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
d3ae6c9a673c6e6d9173068f735788f9baf4cdf3
140
py
Python
bbb/templatetags/is_bbb_mod.py
cmd-ev/voctoconf
5d2c1ca4f1da01b66983f5a562eb8eb6babe0452
[ "MIT" ]
21
2020-08-24T13:27:03.000Z
2021-10-15T09:17:46.000Z
bbb/templatetags/is_bbb_mod.py
cmd-ev/voctoconf
5d2c1ca4f1da01b66983f5a562eb8eb6babe0452
[ "MIT" ]
null
null
null
bbb/templatetags/is_bbb_mod.py
cmd-ev/voctoconf
5d2c1ca4f1da01b66983f5a562eb8eb6babe0452
[ "MIT" ]
5
2020-08-25T16:34:51.000Z
2021-02-19T04:48:10.000Z
from django import template register = template.Library() @register.filter def is_bbb_mod(room, user): return room.is_moderator(user)
17.5
34
0.771429
20
140
5.25
0.75
0
0
0
0
0
0
0
0
0
0
0
0.135714
140
7
35
20
0.867769
0
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0
0.2
0.2
0.6
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
0
0
0
3
6ca310acd08c527da6b679f5c06c920523479f83
899
py
Python
workflow_lib/fert.py
VUB-HYDR/2018_Chawanda_etal
46af26916806e2f61fd48d777f88b04da7fffbbe
[ "MIT" ]
14
2018-09-27T16:03:10.000Z
2021-04-15T06:09:21.000Z
workflow_lib/fert.py
VUB-HYDR/2018_Chawanda_etal
46af26916806e2f61fd48d777f88b04da7fffbbe
[ "MIT" ]
2
2019-10-24T14:03:41.000Z
2019-10-31T22:10:19.000Z
workflow_lib/fert.py
VUB-HYDR/2018_Chawanda_etal
46af26916806e2f61fd48d777f88b04da7fffbbe
[ "MIT" ]
7
2018-11-14T19:42:59.000Z
2021-08-16T07:09:50.000Z
import init_file as variables import cj_function_lib as cj from datetime import datetime fert_table = cj.extract_table_from_mdb(variables.QSWAT_MDB, "fert", variables.path + "\\fert.tmp~") fert = "" for fert_line in fert_table: fert += cj.trailing_spaces(4, fert_line.split(",")[1], 0) + cj.string_trailing_spaces(9, fert_line.split(",")[2]) + cj.trailing_spaces(8, fert_line.split(",")[3], 3) + cj.trailing_spaces(8, fert_line.split(",")[4], 3) + cj.trailing_spaces(8, fert_line.split(",")[5], 3) + cj.trailing_spaces(8, fert_line.split(",")[6], 3) + cj.trailing_spaces(8, fert_line.split(",")[7], 3) + cj.trailing_spaces(4, fert_line.split(",")[8], 2) + "E+00" + cj.trailing_spaces(4, fert_line.split(",")[9], 2)+ "E+00" + cj.trailing_spaces(8, fert_line.split(",")[10], 3) + "\n" fileName = "fert.dat" cj.write_to(variables.DefaultSimDir + "TxtInOut\\" + fileName, fert) #print fileName
56.1875
558
0.688543
146
899
4.020548
0.308219
0.149915
0.221465
0.173765
0.480409
0.480409
0.46678
0.211244
0
0
0
0.042079
0.101224
899
15
559
59.933333
0.684406
0.015573
0
0
0
0
0.060023
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
6cceaf277e8db7db23e8454da2cdbade4678a488
1,892
py
Python
backend/core/migrations/0001_initial.py
EMUNES/hust-mdb
578a9113bc48e19559bb2e62340d38e40bd6ccd8
[ "Apache-2.0" ]
2
2021-04-14T02:43:48.000Z
2021-05-17T06:37:10.000Z
backend/core/migrations/0001_initial.py
EMUNES/hust-mdb
578a9113bc48e19559bb2e62340d38e40bd6ccd8
[ "Apache-2.0" ]
null
null
null
backend/core/migrations/0001_initial.py
EMUNES/hust-mdb
578a9113bc48e19559bb2e62340d38e40bd6ccd8
[ "Apache-2.0" ]
1
2021-04-14T02:57:15.000Z
2021-04-14T02:57:15.000Z
# Generated by Django 3.1.7 on 2021-03-09 16:24 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Material', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('series', models.CharField(db_column='系列', max_length=100, verbose_name='系列')), ('mark', models.CharField(db_column='牌号', max_length=100, verbose_name='牌号')), ('manufacturer', models.CharField(db_column='制造商', max_length=50, verbose_name='制造商')), ('link', models.CharField(db_column='链接', max_length=100, verbose_name='链接')), ('acronym', models.CharField(db_column='材料名称缩写', max_length=20, verbose_name='材料名称缩写')), ('material_type', models.CharField(db_column='材料类型', max_length=100, verbose_name='材料类型')), ('data_source', models.CharField(db_column='数据来源', max_length=100, verbose_name='数据来源')), ('last_modified_date', models.CharField(db_column='上次修改日期', max_length=50, verbose_name='上次修改日期')), ('test_date', models.CharField(db_column='测试日期', max_length=50, verbose_name='测试日期')), ('data_status', models.CharField(db_column='数据状态', max_length=50, verbose_name='数据状态')), ('material_id', models.CharField(db_column='材料ID', max_length=20, verbose_name='材料ID')), ('level_code', models.CharField(db_column='等级代码', max_length=50, verbose_name='等级代码')), ('vendor_code', models.CharField(db_column='供应商代码', max_length=50, verbose_name='供应商代码')), ('fibre_or_infill', models.CharField(db_column='纤维/填充物', max_length=100, verbose_name='纤维/填充物')), ], ), ]
54.057143
115
0.62315
226
1,892
4.969027
0.340708
0.146928
0.211932
0.286732
0.375779
0
0
0
0
0
0
0.033063
0.216702
1,892
34
116
55.647059
0.724696
0.023784
0
0
1
0
0.144173
0
0
0
0
0
0
1
0
false
0
0.037037
0
0.185185
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
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
6cd3dd00805335ac69d9b5556c1f245451bbe9aa
198
py
Python
Ekeopara_Praise/Phase 1/Python Basic 1/Day14 Tasks/Task4.py
CodedLadiesInnovateTech/-python-challenge-solutions
430cd3eb84a2905a286819eef384ee484d8eb9e7
[ "MIT" ]
6
2020-05-23T19:53:25.000Z
2021-05-08T20:21:30.000Z
Ekeopara_Praise/Phase 1/Python Basic 1/Day14 Tasks/Task4.py
CodedLadiesInnovateTech/-python-challenge-solutions
430cd3eb84a2905a286819eef384ee484d8eb9e7
[ "MIT" ]
8
2020-05-14T18:53:12.000Z
2020-07-03T00:06:20.000Z
Ekeopara_Praise/Phase 1/Python Basic 1/Day14 Tasks/Task4.py
CodedLadiesInnovateTech/-python-challenge-solutions
430cd3eb84a2905a286819eef384ee484d8eb9e7
[ "MIT" ]
39
2020-05-10T20:55:02.000Z
2020-09-12T17:40:59.000Z
'''4. Write a Python program to check whether multiple variables have the same value.''' var1, var2, var3 = 20, 20, 20 if var1 == var2== var3: print("var1, var2, and var3 have the same value !")
49.5
88
0.681818
33
198
4.090909
0.636364
0.177778
0.162963
0.237037
0
0
0
0
0
0
0
0.1
0.191919
198
4
89
49.5
0.74375
0.414141
0
0
0
0
0.378378
0
0
0
0
0
0
1
0
true
0
0
0
0
0.333333
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
3
6cf3d683e2db7b466be99b176a67b586108082a3
147
py
Python
maigret/__main__.py
noi4eg/maigret
d3b20e13dfa3df93dea1999201e250d5a7f82ad0
[ "MIT" ]
1,156
2020-08-30T08:06:59.000Z
2022-03-31T17:42:14.000Z
maigret/__main__.py
noi4eg/maigret
d3b20e13dfa3df93dea1999201e250d5a7f82ad0
[ "MIT" ]
132
2020-08-30T13:53:21.000Z
2022-03-31T18:42:42.000Z
maigret/__main__.py
noi4eg/maigret
d3b20e13dfa3df93dea1999201e250d5a7f82ad0
[ "MIT" ]
185
2020-08-30T08:15:00.000Z
2022-03-31T22:49:02.000Z
#! /usr/bin/env python3 """ Maigret entrypoint """ import asyncio from .maigret import main if __name__ == "__main__": asyncio.run(main())
11.307692
26
0.673469
18
147
5.055556
0.722222
0
0
0
0
0
0
0
0
0
0
0.008264
0.176871
147
12
27
12.25
0.743802
0.278912
0
0
0
0
0.081633
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
3
9f01e6da899f6d81dfa4b4fe9c15bd9084a5870b
78
py
Python
codechef/FLOW004.py
andraantariksa/code-exercise-answer
69b7dbdc081cdb094cb110a72bc0c9242d3d344d
[ "MIT" ]
1
2019-11-06T15:17:48.000Z
2019-11-06T15:17:48.000Z
codechef/FLOW004.py
andraantariksa/code-exercise-answer
69b7dbdc081cdb094cb110a72bc0c9242d3d344d
[ "MIT" ]
null
null
null
codechef/FLOW004.py
andraantariksa/code-exercise-answer
69b7dbdc081cdb094cb110a72bc0c9242d3d344d
[ "MIT" ]
1
2018-11-13T08:43:26.000Z
2018-11-13T08:43:26.000Z
for _ in range(int(input())): n = input() print(int(n[0])+int(n[-1]))
19.5
31
0.512821
14
78
2.785714
0.642857
0.205128
0
0
0
0
0
0
0
0
0
0.032258
0.205128
78
3
32
26
0.596774
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.333333
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
9f2096e503b1764311d574ee845445b547da7b73
453
py
Python
Django/ballon/admin.py
ballon3/GRAD
c630e32272fe34ead590c04d8360169e02be87f1
[ "MIT" ]
null
null
null
Django/ballon/admin.py
ballon3/GRAD
c630e32272fe34ead590c04d8360169e02be87f1
[ "MIT" ]
null
null
null
Django/ballon/admin.py
ballon3/GRAD
c630e32272fe34ead590c04d8360169e02be87f1
[ "MIT" ]
null
null
null
from django.contrib import admin from ballon.models import Pkg, Resume, Main, Education, Project, Work, Skill, Testimonial, Social, Address #admin.site.register(Category) admin.site.register(Resume) admin.site.register(Main) admin.site.register(Education) admin.site.register(Work) admin.site.register(Project) admin.site.register(Skill) admin.site.register(Social) admin.site.register(Testimonial) admin.site.register(Address) admin.site.register(Pkg)
32.357143
106
0.81457
63
453
5.857143
0.31746
0.268293
0.506775
0.130081
0
0
0
0
0
0
0
0
0.06181
453
14
107
32.357143
0.868235
0.064018
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.166667
0
0.166667
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
0
0
0
0
0
3
9f4c54bafc52b2cd849c4e602fafdcc41ce81b9c
89
py
Python
test/utils/enums.py
alvintangz/cscc43-a2-sql-queries-test
0531258375a7eee8bd1e9400b72943033290ad66
[ "PostgreSQL" ]
3
2021-07-12T21:52:32.000Z
2021-07-16T19:30:37.000Z
test/utils/enums.py
alvintangz/cscc43-a2-sql-queries-test
0531258375a7eee8bd1e9400b72943033290ad66
[ "PostgreSQL" ]
null
null
null
test/utils/enums.py
alvintangz/cscc43-a2-sql-queries-test
0531258375a7eee8bd1e9400b72943033290ad66
[ "PostgreSQL" ]
null
null
null
from enum import Enum class Semester(Enum): FALL = 9 WINTER = 1 SUMMER = 5
11.125
21
0.606742
13
89
4.153846
0.846154
0
0
0
0
0
0
0
0
0
0
0.05
0.325843
89
7
22
12.714286
0.85
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.2
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
3
9f73832f769c299fec9835e66ca79ecdd0318b41
1,268
py
Python
populate_chijri.py
J471/Telegram-ID_AzanBot
e48bff507ade5e811a6bbac2bfe8615448b09e83
[ "MIT" ]
2
2021-01-27T10:38:25.000Z
2021-06-14T18:54:23.000Z
populate_chijri.py
J471/Telegram-ID_AzanBot
e48bff507ade5e811a6bbac2bfe8615448b09e83
[ "MIT" ]
2
2021-01-27T10:38:07.000Z
2021-06-14T18:51:19.000Z
populate_chijri.py
J471/Telegram-ID_AzanBot
e48bff507ade5e811a6bbac2bfe8615448b09e83
[ "MIT" ]
2
2020-05-09T23:38:57.000Z
2021-01-27T10:38:31.000Z
#!/usr/bin/env python import logging from pymongo import MongoClient from credentials import DBNAME, DBUSER, DBPASS, DBAUTH # Enable logging logging.basicConfig(format='%(asctime)s - %(name)s:%(lineno)d - %(levelname)s - %(message)s', level=logging.INFO) logger = logging.getLogger(__name__) # MongoDB connection client = MongoClient() db = client[DBNAME] db.authenticate(DBUSER, DBPASS, source=DBAUTH) CHIJRI_CONTENTS = [ {"_id": 1, "f29flg": False, "f30flg": False, "fadjst": 0}, {"_id": 2, "f29flg": False, "f30flg": False, "fadjst": 0}, {"_id": 3, "f29flg": False, "f30flg": False, "fadjst": 0}, {"_id": 4, "f29flg": False, "f30flg": False, "fadjst": 0}, {"_id": 5, "f29flg": False, "f30flg": False, "fadjst": 0}, {"_id": 6, "f29flg": False, "f30flg": False, "fadjst": 0}, {"_id": 7, "f29flg": False, "f30flg": False, "fadjst": 0}, {"_id": 8, "f29flg": False, "f30flg": False, "fadjst": 0}, {"_id": 9, "f29flg": False, "f30flg": False, "fadjst": 0}, {"_id": 10, "f29flg": False, "f30flg": False, "fadjst": 0}, {"_id": 11, "f29flg": False, "f30flg": False, "fadjst": 0}, {"_id": 12, "f29flg": False, "f30flg": False, "fadjst": 0}, ] def main(): db.chijri.insert_many(CHIJRI_CONTENTS) if __name__ == '__main__': main()
33.368421
93
0.619085
162
1,268
4.679012
0.364198
0.174142
0.269129
0.348285
0.488127
0.488127
0.449868
0
0
0
0
0.069963
0.154574
1,268
38
94
33.368421
0.637127
0.042587
0
0
0
0.037037
0.266502
0
0
0
0
0
0
1
0.037037
false
0.074074
0.111111
0
0.148148
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
3
9f7b07ec93646ee4b6b36fc42d1cca113c97fedc
72
py
Python
TimeSeriesAnalysisWithPython-master/SciPyTimeSeries/snippets/custom_rolling.py
sunny2309/scipy_conf_notebooks
30a85d5137db95e01461ad21519bc1bdf294044b
[ "MIT" ]
2
2021-01-09T15:57:26.000Z
2021-11-29T01:44:21.000Z
TimeSeriesAnalysisWithPython-master/SciPyTimeSeries/snippets/custom_rolling.py
sunny2309/scipy_conf_notebooks
30a85d5137db95e01461ad21519bc1bdf294044b
[ "MIT" ]
5
2019-11-15T02:00:26.000Z
2021-01-06T04:26:40.000Z
TimeSeriesAnalysisWithPython-master/SciPyTimeSeries/snippets/custom_rolling.py
sunny2309/scipy_conf_notebooks
30a85d5137db95e01461ad21519bc1bdf294044b
[ "MIT" ]
null
null
null
df.rolling(window = 10, center = False).apply(lambda x: x[1]/x[2])[1:10]
72
72
0.652778
15
72
3.133333
0.733333
0
0
0
0
0
0
0
0
0
0
0.107692
0.097222
72
1
72
72
0.615385
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
3
9f9188caeea1a7ed3cadeea7fb8917d2d8703de3
102
py
Python
esercizi/stringaWhile.py
gdv/python-alfabetizzazione
d87561222de8a230db11d8529c49cf1702aec326
[ "MIT" ]
null
null
null
esercizi/stringaWhile.py
gdv/python-alfabetizzazione
d87561222de8a230db11d8529c49cf1702aec326
[ "MIT" ]
null
null
null
esercizi/stringaWhile.py
gdv/python-alfabetizzazione
d87561222de8a230db11d8529c49cf1702aec326
[ "MIT" ]
1
2019-03-26T11:14:33.000Z
2019-03-26T11:14:33.000Z
stringa = 'corso di Informatica' i = 0 while (i < len(stringa)): print stringa[i] i = i + 1
12.75
32
0.578431
16
102
3.6875
0.625
0.067797
0
0
0
0
0
0
0
0
0
0.027397
0.284314
102
7
33
14.571429
0.780822
0
0
0
0
0
0.19802
0
0
0
0
0
0
0
null
null
0
0
null
null
0.2
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
3
9fce30754fe976da1842b3aa8008d94f1ad68697
63
py
Python
utils/checks.py
WJxReloaded/pkbt2
3c6512ef3e5b5f7fe077c8a1adbe9d75c692b485
[ "MIT" ]
4
2017-09-19T12:51:40.000Z
2018-02-16T01:02:16.000Z
utils/checks.py
tacopill/Pokebot
1abf35c35897bdddb17d5f079a6d1432c4ba1431
[ "MIT" ]
null
null
null
utils/checks.py
tacopill/Pokebot
1abf35c35897bdddb17d5f079a6d1432c4ba1431
[ "MIT" ]
3
2017-10-17T22:29:09.000Z
2018-09-03T03:47:27.000Z
def no_delete(cmd): cmd._delete_ctx = False return cmd
15.75
27
0.68254
10
63
4
0.7
0
0
0
0
0
0
0
0
0
0
0
0.238095
63
3
28
21
0.833333
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
3
4c8d3953fb08de0e0e4a8b653c8af1e5bab0d0e4
250
py
Python
TORS/visualizer/__init__.py
AlgTUDelft/cTORS
1d34c26d912b37a09289d6fe52cb0d9aded6d77d
[ "Apache-2.0" ]
5
2021-04-25T10:40:55.000Z
2022-02-24T14:07:28.000Z
TORS/visualizer/__init__.py
UtrechtUniversity/cTORS
1d34c26d912b37a09289d6fe52cb0d9aded6d77d
[ "Apache-2.0" ]
null
null
null
TORS/visualizer/__init__.py
UtrechtUniversity/cTORS
1d34c26d912b37a09289d6fe52cb0d9aded6d77d
[ "Apache-2.0" ]
1
2022-03-04T05:08:05.000Z
2022-03-04T05:08:05.000Z
# This program has been developed by students from the bachelor Computer Science # at Utrecht University within the Software and Game project course in 2019 # (c) Copyright Utrecht University (Department of Information and Computing Sciences) # NOQA
50
85
0.812
35
250
5.8
0.885714
0.167488
0
0
0
0
0
0
0
0
0
0.018957
0.156
250
4
86
62.5
0.943128
0.964
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
3
4c92ce244030df317c3a30e338dd9e45f85fd368
192
py
Python
data_collection/gazette/spiders/sc_chapeco.py
kaiocp/querido-diario
86004049c6eee305e13066cf3607d30849bb099a
[ "MIT" ]
454
2018-04-07T03:32:57.000Z
2020-08-17T19:56:22.000Z
data_collection/gazette/spiders/sc_chapeco.py
kaiocp/querido-diario
86004049c6eee305e13066cf3607d30849bb099a
[ "MIT" ]
254
2020-08-18T14:09:43.000Z
2022-03-28T11:30:51.000Z
data_collection/gazette/spiders/sc_chapeco.py
kaiocp/querido-diario
86004049c6eee305e13066cf3607d30849bb099a
[ "MIT" ]
183
2018-04-11T15:09:37.000Z
2020-08-15T18:55:11.000Z
from gazette.spiders.base.fecam import FecamGazetteSpider class ScChapecoSpider(FecamGazetteSpider): name = "sc_chapeco" FECAM_QUERY = "cod_entidade:71" TERRITORY_ID = "4204202"
24
57
0.765625
21
192
6.809524
0.904762
0
0
0
0
0
0
0
0
0
0
0.055215
0.151042
192
7
58
27.428571
0.822086
0
0
0
0
0
0.166667
0
0
0
0
0
0
1
0
false
0
0.2
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
3
4c9d37382d716b5d2f7ff5351463737b4b1e2fce
385
py
Python
config.py
wangyida/voxel-dcgan
def3fc0e5788ef663feb1a37214117b378101da3
[ "MIT" ]
1
2018-02-01T16:13:39.000Z
2018-02-01T16:13:39.000Z
config.py
wangyida/voxel-dcgan
def3fc0e5788ef663feb1a37214117b378101da3
[ "MIT" ]
null
null
null
config.py
wangyida/voxel-dcgan
def3fc0e5788ef663feb1a37214117b378101da3
[ "MIT" ]
1
2020-09-16T08:29:12.000Z
2020-09-16T08:29:12.000Z
nz = 512 # noize vector size nsf = 4 # encoded voxel size, scale factor nvx = 32 # output voxel size batch_size = 64 learning_rate = 2e-4 dataset_path_i = "/media/wangyida/D0-P1/database/ShapeNetCore.v2/*/*/*/model_normalized.binvox.thinned" dataset_path_o = "/media/wangyida/D0-P1/database/ShapeNetCore.v2/*/*/*/model_normalized.binvox" params_path = "params/voxel_dcgan_model.ckpt"
42.777778
103
0.763636
58
385
4.87931
0.637931
0.063604
0.106007
0.120141
0.424028
0.424028
0.424028
0.424028
0.424028
0.424028
0
0.046243
0.101299
385
8
104
48.125
0.771676
0.176623
0
0
0
0
0.603834
0.603834
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
4cad15e70b748bdb4e072d4e8e11d1a0d8e91b07
269
py
Python
irrd/storage/__init__.py
mirceaulinic/irrd
24cf8812cabe46ea7eaff1c43c9b6a029c30f11c
[ "BSD-2-Clause" ]
null
null
null
irrd/storage/__init__.py
mirceaulinic/irrd
24cf8812cabe46ea7eaff1c43c9b6a029c30f11c
[ "BSD-2-Clause" ]
null
null
null
irrd/storage/__init__.py
mirceaulinic/irrd
24cf8812cabe46ea7eaff1c43c9b6a029c30f11c
[ "BSD-2-Clause" ]
null
null
null
import sqlalchemy as sa import ujson from sqlalchemy.pool import NullPool from irrd.conf import get_setting def get_engine(): return sa.create_engine( get_setting('database_url'), poolclass=NullPool, json_deserializer=ujson.loads, )
17.933333
38
0.717472
34
269
5.5
0.647059
0.106952
0
0
0
0
0
0
0
0
0
0
0.215613
269
14
39
19.214286
0.886256
0
0
0
0
0
0.04461
0
0
0
0
0
0
1
0.1
true
0
0.4
0.1
0.6
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
3
4cba3608e64aeaa57fb925f5a77219c212e22170
23
py
Python
ncoreparser/constant.py
gszabi15/ncoreparser
cd7856a962ac82e31ae840ada77f6c25b2963919
[ "Apache-2.0" ]
10
2020-09-03T23:17:33.000Z
2022-03-05T11:37:19.000Z
ncoreparser/constant.py
gszabi15/ncoreparser
cd7856a962ac82e31ae840ada77f6c25b2963919
[ "Apache-2.0" ]
12
2020-10-29T14:57:13.000Z
2022-03-17T00:44:09.000Z
ncoreparser/constant.py
gszabi15/ncoreparser
cd7856a962ac82e31ae840ada77f6c25b2963919
[ "Apache-2.0" ]
1
2021-11-17T16:32:21.000Z
2021-11-17T16:32:21.000Z
TORRENTS_PER_PAGE = 25
11.5
22
0.826087
4
23
4.25
1
0
0
0
0
0
0
0
0
0
0
0.1
0.130435
23
1
23
23
0.75
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
4cc72ebbf1d2a395ab61b0a358ef14e07350a1c2
333
py
Python
Server/model/account.py
devArtoria/-Awesome-GraphQL-
db13f235b2d1e6aeee6e858a2c682b7f86bd7062
[ "MIT" ]
27
2019-03-20T14:13:09.000Z
2022-03-18T20:36:39.000Z
Server/model/account.py
devArtoria/-Awesome-GraphQL-
db13f235b2d1e6aeee6e858a2c682b7f86bd7062
[ "MIT" ]
5
2018-04-17T10:54:13.000Z
2018-09-25T10:30:29.000Z
Server/model/account.py
devArtoria/-Awesome-GraphQL-
db13f235b2d1e6aeee6e858a2c682b7f86bd7062
[ "MIT" ]
14
2019-02-26T05:43:39.000Z
2022-03-01T15:39:26.000Z
from mongoengine import * from datetime import datetime class AccountModel(Document): meta = {'collection': 'account'} id = StringField(required=True, primary_key=True) username = StringField(required=True) password = StringField(required=True) register_on = DateTimeField(required=True, default=datetime.now())
33.3
70
0.747748
36
333
6.861111
0.638889
0.194332
0.279352
0
0
0
0
0
0
0
0
0
0.147147
333
10
70
33.3
0.869718
0
0
0
0
0
0.050898
0
0
0
0
0
0
1
0
false
0.125
0.25
0
1
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
3
4ccb69dec50ffbff4817a4e9cbaedb4a7551f21e
270
py
Python
src/py/PrjRestfulApiService/RestfulApiService.py
PrQiang/aods
b743754740f5b5bb4217f06fd790dffa303f871f
[ "MIT" ]
2
2020-12-14T14:24:56.000Z
2021-06-16T09:22:13.000Z
example/PrjRestfulApiService/RestfulApiService.py
PrQiang/aods
b743754740f5b5bb4217f06fd790dffa303f871f
[ "MIT" ]
1
2020-12-30T10:25:27.000Z
2020-12-30T10:25:44.000Z
example/PrjRestfulApiService/RestfulApiService.py
PrQiang/aods
b743754740f5b5bb4217f06fd790dffa303f871f
[ "MIT" ]
1
2021-06-16T09:22:17.000Z
2021-06-16T09:22:17.000Z
import socketserver, threading from RestfulApiHandler import RestfulApiHandler if __name__ == "__main__": server = socketserver.ThreadingTCPServer(('0.0.0.0', 32002), RestfulApiHandler) t = threading.Thread(target= server.serve_forever, args = ()) t.start()
38.571429
83
0.748148
29
270
6.655172
0.655172
0.031088
0.031088
0
0
0
0
0
0
0
0
0.038462
0.133333
270
7
84
38.571429
0.786325
0
0
0
0
0
0.055351
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
4cdc30990721503a59591c44c05564a326c709e4
47
py
Python
Python/Topics/Bytes basics/Ord() application/main.py
drtierney/hyperskill-problems
b74da993f0ac7bcff1cbd5d89a3a1b06b05f33e0
[ "MIT" ]
5
2020-08-29T15:15:31.000Z
2022-03-01T18:22:34.000Z
Python/Topics/Bytes basics/Ord() application/main.py
drtierney/hyperskill-problems
b74da993f0ac7bcff1cbd5d89a3a1b06b05f33e0
[ "MIT" ]
null
null
null
Python/Topics/Bytes basics/Ord() application/main.py
drtierney/hyperskill-problems
b74da993f0ac7bcff1cbd5d89a3a1b06b05f33e0
[ "MIT" ]
1
2020-12-02T11:13:14.000Z
2020-12-02T11:13:14.000Z
a = input() b= input() print(ord(a) + ord(b))
9.4
22
0.531915
9
47
2.777778
0.555556
0
0
0
0
0
0
0
0
0
0
0
0.191489
47
4
23
11.75
0.657895
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.333333
1
1
0
null
0
0
0
0
0
0
0
0
0
0
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
3
4cf8442cf94ad2853dab8f12b88955925757d43c
71
py
Python
pyheos/__init__.py
WebSpider/pyheos
1a352d46d2b899a1a78d72b52771585da634f9b8
[ "Apache-2.0" ]
1
2018-08-29T08:08:03.000Z
2018-08-29T08:08:03.000Z
pyheos/__init__.py
WebSpider/pyheos
1a352d46d2b899a1a78d72b52771585da634f9b8
[ "Apache-2.0" ]
1
2018-09-08T07:40:19.000Z
2018-09-08T07:50:32.000Z
pyheos/__init__.py
WebSpider/pyheos
1a352d46d2b899a1a78d72b52771585da634f9b8
[ "Apache-2.0" ]
null
null
null
from .heos import * __author__ = 'Nils Vogels' __version__ = '20180701'
23.666667
26
0.746479
8
71
5.625
1
0
0
0
0
0
0
0
0
0
0
0.131148
0.140845
71
3
27
23.666667
0.606557
0
0
0
0
0
0.263889
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
98084799ad8be61ab260536f6d3ffcf5c84ac7c4
858
py
Python
src/encoded/searches/responses.py
procha2/encoded
e9f122362b71f3b8641023b8d2d5ad531d3484b7
[ "MIT" ]
102
2015-05-20T01:17:43.000Z
2022-03-07T06:03:55.000Z
src/encoded/searches/responses.py
procha2/encoded
e9f122362b71f3b8641023b8d2d5ad531d3484b7
[ "MIT" ]
901
2015-01-07T23:11:57.000Z
2022-03-18T13:56:12.000Z
src/encoded/searches/responses.py
procha2/encoded
e9f122362b71f3b8641023b8d2d5ad531d3484b7
[ "MIT" ]
65
2015-02-06T23:00:26.000Z
2022-01-22T07:58:44.000Z
from encoded.searches.mixins import CartAggsToFacetsMixin from snosearch.responses import BasicQueryResponseWithFacets from snosearch.responses import BasicMatrixResponseWithFacets class CartQueryResponseWithFacets(CartAggsToFacetsMixin, BasicQueryResponseWithFacets): ''' Like BasicQueryResponseWithFacets but uses CartAggsToFacetsMixin instead of AggsToFacetsMixin. ''' def __init__(self, results, query_builder, *args, **kwargs): super().__init__(results, query_builder, *args, **kwargs) class CartMatrixResponseWithFacets(CartAggsToFacetsMixin, BasicMatrixResponseWithFacets): ''' Like BasicMatrixResponseWithFacets but uses CartAggsToFacetsMixin instead of AggsToFacetsMixin. ''' def __init__(self, results, query_builder, *args, **kwargs): super().__init__(results, query_builder, *args, **kwargs)
39
99
0.79021
70
858
9.4
0.4
0.072948
0.115502
0.139818
0.401216
0.401216
0.401216
0.401216
0.401216
0.401216
0
0
0.130536
858
21
100
40.857143
0.882038
0.221445
0
0.444444
0
0
0
0
0
0
0
0
0
1
0.222222
false
0
0.333333
0
0.777778
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
0
1
0
0
3
9809d378624d6c3ff7910c3c40281d8828a87c73
379
py
Python
test_apps/python_app/tests/_shared/for_proc.py
Origen-SDK/o2
5b0f9a6d113ddebc73c7ee224931e8b2d0301794
[ "MIT" ]
null
null
null
test_apps/python_app/tests/_shared/for_proc.py
Origen-SDK/o2
5b0f9a6d113ddebc73c7ee224931e8b2d0301794
[ "MIT" ]
127
2019-11-23T17:09:35.000Z
2021-09-02T11:06:20.000Z
test_apps/python_app/tests/_shared/for_proc.py
Origen-SDK/o2
5b0f9a6d113ddebc73c7ee224931e8b2d0301794
[ "MIT" ]
null
null
null
def setenv(config_root, config_name=None, bypass_config_lookup=None): import os, inspect, pathlib, sys if bypass_config_lookup: os.environ['origen_bypass_config_lookup'] = "1" if config_name is None: config_name = inspect.stack()[1].function os.environ['origen_config_paths'] = str( config_root.joinpath(f"{config_name}.toml").absolute())
42.111111
69
0.707124
52
379
4.865385
0.5
0.158103
0.213439
0
0
0
0
0
0
0
0
0.006369
0.171504
379
8
70
47.375
0.799363
0
0
0
0
0
0.171504
0.07124
0
0
0
0
0
1
0.125
false
0.375
0.125
0
0.25
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
3
e226e53adb49fe2e348b71d72b9e0931ef0a41cb
3,495
py
Python
pesto-orm/pesto_orm/dialect/mysql/domain.py
Dreampie/pesto
3d48637c61396cdc3a5427b8f51378c06c2473d7
[ "Apache-2.0" ]
13
2020-05-22T09:32:48.000Z
2021-09-09T09:57:43.000Z
pesto-orm/pesto_orm/dialect/mysql/domain.py
Dreampie/pesto
3d48637c61396cdc3a5427b8f51378c06c2473d7
[ "Apache-2.0" ]
null
null
null
pesto-orm/pesto_orm/dialect/mysql/domain.py
Dreampie/pesto
3d48637c61396cdc3a5427b8f51378c06c2473d7
[ "Apache-2.0" ]
2
2020-05-25T18:05:20.000Z
2020-05-25T18:50:22.000Z
# coding=utf-8 import re import traceback from pesto_common.config.configer import Configer from pesto_common.log.logger_factory import LoggerFactory from pesto_orm.core.base import db_config from pesto_orm.core.executor import ExecutorFactory from pesto_orm.core.model import BaseModel from pesto_orm.core.repository import BaseRepository from pesto_orm.dialect.base import DefaultDialect logger = LoggerFactory.get_logger('dialect.mysql.domain') class MySQLDialect(DefaultDialect): def get_db_type(self): return 'mysql' def paginate_with(self, sql, page_number, page_size): if page_number == 1 and page_size == 1: if re.match(DefaultDialect.select_single_pattern, sql) is not None: return sql offset = page_size * (page_number - 1) return '%s LIMIT %d OFFSET %d' % (sql, page_size, offset) db_type = Configer.get('db.type') if db_type == 'mysql': import mysql.connector as connector db_config['target'] = connector db_config['use_pure'] = True from mysql.connector.conversion import MySQLConverter class NumpyMySQLConverter(MySQLConverter): ''' A mysql.connector Converter that handles Numpy types ''' def _float32_to_mysql(self, value): return float(value) def _float64_to_mysql(self, value): return float(value) def _int32_to_mysql(self, value): return int(value) def _int64_to_mysql(self, value): return int(value) db_config['converter_class'] = NumpyMySQLConverter mysqlExecutor = ExecutorFactory.get_executor(db_config=db_config) mysqlDialect = MySQLDialect() class MysqlBaseModel(BaseModel): def __init__(self, db_name=None, table_name=None, table_alias=None, primary_key='id'): super(MysqlBaseModel, self).__init__(db_name, table_name, table_alias, primary_key) def get_dialect(self): return mysqlDialect def get_executor(self): return mysqlExecutor class MysqlBaseRepository(BaseRepository): def __init__(self, model_class=None): super(MysqlBaseRepository, self).__init__(model_class) def get_dialect(self): return mysqlDialect def get_executor(self): return mysqlExecutor def transaction(rollback_exceptions=[]): def wrap(func): def handle(result, **kwargs): # 真实执行原方法. func = kwargs['func'] args = kwargs['args'] kwargs = kwargs['kwargs'] return_value = func(*args, **kwargs) logger.info('Transaction method: ' + func.__name__) result.append(return_value) def to_do(*args, **kwargs): new_kwargs = {'func': func, 'args': args, 'kwargs': kwargs} result = [] try: mysqlExecutor.begin_transaction() handle(result, **new_kwargs) mysqlExecutor.commit_transaction() except Exception as e: if len(rollback_exceptions) == 0 or e.__class__ in rollback_exceptions: mysqlExecutor.rollback_transaction() logger.error('Method execute error. method: ' + str(func.__name__) + ', error:' + traceback.format_exc() + ', transaction roll back.') else: mysqlExecutor.commit_transaction() raise e finally: mysqlExecutor.close_transaction() return to_do return wrap
29.369748
155
0.650358
392
3,495
5.540816
0.321429
0.029006
0.027624
0.029466
0.126151
0.126151
0.126151
0.098527
0.066298
0.066298
0
0.005019
0.258941
3,495
118
156
29.618644
0.833591
0.021745
0
0.179487
0
0
0.058634
0
0
0
0
0
0
1
0.205128
false
0
0.141026
0.115385
0.564103
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
e2327222b3a6ee2598025ec347bc46a24be18c32
172
py
Python
last_stone_weight.py
spencercjh/sync-leetcode-today-problem-python3-example
4957e5eadb697334741df0fc297bec2edaa9e2ab
[ "Apache-2.0" ]
null
null
null
last_stone_weight.py
spencercjh/sync-leetcode-today-problem-python3-example
4957e5eadb697334741df0fc297bec2edaa9e2ab
[ "Apache-2.0" ]
null
null
null
last_stone_weight.py
spencercjh/sync-leetcode-today-problem-python3-example
4957e5eadb697334741df0fc297bec2edaa9e2ab
[ "Apache-2.0" ]
null
null
null
class LastStoneWeight: """ https://leetcode-cn.com/problems/last-stone-weight/ """ def lastStoneWeight(self, stones: List[int]) -> int:
17.2
56
0.575581
17
172
5.823529
0.882353
0
0
0
0
0
0
0
0
0
0
0
0.273256
172
9
57
19.111111
0.792
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
3
e245ba7d684d92f61958b015b54789b09a890e6e
262
py
Python
Exercicios/ex012.py
KaioPlandel/Estudos-Python-3
21c3dfb73b9ef0420eac093434050e4aff8fd61e
[ "MIT" ]
null
null
null
Exercicios/ex012.py
KaioPlandel/Estudos-Python-3
21c3dfb73b9ef0420eac093434050e4aff8fd61e
[ "MIT" ]
null
null
null
Exercicios/ex012.py
KaioPlandel/Estudos-Python-3
21c3dfb73b9ef0420eac093434050e4aff8fd61e
[ "MIT" ]
null
null
null
#mostre quando a pessoa vai pagar com o desconto de 5% preco = float(input('Digite o Preço do Produto R$: ')) desconto = preco * 0.05 print(f'O preço do Produto é de R${preco:.2f} com o Desconto de R${desconto:.2f} \nO Total vai ficar R$:{preco - desconto:.2f}')
65.5
128
0.698473
50
262
3.66
0.56
0.043716
0.131148
0.153005
0
0
0
0
0
0
0
0.031963
0.164122
262
4
128
65.5
0.803653
0.20229
0
0
0
0.333333
0.708134
0
0
0
0
0
0
1
0
false
0
0
0
0
0.333333
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
e2662d51f3f0f8d10ecce13084f3868fbba37200
2,185
py
Python
qcp/algorithms/abstract_algorithm.py
RiddhiYadav/https-github.com-Tiernan8r-quantum_computing_project
904896171895faf3613e9b8d64165a35c36f519e
[ "Apache-2.0" ]
null
null
null
qcp/algorithms/abstract_algorithm.py
RiddhiYadav/https-github.com-Tiernan8r-quantum_computing_project
904896171895faf3613e9b8d64165a35c36f519e
[ "Apache-2.0" ]
null
null
null
qcp/algorithms/abstract_algorithm.py
RiddhiYadav/https-github.com-Tiernan8r-quantum_computing_project
904896171895faf3613e9b8d64165a35c36f519e
[ "Apache-2.0" ]
null
null
null
# Copyright 2022 Tiernan8r # # 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. """ Constructs the quantum register, circuits of composite gates, and runs the simulation of Grover's Algorithm """ import abc from typing import Tuple from qcp.matrices import SPARSE, DefaultMatrix, Matrix class GeneralAlgorithm(abc.ABC): def __init__(self, size: int): assert size > 1, "need minimum of two qbits" self.size = size self.state = self.initial_state() self.circuit = self.construct_circuit() def initial_state(self) -> Matrix: """ Creates a state vector corresponding to |1..0> returns: Matrix: the state vector """ entries: SPARSE = {i: {} for i in range(2 ** self.size)} entries[0][0] = 1 return DefaultMatrix(entries) def construct_circuit(self) -> Matrix: """ Construct the circuit for the algorithm returns: Matrix: Matrix representing our the circuit for the algorithm """ pass def run(self) -> Matrix: """ Run the algorithm by applying the quantum circuit to the initial state returns: Matrix: Column matrix representation of the final state """ if self.circuit is not None: self.state = self.circuit * self.state return self.state def measure(self) -> Tuple[int, float]: """ 'measures' self.state by selecting a state weighted by its (amplitude ** 2) returns: Tuple[int, float]: The state observed and the probability of measuring said state """ pass
28.75
74
0.639359
278
2,185
4.996403
0.464029
0.043197
0.018719
0.023038
0.035997
0
0
0
0
0
0
0.010849
0.282838
2,185
75
75
29.133333
0.875558
0.5373
0
0.095238
0
0
0.030826
0
0
0
0
0
0.047619
1
0.238095
false
0.095238
0.142857
0
0.52381
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
3
e27d1ce66a0fb5eca31113991113207c943becc1
4,343
py
Python
PROJ/LEVY/Barrier_Options/Script_DoubleBarrierOptions.py
mattslezak-shell/PROJ_Option_Pricing_Matlab
6105bd00ba3471802180c122fdf81e90833a91c4
[ "MIT" ]
null
null
null
PROJ/LEVY/Barrier_Options/Script_DoubleBarrierOptions.py
mattslezak-shell/PROJ_Option_Pricing_Matlab
6105bd00ba3471802180c122fdf81e90833a91c4
[ "MIT" ]
null
null
null
PROJ/LEVY/Barrier_Options/Script_DoubleBarrierOptions.py
mattslezak-shell/PROJ_Option_Pricing_Matlab
6105bd00ba3471802180c122fdf81e90833a91c4
[ "MIT" ]
1
2022-01-07T15:31:45.000Z
2022-01-07T15:31:45.000Z
# Generated with SMOP 0.41-beta try: from smop.libsmop import * except ImportError: raise ImportError('File compiled with `smop3`, please install `smop3` to run it.') from None # Script_DoubleBarrierOptions.m ################################################################## ### DOUBLE BARRIER OPTION PRICER ################################################################## # Descritpion: Script to Price Double Barrier options in Levy Models # using the PROJ method # Author: Justin Kirkby # References: (1) Efficient Option Pricing By Frame Duality with The Fast # Fourier Transform, SIAM J. Financial Math., 2015 # (2) Robust Barrier Option Pricing by Frame Projection under # Exponential Levy Dynamics, App. Math. Finance, 2017 ################################################################## folder,name,ext=fileparts(which(mfilename('fullpath')),nargout=3) # Script_DoubleBarrierOptions.m:13 cd(folder) addpath('../RN_CHF') addpath('../Helper_Functions') ############################################## ### Step 1) CHOOSE CONTRACT/GENERAL PARAMETERS ############################################## S_0=100 # Script_DoubleBarrierOptions.m:21 W=100 # Script_DoubleBarrierOptions.m:22 r=0.05 # Script_DoubleBarrierOptions.m:23 q=0.02 # Script_DoubleBarrierOptions.m:24 T=1 # Script_DoubleBarrierOptions.m:25 call=1 # Script_DoubleBarrierOptions.m:26 L=80 # Script_DoubleBarrierOptions.m:27 U=120 # Script_DoubleBarrierOptions.m:28 M=52 # Script_DoubleBarrierOptions.m:29 ############################################## ### Step 2) CHOOSE MODEL PARAMETERS ############################################## model=1 # Script_DoubleBarrierOptions.m:35 params=cellarray([]) # Script_DoubleBarrierOptions.m:36 if model == 1: params.sigmaBSM = copy(0.2) # Script_DoubleBarrierOptions.m:39 else: if model == 2: params.C = copy(0.02) # Script_DoubleBarrierOptions.m:42 params.G = copy(5) # Script_DoubleBarrierOptions.m:43 params.MM = copy(15) # Script_DoubleBarrierOptions.m:44 params.Y = copy(1.2) # Script_DoubleBarrierOptions.m:45 else: if model == 3: params.alpha = copy(15) # Script_DoubleBarrierOptions.m:48 params.beta = copy(- 5) # Script_DoubleBarrierOptions.m:49 params.delta = copy(0.5) # Script_DoubleBarrierOptions.m:50 else: if model == 4: params.sigma = copy(0.12) # Script_DoubleBarrierOptions.m:53 params.lam = copy(0.4) # Script_DoubleBarrierOptions.m:54 params.muj = copy(- 0.12) # Script_DoubleBarrierOptions.m:55 params.sigmaj = copy(0.18) # Script_DoubleBarrierOptions.m:56 else: if model == 5: params.sigma = copy(0.15) # Script_DoubleBarrierOptions.m:59 params.lam = copy(3) # Script_DoubleBarrierOptions.m:60 params.p_up = copy(0.2) # Script_DoubleBarrierOptions.m:61 params.eta1 = copy(25) # Script_DoubleBarrierOptions.m:62 params.eta2 = copy(10) # Script_DoubleBarrierOptions.m:63 ############################################## ### Step 3) CHOOSE PROJ PARAMETERS ############################################## logN=13 # Script_DoubleBarrierOptions.m:71 L1=8 # Script_DoubleBarrierOptions.m:72 ############################################## ### PRICE ############################################## ### Note: rnCHF is the risk netural CHF, c1,c2,c4 are the cumulants modelInput=getModelInput(model,T / M,r,q,params) # Script_DoubleBarrierOptions.m:78 alpha=getTruncationAlpha(T,L1,modelInput,model) # Script_DoubleBarrierOptions.m:80 N=2 ** logN # Script_DoubleBarrierOptions.m:81 tic price=PROJ_Double_Barrier(N,alpha,call,L,U,S_0,W,M,T,r,modelInput.rnCHF) # Script_DoubleBarrierOptions.m:84 toc fprintf('%.8f \n',price)
32.901515
97
0.53143
439
4,343
5.159453
0.414579
0.413245
0.429139
0.037086
0.143046
0.059161
0
0
0
0
0
0.051361
0.255814
4,343
132
98
32.901515
0.649443
0.420447
0
0.074074
1
0
0.059158
0
0
0
0
0
0
1
0
false
0
0.055556
0
0.055556
0.018519
0
0
0
null
1
1
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
0
0
0
0
0
0
3
e291856a8670ce43899869355a2184217b3d5cc1
272
py
Python
demo_random_pixels.py
insolor/micropython-troyka-led-matrix
d72905e1b89fcaa1e334434c713e5a6468634ef4
[ "MIT" ]
1
2021-12-10T08:01:12.000Z
2021-12-10T08:01:12.000Z
demo_random_pixels.py
insolor/micropython-troyka-led-matrix
d72905e1b89fcaa1e334434c713e5a6468634ef4
[ "MIT" ]
null
null
null
demo_random_pixels.py
insolor/micropython-troyka-led-matrix
d72905e1b89fcaa1e334434c713e5a6468634ef4
[ "MIT" ]
null
null
null
from troyka_led_matrix import TroykaLedMatrix from urandom import getrandbits import time matrix = TroykaLedMatrix() while True: matrix.draw_pixel(getrandbits(3), getrandbits(3)) matrix.clear_pixel(getrandbits(3), getrandbits(3)) time.sleep_ms(50)
24.727273
55
0.753676
34
272
5.882353
0.529412
0.24
0.17
0.28
0.29
0
0
0
0
0
0
0.026316
0.161765
272
10
56
27.2
0.850877
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.375
0
0.375
0
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
e291fcd825f96b9724727a3f8d3acd4cb312efa4
2,009
py
Python
mp_sort/virtenv/lib/python3.6/site-packages/transcrypt/demos/pysteroids_demo/org/theodox/__init__.py
ang-jason/fip_powerx_mini_projects-foxtrot
37e3671969b516369e2d1c7cab5890b75c489f56
[ "MIT" ]
2,200
2016-10-12T16:47:13.000Z
2022-03-30T16:40:35.000Z
mp_sort/virtenv/lib/python3.6/site-packages/transcrypt/demos/pysteroids_demo/org/theodox/__init__.py
ang-jason/fip_powerx_mini_projects-foxtrot
37e3671969b516369e2d1c7cab5890b75c489f56
[ "MIT" ]
672
2016-10-12T16:36:48.000Z
2022-03-25T00:57:04.000Z
mp_sort/virtenv/lib/python3.6/site-packages/transcrypt/demos/pysteroids_demo/org/theodox/__init__.py
ang-jason/fip_powerx_mini_projects-foxtrot
37e3671969b516369e2d1c7cab5890b75c489f56
[ "MIT" ]
230
2016-10-20T14:31:40.000Z
2022-03-16T15:57:15.000Z
import math import itertools class Vector: """ Generic vector operations. """ def _apply(self,op, other): pairwise = None if type(other) is Vector: pairwise = zip(self.vals, other.vals) else: pairwise = zip(self.vals, [other for _ in self.vals]) return Vector(*itertools.starmap(op, pairwise)) def __init__(self, *args): self.vals = args def __add__(self, other): return self._apply(lambda a, b: a + b, other) def __sub__(self, other): return self._apply(lambda a, b: a - b, other) def __mul__(self, other): return self._apply(lambda a, b: a*b, other) def __div__(self, other): return self._apply(lambda a, b: a / b, other) def length(self): total = sum(map(lambda a: math.pow(a, 2), self.vals)) return math.sqrt(total) def normalized(self): divisor = [self.length()] * len(self) return Vector(*(self / divisor)) def __iter__(self): return py_iter(self.vals) @classmethod def map(cls, *args): return args[0].map(args[1:]) def __getitem__(self, item): return self.values[item] def __str__(self): return str(self.vals) def __len__(self): return len(self.vals) @classmethod def add(cls, a, b): return Vector(*a) + Vector(*b) @classmethod def sub(cls, a, b): return Vector(*a) - Vector(*b) @classmethod def mul(cls, a, b): return Vector(*a) * Vector(*b) @classmethod def div(cls, a, b): return Vector(*a) / Vector(*b) @classmethod def dot(cls, left, right): return sum(Vector.mul(left, right)) @classmethod def norm_dot(Vector, left, right): left = Vector(*left).normalized() right = Vector(*right).normalized() return sum(Vector.mul(left, right))
22.829545
66
0.548034
250
2,009
4.228
0.228
0.022706
0.056764
0.071902
0.403027
0.357616
0.306528
0.306528
0.306528
0.306528
0
0.002212
0.325037
2,009
87
67
23.091954
0.777286
0.012942
0
0.157895
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.035088
0.245614
0.701754
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
e29f7d09efd784db1167faf711962043e5a84615
677
py
Python
commit_grtrans.py
HerculesJack/grtrans
bc005307d81dac1bdb9520e776e7627126dd690a
[ "MIT" ]
25
2016-02-11T01:52:14.000Z
2021-06-16T02:15:42.000Z
commit_grtrans.py
RAnantua/grtrans
a0353a8516335412b27fe4866eabafcfc0fe498f
[ "MIT" ]
6
2016-11-10T15:25:20.000Z
2018-01-18T15:15:57.000Z
commit_grtrans.py
RAnantua/grtrans
a0353a8516335412b27fe4866eabafcfc0fe498f
[ "MIT" ]
6
2016-02-11T14:13:01.000Z
2022-03-10T01:56:02.000Z
import os from run_grtrans_test_problems import run_test_problems from unit_tests import run_unit_tests passed, max_passed, failed = run_test_problems(save=0) nfailed, ufailed = run_unit_tests() if passed < max_passed or nfailed > 0: print 'ERROR -- grtrans tests failed!' else: # os.chdir('..') # os.system('cvs -d :ext:jdexter@grad16.phys.washington.edu:/phys/users/jdexter/cvs commit grtrans') os.system('git commit -a') #try: # with open('tests_failed.p','rb') as f: print 'ERROR -- grtrans tests failed!' #except IOError as e: # os.chdir('..') # os.system('cvs -d :ext:jdexter@grad16.phys.washington.edu:/phys/users/jdexter/cvs commit grtrans')
35.631579
103
0.716396
104
677
4.519231
0.432692
0.076596
0.06383
0.093617
0.476596
0.357447
0.357447
0.357447
0.357447
0.357447
0
0.010327
0.141802
677
18
104
37.611111
0.798623
0.503693
0
0
0
0
0.132308
0
0
0
0
0
0
0
null
null
0.25
0.375
null
null
0.125
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
1
0
0
1
1
0
0
0
0
3
e2a06902ee9718981ff25abb371fb5e304cb3890
178
py
Python
tests/sedes/test_bitvector_instantiation.py
booleanfunction/py-ssz
9d2e34c2257d7b69da824f8a8361dbc71b03b257
[ "MIT" ]
22
2018-12-01T21:16:06.000Z
2021-11-04T14:12:31.000Z
tests/sedes/test_bitvector_instantiation.py
booleanfunction/py-ssz
9d2e34c2257d7b69da824f8a8361dbc71b03b257
[ "MIT" ]
75
2018-11-27T10:09:19.000Z
2021-12-09T03:52:27.000Z
tests/sedes/test_bitvector_instantiation.py
booleanfunction/py-ssz
9d2e34c2257d7b69da824f8a8361dbc71b03b257
[ "MIT" ]
19
2018-12-01T11:36:01.000Z
2022-03-28T18:53:59.000Z
import pytest from ssz.sedes import Bitvector def test_bitvector_instantiation_bound(): with pytest.raises(ValueError): bit_count = 0 Bitvector(bit_count)
17.8
41
0.730337
22
178
5.681818
0.727273
0.128
0
0
0
0
0
0
0
0
0
0.007092
0.207865
178
9
42
19.777778
0.879433
0
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0
0.333333
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
e2b11260dba3afd786662e8f9abbc61d8cd6e587
783
py
Python
holobot/extensions/admin/command_rule_manager_interface.py
rexor12/holobot
89b7b416403d13ccfeee117ef942426b08d3651d
[ "MIT" ]
1
2021-05-24T00:17:46.000Z
2021-05-24T00:17:46.000Z
holobot/extensions/admin/command_rule_manager_interface.py
rexor12/holobot
89b7b416403d13ccfeee117ef942426b08d3651d
[ "MIT" ]
41
2021-03-24T22:50:09.000Z
2021-12-17T12:15:13.000Z
holobot/extensions/admin/command_rule_manager_interface.py
rexor12/holobot
89b7b416403d13ccfeee117ef942426b08d3651d
[ "MIT" ]
null
null
null
from .models import CommandRule from typing import Optional, Tuple class CommandRuleManagerInterface: async def get_rules_by_server(self, server_id: str, start_offset: int, page_size: int, group: Optional[str] = None, subgroup: Optional[str] = None) -> Tuple[CommandRule, ...]: raise NotImplementedError async def set_rule(self, rule: CommandRule) -> int: raise NotImplementedError async def remove_rule(self, rule_id: int) -> None: raise NotImplementedError async def remove_rules_by_server(self, server_id: str) -> None: raise NotImplementedError async def can_execute(self, server_id: str, channel_id: str, group: Optional[str], subgroup: Optional[str], command: str) -> bool: raise NotImplementedError
41.210526
179
0.713921
95
783
5.715789
0.378947
0.073665
0.213628
0.235727
0.316759
0.103131
0.103131
0
0
0
0
0
0.196679
783
18
180
43.5
0.863275
0
0
0.384615
0
0
0
0
0
0
0
0
0
1
0
true
0
0.153846
0
0.230769
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
3
2c3a335f0f1ca3f07b9332c7a1feb6ba4df8ba4f
433
py
Python
fluent_contents/tests/testapp/content_plugins.py
vinnyrose/django-fluent-contents
7fa1a58a97099d8e2898a2016bf8abe2ea651b02
[ "Apache-2.0" ]
null
null
null
fluent_contents/tests/testapp/content_plugins.py
vinnyrose/django-fluent-contents
7fa1a58a97099d8e2898a2016bf8abe2ea651b02
[ "Apache-2.0" ]
null
null
null
fluent_contents/tests/testapp/content_plugins.py
vinnyrose/django-fluent-contents
7fa1a58a97099d8e2898a2016bf8abe2ea651b02
[ "Apache-2.0" ]
null
null
null
from django.utils.safestring import mark_safe from fluent_contents.extensions import ContentPlugin, plugin_pool from fluent_contents.tests.testapp.models import RawHtmlTestItem @plugin_pool.register class RawHtmlTestPlugin(ContentPlugin): """ The most basic "raw HTML" plugin item, for testing. """ model = RawHtmlTestItem def render(self, request, instance, **kwargs): return mark_safe(instance.html)
28.866667
65
0.764434
51
433
6.372549
0.705882
0.049231
0.110769
0
0
0
0
0
0
0
0
0
0.157044
433
14
66
30.928571
0.890411
0.117783
0
0
0
0
0
0
0
0
0
0
0
1
0.125
false
0
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
0
0
0
0
null
0
0
0
0
0
0
0
0
1
1
1
0
0
3
2c4ab657772de4e66a6590e0611b2e99cb5d0d0b
222
py
Python
display/display/handlers/mailbox/read.py
owlsn/h_crawl
c0431ee6484e61d9339553c3350962ea517749d6
[ "MIT" ]
null
null
null
display/display/handlers/mailbox/read.py
owlsn/h_crawl
c0431ee6484e61d9339553c3350962ea517749d6
[ "MIT" ]
8
2021-03-18T20:33:29.000Z
2022-03-11T23:21:04.000Z
display/display/handlers/mailbox/read.py
owlsn/h_crawl
c0431ee6484e61d9339553c3350962ea517749d6
[ "MIT" ]
null
null
null
from display.handlers.base import BaseHandler class MailboxReadHandler(BaseHandler): def get(self): title = 'MailboxReadHandler' self.render('mailbox/read-mail.html', title = title, **self.render_dict)
37
80
0.725225
25
222
6.4
0.72
0.125
0
0
0
0
0
0
0
0
0
0
0.162162
222
6
80
37
0.860215
0
0
0
0
0
0.179372
0.098655
0
0
0
0
0
1
0.2
false
0
0.2
0
0.6
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
3
2c5f547ed3f8ba2162e991dbf9194c4f2334bfdf
1,417
py
Python
launchkey/factories/service.py
bgroveben/launchkey-python
c102d76040221059e7b87d96496edb1be3824d3b
[ "MIT" ]
1
2018-12-06T04:42:35.000Z
2018-12-06T04:42:35.000Z
launchkey/factories/service.py
bgroveben/launchkey-python
c102d76040221059e7b87d96496edb1be3824d3b
[ "MIT" ]
1
2018-12-11T22:31:03.000Z
2018-12-11T22:31:03.000Z
launchkey/factories/service.py
bgroveben/launchkey-python
c102d76040221059e7b87d96496edb1be3824d3b
[ "MIT" ]
null
null
null
from .base import BaseFactory from launchkey import LAUNCHKEY_PRODUCTION from launchkey.clients import ServiceClient class ServiceFactory(BaseFactory): """Factory for creating clients when representing a LaunchKey Service Profile""" def __init__(self, service_id, private_key, url=LAUNCHKEY_PRODUCTION, testing=False, transport=None): """ :param service_id: UUID for the requesting service :param private_key: PEM formatted private key string :param url: URL for the LaunchKey API :param testing: Boolean stating whether testing mode is being used. This will determine whether SSL validation occurs. :param: transport: Instantiated transport object. The default and currently only supported transport is launchkey.transports.JOSETransport. If you wish to set encryption or hashing algorithms, this is where you would do it. IE: JOSETransport(jwt_algorithm="RS512", jwe_cek_encryption="RSA-OAEP", jwe_claims_encryption="A256CBC-HS512", content_hash_algorithm="S256") """ super(ServiceFactory, self).__init__('svc', service_id, private_key, url, testing, transport) def make_service_client(self): """ Retrieves a client to make service calls. :return: launchkey.clients.ServiceClient """ return ServiceClient(self._issuer_id, self._transport)
48.862069
120
0.714891
167
1,417
5.898204
0.562874
0.040609
0.032487
0.038579
0.04467
0
0
0
0
0
0
0.010791
0.215243
1,417
28
121
50.607143
0.875
0.570219
0
0
0
0
0.006186
0
0
0
0
0
0
1
0.25
false
0
0.375
0
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
0
0
0
0
null
0
0
0
0
0
1
0
0
1
0
1
0
0
3
2c6431e095521b9b05fd679eb3f519fd1974a1c5
81
py
Python
python/sys_argv.py
mkanenobu/trashbox
c691dbf9a07991fd42304020c8aac58e1e4b9644
[ "WTFPL" ]
2
2020-05-11T13:43:27.000Z
2020-07-31T11:57:19.000Z
python/sys_argv.py
mkanenobu/trashbox
c691dbf9a07991fd42304020c8aac58e1e4b9644
[ "WTFPL" ]
2
2020-09-27T02:35:38.000Z
2021-03-08T08:33:02.000Z
python/sys_argv.py
mkanenobu/trashbox
c691dbf9a07991fd42304020c8aac58e1e4b9644
[ "WTFPL" ]
1
2020-05-11T13:44:04.000Z
2020-05-11T13:44:04.000Z
import sys # 引数を変数varに代入してprintで返す var = sys.argv[1] print(type(var)) print(var)
13.5
23
0.753086
12
81
5.083333
0.666667
0
0
0
0
0
0
0
0
0
0
0.013889
0.111111
81
5
24
16.2
0.833333
0.259259
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
3
2c6dec3157e23cf5a69e188d1d748411cfc9f657
1,263
py
Python
camper/db/tests/test_registration_form.py
mrtopf/camper
7016539f92202bbea608c6d53ce19097d4ad931d
[ "MIT" ]
13
2016-03-13T02:33:39.000Z
2021-04-01T13:09:12.000Z
camper/db/tests/test_registration_form.py
comlounge/camper
7016539f92202bbea608c6d53ce19097d4ad931d
[ "MIT" ]
122
2016-03-10T09:28:09.000Z
2021-09-07T23:49:05.000Z
camper/db/tests/test_registration_form.py
mrtopf/camper
7016539f92202bbea608c6d53ce19097d4ad931d
[ "MIT" ]
5
2017-01-11T22:00:57.000Z
2020-04-26T14:03:32.000Z
from camper.db import BarcampSchema, Barcamp import datetime def test_get_empty_registration_form(barcamps, barcamp): barcamps.save(barcamp) barcamp = barcamps.by_slug("barcamp") assert barcamp.registration_form == [] def test_add_to_registration_form(barcamps, barcamp): barcamps.save(barcamp) field = { 'name' : 'fullname', 'title' : 'Your full name, please', 'fieldtype' : 'textfield', 'description' : 'enter your full name here', 'required' : False, } barcamp = barcamps.by_slug("barcamp") barcamp.registration_form.append(field) barcamp.save() barcamp = barcamps.by_slug("barcamp") assert len(barcamp.registration_form) == 1 def test_save_registration_data(barcamps, barcamp): barcamps.save(barcamp) # create the field field = { 'name' : 'fullname', 'title' : 'Your full name, please', 'fieldtype' : 'textfield', 'description' : 'enter your full name here', 'required' : False, } barcamp = barcamps.by_slug("barcamp") barcamp.registration_form.append(field) barcamp.save() barcamp = barcamps.by_slug("barcamp") # use the field assert len(barcamp.registration_form) == 1
29.372093
56
0.646873
137
1,263
5.810219
0.29927
0.150754
0.106784
0.13191
0.806533
0.763819
0.638191
0.512563
0.512563
0.512563
0
0.002073
0.235946
1,263
42
57
30.071429
0.822798
0.023753
0
0.764706
0
0
0.19284
0
0
0
0
0
0.088235
1
0.088235
false
0
0.058824
0
0.147059
0
0
0
0
null
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
2caf9720b899a568e29bea30f685e67528d45e67
85
py
Python
src/datasets/hanitem.py
Hazoom/han
5c97568fc052f85db3e3b643a56c782ca24044a1
[ "Apache-2.0" ]
25
2020-07-25T09:45:45.000Z
2022-01-02T09:42:59.000Z
src/datasets/hanitem.py
Hazoom/han
5c97568fc052f85db3e3b643a56c782ca24044a1
[ "Apache-2.0" ]
3
2020-12-14T22:32:47.000Z
2021-04-16T01:06:44.000Z
src/datasets/hanitem.py
Hazoom/han
5c97568fc052f85db3e3b643a56c782ca24044a1
[ "Apache-2.0" ]
6
2020-12-20T16:00:44.000Z
2021-12-07T16:59:07.000Z
import attr @attr.s class HANItem: sentences = attr.ib() label = attr.ib()
10.625
25
0.623529
12
85
4.416667
0.666667
0.226415
0
0
0
0
0
0
0
0
0
0
0.247059
85
7
26
12.142857
0.828125
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.2
0
0.8
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
2cc35cd363ef4cfec9425fc3d0c72127f474a4df
960
py
Python
rehive/api/resources/company_resources.py
rehive/rehive-python
72cf7208db8e99711ea8568073577be3459c79fc
[ "MIT" ]
8
2017-06-23T13:33:59.000Z
2022-01-17T10:55:23.000Z
rehive/api/resources/company_resources.py
rehive/rehive-python
72cf7208db8e99711ea8568073577be3459c79fc
[ "MIT" ]
59
2017-06-23T13:21:01.000Z
2022-01-10T17:41:22.000Z
rehive/api/resources/company_resources.py
rehive/rehive-python
72cf7208db8e99711ea8568073577be3459c79fc
[ "MIT" ]
3
2017-10-12T18:43:29.000Z
2018-12-26T09:38:42.000Z
from .base_resources import Resource, ResourceCollection, ResourceList class APICompany(Resource, ResourceCollection): def __init__(self, client, endpoint='', filters=None): self.resources = ( APIBanks, APICurrencies, APIBankAccount, APIBankAccounts ) super(APICompany, self).__init__(client, endpoint, filters) self.create_resources(self.resources) @classmethod def get_resource_name(cls): return 'company' class APIBanks(ResourceList): @classmethod def get_resource_name(cls): return 'bank' class APICurrencies(ResourceList): @classmethod def get_resource_name(cls): return 'currencies' class APIBankAccount(Resource): @classmethod def get_resource_name(cls): return 'bank-account' class APIBankAccounts(Resource): @classmethod def get_resource_name(cls): return 'bank-accounts'
20.869565
70
0.667708
90
960
6.9
0.355556
0.112721
0.136876
0.201288
0.389694
0.389694
0.389694
0.328502
0.161031
0
0
0
0.248958
960
45
71
21.333333
0.861304
0
0
0.333333
0
0
0.047917
0
0
0
0
0
0
1
0.2
false
0
0.033333
0.166667
0.566667
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
0
0
0
1
1
0
0
3
2cc49cc05dd233210db2a108c300fb21af3b9cd7
737
py
Python
test/test_led_matrix.py
soundmaking/led8x8m
383fe39c9e328951a25fd23298a4a4c11e8c964e
[ "MIT" ]
null
null
null
test/test_led_matrix.py
soundmaking/led8x8m
383fe39c9e328951a25fd23298a4a4c11e8c964e
[ "MIT" ]
null
null
null
test/test_led_matrix.py
soundmaking/led8x8m
383fe39c9e328951a25fd23298a4a4c11e8c964e
[ "MIT" ]
null
null
null
import unittest from led8x8m import LedMatrix class TestLedMatrix(unittest.TestCase): def test_pin_numbers(self): self.assertEqual(len(LedMatrix.PIN_X), 8) self.assertEqual(len(LedMatrix.PIN_Y), 8) set_x = set(LedMatrix.PIN_X) set_y = set(LedMatrix.PIN_Y) self.assertEqual(len(set_x), 8) self.assertEqual(len(set_y), 8) self.assertTrue(set_x.isdisjoint(set_y)) def test_matrix_buffer(self): self.assertIsInstance(LedMatrix.matrix_buffer, list) self.assertEqual(len(LedMatrix.matrix_buffer), 8) for n in range(8): self.assertIsInstance(LedMatrix.matrix_buffer[n], list) self.assertEqual(len(LedMatrix.matrix_buffer[n]), 8)
35.095238
67
0.68114
98
737
4.938776
0.295918
0.18595
0.223141
0.223141
0.516529
0.177686
0.177686
0
0
0
0
0.015437
0.208955
737
20
68
36.85
0.814751
0
0
0
0
0
0
0
0
0
0
0
0.529412
1
0.117647
false
0
0.117647
0
0.294118
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
1
0
0
0
0
0
0
0
0
0
3
e2e18396a6d1962265c20433bef9b5473eadd7dd
1,689
py
Python
tests/mp.py
dmxj/icv
0b074ec9475f2c70038d2e8b7166414fd5b93e61
[ "MIT" ]
5
2019-09-10T04:02:19.000Z
2020-07-24T07:46:08.000Z
tests/mp.py
dmxj/icv
0b074ec9475f2c70038d2e8b7166414fd5b93e61
[ "MIT" ]
null
null
null
tests/mp.py
dmxj/icv
0b074ec9475f2c70038d2e8b7166414fd5b93e61
[ "MIT" ]
1
2020-03-20T03:44:04.000Z
2020-03-20T03:44:04.000Z
from multiprocessing import Pool, Queue import multiprocessing import threading import time def test(x): x0,x1,x2 = x time.sleep(2) return x0+x1+x2, x0*x1*x2 # if p==10000: # return True # else: # return False class Dog(): def __init__(self): pass def go(self,name): return "hello %s" % name def tt(n): n = "rensike" return if __name__ == "__main__": # result=Queue() #队列 # pool = Pool() # def pool_th(): # for i in range(50000000): ##这里需要创建执行的子进程非常多 # try: # result.put(pool.apply_async(test, args=(i,))) # except: # break # def result_th(): # while 1: # a=result.get().get() #获取子进程返回值 # if a: # pool.terminate() #结束所有子进程 # break # ''' # 利用多线程,同时运行Pool函数创建执行子进程,以及运行获取子进程返回值函数。 # ''' # t1=threading.Thread(target=pool_th) # t2=threading.Thread(target=result_th) # t1.start() # t2.start() # t1.join() # t2.join() # pool.join() # p = multiprocessing.Pool(1) # rslt = p.map(test, ((3,6,9),)) # print(rslt[0]) from multiprocessing import Pool # import numpy as np # # def foo(a): # return "hello {}".format(a) # # p = Pool() # result = p.apply_async(foo, args=(np.random.random((2,3)),)) # # foo和a分别是你的方法和参数,这行可以写多个,执行多个进程,返回不同结果 # p.close() # p.join() # # r = result.get() # # print(r) # p = Pool() # d = Dog() # result = p.apply_async(d.go,args=("sikeppp",)) # # p.close() # p.join() # # r = result.get() # print(r)
20.597561
66
0.503848
201
1,689
4.139303
0.437811
0.075721
0.021635
0.069712
0.064904
0.064904
0.064904
0.064904
0.064904
0
0
0.032947
0.33511
1,689
81
67
20.851852
0.707925
0.573712
0
0
0
0
0.034901
0
0
0
0
0
0
1
0.222222
false
0.055556
0.277778
0.055556
0.722222
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
3
e2e80352d380fdeb17dfc45676bbe0034a2b92a7
188
py
Python
tests/twodim/test_synthetic.py
microprediction/punting
5de62913f8eb9777df1d465db0f2d606a3d19c42
[ "MIT" ]
null
null
null
tests/twodim/test_synthetic.py
microprediction/punting
5de62913f8eb9777df1d465db0f2d606a3d19c42
[ "MIT" ]
null
null
null
tests/twodim/test_synthetic.py
microprediction/punting
5de62913f8eb9777df1d465db0f2d606a3d19c42
[ "MIT" ]
null
null
null
from punting.twodim.twosynthetic import random_harville_market def test_synthetic(): n = 7 m = random_harville_market(n=n, scr=-1) if __name__=='__main__': test_synthetic()
18.8
62
0.728723
26
188
4.730769
0.730769
0.227642
0.325203
0
0
0
0
0
0
0
0
0.012739
0.164894
188
10
63
18.8
0.770701
0
0
0
0
0
0.042328
0
0
0
0
0
0
1
0.166667
false
0
0.166667
0
0.333333
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
e2f8cc5f79c191afa6de68ed0f7f734ad2297be2
1,113
py
Python
app-django/departamentos/models.py
ilanaraujo/sistema-gerenciamento-empresarial
d9be1d0b1a7541205099bb99311611d193d3ec7d
[ "MIT" ]
null
null
null
app-django/departamentos/models.py
ilanaraujo/sistema-gerenciamento-empresarial
d9be1d0b1a7541205099bb99311611d193d3ec7d
[ "MIT" ]
null
null
null
app-django/departamentos/models.py
ilanaraujo/sistema-gerenciamento-empresarial
d9be1d0b1a7541205099bb99311611d193d3ec7d
[ "MIT" ]
null
null
null
from io import IncrementalNewlineDecoder from django.db import models # Classe de departamento class Departamento(models.Model): id = models.IntegerField(primary_key=True, editable=False) nome = models.CharField(max_length=255, blank=False) numero_projetos = models.IntegerField(default=0) # Quantidade de projetos no departamento numero_funcionarios = models.IntegerField(default=0) # Quantidade de funcionários do departamento # Construtor da classe #def __init__(self, nome): # self.nome = nome def __str__(self): return self.nome def adiciona_funcionario(self, id_funcionario): # ToDo acrescentar linha na tabela funcionario_departamento print(id_funcionario) self.numero_funcionarios += 1 def remove_funcionario(self, id_funcionario): # ToDo acrescentar linha na tabela funcionario_departamento print(id_funcionario) self.numero_funcionarios -= 1 def adiciona_projeto(self): self.numero_projetos += 1 def remove_projeto(self): self.numero_projetos -= 1
32.735294
101
0.707996
126
1,113
6.047619
0.412698
0.07874
0.065617
0.068241
0.501312
0.501312
0.322835
0.322835
0.322835
0.322835
0
0.010405
0.222821
1,113
33
102
33.727273
0.87052
0.256963
0
0.105263
0
0
0
0
0
0
0
0.030303
0
1
0.263158
false
0
0.105263
0.052632
0.684211
0.105263
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
1
0
0
0
0
1
0
0
3
390cc4f320ef176a0561110f2931fe7231063d55
1,969
py
Python
tb_api_client/test/test_auth_controller_api.py
MOSAIC-LoPoW/oss7-thingsboard-backend-example
9b289dd7fdbb6e932ca338ad497a7bb1fc84d010
[ "Apache-2.0" ]
5
2017-11-27T15:48:16.000Z
2020-09-21T04:18:47.000Z
tb_api_client/test/test_auth_controller_api.py
MOSAIC-LoPoW/oss7-thingsboard-backend-example
9b289dd7fdbb6e932ca338ad497a7bb1fc84d010
[ "Apache-2.0" ]
null
null
null
tb_api_client/test/test_auth_controller_api.py
MOSAIC-LoPoW/oss7-thingsboard-backend-example
9b289dd7fdbb6e932ca338ad497a7bb1fc84d010
[ "Apache-2.0" ]
6
2018-01-14T17:23:46.000Z
2019-06-24T13:38:54.000Z
# coding: utf-8 """ Thingsboard REST API For instructions how to authorize requests please visit <a href='http://thingsboard.io/docs/reference/rest-api/'>REST API documentation page</a>. OpenAPI spec version: 2.0 Contact: info@thingsboard.io Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys import unittest import swagger_client from swagger_client.rest import ApiException from swagger_client.apis.auth_controller_api import AuthControllerApi class TestAuthControllerApi(unittest.TestCase): """ AuthControllerApi unit test stubs """ def setUp(self): self.api = swagger_client.apis.auth_controller_api.AuthControllerApi() def tearDown(self): pass def test_activate_user_using_post(self): """ Test case for activate_user_using_post activateUser """ pass def test_change_password_using_post(self): """ Test case for change_password_using_post changePassword """ pass def test_check_activate_token_using_get(self): """ Test case for check_activate_token_using_get checkActivateToken """ pass def test_check_reset_token_using_get(self): """ Test case for check_reset_token_using_get checkResetToken """ pass def test_get_user_using_get(self): """ Test case for get_user_using_get getUser """ pass def test_request_reset_password_by_email_using_post(self): """ Test case for request_reset_password_by_email_using_post requestResetPasswordByEmail """ pass def test_reset_password_using_post(self): """ Test case for reset_password_using_post resetPassword """ pass if __name__ == '__main__': unittest.main()
21.172043
149
0.661249
227
1,969
5.38326
0.370044
0.05892
0.063011
0.085925
0.322422
0.271686
0.165303
0.05401
0
0
0
0.002082
0.268156
1,969
92
150
21.402174
0.84594
0.383443
0
0.285714
0
0
0.008307
0
0
0
0
0
0
1
0.321429
false
0.392857
0.25
0
0.607143
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
3
391e4057449370d286751ffea0205e08d3058736
1,538
py
Python
route_builder/graph.py
vadimkholodilo/routes-generator
0bf19bce55ecfc2974020fbb8bc51d55bb73fd1a
[ "MIT" ]
null
null
null
route_builder/graph.py
vadimkholodilo/routes-generator
0bf19bce55ecfc2974020fbb8bc51d55bb73fd1a
[ "MIT" ]
null
null
null
route_builder/graph.py
vadimkholodilo/routes-generator
0bf19bce55ecfc2974020fbb8bc51d55bb73fd1a
[ "MIT" ]
null
null
null
""" Copyright 2020 Vadim Kholodilo <vadimkholodilo@gmail.com>, Iulia Durova <yulianna199820@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ # Class to represent a graph # This class must have the following interface: # Constructor creates an empty graph, no parameters. # addVertex(value) adds vertex to the graph # addEdge(v1, v2, weight) adds edge from v1 to v2 with a certain weight # getWeight(v1, v2) returns weight of an edge between v1 and v2, if the edge does not exist returns -1 # Dijkstra algorithm will be added in future
102.533333
461
0.786736
242
1,538
5
0.545455
0.072727
0.021488
0
0
0
0
0
0
0
0
0.014855
0.168401
1,538
14
462
109.857143
0.931196
0.975943
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
3
392319a9342f295f87a01e4b65c39850a3a7bba7
24
py
Python
lib/galaxy/version.py
natefoo/galaxy-beta2
3af3bf5742fbf0f7d301a2a8c548a3e153544448
[ "CC-BY-3.0" ]
null
null
null
lib/galaxy/version.py
natefoo/galaxy-beta2
3af3bf5742fbf0f7d301a2a8c548a3e153544448
[ "CC-BY-3.0" ]
1
2015-02-21T18:48:19.000Z
2015-02-27T15:50:32.000Z
lib/galaxy/version.py
natefoo/galaxy-beta2
3af3bf5742fbf0f7d301a2a8c548a3e153544448
[ "CC-BY-3.0" ]
3
2015-02-22T13:34:16.000Z
2020-10-01T01:28:04.000Z
VERSION_MAJOR = "15.03"
12
23
0.708333
4
24
4
1
0
0
0
0
0
0
0
0
0
0
0.190476
0.125
24
1
24
24
0.571429
0
0
0
0
0
0.208333
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
3930fe21eb5cd0ba519b6ebaa5b9946853840b7a
246
py
Python
test/test_add_group.py
eugene1smith/homeworks
47edd36feddf4965b6a9c3d665406ebdf928af85
[ "Apache-2.0" ]
null
null
null
test/test_add_group.py
eugene1smith/homeworks
47edd36feddf4965b6a9c3d665406ebdf928af85
[ "Apache-2.0" ]
null
null
null
test/test_add_group.py
eugene1smith/homeworks
47edd36feddf4965b6a9c3d665406ebdf928af85
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- from model.group import group def test_add_group(app): app.group.create(group(name="Name", header="Head", footer="Footer")) def test_add_empty_group(app): app.group.create(group(name="", header="", footer=""))
22.363636
72
0.670732
36
246
4.444444
0.472222
0.0875
0.125
0.2
0.3875
0.3875
0.3875
0
0
0
0
0.004651
0.126016
246
10
73
24.6
0.739535
0.085366
0
0
0
0
0.06278
0
0
0
0
0
0
1
0.4
false
0
0.2
0
0.6
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
3
393910313cbbed71c6e0e72f44096de0f1b773f4
291
py
Python
goodrich/python_primer/c119.py
saurabhkhattry/data-structure-algorithm-design
b56e5a049a1ef326b9214b6cc39d115001351176
[ "Apache-2.0" ]
null
null
null
goodrich/python_primer/c119.py
saurabhkhattry/data-structure-algorithm-design
b56e5a049a1ef326b9214b6cc39d115001351176
[ "Apache-2.0" ]
null
null
null
goodrich/python_primer/c119.py
saurabhkhattry/data-structure-algorithm-design
b56e5a049a1ef326b9214b6cc39d115001351176
[ "Apache-2.0" ]
null
null
null
""" C 1.19 --------------------------------- Problem Statement : Demonstrate how to use Python’s list comprehension syntax to produce the list [ a , b , c , ..., z ], but without having to type all 26 such characters literally. Author : Saurabh """ print([chr(x + 97) for x in range(26)])
24.25
88
0.604811
43
291
4.093023
0.860465
0
0
0
0
0
0
0
0
0
0
0.037657
0.178694
291
11
89
26.454545
0.698745
0.824742
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
3
1a337ebf3d2a86cd14f219f3c9b89af5616c8f7e
1,766
py
Python
link.py
EthanC2/broken-link-finder
1a699c6c1f56e0575781abfdfff767bf94345dca
[ "BSD-3-Clause" ]
null
null
null
link.py
EthanC2/broken-link-finder
1a699c6c1f56e0575781abfdfff767bf94345dca
[ "BSD-3-Clause" ]
null
null
null
link.py
EthanC2/broken-link-finder
1a699c6c1f56e0575781abfdfff767bf94345dca
[ "BSD-3-Clause" ]
null
null
null
# Link class class Link: ## Constructor ## def __init__(self, text = "None", url = "None", status_code = 000): # Not the keyword 'None' so it will still print something # Dictionary of URL-related content self.text = text self.url = url self.status_code = status_code # Trims the inside of a string (removing extra whitespace between words) def trim_inner(self, text): return " ".join( [string.strip() for string in text.split()] ) # Separate the indiv. words and trim them individually ## OVERLOADS ## # String representation of the 'Link' class def __str__(self): # Format: status code, hyperlinked text, then url (CSV) text = self.trim_inner(self.text) # Trim internal whitespace; if not text: # If the string is blank, text = "N/A" # Give it some text return f"{self.status_code}, {text}, {self.url}" # Relational Operators, compared by status code for sorting # > (less than) def __lt__(self, other): return self.status_code < other.status_code # >= (less than or equal to) def __le__(self, other): return self.status_code <= other.status_code # == (is equal to) def __eq__(self, other): return self.staus_code == other.status_code # != (is not equal to) def __ne__(self, other): return self.status_code != other.status_code # < (greater than) def __gt__(self, other): return self.status_code > other.status_code # <= (greater than or equal to) def __ge__(self, other): return self.status_code >= other.status_code # End of Link class
32.703704
132
0.596263
223
1,766
4.497758
0.367713
0.169492
0.097707
0.113659
0.292124
0.241276
0.241276
0.241276
0.241276
0.109671
0
0.002449
0.306342
1,766
53
133
33.320755
0.816327
0.348245
0
0
0
0
0.044484
0
0
0
0
0
0
1
0.375
false
0
0
0.291667
0.75
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
1a3b3a34411e2661693d22cef2b7c67cd304a5f8
14,658
py
Python
tests/integrations/java/test_JDK__verify.py
pybee/briefcase
d7e9aa7bf15aa2abbc71e97aef9bea287129fdaa
[ "BSD-3-Clause" ]
522
2015-07-28T16:06:18.000Z
2019-03-25T17:16:55.000Z
tests/integrations/java/test_JDK__verify.py
pybee/briefcase
d7e9aa7bf15aa2abbc71e97aef9bea287129fdaa
[ "BSD-3-Clause" ]
154
2015-09-17T02:50:55.000Z
2019-03-22T07:10:34.000Z
tests/integrations/java/test_JDK__verify.py
pybee/briefcase
d7e9aa7bf15aa2abbc71e97aef9bea287129fdaa
[ "BSD-3-Clause" ]
105
2015-09-25T08:43:26.000Z
2019-03-25T15:59:27.000Z
import os import shutil import subprocess import sys from pathlib import Path from unittest import mock import pytest from requests import exceptions as requests_exceptions from briefcase.console import Log from briefcase.exceptions import BriefcaseCommandError, MissingToolError, NetworkFailure from briefcase.integrations.java import JDK from tests.utils import FsPathMock @pytest.fixture def test_command(tmp_path): command = mock.MagicMock() command.logger = Log() command.tools_path = tmp_path / "tools" # Mock environ.get returning no explicit JAVA_HOME command.os.environ.get = mock.MagicMock(return_value="") return command def test_macos_tool_java_home(test_command, capsys): """On macOS, the /usr/libexec/java_home utility is checked.""" # Mock being on macOS test_command.host_os = "Darwin" # Mock 2 calls to check_output. test_command.subprocess.check_output.side_effect = [ "/path/to/java", "javac 1.8.0_144\n", ] # Create a JDK wrapper by verification jdk = JDK.verify(command=test_command) # The JDK should have the path returned by the tool assert jdk.java_home == Path("/path/to/java") test_command.subprocess.check_output.assert_has_calls( [ # First call is to /usr/lib/java_home mock.call( ["/usr/libexec/java_home"], stderr=subprocess.STDOUT, ), # Second is a call to verify a valid Java version mock.call( [os.fsdecode(Path("/path/to/java/bin/javac")), "-version"], stderr=subprocess.STDOUT, ), ] ) # No console output output = capsys.readouterr() assert output.out == "" assert output.err == "" def test_macos_tool_failure(test_command, tmp_path, capsys): """On macOS, if the libexec tool fails, the Briefcase JDK is used.""" # Mock being on macOS test_command.host_os = "Darwin" # Mock a failed call on the libexec tool test_command.subprocess.check_output.side_effect = subprocess.CalledProcessError( returncode=1, cmd="/usr/libexec/java_home" ) # Create a directory to make it look like the Briefcase Java already exists. (tmp_path / "tools" / "java" / "Contents" / "Home" / "bin").mkdir(parents=True) # Create a JDK wrapper by verification jdk = JDK.verify(command=test_command) # The JDK should have the briefcase JAVA_HOME assert jdk.java_home == tmp_path / "tools" / "java" / "Contents" / "Home" test_command.subprocess.check_output.assert_has_calls( [ # First call is to /usr/lib/java_home mock.call( ["/usr/libexec/java_home"], stderr=subprocess.STDOUT, ), ] ) # No console output output = capsys.readouterr() assert output.out == "" assert output.err == "" def test_macos_provided_overrides_tool_java_home(test_command, capsys): """On macOS, an explicit JAVA_HOME overrides /usr/libexec/java_home.""" # Mock being on macOS test_command.host_os = "Darwin" # Mock environ.get returning an explicit JAVA_HOME test_command.os.environ.get = mock.MagicMock(return_value="/path/to/java") # Mock return value from javac. libexec won't be invoked. test_command.subprocess.check_output.return_value = "javac 1.8.0_144\n" # Create a JDK wrapper by verification jdk = JDK.verify(command=test_command) # The JDK should have the path returned by the tool assert jdk.java_home == Path("/path/to/java") # A single call to check output test_command.subprocess.check_output.assert_called_once_with( [os.fsdecode(Path("/path/to/java/bin/javac")), "-version"], stderr=subprocess.STDOUT, ), # No console output output = capsys.readouterr() assert output.out == "" assert output.err == "" def test_valid_provided_java_home(test_command, capsys): """If a valid JAVA_HOME is provided, it is used.""" # Mock environ.get returning an explicit JAVA_HOME test_command.os.environ.get = mock.MagicMock(return_value="/path/to/java") # Mock return value from javac. test_command.subprocess.check_output.return_value = "javac 1.8.0_144\n" # Create a JDK wrapper by verification jdk = JDK.verify(command=test_command) # The JDK should have the path returned by the tool assert jdk.java_home == Path("/path/to/java") # A single call to check output test_command.subprocess.check_output.assert_called_once_with( [os.fsdecode(Path("/path/to/java/bin/javac")), "-version"], stderr=subprocess.STDOUT, ), # No console output output = capsys.readouterr() assert output.out == "" assert output.err == "" def test_invalid_jdk_version(test_command, tmp_path, capsys): """If the JDK pointed to by JAVA_HOME isn't a Java 8 JDK, the briefcase JDK is used.""" # Mock environ.get returning an explicit JAVA_HOME test_command.os.environ.get = mock.MagicMock(return_value="/path/to/java") # Mock return value from javac. test_command.subprocess.check_output.return_value = "javac 14\n" # Create a directory to make it look like the Briefcase Java already exists. (tmp_path / "tools" / "java" / "bin").mkdir(parents=True) # Create a JDK wrapper by verification jdk = JDK.verify(command=test_command) # The JDK should have the briefcase JAVA_HOME assert jdk.java_home == tmp_path / "tools" / "java" # A single call was made to check javac test_command.subprocess.check_output.assert_called_once_with( [os.fsdecode(Path("/path/to/java/bin/javac")), "-version"], stderr=subprocess.STDOUT, ), # No console output (because Briefcase JDK exists) output = capsys.readouterr() assert output.out == "" assert output.err == "" def test_no_javac(test_command, tmp_path, capsys): """If the JAVA_HOME doesn't point to a location with a bin/javac, the briefcase JDK is used.""" # Mock environ.get returning an explicit JAVA_HOME test_command.os.environ.get = mock.MagicMock(return_value="/path/to/nowhere") # Mock return value from javac failing because executable doesn't exist test_command.subprocess.check_output.side_effect = FileNotFoundError # Create a directory to make it look like the Briefcase Java already exists. (tmp_path / "tools" / "java" / "bin").mkdir(parents=True) # Create a JDK wrapper by verification jdk = JDK.verify(command=test_command) # The JAVA_HOME should point at the Briefcase-provided JDK assert jdk.java_home == tmp_path / "tools" / "java" # A single call was made to check javac test_command.subprocess.check_output.assert_called_once_with( [os.fsdecode(Path("/path/to/nowhere/bin/javac")), "-version"], stderr=subprocess.STDOUT, ), # No console output (because Briefcase JDK exists) output = capsys.readouterr() assert output.out == "" assert output.err == "" def test_javac_error(test_command, tmp_path, capsys): """If javac can't be executed, the briefcase JDK is used.""" # Mock environ.get returning an explicit JAVA_HOME test_command.os.environ.get = mock.MagicMock(return_value="/path/to/java") # Mock return value from javac failing because executable doesn't exist test_command.subprocess.check_output.side_effect = subprocess.CalledProcessError( returncode=1, cmd="/path/to/java/bin/javac" ) # Create a directory to make it look like the Briefcase Java already exists. (tmp_path / "tools" / "java" / "bin").mkdir(parents=True) # Create a JDK wrapper by verification jdk = JDK.verify(command=test_command) # The JDK should have the briefcase JAVA_HOME assert jdk.java_home == tmp_path / "tools" / "java" # A single call was made to check javac test_command.subprocess.check_output.assert_called_once_with( [os.fsdecode(Path("/path/to/java/bin/javac")), "-version"], stderr=subprocess.STDOUT, ), # No console output (because Briefcase JDK exists) output = capsys.readouterr() assert output.out == "" assert output.err == "" def test_unparseable_javac_version(test_command, tmp_path, capsys): """If the javac version can't be parsed, the briefcase JDK is used.""" # Mock environ.get returning an explicit JAVA_HOME test_command.os.environ.get = mock.MagicMock(return_value="/path/to/java") # Mock return value from javac. test_command.subprocess.check_output.return_value = "NONSENSE\n" # Create a directory to make it look like the Briefcase Java already exists. (tmp_path / "tools" / "java" / "bin").mkdir(parents=True) # Create a JDK wrapper by verification jdk = JDK.verify(command=test_command) # The JDK should have the briefcase JAVA_HOME assert jdk.java_home == tmp_path / "tools" / "java" # A single call was made to check javac test_command.subprocess.check_output.assert_called_once_with( [os.fsdecode(Path("/path/to/java/bin/javac")), "-version"], stderr=subprocess.STDOUT, ), # No console output (because Briefcase JDK exists) output = capsys.readouterr() assert output.out == "" assert output.err == "" @pytest.mark.parametrize( ("host_os, jdk_url, jhome"), [ ( "Darwin", "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/" "jdk8u242-b08/OpenJDK8U-jdk_x64_mac_hotspot_8u242b08.tar.gz", "java/Contents/Home", ), ( "Linux", "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/" "jdk8u242-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u242b08.tar.gz", "java", ), ( "Windows", "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/" "jdk8u242-b08/OpenJDK8U-jdk_x64_windows_hotspot_8u242b08.zip", "java", ), ], ) def test_successful_jdk_download( test_command, tmp_path, capsys, host_os, jdk_url, jhome ): """If needed, a JDK can be downloaded.""" # Mock host OS test_command.host_os = host_os # Mock a JAVA_HOME that won't exist # This is only needed to make macOS *not* run /usr/libexec/java_home test_command.os.environ.get = mock.MagicMock(return_value="/does/not/exist") # Mock the cached download path # Consider to remove if block when we drop py3.7 support, only keep statements from else. # MagicMock below py3.8 doesn't has __fspath__ attribute. if sys.version_info < (3, 8): archive = FsPathMock("/path/to/download.zip") else: archive = mock.MagicMock() archive.__fspath__.return_value = "/path/to/download.zip" test_command.download_url.return_value = archive # Create a directory to make it look like Java was downloaded and unpacked. (tmp_path / "tools" / "jdk8u242-b08").mkdir(parents=True) # Invoke the verify call jdk = JDK.verify(command=test_command) assert jdk.java_home == tmp_path / "tools" / jhome # Console output contains a warning about the bad JDK location output = capsys.readouterr() assert output.err == "" assert "** WARNING: JAVA_HOME does not point to a Java 8 JDK" in output.out # Download was invoked test_command.download_url.assert_called_with( url=jdk_url, download_path=tmp_path / "tools", ) # The archive was unpacked # TODO: Py3.6 compatibility; os.fsdecode not required in Py3.7 test_command.shutil.unpack_archive.assert_called_with( "/path/to/download.zip", extract_dir=os.fsdecode(tmp_path / "tools") ) # The original archive was deleted archive.unlink.assert_called_once_with() def test_not_installed(test_command, tmp_path): """If the JDK isn't installed, and install isn't requested, an error is raised.""" # Mock host OS test_command.host_os = "Linux" # Invoke the verify call. Install is not requested, so this will fail. with pytest.raises(MissingToolError): JDK.verify(command=test_command, install=False) # Download was not invoked assert test_command.download_url.call_count == 0 def test_jdk_download_failure(test_command, tmp_path): """If an error occurs downloading the JDK, an error is raised.""" # Mock Linux as the host test_command.host_os = "Linux" # Mock a failure on download test_command.download_url.side_effect = requests_exceptions.ConnectionError # Invoking verify_jdk causes a network failure. with pytest.raises(NetworkFailure): JDK.verify(command=test_command) # That download was attempted test_command.download_url.assert_called_with( url="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/" "jdk8u242-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u242b08.tar.gz", download_path=tmp_path / "tools", ) # No attempt was made to unpack the archive assert test_command.shutil.unpack_archive.call_count == 0 def test_invalid_jdk_archive(test_command, tmp_path): """If the JDK download isn't a valid archive, raise an error.""" # Mock Linux as the host test_command.host_os = "Linux" # Mock the cached download path # Consider to remove if block when we drop py3.7 support, only keep statements from else. # MagicMock below py3.8 doesn't has __fspath__ attribute. if sys.version_info < (3, 8): archive = FsPathMock("/path/to/download.zip") else: archive = mock.MagicMock() archive.__fspath__.return_value = "/path/to/download.zip" test_command.download_url.return_value = archive # Mock an unpack failure due to an invalid archive test_command.shutil.unpack_archive.side_effect = shutil.ReadError with pytest.raises(BriefcaseCommandError): JDK.verify(command=test_command) # The download occurred test_command.download_url.assert_called_with( url="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/" "jdk8u242-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u242b08.tar.gz", download_path=tmp_path / "tools", ) # An attempt was made to unpack the archive. # TODO: Py3.6 compatibility; os.fsdecode not required in Py3.7 test_command.shutil.unpack_archive.assert_called_with( "/path/to/download.zip", extract_dir=os.fsdecode(tmp_path / "tools") ) # The original archive was not deleted assert archive.unlink.call_count == 0
35.066986
93
0.68611
1,982
14,658
4.913724
0.119072
0.074546
0.022179
0.042715
0.775542
0.731595
0.718144
0.693706
0.662388
0.662388
0
0.011612
0.212717
14,658
417
94
35.151079
0.832322
0.302702
0
0.602679
0
0
0.161383
0.067177
0
0
0
0.004796
0.196429
1
0.058036
false
0
0.053571
0
0.116071
0
0
0
0
null
0
0
0
0
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
1a62f4164187518caa99367786abcd22a21e6480
1,288
py
Python
registration_app/tests/frontend/test_view.py
radekska/django-network-controller
6bcb847cbe1efa7dee118974de5e49b4f411e5da
[ "MIT" ]
null
null
null
registration_app/tests/frontend/test_view.py
radekska/django-network-controller
6bcb847cbe1efa7dee118974de5e49b4f411e5da
[ "MIT" ]
null
null
null
registration_app/tests/frontend/test_view.py
radekska/django-network-controller
6bcb847cbe1efa7dee118974de5e49b4f411e5da
[ "MIT" ]
null
null
null
import pytest import requests import unittest from django.test import TestCase from django.urls import reverse from django.contrib.auth.models import User from selenium import webdriver from selenium.webdriver.chrome.options import Options from webdriver_manager.chrome import ChromeDriverManager # giving pytest access to database. # pytestmark = pytest.mark.django_db # class TestRegistrationSignUp(unittest.TestCase): # def test_post_request(self): # options = Options() # options.headless = True # self.driver = webdriver.Chrome(ChromeDriverManager().install(), chrome_options=options) # # self.driver.get("http://localhost:8000/registration/") # self.driver.find_element_by_id('username').send_keys("test_username") # self.driver.find_element_by_id('password1').send_keys("Test_password123") # self.driver.find_element_by_id('password2').send_keys("Test_password123") # # self.driver.find_element_by_id('submit').click() # self.assertIn("http://localhost:8000/", self.driver.current_url) # # created_user = User.objects.get(username='test_username') # self.assertEqual(created_user.username, 'test_username') # self.assertEqual(isinstance(created_user.password, str), True)
33.894737
97
0.735248
153
1,288
6
0.411765
0.076253
0.061002
0.091503
0.235294
0.159041
0.104575
0.104575
0.104575
0.104575
0
0.014639
0.151398
1,288
37
98
34.810811
0.825252
0.732143
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
3
1a8f11a248ca1351bd360d4ea1e5e3435ee8c318
188
py
Python
functions/analytics_worker/test/conftest.py
epiphone/lambda-terraform-analytics
b569ee6a7bcb56c8c3c41b875edd4859350010ee
[ "MIT" ]
null
null
null
functions/analytics_worker/test/conftest.py
epiphone/lambda-terraform-analytics
b569ee6a7bcb56c8c3c41b875edd4859350010ee
[ "MIT" ]
null
null
null
functions/analytics_worker/test/conftest.py
epiphone/lambda-terraform-analytics
b569ee6a7bcb56c8c3c41b875edd4859350010ee
[ "MIT" ]
null
null
null
import os import sys here = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, os.path.join(here, '..', '..', '..', 'test_utils')) from fixtures import event, lambda_context
23.5
70
0.696809
28
188
4.464286
0.642857
0.144
0
0
0
0
0
0
0
0
0
0.005952
0.106383
188
7
71
26.857143
0.738095
0
0
0
0
0
0.085106
0
0
0
0
0
0
1
0
false
0
0.6
0
0.6
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
1a9012d3bbaeed3c5502f33b98692347736e7973
213
wsgi
Python
darkweb.wsgi
robopt/Capstone
d0e092ed7f4a2a2fc2ec79bd2fdf06663de19c11
[ "Apache-2.0" ]
5
2016-04-11T20:24:40.000Z
2019-03-11T23:19:13.000Z
darkweb.wsgi
robopt/Capstone
d0e092ed7f4a2a2fc2ec79bd2fdf06663de19c11
[ "Apache-2.0" ]
null
null
null
darkweb.wsgi
robopt/Capstone
d0e092ed7f4a2a2fc2ec79bd2fdf06663de19c11
[ "Apache-2.0" ]
5
2016-04-18T19:08:59.000Z
2019-01-08T20:11:19.000Z
#!/usr/bin/python import sys import logging logging.basicConfig(stream=sys.stderr) sys.path.insert(0,"/var/www/capstone/") #from FlaskApp import app as application #application.secret_key = 'Add your secret key'
23.666667
47
0.779343
32
213
5.15625
0.75
0.109091
0
0
0
0
0
0
0
0
0
0.005181
0.093897
213
8
48
26.625
0.849741
0.474178
0
0
0
0
0.165138
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
3
1a9e3905097491e316cd401df61464d8541b1d60
7,038
py
Python
examples/shapes_from_glsl/cylinder_shape.py
szabolcsdombi/zengl
2c9c26784285f2f049fb5d6fc9da0ad65d32d52f
[ "MIT" ]
116
2021-10-31T17:24:18.000Z
2022-02-01T05:47:18.000Z
examples/shapes_from_glsl/cylinder_shape.py
szabolcsdombi/zengl
2c9c26784285f2f049fb5d6fc9da0ad65d32d52f
[ "MIT" ]
9
2021-11-12T19:21:33.000Z
2022-01-20T09:48:31.000Z
examples/shapes_from_glsl/cylinder_shape.py
szabolcsdombi/zengl
2c9c26784285f2f049fb5d6fc9da0ad65d32d52f
[ "MIT" ]
3
2021-11-12T18:55:05.000Z
2022-01-19T13:58:26.000Z
import zengl from defaults import defaults from grid import grid_pipeline from window import Window window = Window(1280, 720) ctx = zengl.context() image = ctx.image(window.size, 'rgba8unorm', samples=4) depth = ctx.image(window.size, 'depth24plus', samples=4) image.clear_value = (0.2, 0.2, 0.2, 1.0) ctx.includes['defaults'] = defaults grid = grid_pipeline(ctx, [image, depth]) pipeline = ctx.pipeline( vertex_shader=''' #version 330 #include "defaults" vec3 vertices[24] = vec3[]( vec3(0.000000, 1.000000, -0.500000), vec3(0.000000, 1.000000, 0.500000), vec3(0.500000, 0.866025, -0.500000), vec3(0.500000, 0.866025, 0.500000), vec3(0.866025, 0.500000, -0.500000), vec3(0.866025, 0.500000, 0.500000), vec3(1.000000, -0.000000, -0.500000), vec3(1.000000, -0.000000, 0.500000), vec3(0.866025, -0.500000, -0.500000), vec3(0.866025, -0.500000, 0.500000), vec3(0.500000, -0.866025, -0.500000), vec3(0.500000, -0.866025, 0.500000), vec3(-0.000000, -1.000000, -0.500000), vec3(-0.000000, -1.000000, 0.500000), vec3(-0.500000, -0.866025, -0.500000), vec3(-0.500000, -0.866025, 0.500000), vec3(-0.866025, -0.500000, -0.500000), vec3(-0.866025, -0.500000, 0.500000), vec3(-1.000000, 0.000000, -0.500000), vec3(-1.000000, 0.000000, 0.500000), vec3(-0.866025, 0.500000, -0.500000), vec3(-0.866025, 0.500000, 0.500000), vec3(-0.500000, 0.866025, -0.500000), vec3(-0.500000, 0.866025, 0.500000) ); vec3 normals[14] = vec3[]( vec3(-0.0000, 1.0000, -0.0000), vec3(0.5000, 0.8660, -0.0000), vec3(0.8660, 0.5000, -0.0000), vec3(1.0000, -0.0000, -0.0000), vec3(0.8660, -0.5000, -0.0000), vec3(0.5000, -0.8660, -0.0000), vec3(-0.0000, -1.0000, -0.0000), vec3(-0.5000, -0.8660, -0.0000), vec3(-0.8660, -0.5000, -0.0000), vec3(-1.0000, -0.0000, -0.0000), vec3(-0.8660, 0.5000, -0.0000), vec3(-0.0000, -0.0000, 1.0000), vec3(-0.5000, 0.8660, -0.0000), vec3(-0.0000, -0.0000, -1.0000) ); vec2 texcoords[50] = vec2[]( vec2(1.000000, 0.500000), vec2(0.000000, 0.500000), vec2(0.750000, 0.490000), vec2(1.000000, 1.000000), vec2(0.250000, 0.490000), vec2(0.000000, 1.000000), vec2(0.916667, 0.500000), vec2(0.870000, 0.457846), vec2(0.916667, 1.000000), vec2(0.370000, 0.457846), vec2(0.833333, 0.500000), vec2(0.957846, 0.370000), vec2(0.833333, 1.000000), vec2(0.457846, 0.370000), vec2(0.750000, 0.500000), vec2(0.990000, 0.250000), vec2(0.750000, 1.000000), vec2(0.490000, 0.250000), vec2(0.666667, 0.500000), vec2(0.957846, 0.130000), vec2(0.666667, 1.000000), vec2(0.457846, 0.130000), vec2(0.583333, 0.500000), vec2(0.870000, 0.042154), vec2(0.583333, 1.000000), vec2(0.370000, 0.042154), vec2(0.500000, 0.500000), vec2(0.750000, 0.010000), vec2(0.500000, 1.000000), vec2(0.250000, 0.010000), vec2(0.416667, 0.500000), vec2(0.630000, 0.042154), vec2(0.416667, 1.000000), vec2(0.130000, 0.042154), vec2(0.333333, 0.500000), vec2(0.542154, 0.130000), vec2(0.333333, 1.000000), vec2(0.042154, 0.130000), vec2(0.250000, 0.500000), vec2(0.510000, 0.250000), vec2(0.250000, 1.000000), vec2(0.010000, 0.250000), vec2(0.166667, 0.500000), vec2(0.542154, 0.370000), vec2(0.042154, 0.370000), vec2(0.166667, 1.000000), vec2(0.083333, 0.500000), vec2(0.630000, 0.457846), vec2(0.130000, 0.457846), vec2(0.083333, 1.000000) ); int vertex_indices[132] = int[]( 1, 2, 0, 3, 4, 2, 5, 6, 4, 7, 8, 6, 9, 10, 8, 11, 12, 10, 13, 14, 12, 15, 16, 14, 17, 18, 16, 19, 20, 18, 21, 13, 5, 21, 22, 20, 23, 0, 22, 6, 14, 22, 1, 3, 2, 3, 5, 4, 5, 7, 6, 7, 9, 8, 9, 11, 10, 11, 13, 12, 13, 15, 14, 15, 17, 16, 17, 19, 18, 19, 21, 20, 5, 3, 1, 1, 23, 21, 21, 19, 17, 17, 15, 13, 13, 11, 9, 9, 7, 5, 5, 1, 21, 21, 17, 13, 13, 9, 5, 21, 23, 22, 23, 1, 0, 22, 0, 2, 2, 4, 6, 6, 8, 10, 10, 12, 14, 14, 16, 18, 18, 20, 22, 22, 2, 6, 6, 10, 14, 14, 18, 22 ); int normal_indices[132] = int[]( 0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 4, 3, 4, 5, 4, 5, 6, 5, 6, 7, 6, 7, 8, 7, 8, 9, 8, 9, 10, 9, 11, 11, 11, 10, 12, 10, 12, 0, 12, 13, 13, 13, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 12, 12, 12, 0, 0, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13 ); int texcoord_indices[132] = int[]( 3, 6, 0, 8, 10, 6, 12, 14, 10, 16, 18, 14, 20, 22, 18, 24, 26, 22, 28, 30, 26, 32, 34, 30, 36, 38, 34, 40, 42, 38, 44, 29, 13, 45, 46, 42, 49, 1, 46, 15, 31, 47, 3, 8, 6, 8, 12, 10, 12, 16, 14, 16, 20, 18, 20, 24, 22, 24, 28, 26, 28, 32, 30, 32, 36, 34, 36, 40, 38, 40, 45, 42, 13, 9, 4, 4, 48, 44, 44, 41, 37, 37, 33, 29, 29, 25, 21, 21, 17, 13, 13, 4, 44, 44, 37, 29, 29, 21, 13, 45, 49, 46, 49, 5, 1, 47, 2, 7, 7, 11, 15, 15, 19, 23, 23, 27, 31, 31, 35, 39, 39, 43, 47, 47, 7, 15, 15, 23, 31, 31, 39, 47 ); out vec3 v_vertex; out vec3 v_normal; out vec2 v_texcoord; void main() { v_vertex = vertices[vertex_indices[gl_VertexID]]; v_normal = normals[normal_indices[gl_VertexID]]; v_texcoord = texcoords[texcoord_indices[gl_VertexID]]; gl_Position = mvp * vec4(v_vertex, 1.0); } ''', fragment_shader=''' #version 330 #include "defaults" in vec3 v_normal; layout (location = 0) out vec4 out_color; void main() { float lum = dot(normalize(light.xyz), normalize(v_normal)) * 0.7 + 0.3; out_color = vec4(lum, lum, lum, 1.0); } ''', framebuffer=[image, depth], topology='triangles', cull_face='back', vertex_count=132, ) while window.update(): image.clear() depth.clear() grid.render() pipeline.render() image.blit()
38.67033
119
0.483376
1,114
7,038
3.028725
0.130162
0.114108
0.046236
0.056906
0.422644
0.379964
0.289864
0.289864
0.289864
0.283936
0
0.474829
0.333902
7,038
181
120
38.883978
0.244881
0
0
0.086957
0
0.099379
0.908355
0.023018
0
0
0
0
0
1
0
false
0
0.024845
0
0.024845
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
1aa5cb26673be28d20ce4e1d7ff0bb74d202e4d0
274
py
Python
venv/Lib/site-packages/astroid/__pkginfo__.py
AnxhelaMehmetaj/is219_flask
1e88579f14a96c9826e9452b3c7f8e6477577ef7
[ "BSD-3-Clause" ]
null
null
null
venv/Lib/site-packages/astroid/__pkginfo__.py
AnxhelaMehmetaj/is219_flask
1e88579f14a96c9826e9452b3c7f8e6477577ef7
[ "BSD-3-Clause" ]
null
null
null
venv/Lib/site-packages/astroid/__pkginfo__.py
AnxhelaMehmetaj/is219_flask
1e88579f14a96c9826e9452b3c7f8e6477577ef7
[ "BSD-3-Clause" ]
null
null
null
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html # For details: https://github.com/PyCQA/astroid/blob/main/LICENSE # Copyright (c) https://github.com/PyCQA/astroid/blob/main/CONTRIBUTORS.txt __version__ = "2.11.2" version = __version__
39.142857
85
0.759124
43
274
4.651163
0.674419
0.11
0.14
0.19
0.34
0.34
0.34
0
0
0
0
0.023715
0.076642
274
6
86
45.666667
0.766798
0.806569
0
0
0
0
0.122449
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
1ab0f01b6cfb191ba89088f444dfc7d72d15e946
2,140
py
Python
happy/Utils.py
yunhanw-google/happy
d482f1eeb188a03e3bcd1aefe54424fb2589c9e9
[ "Apache-2.0" ]
42
2017-09-20T07:09:59.000Z
2021-11-08T12:08:30.000Z
happy/Utils.py
yunhanw-google/happy
d482f1eeb188a03e3bcd1aefe54424fb2589c9e9
[ "Apache-2.0" ]
30
2018-06-16T14:48:14.000Z
2020-10-13T04:02:35.000Z
happy/Utils.py
yunhanw-google/happy
d482f1eeb188a03e3bcd1aefe54424fb2589c9e9
[ "Apache-2.0" ]
17
2017-09-20T10:37:56.000Z
2021-02-09T06:27:44.000Z
#!/usr/bin/env python3 # # Copyright (c) 2015-2017 Nest Labs, Inc. # All rights reserved. # # 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 __future__ import absolute_import import time ## # @file # Provides general, low-level utilities used in software implementing Happy. # ## # Formats input string to print in Red on terminal. # # @param[in] txt A string or object that can be coverted to string. # # @return string with prefixed and suffixed ASCII color formatting. # def hred(txt): return '\033[31m' + str(txt) + '\033[0m' ## # Formats input string to print in Green on terminal. # # @param[in] txt A string or object that can be coverted to string. # # @return string with prefixed and suffixed ASCII color formatting. # def hgreen(txt): return '\033[32m' + str(txt) + '\033[0m' ## # Formats input string to print in Yellow on terminal. # # @param[in] txt A string or object that can be coverted to string. # # @return string with prefixed and suffixed ASCII color formatting. # def hyellow(txt): return '\033[33m' + str(txt) + '\033[0m' ## # Formats input string to print in Blue on terminal. # # @param[in] txt A string or object that can be coverted to string. # # @return string with prefixed and suffixed ASCII color formatting. # def hblue(txt): return '\033[34m' + str(txt) + '\033[0m' ## # Delays execution of a program by sec seconds. # # @param[in] sec A number of seconds to delay execution by. # # @return none # def delayExecution(sec): time.sleep(sec)
26.097561
82
0.671495
309
2,140
4.634304
0.420712
0.041899
0.050279
0.055866
0.428073
0.428073
0.409218
0.409218
0.409218
0.409218
0
0.029933
0.235047
2,140
81
83
26.419753
0.844838
0.778972
0
0
0
0
0.145985
0
0
0
0
0
0
1
0.416667
false
0
0.166667
0.333333
0.916667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
1abb0d4acfc6ecf3ec22c58282eb86a6173b6334
310
py
Python
src/housie_game.py
Eclair24/housie
7892002914c2ced422f89cd8c050993c2f931deb
[ "Apache-2.0" ]
1
2020-08-10T07:44:01.000Z
2020-08-10T07:44:01.000Z
src/housie_game.py
Eclair24/housie
7892002914c2ced422f89cd8c050993c2f931deb
[ "Apache-2.0" ]
1
2020-12-07T16:31:05.000Z
2020-12-09T09:04:58.000Z
src/housie_game.py
Eclair24/housie
7892002914c2ced422f89cd8c050993c2f931deb
[ "Apache-2.0" ]
1
2020-10-01T17:54:19.000Z
2020-10-01T17:54:19.000Z
"""Convenience file to help start the game when the repo is cloned from git rather than installed via pip This was required as we needed to run the script from the same level as the housie/ package in order for the imports to work correctly. """ from housie.game import display_main_menu display_main_menu()
34.444444
116
0.793548
55
310
4.4
0.727273
0.090909
0.123967
0
0
0
0
0
0
0
0
0
0.170968
310
8
117
38.75
0.941634
0.770968
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
3
46b8fb46b8c0cdd613c5bd9b26b79ccbc17c69b5
42,439
py
Python
sdk/python/pulumi_azure_nextgen/compute/v20200930/outputs.py
test-wiz-sec/pulumi-azure-nextgen
20a695af0d020b34b0f1c336e1b69702755174cc
[ "Apache-2.0" ]
null
null
null
sdk/python/pulumi_azure_nextgen/compute/v20200930/outputs.py
test-wiz-sec/pulumi-azure-nextgen
20a695af0d020b34b0f1c336e1b69702755174cc
[ "Apache-2.0" ]
null
null
null
sdk/python/pulumi_azure_nextgen/compute/v20200930/outputs.py
test-wiz-sec/pulumi-azure-nextgen
20a695af0d020b34b0f1c336e1b69702755174cc
[ "Apache-2.0" ]
null
null
null
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from ... import _utilities, _tables from . import outputs __all__ = [ 'DataDiskImageEncryptionResponse', 'DisallowedResponse', 'EncryptionImagesResponse', 'GalleryApplicationVersionPublishingProfileResponse', 'GalleryArtifactVersionSourceResponse', 'GalleryDataDiskImageResponse', 'GalleryIdentifierResponse', 'GalleryImageFeatureResponse', 'GalleryImageIdentifierResponse', 'GalleryImageVersionPublishingProfileResponse', 'GalleryImageVersionStorageProfileResponse', 'GalleryOSDiskImageResponse', 'ImagePurchasePlanResponse', 'OSDiskImageEncryptionResponse', 'RecommendedMachineConfigurationResponse', 'RegionalReplicationStatusResponse', 'ReplicationStatusResponse', 'ResourceRangeResponse', 'SharingProfileGroupResponse', 'SharingProfileResponse', 'TargetRegionResponse', 'UserArtifactManageResponse', 'UserArtifactSourceResponse', ] @pulumi.output_type class DataDiskImageEncryptionResponse(dict): """ Contains encryption settings for a data disk image. """ def __init__(__self__, *, lun: int, disk_encryption_set_id: Optional[str] = None): """ Contains encryption settings for a data disk image. :param int lun: This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine. :param str disk_encryption_set_id: A relative URI containing the resource ID of the disk encryption set. """ pulumi.set(__self__, "lun", lun) if disk_encryption_set_id is not None: pulumi.set(__self__, "disk_encryption_set_id", disk_encryption_set_id) @property @pulumi.getter def lun(self) -> int: """ This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine. """ return pulumi.get(self, "lun") @property @pulumi.getter(name="diskEncryptionSetId") def disk_encryption_set_id(self) -> Optional[str]: """ A relative URI containing the resource ID of the disk encryption set. """ return pulumi.get(self, "disk_encryption_set_id") def _translate_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop @pulumi.output_type class DisallowedResponse(dict): """ Describes the disallowed disk types. """ def __init__(__self__, *, disk_types: Optional[Sequence[str]] = None): """ Describes the disallowed disk types. :param Sequence[str] disk_types: A list of disk types. """ if disk_types is not None: pulumi.set(__self__, "disk_types", disk_types) @property @pulumi.getter(name="diskTypes") def disk_types(self) -> Optional[Sequence[str]]: """ A list of disk types. """ return pulumi.get(self, "disk_types") def _translate_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop @pulumi.output_type class EncryptionImagesResponse(dict): """ Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. """ def __init__(__self__, *, data_disk_images: Optional[Sequence['outputs.DataDiskImageEncryptionResponse']] = None, os_disk_image: Optional['outputs.OSDiskImageEncryptionResponse'] = None): """ Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. :param Sequence['DataDiskImageEncryptionResponseArgs'] data_disk_images: A list of encryption specifications for data disk images. :param 'OSDiskImageEncryptionResponseArgs' os_disk_image: Contains encryption settings for an OS disk image. """ if data_disk_images is not None: pulumi.set(__self__, "data_disk_images", data_disk_images) if os_disk_image is not None: pulumi.set(__self__, "os_disk_image", os_disk_image) @property @pulumi.getter(name="dataDiskImages") def data_disk_images(self) -> Optional[Sequence['outputs.DataDiskImageEncryptionResponse']]: """ A list of encryption specifications for data disk images. """ return pulumi.get(self, "data_disk_images") @property @pulumi.getter(name="osDiskImage") def os_disk_image(self) -> Optional['outputs.OSDiskImageEncryptionResponse']: """ Contains encryption settings for an OS disk image. """ return pulumi.get(self, "os_disk_image") def _translate_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop @pulumi.output_type class GalleryApplicationVersionPublishingProfileResponse(dict): """ The publishing profile of a gallery image version. """ def __init__(__self__, *, published_date: str, source: 'outputs.UserArtifactSourceResponse', enable_health_check: Optional[bool] = None, end_of_life_date: Optional[str] = None, exclude_from_latest: Optional[bool] = None, manage_actions: Optional['outputs.UserArtifactManageResponse'] = None, replica_count: Optional[int] = None, storage_account_type: Optional[str] = None, target_regions: Optional[Sequence['outputs.TargetRegionResponse']] = None): """ The publishing profile of a gallery image version. :param str published_date: The timestamp for when the gallery image version is published. :param 'UserArtifactSourceResponseArgs' source: The source image from which the Image Version is going to be created. :param bool enable_health_check: Optional. Whether or not this application reports health. :param str end_of_life_date: The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property is updatable. :param bool exclude_from_latest: If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. :param int replica_count: The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. :param str storage_account_type: Specifies the storage account type to be used to store the image. This property is not updatable. :param Sequence['TargetRegionResponseArgs'] target_regions: The target regions where the Image Version is going to be replicated to. This property is updatable. """ pulumi.set(__self__, "published_date", published_date) pulumi.set(__self__, "source", source) if enable_health_check is not None: pulumi.set(__self__, "enable_health_check", enable_health_check) if end_of_life_date is not None: pulumi.set(__self__, "end_of_life_date", end_of_life_date) if exclude_from_latest is not None: pulumi.set(__self__, "exclude_from_latest", exclude_from_latest) if manage_actions is not None: pulumi.set(__self__, "manage_actions", manage_actions) if replica_count is not None: pulumi.set(__self__, "replica_count", replica_count) if storage_account_type is not None: pulumi.set(__self__, "storage_account_type", storage_account_type) if target_regions is not None: pulumi.set(__self__, "target_regions", target_regions) @property @pulumi.getter(name="publishedDate") def published_date(self) -> str: """ The timestamp for when the gallery image version is published. """ return pulumi.get(self, "published_date") @property @pulumi.getter def source(self) -> 'outputs.UserArtifactSourceResponse': """ The source image from which the Image Version is going to be created. """ return pulumi.get(self, "source") @property @pulumi.getter(name="enableHealthCheck") def enable_health_check(self) -> Optional[bool]: """ Optional. Whether or not this application reports health. """ return pulumi.get(self, "enable_health_check") @property @pulumi.getter(name="endOfLifeDate") def end_of_life_date(self) -> Optional[str]: """ The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property is updatable. """ return pulumi.get(self, "end_of_life_date") @property @pulumi.getter(name="excludeFromLatest") def exclude_from_latest(self) -> Optional[bool]: """ If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. """ return pulumi.get(self, "exclude_from_latest") @property @pulumi.getter(name="manageActions") def manage_actions(self) -> Optional['outputs.UserArtifactManageResponse']: return pulumi.get(self, "manage_actions") @property @pulumi.getter(name="replicaCount") def replica_count(self) -> Optional[int]: """ The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. """ return pulumi.get(self, "replica_count") @property @pulumi.getter(name="storageAccountType") def storage_account_type(self) -> Optional[str]: """ Specifies the storage account type to be used to store the image. This property is not updatable. """ return pulumi.get(self, "storage_account_type") @property @pulumi.getter(name="targetRegions") def target_regions(self) -> Optional[Sequence['outputs.TargetRegionResponse']]: """ The target regions where the Image Version is going to be replicated to. This property is updatable. """ return pulumi.get(self, "target_regions") def _translate_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop @pulumi.output_type class GalleryArtifactVersionSourceResponse(dict): """ The gallery artifact version source. """ def __init__(__self__, *, id: Optional[str] = None, uri: Optional[str] = None): """ The gallery artifact version source. :param str id: The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, user image or storage account resource. :param str uri: The uri of the gallery artifact version source. Currently used to specify vhd/blob source. """ if id is not None: pulumi.set(__self__, "id", id) if uri is not None: pulumi.set(__self__, "uri", uri) @property @pulumi.getter def id(self) -> Optional[str]: """ The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, user image or storage account resource. """ return pulumi.get(self, "id") @property @pulumi.getter def uri(self) -> Optional[str]: """ The uri of the gallery artifact version source. Currently used to specify vhd/blob source. """ return pulumi.get(self, "uri") def _translate_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop @pulumi.output_type class GalleryDataDiskImageResponse(dict): """ This is the data disk image. """ def __init__(__self__, *, lun: int, size_in_gb: int, host_caching: Optional[str] = None, source: Optional['outputs.GalleryArtifactVersionSourceResponse'] = None): """ This is the data disk image. :param int lun: This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine. :param int size_in_gb: This property indicates the size of the VHD to be created. :param str host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' :param 'GalleryArtifactVersionSourceResponseArgs' source: The gallery artifact version source. """ pulumi.set(__self__, "lun", lun) pulumi.set(__self__, "size_in_gb", size_in_gb) if host_caching is not None: pulumi.set(__self__, "host_caching", host_caching) if source is not None: pulumi.set(__self__, "source", source) @property @pulumi.getter def lun(self) -> int: """ This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine. """ return pulumi.get(self, "lun") @property @pulumi.getter(name="sizeInGB") def size_in_gb(self) -> int: """ This property indicates the size of the VHD to be created. """ return pulumi.get(self, "size_in_gb") @property @pulumi.getter(name="hostCaching") def host_caching(self) -> Optional[str]: """ The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' """ return pulumi.get(self, "host_caching") @property @pulumi.getter def source(self) -> Optional['outputs.GalleryArtifactVersionSourceResponse']: """ The gallery artifact version source. """ return pulumi.get(self, "source") def _translate_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop @pulumi.output_type class GalleryIdentifierResponse(dict): """ Describes the gallery unique name. """ def __init__(__self__, *, unique_name: str): """ Describes the gallery unique name. :param str unique_name: The unique name of the Shared Image Gallery. This name is generated automatically by Azure. """ pulumi.set(__self__, "unique_name", unique_name) @property @pulumi.getter(name="uniqueName") def unique_name(self) -> str: """ The unique name of the Shared Image Gallery. This name is generated automatically by Azure. """ return pulumi.get(self, "unique_name") def _translate_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop @pulumi.output_type class GalleryImageFeatureResponse(dict): """ A feature for gallery image. """ def __init__(__self__, *, name: Optional[str] = None, value: Optional[str] = None): """ A feature for gallery image. :param str name: The name of the gallery image feature. :param str value: The value of the gallery image feature. """ if name is not None: pulumi.set(__self__, "name", name) if value is not None: pulumi.set(__self__, "value", value) @property @pulumi.getter def name(self) -> Optional[str]: """ The name of the gallery image feature. """ return pulumi.get(self, "name") @property @pulumi.getter def value(self) -> Optional[str]: """ The value of the gallery image feature. """ return pulumi.get(self, "value") def _translate_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop @pulumi.output_type class GalleryImageIdentifierResponse(dict): """ This is the gallery image definition identifier. """ def __init__(__self__, *, offer: str, publisher: str, sku: str): """ This is the gallery image definition identifier. :param str offer: The name of the gallery image definition offer. :param str publisher: The name of the gallery image definition publisher. :param str sku: The name of the gallery image definition SKU. """ pulumi.set(__self__, "offer", offer) pulumi.set(__self__, "publisher", publisher) pulumi.set(__self__, "sku", sku) @property @pulumi.getter def offer(self) -> str: """ The name of the gallery image definition offer. """ return pulumi.get(self, "offer") @property @pulumi.getter def publisher(self) -> str: """ The name of the gallery image definition publisher. """ return pulumi.get(self, "publisher") @property @pulumi.getter def sku(self) -> str: """ The name of the gallery image definition SKU. """ return pulumi.get(self, "sku") def _translate_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop @pulumi.output_type class GalleryImageVersionPublishingProfileResponse(dict): """ The publishing profile of a gallery image Version. """ def __init__(__self__, *, published_date: str, end_of_life_date: Optional[str] = None, exclude_from_latest: Optional[bool] = None, replica_count: Optional[int] = None, storage_account_type: Optional[str] = None, target_regions: Optional[Sequence['outputs.TargetRegionResponse']] = None): """ The publishing profile of a gallery image Version. :param str published_date: The timestamp for when the gallery image version is published. :param str end_of_life_date: The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property is updatable. :param bool exclude_from_latest: If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. :param int replica_count: The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. :param str storage_account_type: Specifies the storage account type to be used to store the image. This property is not updatable. :param Sequence['TargetRegionResponseArgs'] target_regions: The target regions where the Image Version is going to be replicated to. This property is updatable. """ pulumi.set(__self__, "published_date", published_date) if end_of_life_date is not None: pulumi.set(__self__, "end_of_life_date", end_of_life_date) if exclude_from_latest is not None: pulumi.set(__self__, "exclude_from_latest", exclude_from_latest) if replica_count is not None: pulumi.set(__self__, "replica_count", replica_count) if storage_account_type is not None: pulumi.set(__self__, "storage_account_type", storage_account_type) if target_regions is not None: pulumi.set(__self__, "target_regions", target_regions) @property @pulumi.getter(name="publishedDate") def published_date(self) -> str: """ The timestamp for when the gallery image version is published. """ return pulumi.get(self, "published_date") @property @pulumi.getter(name="endOfLifeDate") def end_of_life_date(self) -> Optional[str]: """ The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property is updatable. """ return pulumi.get(self, "end_of_life_date") @property @pulumi.getter(name="excludeFromLatest") def exclude_from_latest(self) -> Optional[bool]: """ If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. """ return pulumi.get(self, "exclude_from_latest") @property @pulumi.getter(name="replicaCount") def replica_count(self) -> Optional[int]: """ The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. """ return pulumi.get(self, "replica_count") @property @pulumi.getter(name="storageAccountType") def storage_account_type(self) -> Optional[str]: """ Specifies the storage account type to be used to store the image. This property is not updatable. """ return pulumi.get(self, "storage_account_type") @property @pulumi.getter(name="targetRegions") def target_regions(self) -> Optional[Sequence['outputs.TargetRegionResponse']]: """ The target regions where the Image Version is going to be replicated to. This property is updatable. """ return pulumi.get(self, "target_regions") def _translate_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop @pulumi.output_type class GalleryImageVersionStorageProfileResponse(dict): """ This is the storage profile of a Gallery Image Version. """ def __init__(__self__, *, data_disk_images: Optional[Sequence['outputs.GalleryDataDiskImageResponse']] = None, os_disk_image: Optional['outputs.GalleryOSDiskImageResponse'] = None, source: Optional['outputs.GalleryArtifactVersionSourceResponse'] = None): """ This is the storage profile of a Gallery Image Version. :param Sequence['GalleryDataDiskImageResponseArgs'] data_disk_images: A list of data disk images. :param 'GalleryOSDiskImageResponseArgs' os_disk_image: This is the OS disk image. :param 'GalleryArtifactVersionSourceResponseArgs' source: The gallery artifact version source. """ if data_disk_images is not None: pulumi.set(__self__, "data_disk_images", data_disk_images) if os_disk_image is not None: pulumi.set(__self__, "os_disk_image", os_disk_image) if source is not None: pulumi.set(__self__, "source", source) @property @pulumi.getter(name="dataDiskImages") def data_disk_images(self) -> Optional[Sequence['outputs.GalleryDataDiskImageResponse']]: """ A list of data disk images. """ return pulumi.get(self, "data_disk_images") @property @pulumi.getter(name="osDiskImage") def os_disk_image(self) -> Optional['outputs.GalleryOSDiskImageResponse']: """ This is the OS disk image. """ return pulumi.get(self, "os_disk_image") @property @pulumi.getter def source(self) -> Optional['outputs.GalleryArtifactVersionSourceResponse']: """ The gallery artifact version source. """ return pulumi.get(self, "source") def _translate_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop @pulumi.output_type class GalleryOSDiskImageResponse(dict): """ This is the OS disk image. """ def __init__(__self__, *, size_in_gb: int, host_caching: Optional[str] = None, source: Optional['outputs.GalleryArtifactVersionSourceResponse'] = None): """ This is the OS disk image. :param int size_in_gb: This property indicates the size of the VHD to be created. :param str host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' :param 'GalleryArtifactVersionSourceResponseArgs' source: The gallery artifact version source. """ pulumi.set(__self__, "size_in_gb", size_in_gb) if host_caching is not None: pulumi.set(__self__, "host_caching", host_caching) if source is not None: pulumi.set(__self__, "source", source) @property @pulumi.getter(name="sizeInGB") def size_in_gb(self) -> int: """ This property indicates the size of the VHD to be created. """ return pulumi.get(self, "size_in_gb") @property @pulumi.getter(name="hostCaching") def host_caching(self) -> Optional[str]: """ The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' """ return pulumi.get(self, "host_caching") @property @pulumi.getter def source(self) -> Optional['outputs.GalleryArtifactVersionSourceResponse']: """ The gallery artifact version source. """ return pulumi.get(self, "source") def _translate_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop @pulumi.output_type class ImagePurchasePlanResponse(dict): """ Describes the gallery image definition purchase plan. This is used by marketplace images. """ def __init__(__self__, *, name: Optional[str] = None, product: Optional[str] = None, publisher: Optional[str] = None): """ Describes the gallery image definition purchase plan. This is used by marketplace images. :param str name: The plan ID. :param str product: The product ID. :param str publisher: The publisher ID. """ if name is not None: pulumi.set(__self__, "name", name) if product is not None: pulumi.set(__self__, "product", product) if publisher is not None: pulumi.set(__self__, "publisher", publisher) @property @pulumi.getter def name(self) -> Optional[str]: """ The plan ID. """ return pulumi.get(self, "name") @property @pulumi.getter def product(self) -> Optional[str]: """ The product ID. """ return pulumi.get(self, "product") @property @pulumi.getter def publisher(self) -> Optional[str]: """ The publisher ID. """ return pulumi.get(self, "publisher") def _translate_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop @pulumi.output_type class OSDiskImageEncryptionResponse(dict): """ Contains encryption settings for an OS disk image. """ def __init__(__self__, *, disk_encryption_set_id: Optional[str] = None): """ Contains encryption settings for an OS disk image. :param str disk_encryption_set_id: A relative URI containing the resource ID of the disk encryption set. """ if disk_encryption_set_id is not None: pulumi.set(__self__, "disk_encryption_set_id", disk_encryption_set_id) @property @pulumi.getter(name="diskEncryptionSetId") def disk_encryption_set_id(self) -> Optional[str]: """ A relative URI containing the resource ID of the disk encryption set. """ return pulumi.get(self, "disk_encryption_set_id") def _translate_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop @pulumi.output_type class RecommendedMachineConfigurationResponse(dict): """ The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. """ def __init__(__self__, *, memory: Optional['outputs.ResourceRangeResponse'] = None, v_cpus: Optional['outputs.ResourceRangeResponse'] = None): """ The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. :param 'ResourceRangeResponseArgs' memory: Describes the resource range. :param 'ResourceRangeResponseArgs' v_cpus: Describes the resource range. """ if memory is not None: pulumi.set(__self__, "memory", memory) if v_cpus is not None: pulumi.set(__self__, "v_cpus", v_cpus) @property @pulumi.getter def memory(self) -> Optional['outputs.ResourceRangeResponse']: """ Describes the resource range. """ return pulumi.get(self, "memory") @property @pulumi.getter(name="vCPUs") def v_cpus(self) -> Optional['outputs.ResourceRangeResponse']: """ Describes the resource range. """ return pulumi.get(self, "v_cpus") def _translate_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop @pulumi.output_type class RegionalReplicationStatusResponse(dict): """ This is the regional replication status. """ def __init__(__self__, *, details: str, progress: int, region: str, state: str): """ This is the regional replication status. :param str details: The details of the replication status. :param int progress: It indicates progress of the replication job. :param str region: The region to which the gallery image version is being replicated to. :param str state: This is the regional replication state. """ pulumi.set(__self__, "details", details) pulumi.set(__self__, "progress", progress) pulumi.set(__self__, "region", region) pulumi.set(__self__, "state", state) @property @pulumi.getter def details(self) -> str: """ The details of the replication status. """ return pulumi.get(self, "details") @property @pulumi.getter def progress(self) -> int: """ It indicates progress of the replication job. """ return pulumi.get(self, "progress") @property @pulumi.getter def region(self) -> str: """ The region to which the gallery image version is being replicated to. """ return pulumi.get(self, "region") @property @pulumi.getter def state(self) -> str: """ This is the regional replication state. """ return pulumi.get(self, "state") def _translate_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop @pulumi.output_type class ReplicationStatusResponse(dict): """ This is the replication status of the gallery image version. """ def __init__(__self__, *, aggregated_state: str, summary: Sequence['outputs.RegionalReplicationStatusResponse']): """ This is the replication status of the gallery image version. :param str aggregated_state: This is the aggregated replication status based on all the regional replication status flags. :param Sequence['RegionalReplicationStatusResponseArgs'] summary: This is a summary of replication status for each region. """ pulumi.set(__self__, "aggregated_state", aggregated_state) pulumi.set(__self__, "summary", summary) @property @pulumi.getter(name="aggregatedState") def aggregated_state(self) -> str: """ This is the aggregated replication status based on all the regional replication status flags. """ return pulumi.get(self, "aggregated_state") @property @pulumi.getter def summary(self) -> Sequence['outputs.RegionalReplicationStatusResponse']: """ This is a summary of replication status for each region. """ return pulumi.get(self, "summary") def _translate_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop @pulumi.output_type class ResourceRangeResponse(dict): """ Describes the resource range. """ def __init__(__self__, *, max: Optional[int] = None, min: Optional[int] = None): """ Describes the resource range. :param int max: The maximum number of the resource. :param int min: The minimum number of the resource. """ if max is not None: pulumi.set(__self__, "max", max) if min is not None: pulumi.set(__self__, "min", min) @property @pulumi.getter def max(self) -> Optional[int]: """ The maximum number of the resource. """ return pulumi.get(self, "max") @property @pulumi.getter def min(self) -> Optional[int]: """ The minimum number of the resource. """ return pulumi.get(self, "min") def _translate_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop @pulumi.output_type class SharingProfileGroupResponse(dict): """ Group of the gallery sharing profile """ def __init__(__self__, *, ids: Optional[Sequence[str]] = None, type: Optional[str] = None): """ Group of the gallery sharing profile :param Sequence[str] ids: A list of subscription/tenant ids the gallery is aimed to be shared to. :param str type: This property allows you to specify the type of sharing group. <br><br> Possible values are: <br><br> **Subscriptions** <br><br> **AADTenants** """ if ids is not None: pulumi.set(__self__, "ids", ids) if type is not None: pulumi.set(__self__, "type", type) @property @pulumi.getter def ids(self) -> Optional[Sequence[str]]: """ A list of subscription/tenant ids the gallery is aimed to be shared to. """ return pulumi.get(self, "ids") @property @pulumi.getter def type(self) -> Optional[str]: """ This property allows you to specify the type of sharing group. <br><br> Possible values are: <br><br> **Subscriptions** <br><br> **AADTenants** """ return pulumi.get(self, "type") def _translate_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop @pulumi.output_type class SharingProfileResponse(dict): """ Profile for gallery sharing to subscription or tenant """ def __init__(__self__, *, groups: Sequence['outputs.SharingProfileGroupResponse'], permissions: Optional[str] = None): """ Profile for gallery sharing to subscription or tenant :param Sequence['SharingProfileGroupResponseArgs'] groups: A list of sharing profile groups. :param str permissions: This property allows you to specify the permission of sharing gallery. <br><br> Possible values are: <br><br> **Private** <br><br> **Groups** """ pulumi.set(__self__, "groups", groups) if permissions is not None: pulumi.set(__self__, "permissions", permissions) @property @pulumi.getter def groups(self) -> Sequence['outputs.SharingProfileGroupResponse']: """ A list of sharing profile groups. """ return pulumi.get(self, "groups") @property @pulumi.getter def permissions(self) -> Optional[str]: """ This property allows you to specify the permission of sharing gallery. <br><br> Possible values are: <br><br> **Private** <br><br> **Groups** """ return pulumi.get(self, "permissions") def _translate_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop @pulumi.output_type class TargetRegionResponse(dict): """ Describes the target region information. """ def __init__(__self__, *, name: str, encryption: Optional['outputs.EncryptionImagesResponse'] = None, regional_replica_count: Optional[int] = None, storage_account_type: Optional[str] = None): """ Describes the target region information. :param str name: The name of the region. :param 'EncryptionImagesResponseArgs' encryption: Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. :param int regional_replica_count: The number of replicas of the Image Version to be created per region. This property is updatable. :param str storage_account_type: Specifies the storage account type to be used to store the image. This property is not updatable. """ pulumi.set(__self__, "name", name) if encryption is not None: pulumi.set(__self__, "encryption", encryption) if regional_replica_count is not None: pulumi.set(__self__, "regional_replica_count", regional_replica_count) if storage_account_type is not None: pulumi.set(__self__, "storage_account_type", storage_account_type) @property @pulumi.getter def name(self) -> str: """ The name of the region. """ return pulumi.get(self, "name") @property @pulumi.getter def encryption(self) -> Optional['outputs.EncryptionImagesResponse']: """ Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. """ return pulumi.get(self, "encryption") @property @pulumi.getter(name="regionalReplicaCount") def regional_replica_count(self) -> Optional[int]: """ The number of replicas of the Image Version to be created per region. This property is updatable. """ return pulumi.get(self, "regional_replica_count") @property @pulumi.getter(name="storageAccountType") def storage_account_type(self) -> Optional[str]: """ Specifies the storage account type to be used to store the image. This property is not updatable. """ return pulumi.get(self, "storage_account_type") def _translate_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop @pulumi.output_type class UserArtifactManageResponse(dict): def __init__(__self__, *, install: str, remove: str, update: Optional[str] = None): """ :param str install: Required. The path and arguments to install the gallery application. This is limited to 4096 characters. :param str remove: Required. The path and arguments to remove the gallery application. This is limited to 4096 characters. :param str update: Optional. The path and arguments to update the gallery application. If not present, then update operation will invoke remove command on the previous version and install command on the current version of the gallery application. This is limited to 4096 characters. """ pulumi.set(__self__, "install", install) pulumi.set(__self__, "remove", remove) if update is not None: pulumi.set(__self__, "update", update) @property @pulumi.getter def install(self) -> str: """ Required. The path and arguments to install the gallery application. This is limited to 4096 characters. """ return pulumi.get(self, "install") @property @pulumi.getter def remove(self) -> str: """ Required. The path and arguments to remove the gallery application. This is limited to 4096 characters. """ return pulumi.get(self, "remove") @property @pulumi.getter def update(self) -> Optional[str]: """ Optional. The path and arguments to update the gallery application. If not present, then update operation will invoke remove command on the previous version and install command on the current version of the gallery application. This is limited to 4096 characters. """ return pulumi.get(self, "update") def _translate_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop @pulumi.output_type class UserArtifactSourceResponse(dict): """ The source image from which the Image Version is going to be created. """ def __init__(__self__, *, media_link: str, default_configuration_link: Optional[str] = None): """ The source image from which the Image Version is going to be created. :param str media_link: Required. The mediaLink of the artifact, must be a readable storage page blob. :param str default_configuration_link: Optional. The defaultConfigurationLink of the artifact, must be a readable storage page blob. """ pulumi.set(__self__, "media_link", media_link) if default_configuration_link is not None: pulumi.set(__self__, "default_configuration_link", default_configuration_link) @property @pulumi.getter(name="mediaLink") def media_link(self) -> str: """ Required. The mediaLink of the artifact, must be a readable storage page blob. """ return pulumi.get(self, "media_link") @property @pulumi.getter(name="defaultConfigurationLink") def default_configuration_link(self) -> Optional[str]: """ Optional. The defaultConfigurationLink of the artifact, must be a readable storage page blob. """ return pulumi.get(self, "default_configuration_link") def _translate_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop
38.233333
290
0.654045
4,956
42,439
5.398507
0.063156
0.012334
0.031583
0.04616
0.773874
0.730144
0.689553
0.670379
0.641674
0.616969
0
0.000793
0.257405
42,439
1,109
291
38.267809
0.848168
0.348194
0
0.614853
1
0
0.144912
0.079728
0
0
0
0
0
1
0.19171
false
0
0.010363
0.041451
0.393782
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
46c4c877c664ccafd3ca1715fdec77ace89a64db
174
py
Python
search/urls.py
Tariqalrehily/iShop
0454106c1ff5b508b734b95f3f6cfe1008d630b5
[ "PostgreSQL" ]
null
null
null
search/urls.py
Tariqalrehily/iShop
0454106c1ff5b508b734b95f3f6cfe1008d630b5
[ "PostgreSQL" ]
5
2020-06-06T00:28:48.000Z
2022-01-13T02:04:54.000Z
search/urls.py
Tariqalrehily/iShop
0454106c1ff5b508b734b95f3f6cfe1008d630b5
[ "PostgreSQL" ]
1
2020-02-18T19:33:21.000Z
2020-02-18T19:33:21.000Z
from django.conf.urls import url from .views import do_search, filter urlpatterns = [ url(r'^$', do_search, name='search'), url(r'^filter/', filter, name='filter') ]
24.857143
43
0.672414
25
174
4.6
0.52
0.13913
0
0
0
0
0
0
0
0
0
0
0.155172
174
7
44
24.857143
0.782313
0
0
0
0
0
0.125714
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
46c928585677c4ea370d9cde42b1e5b9a1eac936
45
py
Python
CTFd/constants/themes.py
nox237/CTFd
ff6e093fa6bf23b526ecddf9271195b429240ff4
[ "Apache-2.0" ]
3,592
2017-03-12T19:44:07.000Z
2022-03-30T16:03:33.000Z
CTFd/constants/themes.py
nox237/CTFd
ff6e093fa6bf23b526ecddf9271195b429240ff4
[ "Apache-2.0" ]
1,648
2017-03-12T23:44:34.000Z
2022-03-31T15:28:38.000Z
CTFd/constants/themes.py
nox237/CTFd
ff6e093fa6bf23b526ecddf9271195b429240ff4
[ "Apache-2.0" ]
1,736
2017-03-13T14:01:28.000Z
2022-03-31T08:14:24.000Z
ADMIN_THEME = "admin" DEFAULT_THEME = "core"
15
22
0.733333
6
45
5.166667
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.133333
45
2
23
22.5
0.794872
0
0
0
0
0
0.2
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
46dea0e929c6d4425f82b7f896f31290465dc137
820
py
Python
punto/__init__.py
xu-hong/Punto
906d2725d8e4c72b5c094a5f1f738f5ce2a7532f
[ "MIT" ]
null
null
null
punto/__init__.py
xu-hong/Punto
906d2725d8e4c72b5c094a5f1f738f5ce2a7532f
[ "MIT" ]
null
null
null
punto/__init__.py
xu-hong/Punto
906d2725d8e4c72b5c094a5f1f738f5ce2a7532f
[ "MIT" ]
null
null
null
""" Compartmentalize: [ ascii art input ] --------------- | maybe some | | sort of auxillary | | drawing program | | | \ / v [ lex/parser ] --> [ translater ] --------- ---------- | grammar | | notes literals| | to numerical | | patterns with | | timestamps | | and midi meta | | data | | ,------------------------' | `--> [ sequencer ] ----------- | do the | | sequencing | | duh | | | \ / v [ midi sender ] ---------- | communicate to | | midi external | """
20.5
46
0.265854
39
820
5.589744
0.897436
0
0
0
0
0
0
0
0
0
0
0
0.556098
820
39
47
21.025641
0.598901
0.960976
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
3
46f4304f0194b1310f816ea7b6c9eb36a154d157
192
py
Python
huaweisms/api/monitoring.py
mcsarge/huawei-modem-python-api-client
1bac12d9c44b3c0ee85a469004e9d37e4f7bbd37
[ "MIT" ]
2
2018-03-15T18:15:35.000Z
2018-03-16T20:23:42.000Z
huaweisms/api/monitoring.py
mcsarge/huawei-modem-python-api-client
1bac12d9c44b3c0ee85a469004e9d37e4f7bbd37
[ "MIT" ]
null
null
null
huaweisms/api/monitoring.py
mcsarge/huawei-modem-python-api-client
1bac12d9c44b3c0ee85a469004e9d37e4f7bbd37
[ "MIT" ]
null
null
null
from huaweisms.api.common import get_from_url, ApiCtx from .config import API_URL def status(ctx: ApiCtx): url = "{}/monitoring/status".format(API_URL) return get_from_url(url, ctx)
24
53
0.744792
30
192
4.566667
0.5
0.10219
0.145985
0
0
0
0
0
0
0
0
0
0.145833
192
7
54
27.428571
0.835366
0
0
0
0
0
0.104167
0
0
0
0
0
0
1
0.2
false
0
0.4
0
0.8
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
3
46f8f978d1dff2ed9209d787daec474e7c997240
746
py
Python
xpdacq/devices.py
xpdAcq/xpdAcq
ad850df65c185c50b2bd7daf44148480a8ec42dd
[ "BSD-2-Clause-FreeBSD" ]
3
2017-12-11T17:28:03.000Z
2020-05-05T20:51:15.000Z
xpdacq/devices.py
xpdAcq/xpdAcq
ad850df65c185c50b2bd7daf44148480a8ec42dd
[ "BSD-2-Clause-FreeBSD" ]
521
2016-02-06T23:27:47.000Z
2022-02-02T21:25:37.000Z
xpdacq/devices.py
xpdAcq/xpdAcq
ad850df65c185c50b2bd7daf44148480a8ec42dd
[ "BSD-2-Clause-FreeBSD" ]
15
2016-02-08T03:49:03.000Z
2022-03-30T00:25:40.000Z
"""Wrappers for the ophyd devices.""" from ophyd import Device, Signal from ophyd import Kind from ophyd.device import Component as Cpt class CalibrationData(Device): """A device to hold pyFAI calibration data.""" dist = Cpt(Signal, value=1., kind=Kind.config) poni1 = Cpt(Signal, value=0., kind=Kind.config) poni2 = Cpt(Signal, value=0., kind=Kind.config) rot1 = Cpt(Signal, value=0., kind=Kind.config) rot2 = Cpt(Signal, value=0., kind=Kind.config) rot3 = Cpt(Signal, value=0., kind=Kind.config) pixel1 = Cpt(Signal, value=0., kind=Kind.config) pixel2 = Cpt(Signal, value=0., kind=Kind.config) detector = Cpt(Signal, value="", kind=Kind.config) wavelength = Cpt(Signal, value=0., kind=Kind.config)
39.263158
56
0.684987
110
746
4.645455
0.318182
0.176125
0.273973
0.234834
0.454012
0.454012
0.454012
0
0
0
0
0.025765
0.16756
746
18
57
41.444444
0.797101
0.096515
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.214286
0
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
3
201171ed4ed2acece5307ef9d3b0fd5bbf3bf1a5
114
py
Python
pyeem/instruments/horiba/__init__.py
drewmee/PyEEM
283c01405bf51da6827ba434be53acd580b7642b
[ "MIT" ]
4
2020-09-01T08:27:28.000Z
2022-03-12T09:11:15.000Z
pyeem/instruments/horiba/__init__.py
drewmee/PyEEM
283c01405bf51da6827ba434be53acd580b7642b
[ "MIT" ]
2
2021-06-11T18:20:47.000Z
2021-11-19T14:11:09.000Z
pyeem/instruments/horiba/__init__.py
drewmee/PyEEM
283c01405bf51da6827ba434be53acd580b7642b
[ "MIT" ]
null
null
null
from .aqualog import Aqualog from .fluorolog import Fluorolog name = "Horiba" instruments = [Aqualog, Fluorolog]
19
34
0.780702
13
114
6.846154
0.538462
0
0
0
0
0
0
0
0
0
0
0
0.140351
114
5
35
22.8
0.908163
0
0
0
0
0
0.052632
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
20180273094d0e160bca16ce1c37d08abdc4c3cc
803
py
Python
message/models.py
bopopescu/storyboard
0258fd6f80b6bbd9d0ca493cbaaae87c3a6d16e2
[ "MIT" ]
null
null
null
message/models.py
bopopescu/storyboard
0258fd6f80b6bbd9d0ca493cbaaae87c3a6d16e2
[ "MIT" ]
null
null
null
message/models.py
bopopescu/storyboard
0258fd6f80b6bbd9d0ca493cbaaae87c3a6d16e2
[ "MIT" ]
null
null
null
#!/usr/bin/env python # encoding: utf-8 """ models.py Created by Darcy Liu on 2012-03-03. Copyright (c) 2012 Close To U. All rights reserved. """ from django.db import models from django.contrib.auth.models import User # class Message(models.Model): # key = models.AutoField(primary_key=True) # title = models.CharField(max_length=256,verbose_name='title') # text = models.TextField(blank=True, verbose_name='text') # sender = models.ForeignKey(User,verbose_name='sender') # receiver = models.ForeignKey(User,verbose_name='receiver') # created = models.DateTimeField(auto_now_add=True,verbose_name='created') # updated = models.DateTimeField(auto_now=True,verbose_name='updated') # def __unicode__(self): # result = self.title # return unicode(result)
33.458333
78
0.714819
107
803
5.224299
0.570093
0.118068
0.080501
0.096601
0.110912
0
0
0
0
0
0
0.023564
0.154421
803
23
79
34.913043
0.799705
0.864259
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
3
20299f247043cda7e41287f499114f04606c876f
86
py
Python
2rd.py
chidanandpujar/Python_scripts
0ee70e07ef4ab4d8c04955466ea9b305bdac0a53
[ "Unlicense" ]
null
null
null
2rd.py
chidanandpujar/Python_scripts
0ee70e07ef4ab4d8c04955466ea9b305bdac0a53
[ "Unlicense" ]
null
null
null
2rd.py
chidanandpujar/Python_scripts
0ee70e07ef4ab4d8c04955466ea9b305bdac0a53
[ "Unlicense" ]
null
null
null
fd = open('f',"r") buffer = fd.read(2) print("first 2 chars in f:",buffer) fd.close()
17.2
35
0.616279
17
86
3.117647
0.705882
0.301887
0
0
0
0
0
0
0
0
0
0.027027
0.139535
86
4
36
21.5
0.689189
0
0
0
0
0
0.244186
0
0
0
0
0
0
1
0
false
0
0
0
0
0.25
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
20318ce6f98ad7d15054368aa42e0b37d5feb5f0
862
py
Python
tools/intogen/runtime/pyenv/lib/python2.7/site-packages/wok/core/utils/proxies.py
globusgenomics/galaxy
7caf74d9700057587b3e3434c64e82c5b16540f1
[ "CC-BY-3.0" ]
1
2021-02-05T13:19:58.000Z
2021-02-05T13:19:58.000Z
chapter2/wok/master/wok/core/utils/proxies.py
chris-zen/phd-thesis
1eefdff8e7ca1910304e27ae42551dc64496b101
[ "Unlicense" ]
null
null
null
chapter2/wok/master/wok/core/utils/proxies.py
chris-zen/phd-thesis
1eefdff8e7ca1910304e27ae42551dc64496b101
[ "Unlicense" ]
null
null
null
# from http://www.voidspace.org.uk/python/weblog/arch_d7_2007_03_17.shtml#e664 def ReadOnlyProxy(obj): class _ReadOnlyProxy(object): def __getattr__(self, name): return getattr(obj, name) def __setattr__(self, name, value): raise AttributeError("Attributes can't be set on this object") for name in dir(obj): if not (name[:2] == '__' == name[-2:]): continue if name in ('__new__', '__init__', '__class__', '__bases__'): continue if not callable(getattr(obj, name)): continue def get_proxy_method(name): def proxy_method(self, *args, **keywargs): return getattr(obj, name)(*args, **keywargs) return proxy_method setattr(_ReadOnlyProxy, name, get_proxy_method(name)) return _ReadOnlyProxy()
33.153846
78
0.603248
100
862
4.81
0.51
0.091476
0.087318
0.08316
0
0
0
0
0
0
0
0.022508
0.278422
862
26
79
33.153846
0.750804
0.087007
0
0.157895
0
0
0.092994
0
0
0
0
0
0
1
0.263158
false
0
0
0.105263
0.526316
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
20487ec8a56148d10391484016a8c173799c42c3
352
py
Python
setup.py
rickie/hopla
24a422194e42c03d5877dc167b2b07147326a595
[ "Apache-2.0" ]
null
null
null
setup.py
rickie/hopla
24a422194e42c03d5877dc167b2b07147326a595
[ "Apache-2.0" ]
null
null
null
setup.py
rickie/hopla
24a422194e42c03d5877dc167b2b07147326a595
[ "Apache-2.0" ]
null
null
null
""" Module used for building hopla. [quote](https://setuptools.readthedocs.io/en/latest/setuptools.html): As PEP 517 is new, support is not universal, and frontends that do support it may still have bugs. For compatibility, you may want to put a setup.py file containing only a setuptools.setup() invocation. """ import setuptools setuptools.setup()
29.333333
69
0.772727
54
352
5.037037
0.796296
0.110294
0
0
0
0
0
0
0
0
0
0.009836
0.133523
352
11
70
32
0.881967
0.866477
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
3
64aa32eb7118f5a70eea293de71708246ff3bf6d
405
py
Python
src/domain/image.py
wlsouza/py-video-maker
7e39b884db8f6159489157e077705a68433a48c9
[ "MIT" ]
3
2020-02-16T18:28:29.000Z
2020-07-16T22:53:08.000Z
src/domain/image.py
wlsouza/py-video-maker
7e39b884db8f6159489157e077705a68433a48c9
[ "MIT" ]
10
2020-02-16T01:26:39.000Z
2022-03-12T00:58:39.000Z
src/domain/image.py
wlsouza/py-video-maker
7e39b884db8f6159489157e077705a68433a48c9
[ "MIT" ]
null
null
null
# !usr/bin/python # -*- coding: UTF-8 -*- class Image: def __init__(self, name, path, url): self.name = name self.path = path self.url = url @property def full_path(self): return self.path + self.name def __str__(self): return self.name def __repr__(self): return f' {{ Name: {self.name}, \nPath: {self.path}, \nURL:{self.url} }}'
19.285714
81
0.553086
53
405
3.981132
0.415094
0.189573
0.132701
0
0
0
0
0
0
0
0
0.003497
0.293827
405
20
82
20.25
0.734266
0.091358
0
0
0
0.083333
0.172603
0
0
0
0
0
0
1
0.333333
false
0
0
0.25
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
64abd26bdea2dd2cb38f2c7f7fbbe13c0579ff77
126
py
Python
gym_quoridor/__init__.py
Xe-Xo/GymQuoridor
ab65c9f698fa2ceaf4728a241fcf181b09dbfd9d
[ "MIT" ]
1
2020-06-27T08:19:23.000Z
2020-06-27T08:19:23.000Z
gym_quoridor/__init__.py
Xe-Xo/GymQuoridor
ab65c9f698fa2ceaf4728a241fcf181b09dbfd9d
[ "MIT" ]
null
null
null
gym_quoridor/__init__.py
Xe-Xo/GymQuoridor
ab65c9f698fa2ceaf4728a241fcf181b09dbfd9d
[ "MIT" ]
null
null
null
from gym.envs.registration import register register( id='quoridor-v0', entry_point='gym_quoridor.envs:QuoridorEnv', )
21
48
0.753968
16
126
5.8125
0.75
0
0
0
0
0
0
0
0
0
0
0.009091
0.126984
126
6
49
21
0.836364
0
0
0
0
0
0.314961
0.228346
0
0
0
0
0
1
0
true
0
0.2
0
0.2
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
3
64adfd451b09f6dc065a668f9264ad3f97a22f44
397
py
Python
test/unit/tools/filter_modules/filtermod.py
ramezrawas/galaxy-1
c03748dd49c060a68d07bce56eae33e0ba154414
[ "CC-BY-3.0" ]
6
2018-11-03T22:43:35.000Z
2022-02-15T17:51:33.000Z
test/unit/tools/filter_modules/filtermod.py
igorhollaender/OBSOLETE_sirv_dashboard
85aec60b80ef6f561d89398e3da5963d3d0f2aa4
[ "CC-BY-3.0" ]
7
2016-12-07T22:19:37.000Z
2019-01-30T15:04:26.000Z
test/unit/tools/filter_modules/filtermod.py
igorhollaender/OBSOLETE_sirv_dashboard
85aec60b80ef6f561d89398e3da5963d3d0f2aa4
[ "CC-BY-3.0" ]
10
2017-04-10T21:40:22.000Z
2022-02-21T16:50:10.000Z
""" Test filters used by test_toolbox_filters.py. """ def filter_tool( context, tool ): """Test Filter Tool""" return False def filter_section( context, section ): """Test Filter Section""" return False def filter_label_1( context, label ): """Test Filter Label 1""" return False def filter_label_2( context, label ): """Test Filter Label 2""" return False
17.26087
49
0.654912
52
397
4.846154
0.307692
0.142857
0.166667
0.238095
0.412698
0
0
0
0
0
0
0.012987
0.224181
397
22
50
18.045455
0.805195
0.307305
0
0.5
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0
1
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
3
64bd36f6fcd20ce41e9f8fade95cc48e8c9d5d1e
1,172
py
Python
tests/test_genericls.py
scsides/usgscsm
4a69e01015faddd7d0bdeb15097cc02a9cae09be
[ "Unlicense" ]
null
null
null
tests/test_genericls.py
scsides/usgscsm
4a69e01015faddd7d0bdeb15097cc02a9cae09be
[ "Unlicense" ]
null
null
null
tests/test_genericls.py
scsides/usgscsm
4a69e01015faddd7d0bdeb15097cc02a9cae09be
[ "Unlicense" ]
null
null
null
import os import json import pytest from cycsm import isd import cycsm.csm as csm import usgscam as cam data_path = os.path.dirname(__file__) class TestGenericLs: @pytest.mark.parametrize('image, ground',[ ((2500, 9216, 0), (-73589.5516508502, 562548.342040933, 2372508.44060771)) ]) def test_image_to_ground(self, ctx_model, image, ground): gx, gy, gz = ground x, y, z = ctx_model.imageToGround(*image) #TODO: Get this test up and running. #print(x, y, z) #assert False #assert x == pytest.approx(gx, rel=1) #assert y == pytest.approx(gy, rel=1) #assert z == pytest.approx(gz, rel=1) #@pytest.mark.parametrize('image, ground',[ # ((512, 512, 0), (-73589.5516508502, 562548.342040933, 2372508.44060771)), # ((100, 100, 0), (-48020.2164819883, 539322.805489926, 2378549.41724731)) #]) #def test_ground_to_image(self, model, image, ground): # y, x = model.groundToImage(*ground) # ix, iy, _ = image # # assert x == pytest.approx(ix) # assert y == pytest.approx(iy)
32.555556
104
0.585324
146
1,172
4.60274
0.452055
0.089286
0.0625
0.077381
0.232143
0.136905
0.136905
0
0
0
0
0.190533
0.27901
1,172
35
105
33.485714
0.604734
0.50256
0
0
0
0
0.022928
0
0
0
0
0.028571
0
1
0.071429
false
0
0.428571
0
0.571429
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
1
0
1
0
0
3
64c3a770ec74f61297b7a81dce5e68acdf82a4ee
576
py
Python
pdfmajor/interpreter/commands/state/PDFGraphicState/PDFColor.py
asosnovsky/pdfmajor
7e24c64b5b4fdc84c12b2f78dcaab0e1aa07f4ad
[ "MIT" ]
23
2019-01-13T23:32:24.000Z
2021-07-08T04:29:15.000Z
pdfmajor/interpreter/commands/state/PDFGraphicState/PDFColor.py
asosnovsky/pdfmajor
7e24c64b5b4fdc84c12b2f78dcaab0e1aa07f4ad
[ "MIT" ]
3
2019-08-09T18:42:01.000Z
2019-12-13T15:43:24.000Z
pdfmajor/interpreter/commands/state/PDFGraphicState/PDFColor.py
asosnovsky/pdfmajor
7e24c64b5b4fdc84c12b2f78dcaab0e1aa07f4ad
[ "MIT" ]
2
2020-01-09T11:18:20.000Z
2020-03-24T06:02:30.000Z
from typing import Tuple, Optional from .PDFColorSpace import PDFColorSpace class PDFColor: def __init__(self, color_space: Optional[PDFColorSpace], *values: float): self.color_space: Optional[PDFColorSpace] = color_space self.values: Tuple[float, ...] = values def copy(self): return self.__class__( self.color_space, *self.values ) def __repr__(self): return f"""<PDFColor space="{ None if self.color_space is None else self.color_space.name }" values={self.values}/>"""
30.315789
77
0.633681
65
576
5.338462
0.369231
0.172911
0.201729
0.126801
0.201729
0
0
0
0
0
0
0
0.260417
576
18
78
32
0.814554
0
0
0
0
0
0.215278
0.074653
0
0
0
0
0
1
0.2
false
0
0.133333
0.133333
0.533333
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
3
64cdcaff8bfef6cb8ac2031be3de787a65f14e15
1,781
py
Python
src/visions/lib/relations/string_to_datetime.py
sweersr/visions
1af04235cb77bec52e4923627dfbf968ed1a584d
[ "BSD-4-Clause" ]
null
null
null
src/visions/lib/relations/string_to_datetime.py
sweersr/visions
1af04235cb77bec52e4923627dfbf968ed1a584d
[ "BSD-4-Clause" ]
null
null
null
src/visions/lib/relations/string_to_datetime.py
sweersr/visions
1af04235cb77bec52e4923627dfbf968ed1a584d
[ "BSD-4-Clause" ]
null
null
null
import pandas as pd from visions import visions_string, visions_datetime from visions.core.model import TypeRelation from visions.core.model.relations import InferenceRelation from visions.utils.coercion import test_utils def to_datetime_year_week(series): """Convert a series of the format YYYY/UU (year, week) to datetime. A '0' is added as day dummy value, as pandas requires a day value to parse. Args: series: the Series to parse Returns: A datetime series Examples: >>> series = pd.Series(['2018/47', '2018/12', '2018/03']) >>> parsed_series = to_datetime_year_week(series) >>> print(parsed_series.dt.week) 0 47 1 12 2 3 dtype: int64 """ return pd.to_datetime(series + "0", format="%Y/%U%w") def to_datetime_year_month_day(series): """Convert a series of the format YYYYMMDD (year, month, day) to datetime. Args: series: the Series to parse Returns: A datetime series Examples: >>> series = pd.Series(['20181201', '20181202', '20181203']) >>> parsed_series = to_datetime_year_week(series) >>> print(parsed_series.dt.day) 0 1 1 2 2 3 dtype: int64 """ return pd.to_datetime(series, format="%Y%m%d") def get_string_datetime_type_relation(func): return InferenceRelation( relationship=test_utils.coercion_test(func), transformer=func, related_type=visions_string, type=visions_datetime, ) def string_to_datetime_year_week(): return get_string_datetime_type_relation(to_datetime_year_week) def string_to_datetime_year_month_day(): return get_string_datetime_type_relation(to_datetime_year_month_day)
26.58209
79
0.665357
238
1,781
4.747899
0.289916
0.106195
0.099115
0.079646
0.542478
0.426549
0.426549
0.371681
0.371681
0.221239
0
0.045994
0.243122
1,781
66
80
26.984848
0.792285
0.441887
0
0
0
0
0.016037
0
0
0
0
0
0
1
0.25
false
0
0.25
0.15
0.75
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
64d7a8053972b4804e4b495adaa95ceebb6347ae
350
py
Python
tests/preprocessing/test_preprocessing_check.py
lshtm-gis/WHO_PHSM_Cleaning
5892673922fc555fb86d6e0be548b48c7dc66814
[ "MIT" ]
null
null
null
tests/preprocessing/test_preprocessing_check.py
lshtm-gis/WHO_PHSM_Cleaning
5892673922fc555fb86d6e0be548b48c7dc66814
[ "MIT" ]
123
2020-10-12T11:06:27.000Z
2021-04-28T15:32:29.000Z
tests/preprocessing/test_preprocessing_check.py
lshtm-gis/WHO_PHSM_Cleaning
5892673922fc555fb86d6e0be548b48c7dc66814
[ "MIT" ]
null
null
null
import pytest import pandas as pd from src.preprocess import check class Test_check_column_names: def test_check_column_names(self): records = pd.DataFrame({'a': [1]}) config = pd.DataFrame({'column': ['a'], 'dataset': ['ACAPS']}) res = check.check_column_names(records, config, log=False) assert res is None
23.333333
70
0.662857
47
350
4.765957
0.595745
0.147321
0.214286
0.178571
0
0
0
0
0
0
0
0.003623
0.211429
350
14
71
25
0.807971
0
0
0
0
0
0.057143
0
0
0
0
0
0.111111
1
0.111111
false
0
0.333333
0
0.555556
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
64da1b100ea51354dfbc6cebf59ad3bf8b64417b
565
py
Python
backoffice/migrations/0019_auto_20211010_1210.py
Psemp/artsetforme_public
240bb8ef22c0589f168b24c0ee5ed8e9030fe94a
[ "MIT" ]
null
null
null
backoffice/migrations/0019_auto_20211010_1210.py
Psemp/artsetforme_public
240bb8ef22c0589f168b24c0ee5ed8e9030fe94a
[ "MIT" ]
1
2021-10-08T22:20:09.000Z
2021-10-08T22:20:09.000Z
backoffice/migrations/0019_auto_20211010_1210.py
Psemp/artsetforme_public
240bb8ef22c0589f168b24c0ee5ed8e9030fe94a
[ "MIT" ]
null
null
null
# Generated by Django 3.2.7 on 2021-10-10 10:10 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('backoffice', '0018_auto_20210929_1112'), ] operations = [ migrations.RemoveField( model_name='newsletter', name='attachment', ), migrations.RemoveField( model_name='newsletter', name='image_body_1', ), migrations.RemoveField( model_name='newsletter', name='image_body_2', ), ]
21.730769
50
0.564602
53
565
5.830189
0.566038
0.038835
0.252427
0.291262
0.485437
0.485437
0.343042
0.343042
0
0
0
0.086842
0.327434
565
25
51
22.6
0.726316
0.079646
0
0.473684
1
0
0.187259
0.044402
0
0
0
0
0
1
0
false
0
0.052632
0
0.210526
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
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
b37e55272ef98aa2ee817e1085b7b26d1e87865a
197
py
Python
FusionIIIT/applications/academic_procedures/urls.py
paras11agarwal/FusionIIIT
8332811dcec475176c15e6a3a00e5bdd9074fa49
[ "Apache-2.0" ]
null
null
null
FusionIIIT/applications/academic_procedures/urls.py
paras11agarwal/FusionIIIT
8332811dcec475176c15e6a3a00e5bdd9074fa49
[ "Apache-2.0" ]
6
2020-02-12T00:40:35.000Z
2022-03-11T23:19:42.000Z
FusionIIIT/applications/academic_procedures/urls.py
paras11agarwal/FusionIIIT
8332811dcec475176c15e6a3a00e5bdd9074fa49
[ "Apache-2.0" ]
null
null
null
from django.conf.urls import url from . import views urlpatterns = [ url(r'addCourse/', views.add_course, name='addCourse'), url(r'^dropCourse/', views.drop_course, name='dropCourse'), ]
21.888889
63
0.700508
26
197
5.230769
0.576923
0.058824
0
0
0
0
0
0
0
0
0
0
0.142132
197
8
64
24.625
0.804734
0
0
0
0
0
0.208122
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
b3a5e848fef8a886c8da89c6bdd2489931204aef
446
py
Python
rubicon_ml/viz/__init__.py
fdosani/rubicon-ml
b6dbd3ea44afb297a224baec387712fdf65b5b4f
[ "Apache-2.0" ]
null
null
null
rubicon_ml/viz/__init__.py
fdosani/rubicon-ml
b6dbd3ea44afb297a224baec387712fdf65b5b4f
[ "Apache-2.0" ]
null
null
null
rubicon_ml/viz/__init__.py
fdosani/rubicon-ml
b6dbd3ea44afb297a224baec387712fdf65b5b4f
[ "Apache-2.0" ]
null
null
null
from rubicon_ml.viz.dashboard import Dashboard from rubicon_ml.viz.dataframe_plot import DataframePlot from rubicon_ml.viz.experiments_table import ExperimentsTable from rubicon_ml.viz.metric_correlation_plot import MetricCorrelationPlot from rubicon_ml.viz.metric_lists_comparison import MetricListsComparison __all__ = [ "Dashboard", "DataframePlot", "ExperimentsTable", "MetricListsComparison", "MetricCorrelationPlot", ]
31.857143
72
0.825112
47
446
7.510638
0.404255
0.155807
0.184136
0.226629
0.124646
0
0
0
0
0
0
0
0.112108
446
13
73
34.307692
0.891414
0
0
0
0
0
0.179372
0.09417
0
0
0
0
0
1
0
false
0
0.416667
0
0.416667
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
b3bc40604998529df6bc48de77ceab6a0500f44e
1,166
py
Python
board/boardmanager.py
nh-99/COS125-OhMyCheckers
8e8af36532547e30162a9f4c4d3f204b56b42a6c
[ "MIT" ]
null
null
null
board/boardmanager.py
nh-99/COS125-OhMyCheckers
8e8af36532547e30162a9f4c4d3f204b56b42a6c
[ "MIT" ]
3
2016-10-23T08:25:19.000Z
2016-10-24T02:15:41.000Z
board/boardmanager.py
nh-99/COS125-OhMyCheckers
8e8af36532547e30162a9f4c4d3f204b56b42a6c
[ "MIT" ]
null
null
null
from colorama import Style, Fore import gamepiece header = ' 0 1 2 3 4 5 6 7' footer = ' +---+---+---+---+---+---+---+---+' def construct_board(): print("\n" * 100) print Fore.CYAN + "______ _ _ _ _____ _ _" print "| ___ \ (_) | / __ \ | | | " print "| |_/ / |_| |_ ___| / \/ |__ ___ ___| | _____ _ __ ___ " print "| ___ \ | | __|_ / | | '_ \ / _ \/ __| |/ / _ \ '__/ __|" print "| |_/ / | | |_ / /| \__/\ | | | __/ (__| < __/ | \__ \\" print "\____/|_|_|\__/___|\____/_| |_|\___|\___|_|\_\___|_| |___/" + Fore.RESET print print print header print footer for y in range(0, 8): to_print = chr(y + 97).upper() + ' ' for x in range(0, 9): piece = gamepiece.get_piece(str(x) + str(y)) if piece: to_print += '| ' + piece.get_team() + 'O' + Style.RESET_ALL + ' ' else: to_print += '| ' print to_print print footer def init_board(): gamepiece.init_pieces() construct_board() def update_board(): construct_board()
29.15
84
0.43482
97
1,166
4
0.474227
0.206186
0.154639
0.103093
0
0
0
0
0
0
0
0.023288
0.373928
1,166
39
85
29.897436
0.508219
0
0
0.193548
0
0.129032
0.360206
0.072041
0
0
0
0
0
0
null
null
0
0.064516
null
null
0.516129
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
1
0
3
b3bc9203c8074991c7351558c34b1c4b3515287e
133
py
Python
config.py
dufftt/social_distance_detector
b5726b544ba34051f0c9acbcba78fc6a87c93397
[ "MIT" ]
null
null
null
config.py
dufftt/social_distance_detector
b5726b544ba34051f0c9acbcba78fc6a87c93397
[ "MIT" ]
null
null
null
config.py
dufftt/social_distance_detector
b5726b544ba34051f0c9acbcba78fc6a87c93397
[ "MIT" ]
2
2020-12-04T04:47:26.000Z
2021-01-25T10:11:53.000Z
MIN_CONF = 0.3 NMS_THRESH = 0.3 USE_GPU = False MIN_DISTANCE = 50 WEIGHT_PATH = "yolov3-tiny.weights" CONFIG_PATH = "yolov3-tiny.cfg"
22.166667
35
0.75188
24
133
3.916667
0.75
0.042553
0.297872
0
0
0
0
0
0
0
0
0.068966
0.12782
133
6
36
22.166667
0.741379
0
0
0
0
0
0.253731
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
b3e2ec988106df0c07fe3fcce90989007d7b9618
365
py
Python
backend/presentation/admin.py
Weida-W/CMPUT404-project-socialdistribution
41d8a7f7f013723d2a3878156953fbc11c2e6156
[ "W3C-20150513" ]
null
null
null
backend/presentation/admin.py
Weida-W/CMPUT404-project-socialdistribution
41d8a7f7f013723d2a3878156953fbc11c2e6156
[ "W3C-20150513" ]
75
2021-01-13T23:48:48.000Z
2021-04-16T19:39:38.000Z
backend/presentation/admin.py
Weida-W/CMPUT404-project-socialdistribution
41d8a7f7f013723d2a3878156953fbc11c2e6156
[ "W3C-20150513" ]
12
2021-01-13T23:22:35.000Z
2021-04-28T08:13:38.000Z
from django.contrib import admin # Register your models here. from .models import * admin.site.register(Author) admin.site.register(Follower) admin.site.register(Post) admin.site.register(Comment) admin.site.register(Request) admin.site.register(Inbox) admin.site.register(Likes) admin.site.register(Liked) admin.site.register(Usermod) admin.site.register(Friend)
24.333333
32
0.810959
52
365
5.692308
0.384615
0.304054
0.574324
0
0
0
0
0
0
0
0
0
0.065753
365
15
33
24.333333
0.868035
0.071233
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.166667
0
0.166667
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
0
0
0
0
0
3
b60bb95066becb48c6ff8cba134f776c7538e9c1
204
py
Python
simple_help/__init__.py
DCOD-OpenSource/django-simple-help
779ccd900adee0d0eb656dd8e676019127e5f6e2
[ "MIT" ]
3
2016-11-29T14:24:59.000Z
2017-05-25T11:25:55.000Z
simple_help/__init__.py
DCOD-OpenSource/django-simple-help
779ccd900adee0d0eb656dd8e676019127e5f6e2
[ "MIT" ]
null
null
null
simple_help/__init__.py
DCOD-OpenSource/django-simple-help
779ccd900adee0d0eb656dd8e676019127e5f6e2
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # django-simple-help # simple_help/__init__.py from __future__ import unicode_literals __all__ = [ "default_app_config", ] default_app_config = "simple_help.apps.Config"
13.6
46
0.720588
26
204
4.923077
0.692308
0.234375
0.25
0
0
0
0
0
0
0
0
0.00578
0.151961
204
14
47
14.571429
0.734104
0.313725
0
0
0
0
0.301471
0.169118
0
0
0
0
0
1
0
false
0
0.2
0
0.2
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
37337c62dbb2bddf2dd085e45f52e14215a16cb3
866
py
Python
pyy1/.pycharm_helpers/python_stubs/-1550516950/_dbus_bindings/SignalMessage.py
pyy1988/pyy_test1
6bea878409e658aa87441384419be51aaab061e7
[ "Apache-2.0" ]
null
null
null
pyy1/.pycharm_helpers/python_stubs/-1550516950/_dbus_bindings/SignalMessage.py
pyy1988/pyy_test1
6bea878409e658aa87441384419be51aaab061e7
[ "Apache-2.0" ]
null
null
null
pyy1/.pycharm_helpers/python_stubs/-1550516950/_dbus_bindings/SignalMessage.py
pyy1988/pyy_test1
6bea878409e658aa87441384419be51aaab061e7
[ "Apache-2.0" ]
null
null
null
# encoding: utf-8 # module _dbus_bindings # from /usr/lib/python3/dist-packages/_dbus_bindings.cpython-35m-x86_64-linux-gnu.so # by generator 1.145 """ Low-level Python bindings for libdbus. Don't use this module directly - the public API is provided by the `dbus`, `dbus.service`, `dbus.mainloop` and `dbus.mainloop.glib` modules, with a lower-level API provided by the `dbus.lowlevel` module. """ # imports import dbus.lowlevel as __dbus_lowlevel class SignalMessage(__dbus_lowlevel.Message): """ A signal message. Constructor:: dbus.lowlevel.SignalMessage(path: str, interface: str, method: str) """ def __init__(self, path, interface, method): # real signature unknown; restored from __doc__ pass def __repr__(self, *args, **kwargs): # real signature unknown """ Return repr(self). """ pass
27.0625
96
0.69515
115
866
5.034783
0.626087
0.103627
0.044905
0.058722
0
0
0
0
0
0
0
0.017118
0.190531
866
31
97
27.935484
0.808845
0.67552
0
0.333333
0
0
0
0
0
0
0
0
0
1
0.333333
false
0.333333
0.166667
0
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
3
3737f665e231d9f0a760461d0daa2bfa21140b4e
2,103
py
Python
YatzyPy/tests.py
markomanninen/YatzyPy
a6904b22473ae909f588e3b82a67b8b4f2dce0f2
[ "MIT" ]
null
null
null
YatzyPy/tests.py
markomanninen/YatzyPy
a6904b22473ae909f588e3b82a67b8b4f2dce0f2
[ "MIT" ]
null
null
null
YatzyPy/tests.py
markomanninen/YatzyPy
a6904b22473ae909f588e3b82a67b8b4f2dce0f2
[ "MIT" ]
null
null
null
# tests.py from . main import Yatzy def runTests(): c = Yatzy([5, 5, 6, 5, 6]) s = c.getScoreTable() assert s['change'] == 27 and s['fullhouse'] == 27 assert s['double'] == 12 and s['six'] == 12 assert s['five'] == 15 and s['triple'] == 15 assert s['pair'] == 22 c = Yatzy([5, 5, 5, 5, 5]) s = c.getScoreTable() assert s['change'] == 25 and s['fullhouse'] == 25 and s['five'] == 25 assert s['double'] == 10 assert s['triple'] == 15 assert s['pair'] == 20 and s['quadruple'] == 20 assert s['yatzy'] == 50 c = Yatzy([4,4,4,4,1]) s = c.getScoreTable() assert s['change'] == 17 assert s['double'] == 8 assert s['triple'] == 12 assert s['one'] == 1 assert s['pair'] == 16 and s['quadruple'] == 16 c = Yatzy([3,3,3,2,1]) s = c.getScoreTable() assert s['change'] == 12 assert s['double'] == 6 assert s['triple'] == 9 and s['three'] == 9 assert s['one'] == 1 assert s['two'] == 2 c = Yatzy([3,3,4,2,1]) s = c.getScoreTable() assert s['change'] == 13 assert s['one'] == 1 assert s['two'] == 2 assert s['four'] == 4 assert s['three'] == 6 and s['double'] == 6 c = Yatzy([3,5,4,2,1]) s = c.getScoreTable() assert s['change'] == 15 and s['smallstraight'] == 15 assert s['one'] == 1 assert s['two'] == 2 assert s['three'] == 3 assert s['four'] == 4 assert s['five'] == 5 c = Yatzy([3,5,4,2,6]) s = c.getScoreTable() assert s['change'] == 20 and s['largestraight'] == 20 assert s['six'] == 6 assert s['two'] == 2 assert s['three'] == 3 assert s['four'] == 4 assert s['five'] == 5 c = Yatzy([3,5,4,1,6]) s = c.getScoreTable() assert s['change'] == 19 assert s['six'] == 6 assert s['one'] == 1 assert s['three'] == 3 assert s['four'] == 4 assert s['five'] == 5 c = Yatzy([3,3,4,4,5]) s = c.getScoreTable() assert s['change'] == 19 assert s['three'] == 6 assert s['four'] == 8 and s['double'] == 8 assert s['five'] == 5 assert s['pair'] == 14
26.961538
73
0.495483
334
2,103
3.11976
0.143713
0.315739
0.129559
0.181382
0.622841
0.584453
0.483685
0.370441
0.320537
0.190019
0
0.086899
0.277699
2,103
77
74
27.311688
0.599078
0.003804
0
0.492537
0
0
0.146679
0
0
0
0
0
0.701493
1
0.014925
false
0
0.014925
0
0.029851
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
1
0
0
0
0
0
0
0
0
0
3
3738e841ef076c03ff9662d1673998caf409d2bf
19
py
Python
main/libx11/update.py
RoastVeg/cports
803c7f07af341eb32f791b6ec1f237edb2764bd5
[ "BSD-2-Clause" ]
46
2021-06-10T02:27:32.000Z
2022-03-27T11:33:24.000Z
main/libx11/update.py
RoastVeg/cports
803c7f07af341eb32f791b6ec1f237edb2764bd5
[ "BSD-2-Clause" ]
58
2021-07-03T13:58:20.000Z
2022-03-13T16:45:35.000Z
main/libx11/update.py
RoastVeg/cports
803c7f07af341eb32f791b6ec1f237edb2764bd5
[ "BSD-2-Clause" ]
6
2021-07-04T10:46:40.000Z
2022-01-09T00:03:59.000Z
pkgname = "libX11"
9.5
18
0.684211
2
19
6.5
1
0
0
0
0
0
0
0
0
0
0
0.125
0.157895
19
1
19
19
0.6875
0
0
0
0
0
0.315789
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
37562319f7afe5cba9d3144dd3ddb0395179ad06
455
py
Python
what_apps/do/functions.py
SlashRoot/WHAT
69e78d01065142446234e77ea7c8c31e3482af29
[ "MIT" ]
null
null
null
what_apps/do/functions.py
SlashRoot/WHAT
69e78d01065142446234e77ea7c8c31e3482af29
[ "MIT" ]
null
null
null
what_apps/do/functions.py
SlashRoot/WHAT
69e78d01065142446234e77ea7c8c31e3482af29
[ "MIT" ]
null
null
null
from .models import Task from django.contrib.auth.models import User from django.template import loader, Context def get_tasks_in_prototype_related_to_object(prototype_id, object): from django.contrib.contenttypes.models import ContentType user_contenttype = ContentType.objects.get_for_model(object) return Task.objects.filter(prototype__id=prototype_id, related_objects__content_type=user_contenttype, related_objects__object_id=object.id)
50.555556
144
0.850549
63
455
5.793651
0.460317
0.09863
0.093151
0
0
0
0
0
0
0
0
0
0.087912
455
9
144
50.555556
0.879518
0
0
0
0
0
0
0
0
0
0
0
0
1
0.142857
false
0
0.571429
0
0.857143
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
3
3770da89f4542e5492348ec764138aaa4353f223
575
py
Python
contenttype/tree/TestStandardTree_BlackBox.py
ytyaru/GitHub.Uploader.ContentType.201705020847__old
d20574ea8ed62672c1a89e9feef24da7f720f2de
[ "CC0-1.0" ]
null
null
null
contenttype/tree/TestStandardTree_BlackBox.py
ytyaru/GitHub.Uploader.ContentType.201705020847__old
d20574ea8ed62672c1a89e9feef24da7f720f2de
[ "CC0-1.0" ]
null
null
null
contenttype/tree/TestStandardTree_BlackBox.py
ytyaru/GitHub.Uploader.ContentType.201705020847__old
d20574ea8ed62672c1a89e9feef24da7f720f2de
[ "CC0-1.0" ]
null
null
null
import unittest from SubTypeTree import SubTypeTreeFactory from SubTypeTree import VenderTreeFactory from SubTypeTree import SubTypeTree from SubTypeTree import VenderTree from SubTypeTree import GitHubVenderTree from SubTypeTree import StandardTree from SubTypeTree import ParsonalTree from SubTypeTree import UnregisteredTree class TestStandardTree_BlackBox(unittest.TestCase): def test_Values(self): tree_list = ['html'] tree = StandardTree(tree_list) self.assertEqual(None, tree.GetFacet()) self.assertEqual(tree_list, tree.TreeList)
33.823529
51
0.805217
61
575
7.508197
0.42623
0.262009
0.366812
0
0
0
0
0
0
0
0
0
0.147826
575
16
52
35.9375
0.934694
0
0
0
0
0
0.006969
0
0
0
0
0
0.133333
1
0.066667
false
0
0.6
0
0.733333
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
3777252434bf4837cbda3b2dcda94275b7648d0e
654
py
Python
backend/core/introduction_to_algorithms/logics/catalog.py
kehuo/myweb
3c03cfb0e2380e5dc4e627e3d7decf9e07f7572f
[ "MIT" ]
null
null
null
backend/core/introduction_to_algorithms/logics/catalog.py
kehuo/myweb
3c03cfb0e2380e5dc4e627e3d7decf9e07f7572f
[ "MIT" ]
null
null
null
backend/core/introduction_to_algorithms/logics/catalog.py
kehuo/myweb
3c03cfb0e2380e5dc4e627e3d7decf9e07f7572f
[ "MIT" ]
null
null
null
# @File: catalog.py # @Author: Kevin Huo # @LastUpdate: 4/10/2020 10:13 AM import json from common.utils.http import load_json_file from core.introduction_to_algorithms.logics.replace_n_to_br import replace_n_to_br_func # 因为python manage.py runserver 是从backend更路径运行的, 所以 DATA_PATH 要以根路径为准 # BASE_DATA_PATH = "./data/introduction_to_algorithms/part1/chapter2/section1.json" def get_catalog_json(args): """ data/introduction_to_algorithms/catalog.json """ DATA_PATH = "./data/introduction_to_algorithms/catalog.json" page_data = load_json_file(DATA_PATH) res = {"code": "SUCCESS", "data": page_data} return res
27.25
87
0.747706
93
654
4.956989
0.516129
0.121475
0.208243
0.182213
0.264642
0.264642
0
0
0
0
0
0.02518
0.149847
654
23
88
28.434783
0.803957
0.402141
0
0
0
0
0.16442
0.123989
0
0
0
0
0
1
0.111111
false
0
0.333333
0
0.555556
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
378e3c2cc2b4aed3dd1d5afa919592ab4bfb7f68
468
py
Python
surfactant_example/micelle/micelle_factory.py
force-h2020/force-bdss-plugin-surfactant-example
ba442f2b39919f7d071f4384f8eaba0d99f44b1f
[ "BSD-2-Clause", "MIT" ]
null
null
null
surfactant_example/micelle/micelle_factory.py
force-h2020/force-bdss-plugin-surfactant-example
ba442f2b39919f7d071f4384f8eaba0d99f44b1f
[ "BSD-2-Clause", "MIT" ]
null
null
null
surfactant_example/micelle/micelle_factory.py
force-h2020/force-bdss-plugin-surfactant-example
ba442f2b39919f7d071f4384f8eaba0d99f44b1f
[ "BSD-2-Clause", "MIT" ]
null
null
null
from force_bdss.api import BaseDataSourceFactory from .micelle_model import MicelleDataSourceModel from .micelle_data_source import MicelleDataSource class MicelleFactory(BaseDataSourceFactory): def get_identifier(self): return "micelle" def get_name(self): return "Micelle Aggregation Calculator" def get_model_class(self): return MicelleDataSourceModel def get_data_source_class(self): return MicelleDataSource
23.4
50
0.767094
49
468
7.102041
0.44898
0.068966
0.097701
0
0
0
0
0
0
0
0
0
0.185897
468
19
51
24.631579
0.913386
0
0
0
0
0
0.07906
0
0
0
0
0
0
1
0.333333
false
0
0.25
0.333333
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
378eda99db9461519b18902ce8432550ad1b4efa
80
py
Python
read.py
sundeepsingh1984/openinsiderscrapper
b23d51139031380bcb34f10dcaac92e4d5803dd6
[ "MIT" ]
null
null
null
read.py
sundeepsingh1984/openinsiderscrapper
b23d51139031380bcb34f10dcaac92e4d5803dd6
[ "MIT" ]
null
null
null
read.py
sundeepsingh1984/openinsiderscrapper
b23d51139031380bcb34f10dcaac92e4d5803dd6
[ "MIT" ]
null
null
null
import pandas as pd df=pd.read_json("D:\eiaScrapper\eio.jl") print(df.info())
13.333333
40
0.7125
15
80
3.733333
0.866667
0
0
0
0
0
0
0
0
0
0
0
0.1
80
6
41
13.333333
0.777778
0
0
0
0
0
0.259259
0.259259
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0.333333
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
37bfd7a583e97429e831b74add6932d378244f17
242
py
Python
python/app/logconfig.py
brandond/obra-hacks
df451c6c6cd78b48f6e32bbd102a8e8a6bd77cb3
[ "Apache-2.0" ]
null
null
null
python/app/logconfig.py
brandond/obra-hacks
df451c6c6cd78b48f6e32bbd102a8e8a6bd77cb3
[ "Apache-2.0" ]
null
null
null
python/app/logconfig.py
brandond/obra-hacks
df451c6c6cd78b48f6e32bbd102a8e8a6bd77cb3
[ "Apache-2.0" ]
null
null
null
import logging import os logging.basicConfig(level=os.environ.get('LOG_LEVEL', 'INFO'), format='[python %(name)s pid: %(process)d] %(levelname)s: %(message)s') logger = logging.getLogger(__name__) logger.info('{} imported'.format(__name__))
34.571429
134
0.731405
33
242
5.090909
0.636364
0
0
0
0
0
0
0
0
0
0
0
0.07438
242
6
135
40.333333
0.75
0
0
0
0
0.2
0.35124
0
0
0
0
0
0
1
0
false
0
0.6
0
0.6
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
3
37c2edca7854e044a40725c0eb4b1d2f0013ee57
824
py
Python
xunit-autolabeler-v2/ast_parser/python/test_data/parser/nested_tags/nested_tags.py
GoogleCloudPlatform/repo-automation-playground
a4c8f104c246ede002f6c18fcebfc0496c8abb94
[ "Apache-2.0" ]
5
2019-07-11T17:35:44.000Z
2021-10-09T01:49:04.000Z
xunit-autolabeler-v2/ast_parser/python/test_data/parser/nested_tags/nested_tags.py
GoogleCloudPlatform/repo-automation-playground
a4c8f104c246ede002f6c18fcebfc0496c8abb94
[ "Apache-2.0" ]
36
2019-08-27T18:20:21.000Z
2022-01-12T21:29:00.000Z
xunit-autolabeler-v2/ast_parser/python/test_data/parser/nested_tags/nested_tags.py
GoogleCloudPlatform/repo-automation-playground
a4c8f104c246ede002f6c18fcebfc0496c8abb94
[ "Apache-2.0" ]
13
2019-10-30T19:39:51.000Z
2021-04-04T09:31:52.000Z
# Copyright 2020 Google LLC. # # 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. # [START root_tag] # [START nested_tag] def nested_method(): return 'nested' # [END nested_tag] def root_method(): return 'root' # [END root_tag] # [START root_tag] def another_root_method(): return 'another root' # [END root_tag]
25.75
74
0.734223
125
824
4.76
0.576
0.10084
0.043697
0.053782
0
0
0
0
0
0
0
0.011834
0.179612
824
31
75
26.580645
0.868343
0.786408
0
0
0
0
0.141026
0
0
0
0
0
0
1
0.5
true
0
0
0.5
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
1
0
0
0
3
806099da6f4e0eb08385e71c81f065edd86b5eed
472
py
Python
myapi/serializers.py
zchuhui/django-rest-framework-example
82ee470b581473a0e9f5772ede75a90f2dfe1c54
[ "Apache-2.0" ]
null
null
null
myapi/serializers.py
zchuhui/django-rest-framework-example
82ee470b581473a0e9f5772ede75a90f2dfe1c54
[ "Apache-2.0" ]
null
null
null
myapi/serializers.py
zchuhui/django-rest-framework-example
82ee470b581473a0e9f5772ede75a90f2dfe1c54
[ "Apache-2.0" ]
null
null
null
from rest_framework import serializers from .models import Hero,Company class HeroSerializer(serializers.HyperlinkedModelSerializer): ''' 系列化 Hero model ''' class Meta: model = Hero fields = ('id','name','alias') class CompanySerializer(serializers.HyperlinkedModelSerializer): ''' 系列化 Company model ''' class Meta: model = Company fields = ('id','name','address','city','official_website')
19.666667
66
0.633475
43
472
6.906977
0.534884
0.249158
0.26936
0.127946
0
0
0
0
0
0
0
0
0.252119
472
23
67
20.521739
0.84136
0.069915
0
0.2
0
0
0.111111
0
0
0
0
0
0
1
0
false
0
0.2
0
0.6
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
3
807c5029f34b249c21ce5270b815763c5f2132a5
3,549
py
Python
01/hierarchy/company_management.py
MayaScarlet/runestone-pythonds3
9ac53482568b34e7272c122a5545a50da05b69fe
[ "MIT" ]
null
null
null
01/hierarchy/company_management.py
MayaScarlet/runestone-pythonds3
9ac53482568b34e7272c122a5545a50da05b69fe
[ "MIT" ]
null
null
null
01/hierarchy/company_management.py
MayaScarlet/runestone-pythonds3
9ac53482568b34e7272c122a5545a50da05b69fe
[ "MIT" ]
null
null
null
""" Class hierarchy for company management """ class Company: def __init__(self, company_name, location): self.company_name = company_name self.location = location def __str__(self): return f"Company: {self.company_name}, {self.location}" def __repr(self): return f"Company: {self.company_name}, {self.location}" class Management(Company): def __init__(self, company_name, location, employee, position, management_type, **kwargs): self.management_type = management_type self.employee = employee self.position = position super().__init__(company_name, location) def __str__(self): return f"{self.employee}: {self.position} in {self.management_type} management at {self.company_name}" def __repr__(self): return f"{self.employee}: {self.position} in {self.management_type} management at {self.company_name}" def type(self): return f"{self.management_type}" def position(self): return f"{self.position}" class TopLevelManagement(Management): def __init__(self, company_name, location, employee, position, **kwargs): super().__init__(company_name, location, employee, position, management_type='Top level', **kwargs) @classmethod def chairman(cls) -> 'TopLevelManagement': return cls('Xamarin Ltd', 'John Doe', 'Chairman', 'United States') @classmethod def vice_president(cls) -> 'TopLevelManagement': return cls('Xamarin Ltd', 'Jane Doe', 'Vice President', 'United States') @classmethod def ceo(cls) -> 'TopLevelManagement': return cls('Xamarin Ltd', 'Jeanne Donne', 'CEO', 'United States') class MiddleManagement(Management): def __init__(self, company_name, location, employee, position, **kwargs): super().__init__(company_name, location, employee, position, management_type='Middle', **kwargs) @classmethod def general_manager(cls) -> 'MiddleManagement': return cls('Xamarin Ltd', 'Aran Diego', 'General Manager', 'United States') @classmethod def regional_manager(cls) -> 'MiddleManagement': return cls('Xamarin Ltd', 'Antuan Doe', 'General Manager', 'United States') class FirstLineManagement(Management): def __init__(self, company_name, location, employee, position, **kwargs): super().__init__(company_name, location, employee, position, management_type='First line', **kwargs) @classmethod def supervisor(cls) -> 'FirstLineManagement': return cls('Xamarin Ltd', 'Sam Pauline', 'Supervisor', 'United States') @classmethod def office_manager(cls) -> 'FirstLineManagement': return cls('Xamarin Ltd', 'Sarah Jones', 'Office Manager', 'United States') @classmethod def team_leader(cls) -> 'FirstLineManagement': return cls('Xamarin Ltd', 'Amy Joe', 'Team Leader', 'United States') def main(): company = Company('Xamarin Ltd', 'United States') print(company) chairman = TopLevelManagement.chairman() print(chairman) ceo = TopLevelManagement.ceo() print(ceo) general_manager = MiddleManagement.general_manager() print(general_manager) regional_manager = MiddleManagement.regional_manager() print(regional_manager) supervisor = FirstLineManagement.supervisor() print(supervisor) office_manager = FirstLineManagement.office_manager() print(office_manager) team_leader = FirstLineManagement.team_leader() print(team_leader) if __name__ == '__main__': main()
31.6875
110
0.688363
378
3,549
6.201058
0.166667
0.070392
0.063993
0.064846
0.504266
0.462884
0.34727
0.28413
0.264505
0.226109
0
0
0.189349
3,549
111
111
31.972973
0.814738
0.010707
0
0.22973
0
0.027027
0.248359
0.018841
0
0
0
0
0
1
0.27027
false
0
0
0.189189
0.527027
0.108108
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
80969674b8cc9162e56c575ce0b3e77de0054708
194
py
Python
coding/exceptions.py
ffaristocrat/coding
5017ddba4b1b1e180f012bc36608e1e6b30b0447
[ "MIT" ]
null
null
null
coding/exceptions.py
ffaristocrat/coding
5017ddba4b1b1e180f012bc36608e1e6b30b0447
[ "MIT" ]
null
null
null
coding/exceptions.py
ffaristocrat/coding
5017ddba4b1b1e180f012bc36608e1e6b30b0447
[ "MIT" ]
null
null
null
class GameException(Exception): pass class GameFlowException(GameException): pass class EndProgram(GameFlowException): pass class InvalidPlayException(GameException): pass
12.933333
42
0.762887
16
194
9.25
0.4375
0.182432
0
0
0
0
0
0
0
0
0
0
0.175258
194
14
43
13.857143
0.925
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
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
3
80c6ede6e307ee489af6f1fefba2316fa2f0871d
5,565
py
Python
SimpleTrading/commodities_inflation.py
Nawter/Quantiacs
95ea9443744c5a2e5268fa18f5e38928a6452d5d
[ "MIT" ]
null
null
null
SimpleTrading/commodities_inflation.py
Nawter/Quantiacs
95ea9443744c5a2e5268fa18f5e38928a6452d5d
[ "MIT" ]
null
null
null
SimpleTrading/commodities_inflation.py
Nawter/Quantiacs
95ea9443744c5a2e5268fa18f5e38928a6452d5d
[ "MIT" ]
null
null
null
# This program imports the federal reserve economic data consumer price index # values from 1990 and uses those values to get the real values or infaltion adjusted # values of the sepcific commodities/markets. # Then when a commdoity hits a specific low infaltion based price, the algo # enters into a long psoiton and exits when the commodity/market hits a relativley # high price. import numpy import csv #elemnt zero is the oldest elment, in this case, inflation from 2/1/1990 def cpi_array(): cpi_array = numpy.zeros((328)) count = 0 with open("CPI_Spyder.csv", 'r') as csvfile: reader = csv.reader(csvfile) for row in reader: cpi = float(row[1]) cpi_array[count] = cpi count += 1 csvfile.close() return cpi_array #market dicitonary [buy price, sell price, current pos, iniital entry pos, fall by price, add to pos price #if it falls by 'fall by price', # of times added to the pos] def market_dictionary(): market_dictionary = {} market_dictionary[0] = [10000.0,12500.0,0,.5,.08,.1, 0] market_dictionary[1] = [8000.0,12000.0,0,.5,.12,.1, 0] market_dictionary[2] = [20000.0,25000.0,0,.5,.1,.1, 0] market_dictionary[3] = [15000.0,20000.0,0,.5,.06,.1, 0] market_dictionary[4] = [26000.0,36000.0,0,.5,.07,.1, 0] market_dictionary[5] = [25000.0,30000.0,0,.5,.08,.1, 0] market_dictionary[6] = [20000.0,21000.0,0,.5,.05,.1, 0] market_dictionary[7] = [14000.0,17000.0,0,.5,.07,.1, 0] market_dictionary[8] = [15000.0,20000.0,0,.5,.07,.1, 0] market_dictionary[9] = [5000.0,6000.0,0,.5,.1,.1, 0] market_dictionary[10] = [13000.0,19500.0,0,.5,.075,.1, 0] return market_dictionary def myTradingSystem(DATE, OPEN, HIGH, LOW, CLOSE, VOL, exposure, equity, settings): #initalzie the basics nMarkets = CLOSE.shape[1] pos = numpy.zeros(nMarkets) i = 0 settings['countDays'] += 1 #setting the cpi multiplyer to get compare prices reltivlely settings['CPI_muliplyer'] = (settings['BASE_CPI'] / settings['cpi_array'][ settings['count']]) # constantly get a new cpi every month by adding to count if settings['countDays'] % 21 == 0: settings['count'] += 1 #entering the pos for i in range(nMarkets - 1): if (CLOSE[-1, i] * settings['CPI_muliplyer']) <= settings['market_dictionary'][i][0]: settings['market_dictionary'][i][2] = settings['market_dictionary'][i][3] # pyramding to a falling posiiton - stage 1 if (CLOSE[-1,i] * settings['CPI_muliplyer']) <= (settings['market_dictionary'][i][0] / (1+(settings['market_dictionary'][i][4] * 5)) and settings['market_dictionary'][i][6] == 4): settings['market_dictionary'][i][6] += 1 settings['market_dictionary'][i][3] += settings['market_dictionary'][i][5] elif (CLOSE[-1,i] * settings['CPI_muliplyer']) <= (settings['market_dictionary'][i][0] / (1+(settings['market_dictionary'][i][4] * 4)) and settings['market_dictionary'][i][6] == 3): settings['market_dictionary'][i][6] += 1 settings['market_dictionary'][i][3] += settings['market_dictionary'][i][5] elif (CLOSE[-1,i] * settings['CPI_muliplyer']) <= (settings['market_dictionary'][i][0] / (1+(settings['market_dictionary'][i][4] * 3)) and settings['market_dictionary'][i][6] == 2): settings['market_dictionary'][i][6] += 1 settings['market_dictionary'][i][3] += settings['market_dictionary'][i][5] elif (CLOSE[-1,i] * settings['CPI_muliplyer']) <= (settings['market_dictionary'][i][0] / (1+(settings['market_dictionary'][i][5] * 2)) and settings['market_dictionary'][i][6] == 1): settings['market_dictionary'][i][6] += 1 settings['market_dictionary'][i][3] += settings['market_dictionary'][i][5] elif (CLOSE[-1,i] * settings['CPI_muliplyer']) <= (settings['market_dictionary'][i][0] / (1+settings['market_dictionary'][i][4]) and settings['market_dictionary'][i][6] == 0): settings['market_dictionary'][i][6] += 1 settings['market_dictionary'][i][3] += settings['market_dictionary'][i][5] #closing the position if (CLOSE[-1, i] * settings['CPI_muliplyer']) >= settings['market_dictionary'][i][1]: settings['market_dictionary'][i][2] = 0 settings['market_dictionary'][i][6] = 0 #set posistion to be returned equal to market dictionary value 2 for i in range(nMarkets - 1): pos[i] = settings['market_dictionary'][i][2] pos[11] = 11 return pos, settings def mySettings(): ''' Define your trading system settings here ''' settings = {} # Futures Contracts settings['markets'] = ['F_C', 'F_CC', 'F_CL', 'F_CT', 'F_FC','F_KC', 'F_LC', 'F_LN', 'F_NG', 'F_O', 'F_PA', 'CASH'] #`19900104 - 20170710 settings['beginInSample'] = '19900104' #settings['endInSample'] = '20170710' settings['lookback'] = 21 settings['budget'] = 10**6 settings['slippage'] = 0.05 settings['countDays'] = 0 settings['count'] = 0 settings['cpi_array'] = cpi_array() settings['market_dictionary'] = market_dictionary() settings['BASE_CPI'] = settings['cpi_array'][0] settings['CPI_muliplyer'] = 0 return settings # Evaluate trading system defined in current file. if __name__ == '__main__': import quantiacsToolbox results = quantiacsToolbox.runts(__file__) print(results['stats'])
46.764706
136
0.62372
764
5,565
4.417539
0.265707
0.256
0.270222
0.274074
0.442074
0.410074
0.346074
0.328593
0.281481
0.281481
0
0.078263
0.205571
5,565
119
137
46.764706
0.685139
0.189937
0
0.178571
0
0
0.216867
0
0
0
0
0
0
1
0.047619
false
0
0.035714
0
0.130952
0.011905
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
80eafa3cec93de224ebf997c5f37fafcf8ce4716
146
py
Python
graphics/__main__.py
wangyibin/biowy
a534f35fc6f96fe1b3a6ca78853a5aa076337328
[ "BSD-2-Clause" ]
1
2018-10-22T04:44:42.000Z
2018-10-22T04:44:42.000Z
graphics/__main__.py
wangyibin/bioway
a534f35fc6f96fe1b3a6ca78853a5aa076337328
[ "BSD-2-Clause" ]
null
null
null
graphics/__main__.py
wangyibin/bioway
a534f35fc6f96fe1b3a6ca78853a5aa076337328
[ "BSD-2-Clause" ]
null
null
null
#!/usr/bin/env python # -*- coding:utf-8 -*- # @Time: 2019/1/8 16:41 from bioway.apps.base import dmain if __name__ == "__main__": dmain()
14.6
34
0.623288
23
146
3.608696
0.913043
0
0
0
0
0
0
0
0
0
0
0.091667
0.178082
146
10
35
14.6
0.6
0.431507
0
0
0
0
0.098765
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
3
0383eebbfbfff2168965dd0292da22a7b499eb2b
25,457
py
Python
mopidy_pidi/brainz.py
JimmyBlunt/mopidy-pidi
30d99c2850bc527b81e8eec8941adcd49c2423d3
[ "Apache-2.0" ]
null
null
null
mopidy_pidi/brainz.py
JimmyBlunt/mopidy-pidi
30d99c2850bc527b81e8eec8941adcd49c2423d3
[ "Apache-2.0" ]
null
null
null
mopidy_pidi/brainz.py
JimmyBlunt/mopidy-pidi
30d99c2850bc527b81e8eec8941adcd49c2423d3
[ "Apache-2.0" ]
null
null
null
""" Musicbrainz related functions. """ import base64 import logging import os import time from threading import Thread import musicbrainzngs as mus from .__init__ import __version__ logger = logging.getLogger(__name__) class Brainz: def __init__(self, cache_dir): """Initialize musicbrainz.""" mus.set_useragent( "python-pidi: A cover art daemon.", __version__, "https://github.com/pimoroni/mopidy-pidi", ) self._cache_dir = cache_dir self._default_filename = os.path.join(self._cache_dir, "__default.jpg") self.save_album_art(self.get_default_album_art(), self._default_filename) def get_album_art(self, artist, album, callback=None): if artist is None or album is None or artist == "" or album == "": if callback is not None: return callback(self._default_filename) return self._default_filename file_name = self.get_cache_file_name(f"{artist}_{album}") logger.info("BRAINZ::get_album-art: get_cached_file_name:(fartist_album" + str(file_name)) if os.path.isfile(file_name): # If a cached file already exists, use it! if callback is not None: return callback(file_name) return file_name file_name1 = f"{artist}_{album}.jpg".replace("/", "") file_name1 = "/var/lib/mopidy/pidi/"+file_name1 logger.info("BRAINZ:get_album-art: file_name1:" + str(file_name1)) if os.path.isfile(file_name): if callback is not None: return callback(file_name) return file_name if callback is not None: def async_request_album_art(self, artist, album, file_name, callback): album_art = self.request_album_art(artist, album) if album_art is None: # If the MusicBrainz request fails, cache the default # art using this filename. self.save_album_art(self.get_default_album_art(), file_name) return callback(file_name) self.save_album_art(album_art, file_name) return callback(file_name) t_album_art = Thread( target=async_request_album_art, args=(self, artist, album, file_name, callback), ) t_album_art.start() return t_album_art else: album_art = self.request_album_art(artist, album) if album_art is None: # If the MusicBrainz request fails, cache the default # art using this filename. self.save_album_art(self.get_default_album_art(), file_name) return file_name self.save_album_art(album_art, file_name) return file_name # album_art = self.request_album_art(artist, album) # # if album_art is None: # # file_name = f"{album}".jpg # logger.info("BRAINZ::get_album-art: BrainzRequestFailed-try-cleartexfile.f{album}).jpg" + str(file_name)) # if os.path.isfile(file_name): # # If a cached file already exists, use it! # if callback is not None: # return callback(file_name) # return file_name # file_name1 = f"{album}.jpg".replace("/", "") # file_name1 = "/var/lib/mopidy/pidi/"+file_name1 # logger.info("BRAINZ:get_album-art: onlyalbumfile_name1:" + str(file_name1)) # # if os.path.isfile(file_name1): # if callback is not None: # return callback(file_name1) # return file_name1 # if album_art is None: # If the MusicBrainz request fails, cache the default # art using this filename. # self.save_album_art(self.get_default_album_art(), file_name) # return file_name # If the MusicBrainz request fails, cache the default # # art using this filename. # self.save_album_art(self.get_default_album_art(), file_name)# # return file_name # self.save_album_art(album_art, file_name) # return file_name def save_album_art(self, data, output_file): with open(output_file, "wb") as f: f.write(data) def request_album_art(self, artist, album, size=500, retry_delay=5, retries=5): """Download the cover art.""" try: data = mus.search_releases(artist=artist, release=album, limit=1) release_id = data["release-list"][0]["release-group"]["id"] logger.info("mopidy-pidi: musicbrainz using release-id: {release_id}") return mus.get_release_group_image_front(release_id, size=size) except mus.NetworkError: if retries == 0: # raise mus.NetworkError("Failure connecting to MusicBrainz.org") return None logger.info( f"mopidy-pidi: musicbrainz retrying download. {retries} retries left!" ) time.sleep(retry_delay) self.request_album_art(artist, album, size=size, retries=retries - 1) except mus.ResponseError: logger.info( f"mopidy-pidi: musicbrainz couldn't find album art for {artist} - {album}" ) return None def get_cache_file_name(self, file_name): file_name = file_name.encode("utf-8") file_name = base64.b64encode(file_name) if type(file_name) is bytes: file_name = file_name.decode("utf-8") # Ruh roh, / is a vaild Base64 character # but also a valid UNIX path separator! file_name = file_name.replace("/", "-") file_name = f"{file_name}.jpg" return os.path.join(self._cache_dir, file_name) def get_default_album_art(self): """Return binary version of default album art.""" return base64.b64decode( """ /9j/4AAQSkZJRgABAgEAlgCWAAD//gASTEVBRFRPT0xTIHYyMC4wAP/bAIQABQUFCAUIDAcHDAwJCQkMDQwMDAwNDQ0NDQ0NDQ0ND Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQEFCAgKBwoMBwcMDQwKDA0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ 0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0N/8QBogAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoLAQADAQEBAQEBAQEBAAAAAAAAAQI DBAUGBwgJCgsQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkq NDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw 8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+hEAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFE KRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiIm KkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/8AAEQgAvgENAwEi AAIRAQMRAf/aAAwDAQACEQMRAD8A+m9UuZo7p1R3VRtwAxAHyr2BqiLu4P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HRTb2Z0d2FyZQBBZG9iZSBJbWFn ZVJlYWR5ccllPAAAAMBQTFRFBHwvBSl8d04DCQ99egJLfAMzejQGcGoAAGZ6AHN3N3wBSHwBKXwDAHlp NQF9AHtXAFV7VwB7HgN9B30aG30FXncAAXtERwB8fQMbZQB5AUF8fRsHQ04rfQgLFlZTVzgteABiZ14F agNiAmpoF3kaLVU4V1QVYhdFLkZIQy1MFWc/biYkKSVpLWUmLjVYcQBzJHMbeRQiBWxZBlxnOmkXDn0M WAdnGhd5FkBlSRZfCk1rO3MMTmwJCm5FQgtwMhJydzVfDgAAAYtJREFUeNpUzeligjAQBOCNgFcVFVRQ FC3gUU/Uingg7/9W3U1CpJOf38wGGpQ2ptPpDIcAYNv29Xrt9/utVqsJXBsfLmmzKbiYy3WZ6/XC1fyj X8iiIOZQsFDBvFBct+1I6BcGuvUuedgIwzOfR9dI6QC6FF4I2+dsmEEURVIHA+RxVzZwfs4gi+JW3Hwi ch5juF8ul/CcbTZxHD+ffFqwrGDB32z2+9/n6/VCqw1qwMZMFh6Ph+/7C2RUJAowGWqlqb9eLCa/y2/M f2YsZWl6WK8nk+VSOTBN05iGemO73e5w+JnNZpVlRQYIKTcM+g/xtiq1BloR5Dy/3++r7ba6rWLkmmLd LCvP8zfqCp0zNYgtepZlmu93kiCfTifP87iDNK5OkiSBbpyEe1WPs0DTdJxeEAQr3TCUgyXUQnR6ySgI dJy7rjclV8y3PdS5jm647nRKDVBIOjoSG4KpAOpfB3V0nM/LjmyapXHBriscylrwx0FpiQ11Hf6PyXX5 ORWAoxqr44Y4/ifAAPd/TAMIg8r1AAAAAElFTkSuQmCC""" ) '''
79.553125
5,753
0.864124
1,525
25,457
14.299016
0.579016
0.016509
0.007704
0.00587
0.084289
0.082042
0.06833
0.065762
0.062964
0.058012
0
0.132148
0.085635
25,457
319
5,754
79.802508
0.804657
0.072554
0
0.288889
0
0
0.11296
0.023201
0
1
0
0
0
1
0.077778
false
0
0.077778
0
0.344444
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
3
038e7cca624d292ed41cd443faa6f20564a62fd4
303
py
Python
abct/abct.py
hornc/abctag
d2abd7384e0e155fbee35c639dd1afe6336f0bd9
[ "MIT" ]
2
2020-07-25T07:22:50.000Z
2022-02-06T16:09:27.000Z
abct/abct.py
hornc/abctag
d2abd7384e0e155fbee35c639dd1afe6336f0bd9
[ "MIT" ]
2
2021-08-21T09:24:14.000Z
2021-08-24T08:08:57.000Z
abct/abct.py
hornc/abctag
d2abd7384e0e155fbee35c639dd1afe6336f0bd9
[ "MIT" ]
null
null
null
from math import floor, log n = lambda x: (x + 1) % 2 + 1 s = lambda x: floor(log(x + 1, 2)) r = lambda x: x // 2 - n(x) + 1 + n(x) * 2**(s(x) - 1) pn = lambda p: r(p) + (n(p) == 2) * (r(r(p)) - r(p)) dn = lambda p, d: (d + (n(p) == n(d) == 2) * (n(r(p)) * 2**s(d)) - (n(p) == 1)) // (3 - n(p))
43.285714
94
0.392739
69
303
1.724638
0.246377
0.067227
0.134454
0
0
0
0
0
0
0
0
0.064516
0.283828
303
6
95
50.5
0.483871
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.166667
0
0.166667
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3