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
f9b9db4cb53b402b62374ae430392b63169f78ec
137
py
Python
Chapter 08/ch8_1.py
bpbpublications/TEST-YOUR-SKILLS-IN-PYTHON-LANGUAGE
f6a4194684515495d00aa38347a725dd08f39a0c
[ "MIT" ]
null
null
null
Chapter 08/ch8_1.py
bpbpublications/TEST-YOUR-SKILLS-IN-PYTHON-LANGUAGE
f6a4194684515495d00aa38347a725dd08f39a0c
[ "MIT" ]
null
null
null
Chapter 08/ch8_1.py
bpbpublications/TEST-YOUR-SKILLS-IN-PYTHON-LANGUAGE
f6a4194684515495d00aa38347a725dd08f39a0c
[ "MIT" ]
null
null
null
mywords = ['Krishna', 'Rameshwar Dass', 'Usha', 'Ramesh'] for w in mywords: print(w, end='') #Krishna Rameshwar Dass Usha Ramesh
27.4
58
0.649635
18
137
4.944444
0.611111
0.359551
0.449438
0.539326
0.674157
0
0
0
0
0
0
0
0.189781
137
5
59
27.4
0.801802
0.248175
0
0
0
0
0.313131
0
0
0
0
0
0
1
0
false
0
0
0
0
0.333333
1
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
5
f9baf7eda1c8acf5bf0b18490261ed74ea339eb3
350
py
Python
apex/interfaces.py
timgates42/apex
019b163722731978848efb29436c038a700be589
[ "MIT" ]
null
null
null
apex/interfaces.py
timgates42/apex
019b163722731978848efb29436c038a700be589
[ "MIT" ]
null
null
null
apex/interfaces.py
timgates42/apex
019b163722731978848efb29436c038a700be589
[ "MIT" ]
null
null
null
from zope.interface import implements from zope.interface import Interface class IApex(Interface): """ Class so that we can tell if Apex is installed from other applications """ pass class ApexImplementation(object): """ Class so that we can tell if Apex is installed from other applications """ implements(IApex)
23.333333
66
0.708571
45
350
5.511111
0.466667
0.064516
0.137097
0.185484
0.467742
0.467742
0.467742
0.467742
0.467742
0.467742
0
0
0.228571
350
14
67
25
0.918519
0.408571
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.166667
0.333333
0
0.666667
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
1
0
0
5
ddc061ebdabe5feb0d00d670bc96625645aefa9d
43
py
Python
chapter3/ding.py
chavo1/playground-python
558ba5515cb01b3fdb8123a1df7c6abc0ef6fa20
[ "MIT" ]
null
null
null
chapter3/ding.py
chavo1/playground-python
558ba5515cb01b3fdb8123a1df7c6abc0ef6fa20
[ "MIT" ]
null
null
null
chapter3/ding.py
chavo1/playground-python
558ba5515cb01b3fdb8123a1df7c6abc0ef6fa20
[ "MIT" ]
null
null
null
import snaps snaps.play_sound('ding.wav')
10.75
28
0.767442
7
43
4.571429
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.093023
43
3
29
14.333333
0.820513
0
0
0
0
0
0.186047
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
dddccf902c6bded1454a46072c10058c0c95aa60
361
py
Python
mlctl/interfaces/Hosting.py
LaudateCorpus1/mlctl
0a42035ce9c4999e1b3565ba41fe69d6d3552273
[ "Apache-2.0" ]
24
2021-06-25T04:31:10.000Z
2022-01-12T12:53:42.000Z
mlctl/interfaces/Hosting.py
srivathsanvc/mlctl
0a42035ce9c4999e1b3565ba41fe69d6d3552273
[ "Apache-2.0" ]
14
2021-06-25T04:46:43.000Z
2021-08-19T00:01:42.000Z
mlctl/interfaces/Hosting.py
LaudateCorpus1/mlctl
0a42035ce9c4999e1b3565ba41fe69d6d3552273
[ "Apache-2.0" ]
8
2021-07-16T18:14:17.000Z
2022-02-24T08:05:39.000Z
from abc import ABC, abstractmethod class Hosting(ABC): @abstractmethod def create(self, model_config): pass @abstractmethod def deploy(self, endpoint_name, config): pass @abstractmethod def undeploy(self, endpoint_name): pass @abstractmethod def get_endpoint_info(self, endpoint_name): pass
18.05
47
0.66205
39
361
5.974359
0.461538
0.291845
0.270386
0.23176
0
0
0
0
0
0
0
0
0.268698
361
19
48
19
0.882576
0
0
0.571429
0
0
0
0
0
0
0
0
0
1
0.285714
false
0.285714
0.071429
0
0.428571
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
5
fb1df0ebcb865bca7141b3ee8f232c1ce5a7dafe
45
py
Python
app/__main__.py
bennydictor/httptool
91684575794c7199587a509fcb17543f9942cfbb
[ "MIT" ]
null
null
null
app/__main__.py
bennydictor/httptool
91684575794c7199587a509fcb17543f9942cfbb
[ "MIT" ]
null
null
null
app/__main__.py
bennydictor/httptool
91684575794c7199587a509fcb17543f9942cfbb
[ "MIT" ]
null
null
null
from . import application application.run()
11.25
25
0.777778
5
45
7
0.8
0
0
0
0
0
0
0
0
0
0
0
0.133333
45
3
26
15
0.897436
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
fb24d9ab8ed699b2397b0d1a277425409fb50d33
680
py
Python
vagrant_manager/helpers/vagrant.py
vgrt/vagrant-manager
c1211bc0442a9eb6d120eb00c1c56939813fb5f0
[ "MIT" ]
null
null
null
vagrant_manager/helpers/vagrant.py
vgrt/vagrant-manager
c1211bc0442a9eb6d120eb00c1c56939813fb5f0
[ "MIT" ]
null
null
null
vagrant_manager/helpers/vagrant.py
vgrt/vagrant-manager
c1211bc0442a9eb6d120eb00c1c56939813fb5f0
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- vagrant = 'vagrant' def up(): return '{} up'.format(vagrant) def ssh(): return '{} ssh'.format(vagrant) def suspend(): return '{} suspend'.format(vagrant) def status(): return '{} status'.format(vagrant) def halt(): return '{} halt'.format(vagrant) def destroy(force=False): options = '' if force: options += '--force' return '{} destroy {}'.format(vagrant, options) def share(**kwargs): options = '' name = kwargs.get('name') if name: options += '--name {}'.format(name) if options != '': options = ' ' + options return '{} share{}'.format(vagrant, options)
14.468085
51
0.552941
72
680
5.222222
0.291667
0.242021
0.212766
0
0
0
0
0
0
0
0
0.001972
0.254412
680
46
52
14.782609
0.739645
0.030882
0
0.083333
0
0
0.133942
0
0
0
0
0
0
1
0.291667
false
0
0
0.208333
0.583333
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
fb3dc5190d18182b66660d69490096fe30f8822d
2,905
py
Python
rest_api/migrations/0037_auto_20210226_1502.py
InspectorIncognito/gtfs-editor
4e3245f44ec44aeb2d28aa25786dc95a3193fb81
[ "MIT" ]
2
2021-10-01T16:11:20.000Z
2022-01-15T10:55:40.000Z
rest_api/migrations/0037_auto_20210226_1502.py
InspectorIncognito/gtfs-editor
4e3245f44ec44aeb2d28aa25786dc95a3193fb81
[ "MIT" ]
3
2021-06-10T19:17:55.000Z
2022-03-05T08:37:46.000Z
rest_api/migrations/0037_auto_20210226_1502.py
InspectorIncognito/gtfs-editor
4e3245f44ec44aeb2d28aa25786dc95a3193fb81
[ "MIT" ]
1
2022-03-05T08:37:53.000Z
2022-03-05T08:37:53.000Z
# Generated by Django 3.1.3 on 2021-02-26 18:02 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('rest_api', '0036_auto_20210226_1122'), ] operations = [ migrations.AlterField( model_name='fareattribute', name='agency', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='rest_api.agency'), ), migrations.AlterField( model_name='farerule', name='fare_attribute', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='rest_api.fareattribute'), ), migrations.AlterField( model_name='frequency', name='trip', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='rest_api.trip'), ), migrations.AlterField( model_name='pathway', name='from_stop', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='stop_from', to='rest_api.stop'), ), migrations.AlterField( model_name='pathway', name='to_stop', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='stop_to', to='rest_api.stop'), ), migrations.AlterField( model_name='route', name='agency', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='rest_api.agency'), ), migrations.AlterField( model_name='stoptime', name='stop', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='rest_api.stop'), ), migrations.AlterField( model_name='stoptime', name='trip', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='stop_times', to='rest_api.trip'), ), migrations.AlterField( model_name='transfer', name='from_stop', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='from_stop', to='rest_api.stop'), ), migrations.AlterField( model_name='transfer', name='to_stop', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='to_stop', to='rest_api.stop'), ), migrations.AlterField( model_name='trip', name='route', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='rest_api.route'), ), migrations.AlterField( model_name='trip', name='shape', field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='rest_api.shape'), ), ]
38.733333
128
0.60895
316
2,905
5.424051
0.164557
0.065344
0.106184
0.166861
0.78063
0.78063
0.725204
0.725204
0.613186
0.55951
0
0.014445
0.261274
2,905
74
129
39.256757
0.78425
0.015491
0
0.617647
1
0
0.144507
0.015745
0
0
0
0
0
1
0
false
0
0.029412
0
0.073529
0
0
0
0
null
0
0
1
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
34bb3e107368cd15741c23f195534bf97095a4c4
53
py
Python
arnold_wrapper/util/__init__.py
gr4ph0s/C4DToA_python_wrapper
d1930839b325b301002539779c07577a1d2ae542
[ "MIT" ]
5
2017-12-11T22:38:18.000Z
2021-05-22T09:42:03.000Z
arnold_wrapper/util/__init__.py
gr4ph0s/C4DToA_python_wrapper
d1930839b325b301002539779c07577a1d2ae542
[ "MIT" ]
null
null
null
arnold_wrapper/util/__init__.py
gr4ph0s/C4DToA_python_wrapper
d1930839b325b301002539779c07577a1d2ae542
[ "MIT" ]
null
null
null
from .Const import Const from .Utility import Utility
26.5
28
0.830189
8
53
5.5
0.5
0
0
0
0
0
0
0
0
0
0
0
0.132075
53
2
28
26.5
0.956522
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
34c5a87cadcca6a77f588f1b15074e25e12ae353
140
py
Python
inspector/admin.py
maexe/linspector-web
d5a695445164df31ee69362ffdfb5ca924d054f6
[ "Apache-2.0" ]
5
2019-10-19T03:10:02.000Z
2022-01-19T13:43:14.000Z
inspector/admin.py
maexe/linspector-server
d5a695445164df31ee69362ffdfb5ca924d054f6
[ "Apache-2.0" ]
9
2019-11-11T14:28:45.000Z
2022-02-10T08:43:48.000Z
inspector/admin.py
maexe/linspector-web
d5a695445164df31ee69362ffdfb5ca924d054f6
[ "Apache-2.0" ]
null
null
null
from django.contrib import admin from .models import Language, ProbingTask admin.site.register(Language) admin.site.register(ProbingTask)
20
41
0.828571
18
140
6.444444
0.555556
0.155172
0.293103
0
0
0
0
0
0
0
0
0
0.092857
140
6
42
23.333333
0.913386
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
9b2ea1c68a66640c897c11662a6c2e2552eafd1f
209
py
Python
mlrtvc/src/core/encoder/data_objects/__init__.py
rushic24/Multi-Language-RTVC
f61f79ea119d10c876bd69b825f5cb84c9b66ac8
[ "MIT" ]
9
2021-12-19T07:41:49.000Z
2022-01-28T17:16:32.000Z
mlrtvc/src/core/encoder/data_objects/__init__.py
rushic24/Multi-Language-RTVC
f61f79ea119d10c876bd69b825f5cb84c9b66ac8
[ "MIT" ]
13
2021-12-17T18:57:39.000Z
2022-03-04T12:22:46.000Z
mlrtvc/src/core/encoder/data_objects/__init__.py
rushic24/Multi-Language-RTVC
f61f79ea119d10c876bd69b825f5cb84c9b66ac8
[ "MIT" ]
3
2021-12-21T23:52:55.000Z
2022-01-06T23:08:34.000Z
from core.encoder.data_objects.speaker_verification_dataset import ( SpeakerVerificationDataset, ) from core.encoder.data_objects.speaker_verification_dataset import ( SpeakerVerificationDataLoader, )
29.857143
68
0.84689
20
209
8.55
0.55
0.093567
0.175439
0.222222
0.678363
0.678363
0.678363
0.678363
0.678363
0
0
0
0.095694
209
6
69
34.833333
0.904762
0
0
0.333333
0
0
0
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
9b3fbd74caf9ea4c32aaeede9724570e0b7dfcff
36
py
Python
app/datasources/__init__.py
DataScienceHobbyGroup/nacho-b
e4cfc62f2daa45cb939bb544491cdb1c1a7294ef
[ "MIT" ]
null
null
null
app/datasources/__init__.py
DataScienceHobbyGroup/nacho-b
e4cfc62f2daa45cb939bb544491cdb1c1a7294ef
[ "MIT" ]
1
2021-04-30T22:09:21.000Z
2021-04-30T22:09:21.000Z
app/datasources/__init__.py
DataScienceHobbyGroup/nacho-b
e4cfc62f2daa45cb939bb544491cdb1c1a7294ef
[ "MIT" ]
null
null
null
"""Init file for modularisation."""
18
35
0.694444
4
36
6.25
1
0
0
0
0
0
0
0
0
0
0
0
0.111111
36
1
36
36
0.78125
0.805556
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
9b5986bd365af43f3bd6de09eeee4e61560515df
138
py
Python
zeus/modules/operators/quant/__init__.py
shaido987/vega
14d5d49fb8bdf96bd1f3fcfac201ce6b6712c3b6
[ "MIT" ]
240
2020-08-15T15:11:49.000Z
2022-03-28T07:26:23.000Z
zeus/modules/operators/quant/__init__.py
WholeG/vega
d1ccf1c3ce68a118bdb6775594ceed0f895911e7
[ "MIT" ]
20
2020-08-29T06:18:21.000Z
2022-03-21T04:35:57.000Z
zeus/modules/operators/quant/__init__.py
WholeG/vega
d1ccf1c3ce68a118bdb6775594ceed0f895911e7
[ "MIT" ]
69
2020-08-15T15:41:53.000Z
2022-03-16T08:27:47.000Z
import zeus if zeus.is_tf_backend(): from .tensorflow_quant import * elif zeus.is_torch_backend(): from .pytorch_quant import *
17.25
35
0.73913
20
138
4.8
0.6
0.125
0
0
0
0
0
0
0
0
0
0
0.173913
138
7
36
19.714286
0.842105
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.6
0
0.6
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
9b6e9916bcfc3cca161640160dd6c8fa6fe4c87c
19
py
Python
WH_Utils/Analytics/Prospects/__init__.py
McClain-Thiel/WH_Utils
f81432f57a5a8ed582ddb76f8f11353b3e1ea8bd
[ "Apache-2.0" ]
1
2022-03-28T08:56:24.000Z
2022-03-28T08:56:24.000Z
WH_Utils/Analytics/Prospects/__init__.py
McClain-Thiel/WH_Utils
f81432f57a5a8ed582ddb76f8f11353b3e1ea8bd
[ "Apache-2.0" ]
null
null
null
WH_Utils/Analytics/Prospects/__init__.py
McClain-Thiel/WH_Utils
f81432f57a5a8ed582ddb76f8f11353b3e1ea8bd
[ "Apache-2.0" ]
null
null
null
from .API import *
9.5
18
0.684211
3
19
4.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.210526
19
1
19
19
0.866667
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
0
0
0
5
9b81a5f7010d934c4e02dafb9065cc3f7c772073
94
py
Python
models/__init__.py
hanq0212/IB-GAN
30d7f6e685def9fcf0754edcc63a1ac6e7344638
[ "MIT" ]
3
2021-08-22T06:37:06.000Z
2022-03-30T02:41:01.000Z
models/__init__.py
hanq0212/IB-GAN
30d7f6e685def9fcf0754edcc63a1ac6e7344638
[ "MIT" ]
null
null
null
models/__init__.py
hanq0212/IB-GAN
30d7f6e685def9fcf0754edcc63a1ac6e7344638
[ "MIT" ]
null
null
null
from .base import * from .utils import * from .discriminator import * from .generator import *
23.5
28
0.755319
12
94
5.916667
0.5
0.422535
0
0
0
0
0
0
0
0
0
0
0.159574
94
4
29
23.5
0.898734
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
9b853d3304bd95650cc9a61b6a947d3c1d0be1db
37
py
Python
Uncategorized/python2.py
crackersamdjam/DMOJ-Solutions
97992566595e2c7bf41b5da9217d8ef61bdd1d71
[ "MIT" ]
null
null
null
Uncategorized/python2.py
crackersamdjam/DMOJ-Solutions
97992566595e2c7bf41b5da9217d8ef61bdd1d71
[ "MIT" ]
null
null
null
Uncategorized/python2.py
crackersamdjam/DMOJ-Solutions
97992566595e2c7bf41b5da9217d8ef61bdd1d71
[ "MIT" ]
null
null
null
print(x.__closure__[0].cell_contents)
37
37
0.837838
6
37
4.333333
1
0
0
0
0
0
0
0
0
0
0
0.027027
0
37
1
37
37
0.675676
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
0
1
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
1
0
5
9ba6fec9d1a52b1a9f73c3a187176dcc3e202302
146
py
Python
lab_assignment/lab_exception/assert.py
caru1613/introduction_to_python_TEAMLAB_MOOC
e0ac95f7a6b889e7d18b7bdaaab49820e73d5477
[ "MIT" ]
null
null
null
lab_assignment/lab_exception/assert.py
caru1613/introduction_to_python_TEAMLAB_MOOC
e0ac95f7a6b889e7d18b7bdaaab49820e73d5477
[ "MIT" ]
null
null
null
lab_assignment/lab_exception/assert.py
caru1613/introduction_to_python_TEAMLAB_MOOC
e0ac95f7a6b889e7d18b7bdaaab49820e73d5477
[ "MIT" ]
null
null
null
def get_binary_nmubmer(decimal_number): assert isinstance(decimal_number, int) return bin(decimal_number) print(get_binary_nmubmer(10.5))
29.2
42
0.80137
21
146
5.238095
0.666667
0.354545
0.290909
0
0
0
0
0
0
0
0
0.023077
0.109589
146
5
43
29.2
0.823077
0
0
0
0
0
0
0
0
0
0
0
0.25
1
0.25
false
0
0
0
0.5
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
1
0
0
0
0
0
0
0
5
9bbe59ff9854c9e2eb94d5f1bfec92b3dd490ed9
78
py
Python
DevOlogy/frontend/views.py
Python-Freak/DevOlogy
94bd21cecce956bb6b9d344eaf903c7519f13116
[ "MIT" ]
1
2021-11-02T13:37:32.000Z
2021-11-02T13:37:32.000Z
DevOlogy/frontend/views.py
Python-Freak/DevOlogy
94bd21cecce956bb6b9d344eaf903c7519f13116
[ "MIT" ]
null
null
null
DevOlogy/frontend/views.py
Python-Freak/DevOlogy
94bd21cecce956bb6b9d344eaf903c7519f13116
[ "MIT" ]
null
null
null
from django.shortcuts import render, redirect # Create your views here.
8.666667
45
0.74359
10
78
5.8
1
0
0
0
0
0
0
0
0
0
0
0
0.205128
78
8
46
9.75
0.935484
0.294872
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
1
0
0
5
32fa8429347462321eb80123c4c3ea6f17ca2d16
195
py
Python
pytorch_tools/segmentation_models/__init__.py
YevheniiSemendiak/pytorch-tools
11f895ac7af796ca786a3d94bb46de70d7fce87a
[ "MIT" ]
155
2019-11-06T14:05:32.000Z
2022-03-24T11:12:19.000Z
pytorch_tools/segmentation_models/__init__.py
YevheniiSemendiak/pytorch-tools
11f895ac7af796ca786a3d94bb46de70d7fce87a
[ "MIT" ]
41
2019-11-01T21:41:51.000Z
2021-07-19T12:53:39.000Z
pytorch_tools/segmentation_models/__init__.py
YevheniiSemendiak/pytorch-tools
11f895ac7af796ca786a3d94bb46de70d7fce87a
[ "MIT" ]
15
2019-12-07T19:09:18.000Z
2021-09-27T19:17:55.000Z
from .unet import Unet from .linknet import Linknet from .deeplabv3_plus import DeepLabV3 from .segm_fpn import SegmentationFPN from .segm_bifpn import SegmentationBiFPN from .hrnet import HRNet
27.857143
41
0.846154
27
195
6
0.444444
0.098765
0
0
0
0
0
0
0
0
0
0.011696
0.123077
195
6
42
32.5
0.935673
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
fd2d17a53ad0b5b25a88a66aba9ed96fcd4d203f
38
py
Python
evolocity/pp.py
samsledje/evolocity
2b162ff61d4239ba5af06a601e5bb62f501d4a0f
[ "MIT" ]
25
2021-06-03T22:51:24.000Z
2022-03-18T09:38:42.000Z
evolocity/pp.py
samsledje/evolocity
2b162ff61d4239ba5af06a601e5bb62f501d4a0f
[ "MIT" ]
7
2021-07-11T17:20:24.000Z
2022-03-17T02:31:13.000Z
evolocity/pp.py
samsledje/evolocity
2b162ff61d4239ba5af06a601e5bb62f501d4a0f
[ "MIT" ]
5
2021-06-08T18:39:14.000Z
2022-03-11T12:55:33.000Z
from evolocity.preprocessing import *
19
37
0.842105
4
38
8
1
0
0
0
0
0
0
0
0
0
0
0
0.105263
38
1
38
38
0.941176
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
0
0
0
5
b5bbfea32382d4b3bb84b51ac14db7ee7e23bfb8
129
py
Python
ojos/decorator/__init__.py
ojos/python-core
d43f99d31c99493f0966ba7020bdc40f2dc2ed2e
[ "MIT" ]
null
null
null
ojos/decorator/__init__.py
ojos/python-core
d43f99d31c99493f0966ba7020bdc40f2dc2ed2e
[ "MIT" ]
null
null
null
ojos/decorator/__init__.py
ojos/python-core
d43f99d31c99493f0966ba7020bdc40f2dc2ed2e
[ "MIT" ]
null
null
null
from .logging import logging from .retry import retry, retry_handler __all__ = [ 'logging', 'retry', 'retry_handler', ]
16.125
39
0.689922
15
129
5.533333
0.4
0.240964
0.409639
0
0
0
0
0
0
0
0
0
0.193798
129
7
40
18.428571
0.798077
0
0
0
0
0
0.193798
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
bd3563acf470c5172e22d829b0f2bd228266cfc6
102
py
Python
unet3d/model/__init__.py
vuhoangminh/medical-segmentation
4a2a663d1f2d6de5c78bc521f6ed2aa1681a8804
[ "MIT" ]
1
2018-12-06T09:17:26.000Z
2018-12-06T09:17:26.000Z
unet3d/model/__init__.py
vuhoangminh/medical-segmentation
4a2a663d1f2d6de5c78bc521f6ed2aa1681a8804
[ "MIT" ]
null
null
null
unet3d/model/__init__.py
vuhoangminh/medical-segmentation
4a2a663d1f2d6de5c78bc521f6ed2aa1681a8804
[ "MIT" ]
2
2019-05-07T10:07:33.000Z
2019-05-20T12:50:37.000Z
from .unet import unet_model_3d from .isensee3d import isensee2017_model from .segnet import segnet3d
25.5
40
0.852941
15
102
5.6
0.6
0
0
0
0
0
0
0
0
0
0
0.077778
0.117647
102
3
41
34
0.855556
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
bd38fe7486d7ac37695d5ea2e3e790bf6bf40126
798
py
Python
aiotdlib/api/functions/get_password_state.py
jraylan/aiotdlib
4528fcfca7c5c69b54a878ce6ce60e934a2dcc73
[ "MIT" ]
37
2021-05-04T10:41:41.000Z
2022-03-30T13:48:05.000Z
aiotdlib/api/functions/get_password_state.py
jraylan/aiotdlib
4528fcfca7c5c69b54a878ce6ce60e934a2dcc73
[ "MIT" ]
13
2021-07-17T19:54:51.000Z
2022-02-26T06:50:00.000Z
aiotdlib/api/functions/get_password_state.py
jraylan/aiotdlib
4528fcfca7c5c69b54a878ce6ce60e934a2dcc73
[ "MIT" ]
7
2021-09-22T21:27:11.000Z
2022-02-20T02:33:19.000Z
# =============================================================================== # # # # This file has been generated automatically!! Do not change this manually! # # # # =============================================================================== # from __future__ import annotations from pydantic import Field from ..base_object import BaseObject class GetPasswordState(BaseObject): """ Returns the current state of 2-step verification """ ID: str = Field("getPasswordState", alias="@type") @staticmethod def read(q: dict) -> GetPasswordState: return GetPasswordState.construct(**q)
33.25
83
0.406015
51
798
6.254902
0.784314
0
0
0
0
0
0
0
0
0
0
0.001887
0.33584
798
23
84
34.695652
0.6
0.567669
0
0
1
0
0.066879
0
0
0
0
0
0
1
0.125
false
0.5
0.375
0.125
0.875
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
0
0
1
1
1
1
0
0
5
1fe344f2b14a4b0b1ff80ef42413908666f40fac
181
py
Python
infra_validation_engine/utils/constants.py
boris-vasilev/simple_grid_infra_validation_engine
66a1410ca42718d559fd12e1e99dbcbc64457645
[ "Apache-2.0" ]
null
null
null
infra_validation_engine/utils/constants.py
boris-vasilev/simple_grid_infra_validation_engine
66a1410ca42718d559fd12e1e99dbcbc64457645
[ "Apache-2.0" ]
null
null
null
infra_validation_engine/utils/constants.py
boris-vasilev/simple_grid_infra_validation_engine
66a1410ca42718d559fd12e1e99dbcbc64457645
[ "Apache-2.0" ]
null
null
null
class Constants: def __init__(self): pass SIMPLE_CONFIG_DIR = "/etc/simple_grid" GIT_PKG_NAME = "git" DOCKER_PKG_NAME = "docker" BOLT_PKG_NAME = "bolt"
20.111111
42
0.646409
24
181
4.333333
0.666667
0.201923
0
0
0
0
0
0
0
0
0
0
0.254144
181
8
43
22.625
0.77037
0
0
0
0
0
0.160221
0
0
0
0
0
0
1
0.142857
false
0.142857
0
0
0.857143
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
5
9507d37a2e0fcf57f6bec30b5fc0f27cec02aa4e
2,296
py
Python
sandbox/plot/powerspectrum-flash.py
jmark/turbubox
17fd3214ad4cb0c360bdb628d7bd270e8b00aadc
[ "MIT" ]
null
null
null
sandbox/plot/powerspectrum-flash.py
jmark/turbubox
17fd3214ad4cb0c360bdb628d7bd270e8b00aadc
[ "MIT" ]
null
null
null
sandbox/plot/powerspectrum-flash.py
jmark/turbubox
17fd3214ad4cb0c360bdb628d7bd270e8b00aadc
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 from matplotlib import pylab as plt from mpl_toolkits.mplot3d import axes3d import sys import numpy as np from numpy.fft import rfftn, fftshift import flash as FLASH from shellavg import shell_avg_3d import ulz sys.argv.reverse() progpath = sys.argv.pop() flsfp = sys.argv.pop() flsfp2 = sys.argv.pop() sinkfp = sys.argv.pop() flash = FLASH.File(flsfp) time = flash.realscalars['time'] #step = flash.integerscalars['nstep'] c_s = flash.realruntime['c_ambient'] rho0 = flash.realruntime['rho_ambient'] # c_s = flash.realruntime['sim_cambient'] # rho0 = flash.realruntime['sim_rhoambient'] Vgrid = np.prod(flash.gridsize) Vcell = np.prod(flash.cellsize) Vdomain = np.prod(flash.domainsize) density = flash.data('dens') velocity = tuple(flash.data('vel'+dim) for dim in 'x y z'.split()) #ekin = 0.5*Vcell*density * ulz.norm(*velocity) #fekin = fftshift(np.abs(rfftn(ekin))) #input = density**(1/3) * np.sqrt(ulz.norm(*velocity)) input = np.sqrt(ulz.norm(*velocity)) #vels = ulz.norm(*velocity) fvels = fftshift(np.abs(rfftn(input))) nsamples = 200 radii,totals = shell_avg_3d(fvels**2, nsamples) rs = radii[1:] ps = rs**2 * totals[1:] plt.grid() plt.xlim(1,1000) xs = rs ys = ps/rs**(-5/3) plt.loglog(xs,ys, '-', label='b3') ######################### flash = FLASH.File(flsfp2) time = flash.realscalars['time'] #step = flash.integerscalars['nstep'] c_s = flash.realruntime['c_ambient'] rho0 = flash.realruntime['rho_ambient'] # c_s = flash.realruntime['sim_cambient'] # rho0 = flash.realruntime['sim_rhoambient'] Vgrid = np.prod(flash.gridsize) Vcell = np.prod(flash.cellsize) Vdomain = np.prod(flash.domainsize) density = flash.data('dens') velocity = tuple(flash.data('vel'+dim) for dim in 'x y z'.split()) #ekin = 0.5*Vcell*density * ulz.norm(*velocity) #fekin = fftshift(np.abs(rfftn(ekin))) #input = density**(1/3) * np.sqrt(ulz.norm(*velocity)) input = np.sqrt(ulz.norm(*velocity)) #vels = ulz.norm(*velocity) fvels = fftshift(np.abs(rfftn(input))) nsamples = 200 radii,totals = shell_avg_3d(fvels**2, nsamples) rs = radii[1:] ps = rs**2 * totals[1:] ######################### xs = rs ys = ps/rs**(-2) plt.loglog(xs,ys, '-', label='b5') plt.legend(loc='upper right') plt.savefig(sinkfp,bbox_inches='tight')
22.076923
67
0.675523
347
2,296
4.412104
0.299712
0.083605
0.07838
0.047028
0.747224
0.710647
0.710647
0.710647
0.710647
0.710647
0
0.022
0.12892
2,296
103
68
22.291262
0.7435
0.257404
0
0.566038
0
0
0.057317
0
0
0
0
0
0
1
0
false
0
0.150943
0
0.150943
0
0
0
0
null
0
0
0
0
1
1
1
1
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
5
950f92628f668d489a806d8dd9fc22fff587fd31
4,087
py
Python
build/lib/BAARFormatConverter/converter.py
xuzhaoyu/BAARFormatConverter
8e479a076a098b88cdb7c2c13927f370a3f8568b
[ "MIT" ]
1
2021-06-04T09:36:45.000Z
2021-06-04T09:36:45.000Z
src/BAARFormatConverter/converter.py
xuzhaoyu/BAARFormatConverter
8e479a076a098b88cdb7c2c13927f370a3f8568b
[ "MIT" ]
null
null
null
src/BAARFormatConverter/converter.py
xuzhaoyu/BAARFormatConverter
8e479a076a098b88cdb7c2c13927f370a3f8568b
[ "MIT" ]
null
null
null
def read_convert(input: str) -> list: dict_list = [] input = input.split("__::__") for lines in input: line_dict = {} line = lines.split("__$$__") for l in line: dict_value = l.split("__=__") key = dict_value[0] if len(dict_value) == 1: value = "" else: value = dict_value[1] line_dict[key] = value dict_list.append(line_dict) return dict_list def write_convert(input: list) -> str: output_str = "" for dicts in input: for key, value in dicts.items(): output_str = output_str + key + "__=__" + value output_str = output_str + "__$$__" output_str = output_str[:len(output_str) - 6] output_str = output_str + "__::__" output_str = output_str[:len(output_str) - 6] return output_str if __name__ == "__main__": loans = "Processor__=____$$__Loan_Number__=__2501507794__$$__Underwriter__=____$$__Borrower__=__CREDCO,BARRY__$$__Purpose__=__Construction/Perm__$$__Loan_Type__=__Conventional-Conf__$$__Est_Closing_Date__=__2020-09-25 00:00:00__$$__Program__=__One Close Construction Conf__$$__processor_manager__=__No contact selected__$$__underwriter_manager__=__No contact selected__$$__e_consent__=____$$__processor_note__=____$$__investor_category__=__PPB__$$__risk_level__=__3__$$__sample_status__=____$$__rush_status__=____$$__type__=__New__$$__sampled_date__=__2021-03-25 12:21:58.0__$$__update_date__=__2021-03-25 12:21:58.0__$$____::__Processor__=__Carmen Medrano__$$__Loan_Number__=__2501666460__$$__Underwriter__=__Erica Lopes__$$__Borrower__=__Credco,Barry__$$__Purpose__=__Purchase__$$__Loan_Type__=__Conventional-Conf__$$__Est_Closing_Date__=__2021-03-29 00:00:00__$$__Program__=__Conf__$$__processor_manager__=__No contact selected__$$__underwriter_manager__=__Joy Swift-Greiff__$$__e_consent__=____$$__processor_note__=____$$__investor_category__=__PCB__$$__risk_level__=__1__$$__sample_status__=____$$__rush_status__=____$$__type__=__New__$$__sampled_date__=__2021-03-25 12:21:58.0__$$__update_date__=__2021-03-25 12:21:58.0__::__Processor__=____$$__Loan_Number__=__2501679729__$$__Underwriter__=____$$__Borrower__=__Credco,Barry__$$__Purpose__=__Refinance__$$__Loan_Type__=__Conventional-Conf__$$__Est_Closing_Date__=__2021-04-24 00:00:00__$$__Program__=__BMO Harris ReadyLine Conf__$$__processor_manager__=__No contact selected__$$__underwriter_manager__=__No contact selected__$$__e_consent__=____$$__processor_note__=____$$__investor_category__=__SMU__$$__risk_level__=__1__$$__sample_status__=____$$__rush_status__=____$$__type__=__New__$$__sampled_date__=__2021-03-25 12:21:58.0__$$__update_date__=__2021-03-25 12:21:58.0__::__Processor__=____$$__Loan_Number__=__2501682907__$$__Underwriter__=____$$__Borrower__=__Firstimer,Alice__$$__Purpose__=__Purchase__$$__Loan_Type__=__Conventional-Conf__$$__Est_Closing_Date__=__2021-05-01 00:00:00__$$__Program__=__BMO Harris ReadyLine Conf__$$__processor_manager__=__No contact selected__$$__underwriter_manager__=__No contact selected__$$__e_consent__=____$$__processor_note__=____$$__investor_category__=__PCB__$$__risk_level__=__1__$$__sample_status__=____$$__rush_status__=____$$__type__=__New__$$__sampled_date__=__2021-03-25 12:21:58.0__$$__update_date__=__2021-03-25 12:21:58.0__::__Processor__=__Carmen Medrano__$$__Loan_Number__=__2501682635__$$__Underwriter__=____$$__Borrower__=__Credco,Barry__$$__Purpose__=__Purchase__$$__Loan_Type__=__Conventional-Conf__$$__Est_Closing_Date__=__2021-04-30 00:00:00__$$__Program__=__Conf__$$__processor_manager__=__No contact selected__$$__underwriter_manager__=__No contact selected__$$__e_consent__=____$$__processor_note__=____$$__investor_category__=__SMU__$$__risk_level__=__1__$$__sample_status__=____$$__rush_status__=____$$__type__=__New__$$__sampled_date__=__2021-03-25 12:21:58.0__$$__update_date__=__2021-03-25 12:21:58.0" dicts = read_convert(loans) outputstr = write_convert(dicts) converted = read_convert(outputstr) print(dicts == converted)
113.527778
3,033
0.784194
486
4,087
4.761317
0.220165
0.054451
0.047537
0.051858
0.711322
0.674589
0.674589
0.658168
0.658168
0.638289
0
0.075696
0.094935
4,087
36
3,034
113.527778
0.549878
0
0
0.0625
0
0.03125
0.748777
0.697896
0
0
0
0
0
1
0.0625
false
0
0
0
0.125
0.03125
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
1
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
1f2c3a2b68515dbb833e3a571db55d1c547332a1
12,813
py
Python
model/option_gail.py
id9502/Option-GAIL
73ee70f097e272e00e482bff8cff558370f90ab6
[ "MIT" ]
9
2021-06-09T07:13:58.000Z
2022-03-23T08:57:08.000Z
model/option_gail.py
id9502/Option-GAIL
73ee70f097e272e00e482bff8cff558370f90ab6
[ "MIT" ]
3
2021-08-11T08:56:02.000Z
2021-12-27T03:08:48.000Z
model/option_gail.py
id9502/Option-GAIL
73ee70f097e272e00e482bff8cff558370f90ab6
[ "MIT" ]
3
2021-08-12T11:19:20.000Z
2022-03-23T08:57:27.000Z
import torch import torch.nn.functional as F from .option_policy import OptionPolicy, Policy, MoEPolicy from .option_discriminator import OptionDiscriminator, Discriminator, MoEDiscriminator from utils.config import Config class GAIL(torch.nn.Module): def __init__(self, config: Config, dim_s=2, dim_a=2): super(GAIL, self).__init__() self.dim_a = dim_a self.dim_s = dim_s self.device = torch.device(config.device) self.mini_bs = config.mini_batch_size lr = config.optimizer_lr_discriminator self.discriminator = Discriminator(config, dim_s=dim_s, dim_a=dim_a) self.policy = Policy(config, dim_s=self.dim_s, dim_a=self.dim_a) self.optim = torch.optim.Adam(self.discriminator.parameters(), lr=lr, weight_decay=1.e-3) self.to(self.device) def gail_reward(self, s, a): d = self.discriminator.get_unnormed_d(s, a) reward = -F.logsigmoid(d) return reward def step_original_gan(self, sample_sar, demo_sar, n_step=10): sp = torch.cat([s for s, a, r in sample_sar], dim=0) se = torch.cat([s for s, a, r in demo_sar], dim=0) ap = torch.cat([a for s, a, r in sample_sar], dim=0) ae = torch.cat([a for s, a, r in demo_sar], dim=0) tp = torch.ones(self.mini_bs, 1, dtype=torch.float32, device=self.device) te = torch.zeros(self.mini_bs, 1, dtype=torch.float32, device=self.device) for _ in range(n_step): inds = torch.randperm(sp.size(0), device=self.device) for ind_p in inds.split(self.mini_bs): sp_b, ap_b, tp_b = sp[ind_p], ap[ind_p], tp[:ind_p.size(0)] ind_e = torch.randperm(se.size(0), device=self.device)[:ind_p.size(0)] se_b, ae_b, te_b = se[ind_e], ae[ind_e], te[:ind_p.size(0)] s_array = torch.cat((sp_b, se_b), dim=0) a_array = torch.cat((ap_b, ae_b), dim=0) t_array = torch.cat((tp_b, te_b), dim=0) for _ in range(3): src = self.discriminator.get_unnormed_d(s_array, a_array) loss = F.binary_cross_entropy_with_logits(src, t_array) self.optim.zero_grad() loss.backward() self.optim.step() def step_wgail_gp(self, sample_sar, demo_sar, n_step=10): sp = torch.cat([s for s, a, r in sample_sar], dim=0) se = torch.cat([s for s, a, r in demo_sar], dim=0) ap = torch.cat([a for s, a, r in sample_sar], dim=0) ae = torch.cat([a for s, a, r in demo_sar], dim=0) for _ in range(n_step): inds = torch.randperm(sp.size(0), device=self.device) for ind_p in inds.split(self.mini_bs): sp_b, ap_b = sp[ind_p], ap[ind_p] ind_e = torch.randperm(se.size(0), device=self.device)[:ind_p.size(0)] se_b, ae_b = se[ind_e], ae[ind_e] for _ in range(3): Wasserstein_D = self.discriminator.get_unnormed_d(sp_b, ap_b).mean() \ - self.discriminator.get_unnormed_d(se_b, ae_b).mean() alpha = torch.rand(sp_b.size(0), 1, dtype=torch.float32, device=self.device) inter_s = alpha * se_b + (1 - alpha) * sp_b inter_a = alpha * ae_b + (1 - alpha) * ap_b gradient_penalty = self.discriminator.gradient_penalty(inter_s, inter_a) loss = Wasserstein_D + gradient_penalty self.optim.zero_grad() loss.backward() self.optim.step() def step(self, sample_sar, demo_sar, n_step=10): return self.step_original_gan(sample_sar, demo_sar, n_step) def convert_demo(self, demo_sa): with torch.no_grad(): out_sample = [] r_sum_avg = 0. for s_array, a_array in demo_sa: r_fake_array = self.gail_reward(s_array, a_array) out_sample.append((s_array, a_array, r_fake_array)) r_sum_avg += r_fake_array.sum().item() r_sum_avg /= len(demo_sa) return out_sample, r_sum_avg def convert_sample(self, sample_sar): with torch.no_grad(): out_sample = [] r_sum_avg = 0. for s_array, a_array, r_real_array in sample_sar: r_fake_array = self.gail_reward(s_array, a_array) out_sample.append((s_array, a_array, r_fake_array)) r_sum_avg += r_real_array.sum().item() r_sum_avg /= len(sample_sar) return out_sample, r_sum_avg class OptionGAIL(torch.nn.Module): def __init__(self, config: Config, dim_s=2, dim_a=2): super(OptionGAIL, self).__init__() self.dim_a = dim_a self.dim_s = dim_s self.dim_c = config.dim_c self.with_c = config.use_c_in_discriminator self.mini_bs = config.mini_batch_size self.use_d_info_gail = config.use_d_info_gail self.device = torch.device(config.device) self.discriminator = OptionDiscriminator(config, dim_s=dim_s, dim_a=dim_a) self.policy = OptionPolicy(config, dim_s=self.dim_s, dim_a=self.dim_a) self.optim = torch.optim.Adam(self.discriminator.parameters(), weight_decay=1.e-3) self.to(self.device) def original_gail_reward(self, s, c_1, a, c): d = self.discriminator.get_unnormed_d(s, c_1, a, c) reward = -F.logsigmoid(d) return reward def d_info_gail_reward(self, s, c_1, a, c): d = self.discriminator.get_unnormed_d(s, c_1, a, c) # la, lb, _, _, _ = self.policy.log_alpha_beta(s, a) # logpc = (la + lb).log_softmax(dim=-1).gather(dim=-1, index=c) reward = -F.logsigmoid(d) reward += 0.001 * self.policy.log_prob_option(s, c_1, c) return reward def gail_reward(self, s, c_1, a, c): if not self.use_d_info_gail: return self.original_gail_reward(s, c_1, a, c) else: return self.d_info_gail_reward(s, c_1, a, c) def step_original_gan(self, sample_scar, demo_scar, n_step=10): sp = torch.cat([s for s, c, a, r in sample_scar], dim=0) se = torch.cat([s for s, c, a, r in demo_scar], dim=0) c_1p = torch.cat([c[:-1] for s, c, a, r in sample_scar], dim=0) c_1e = torch.cat([c[:-1] for s, c, a, r in demo_scar], dim=0) cp = torch.cat([c[1:] for s, c, a, r in sample_scar], dim=0) ce = torch.cat([c[1:] for s, c, a, r in demo_scar], dim=0) ap = torch.cat([a for s, c, a, r in sample_scar], dim=0) ae = torch.cat([a for s, c, a, r in demo_scar], dim=0) tp = torch.ones(self.mini_bs, 1, dtype=torch.float32, device=self.device) te = torch.zeros(self.mini_bs, 1, dtype=torch.float32, device=self.device) for _ in range(n_step): inds = torch.randperm(sp.size(0), device=self.device) for ind_p in inds.split(self.mini_bs): sp_b, cp_1b, ap_b, cp_b, tp_b = sp[ind_p], c_1p[ind_p], ap[ind_p], cp[ind_p], tp[:ind_p.size(0)] ind_e = torch.randperm(se.size(0), device=self.device)[:ind_p.size(0)] se_b, ce_1b, ae_b, ce_b, te_b = se[ind_e], c_1e[ind_e], ae[ind_e], ce[ind_e], te[:ind_p.size(0)] s_array = torch.cat((sp_b, se_b), dim=0) a_array = torch.cat((ap_b, ae_b), dim=0) c_1array = torch.cat((cp_1b, ce_1b), dim=0) c_array = torch.cat((cp_b, ce_b), dim=0) t_array = torch.cat((tp_b, te_b), dim=0) for _ in range(3): src = self.discriminator.get_unnormed_d(s_array, c_1array, a_array, c_array) loss = F.binary_cross_entropy_with_logits(src, t_array) self.optim.zero_grad() loss.backward() self.optim.step() def step(self, sample_sar, demo_sar, n_step=10): return self.step_original_gan(sample_sar, demo_sar, n_step) def convert_demo(self, demo_sa): with torch.no_grad(): out_sample = [] r_sum_avg = 0. for s_array, a_array in demo_sa: if self.with_c: c_array, _ = self.policy.viterbi_path(s_array, a_array) else: c_array = torch.zeros(s_array.size(0)+1, 1, dtype=torch.long, device=self.device) r_array = self.gail_reward(s_array, c_array[:-1], a_array, c_array[1:]) out_sample.append((s_array, c_array, a_array, r_array)) r_sum_avg += r_array.sum().item() r_sum_avg /= len(demo_sa) return out_sample, r_sum_avg def convert_sample(self, sample_scar): with torch.no_grad(): out_sample = [] r_sum_avg = 0. for s_array, c_array, a_array, r_real_array in sample_scar: r_fake_array = self.gail_reward(s_array, c_array[:-1], a_array, c_array[1:]) out_sample.append((s_array, c_array, a_array, r_fake_array)) r_sum_avg += r_real_array.sum().item() r_sum_avg /= len(sample_scar) return out_sample, r_sum_avg class MoEGAIL(torch.nn.Module): def __init__(self, config: Config, dim_s=2, dim_a=2): super(MoEGAIL, self).__init__() self.dim_a = dim_a self.dim_s = dim_s self.dim_c = config.dim_c self.mini_bs = config.mini_batch_size self.device = torch.device(config.device) self.discriminator = MoEDiscriminator(config, dim_s=dim_s) self.policy = MoEPolicy(config, dim_s=self.dim_s, dim_a=self.dim_a) self.optim = torch.optim.Adam(list(self.discriminator.parameters()) + self.policy.get_param(low_policy=False), weight_decay=1.e-3) self.to(self.device) def original_gail_reward(self, s): # N x 1 d = self.discriminator.get_unnormed_d(s) # N x C x 1 weight = self.policy.mix(s) # N x C x 1 reward = -(F.logsigmoid(d) * weight).sum(dim=-2) return reward def gail_reward(self, s): # N x 1 return self.original_gail_reward(s) def step_original_gan(self, sample_sar, demo_sar, n_step=10): sp = torch.cat([s for s, a, r in sample_sar], dim=0) se = torch.cat([s for s, a, r in demo_sar], dim=0) tp = torch.ones(self.mini_bs, self.dim_c, dtype=torch.float32, device=self.device) te = torch.zeros(self.mini_bs, self.dim_c, dtype=torch.float32, device=self.device) for _ in range(n_step): inds = torch.randperm(sp.size(0), device=self.device) for ind_p in inds.split(self.mini_bs): sp_b, tp_b = sp[ind_p], tp[:ind_p.size(0)] ind_e = torch.randperm(se.size(0), device=self.device)[:ind_p.size(0)] se_b, te_b = se[ind_e], te[:ind_p.size(0)] s_array = torch.cat((sp_b, se_b), dim=0) t_array = torch.cat((tp_b, te_b), dim=0) for _ in range(3): w_array = self.policy.mix(s_array).squeeze(dim=-1) # N x C src = self.discriminator.get_unnormed_d(s_array).squeeze(dim=-1) # N x C loss = (F.binary_cross_entropy_with_logits(src, t_array, reduction='none') * w_array).mean(dim=-2).sum() lb = (w_array.mean(dim=0) - 0.5).square().sum() le = (w_array.mean(dim=1) - 0.5).square().mean() lv = -((w_array - w_array.mean(dim=0, keepdim=True)).mean(dim=0)).sum() loss = loss + 0.01 * lb + 10.0 * le + 1.0 * lv self.optim.zero_grad() loss.backward() self.optim.step() def step(self, sample_sar, demo_sar, n_step=10): return self.step_original_gan(sample_sar, demo_sar, n_step) def convert_demo(self, demo_sa): with torch.no_grad(): out_sample = [] r_sum_avg = 0. for s_array, a_array in demo_sa: r_array = self.gail_reward(s_array) out_sample.append((s_array, a_array, r_array)) r_sum_avg += r_array.sum().item() r_sum_avg /= len(demo_sa) return out_sample, r_sum_avg def convert_sample(self, sample_sar): with torch.no_grad(): out_sample = [] r_sum_avg = 0. for s_array, a_array, r_real_array in sample_sar: r_fake_array = self.gail_reward(s_array) out_sample.append((s_array, a_array, r_fake_array)) r_sum_avg += r_real_array.sum().item() r_sum_avg /= len(sample_sar) return out_sample, r_sum_avg
45.43617
138
0.580426
2,037
12,813
3.372116
0.076583
0.018052
0.024458
0.022711
0.817295
0.794439
0.772602
0.718154
0.676081
0.66953
0
0.018049
0.295169
12,813
281
139
45.597865
0.742553
0.012175
0
0.615385
0
0
0.000316
0
0
0
0
0
0
1
0.094017
false
0
0.021368
0.017094
0.196581
0
0
0
0
null
0
0
0
1
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
5
1f35430ad6e0b51ffdda3725dab4939a4725f5b3
92
py
Python
vip/admin.py
jhihwei/eshop
e9861e9a2ee084201ecd36bed628cf50e9dbeb7e
[ "Apache-2.0" ]
null
null
null
vip/admin.py
jhihwei/eshop
e9861e9a2ee084201ecd36bed628cf50e9dbeb7e
[ "Apache-2.0" ]
null
null
null
vip/admin.py
jhihwei/eshop
e9861e9a2ee084201ecd36bed628cf50e9dbeb7e
[ "Apache-2.0" ]
null
null
null
from django.contrib import admin from .models import VIP_User admin.site.register(VIP_User)
23
32
0.836957
15
92
5
0.666667
0.186667
0
0
0
0
0
0
0
0
0
0
0.097826
92
4
33
23
0.903614
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
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
1
0
1
0
1
0
0
5
1f41d8d43b9fc1492c3a2c2f9cb8a62b89ca434d
285
py
Python
Products/__init__.py
zms-publishing/Products.zms-skins
fcf7693aeeb0b09544fd9710a060ae227d253e0e
[ "MIT" ]
null
null
null
Products/__init__.py
zms-publishing/Products.zms-skins
fcf7693aeeb0b09544fd9710a060ae227d253e0e
[ "MIT" ]
null
null
null
Products/__init__.py
zms-publishing/Products.zms-skins
fcf7693aeeb0b09544fd9710a060ae227d253e0e
[ "MIT" ]
null
null
null
# @see https://setuptools.readthedocs.io/en/latest/setuptools.html?highlight=namespace%20packages#namespace-packages # @see https://packaging.python.org/guides/packaging-namespace-packages/#pkg-resources-style-namespace-packages __import__("pkg_resources").declare_namespace(__name__)
71.25
116
0.835088
34
285
6.705882
0.647059
0.223684
0
0
0
0
0
0
0
0
0
0.007194
0.024561
285
3
117
95
0.81295
0.778947
0
0
0
0
0.224138
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
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
5
1f7dc2a3113dfd5f8aa0d97e3c502f866e0aec69
96
py
Python
venv/lib/python3.8/site-packages/rope/refactor/extract.py
Retraces/UkraineBot
3d5d7f8aaa58fa0cb8b98733b8808e5dfbdb8b71
[ "MIT" ]
2
2022-03-13T01:58:52.000Z
2022-03-31T06:07:54.000Z
venv/lib/python3.8/site-packages/rope/refactor/extract.py
DesmoSearch/Desmobot
b70b45df3485351f471080deb5c785c4bc5c4beb
[ "MIT" ]
19
2021-11-20T04:09:18.000Z
2022-03-23T15:05:55.000Z
venv/lib/python3.8/site-packages/rope/refactor/extract.py
DesmoSearch/Desmobot
b70b45df3485351f471080deb5c785c4bc5c4beb
[ "MIT" ]
null
null
null
/home/runner/.cache/pip/pool/03/5d/73/bf11ad8cbb2433eafbeb5403b0b1ea0db92962c094d0b91f4976933dbb
96
96
0.895833
9
96
9.555556
1
0
0
0
0
0
0
0
0
0
0
0.385417
0
96
1
96
96
0.510417
0
0
0
0
0
0
0
0
1
0
0
0
0
null
null
0
0
null
null
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
null
1
0
0
0
1
0
0
0
0
0
0
0
0
5
1f94fdfa605c8b25a50c57cdfe1968ce12115147
3,393
py
Python
spam.py
sweden-moose/Forum-spammer
09871f0bcfba51d79b9cc496530cd7170c65e45b
[ "MIT" ]
1
2020-12-26T13:57:22.000Z
2020-12-26T13:57:22.000Z
spam.py
sweden-moose/Forum-spammer
09871f0bcfba51d79b9cc496530cd7170c65e45b
[ "MIT" ]
null
null
null
spam.py
sweden-moose/Forum-spammer
09871f0bcfba51d79b9cc496530cd7170c65e45b
[ "MIT" ]
null
null
null
from bs4 import BeautifulSoup from selenium import webdriver import time import random import getlinks logins = ['capcha_remake1', 'capcha_remake2', 'capcha_remake3'] f = open("proxy.txt", 'r') proxies = f.read().split('\n') f.close() qst = {'8+8=': '16', 'Самая большая страна мира по площади?': 'Россия', 'Имя первого космонавта?': 'Юра', 'Как называется наша планета?': 'Земля', '2+2=': '4', 'Что светит в небе?': 'Солнце'} mes = 'Пионер! Поменяй капчу!!!' again = [] firefox_capabilities = webdriver.DesiredCapabilities.FIREFOX firefox_capabilities['marionette'] = True proxy = random.choice(proxies) print(proxy) firefox_capabilities['proxy'] = { "proxyType": "MANUAL", "httpProxy": proxy, "ftpProxy": proxy, "sslProxy": proxy } def change_prox(): proxy = random.choice(proxies) print(proxy) firefox_capabilities['proxy'] = { "proxyType": "MANUAL", "httpProxy": proxy, "ftpProxy": proxy, "sslProxy": proxy } for i in testxts.find_threads('https://freetp.org/forum/categories-10'): try: driver = webdriver.Firefox(capabilities=firefox_capabilities) driver.get(i) change_prox() driver.get(i) log = random.choice(logins) driver.find_element_by_xpath("//input[@name=\"login_name\"]").send_keys(log) driver.find_element_by_xpath("//input[@name=\"login_password\"]").send_keys(log) driver.find_element_by_xpath("//input[@onclick=\"submit();\"]").click() driver.find_element_by_xpath("//textarea[@id=\"text_msg\"]").send_keys('Пионер, измени капчу!!!!') f = driver.find_element_by_xpath( "/html/body/div[2]/div[3]/div[3]/div[1]/div[1]/div/div/div[1]/div/form/ol/li/div[3]/dl/dt").text[8:] driver.find_element_by_xpath( '/html/body/div[2]/div[3]/div[3]/div[1]/div[1]/div/div/div[1]/div/form/ol/li/div[3]/dl/dd/input').send_keys( qst[f]) driver.find_element_by_xpath( '/html/body/div[2]/div[3]/div[3]/div[1]/div[1]/div/div/div[1]/div/form/ol/li/div[3]/button').click() time.sleep(10) driver.close() except BaseException: again.append(i) while again != []: j = random.choice(again) try: driver = webdriver.Firefox(capabilities=firefox_capabilities) driver.get(j) change_prox() driver.get(j) log = random.choice(logins) driver.find_element_by_xpath("//input[@name=\"login_name\"]").send_keys(log) driver.find_element_by_xpath("//input[@name=\"login_password\"]").send_keys(log) driver.find_element_by_xpath("//input[@onclick=\"submit();\"]").click() driver.find_element_by_xpath("//textarea[@id=\"text_msg\"]").send_keys('Пионер, измени капчу!!!!') f = driver.find_element_by_xpath( "/html/body/div[2]/div[3]/div[3]/div[1]/div[1]/div/div/div[1]/div/form/ol/li/div[3]/dl/dt").text[8:] driver.find_element_by_xpath( '/html/body/div[2]/div[3]/div[3]/div[1]/div[1]/div/div/div[1]/div/form/ol/li/div[3]/dl/dd/input').send_keys( qst[f]) driver.find_element_by_xpath( '/html/body/div[2]/div[3]/div[3]/div[1]/div[1]/div/div/div[1]/div/form/ol/li/div[3]/button').click() time.sleep(10) again.pop(again.index(j)) driver.close() except BaseException: again.append(i)
39.453488
120
0.626584
478
3,393
4.305439
0.259414
0.034985
0.061224
0.129252
0.726919
0.726919
0.726919
0.686103
0.686103
0.622935
0
0.021966
0.18155
3,393
85
121
39.917647
0.718761
0
0
0.717949
0
0.076923
0.318101
0.159788
0
0
0
0
0
0
null
null
0.025641
0.064103
null
null
0.025641
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
1
0
0
0
0
0
0
0
0
5
1f97da4e4df1fac327b9224a6fc912843a7dfadc
217
py
Python
LMs/probe_tasks/src/contextualizers/__init__.py
baidu-research/task_space
6d07315e4da78561d465ae9cd99542d6f8f43a13
[ "MIT" ]
10
2021-11-08T07:18:00.000Z
2022-03-30T21:50:35.000Z
LMs/probe_tasks/src/contextualizers/__init__.py
baidu-research/task_space
6d07315e4da78561d465ae9cd99542d6f8f43a13
[ "MIT" ]
null
null
null
LMs/probe_tasks/src/contextualizers/__init__.py
baidu-research/task_space
6d07315e4da78561d465ae9cd99542d6f8f43a13
[ "MIT" ]
null
null
null
from src.contextualizers.contextualizer import Contextualizer from src.contextualizers.precomputed_contextualizer import PrecomputedContextualizer __all__ = ["Contextualizer", "PrecomputedContextualizer"]
36.166667
84
0.834101
16
217
11
0.5
0.079545
0.25
0
0
0
0
0
0
0
0
0
0.110599
217
5
85
43.4
0.911917
0
0
0
0
0
0.179724
0.115207
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
1
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
2f0da9af0f8d9efd525d622b897db4ace0ea3f40
70
py
Python
btbot/__init__.py
virtualpeer/btbot
fd0cae7c3e946631e42128630579cb9f93678805
[ "MIT" ]
8
2019-01-28T00:14:55.000Z
2022-03-02T07:18:24.000Z
btbot/__init__.py
virtualpeer/btbot
fd0cae7c3e946631e42128630579cb9f93678805
[ "MIT" ]
null
null
null
btbot/__init__.py
virtualpeer/btbot
fd0cae7c3e946631e42128630579cb9f93678805
[ "MIT" ]
11
2018-10-19T14:56:40.000Z
2022-03-02T07:18:26.000Z
from .cerebro import Cerebro, get_cerebro from .trainer import Trainer
35
41
0.842857
10
70
5.8
0.5
0
0
0
0
0
0
0
0
0
0
0
0.114286
70
2
42
35
0.935484
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
2f43d40ce3f1aab212807b3b9c122586b3b59cbf
29
py
Python
learning_new_technique_sandbox/src/__init__.py
qingchaowang/learning_sandbox
cfc756bc5abd944935213b2ef90beab7d40d5d18
[ "MIT" ]
null
null
null
learning_new_technique_sandbox/src/__init__.py
qingchaowang/learning_sandbox
cfc756bc5abd944935213b2ef90beab7d40d5d18
[ "MIT" ]
null
null
null
learning_new_technique_sandbox/src/__init__.py
qingchaowang/learning_sandbox
cfc756bc5abd944935213b2ef90beab7d40d5d18
[ "MIT" ]
null
null
null
from .desing_pattern import *
29
29
0.827586
4
29
5.75
1
0
0
0
0
0
0
0
0
0
0
0
0.103448
29
1
29
29
0.884615
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
0
0
0
5
2f612457e98cc0f2f9401bc37c49af1eb694b5cf
48
py
Python
ex/23.py
StopITnowFAST/7lab
8619e2a6f830d410377c5c0865ea74e30b711168
[ "MIT" ]
null
null
null
ex/23.py
StopITnowFAST/7lab
8619e2a6f830d410377c5c0865ea74e30b711168
[ "MIT" ]
null
null
null
ex/23.py
StopITnowFAST/7lab
8619e2a6f830d410377c5c0865ea74e30b711168
[ "MIT" ]
null
null
null
a = [1, 2, 3, 4, 5] print(a) a.clear() print(a)
9.6
19
0.5
12
48
2
0.666667
0.5
0
0
0
0
0
0
0
0
0
0.131579
0.208333
48
4
20
12
0.5
0
0
0.5
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
1
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
5
2f7a88a336a1ce95a24562fa797b8d955f3aa038
119
py
Python
manageflow/boards/admin.py
M-Anas-Syed/manageflow
88c689d6f40eaff818abaa6a44e1370e22a97809
[ "MIT" ]
null
null
null
manageflow/boards/admin.py
M-Anas-Syed/manageflow
88c689d6f40eaff818abaa6a44e1370e22a97809
[ "MIT" ]
null
null
null
manageflow/boards/admin.py
M-Anas-Syed/manageflow
88c689d6f40eaff818abaa6a44e1370e22a97809
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import Board, Task admin.site.register(Board) admin.site.register(Task)
19.833333
32
0.806723
18
119
5.333333
0.555556
0.1875
0.354167
0
0
0
0
0
0
0
0
0
0.10084
119
5
33
23.8
0.897196
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
2f86d7e42b1599f3e5f80137d6ba4e7bfe2c540a
385
py
Python
terrascript/icinga2/r.py
vutsalsinghal/python-terrascript
3b9fb5ad77453d330fb0cd03524154a342c5d5dc
[ "BSD-2-Clause" ]
null
null
null
terrascript/icinga2/r.py
vutsalsinghal/python-terrascript
3b9fb5ad77453d330fb0cd03524154a342c5d5dc
[ "BSD-2-Clause" ]
null
null
null
terrascript/icinga2/r.py
vutsalsinghal/python-terrascript
3b9fb5ad77453d330fb0cd03524154a342c5d5dc
[ "BSD-2-Clause" ]
null
null
null
# terrascript/icinga2/r.py import terrascript class icinga2_host(terrascript.Resource): pass class icinga2_hostgroup(terrascript.Resource): pass class icinga2_checkcommand(terrascript.Resource): pass class icinga2_service(terrascript.Resource): pass class icinga2_user(terrascript.Resource): pass class icinga2_notification(terrascript.Resource): pass
16.73913
49
0.784416
42
385
7.047619
0.333333
0.243243
0.466216
0.472973
0.591216
0
0
0
0
0
0
0.021212
0.142857
385
22
50
17.5
0.875758
0.062338
0
0.461538
0
0
0
0
0
0
0
0
0
1
0
true
0.461538
0.076923
0
0.538462
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
1
1
0
0
0
0
0
5
85d7a35e2e3c18b4ee6be40ae24fbbeb135cdaeb
37
py
Python
scorecard/profile_data/indicator_calculator.py
desafinadude/municipal-data
1c86c55bbb59f9c8087f6920fae3585dd90d5d43
[ "MIT" ]
19
2018-01-09T10:54:15.000Z
2022-01-25T13:10:55.000Z
scorecard/profile_data/indicator_calculator.py
desafinadude/municipal-data
1c86c55bbb59f9c8087f6920fae3585dd90d5d43
[ "MIT" ]
29
2018-01-12T12:12:38.000Z
2022-01-31T15:30:36.000Z
scorecard/profile_data/indicator_calculator.py
desafinadude/municipal-data
1c86c55bbb59f9c8087f6920fae3585dd90d5d43
[ "MIT" ]
13
2018-02-11T02:12:57.000Z
2021-11-22T11:03:22.000Z
class IndicatorCalculator: pass
9.25
26
0.756757
3
37
9.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.216216
37
3
27
12.333333
0.965517
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
c80a00cd5f3c14562795867d3a826546836aadb0
50
py
Python
flask_accepts/decorators/__init__.py
cafetodev/flask_accepts
6d3728a4008f360e0a208064f6620557d270bcdd
[ "BSD-3-Clause" ]
170
2019-05-04T17:53:15.000Z
2022-03-03T21:39:59.000Z
flask_accepts/decorators/__init__.py
cafetodev/flask_accepts
6d3728a4008f360e0a208064f6620557d270bcdd
[ "BSD-3-Clause" ]
104
2019-07-04T15:46:15.000Z
2022-01-14T19:18:12.000Z
flask_accepts/decorators/__init__.py
cafetodev/flask_accepts
6d3728a4008f360e0a208064f6620557d270bcdd
[ "BSD-3-Clause" ]
55
2019-05-04T22:39:30.000Z
2022-01-13T16:18:13.000Z
from .decorators import accepts, responds # noqa
25
49
0.78
6
50
6.5
1
0
0
0
0
0
0
0
0
0
0
0
0.16
50
1
50
50
0.928571
0.08
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
1
0
0
5
c81093b8a370b02d8fac2b2eb7b1bfd6b8fc5055
148
py
Python
uteis/numeros/__init__.py
Felix-xilef/Curso-de-Python
cdff7c7f3850e6326e274c8c1987b9e1a18ce910
[ "MIT" ]
null
null
null
uteis/numeros/__init__.py
Felix-xilef/Curso-de-Python
cdff7c7f3850e6326e274c8c1987b9e1a18ce910
[ "MIT" ]
null
null
null
uteis/numeros/__init__.py
Felix-xilef/Curso-de-Python
cdff7c7f3850e6326e274c8c1987b9e1a18ce910
[ "MIT" ]
null
null
null
def fatorial(n): f = 1 for i in range(n, 0, -1): f *= i return f def dobro(n): return n*2 def triplo(n): return n*3
10.571429
29
0.486486
28
148
2.571429
0.535714
0.194444
0.222222
0
0
0
0
0
0
0
0
0.054348
0.378378
148
13
30
11.384615
0.728261
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
0.222222
0.666667
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
c826f614dc7c154cddca9eab5f95e471595ccc65
193
py
Python
linearmodels/tests/shared/test_base.py
clarityai-eng/linearmodels
21d059199925b51075ac2139e6d8ab44fdd17938
[ "NCSA" ]
null
null
null
linearmodels/tests/shared/test_base.py
clarityai-eng/linearmodels
21d059199925b51075ac2139e6d8ab44fdd17938
[ "NCSA" ]
null
null
null
linearmodels/tests/shared/test_base.py
clarityai-eng/linearmodels
21d059199925b51075ac2139e6d8ab44fdd17938
[ "NCSA" ]
null
null
null
from linearmodels.compat.statsmodels import Summary from linearmodels.shared.base import _SummaryStr def test_sumary_str(): ss = _SummaryStr() assert isinstance(ss.summary, Summary)
21.444444
51
0.787565
23
193
6.434783
0.695652
0.216216
0
0
0
0
0
0
0
0
0
0
0.139896
193
8
52
24.125
0.891566
0
0
0
0
0
0
0
0
0
0
0
0.2
1
0.2
false
0
0.4
0
0.6
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
c08f0e44cc9b4fdb9480cc8307d130df847073c7
301
py
Python
e2elink/steps/compare/columns/visit_date.py
ersilia-os/cidrz-e2e-linkage
840581cdb90617f3ceb1be898992f0a8df71f9e3
[ "MIT" ]
null
null
null
e2elink/steps/compare/columns/visit_date.py
ersilia-os/cidrz-e2e-linkage
840581cdb90617f3ceb1be898992f0a8df71f9e3
[ "MIT" ]
null
null
null
e2elink/steps/compare/columns/visit_date.py
ersilia-os/cidrz-e2e-linkage
840581cdb90617f3ceb1be898992f0a8df71f9e3
[ "MIT" ]
null
null
null
from ....metrics.metrics import LevenshteinSimilarity, TimeDaysSimilarity from ....columns.visit_date import VisitDateColumn class VisitDateMetrics(object): def __init__(self): self.metrics = [LevenshteinSimilarity(), TimeDaysSimilarity()] self.prefix = VisitDateColumn().label
30.1
73
0.754153
26
301
8.538462
0.653846
0.351351
0
0
0
0
0
0
0
0
0
0
0.142857
301
9
74
33.444444
0.860465
0
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0
0.333333
0
0.666667
0
1
0
0
null
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
1
0
0
5
c0b1b7000bf9d14965c85bb3bd55f3df827baed2
430
py
Python
step9/test/persistence/__init__.py
banalna/pip-samples-beacons-python
6a26bbb47f0d570e97e8135818ebcd76bfe41d93
[ "MIT" ]
null
null
null
step9/test/persistence/__init__.py
banalna/pip-samples-beacons-python
6a26bbb47f0d570e97e8135818ebcd76bfe41d93
[ "MIT" ]
null
null
null
step9/test/persistence/__init__.py
banalna/pip-samples-beacons-python
6a26bbb47f0d570e97e8135818ebcd76bfe41d93
[ "MIT" ]
1
2020-08-03T13:12:26.000Z
2020-08-03T13:12:26.000Z
# -*- coding: utf-8 -*- __all__ = ['TestBeaconMongoDbPersistence', 'TestBeaconMemoryPersistence', 'TestBeaconFilePersistence', 'BeaconsPersistenceFixture'] from .BeaconsPersistenceFixture import BeaconsPersistenceFixture from .test_BeaconFilePersistence import TestBeaconFilePersistence from .test_BeaconMemoryPersistence import TestBeaconMemoryPersistence from .test_BeaconMongoDbPersistence import TestBeaconMongoDbPersistence
53.75
131
0.872093
27
430
13.62963
0.518519
0.065217
0
0
0
0
0
0
0
0
0
0.002488
0.065116
430
8
132
53.75
0.912935
0.048837
0
0
0
0
0.257353
0.257353
0
0
0
0
0
1
0
false
0
0.8
0
0.8
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
1
0
0
5
c0d0e316f0af4600ff06eba13181f2f80d4f641b
44
py
Python
excel4lib/sheet/__init__.py
aaaddress1/boobsnail
c0c2067d7271ca76ee721998d28e8c3c81a48397
[ "MIT" ]
169
2021-05-26T13:35:16.000Z
2021-09-06T08:04:19.000Z
excel4lib/sheet/__init__.py
H4xl0r/boobsnail
c0c2067d7271ca76ee721998d28e8c3c81a48397
[ "MIT" ]
2
2021-06-01T13:46:37.000Z
2021-07-12T19:06:37.000Z
excel4lib/sheet/__init__.py
H4xl0r/boobsnail
c0c2067d7271ca76ee721998d28e8c3c81a48397
[ "MIT" ]
29
2021-05-27T17:28:29.000Z
2021-09-04T19:24:50.000Z
from .cell import * from .worksheet import *
22
24
0.75
6
44
5.5
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.159091
44
2
24
22
0.891892
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
0
0
0
5
23baafab3de4686aa7f0b8672a42c0db1845e871
256
py
Python
Problems/Stack/Easy/RemoveAllAdjacentDuplicatesInString/test_remove_duplicates.py
dolong2110/Algorithm-By-Problems-Python
31ecc7367aaabdd2b0ac0af7f63ca5796d70c730
[ "MIT" ]
1
2021-08-16T14:52:05.000Z
2021-08-16T14:52:05.000Z
Problems/Stack/Easy/RemoveAllAdjacentDuplicatesInString/test_remove_duplicates.py
dolong2110/Algorithm-By-Problems-Python
31ecc7367aaabdd2b0ac0af7f63ca5796d70c730
[ "MIT" ]
null
null
null
Problems/Stack/Easy/RemoveAllAdjacentDuplicatesInString/test_remove_duplicates.py
dolong2110/Algorithm-By-Problems-Python
31ecc7367aaabdd2b0ac0af7f63ca5796d70c730
[ "MIT" ]
null
null
null
from unittest import TestCase from remove_duplicates import removeDuplicates class Test(TestCase): def test_remove_duplicates(self): self.assertEqual(removeDuplicates("abbaca"), "ca") self.assertEqual(removeDuplicates("azxxzy"), "ay")
32
58
0.753906
27
256
7.037037
0.592593
0.168421
0.326316
0
0
0
0
0
0
0
0
0
0.144531
256
7
59
36.571429
0.86758
0
0
0
0
0
0.0625
0
0
0
0
0
0.333333
1
0.166667
false
0
0.333333
0
0.666667
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
23c6757a4e2eb44559c187d7126c685c62339153
49
py
Python
usecases/screen/exceptions.py
aboulay/goyave.py
ce46f582d87a9fc5a455e7f5e1b0103a4571f157
[ "MIT" ]
null
null
null
usecases/screen/exceptions.py
aboulay/goyave.py
ce46f582d87a9fc5a455e7f5e1b0103a4571f157
[ "MIT" ]
null
null
null
usecases/screen/exceptions.py
aboulay/goyave.py
ce46f582d87a9fc5a455e7f5e1b0103a4571f157
[ "MIT" ]
null
null
null
class UnknownResponseFormat(Exception): pass
16.333333
39
0.795918
4
49
9.75
1
0
0
0
0
0
0
0
0
0
0
0
0.142857
49
2
40
24.5
0.928571
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
23f679d39a88c414a6bf699dbfc285a0a1bf4b3c
215
py
Python
idcovid19/models/factory.py
mfkasim91/idcovid19
3e51b16354581a4e0defc635f837f93faff26afc
[ "BSD-3-Clause" ]
null
null
null
idcovid19/models/factory.py
mfkasim91/idcovid19
3e51b16354581a4e0defc635f837f93faff26afc
[ "BSD-3-Clause" ]
null
null
null
idcovid19/models/factory.py
mfkasim91/idcovid19
3e51b16354581a4e0defc635f837f93faff26afc
[ "BSD-3-Clause" ]
null
null
null
from idcovid19.models.model1 import Model1 from idcovid19.models.model2 import Model2 def get_model(modelname, data): return { "model1": Model1, "model2": Model2, }[modelname.lower()](data)
23.888889
42
0.683721
25
215
5.84
0.52
0.178082
0.260274
0
0
0
0
0
0
0
0
0.069767
0.2
215
8
43
26.875
0.77907
0
0
0
0
0
0.055814
0
0
0
0
0
0
1
0.142857
false
0
0.285714
0.142857
0.571429
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
5
9b13b71566d80a7f1e6105afaf3f41bfd49afa98
87
py
Python
src/__init__.py
AP-Atul/string-matching
d12b1fac4aa1225c9a2a1e7802b400992aaf66e4
[ "MIT" ]
1
2021-06-13T16:59:42.000Z
2021-06-13T16:59:42.000Z
src/__init__.py
AP-Atul/string-matching
d12b1fac4aa1225c9a2a1e7802b400992aaf66e4
[ "MIT" ]
null
null
null
src/__init__.py
AP-Atul/string-matching
d12b1fac4aa1225c9a2a1e7802b400992aaf66e4
[ "MIT" ]
null
null
null
from ._match import levenshtein_ratio_and_distance from ._dictionary import Dictionary
29
50
0.885057
11
87
6.545455
0.727273
0
0
0
0
0
0
0
0
0
0
0
0.091954
87
2
51
43.5
0.911392
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
f1e48fe015011c25ddd1cabbe6ac89a1d982dc36
61
py
Python
PyFLOTRAN/utils/__init__.py
aitirga/PyFLOTRAN
f601052a0686e89434ae91a917f218afa6c31528
[ "MIT" ]
2
2021-05-14T18:41:49.000Z
2021-10-05T15:06:31.000Z
PyFLOTRAN/utils/__init__.py
aitirga/PyFLOTRAN
f601052a0686e89434ae91a917f218afa6c31528
[ "MIT" ]
6
2020-04-30T10:19:39.000Z
2022-03-21T18:16:14.000Z
PyFLOTRAN/utils/__init__.py
aitirga/PyFLOTRAN
f601052a0686e89434ae91a917f218afa6c31528
[ "MIT" ]
1
2020-03-24T10:37:23.000Z
2020-03-24T10:37:23.000Z
from .configuration_utils import * from .decorators import *
20.333333
34
0.803279
7
61
6.857143
0.714286
0
0
0
0
0
0
0
0
0
0
0
0.131148
61
2
35
30.5
0.90566
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
f1f7be408b9dd29702d90db9ab88fad8307340dc
63
py
Python
11-(ek)-modul-kullanimi.py
omerkocadayi/WeWantEd--Python-a-Giris-
bedde84d0933d05a3a73b894c90c7d04736c3bba
[ "MIT" ]
2
2017-03-26T13:02:42.000Z
2017-04-03T00:50:19.000Z
11-(ek)-modul-kullanimi.py
omerkocadayi/WeWantEd--Python-a-Giris-
bedde84d0933d05a3a73b894c90c7d04736c3bba
[ "MIT" ]
null
null
null
11-(ek)-modul-kullanimi.py
omerkocadayi/WeWantEd--Python-a-Giris-
bedde84d0933d05a3a73b894c90c7d04736c3bba
[ "MIT" ]
null
null
null
from 11-fonksiyon-hesap-makinesi import * print(kokAl(625,4))
15.75
41
0.761905
10
63
4.8
1
0
0
0
0
0
0
0
0
0
0
0.105263
0.095238
63
3
42
21
0.736842
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0.5
null
null
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
1
0
5
7b0ac9a8b5c7d8c08a4c6954c83e8b09da565e83
34
py
Python
examples/str.index/ex1.py
mcorne/python-by-example
15339c0909c84b51075587a6a66391100971c033
[ "MIT" ]
null
null
null
examples/str.index/ex1.py
mcorne/python-by-example
15339c0909c84b51075587a6a66391100971c033
[ "MIT" ]
null
null
null
examples/str.index/ex1.py
mcorne/python-by-example
15339c0909c84b51075587a6a66391100971c033
[ "MIT" ]
null
null
null
print('Looking for o'.index('o'))
17
33
0.647059
6
34
3.666667
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.088235
34
1
34
34
0.709677
0
0
0
0
0
0.411765
0
0
0
0
0
0
1
0
true
0
0
0
0
1
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
1
0
5
7b1594cc81b70d7e10b2209ad94a278c765693d8
19
py
Python
cacreader/swig-4.0.2/Examples/python/import_packages/split_modules/vanilla_split/pkg1/__init__.py
kyletanyag/LL-Smartcard
02abea9de5a13f8bae4d7832ab34cb7f0d9514c9
[ "BSD-3-Clause" ]
1,031
2015-01-02T14:08:47.000Z
2022-03-29T02:25:27.000Z
cacreader/swig-4.0.2/Examples/python/import_packages/split_modules/vanilla_split/pkg1/__init__.py
kyletanyag/LL-Smartcard
02abea9de5a13f8bae4d7832ab34cb7f0d9514c9
[ "BSD-3-Clause" ]
240
2015-01-11T04:27:19.000Z
2022-03-30T00:35:57.000Z
cacreader/swig-4.0.2/Examples/python/import_packages/split_modules/vanilla_split/pkg1/__init__.py
kyletanyag/LL-Smartcard
02abea9de5a13f8bae4d7832ab34cb7f0d9514c9
[ "BSD-3-Clause" ]
224
2015-01-05T06:13:54.000Z
2022-02-25T14:39:51.000Z
# killroy was here
9.5
18
0.736842
3
19
4.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.210526
19
1
19
19
0.933333
0.842105
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
7b1bd8511082d93a8e487c79b59457f2179b8970
377
py
Python
project/Shop/models.py
leehe228/Ecoverse
1554e4f44c8ba3cc60a0b7f2509f4d9b7a94099a
[ "CC-BY-4.0" ]
null
null
null
project/Shop/models.py
leehe228/Ecoverse
1554e4f44c8ba3cc60a0b7f2509f4d9b7a94099a
[ "CC-BY-4.0" ]
null
null
null
project/Shop/models.py
leehe228/Ecoverse
1554e4f44c8ba3cc60a0b7f2509f4d9b7a94099a
[ "CC-BY-4.0" ]
null
null
null
from django.db import models # Create your models here. class Shop(models.Model): lastupdate = models.DateTimeField(primary_key=True, auto_now_add=True) item1 = models.IntegerField(default=0) item2 = models.IntegerField(default=0) item3 = models.IntegerField(default=0) def __str__(self): return self.item1 + "&" + self.item2 + "&" + self.item3
26.928571
74
0.700265
48
377
5.354167
0.604167
0.210117
0.291829
0.303502
0
0
0
0
0
0
0
0.029126
0.180371
377
13
75
29
0.802589
0.06366
0
0
0
0
0.005698
0
0
0
0
0
0
1
0.125
false
0
0.125
0.125
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
1
1
0
0
5
9e6f6a926c01450b6d5a767dc27a10ccd6dc2d9b
58
py
Python
dlutils/models/gans/unit/__init__.py
justusschock/dl-utils
1078f5030b8aac2bf022daf5fa14d66f74c3c893
[ "MIT" ]
13
2020-03-25T12:29:32.000Z
2022-02-05T15:02:11.000Z
dlutils/models/gans/unit/__init__.py
Royzon/dl-utils
be95707da9cb812a5f25a11f1469055e0b7abcd2
[ "MIT" ]
1
2021-07-05T10:14:52.000Z
2021-07-05T10:14:52.000Z
dlutils/models/gans/unit/__init__.py
Royzon/dl-utils
be95707da9cb812a5f25a11f1469055e0b7abcd2
[ "MIT" ]
5
2020-03-25T12:55:09.000Z
2020-12-22T20:18:52.000Z
from dlutils.models.gans.unit.unit import UNIT, update_fn
29
57
0.827586
10
58
4.7
0.8
0
0
0
0
0
0
0
0
0
0
0
0.086207
58
1
58
58
0.886792
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
9eb28a074bc39b9f747344f6e677d43e580505bf
72
py
Python
conch/analysis/mfcc/__init__.py
mmcauliffe/Conch
7668612d7a610d0f5ae3332f990e71b26c5e8b34
[ "MIT" ]
33
2015-06-10T19:36:54.000Z
2017-09-18T23:57:46.000Z
conch/analysis/mfcc/__init__.py
mmcauliffe/Conch
7668612d7a610d0f5ae3332f990e71b26c5e8b34
[ "MIT" ]
5
2015-03-22T07:05:21.000Z
2017-08-16T03:48:19.000Z
conch/analysis/mfcc/__init__.py
mmcauliffe/Conch
7668612d7a610d0f5ae3332f990e71b26c5e8b34
[ "MIT" ]
10
2015-04-29T05:51:51.000Z
2017-07-12T18:52:18.000Z
from .rastamat import MfccFunction from .praat import PraatMfccFunction
24
36
0.861111
8
72
7.75
0.75
0
0
0
0
0
0
0
0
0
0
0
0.111111
72
2
37
36
0.96875
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
9ebad957c832678f90b1bb82e3f547b90fa1e7bc
39
py
Python
octohatrack.py
LABHR/octohatrack
89efd9d9e0237214a59f0c5e0c0535fa54f19aee
[ "BSD-3-Clause" ]
143
2015-11-27T17:07:04.000Z
2021-02-15T17:21:07.000Z
octohatrack.py
LABHR/octohatrack
89efd9d9e0237214a59f0c5e0c0535fa54f19aee
[ "BSD-3-Clause" ]
58
2015-11-22T06:23:49.000Z
2021-02-06T09:14:05.000Z
octohatrack.py
LABHR/octohatrack
89efd9d9e0237214a59f0c5e0c0535fa54f19aee
[ "BSD-3-Clause" ]
19
2015-11-28T05:32:09.000Z
2020-10-21T21:49:19.000Z
import octohatrack octohatrack.main()
9.75
18
0.820513
4
39
8
0.75
0
0
0
0
0
0
0
0
0
0
0
0.102564
39
3
19
13
0.914286
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
7b83656f261e67fb31d4cfef3bf1b17074fc805d
148
py
Python
main/admin.py
DilyanAntonov/django-sales-finder
657991b367122a5431b7dd0142a48b32f815e447
[ "MIT" ]
null
null
null
main/admin.py
DilyanAntonov/django-sales-finder
657991b367122a5431b7dd0142a48b32f815e447
[ "MIT" ]
null
null
null
main/admin.py
DilyanAntonov/django-sales-finder
657991b367122a5431b7dd0142a48b32f815e447
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import ClothesItem, ClothesSearch admin.site.register(ClothesItem) admin.site.register(ClothesSearch)
29.6
46
0.851351
18
148
7
0.555556
0.142857
0.269841
0
0
0
0
0
0
0
0
0
0.074324
148
5
47
29.6
0.919708
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
7bcdbfe384dd7065ea67f5f453768fe4cd54a104
99
py
Python
Code/src/errors.py
alamillac/master_AI_tesis
c9cdb8e0b71498fca04c732cb176bf0610170b21
[ "MIT" ]
1
2021-12-18T15:18:24.000Z
2021-12-18T15:18:24.000Z
Code/src/errors.py
alamillac/master_AI_tesis
c9cdb8e0b71498fca04c732cb176bf0610170b21
[ "MIT" ]
null
null
null
Code/src/errors.py
alamillac/master_AI_tesis
c9cdb8e0b71498fca04c732cb176bf0610170b21
[ "MIT" ]
null
null
null
class InvalidGroupError(Exception): pass class MaxInvalidIterationsError(Exception): pass
16.5
43
0.787879
8
99
9.75
0.625
0.333333
0
0
0
0
0
0
0
0
0
0
0.151515
99
5
44
19.8
0.928571
0
0
0.5
0
0
0
0
0
0
0
0
0
1
0
true
0.5
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
0
1
1
0
0
0
0
0
5
c8d4e0cc8060ad2aeec52f874b646c40594f259a
115
py
Python
1387.py
gabriel1lima/Questoes---URI---Python
4e88d76cf7ea68baf0464071bc4f72ced7d746cd
[ "MIT" ]
1
2020-10-01T14:22:48.000Z
2020-10-01T14:22:48.000Z
1387.py
gabriel1lima/Questoes---URI---Python
4e88d76cf7ea68baf0464071bc4f72ced7d746cd
[ "MIT" ]
null
null
null
1387.py
gabriel1lima/Questoes---URI---Python
4e88d76cf7ea68baf0464071bc4f72ced7d746cd
[ "MIT" ]
7
2020-10-01T13:03:22.000Z
2020-10-02T16:10:25.000Z
l, r = map(int, input().split()) while(l != 0 and r != 0): print(l + r) l, r = map(int, input().split())
16.428571
36
0.478261
21
115
2.619048
0.47619
0.109091
0.181818
0.290909
0.654545
0.654545
0
0
0
0
0
0.023529
0.26087
115
7
36
16.428571
0.623529
0
0
0.5
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
0
0.25
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
c8d4e96aff4bf95b74c693397bb9c9f783a1fd48
126
py
Python
models3CwProject/models3CwProblem2App/views.py
cs-fullstack-2019-spring/django-models3-cw-MelaatiJ
cba6396f46f959b9b89fe22430de541aee164e60
[ "Apache-2.0" ]
null
null
null
models3CwProject/models3CwProblem2App/views.py
cs-fullstack-2019-spring/django-models3-cw-MelaatiJ
cba6396f46f959b9b89fe22430de541aee164e60
[ "Apache-2.0" ]
null
null
null
models3CwProject/models3CwProblem2App/views.py
cs-fullstack-2019-spring/django-models3-cw-MelaatiJ
cba6396f46f959b9b89fe22430de541aee164e60
[ "Apache-2.0" ]
null
null
null
from django.shortcuts import render # Create your views here. from django.http import HttpResponse from .models import Car
15.75
36
0.801587
18
126
5.611111
0.722222
0.19802
0
0
0
0
0
0
0
0
0
0
0.15873
126
7
37
18
0.95283
0.18254
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
1
0
0
5
cda615e051bcb4f41913352818fa9e85cce142ef
161
py
Python
mmselfsup/models/backbones/__init__.py
st9007a/mmselfsup
7127db8522c38e16e00ab1bf9710ba6d5197469a
[ "Apache-2.0" ]
1
2021-12-22T08:36:20.000Z
2021-12-22T08:36:20.000Z
mmselfsup/models/backbones/__init__.py
Yagami5/mmselfsup
5d2b4a389bbf8b2e05f34fe3b607919a3b9ea7a3
[ "Apache-2.0" ]
null
null
null
mmselfsup/models/backbones/__init__.py
Yagami5/mmselfsup
5d2b4a389bbf8b2e05f34fe3b607919a3b9ea7a3
[ "Apache-2.0" ]
1
2022-03-15T11:31:48.000Z
2022-03-15T11:31:48.000Z
# Copyright (c) OpenMMLab. All rights reserved. from .resnet import ResNet, ResNetV1d from .resnext import ResNeXt __all__ = ['ResNet', 'ResNetV1d', 'ResNeXt']
26.833333
47
0.745342
19
161
6.105263
0.578947
0.258621
0
0
0
0
0
0
0
0
0
0.014388
0.136646
161
5
48
32.2
0.820144
0.279503
0
0
0
0
0.192982
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
cdd91cb90697ed51cc391a2b87791c5c11e17002
21
py
Python
cache/RiZoeL.py
MrRizoel/RiZoeLVCstream
66686932eb8715ec4b0872d593c2c401af7a4417
[ "MIT" ]
null
null
null
cache/RiZoeL.py
MrRizoel/RiZoeLVCstream
66686932eb8715ec4b0872d593c2c401af7a4417
[ "MIT" ]
null
null
null
cache/RiZoeL.py
MrRizoel/RiZoeLVCstream
66686932eb8715ec4b0872d593c2c401af7a4417
[ "MIT" ]
null
null
null
#lodaa lenaa kangerr
10.5
20
0.809524
3
21
5.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.142857
21
1
21
21
0.944444
0.904762
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
cdf49e0f5872dff7015116ee493187628e9dcae6
50
py
Python
tests/test_sample.py
sasano8/fastapi_docker_template
9f53ba7473da02f5fe9725c753a4ab491e42c855
[ "MIT" ]
null
null
null
tests/test_sample.py
sasano8/fastapi_docker_template
9f53ba7473da02f5fe9725c753a4ab491e42c855
[ "MIT" ]
null
null
null
tests/test_sample.py
sasano8/fastapi_docker_template
9f53ba7473da02f5fe9725c753a4ab491e42c855
[ "MIT" ]
null
null
null
# type: ignore def test_func(): assert True
8.333333
16
0.64
7
50
4.428571
1
0
0
0
0
0
0
0
0
0
0
0
0.26
50
5
17
10
0.837838
0.24
0
0
0
0
0
0
0
0
0
0
0.5
1
0.5
true
0
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
1
0
1
1
0
0
0
0
0
0
5
a800732db357db015884d9718b92c357c7809507
159
py
Python
apps/risk_rating/tests.py
fga-gpp-mds/2017.2-Grupo4
e7cd2114ed46da879700f6163594d57e7797e367
[ "MIT" ]
7
2017-08-22T19:27:25.000Z
2017-12-09T18:17:40.000Z
apps/risk_rating/tests.py
fga-gpp-mds/2017.2-Grupo4
e7cd2114ed46da879700f6163594d57e7797e367
[ "MIT" ]
89
2017-09-20T03:22:49.000Z
2017-12-11T18:50:25.000Z
apps/risk_rating/tests.py
fga-gpp-mds/2017.2-Grupo4
e7cd2114ed46da879700f6163594d57e7797e367
[ "MIT" ]
1
2017-09-26T04:15:49.000Z
2017-09-26T04:15:49.000Z
from apps.risk_rating.apps import RiskRatingConfig class TestRiskRating: def test_app(self): assert RiskRatingConfig.name == 'apps.risk_rating'
19.875
58
0.754717
19
159
6.157895
0.736842
0.136752
0.239316
0
0
0
0
0
0
0
0
0
0.169811
159
7
59
22.714286
0.886364
0
0
0
0
0
0.100629
0
0
0
0
0
0.25
1
0.25
false
0
0.25
0
0.75
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
1
0
0
5
a827f8281dbd6d379531d7df14de77d9352d268a
2,440
py
Python
tests/test_address.py
ishiland/nyc-parser
6912e211893aea999f609f6e6311a06744de0dc0
[ "MIT" ]
1
2019-11-19T22:47:17.000Z
2019-11-19T22:47:17.000Z
tests/test_address.py
ishiland/nyc-parser
6912e211893aea999f609f6e6311a06744de0dc0
[ "MIT" ]
1
2019-08-19T18:49:53.000Z
2019-08-21T13:22:48.000Z
tests/test_address.py
ishiland/nyc-parser
6912e211893aea999f609f6e6311a06744de0dc0
[ "MIT" ]
null
null
null
from tests.testcase import TestCase class TestAddress(TestCase): def test_phn(self): result = self.parser.address('100') self.assertDictEqual({ 'PHN': '100', 'STREET': '', 'BOROUGH_CODE': None, 'BOROUGH_NAME': None, 'ZIP': None }, result) def test_street(self): result = self.parser.address('100 Gold st') self.assertDictEqual({ 'PHN': '100', 'STREET': 'GOLD ST', 'BOROUGH_CODE': None, 'BOROUGH_NAME': None, 'ZIP': None }, result) def test_borough_code(self): result = self.parser.address('100 Gold st, mn') self.assertDictEqual({ 'PHN': '100', 'STREET': 'GOLD ST', 'BOROUGH_CODE': 1, 'BOROUGH_NAME': 'MANHATTAN', 'ZIP': None }, result) def test_borough_name(self): result = self.parser.address('100 Gold, mn') self.assertDictEqual({ 'PHN': '100', 'STREET': 'GOLD', 'BOROUGH_CODE': 1, 'BOROUGH_NAME': 'MANHATTAN', 'ZIP': None }, result) def test_zip(self): result = self.parser.address('100 Gold st, MN 10038') self.assertDictEqual({ 'PHN': '100', 'STREET': 'GOLD ST', 'BOROUGH_CODE': 1, 'BOROUGH_NAME': 'MANHATTAN', 'ZIP': '10038' }, result) def test_address_w_apartment(self): result = self.parser.address('100 gold st apt 123, mn') self.assertDictEqual({ 'PHN': '100', 'STREET': 'GOLD ST', 'BOROUGH_CODE': 1, 'BOROUGH_NAME': 'MANHATTAN', 'ZIP': None }, result) def test_queens_address(self): result = self.parser.address('74-12 35th ave, Queens') self.assertDictEqual({ 'PHN': '74-12', 'STREET': '35TH AVE', 'BOROUGH_CODE': 4, 'BOROUGH_NAME': 'QUEENS', 'ZIP': None }, result) def test_queens_address_w_apartment(self): result = self.parser.address('74-12 35th ave apt 319, Queens NY 11372') self.assertDictEqual({ 'PHN': '74-12', 'STREET': '35TH AVE', 'BOROUGH_CODE': 4, 'BOROUGH_NAME': 'QUEENS', 'ZIP': '11372' }, result)
28.705882
79
0.492623
243
2,440
4.814815
0.164609
0.084615
0.095727
0.136752
0.874359
0.847863
0.810256
0.718803
0.628205
0.468376
0
0.059585
0.367213
2,440
84
80
29.047619
0.698187
0
0
0.702703
0
0
0.232882
0
0
0
0
0
0.108108
1
0.108108
false
0
0.013514
0
0.135135
0
0
0
0
null
0
0
0
1
1
1
1
0
0
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
5
b59b43fe77ba7b0c8426a7110f29a82190a65d26
585
py
Python
first_project/first_app/views.py
venkat1077/learn_django
ca83640cb490d27b313c94ba7b3e85fa0053d2be
[ "MIT" ]
1
2018-03-27T11:12:27.000Z
2018-03-27T11:12:27.000Z
first_project/first_app/views.py
venkat1077/learn_django
ca83640cb490d27b313c94ba7b3e85fa0053d2be
[ "MIT" ]
null
null
null
first_project/first_app/views.py
venkat1077/learn_django
ca83640cb490d27b313c94ba7b3e85fa0053d2be
[ "MIT" ]
null
null
null
from django.shortcuts import render from django.http import HttpResponse from first_app.models import Topic, Webpage, AccessRecord # Create your views here. def index(request): webpages_list = AccessRecord.objects.order_by('date') date_dict = {'access_records':webpages_list} return render(request, 'first_app/index.html', context=date_dict) def home(request): return render(request, 'first_app/home.html') #def index(request): # my_dict = {'insert_me': "Hello! I'm from first_app/index.html"} # return render(request, 'first_app/index.html', context=my_dict)
34.411765
69
0.752137
83
585
5.13253
0.46988
0.093897
0.133803
0.169014
0.265258
0.201878
0.201878
0.201878
0
0
0
0
0.129915
585
16
70
36.5625
0.836935
0.300855
0
0
0
0
0.141089
0
0
0
0
0
0
1
0.222222
false
0
0.333333
0.111111
0.777778
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
1
0
0
5
b59ba779d08ef30198ce3eedd80248745e1f9083
174
py
Python
_input.py
9gress0r/Sudoku-Solver
5a24b706ebecf39253ab80bfe27db8b2dee8da42
[ "MIT" ]
null
null
null
_input.py
9gress0r/Sudoku-Solver
5a24b706ebecf39253ab80bfe27db8b2dee8da42
[ "MIT" ]
null
null
null
_input.py
9gress0r/Sudoku-Solver
5a24b706ebecf39253ab80bfe27db8b2dee8da42
[ "MIT" ]
null
null
null
def getting_input(): """ Gets input from user and implements it into an 2 dim array """ print('Enter a table:') return [list(map(int, list(input()))) for _ in range(9)]
24.857143
59
0.666667
29
174
3.931034
0.896552
0
0
0
0
0
0
0
0
0
0
0.013986
0.178161
174
6
60
29
0.783217
0.333333
0
0
0
0
0.132075
0
0
0
0
0
0
1
0.333333
true
0
0
0
0.666667
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
1
1
0
0
0
1
0
0
5
a93a165c3989173202ca249b1801ca70c786cf8c
7,931
py
Python
tests/test_readcounter.py
housw/readcounter
d532ad8b98c546044a1447851db8ed9d82bd3372
[ "MIT" ]
null
null
null
tests/test_readcounter.py
housw/readcounter
d532ad8b98c546044a1447851db8ed9d82bd3372
[ "MIT" ]
261
2019-06-04T03:16:45.000Z
2022-03-31T18:33:23.000Z
tests/test_readcounter.py
housw/readcounter
d532ad8b98c546044a1447851db8ed9d82bd3372
[ "MIT" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for `readcounter` package.""" import os import pytest import traceback import subprocess from click.testing import CliRunner from readcounter import readcounter from readcounter import cli from readcounter import __version__ as version import pkgutil import pkg_resources @pytest.fixture(scope="module") def runner(): return CliRunner() def get_test_input_file(format='fq', compress_type='none'): if compress_type == 'none': input_file = pkg_resources.resource_filename(__name__, 'test_data/test.{suffix}'.format(suffix=format)) else: if format not in ('fasta', 'fq', 'fastq','sam', 'bam', 'fastqc'): raise cli.UsageError(message="only compressed fq files are available in the test folder!") input_file = pkg_resources.resource_filename(__name__, 'test_data/test.{suffix}.{compress}'.format(suffix=format, compress=compress_type)) return input_file def test_help(runner): """Test readcounter --help""" help_result = runner.invoke(cli.main, ['--help']) assert help_result.exit_code == 0 assert 'Show this message and exit.' \ in help_result.output def test_version(runner): """Test readcounter --version""" version_result = runner.invoke(cli.main, ['fasta', '--version']) assert version_result.exit_code == 0 assert 'readcounter, version {v}'.format(v=version) \ in version_result.output def test_plain_fasta_input(runner): input_file = get_test_input_file(format="fasta") output_dir = "./tests/test_results" output_prefix = "test_plain_fasta" result = runner.invoke(cli.main, ['fasta', '--output_dir', output_dir, '--prefix', output_prefix, '--force', input_file]) if result.exception: traceback.print_exception(*result.exc_info) assert result.exit_code == 0 output_file = os.path.join(output_dir, output_prefix + ".txt") read_count = open(output_file, 'r').read() assert read_count == 'test : 250\n' def test_gzip_fasta_input(runner): input_file = get_test_input_file(format="fasta", compress_type='gz') output_dir = "./tests/test_results" output_prefix = "test_gzip_fasta" result = runner.invoke(cli.main, ['fasta', '--output_dir', output_dir, '--prefix', output_prefix, '--force', input_file]) if result.exception: traceback.print_exception(*result.exc_info) assert result.exit_code == 0 output_file = os.path.join(output_dir, output_prefix + ".txt") read_count = open(output_file, 'r').read() assert read_count == 'test : 250\n' def test_plain_fastq_input(runner): input_file = get_test_input_file(format="fastq") output_dir = "./tests/test_results" output_prefix = "test_plain_fasta" result = runner.invoke(cli.main, ['fastq', '--output_dir', output_dir, '--prefix', output_prefix, '--force', input_file]) if result.exception: traceback.print_exception(*result.exc_info) assert result.exit_code == 0 output_file = os.path.join(output_dir, output_prefix + ".txt") read_count = open(output_file, 'r').read() assert read_count == 'test : 250\n' def test_gz_fq(runner): input_file = get_test_input_file(format='fq', compress_type='gz') output_dir = "./tests/test_results" output_prefix = "test_gz_fastq" result = runner.invoke(cli.main, ['fastq', '--output_dir', output_dir, '--prefix', output_prefix, '--force', input_file]) if result.exception: traceback.print_exception(*result.exc_info) assert result.exit_code == 0 output_file = os.path.join(output_dir, output_prefix + ".txt") read_count = open(output_file, 'r').read() assert read_count == 'test : 250\n' def test_bz2_fq(runner): input_file = get_test_input_file(format='fq', compress_type='bz2') output_dir = "./tests/test_results" output_prefix = "test_bz2_fastq" result = runner.invoke(cli.main, ['fastq', '--output_dir', output_dir, '--prefix', output_prefix, '--force', input_file]) if result.exception: traceback.print_exception(*result.exc_info) assert result.exit_code == 0 output_file = os.path.join(output_dir, output_prefix + ".txt") read_count = open(output_file, 'r').read() assert read_count == 'test : 250\n' def test_zip_fq(runner): input_file = get_test_input_file(format='fq', compress_type='zip') output_dir = "./tests/test_results" output_prefix = "test_zip_fastq" result = runner.invoke(cli.main, ['fastq', '--output_dir', output_dir, '--prefix', output_prefix, '--force', input_file]) if result.exception: traceback.print_exception(*result.exc_info) assert result.exit_code == 0 output_file = os.path.join(output_dir, output_prefix + ".txt") read_count = open(output_file, 'r').read() assert read_count == 'test : 250\n' def test_input_fastqc_folder(runner): input_file = pkg_resources.resource_filename(__name__, 'test_data/sample2_fastqc') output_dir = "./tests/test_results" output_prefix = "test_input_fastqc_folder" result = runner.invoke(cli.main, ['fastqc', '--output_dir', output_dir, '--prefix', output_prefix, '--force', input_file]) if result.exception: traceback.print_exception(*result.exc_info) assert result.exit_code == 0 output_file = os.path.join(output_dir, output_prefix + ".txt") read_count = open(output_file, 'r').read() assert read_count == 'sample2_fastqc : 12733986\n' def test_input_fastqc_zip(runner): input_file = pkg_resources.resource_filename(__name__, 'test_data/sample1_fastqc.zip') output_dir = "./tests/test_results" output_prefix = "test_input_fastqc_zip" result = runner.invoke(cli.main, ['fastqc', '--output_dir', output_dir, '--prefix', output_prefix, '--force', input_file]) if result.exception: traceback.print_exception(*result.exc_info) assert result.exit_code == 0 output_file = os.path.join(output_dir, output_prefix + ".txt") read_count = open(output_file, 'r').read() assert read_count == 'sample1_fastqc : 12733986\n' def test_input_bam_file(runner): input_file = pkg_resources.resource_filename(__name__, 'test_data/test.bam') input_count_file = pkg_resources.resource_filename(__name__, 'test_data/bam_read_number.txt') output_dir = "./tests/test_results" output_prefix = "test_input_bam_file" result = runner.invoke(cli.main, ['bam', '--output_dir', output_dir, '--prefix', output_prefix, '--force', input_file]) if result.exception: traceback.print_exception(*result.exc_info) assert result.exit_code == 0 output_file = os.path.join(output_dir, output_prefix + ".txt") read_count = open(output_file, 'r').read() ret_code = subprocess.check_call("diff {in_count} {out_count}".format(in_count=input_count_file, out_count=output_file), shell=True) assert ret_code == 0
41.093264
146
0.611903
938
7,931
4.850746
0.118337
0.071209
0.059341
0.050769
0.777802
0.753846
0.735385
0.735385
0.708791
0.679121
0
0.009288
0.266927
7,931
192
147
41.307292
0.773306
0.015887
0
0.610063
0
0
0.150745
0.023498
0
0
0
0
0.138365
1
0.081761
false
0
0.062893
0.006289
0.157233
0.056604
0
0
0
null
0
0
0
0
1
1
1
1
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
5
a9588271b9a570b56173e1ed5d53a04cee8df54c
107
py
Python
high_level.py
LokiTheGodOfBitchez/Lab_4
9de2bbfd3e438f9963a756dc88cd7f5de8eb4cf2
[ "MIT" ]
null
null
null
high_level.py
LokiTheGodOfBitchez/Lab_4
9de2bbfd3e438f9963a756dc88cd7f5de8eb4cf2
[ "MIT" ]
null
null
null
high_level.py
LokiTheGodOfBitchez/Lab_4
9de2bbfd3e438f9963a756dc88cd7f5de8eb4cf2
[ "MIT" ]
null
null
null
a = int(input("Enter number a: ")) b = int(input("Enter number b: ")) i = a % b j = b % a print(i * j + 1)
17.833333
34
0.523364
22
107
2.545455
0.454545
0.285714
0.464286
0.678571
0
0
0
0
0
0
0
0.0125
0.252336
107
5
35
21.4
0.6875
0
0
0
0
0
0.299065
0
0
0
0
0
0
1
0
false
0
0
0
0
0.2
1
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
5
a970349a2b9ed324d26a73227934360bc4aec629
31
py
Python
datasets/femnist/__init__.py
ayush268/RecoEdge
b6554c646bae602704f44ae80571a4c319f90fd2
[ "Apache-2.0" ]
5
2022-02-27T17:01:17.000Z
2022-03-29T10:06:18.000Z
datasets/femnist/__init__.py
ayush268/RecoEdge
b6554c646bae602704f44ae80571a4c319f90fd2
[ "Apache-2.0" ]
16
2022-02-26T13:29:04.000Z
2022-03-29T08:20:01.000Z
datasets/femnist/__init__.py
ayush268/RecoEdge
b6554c646bae602704f44ae80571a4c319f90fd2
[ "Apache-2.0" ]
6
2022-03-04T14:53:11.000Z
2022-03-23T12:33:14.000Z
from . import femnist_processor
31
31
0.870968
4
31
6.5
1
0
0
0
0
0
0
0
0
0
0
0
0.096774
31
1
31
31
0.928571
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
0
0
0
5
a9a016e7bb9b1c8ffe2dbfc9c8555219d01c8a33
168
py
Python
tcheasy/__init__.py
No9005/tcheasy
35dbf27ef00b4a6e17cd085eeda0868c83d354ef
[ "MIT" ]
null
null
null
tcheasy/__init__.py
No9005/tcheasy
35dbf27ef00b4a6e17cd085eeda0868c83d354ef
[ "MIT" ]
null
null
null
tcheasy/__init__.py
No9005/tcheasy
35dbf27ef00b4a6e17cd085eeda0868c83d354ef
[ "MIT" ]
null
null
null
""" Imports the decorator for easy imports """ from .type_check import tcheasy from .sort_parameters import sort_parameters as sorpa from .version import __version__
16.8
53
0.803571
23
168
5.565217
0.652174
0.21875
0
0
0
0
0
0
0
0
0
0
0.142857
168
10
54
16.8
0.888889
0.22619
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
8d28cfa38a3a1ab2362289323f92072ee91bca86
151
py
Python
tests/conftest.py
GabrielIFPB/flask-delivery
c46fe31103729cf67538052c9946448bde54f0b1
[ "MIT" ]
null
null
null
tests/conftest.py
GabrielIFPB/flask-delivery
c46fe31103729cf67538052c9946448bde54f0b1
[ "MIT" ]
null
null
null
tests/conftest.py
GabrielIFPB/flask-delivery
c46fe31103729cf67538052c9946448bde54f0b1
[ "MIT" ]
null
null
null
import pytest from delivery.app import create_app @pytest.fixture(scope='module') def app(): """Instance of main app flask""" return create_app()
15.1
35
0.735099
22
151
4.954545
0.681818
0.165138
0
0
0
0
0
0
0
0
0
0
0.139073
151
9
36
16.777778
0.838462
0.172185
0
0
0
0
0.050847
0
0
0
0
0
0
1
0.2
true
0
0.4
0
0.8
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
8d76b8b176913ef51d25ec414fb354f6842e6cab
51
py
Python
winnow/utils/__init__.py
stepan-anokhin/VideoDeduplication
27d7726601ded654ac3710952baf989674aecf7e
[ "MIT" ]
1
2020-10-09T07:33:11.000Z
2020-10-09T07:33:11.000Z
winnow/utils/__init__.py
stepan-anokhin/VideoDeduplication
27d7726601ded654ac3710952baf989674aecf7e
[ "MIT" ]
null
null
null
winnow/utils/__init__.py
stepan-anokhin/VideoDeduplication
27d7726601ded654ac3710952baf989674aecf7e
[ "MIT" ]
null
null
null
from .utils import * from .scene_detection import *
25.5
30
0.784314
7
51
5.571429
0.714286
0
0
0
0
0
0
0
0
0
0
0
0.137255
51
2
30
25.5
0.886364
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
a5f352917a935e33323cf8ae659f3f6d96dd2e9f
171
py
Python
gerardozavala.py
Instituto-i2ds/repo-to-fork
459db8dc009830a8302df6b8bddd073d54a294b8
[ "Apache-2.0" ]
null
null
null
gerardozavala.py
Instituto-i2ds/repo-to-fork
459db8dc009830a8302df6b8bddd073d54a294b8
[ "Apache-2.0" ]
3
2020-10-02T22:26:50.000Z
2020-11-03T17:12:43.000Z
gerardozavala.py
Instituto-i2ds/repo-to-fork
459db8dc009830a8302df6b8bddd073d54a294b8
[ "Apache-2.0" ]
18
2020-09-08T03:47:19.000Z
2021-06-02T03:22:16.000Z
def generate_odd_nums(start, end): for num in range(start, end+1): if num % 2 !=0: print(num, end=" ") generate_odd_nums(start = 0, end = 15)
15.545455
38
0.561404
27
171
3.407407
0.592593
0.23913
0.326087
0.434783
0
0
0
0
0
0
0
0.05
0.298246
171
10
39
17.1
0.716667
0
0
0
1
0
0.005882
0
0
0
0
0
0
1
0.2
false
0
0
0
0.2
0.2
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
a5ff5d3b83c1f0a88d6afd19825e3c8b0af34023
90
py
Python
search/admin.py
RalXYZ/meow-search
74e9866184f98f808b042aa0ab92dde14561ca5d
[ "MIT" ]
2
2020-09-14T08:06:16.000Z
2021-03-20T09:57:20.000Z
search/admin.py
RalXYZ/meow-search
74e9866184f98f808b042aa0ab92dde14561ca5d
[ "MIT" ]
null
null
null
search/admin.py
RalXYZ/meow-search
74e9866184f98f808b042aa0ab92dde14561ca5d
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import Result admin.site.register(Result)
15
32
0.811111
13
90
5.615385
0.692308
0
0
0
0
0
0
0
0
0
0
0
0.122222
90
5
33
18
0.924051
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
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
1
0
1
0
1
0
0
5
5730a7099d9c6956ad6d66922199469d5d371a76
666
py
Python
tripaille/commands/cmd_expression.py
mboudet/python-tripal
c1d0128b16b7c0d3794e217993b053bf0fb64a71
[ "MIT" ]
3
2017-09-08T15:16:07.000Z
2019-07-18T12:00:18.000Z
tripaille/commands/cmd_expression.py
abretaud/python-tripal
9988f5a648a40be21d2ae553b2eda91c15fa881e
[ "MIT" ]
9
2018-04-21T14:33:50.000Z
2019-02-08T09:59:32.000Z
tripaille/commands/cmd_expression.py
abretaud/python-tripal
9988f5a648a40be21d2ae553b2eda91c15fa881e
[ "MIT" ]
2
2018-09-04T13:00:40.000Z
2018-12-04T14:59:33.000Z
import click from tripaille.commands.expression.add_biomaterial import cli as func0 from tripaille.commands.expression.add_expression import cli as func1 from tripaille.commands.expression.delete_biomaterials import cli as func2 from tripaille.commands.expression.get_biomaterials import cli as func3 from tripaille.commands.expression.get_biomaterials_tripal import cli as func4 from tripaille.commands.expression.sync_biomaterials import cli as func5 @click.group() def cli(): """Manage Tripal expressions""" pass cli.add_command(func0) cli.add_command(func1) cli.add_command(func2) cli.add_command(func3) cli.add_command(func4) cli.add_command(func5)
30.272727
78
0.831832
95
666
5.694737
0.284211
0.144177
0.232902
0.343808
0.295749
0.170055
0
0
0
0
0
0.019901
0.094595
666
21
79
31.714286
0.87728
0.037538
0
0
0
0
0
0
0
0
0
0
0
1
0.0625
true
0.0625
0.4375
0
0.5
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
0
0
0
5
93eb7ef9ca98517ed67265be6f8b215799d7ff6a
41
py
Python
python/smqtk/representation/detection_element/__init__.py
Purg/SMQTK
705a2b2979935ed129aac7db578571c4ae1343e7
[ "BSD-3-Clause" ]
1
2021-04-25T16:53:50.000Z
2021-04-25T16:53:50.000Z
python/smqtk/representation/detection_element/__init__.py
Purg/SMQTK
705a2b2979935ed129aac7db578571c4ae1343e7
[ "BSD-3-Clause" ]
3
2021-09-08T02:17:49.000Z
2022-03-12T00:40:33.000Z
python/smqtk/representation/detection_element/__init__.py
Purg/SMQTK
705a2b2979935ed129aac7db578571c4ae1343e7
[ "BSD-3-Clause" ]
null
null
null
from ._interface import DetectionElement
20.5
40
0.878049
4
41
8.75
1
0
0
0
0
0
0
0
0
0
0
0
0.097561
41
1
41
41
0.945946
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
0
0
0
5
9e1a227e73cf26bcacc43897fa9243fae3ae80a7
54
py
Python
Lib/test/test_compiler/testcorpus/32_func_global_nested.py
diogommartins/cinder
79103e9119cbecef3b085ccf2878f00c26e1d175
[ "CNRI-Python-GPL-Compatible" ]
1,886
2021-05-03T23:58:43.000Z
2022-03-31T19:15:58.000Z
Lib/test/test_compiler/testcorpus/32_func_global_nested.py
diogommartins/cinder
79103e9119cbecef3b085ccf2878f00c26e1d175
[ "CNRI-Python-GPL-Compatible" ]
70
2021-05-04T23:25:35.000Z
2022-03-31T18:42:08.000Z
Lib/test/test_compiler/testcorpus/32_func_global_nested.py
diogommartins/cinder
79103e9119cbecef3b085ccf2878f00c26e1d175
[ "CNRI-Python-GPL-Compatible" ]
52
2021-05-04T21:26:03.000Z
2022-03-08T18:02:56.000Z
def foo(): global bar def bar(): pass
10.8
14
0.462963
7
54
3.571429
0.714286
0
0
0
0
0
0
0
0
0
0
0
0.425926
54
4
15
13.5
0.806452
0
0
0
0
0
0
0
0
0
0
0
0
1
0.5
true
0.25
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
1
1
1
0
0
0
0
0
5
f509f1601d30abf846226fcf6425485958e5d112
322
py
Python
craamvert/utils/julday.py
craam/craamvert
ce776346844c83037eb552bdbffb9d5b5c7c9b9d
[ "MIT" ]
null
null
null
craamvert/utils/julday.py
craam/craamvert
ce776346844c83037eb552bdbffb9d5b5c7c9b9d
[ "MIT" ]
null
null
null
craamvert/utils/julday.py
craam/craamvert
ce776346844c83037eb552bdbffb9d5b5c7c9b9d
[ "MIT" ]
1
2021-03-26T22:53:43.000Z
2021-03-26T22:53:43.000Z
from datetime import datetime, timedelta def time(jd): return str((datetime(2001, 1, 1) + timedelta(seconds=jd)).time()) def date(jd): return str((datetime(2001, 1, 1) + timedelta(seconds=jd)).date()) def sec(sec): # return timedelta(seconds=sec).seconds * 1000 return timedelta(seconds=sec).seconds
21.466667
69
0.68323
45
322
4.888889
0.333333
0.290909
0.1
0.172727
0.681818
0.390909
0.390909
0.390909
0.390909
0.390909
0
0.059259
0.161491
322
14
70
23
0.755556
0.136646
0
0
0
0
0
0
0
0
0
0
0
1
0.428571
false
0
0.142857
0.428571
1
0
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
f510092a9cfc9ff218af7edde62f1e13d748d456
72
py
Python
tmp/enable_call_recording.py
dtolb/docstring-extractor
f77ba4bc8e03eaa041eea92fdadf9442e6eb6ca6
[ "MIT" ]
null
null
null
tmp/enable_call_recording.py
dtolb/docstring-extractor
f77ba4bc8e03eaa041eea92fdadf9442e6eb6ca6
[ "MIT" ]
null
null
null
tmp/enable_call_recording.py
dtolb/docstring-extractor
f77ba4bc8e03eaa041eea92fdadf9442e6eb6ca6
[ "MIT" ]
null
null
null
# Example: Enable Call Recording api.enable_call_recording('c-callId')
24
37
0.791667
10
72
5.5
0.7
0.363636
0.690909
0
0
0
0
0
0
0
0
0
0.097222
72
2
38
36
0.846154
0.416667
0
0
0
0
0.205128
0
0
0
0
0
0
1
0
true
0
0
0
0
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
277e7e236d25e2134c2fc1858aebdb4c05bc12af
552
py
Python
utilitiespackage/utilitiespackage/tests/test_crypto.py
GDSLLC/utilities-package
52a3315bb56eb7592be82293f97aeeb3be5988e6
[ "MIT" ]
null
null
null
utilitiespackage/utilitiespackage/tests/test_crypto.py
GDSLLC/utilities-package
52a3315bb56eb7592be82293f97aeeb3be5988e6
[ "MIT" ]
null
null
null
utilitiespackage/utilitiespackage/tests/test_crypto.py
GDSLLC/utilities-package
52a3315bb56eb7592be82293f97aeeb3be5988e6
[ "MIT" ]
null
null
null
import sys import pytest from utilitiespackage.crypto import aes_encrypt, aes_decrypt @pytest.mark.skipif(sys.platform.startswith("darwin") == True, reason="mac has unsupported version of openssl") def test_aes_encrypt(): assert aes_decrypt(aes_encrypt("plaintext", "password"), "password") == b"plaintext" @pytest.mark.skipif(sys.platform.startswith("darwin") == True, reason="mac has unsupported version of openssl") def test_aes_decrypt(): assert aes_decrypt(b"U2FsdGVkX1/5WxdnwB9+rUwtU09n4/3Kp3HauNL1z94=", "password") == b"plaintext"
36.8
111
0.768116
71
552
5.84507
0.450704
0.096386
0.077108
0.091566
0.462651
0.462651
0.462651
0.462651
0.462651
0.462651
0
0.024145
0.099638
552
14
112
39.428571
0.810865
0
0
0.222222
0
0
0.331522
0.07971
0
0
0
0
0.222222
1
0.222222
true
0.222222
0.333333
0
0.555556
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
1
1
0
1
0
0
5
27ad5d4d21013225060eb76ed34aaf5630fbdc90
23
py
Python
reservoir/__init__.py
saromanov/reservoir-sampling
e0021ee80c1c10ad1224483fbc4d335fa859f1a1
[ "MIT" ]
null
null
null
reservoir/__init__.py
saromanov/reservoir-sampling
e0021ee80c1c10ad1224483fbc4d335fa859f1a1
[ "MIT" ]
null
null
null
reservoir/__init__.py
saromanov/reservoir-sampling
e0021ee80c1c10ad1224483fbc4d335fa859f1a1
[ "MIT" ]
null
null
null
from .sampling import *
23
23
0.782609
3
23
6
1
0
0
0
0
0
0
0
0
0
0
0
0.130435
23
1
23
23
0.9
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
0
0
0
5
27dac4e370533b0a9988d3248a0a01384928988f
248
py
Python
identity/test.py
michellab/BioSimSpaceCloud
456b146a2131565e354352872d3e75a08c3652d1
[ "Apache-2.0" ]
2
2019-02-15T16:04:19.000Z
2019-02-19T15:42:27.000Z
identity/test.py
michellab/BioSimSpaceCloud
456b146a2131565e354352872d3e75a08c3652d1
[ "Apache-2.0" ]
null
null
null
identity/test.py
michellab/BioSimSpaceCloud
456b146a2131565e354352872d3e75a08c3652d1
[ "Apache-2.0" ]
null
null
null
import os from Acquire.Service import login_to_service_account from Acquire.Service import create_return_value def run(args): status = 0 message = "TEST" return_value = create_return_value(status, message) return return_value
16.533333
55
0.762097
34
248
5.294118
0.529412
0.244444
0.2
0.266667
0
0
0
0
0
0
0
0.004951
0.185484
248
14
56
17.714286
0.886139
0
0
0
0
0
0.016194
0
0
0
0
0
0
1
0.125
false
0
0.375
0
0.625
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
1
0
1
0
0
5
27e1a67677d3d1564c33b7f5e2fb284858096d71
133
py
Python
__init__.py
greatwallet/cosypose
e72ce7d521ef61870daef267cbbe65aaebe9d24d
[ "MIT" ]
null
null
null
__init__.py
greatwallet/cosypose
e72ce7d521ef61870daef267cbbe65aaebe9d24d
[ "MIT" ]
null
null
null
__init__.py
greatwallet/cosypose
e72ce7d521ef61870daef267cbbe65aaebe9d24d
[ "MIT" ]
null
null
null
import os os.environ['MKL_NUM_THREADS'] = '1' os.environ['OMP_NUM_THREADS'] = '1' print("Setting OMP and MKL num threads to 1.")
26.6
47
0.691729
23
133
3.826087
0.521739
0.340909
0.295455
0
0
0
0
0
0
0
0
0.026549
0.150376
133
4
48
33.25
0.752212
0
0
0
0
0
0.534884
0
0
0
0
0
0
1
0
true
0
0.25
0
0.25
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
1
0
0
0
0
0
0
5
27e932a866f2d97ab0ec87bdb36384252305269d
92
py
Python
ex_4.py
joao-barabba/Exercicios_Python
ceddb0c99ed6b8b2b749c00f227dfc4b95224a85
[ "MIT" ]
null
null
null
ex_4.py
joao-barabba/Exercicios_Python
ceddb0c99ed6b8b2b749c00f227dfc4b95224a85
[ "MIT" ]
null
null
null
ex_4.py
joao-barabba/Exercicios_Python
ceddb0c99ed6b8b2b749c00f227dfc4b95224a85
[ "MIT" ]
null
null
null
def raizI(x,b): if b** 2>x: return b-1 return raizI (x,b+1) raizI(11,5)
18.4
26
0.48913
19
92
2.368421
0.526316
0.266667
0.311111
0
0
0
0
0
0
0
0
0.098361
0.336957
92
5
27
18.4
0.639344
0
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0
0
0
0.6
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
5
fd72096d41e6792dc1db36e189ea0bfe84334019
42
py
Python
sandbox/format_string.py
daviddoret/pyxag
6884c7e100d28c3ce6273248caa40eaeab920bc5
[ "MIT" ]
1
2019-10-27T15:56:27.000Z
2019-10-27T15:56:27.000Z
sandbox/format_string.py
daviddoret/pynag
6884c7e100d28c3ce6273248caa40eaeab920bc5
[ "MIT" ]
11
2019-11-04T18:21:16.000Z
2019-11-07T03:22:41.000Z
sandbox/format_string.py
daviddoret/pynag
6884c7e100d28c3ce6273248caa40eaeab920bc5
[ "MIT" ]
null
null
null
print('test {0} test {1}'.format('a','b'))
42
42
0.547619
8
42
2.875
0.875
0
0
0
0
0
0
0
0
0
0
0.051282
0.071429
42
1
42
42
0.538462
0
0
0
0
0
0.44186
0
0
0
0
0
0
1
0
true
0
0
0
0
1
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
1
0
5
fdc2b7d0ba3519bd7924f9e47ec324389f870d12
64
py
Python
KonoPyUtil/soccer/__init__.py
KonoAnalytics/KonoPyUtil
9a5751962688dafd098ecc27f31b9ac689348efc
[ "Apache-2.0" ]
null
null
null
KonoPyUtil/soccer/__init__.py
KonoAnalytics/KonoPyUtil
9a5751962688dafd098ecc27f31b9ac689348efc
[ "Apache-2.0" ]
null
null
null
KonoPyUtil/soccer/__init__.py
KonoAnalytics/KonoPyUtil
9a5751962688dafd098ecc27f31b9ac689348efc
[ "Apache-2.0" ]
null
null
null
from .elo import get_elo_season, get_elo_match, validate_elo_df
32
63
0.859375
12
64
4.083333
0.666667
0.244898
0
0
0
0
0
0
0
0
0
0
0.09375
64
1
64
64
0.844828
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
fde2a3abb82b04877e7e6638582aa948521a6a2a
57
py
Python
paypalhttp/testutils/__init__.py
cameronmoten/paypalhttp_python
72609783230663b8e34c6f0384837db7b166c8f4
[ "MIT" ]
5
2020-04-25T01:07:23.000Z
2021-10-21T21:39:00.000Z
paypalhttp/testutils/__init__.py
cameronmoten/paypalhttp_python
72609783230663b8e34c6f0384837db7b166c8f4
[ "MIT" ]
3
2020-07-23T12:07:26.000Z
2021-12-01T18:45:36.000Z
paypalhttp/testutils/__init__.py
cameronmoten/paypalhttp_python
72609783230663b8e34c6f0384837db7b166c8f4
[ "MIT" ]
13
2020-03-03T02:35:50.000Z
2022-03-17T18:12:49.000Z
from paypalhttp.testutils.testharness import TestHarness
28.5
56
0.894737
6
57
8.5
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.070175
57
1
57
57
0.962264
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
8bfb308f55b44e46626e597611f36d1cadc97ca8
91
py
Python
wwwhero/exceptions.py
IharSha/build_a_hero
4a0f0aa701c205d04edd6bc801707a73bcc210f2
[ "BSD-3-Clause" ]
null
null
null
wwwhero/exceptions.py
IharSha/build_a_hero
4a0f0aa701c205d04edd6bc801707a73bcc210f2
[ "BSD-3-Clause" ]
2
2021-01-08T11:53:33.000Z
2021-09-23T07:04:20.000Z
wwwhero/exceptions.py
IharSha/build_a_hero
4a0f0aa701c205d04edd6bc801707a73bcc210f2
[ "BSD-3-Clause" ]
null
null
null
class LevelUpCooldownError(Exception): pass class MaxLevelError(Exception): pass
13
38
0.758242
8
91
8.625
0.625
0.376812
0
0
0
0
0
0
0
0
0
0
0.175824
91
6
39
15.166667
0.92
0
0
0.5
0
0
0
0
0
0
0
0
0
1
0
true
0.5
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
0
1
1
0
0
0
0
0
5
e3074e4be445f2548c93ce72ccdf2e703394f343
41
py
Python
desligar-computador.py
douglaspfeffer/brincandoComPython
57c3789c43d42b5da755458cf2a88e65bc81341a
[ "MIT" ]
null
null
null
desligar-computador.py
douglaspfeffer/brincandoComPython
57c3789c43d42b5da755458cf2a88e65bc81341a
[ "MIT" ]
null
null
null
desligar-computador.py
douglaspfeffer/brincandoComPython
57c3789c43d42b5da755458cf2a88e65bc81341a
[ "MIT" ]
null
null
null
import os os.system('shutdown /s /s 1')
10.25
29
0.658537
8
41
3.375
0.75
0
0
0
0
0
0
0
0
0
0
0.029412
0.170732
41
3
30
13.666667
0.764706
0
0
0
0
0
0.390244
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
e32074949ff69f9249b9fefb34cb80afb02749c3
32
py
Python
stubbs/defs/wind.py
holy-crust/reclaimer
0aa693da3866ce7999c68d5f71f31a9c932cdb2c
[ "MIT" ]
null
null
null
stubbs/defs/wind.py
holy-crust/reclaimer
0aa693da3866ce7999c68d5f71f31a9c932cdb2c
[ "MIT" ]
null
null
null
stubbs/defs/wind.py
holy-crust/reclaimer
0aa693da3866ce7999c68d5f71f31a9c932cdb2c
[ "MIT" ]
null
null
null
from ...hek.defs.wind import *
16
31
0.65625
5
32
4.2
1
0
0
0
0
0
0
0
0
0
0
0
0.15625
32
1
32
32
0.777778
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
0
0
0
5
e32da46b8c369c86d3377ee5a4bc2b5d1fa47efe
2,595
py
Python
test/test_timeslots.py
dfioravanti/opening_hours_python
fde9ef349932c6215d5ab9b5b49352dca9f8f1ce
[ "MIT" ]
null
null
null
test/test_timeslots.py
dfioravanti/opening_hours_python
fde9ef349932c6215d5ab9b5b49352dca9f8f1ce
[ "MIT" ]
null
null
null
test/test_timeslots.py
dfioravanti/opening_hours_python
fde9ef349932c6215d5ab9b5b49352dca9f8f1ce
[ "MIT" ]
null
null
null
from datetime import datetime import pytest import pytz from src.internals.timeslots import (Timeslot, ValidationError, prettify_timeslots) from .utils import load_data_results tz = pytz.timezone('GMT') def test_string_representation(): """ Test if the __str__ method returns the correct representation """ opening_string = "1 AM" opening_timestamp = int(datetime.strptime( f"1970-01-01 {opening_string}", "%Y-%m-%d %I %p").replace(tzinfo=tz).timestamp()) closing_string = "5 AM" closing_timestamp = int(datetime.strptime( f"1970-01-01 {closing_string}", "%Y-%m-%d %I %p").replace(tzinfo=tz).timestamp()) string = f"{opening_string} - {closing_string}" timeslot = Timeslot.from_timestamps( opening_timestamp=opening_timestamp, closing_timestamp=closing_timestamp) assert str(timeslot) == string opening_string = "1 AM" opening_timestamp = int(datetime.strptime( f"1970-01-01 {opening_string}", "%Y-%m-%d %I %p").replace(tzinfo=tz).timestamp()) closing_string = "1 AM" closing_timestamp = int(datetime.strptime( f"1970-01-01 {closing_string}", "%Y-%m-%d %I %p").replace(tzinfo=tz).timestamp()) string = f"{opening_string} - {closing_string}" timeslot = Timeslot.from_timestamps( opening_timestamp=opening_timestamp, closing_timestamp=closing_timestamp) assert str(timeslot) == string def test_one_day(): """ Test if the code works as intended when we have only one open day """ test_data, test_data_results = load_data_results(base_filename="one_day") for data, result in zip(test_data, test_data_results): assert prettify_timeslots(data) == result def test_two_days(): """ Test if the code works as intended when we have only two open days """ test_data, test_data_results = load_data_results(base_filename="two_days") for data, result in zip(test_data, test_data_results): assert prettify_timeslots(data) == result def test_full_days(): """ Test if the code works as intended when we having all days """ test_data, test_data_results = load_data_results(base_filename="seven_days") for data, result in zip(test_data, test_data_results): assert prettify_timeslots(data) == result def test_errors(): """ Test if errors are detected correctly """ test_data = load_data_results(base_filename="errors", only_data=True) for data in test_data: with pytest.raises(ValidationError): prettify_timeslots(data)
32.848101
89
0.688632
345
2,595
4.942029
0.226087
0.065689
0.042229
0.056305
0.743695
0.727859
0.727859
0.727859
0.727859
0.727859
0
0.017358
0.200771
2,595
78
90
33.269231
0.804725
0.112524
0
0.533333
0
0
0.127526
0
0
0
0
0
0.111111
1
0.111111
false
0
0.111111
0
0.222222
0
0
0
0
null
0
0
0
0
1
1
1
1
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
5
e3601e7a0d856474d8d27e216d406f389c76dfe5
447
py
Python
Scripts/__init__.py
MeRajat/DocProduct
0ccd542f0c2e1ec3b8fb543cffd19d47a2829c5a
[ "MIT" ]
3
2020-03-06T00:03:30.000Z
2020-05-25T03:51:15.000Z
Scripts/__init__.py
ibrahim85/Medical-Q-A-with-Deep-Language-Models
189ae54d2a64bb924ee50b3a88ae093341684123
[ "MIT" ]
2
2022-02-09T23:37:32.000Z
2022-02-10T01:16:59.000Z
Scripts/__init__.py
SeniorDev009/DocProduct
da959cf6f636cec1fece38178de7237f6efe412a
[ "MIT" ]
null
null
null
from Scripts.train_data_to_embedding import train_data_to_embedding from Scripts.train_embedding_to_gpt2_data import train_embedding_to_gpt2_data from Scripts.train_ffn import train_ffn from Scripts.train_bertffn import train_bertffn from Scripts.train_gpt2 import train_gpt2 from Scripts import tokenization from Scripts import loss from Scripts import metrics from Scripts import dataset from Scripts import models from Scripts import predictor
37.25
77
0.89038
69
447
5.478261
0.231884
0.320106
0.269841
0.10582
0.126984
0
0
0
0
0
0
0.009926
0.098434
447
11
78
40.636364
0.92804
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
1
0
1
0
0
5
e361a9fe665477ae76bd619b9fc2a9cf863ffd48
60
py
Python
app/apps/home/__init__.py
umbibio/babesia_dash_app
ccf8c435f80fb1fc299810fba4ccb09323e491cd
[ "MIT" ]
null
null
null
app/apps/home/__init__.py
umbibio/babesia_dash_app
ccf8c435f80fb1fc299810fba4ccb09323e491cd
[ "MIT" ]
null
null
null
app/apps/home/__init__.py
umbibio/babesia_dash_app
ccf8c435f80fb1fc299810fba4ccb09323e491cd
[ "MIT" ]
null
null
null
import apps.home.callbacks from apps.home.layouts import *
15
31
0.8
9
60
5.333333
0.666667
0.333333
0
0
0
0
0
0
0
0
0
0
0.116667
60
3
32
20
0.90566
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
e37fe49e8a36fc766b3d42fa6b3b03e76bceabb5
31
py
Python
clinicadl/utils/cli_param/__init__.py
Raelag0112/clinicadl
4b9508ea6bbe5498069b1d76ad2c3636f67e3184
[ "MIT" ]
25
2021-08-01T05:52:34.000Z
2022-03-22T04:18:01.000Z
clinicadl/utils/cli_param/__init__.py
Raelag0112/clinicadl
4b9508ea6bbe5498069b1d76ad2c3636f67e3184
[ "MIT" ]
82
2021-07-12T08:28:36.000Z
2022-03-02T16:12:04.000Z
clinicadl/utils/cli_param/__init__.py
Raelag0112/clinicadl
4b9508ea6bbe5498069b1d76ad2c3636f67e3184
[ "MIT" ]
12
2021-07-30T08:01:02.000Z
2022-03-14T11:45:03.000Z
from . import argument, option
15.5
30
0.774194
4
31
6
1
0
0
0
0
0
0
0
0
0
0
0
0.16129
31
1
31
31
0.923077
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
0
0
0
5
8b6fe2132c0c26b12eb3499c9c4e8d48a2f3182f
115
py
Python
textattack/commands/__init__.py
k-ivey/TextAttack
47d15acea90bf92e6a7f19200a59da29e74731e6
[ "MIT" ]
1
2020-12-04T18:05:44.000Z
2020-12-04T18:05:44.000Z
textattack/commands/__init__.py
k-ivey/TextAttack
47d15acea90bf92e6a7f19200a59da29e74731e6
[ "MIT" ]
null
null
null
textattack/commands/__init__.py
k-ivey/TextAttack
47d15acea90bf92e6a7f19200a59da29e74731e6
[ "MIT" ]
null
null
null
from abc import ABC, abstractmethod from .textattack_command import TextAttackCommand from . import textattack_cli
28.75
49
0.86087
14
115
6.928571
0.571429
0
0
0
0
0
0
0
0
0
0
0
0.113043
115
3
50
38.333333
0.95098
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
8bae66da8f724665e2ac7a2ccfcc31008fee2ab0
70
py
Python
sprint/tools_fq/__init__.py
jumphone/sprint
94a5e5450d73b357497fba11eef818c6cc8792aa
[ "MIT" ]
44
2018-03-09T22:22:50.000Z
2021-09-15T09:40:54.000Z
sprint/tools_fq/__init__.py
jumphone/sprint
94a5e5450d73b357497fba11eef818c6cc8792aa
[ "MIT" ]
30
2018-03-19T05:30:05.000Z
2022-01-21T06:54:45.000Z
sprint/tools_fq/__init__.py
jumphone/sprint
94a5e5450d73b357497fba11eef818c6cc8792aa
[ "MIT" ]
13
2018-06-30T10:07:02.000Z
2021-06-10T13:25:43.000Z
from cut import * from get_baseq_cutoff import * from maskfq import *
17.5
30
0.785714
11
70
4.818182
0.636364
0.377358
0
0
0
0
0
0
0
0
0
0
0.171429
70
3
31
23.333333
0.913793
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
8bc990de46b934972e01f0c8538c107eb4320eae
10,589
py
Python
trove_tempest_plugin/tests/scenario/test_instance_actions.py
openstack/trove-tempest-plugin
5de39645ed4c5f12526863d1546769dce74fcb08
[ "Apache-2.0" ]
6
2018-08-02T12:10:56.000Z
2019-01-28T22:13:06.000Z
trove_tempest_plugin/tests/scenario/test_instance_actions.py
openstack/trove-tempest-plugin
5de39645ed4c5f12526863d1546769dce74fcb08
[ "Apache-2.0" ]
null
null
null
trove_tempest_plugin/tests/scenario/test_instance_actions.py
openstack/trove-tempest-plugin
5de39645ed4c5f12526863d1546769dce74fcb08
[ "Apache-2.0" ]
3
2018-03-05T22:33:17.000Z
2019-09-04T12:35:18.000Z
# Copyright 2020 Catalyst Cloud # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from tempest import config from tempest.lib import decorators import testtools from trove_tempest_plugin.tests import constants from trove_tempest_plugin.tests.scenario import base_actions from trove_tempest_plugin.tests import utils CONF = config.CONF class InstanceActionsMySQLBase(base_actions.TestInstanceActionsBase): @classmethod def init_db(cls, ip, username=constants.DB_USER, password=constants.DB_PASS, database=constants.DB_NAME): db_url = f'mysql+pymysql://{username}:{password}@{ip}:3306/{database}' with utils.SQLClient(db_url) as db_client: cmds = [ "CREATE TABLE Persons (ID int, String varchar(255));", ] db_client.mysql_execute(cmds) def insert_data_upgrade(self, ip, username=constants.DB_USER, password=constants.DB_PASS, database=constants.DB_NAME): db_url = f'mysql+pymysql://{username}:{password}@{ip}:3306/{database}' with utils.SQLClient(db_url) as db_client: cmds = [ "insert into Persons VALUES (99, 'Upgrade');" ] db_client.mysql_execute(cmds) def verify_data_upgrade(self, ip, username=constants.DB_USER, password=constants.DB_PASS, database=constants.DB_NAME): db_url = f'mysql+pymysql://{username}:{password}@{ip}:3306/{database}' with utils.SQLClient(db_url) as db_client: cmd = "select * from Persons;" ret = db_client.mysql_execute(cmd) keys = ret.keys() rows = ret.fetchall() self.assertGreaterEqual(len(rows), 1) result = [] for index in range(len(rows)): result.append(dict(zip(keys, rows[index]))) expected = {'ID': 99, 'String': 'Upgrade'} self.assert_single_item(result, **expected) def insert_data_before_rebuild(self, ip, username=constants.DB_USER, password=constants.DB_PASS, database=constants.DB_NAME): db_url = f'mysql+pymysql://{username}:{password}@{ip}:3306/{database}' with utils.SQLClient(db_url) as db_client: cmds = [ "CREATE TABLE Rebuild (ID int, String varchar(255));", "insert into Rebuild VALUES (1, 'rebuild-data');" ] db_client.mysql_execute(cmds) def verify_data_after_rebuild(self, ip, username=constants.DB_USER, password=constants.DB_PASS, database=constants.DB_NAME): db_url = f'mysql+pymysql://{username}:{password}@{ip}:3306/{database}' with utils.SQLClient(db_url) as db_client: cmd = "select * from Rebuild;" ret = db_client.mysql_execute(cmd) keys = ret.keys() rows = ret.fetchall() self.assertEqual(1, len(rows)) actual = dict(zip(keys, rows[0])) expected = {'ID': 1, 'String': 'rebuild-data'} self.assertEqual(expected, actual) def get_db_version(self, ip, username=constants.DB_USER, password=constants.DB_PASS): db_url = f'mysql+pymysql://{username}:{password}@{ip}:3306' with utils.SQLClient(db_url) as db_client: cmd = "SELECT @@GLOBAL.innodb_version;" ret = db_client.mysql_execute(cmd) return ret.first()[0] def get_config_value(self, ip, option, username=constants.DB_USER, password=constants.DB_PASS): db_url = f'mysql+pymysql://{username}:{password}@{ip}:3306' with utils.SQLClient(db_url) as db_client: cmd = f"show variables where Variable_name in ('{option}');" ret = db_client.mysql_execute(cmd) rows = ret.fetchall() self.assertEqual(1, len(rows)) return int(rows[0][1]) class TestInstanceActionsMySQL(InstanceActionsMySQLBase): datastore = 'mysql' @decorators.idempotent_id("be6dd514-27d6-11ea-a56a-98f2b3cc23a0") @testtools.skipUnless( 'mysql' in CONF.database.pre_upgrade_datastore_versions, 'Datastore upgrade is disabled.') def test_instance_upgrade(self): self.instance_upgrade_test() @decorators.idempotent_id("27914e82-b061-11ea-b87c-00224d6b7bc1") def test_resize(self): self.resize_test() @decorators.idempotent_id("8d4d675c-d829-11ea-b87c-00224d6b7bc1") @testtools.skipUnless(CONF.database.rebuild_image_id, 'Image for rebuild not configured.') def test_rebuild(self): config_values = {"max_connections": 555} self.rebuild_test(config_values) class TestInstanceActionsMariaDB(InstanceActionsMySQLBase): datastore = 'mariadb' @decorators.idempotent_id("f7a0fef6-f413-11ea-a950-00224d6b7bc1") @testtools.skipUnless( 'mariadb' in CONF.database.pre_upgrade_datastore_versions, 'Datastore upgrade is disabled.') def test_instance_upgrade(self): self.instance_upgrade_test() @decorators.idempotent_id("fb89d402-f413-11ea-a950-00224d6b7bc1") def test_resize(self): self.resize_test() @decorators.idempotent_id("ff34768e-f413-11ea-a950-00224d6b7bc1") @testtools.skipUnless(CONF.database.rebuild_image_id, 'Image for rebuild not configured.') def test_rebuild(self): config_values = {"max_connections": 555} self.rebuild_test(config_values) class TestInstanceActionsPostgreSQL(base_actions.TestInstanceActionsBase): datastore = 'postgresql' create_user = False enable_root = True @classmethod def init_db(cls, ip): db_url = (f'postgresql+psycopg2://root:{cls.password}@' f'{ip}:5432/postgres') with utils.SQLClient(db_url) as db_client: cmd = "CREATE DATABASE testdb;" db_client.pgsql_execute(cmd) db_url = (f'postgresql+psycopg2://root:{cls.password}@' f'{ip}:5432/testdb') with utils.SQLClient(db_url) as db_client: cmds = [ "CREATE TABLE persons (id INT PRIMARY KEY NOT NULL, " "string VARCHAR(255));", ] db_client.pgsql_execute(cmds) def insert_data_upgrade(self, ip): db_url = (f'postgresql+psycopg2://root:{self.password}@' f'{ip}:5432/testdb') with utils.SQLClient(db_url) as db_client: cmds = [ "insert into Persons VALUES (99, 'Upgrade');" ] db_client.pgsql_execute(cmds) def verify_data_upgrade(self, ip): db_url = (f'postgresql+psycopg2://root:{self.password}@' f'{ip}:5432/testdb') with utils.SQLClient(db_url) as db_client: cmd = "select * from Persons;" ret = db_client.pgsql_execute(cmd) keys = ret.keys() rows = ret.fetchall() self.assertGreaterEqual(len(rows), 1) result = [] for index in range(len(rows)): result.append(dict(zip(keys, rows[index]))) expected = {'id': 99, 'string': 'Upgrade'} self.assert_single_item(result, **expected) def insert_data_before_rebuild(self, ip): db_url = (f'postgresql+psycopg2://root:{self.password}@' f'{ip}:5432/testdb') with utils.SQLClient(db_url) as db_client: cmds = [ "CREATE TABLE Rebuild (ID int, String varchar(255));", "insert into Rebuild VALUES (1, 'rebuild-data');" ] db_client.pgsql_execute(cmds) def verify_data_after_rebuild(self, ip): db_url = (f'postgresql+psycopg2://root:{self.password}@' f'{ip}:5432/testdb') with utils.SQLClient(db_url) as db_client: cmd = "select * from Rebuild;" ret = db_client.pgsql_execute(cmd) keys = ret.keys() rows = ret.fetchall() self.assertEqual(1, len(rows)) actual = dict(zip(keys, rows[0])) expected = {'id': 1, 'string': 'rebuild-data'} self.assertEqual(expected, actual) def get_db_version(self, ip, username=constants.DB_USER, password=constants.DB_PASS): db_url = (f'postgresql+psycopg2://root:{self.password}@' f'{ip}:5432/postgres') with utils.SQLClient(db_url) as db_client: cmd = "SHOW server_version;" ret = db_client.pgsql_execute(cmd) version = ret.first()[0] return version.split(' ')[0] def get_config_value(self, ip, option): db_url = (f'postgresql+psycopg2://root:{self.password}@' f'{ip}:5432/postgres') with utils.SQLClient(db_url) as db_client: cmd = f"SELECT setting FROM pg_settings WHERE name='{option}';" ret = db_client.pgsql_execute(cmd) rows = ret.fetchall() self.assertEqual(1, len(rows)) return int(rows[0][0]) @decorators.idempotent_id("97f1e7ca-f415-11ea-a950-00224d6b7bc1") @testtools.skipUnless( 'postgresql' in CONF.database.pre_upgrade_datastore_versions, 'Datastore upgrade is disabled.') def test_instance_upgrade(self): self.instance_upgrade_test() @decorators.idempotent_id("9b940c00-f415-11ea-a950-00224d6b7bc1") def test_resize(self): self.resize_test() @decorators.idempotent_id("9ec5dd54-f415-11ea-a950-00224d6b7bc1") @testtools.skipUnless(CONF.database.rebuild_image_id, 'Image for rebuild not configured.') def test_rebuild(self): config_values = {"max_connections": 101} self.rebuild_test(config_values, config_need_restart=True)
39.808271
78
0.609878
1,220
10,589
5.12623
0.17459
0.023985
0.014391
0.047969
0.787016
0.769587
0.71906
0.71874
0.693156
0.683882
0
0.04012
0.277363
10,589
265
79
39.958491
0.777182
0.054585
0
0.685446
0
0
0.220566
0.107432
0
0
0
0
0.046948
1
0.107981
false
0.107981
0.028169
0
0.197183
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
1
0
0
0
0
0
5
8bd21dd8d00547d9c6b311aebb0210cf990d5280
3,583
py
Python
tests/test_typing_utils.py
adevore/djangorestframework-dataclasses
96d7b6c56b5321ae809a486e8962421dad566a7b
[ "BSD-3-Clause" ]
1
2021-12-12T04:23:17.000Z
2021-12-12T04:23:17.000Z
tests/test_typing_utils.py
adevore/djangorestframework-dataclasses
96d7b6c56b5321ae809a486e8962421dad566a7b
[ "BSD-3-Clause" ]
null
null
null
tests/test_typing_utils.py
adevore/djangorestframework-dataclasses
96d7b6c56b5321ae809a486e8962421dad566a7b
[ "BSD-3-Clause" ]
null
null
null
import typing from unittest import TestCase from rest_framework_dataclasses import typing_utils class TypingTest(TestCase): def test_iterable(self): self.assertTrue(typing_utils.is_iterable_type(typing.Iterable[str])) self.assertTrue(typing_utils.is_iterable_type(typing.Collection[str])) self.assertTrue(typing_utils.is_iterable_type(typing.Mapping[str, int])) self.assertTrue(typing_utils.is_iterable_type(typing.Sequence[str])) self.assertTrue(typing_utils.is_iterable_type(typing.List[str])) self.assertTrue(typing_utils.is_iterable_type(typing.Dict[str, int])) self.assertTrue(typing_utils.is_iterable_type(typing.Set[str])) self.assertTrue(typing_utils.is_iterable_type(typing.Generator[str, int, int])) self.assertFalse(typing_utils.is_iterable_type(str)) self.assertFalse(typing_utils.is_iterable_type(bytes)) self.assertFalse(typing_utils.is_iterable_type(int)) self.assertFalse(typing_utils.is_iterable_type(TypingTest)) self.assertEqual(typing_utils.get_iterable_element_type(typing.Iterable[str]), str) self.assertEqual(typing_utils.get_iterable_element_type(typing.Collection[str]), str) self.assertEqual(typing_utils.get_iterable_element_type(typing.Mapping[str, int]), str) self.assertEqual(typing_utils.get_iterable_element_type(typing.Sequence[str]), str) self.assertEqual(typing_utils.get_iterable_element_type(typing.List[str]), str) self.assertEqual(typing_utils.get_iterable_element_type(typing.Dict[str, int]), str) self.assertEqual(typing_utils.get_iterable_element_type(typing.Set[str]), str) self.assertEqual(typing_utils.get_iterable_element_type(typing.Generator[str, int, int]), str) with self.assertRaises(ValueError): typing_utils.get_iterable_element_type(str) def test_mapping(self): self.assertTrue(typing_utils.is_mapping_type(typing.Mapping[str, int])) self.assertTrue(typing_utils.is_mapping_type(typing.Dict[str, int])) self.assertFalse(typing_utils.is_mapping_type(str)) self.assertFalse(typing_utils.is_mapping_type(int)) self.assertFalse(typing_utils.is_mapping_type(TypingTest)) self.assertEqual(typing_utils.get_mapping_value_type(typing.Mapping[str, int]), int) self.assertEqual(typing_utils.get_mapping_value_type(typing.Dict[str, int]), int) with self.assertRaises(ValueError): typing_utils.get_mapping_value_type(str) def test_optional(self): self.assertTrue(typing_utils.is_optional_type(typing.Optional[str])) self.assertTrue(typing_utils.is_optional_type(typing.Union[str, None])) self.assertTrue(typing_utils.is_optional_type(typing.Union[str, typing.Optional[str]])) self.assertTrue(typing_utils.is_optional_type(typing.Union[str, typing.Union[str, None]])) self.assertFalse(typing_utils.is_optional_type(str)) self.assertFalse(typing_utils.is_optional_type(int)) self.assertFalse(typing_utils.is_optional_type(TypingTest)) self.assertEqual(typing_utils.get_optional_type(typing.Optional[str]), str) self.assertEqual(typing_utils.get_optional_type(typing.Union[str, None]), str) self.assertEqual(typing_utils.get_optional_type(typing.Union[str, typing.Optional[str]]), str) self.assertEqual(typing_utils.get_optional_type(typing.Union[str, typing.Union[str, None]]), str) with self.assertRaises(ValueError): typing_utils.get_optional_type(str)
55.984375
105
0.754954
472
3,583
5.432203
0.082627
0.180187
0.121685
0.136505
0.907956
0.890016
0.851404
0.724649
0.553042
0.393136
0
0
0.13592
3,583
63
106
56.873016
0.828165
0
0
0.058824
0
0
0
0
0
0
0
0
0.803922
1
0.058824
false
0
0.058824
0
0.137255
0
0
0
0
null
0
0
0
1
1
1
1
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
5
8be7c45075fcf48aaa9b6aa7ba233ac4ee967f97
6,818
py
Python
future_years/test/test_columns_in_views.py
uktrade/fadmin2
0f774400fb816c9ca30e30b25ae542135966e185
[ "MIT" ]
null
null
null
future_years/test/test_columns_in_views.py
uktrade/fadmin2
0f774400fb816c9ca30e30b25ae542135966e185
[ "MIT" ]
6
2022-01-17T16:14:53.000Z
2022-03-30T08:31:56.000Z
future_years/test/test_columns_in_views.py
uktrade/fadmin2
0f774400fb816c9ca30e30b25ae542135966e185
[ "MIT" ]
null
null
null
from django.urls import reverse from future_years.test.future_year_utils import FutureYearForecastSetup class ViewFutureForecastColumnTest(FutureYearForecastSetup): year_to_date_header = "Year to Date Actuals" budget_spent_to_date_header = "budget spent to date" def check_response(self, response): self.assertEqual(response.status_code, 200) self.assertContains(response, "govuk-table") self.assertNotContains(response, self.year_to_date_header) self.assertNotContains(response, self.budget_spent_to_date_header) def test_view_cost_centre_summary(self): response = self.client.get( reverse( "forecast_cost_centre", kwargs={ "cost_centre_code": self.cost_centre_code, "period": self.future_year, }, ), ) self.check_response(response) def test_view_directorate_summary(self): response = self.client.get( reverse( "forecast_directorate", kwargs={ "directorate_code": self.directorate_code, "period": self.future_year, }, ), ) self.check_response(response) def test_view_group_summary(self): response = self.client.get( reverse( "forecast_group", kwargs={ "group_code": self.group_code, "period": self.future_year, }, ) ) self.check_response(response) def test_view_dit_summary(self): response = self.client.get( reverse( "forecast_dit", kwargs={ "period": self.future_year, }, ) ) self.check_response(response) def test_view_cost_centre_nac_details(self): resp = self.client.get( reverse( "expenditure_details_cost_centre", kwargs={ "cost_centre_code": self.cost_centre_code, "expenditure_category": self.expenditure_category_id, "budget_type": self.budget_type_id, "period": self.future_year, }, ), ) self.check_response(resp) def test_view_directory_nac_details(self): resp = self.client.get( reverse( "expenditure_details_directorate", kwargs={ "directorate_code": self.directorate_code, "expenditure_category": self.expenditure_category_id, "budget_type": self.budget_type_id, "period": self.future_year, }, ), ) self.check_response(resp) def test_view_group_nac_details(self): resp = self.client.get( reverse( "expenditure_details_group", kwargs={ "group_code": self.group_code, "expenditure_category": self.expenditure_category_id, "budget_type": self.budget_type_id, "period": self.future_year, }, ), ) self.check_response(resp) def test_view_dit_nac_details(self): resp = self.client.get( reverse( "expenditure_details_dit", kwargs={ "expenditure_category": self.expenditure_category_id, "budget_type": self.budget_type_id, "period": self.future_year, }, ), ) self.check_response(resp) def test_view_directory_programme_details(self): resp = self.client.get( reverse( "programme_details_directorate", kwargs={ "directorate_code": self.directorate_code, "programme_code": self.programme_code, "forecast_expenditure_type": self.forecast_expenditure_type_id, "period": self.future_year, }, ), ) self.check_response(resp) def test_view_group_programme_details(self): resp = self.client.get( reverse( "programme_details_group", kwargs={ "group_code": self.group_code, "programme_code": self.programme_code, "forecast_expenditure_type": self.forecast_expenditure_type_id, "period": self.future_year, }, ), ) self.check_response(resp) def test_view_dit_programme_details(self): resp = self.client.get( reverse( "programme_details_dit", kwargs={ "programme_code": self.programme_code, "forecast_expenditure_type": self.forecast_expenditure_type_id, "period": self.future_year, }, ), ) self.check_response(resp) def test_view_cost_Centre_project_details(self): resp = self.client.get( reverse( "project_details_costcentre", kwargs={ "cost_centre_code": self.cost_centre_code, "project_code": self.project_code, "period": self.future_year, }, ), ) self.check_response(resp) def test_view_directory_project_details(self): resp = self.client.get( reverse( "project_details_directorate", kwargs={ "directorate_code": self.directorate_code, "project_code": self.project_code, "period": self.future_year, }, ), ) self.check_response(resp) def test_view_group_project_details(self): resp = self.client.get( reverse( "project_details_group", kwargs={ "group_code": self.group_code, "project_code": self.project_code, "period": self.future_year, }, ), ) self.check_response(resp) def test_view_dit_project_details(self): resp = self.client.get( reverse( "project_details_dit", kwargs={ "project_code": self.project_code, "period": self.future_year, }, ), ) self.check_response(resp)
32.00939
83
0.5132
592
6,818
5.543919
0.091216
0.043876
0.050274
0.091408
0.865021
0.838513
0.838513
0.815356
0.678245
0.678245
0
0.000737
0.403051
6,818
212
84
32.160377
0.805651
0
0
0.619048
0
0
0.135524
0.048695
0
0
0
0
0.021164
1
0.084656
false
0
0.010582
0
0.111111
0
0
0
0
null
0
0
0
1
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
5
473582ae68c96f851b69fe3b93d2174f39fb2dda
5,483
py
Python
switch5.py
SamMakesIt/pokedex
9605cc6fcf3b6d3fe9f3668f397d278b66990998
[ "Apache-2.0" ]
1
2022-03-19T04:04:15.000Z
2022-03-19T04:04:15.000Z
switch5.py
SamMakesIt/pokedex
9605cc6fcf3b6d3fe9f3668f397d278b66990998
[ "Apache-2.0" ]
null
null
null
switch5.py
SamMakesIt/pokedex
9605cc6fcf3b6d3fe9f3668f397d278b66990998
[ "Apache-2.0" ]
null
null
null
import RPi.GPIO as GPIO from gpiozero import Button from signal import pause import subprocess import sys ## for the LCD screen import time import logging import spidev as SPI from lib import LCD_2inch4 from PIL import Image,ImageDraw,ImageFont button = Button(17) def open_dex_and_die(program, exit_code=0): # Start the dex subprocess.Popen(program) # close this script sys.exit(exit_code) button.when_released = open_dex_and_die(['python', 'objectident.py'])
161.264706
4,983
0.067664
75
5,483
4.813333
0.6
0.038781
0.055402
0.072022
0
0
0
0
0
0
0
0.012376
0.926318
5,483
33
4,984
166.151515
0.881188
0.009119
0
0
0
0
0.003687
0
0
0
0
0
0
1
0.066667
false
0
0.666667
0
0.733333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5