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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a57702edb80e3f81223f03c32153b6c5bd7e9b60
| 175
|
py
|
Python
|
ob/apps.py
|
peterkuma/tjrapid
|
8813cb0a3633785754d20263f180428688bcb026
|
[
"MIT"
] | null | null | null |
ob/apps.py
|
peterkuma/tjrapid
|
8813cb0a3633785754d20263f180428688bcb026
|
[
"MIT"
] | 1
|
2021-05-16T16:40:00.000Z
|
2021-05-16T16:40:00.000Z
|
ob/apps.py
|
peterkuma/tjrapid
|
8813cb0a3633785754d20263f180428688bcb026
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class ObAppConfig(AppConfig):
name = 'ob'
verbose_name = _('Orienteering')
| 21.875
| 55
| 0.76
| 21
| 175
| 6.142857
| 0.761905
| 0.155039
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.16
| 175
| 7
| 56
| 25
| 0.877551
| 0
| 0
| 0
| 0
| 0
| 0.08
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
a5b46685ba9ea5c26778bed7d6934ee71d18f11b
| 142
|
py
|
Python
|
src/omero_napari/widgets/__init__.py
|
will-moore/napari-omero
|
c3fe552a6417c312ab52e7ade10d1b80859b5336
|
[
"BSD-3-Clause"
] | 23
|
2020-06-23T01:28:33.000Z
|
2022-01-22T13:36:21.000Z
|
src/omero_napari/widgets/__init__.py
|
will-moore/napari-omero
|
c3fe552a6417c312ab52e7ade10d1b80859b5336
|
[
"BSD-3-Clause"
] | 29
|
2020-06-24T00:58:50.000Z
|
2022-02-02T12:46:55.000Z
|
src/omero_napari/widgets/__init__.py
|
will-moore/napari-omero
|
c3fe552a6417c312ab52e7ade10d1b80859b5336
|
[
"BSD-3-Clause"
] | 7
|
2020-06-23T11:28:39.000Z
|
2022-02-03T06:51:38.000Z
|
from .main import OMEROWidget
from .gateway import QGateWay
from .login import LoginForm
__all__ = ["OMEROWidget", "QGateWay", "LoginForm"]
| 20.285714
| 50
| 0.767606
| 16
| 142
| 6.5625
| 0.5625
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.133803
| 142
| 6
| 51
| 23.666667
| 0.853659
| 0
| 0
| 0
| 0
| 0
| 0.197183
| 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
|
3c21a237298ffb0157442bca1ca648140ebef858
| 354
|
py
|
Python
|
Day_17/generator_python.py
|
kiranrraj/100Days_Of_Coding
|
ab75d83be9be87fb7bc83a3f3b72a4638dab22a1
|
[
"MIT"
] | null | null | null |
Day_17/generator_python.py
|
kiranrraj/100Days_Of_Coding
|
ab75d83be9be87fb7bc83a3f3b72a4638dab22a1
|
[
"MIT"
] | null | null | null |
Day_17/generator_python.py
|
kiranrraj/100Days_Of_Coding
|
ab75d83be9be87fb7bc83a3f3b72a4638dab22a1
|
[
"MIT"
] | null | null | null |
# Title : Generators in python
# Author : Kiran raj R.
# Date : 31:10:2020
def printNum():
num = 0
while True:
yield num
num += 1
result = printNum()
print(next(result))
print(next(result))
print(next(result))
result = (num for num in range(10000))
print(result)
print(next(result))
print(next(result))
print(next(result))
| 16.090909
| 38
| 0.644068
| 51
| 354
| 4.470588
| 0.509804
| 0.236842
| 0.394737
| 0.460526
| 0.421053
| 0.421053
| 0.421053
| 0.394737
| 0.394737
| 0
| 0
| 0.053957
| 0.214689
| 354
| 21
| 39
| 16.857143
| 0.766187
| 0.200565
| 0
| 0.428571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.071429
| false
| 0
| 0
| 0
| 0.071429
| 0.642857
| 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
|
3c72bc18b29bf425b0c14d5625db1f4a7d6f2d7f
| 160
|
py
|
Python
|
GodwillOnyewuchi/Phase 1/Python Basic 2/day 11 task/task10.py
|
CodedLadiesInnovateTech/-python-challenge-solutions
|
430cd3eb84a2905a286819eef384ee484d8eb9e7
|
[
"MIT"
] | 6
|
2020-05-23T19:53:25.000Z
|
2021-05-08T20:21:30.000Z
|
GodwillOnyewuchi/Phase 1/Python Basic 2/day 11 task/task10.py
|
GREENFONTS/python-challenge-solutions
|
a9aad85a250892fe41961a7d5e77f67b8d14fc1b
|
[
"MIT"
] | 8
|
2020-05-14T18:53:12.000Z
|
2020-07-03T00:06:20.000Z
|
GodwillOnyewuchi/Phase 1/Python Basic 2/day 11 task/task10.py
|
GREENFONTS/python-challenge-solutions
|
a9aad85a250892fe41961a7d5e77f67b8d14fc1b
|
[
"MIT"
] | 39
|
2020-05-10T20:55:02.000Z
|
2020-09-12T17:40:59.000Z
|
# Python program to get the name of the host on which the routine is running
import socket
host_name = socket.gethostname()
print(f'Host name: {host_name}')
| 20
| 76
| 0.75625
| 27
| 160
| 4.407407
| 0.666667
| 0.201681
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.16875
| 160
| 7
| 77
| 22.857143
| 0.894737
| 0.4625
| 0
| 0
| 0
| 0
| 0.261905
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0.333333
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
3c7a360a728d525f37ae5bfc4620ba976749fb01
| 93
|
py
|
Python
|
exampleapp/dinosaurs/models.py
|
jupiterFierce31/A-simple-example-of-a-Django-REST-app-Angular2
|
15a07836d7c2d775935a5e214a9715677bfe4243
|
[
"MIT"
] | 163
|
2016-07-19T21:04:53.000Z
|
2022-01-28T12:55:14.000Z
|
exampleapp/dinosaurs/models.py
|
jupiterFierce31/A-simple-example-of-a-Django-REST-app-Angular2
|
15a07836d7c2d775935a5e214a9715677bfe4243
|
[
"MIT"
] | 9
|
2016-10-29T13:32:16.000Z
|
2022-01-28T13:23:21.000Z
|
exampleapp/dinosaurs/models.py
|
jupiterFierce31/A-simple-example-of-a-Django-REST-app-Angular2
|
15a07836d7c2d775935a5e214a9715677bfe4243
|
[
"MIT"
] | 74
|
2016-07-28T17:13:39.000Z
|
2020-05-28T07:42:28.000Z
|
from django.db import models
class Dinosaur(models.Model):
species = models.TextField()
| 18.6
| 32
| 0.752688
| 12
| 93
| 5.833333
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.150538
| 93
| 5
| 32
| 18.6
| 0.886076
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
3c93e852cc22b18c12b70154a68fa622930bb82a
| 232
|
py
|
Python
|
celery-getting-started/proj/tasks.py
|
hustbeta/python-examples
|
9052a080cb27b1c8c2bc36222ece409e236ba076
|
[
"MIT"
] | null | null | null |
celery-getting-started/proj/tasks.py
|
hustbeta/python-examples
|
9052a080cb27b1c8c2bc36222ece409e236ba076
|
[
"MIT"
] | null | null | null |
celery-getting-started/proj/tasks.py
|
hustbeta/python-examples
|
9052a080cb27b1c8c2bc36222ece409e236ba076
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from proj.celery import app
@app.task
def add(x, y):
return x + y
@app.task
def mul(x, y):
return x * y
@app.task
def xsum(numbers):
return sum(numbers)
| 13.647059
| 38
| 0.650862
| 39
| 232
| 3.74359
| 0.512821
| 0.054795
| 0.205479
| 0.123288
| 0.273973
| 0.273973
| 0.273973
| 0.273973
| 0
| 0
| 0
| 0.005495
| 0.215517
| 232
| 16
| 39
| 14.5
| 0.796703
| 0.090517
| 0
| 0.272727
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.272727
| false
| 0
| 0.181818
| 0.272727
| 0.727273
| 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
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
3c9d10c4a95e134537afb0ec069fd1d54f2efd50
| 57
|
py
|
Python
|
src/apps/api/service.py
|
Flaiers/django-clean-architecture
|
4d14c1a7426e162d5e413e8f70e16e269cd63f82
|
[
"MIT"
] | 2
|
2021-10-19T21:30:43.000Z
|
2021-10-21T18:38:02.000Z
|
src/apps/api/service.py
|
Flaiers/django-template
|
4d14c1a7426e162d5e413e8f70e16e269cd63f82
|
[
"MIT"
] | null | null | null |
src/apps/api/service.py
|
Flaiers/django-template
|
4d14c1a7426e162d5e413e8f70e16e269cd63f82
|
[
"MIT"
] | null | null | null |
from django_filters import rest_framework as drf_filters
| 28.5
| 56
| 0.894737
| 9
| 57
| 5.333333
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.105263
| 57
| 1
| 57
| 57
| 0.941176
| 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
|
b1cea7cb66b3ae01538cf1af60a2fc9afa373d23
| 83
|
py
|
Python
|
cpc/cpcparser/__init__.py
|
U-Ar/Cpresto
|
f723458fb237c9e3e8bc8a6afdf7c81858a65363
|
[
"BSD-3-Clause"
] | 1
|
2021-05-09T07:10:19.000Z
|
2021-05-09T07:10:19.000Z
|
cpc/cpcparser/__init__.py
|
U-Ar/Cpresto
|
f723458fb237c9e3e8bc8a6afdf7c81858a65363
|
[
"BSD-3-Clause"
] | null | null | null |
cpc/cpcparser/__init__.py
|
U-Ar/Cpresto
|
f723458fb237c9e3e8bc8a6afdf7c81858a65363
|
[
"BSD-3-Clause"
] | null | null | null |
#from .CprestoParser import CprestoParser
#from .LibraryLoader import LibraryLoader
| 41.5
| 41
| 0.86747
| 8
| 83
| 9
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.084337
| 83
| 2
| 42
| 41.5
| 0.947368
| 0.963855
| 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
|
b1dcaaa277cc252245ab7e43be8f88599018fa6d
| 2,212
|
py
|
Python
|
restmore/permissions.py
|
zbyte64/python-restmore
|
86916009806b9390260b8445f5536fa6aa345862
|
[
"MIT"
] | 1
|
2015-08-08T15:45:54.000Z
|
2015-08-08T15:45:54.000Z
|
restmore/permissions.py
|
zbyte64/python-restmore
|
86916009806b9390260b8445f5536fa6aa345862
|
[
"MIT"
] | null | null | null |
restmore/permissions.py
|
zbyte64/python-restmore
|
86916009806b9390260b8445f5536fa6aa345862
|
[
"MIT"
] | null | null | null |
#CONSIDER: composable authorizations
class Authorization(object):
'''
Base authorization class, defaults to full authorization
'''
#CONSIDER: how is this notified about filtering, ids, etc
def __init__(self, identity, endpoint):
self.identity = identity
self.endpoint = endpoint
def process_queryset(self, queryset):
return queryset
def is_authorized(self):
return True
class AuthorizationMixin(object):
def make_authorization(self, identity, endpoint):
return Authorization(identity, endpoint)
def get_identity(self):
#TODO delegate
return self.request.user
def is_authenticated(self):
return self.authorization.is_authorized()
def handle(self, endpoint, *args, **kwargs):
self.identity = self.get_identity()
self.authorization = self.make_authorization(self.identity, endpoint)
return super(AuthorizationMixin, self).handle(endpoint, *args, **kwargs)
class DjangoModelAuthorization(Authorization):
'''
Your basic django core permission based authorization
'''
def __init__(self, identity, model, endpoint):
super(DjangoModelAuthorization, self).__init__(identity, endpoint)
self.model = model
def is_authorized(self):
#print("auth identity:", self.identity)
if self.identity.is_superuser:
return True
#TODO proper lookup of label?
if self.endpoint == 'list':
return True
#TODO in django fashion, you have list if you have add, change, or delete
return self.identity.has_perm
perm_name = self.model._meta.app_label + '.'
if self.endpoint == 'create':
perm_name += 'add'
elif self.endpoint == 'update':
perm_name += 'change'
else:
#TODO delete_list? update_list? others?
perm_name += self.endpoint
perm_name += '_' + self.model.__name__
return self.identity.has_perm(perm_name)
class ModelAuthorizationMixin(AuthorizationMixin):
def make_authorization(self, identity, endpoint):
return DjangoModelAuthorization(identity, self.model, endpoint)
| 32.529412
| 85
| 0.661392
| 235
| 2,212
| 6.055319
| 0.323404
| 0.092762
| 0.056219
| 0.061138
| 0.141251
| 0.141251
| 0.111033
| 0
| 0
| 0
| 0
| 0
| 0.248192
| 2,212
| 67
| 86
| 33.014925
| 0.855683
| 0.176763
| 0
| 0.170732
| 0
| 0
| 0.015135
| 0
| 0
| 0
| 0
| 0.029851
| 0
| 1
| 0.243902
| false
| 0
| 0
| 0.146341
| 0.609756
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
b1f9408109772806fc957f33745507101ebc8af2
| 265
|
py
|
Python
|
conftest_example.py
|
prmtl/celery_mock
|
ea4cef56824a7667cb68b899965db5f64b6a4f7f
|
[
"MIT"
] | null | null | null |
conftest_example.py
|
prmtl/celery_mock
|
ea4cef56824a7667cb68b899965db5f64b6a4f7f
|
[
"MIT"
] | null | null | null |
conftest_example.py
|
prmtl/celery_mock
|
ea4cef56824a7667cb68b899965db5f64b6a4f7f
|
[
"MIT"
] | null | null | null |
def pytest_sessionstart(session):
from celery_mock import mock_celery_task
from my_app import celery_app
mock_celery_task(celery_app)
def pytest_runtest_teardown(item, nextitem):
from celery_mock import reset_celery_mocks
reset_celery_mocks()
| 26.5
| 46
| 0.803774
| 38
| 265
| 5.184211
| 0.447368
| 0.091371
| 0.142132
| 0.203046
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.154717
| 265
| 9
| 47
| 29.444444
| 0.879464
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0.428571
| 0
| 0.714286
| 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
| 1
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
59191908ae2c71e65cb3b9bb79a44241ce7bd6e4
| 331
|
py
|
Python
|
utils/__init__.py
|
mihamerstan/lidar_ordered_points
|
ca0aca20cbb5c1434529d4722ee1125b095e37e1
|
[
"MIT"
] | 1
|
2021-05-17T19:08:05.000Z
|
2021-05-17T19:08:05.000Z
|
utils/__init__.py
|
mihamerstan/lidar_ordered_points
|
ca0aca20cbb5c1434529d4722ee1125b095e37e1
|
[
"MIT"
] | null | null | null |
utils/__init__.py
|
mihamerstan/lidar_ordered_points
|
ca0aca20cbb5c1434529d4722ee1125b095e37e1
|
[
"MIT"
] | null | null | null |
from .meters import AverageMeter, RunningAverageMeter, TimeMeter
from .progress_bar import ProgressBar
from .noise_model import get_noise
from .train_utils import *
from .metrics import *
from .test_metrics import metrics_avg_on_noise_range
from .demo_utils import *
from .pwc_dataset import PieceWiseConstantDataset, MaskedDataset
| 41.375
| 64
| 0.854985
| 43
| 331
| 6.325581
| 0.55814
| 0.110294
| 0.110294
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.102719
| 331
| 8
| 65
| 41.375
| 0.915825
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
592ea9bf33dad4cbae7ed2d382789b96776a3153
| 233
|
py
|
Python
|
start.py
|
nikor1337/ironpython_training
|
022e2c48193fa81c3c3d7530ae0b9d939e50687e
|
[
"Apache-2.0"
] | null | null | null |
start.py
|
nikor1337/ironpython_training
|
022e2c48193fa81c3c3d7530ae0b9d939e50687e
|
[
"Apache-2.0"
] | null | null | null |
start.py
|
nikor1337/ironpython_training
|
022e2c48193fa81c3c3d7530ae0b9d939e50687e
|
[
"Apache-2.0"
] | null | null | null |
import clr
clr.AddReferenceByName('Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c')
from Microsoft.Office.Interop import Excel
excel = Excel.ApplicationClass()
excel.Visible = True
| 38.833333
| 124
| 0.824034
| 29
| 233
| 6.62069
| 0.62069
| 0.15625
| 0.229167
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.069124
| 0.06867
| 233
| 6
| 125
| 38.833333
| 0.815668
| 0
| 0
| 0
| 0
| 0.2
| 0.418803
| 0.264957
| 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
|
59316f06b24867b274335961d18f65a1ac390d62
| 55
|
py
|
Python
|
tests/import/import-from.test/import-same-level.py
|
nanolikeyou/pysonar2
|
0750a7a4474fe27f2ded14e9999d93470cb1ccc4
|
[
"Apache-2.0"
] | 2,574
|
2015-01-02T04:50:03.000Z
|
2022-03-28T06:25:18.000Z
|
tests/import/import-from.test/import-same-level.py
|
nanolikeyou/pysonar2
|
0750a7a4474fe27f2ded14e9999d93470cb1ccc4
|
[
"Apache-2.0"
] | 38
|
2015-01-29T15:55:41.000Z
|
2022-02-04T10:02:26.000Z
|
tests/import/import-from.test/import-same-level.py
|
nanolikeyou/pysonar2
|
0750a7a4474fe27f2ded14e9999d93470cb1ccc4
|
[
"Apache-2.0"
] | 955
|
2015-01-02T10:14:13.000Z
|
2022-03-26T17:46:41.000Z
|
from drawer import Knife
k1 = Knife()
print k1.length
| 11
| 24
| 0.745455
| 9
| 55
| 4.555556
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.044444
| 0.181818
| 55
| 4
| 25
| 13.75
| 0.866667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.333333
| null | null | 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
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
3ce14cae14dae90f832595459a40d1d12d1bccf4
| 4,914
|
py
|
Python
|
test/state_script.py
|
woza/minstrel
|
46941700924b0412c5a261ecb6cc8224df7014a2
|
[
"MIT"
] | null | null | null |
test/state_script.py
|
woza/minstrel
|
46941700924b0412c5a261ecb6cc8224df7014a2
|
[
"MIT"
] | null | null | null |
test/state_script.py
|
woza/minstrel
|
46941700924b0412c5a261ecb6cc8224df7014a2
|
[
"MIT"
] | null | null | null |
#!/usr/bin/python
import state_machine
import stub_system
import inspect
import sys
import time
class failure:
pass
def encode_state( machine, stub ):
return "%s %s" % ( machine.query_current_selection(), stub.query_play_state())
def ensure( machine, stub, expect):
called_from_line = inspect.stack()[1][2]
actual = encode_state(machine, stub)
msg = "[Line %d] - " % called_from_line
if actual != expect:
msg += "FAIL: Expected '%s' received '%s'" % ( expect, actual )
print msg
sys.exit(1)
else:
msg += "PASS"
print msg
stub = stub_system.stub('root')
path = stub.mkdir('root', 'alpha_list')
stub.add_file(path, 'Alice')
stub.add_file(path, 'Adam')
stub.add_file(path, 'Anne')
stub.add_file(path, 'Alex')
p2 = stub.mkdir(path, 'angel_directory')
stub.add_file(p2, 'Anon')
path=stub.mkdir('root', 'beta_list')
stub.add_file(path, 'Bob')
stub.add_file(path, 'Belle')
stub.add_file(path, 'Brad')
stub.add_file('root', 'eve')
sm = state_machine.minstrel_state('root', stub)
##########################################
# Navigation Tests
##########################################
# Ensure we cycle properly when moving forwards
ensure(sm, stub, 'alpha_list stopped')
sm.process_input(sm.ACTIONS.forward)
ensure(sm, stub, 'beta_list stopped')
sm.process_input(sm.ACTIONS.forward)
ensure(sm, stub, 'eve stopped')
sm.process_input(sm.ACTIONS.forward)
ensure(sm, stub, 'alpha_list stopped')
sm.process_input(sm.ACTIONS.forward)
ensure(sm, stub, 'beta_list stopped')
#Ensure we cycle properly when moving backwards
sm.process_input(sm.ACTIONS.backward)
ensure(sm, stub, 'alpha_list stopped')
sm.process_input(sm.ACTIONS.backward)
ensure(sm, stub, 'eve stopped')
sm.process_input(sm.ACTIONS.backward)
ensure(sm, stub, 'beta_list stopped')
sm.process_input(sm.ACTIONS.backward)
ensure(sm, stub, 'alpha_list stopped')
sm.process_input(sm.ACTIONS.backward)
ensure(sm, stub, 'eve stopped')
#Ensure we can enter and leave directories
sm.process_input(sm.ACTIONS.enter) # Entering a file is a no-op
ensure(sm, stub, 'eve stopped')
sm.process_input(sm.ACTIONS.forward)
ensure(sm, stub, 'alpha_list stopped')
sm.process_input(sm.ACTIONS.enter)
ensure(sm, stub, 'Alice stopped')
sm.process_input(sm.ACTIONS.forward)
ensure(sm, stub, 'Adam stopped')
sm.process_input(sm.ACTIONS.forward)
ensure(sm, stub, 'Anne stopped')
sm.process_input(sm.ACTIONS.forward)
ensure(sm, stub, 'Alex stopped')
sm.process_input(sm.ACTIONS.forward)
ensure(sm, stub, 'angel_directory stopped')
sm.process_input(sm.ACTIONS.enter)
ensure(sm, stub, 'Anon stopped')
sm.process_input(sm.ACTIONS.leave)
ensure(sm, stub, 'angel_directory stopped')
sm.process_input(sm.ACTIONS.backward) #Ensure leave from a file works too
ensure(sm, stub, 'Alex stopped')
sm.process_input(sm.ACTIONS.leave)
ensure(sm, stub, 'alpha_list stopped')
sm.process_input(sm.ACTIONS.leave) # Leave at top level is no-op
ensure(sm, stub, 'alpha_list stopped')
##########################################
# Playing/Pausing/Stopping Tests
##########################################
sm.process_input(sm.ACTIONS.play) # Play on directory is no-op
ensure(sm, stub, 'alpha_list stopped')
sm.process_input(sm.ACTIONS.enter)
ensure(sm, stub, 'Alice stopped')
sm.process_input(sm.ACTIONS.play)
ensure(sm, stub, 'Alice playing')
sm.process_input(sm.ACTIONS.forward)
ensure(sm, stub, 'Adam playing')
sm.process_input(sm.ACTIONS.forward)
ensure(sm, stub, 'Anne playing')
sm.process_input(sm.ACTIONS.backward) #Assumed within unrewind time
ensure(sm, stub, 'Adam playing')
delay = sm.query_rewind_trigger_delay() + 1
print "Pausing for %d seconds" % delay
time.sleep(delay)
sm.process_input(sm.ACTIONS.backward)
ensure(sm, stub, 'Adam playing') # Rewound
sm.process_input(sm.ACTIONS.backward) #Assumed within unrewind time
ensure(sm, stub, 'Alice playing')
sm.process_input(sm.ACTIONS.backward)
ensure(sm, stub, 'angel_directory stopped')
sm.process_input(sm.ACTIONS.forward)
ensure(sm, stub, 'Alice stopped')
sm.process_input(sm.ACTIONS.play)
ensure(sm, stub, 'Alice playing')
sm.process_input(sm.ACTIONS.play)
ensure(sm, stub, 'Alice paused')
sm.process_input(sm.ACTIONS.play)
ensure(sm, stub, 'Alice playing')
sm.process_input(sm.ACTIONS.play)
ensure(sm, stub, 'Alice paused')
sm.process_input(sm.ACTIONS.forward) # Moving off the paused track, should move to stopped
ensure(sm, stub, 'Adam stopped')
sm.process_input(sm.ACTIONS.play)
ensure(sm, stub, 'Adam playing')
sm.process_input(sm.ACTIONS.play)
ensure(sm, stub, 'Adam paused')
sm.process_input(sm.ACTIONS.backward)
ensure(sm, stub, 'Alice stopped')
sm.process_input(sm.ACTIONS.play)
ensure(sm, stub, 'Alice playing')
sm.process_input(sm.ACTIONS.play)
ensure(sm, stub, 'Alice paused')
sm.process_input(sm.ACTIONS.enter)
ensure(sm, stub, 'Alice paused')
sm.process_input(sm.ACTIONS.leave)
ensure(sm, stub, 'alpha_list stopped')
print "All Tests Passed"
| 32.76
| 90
| 0.722426
| 738
| 4,914
| 4.691057
| 0.155827
| 0.101675
| 0.152513
| 0.198729
| 0.729058
| 0.710572
| 0.673021
| 0.669555
| 0.665511
| 0.630272
| 0
| 0.001364
| 0.104803
| 4,914
| 149
| 91
| 32.979866
| 0.785633
| 0.088116
| 0
| 0.68
| 0
| 0
| 0.189812
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0.024
| 0.04
| null | null | 0.032
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
3ceaaf4ea8991934e1cf0a97c09ff15e7b9eb12f
| 10,381
|
py
|
Python
|
discordbot.py
|
sigu0613/discordpy-startup
|
769bc191594b6e1f81e47a13cde7ea21872271b4
|
[
"MIT"
] | null | null | null |
discordbot.py
|
sigu0613/discordpy-startup
|
769bc191594b6e1f81e47a13cde7ea21872271b4
|
[
"MIT"
] | null | null | null |
discordbot.py
|
sigu0613/discordpy-startup
|
769bc191594b6e1f81e47a13cde7ea21872271b4
|
[
"MIT"
] | null | null | null |
"""from discord.ext import commands
import os
import discord
import traceback
import asyncio
import random
rbtflag = False
bot = commands.Bot(command_prefix='.', description='自動でチーム募集をするBOTです')
client = discord.Client()
token = os.environ['DISCORD_BOT_TOKEN']
recruit_message = {}
lastest_recruit_data = {}
cache_limit = 300
@bot.event
async def on_reaction_add(reaction, user):
message = reaction.message
if(message.id in recruit_message and not user.bot):
emj = str(reaction.emoji)
await message.remove_reaction(emj, user)
isFull = False
if(emj == "⬆️" and user.id != recruit_message[message.id]["writer_id"]):
if(recruit_message[message.id]["max_user"] == -1 or len(recruit_message[message.id]["users"]) < recruit_message[message.id]["max_user"]):
if(user.id not in recruit_message[message.id]["users"]):
recruit_message[message.id]["users"].append(user.id)
if(recruit_message[message.id]["max_user"] != -1 and len(recruit_message[message.id]["users"]) >= recruit_message[message.id]["max_user"]):
isFull = True
elif(emj == "⬇️" and user.id != recruit_message[message.id]["writer_id"] and user.id in recruit_message[message.id]["users"]):
recruit_message[message.id]["users"].remove(user.id)
elif(emj == "✖" and user.id == recruit_message[message.id]["writer_id"]):
isFull = True
users_str = "{name} [{id}]".format(name = message.guild.get_member(recruit_message[message.id]["writer_id"]).name, id = str(message.guild.get_member(recruit_message[message.id]["writer_id"])))
if(message.guild.get_member(recruit_message[message.id]["writer_id"]).nick != None):
users_str = "{name} [{id}]".format(name = message.guild.get_member(recruit_message[message.id]["writer_id"]).nick, id = str(message.guild.get_member(recruit_message[message.id]["writer_id"])))
if(isFull):
users = recruit_message[message.id]["users"]
lottery_user = recruit_message[message.id]["lottery_user"]
title = recruit_message[message.id]["title"]
room = recruit_message[message.id]["room"]
writer_id = recruit_message[message.id]["writer_id"]
del recruit_message[message.id]
if(lottery_user != -1 and len(users) >= lottery_user):
users = random.sample(users, lottery_user)
full_users = users + [writer_id]
for user_id in users:
if(bot.get_user(user_id) != None):
if(message.guild.get_member(user_id).nick != None):
users_str += "\n{name} [{id}]".format(name = message.guild.get_member(user_id).nick, id = str(message.guild.get_member(user_id)))
else:
users_str += "\n{name} [{id}]".format(name = message.guild.get_member(user_id).name, id = str(message.guild.get_member(user_id)))
users_str.rstrip()
for user_id in users:
if(bot.get_user(user_id) != None):
if(user_id not in lastest_recruit_data and len(lastest_recruit_data) >= cache_limit):
del lastest_recruit_data[lastest_recruit_data.keys()[0]]
lastest_recruit_data[user_id] = { "title" : title, "users" : full_users }
if(room != "-1"):
await message.guild.get_member(user_id).send("{}の部屋番号は {} です".format(title, room))
if(writer_id not in lastest_recruit_data and len(lastest_recruit_data) >= cache_limit):
del lastest_recruit_data[lastest_recruit_data.keys()[0]]
lastest_recruit_data[writer_id] = { "title" : title, "users" : full_users }
await message.edit(content = (title + " 募集終了\n```\n{} ```".format(users_str)))
await message.remove_reaction("⬆️", bot.user)
await message.remove_reaction("⬇️", bot.user)
await message.remove_reaction("✖", bot.user)
else:
for user_id in recruit_message[message.id]["users"]:
if(bot.get_user(user_id) != None):
if(message.guild.get_member(user_id).nick != None):
users_str += "\n{name} [{id}]".format(name = message.guild.get_member(user_id).nick, id = str(message.guild.get_member(user_id)))
else:
users_str += "\n{name} [{id}]".format(name = message.guild.get_member(user_id).name, id = str(message.guild.get_member(user_id)))
else:
recruit_message[message.id]["users"].remove(user_id)
users_str.rstrip()
rec_text = "募集中!"
if(recruit_message[message.id]["lottery_user"] != -1):
rec_text = "募集中!(抽選 {}人->{}人)".format(recruit_message[message.id]["max_user"], recruit_message[message.id]["lottery_user"])
await message.edit(content = (recruit_message[message.id]["title"] + " {rec_text} @{count}人(↑で参加 ↓で退出)\n```\n{str} ```".format(rec_text = rec_text, count = recruit_message[message.id]["max_user"] - len(recruit_message[message.id]["users"]), str = users_str)))
recruit_message[message.id]["raw_message"] = message
@bot.command()
async def r(ctx, room_id = "-1"):
sender_id = ctx.message.author.id
if(sender_id in lastest_recruit_data and room_id != -1):
title = lastest_recruit_data[sender_id]["title"]
users = lastest_recruit_data[sender_id]["users"]
notify_txt = ""
for user_id in users:
notify_txt += ctx.message.guild.get_member(user_id).mention + " "
if(user_id != sender_id):
await ctx.message.guild.get_member(user_id).send("{}の新しい部屋番号は {} です".format(title, room_id))
await ctx.send(notify_txt + "新しい部屋番号を送信しました")
await ctx.message.delete()
elif(bot.get_user(sender_id) != None):
await ctx.send("{} 最後に参加した部屋が存在しないか、古すぎます。".format(bot.get_user(sender_id).mention))
await ctx.message.delete()
@bot.command()
async def s(ctx, room_id = "-1", title = "", max_user = 2, remain_time = 300):
users_str = "{name} [{id}]".format(name = ctx.message.author.name, id = str(ctx.message.author))
if(ctx.message.author.nick != None):
users_str = "{name} [{id}]".format(name = ctx.message.author.nick, id = str(ctx.message.author))
users_str.rstrip("")
mes = await ctx.send(title + " 募集中! @{count}人(↑で参加 ↓で退出)\n```\n{str} ```".format(count = max_user, str = users_str))
recruit_message[mes.id] = { "room" : room_id, "time" : remain_time, "max_user" : max_user, "writer_id" : ctx.message.author.id, "title" : title, "users" : [], "raw_message" : mes, "lottery_user" : -1 }
await ctx.message.delete()
await mes.add_reaction("⬆️")
await mes.add_reaction("⬇️")
await mes.add_reaction("✖")
@bot.command()
async def l(ctx, room_id = "-1", title = "", max_user = 5, lottery_user = 2, remain_time = 300):
users_str = "{name} [{id}]".format(name = ctx.message.author.name, id = str(ctx.message.author))
if(ctx.message.author.nick != None):
users_str = "{name} [{id}]".format(name = ctx.message.author.nick, id = str(ctx.message.author))
users_str.rstrip("")
mes = await ctx.send(title + " 募集中!(抽選 {max_user}人->{lottery_user}人) @{count}人(↑で参加 ↓で退出)\n```\n{str} ```".format(max_user = max_user, lottery_user = lottery_user, count = max_user, str = users_str))
recruit_message[mes.id] = { "room" : room_id, "time" : 300, "max_user" : max_user, "writer_id" : ctx.message.author.id, "title" : title, "users" : [], "raw_message" : mes, "lottery_user" : lottery_user }
await ctx.message.delete()
await mes.add_reaction("⬆️")
await mes.add_reaction("⬇️")
await mes.add_reaction("✖")
@bot.command()
async def s1(ctx, room_id = "-1", title = ""):
users_str = "{name} [{id}]".format(name = ctx.message.author.name, id = str(ctx.message.author))
if(ctx.message.author.nick != None):
users_str = "{name} [{id}]".format(name = ctx.message.author.nick, id = str(ctx.message.author))
users_str.rstrip("")
mes = await ctx.send(title + " 募集中! @{count}人(↑で参加 ↓で退出)\n```\n{str} ```".format(count = 1, str = users_str))
recruit_message[mes.id] = { "room" : room_id, "time" : 300, "max_user" : 1, "writer_id" : ctx.message.author.id, "title" : title, "users" : [], "raw_message" : mes, "lottery_user" : -1 }
await ctx.message.delete()
await mes.add_reaction("⬆️")
await mes.add_reaction("⬇️")
await mes.add_reaction("✖")
async def disconnect_timer():
while True:
for mes_key in list(recruit_message.keys()):
if(mes_key in recruit_message):
mes = recruit_message[mes_key]["raw_message"]
recruit_message[mes_key]["time"] = recruit_message[mes_key]["time"] - 1
if(recruit_message[mes_key]["time"] <= 0):
users = recruit_message[mes_key]["users"]
title = recruit_message[mes_key]["title"]
room = recruit_message[mes_key]["room"]
writer_id = recruit_message[mes_key]["writer_id"]
lottery_user = recruit_message[mes_key]["lottery_user"]
if(lottery_user != -1 and len(users) >= lottery_user):
users = random.sample(users, lottery_user)
full_users = users + [writer_id]
del recruit_message[mes_key]
users_str = "{name} [{id}]".format(name = mes.guild.get_member(writer_id).name, id = str(mes.guild.get_member(writer_id)))
if(mes.guild.get_member(writer_id).nick != None):
users_str = "{name} [{id}]".format(name = mes.guild.get_member(writer_id).nick, id = str(mes.guild.get_member(writer_id)))
for user_id in users:
if(bot.get_user(user_id) != None):
if(user_id not in lastest_recruit_data and len(lastest_recruit_data) >= cache_limit):
del lastest_recruit_data[lastest_recruit_data.keys()[0]]
lastest_recruit_data[user_id] = { "title" : title, "users" : full_users }
if(room != "-1"):
await mes.guild.get_member(user_id).send("{}の部屋番号は {} です".format(title, room))
if(mes.guild.get_member(user_id).nick != None):
users_str += "\n{name} [{id}]".format(name = mes.guild.get_member(user_id).nick, id = str(mes.guild.get_member(user_id)))
else:
users_str += "\n{name} [{id}]".format(name = mes.guild.get_member(user_id).name, id = str(mes.guild.get_member(user_id)))
else:
users.remove(user_id)
users_str.rstrip()
if(writer_id not in lastest_recruit_data and len(lastest_recruit_data) >= cache_limit):
del lastest_recruit_data[lastest_recruit_data.keys()[0]]
lastest_recruit_data[writer_id] = { "title" : title, "users" : full_users }
await mes.edit(content = (title + " 募集終了\n```\n{} ```".format(users_str)))
await mes.remove_reaction("⬆️", bot.user)
await mes.remove_reaction("⬇️", bot.user)
await mes.remove_reaction("✖", bot.user)
await asyncio.sleep(1)
@bot.event
async def on_ready():
print('Logged in as')
print(bot.user.name)
print(bot.user.id)
print('------')
async def startup():
global bot
await bot.login(token, bot=True)
await bot.connect()
bot.clear()
async def logout():
global bot
await bot.close()"""
print("TEST")
| 50.639024
| 262
| 0.684134
| 1,570
| 10,381
| 4.332484
| 0.082803
| 0.102911
| 0.101882
| 0.111585
| 0.788886
| 0.711702
| 0.665099
| 0.623934
| 0.600265
| 0.572038
| 0
| 0.004677
| 0.134958
| 10,381
| 204
| 263
| 50.887255
| 0.748552
| 1.344186
| 0
| 0
| 0
| 0
| 0.266667
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
3cf4d0c01b46fc2c20309eed479e47bb5c129348
| 298
|
py
|
Python
|
chatpush/routes.py
|
yijianduanlang/n95-py
|
6efefe9497ed95a75c7712323a85daec7eb7f3aa
|
[
"MIT"
] | 357
|
2020-02-08T07:07:18.000Z
|
2022-03-26T02:44:53.000Z
|
chatpush/routes.py
|
tavernier/N95-watcher
|
6efefe9497ed95a75c7712323a85daec7eb7f3aa
|
[
"MIT"
] | 14
|
2020-02-10T08:12:58.000Z
|
2022-03-12T00:15:19.000Z
|
chatpush/routes.py
|
tavernier/N95-watcher
|
6efefe9497ed95a75c7712323a85daec7eb7f3aa
|
[
"MIT"
] | 107
|
2020-02-08T13:26:27.000Z
|
2022-03-05T04:38:26.000Z
|
from flask import Blueprint
from flask import render_template
route_bp = Blueprint('route', __name__)
@route_bp.route('/')
def index():
# 显示登陆状态
# return 'Hello, World!'
return render_template('index.html')
# 发送消息
@route_bp.route('/send', methods=['POST'])
def send_msg():
pass
| 17.529412
| 42
| 0.684564
| 39
| 298
| 4.974359
| 0.564103
| 0.108247
| 0.154639
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.167785
| 298
| 16
| 43
| 18.625
| 0.782258
| 0.114094
| 0
| 0
| 0
| 0
| 0.096154
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.222222
| false
| 0.111111
| 0.222222
| 0.111111
| 0.555556
| 0.222222
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
|
0
| 4
|
3cf5090490f94b4c3a743da9ad9fffafbe907b05
| 64
|
py
|
Python
|
dartcms/apps/feedback/__init__.py
|
astrikov-d/dartcms
|
41af3ecfcff73d3fb6a483e3a6ca1c4acb6278fa
|
[
"MIT"
] | 26
|
2015-01-12T09:47:32.000Z
|
2021-04-15T14:09:49.000Z
|
dartcms/apps/feedback/__init__.py
|
astrikov-d/dartcms
|
41af3ecfcff73d3fb6a483e3a6ca1c4acb6278fa
|
[
"MIT"
] | 41
|
2016-07-04T06:55:31.000Z
|
2019-07-31T14:11:53.000Z
|
dartcms/apps/feedback/__init__.py
|
astrikov-d/dartcms
|
41af3ecfcff73d3fb6a483e3a6ca1c4acb6278fa
|
[
"MIT"
] | 12
|
2015-01-20T09:51:53.000Z
|
2021-01-26T16:51:47.000Z
|
default_app_config = 'dartcms.apps.feedback.apps.FeedbackConfig'
| 64
| 64
| 0.859375
| 8
| 64
| 6.625
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.03125
| 64
| 1
| 64
| 64
| 0.854839
| 0
| 0
| 0
| 0
| 0
| 0.630769
| 0.630769
| 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
|
a7159c33c96a291d264d417146206d4597c6b06d
| 3,175
|
py
|
Python
|
pull_simulation/MuTracSimulation.py
|
KeenanNS/MuTrac
|
a13f3ba307524a6bd212f519ad7a296592151a32
|
[
"MIT"
] | 1
|
2020-09-08T00:48:38.000Z
|
2020-09-08T00:48:38.000Z
|
pull_simulation/MuTracSimulation.py
|
KeenanNS/MuTrac
|
a13f3ba307524a6bd212f519ad7a296592151a32
|
[
"MIT"
] | 1
|
2020-10-01T14:14:43.000Z
|
2020-10-01T14:14:43.000Z
|
pull_simulation/MuTracSimulation.py
|
KeenanNS/MuTrac
|
a13f3ba307524a6bd212f519ad7a296592151a32
|
[
"MIT"
] | null | null | null |
#This is a Simulation of a tractor pull and is the property of the McGill University Trcator Pulling Team. Contact keenan.simpson1999@gmail.com if you wish to use this software.
import numpy as np
import math
GRAVITY = 10 # lol
BASE_RATIO = 11.7 # engine rpm to motor rpm
MAX_DISPLACEMENT = 0.009 # flow rate of oil in m^3
TIRE_DIAMETER = 1 # meter this is also wrong
class Tractor:
def __init__(self, length, mass, hitch_height):
self.length = length #meters
self.mass = mass #grams
self.tire_diameter = 4 # example
self.exampleConstantProperty = 69 # this one is constant and is not taken as an argument
self.displacement = None
# etc just add stuff you need
def get_displacement(self, theta):
self.displacement = theta * MAX_DISPLACEMENT
return theta * MAX_DISPLACEMENT
def get_weight(self):
return self.mass * GRAVITY
def get_rpms(self):
#TODO this should be a function of load etc
return 3600.0
#this is new work, idk how to do this. You probably need to look at documents or run an experiment
def max_available_power(self, theta):
peak_power = 61591000 - 49681800 / theta - 4866 * math.log(theta)
peak_power = peak_power * 4.86 - 2184 / self.get_rpms() - 0.440 * math.log(self.get_rpms())
return peak_power # in watts
# this is where autopull comes into play. theta is a fraction we adjust to compensate for load. as of now it is always 1
def get_requested_power(self, theta, load):
return self.get_rpms() * self.get_displacement(theta) * load
def get_distance_from_displacement(self): # this is wheere you'll determine your time base
return self.displacement * BASE_RATIO * TIRE_DIAMETER
class PullingSurface:
def __init__(self, hydration, temperature): # idk what we'll need and this is more advanced. probably just use one default surface
pass
def get_tire_friction(self):
return 1 # coefficient of friction for now just google what it is for tractors on dirt
def get_sled_friction(self):
return 0.4 # same as above but for the sled plate
class Sled:
def __init__(self, rate_of_increase, starting_weight):
self.rate_of_increase = rate_of_increase
self.starting_weight = starting_weight
def get_current_load(self, current_position):
return self.starting_weight + self.rate_of_increase * current_position # load increases per meter this is wrong it should be based on friction
## this is the dynamics part and is where it gets actually complicated with momentum and such. That, I'll leave to you
def get_net_force():
pass
# at each time step you need to determine the load of the sled
MH2 = Tractor(1,1,1) # this is where the __init__ method gets called
sled = Sled(100, 10000)
current_position = 0
# for now, have this run and output a reasonable number ~ 100 meters, but talk to shamus and john about it. Find the all the constants you need (max displacement etc. )
while(1):
sled_load = sled.get_current_load(current_position)
#rint(MH2.get_requested_power(1, sled_load),MH2.max_available_power(1))
if(MH2.get_requested_power(1, sled_load) < MH2.max_available_power(1)):
current_position += MH2.get_distance_from_displacement()
else:
break
print(current_position)
| 34.89011
| 177
| 0.760315
| 521
| 3,175
| 4.47025
| 0.385797
| 0.023186
| 0.024045
| 0.023186
| 0.070416
| 0.070416
| 0.042937
| 0.042937
| 0.042937
| 0.042937
| 0
| 0.031939
| 0.171654
| 3,175
| 90
| 178
| 35.277778
| 0.853612
| 0.440315
| 0
| 0.037736
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.011111
| 0
| 1
| 0.245283
| false
| 0.037736
| 0.037736
| 0.132075
| 0.509434
| 0.018868
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
5970b6ef9ca6084477653f882601edcae51a1ad4
| 52
|
py
|
Python
|
YikYak_Frequency/yaklient/api/__init__.py
|
dpeters1/YakFrequency
|
f9dd504ed0dfc3667bddf046643d5feb1c9add91
|
[
"MIT"
] | null | null | null |
YikYak_Frequency/yaklient/api/__init__.py
|
dpeters1/YakFrequency
|
f9dd504ed0dfc3667bddf046643d5feb1c9add91
|
[
"MIT"
] | null | null | null |
YikYak_Frequency/yaklient/api/__init__.py
|
dpeters1/YakFrequency
|
f9dd504ed0dfc3667bddf046643d5feb1c9add91
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
"""Treat api as package"""
| 13
| 26
| 0.519231
| 7
| 52
| 3.857143
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02381
| 0.192308
| 52
| 3
| 27
| 17.333333
| 0.619048
| 0.826923
| 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
|
59ae1449f997f448ca273bf2c49875b0e9db7e37
| 181
|
py
|
Python
|
buyfree_mall/buyfree_mall/apps/orders/tests.py
|
GalphaXie/E-commerce
|
e358089c8002739b121cf7ced7d27b093303de94
|
[
"MIT"
] | null | null | null |
buyfree_mall/buyfree_mall/apps/orders/tests.py
|
GalphaXie/E-commerce
|
e358089c8002739b121cf7ced7d27b093303de94
|
[
"MIT"
] | null | null | null |
buyfree_mall/buyfree_mall/apps/orders/tests.py
|
GalphaXie/E-commerce
|
e358089c8002739b121cf7ced7d27b093303de94
|
[
"MIT"
] | null | null | null |
from django.test import TestCase
# Create your tests here.
"""
表单设计--关键点:
- 1.用特殊的订单编号(指明primary_key) 来代替 自增主键
- 2. decimal 来 控制精度
- 3. choice 枚举
回滚 注意点:
- 数据库出现异常才会回滚
"""
| 9.526316
| 36
| 0.668508
| 27
| 181
| 4.444444
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.020979
| 0.209945
| 181
| 19
| 37
| 9.526316
| 0.818182
| 0.127072
| 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
|
59dec281be8afa686bb7cb756c272ad0da57523b
| 1,652
|
py
|
Python
|
model/metric.py
|
zichang06/CR_PC_PCN
|
690af01efd5934227723e6ff60b0abb7a1679f60
|
[
"MIT"
] | null | null | null |
model/metric.py
|
zichang06/CR_PC_PCN
|
690af01efd5934227723e6ff60b0abb7a1679f60
|
[
"MIT"
] | null | null | null |
model/metric.py
|
zichang06/CR_PC_PCN
|
690af01efd5934227723e6ff60b0abb7a1679f60
|
[
"MIT"
] | null | null | null |
import torch
import torch.nn as nn
# 平均误差率 平均绝对百分比误差(Mean Absolute Percentage Error)
def MAPE(output, target):
return torch.mean(torch.abs((target - output) / target))
def MAPE0(output, target):
return torch.mean(torch.abs((target[:,0] - output[:,0]) / target[:,0]))
def MAPE1(output, target):
return torch.mean(torch.abs((target[:,1] - output[:,1]) / target[:,1]))
def MAPE2(output, target):
return torch.mean(torch.abs((target[:,2] - output[:,2]) / target[:,2]))
def MAPE3(output, target):
return torch.mean(torch.abs((target[:,3] - output[:,3]) / target[:,3]))
def MAPE4(output, target):
return torch.mean(torch.abs((target[:,4] - output[:,4]) / target[:,4]))
def MAPE5(output, target):
return torch.mean(torch.abs((target[:,5] - output[:,5]) / target[:,5]))
def MAPE6(output, target):
return torch.mean(torch.abs((target[:,6] - output[:,6]) / target[:,6]))
def MSE(output, target):
criterion = nn.MSELoss() # ??? 不能直接 return nn.MSELoss(output, target)
return criterion(output, target)
def accuracy(output, target):
with torch.no_grad():
pred = torch.argmax(output, dim=1)
assert pred.shape[0] == len(target)
correct = 0
correct += torch.sum(pred == target).item()
return correct / len(target)
def top_k_acc(output, target, k=3):
with torch.no_grad():
pred = torch.topk(output, k, dim=1)[1]
assert pred.shape[0] == len(target)
correct = 0
for i in range(k):
correct += torch.sum(pred[:, i] == target).item()
return correct / len(target)
| 37.545455
| 82
| 0.595036
| 223
| 1,652
| 4.390135
| 0.246637
| 0.171604
| 0.165475
| 0.187947
| 0.518897
| 0.518897
| 0.404494
| 0.404494
| 0.069459
| 0
| 0
| 0.028037
| 0.22276
| 1,652
| 43
| 83
| 38.418605
| 0.734424
| 0.054479
| 0
| 0.222222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.055556
| 1
| 0.305556
| false
| 0
| 0.055556
| 0.222222
| 0.666667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
ab7a4b08af97494b841c9a0e0e36d70b9e24f3ba
| 928
|
py
|
Python
|
tests/conftest.py
|
fferegrino/send-to-kindle
|
21d19858e9f438bfa8c335bd6759dc280918b23c
|
[
"MIT"
] | null | null | null |
tests/conftest.py
|
fferegrino/send-to-kindle
|
21d19858e9f438bfa8c335bd6759dc280918b23c
|
[
"MIT"
] | 8
|
2019-09-07T08:37:19.000Z
|
2021-12-13T20:31:34.000Z
|
tests/conftest.py
|
fferegrino/send-to-kindle
|
21d19858e9f438bfa8c335bd6759dc280918b23c
|
[
"MIT"
] | 1
|
2019-11-04T10:36:56.000Z
|
2019-11-04T10:36:56.000Z
|
import pytest
from pathlib import Path
from bs4 import BeautifulSoup
@pytest.fixture
def from_email():
return "from@mail.com"
@pytest.fixture
def to_email():
return "to@mail.com"
@pytest.fixture
def subject():
return "subject"
@pytest.fixture
def password():
return "password"
@pytest.fixture
def host():
return "localhost"
@pytest.fixture
def port():
return 1234
@pytest.fixture
def attachment_path():
return Path("/fakepath")
@pytest.fixture(scope="session")
def get_file_content(pytestconfig):
def inner(file, mode="r"):
file_path = Path(pytestconfig.rootdir, "tests", file)
with open(file_path, mode) as readable:
return readable.read()
return inner
@pytest.fixture(scope="session")
def get_soup(get_file_content):
def inner(file):
content = get_file_content(file)
return BeautifulSoup(content, "lxml")
return inner
| 16
| 61
| 0.684267
| 117
| 928
| 5.324786
| 0.34188
| 0.187801
| 0.179775
| 0.064205
| 0.173355
| 0.099518
| 0
| 0
| 0
| 0
| 0
| 0.006739
| 0.200431
| 928
| 57
| 62
| 16.280702
| 0.832884
| 0
| 0
| 0.297297
| 0
| 0
| 0.087284
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.297297
| false
| 0.054054
| 0.081081
| 0.189189
| 0.675676
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
|
0
| 4
|
ab7f3c63133a776676692f0b107b284e07fff8dd
| 449
|
py
|
Python
|
hello_world/services/variant_service.py
|
LeopoldTal/ned-kelly-criterion
|
46c636f940736d4d03a236ccea5a56af7f353323
|
[
"MIT"
] | null | null | null |
hello_world/services/variant_service.py
|
LeopoldTal/ned-kelly-criterion
|
46c636f940736d4d03a236ccea5a56af7f353323
|
[
"MIT"
] | null | null | null |
hello_world/services/variant_service.py
|
LeopoldTal/ned-kelly-criterion
|
46c636f940736d4d03a236ccea5a56af7f353323
|
[
"MIT"
] | null | null | null |
from ..orm import Variant
from ..db import get_variant_by_id
def get_variant_for_user(variant_id : int, user_id : int) -> Variant:
variant = get_variant_by_id(variant_id)
if variant is None:
return None
if variant.experiment.user_id != user_id:
return None
return variant
def record_variant_success(variant_id : int, user_id : int) -> None:
# TODO
pass
def record_variant_failure(variant_id : int, user_id : int) -> None:
# TODO
pass
| 23.631579
| 69
| 0.750557
| 73
| 449
| 4.315068
| 0.30137
| 0.095238
| 0.114286
| 0.152381
| 0.27619
| 0.27619
| 0.209524
| 0.209524
| 0.209524
| 0
| 0
| 0
| 0.162584
| 449
| 18
| 70
| 24.944444
| 0.837766
| 0.020045
| 0
| 0.307692
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.055556
| 0
| 1
| 0.230769
| false
| 0.153846
| 0.153846
| 0
| 0.615385
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
ab94cb9d8a6f3b63819efa266ddcbee85c256adf
| 9,050
|
py
|
Python
|
tests/board-test.py
|
MatMoore/Connection
|
1b77879908c22a3caff43cc0e48077b5b5b0222a
|
[
"Unlicense"
] | null | null | null |
tests/board-test.py
|
MatMoore/Connection
|
1b77879908c22a3caff43cc0e48077b5b5b0222a
|
[
"Unlicense"
] | null | null | null |
tests/board-test.py
|
MatMoore/Connection
|
1b77879908c22a3caff43cc0e48077b5b5b0222a
|
[
"Unlicense"
] | null | null | null |
#!/usr/bin/python
# Unit tests for board.py
import unittest
from board import *
from game import Move
import copy
class Player(object):
def __init__(self, bla):
self.bla = bla
class BoardSizeTest(unittest.TestCase):
'''Check that different sized boards can be created'''
def testSquare(self):
'''Check square boards between 2 and 50 work'''
for i in range(3,51):
theboard = RectangularBoard((i,i))
self.assertTrue(theboard is not None)
self.assertEquals(theboard.get_size(), (i,i))
def testBadSize(self):
'''Check that silly sized boards don't work'''
for i in (-1,0,1,2):
self.assertRaises(SizeError, RectangularBoard, (i,i))
def testRectangular(self):
'''Check a couple of rectangular boards'''
for shape in ((9,13),(10,5),(21,6)):
theboard = RectangularBoard(shape)
self.assertTrue(theboard is not None)
self.assertEquals(theboard.get_size(), shape)
class BoardTest(unittest.TestCase):
def setUp(self):
self.board = RectangularBoard((19,19))
self.black = Player('black')
self.white = Player('white')
class GroupTest(BoardTest):
def testConnectedStones(self):
'''Check connected stones are grouped together'''
self.board.place_stone(Move((1,1),self.black))
self.board.place_stone(Move((1,2),self.black))
self.board.place_stone(Move((1,3),self.black))
group1 = Group(self.board,(1,1))
group2 = Group(self.board,(1,2))
group3 = Group(self.board,(1,3))
self.assertEquals(group1, group2, group3)
self.assertTrue((1,1) in group1.stones)
self.assertTrue((1,2) in group1.stones)
self.assertTrue((1,3) in group1.stones)
# def testLibertiesCorner(self):
# '''Check the number of liberties of a group is correct for a corner group'''
# self.board.place_stone(Move((0,0),self.black))
# self.board.place_stone(Move((0,1),self.black))
# self.board.place_stone(Move((0,2),self.black))
# group1 = Group(self.board,(0,0))
# self.assertEquals(group1.liberties, 4)
#
# def testLibertiesSide(self):
# '''Check the number of liberties of a group is correct for a side group'''
# self.board.place_stone(Move((0,3),self.black))
# self.board.place_stone(Move((0,1),self.black))
# self.board.place_stone(Move((0,2),self.black))
# group1 = Group(self.board,(0,3))
# self.assertEquals(group1.liberties, 5)
#
# def testLibertiesCenter(self):
# '''Check the number of liberties of a group is correct for a center group'''
# self.board.place_stone(Move((2,4),self.black))
# self.board.place_stone(Move((2,2),self.black))
# self.board.place_stone(Move((2,3),self.black))
# group1 = Group(self.board,(2,4))
# self.assertEquals(group1.liberties, 8)
def testLibertiesSurrounded(self):
'''Check the number of liberties of a group is zero when surrounded'''
self.board.place_stone(Move((0,0),self.black))
self.board.place_stone(Move((0,1),self.black))
self.board.place_stone(Move((0,2),self.black))
self.board.place_stone(Move((0,3),self.white))
self.board.place_stone(Move((1,0),self.white))
self.board.place_stone(Move((1,1),self.white))
self.board.place_stone(Move((1,2),self.white))
group1 = Group(self.board,(0,0))
self.assertEquals(group1.liberties, False)
def testMarkingDeadStone(self):
'''Mark as dead a single black stone'''
# b w w
# . w w
# w w w
self.board.place_stone(Move((0,0),self.black))
self.board.place_stone(Move((0,2),self.white))
self.board.place_stone(Move((1,2),self.white))
self.board.place_stone(Move((1,1),self.white))
self.board.place_stone(Move((1,0),self.white))
self.board.place_stone(Move((2,0),self.white))
self.board.place_stone(Move((2,1),self.white))
self.board.place_stone(Move((2,2),self.white))
self.board.toggle_dead((0,0))
player,state = self.board.get_point((0,0))
self.assertEquals(state, DEAD_STONE)
self.assertEquals(player, self.black)
def testMarkingDeadGroup(self):
'''Mark as dead a connected black group'''
# b w w
# b . w
# w w w
self.board.place_stone(Move((0,0),self.black))
self.board.place_stone(Move((0,1),self.black))
self.board.place_stone(Move((0,2),self.white))
self.board.place_stone(Move((1,2),self.white))
self.board.place_stone(Move((1,0),self.white))
self.board.place_stone(Move((2,0),self.white))
self.board.place_stone(Move((2,1),self.white))
self.board.place_stone(Move((2,2),self.white))
self.board.toggle_dead((0,0))
player,state = self.board.get_point((0,0))
self.assertEquals(state, DEAD_STONE)
self.assertEquals(player, self.black)
player,state = self.board.get_point((0,1))
self.assertEquals(state, DEAD_STONE)
self.assertEquals(player, self.black)
player,state = self.board.get_point((1,0))
self.assertEquals(state, STONE)
self.assertEquals(player, self.white)
self.assertTrue(self.board.get_point((1,1)) is None)
def testUnmarkingDeadGroup(self):
'''Unmark a connected group currently marked dead'''
# b w w
# b . w
# w w w
self.board.place_stone(Move((0,0),self.black))
self.board.place_stone(Move((0,1),self.black))
self.board.place_stone(Move((0,2),self.white))
self.board.place_stone(Move((1,2),self.white))
self.board.place_stone(Move((1,0),self.white))
self.board.place_stone(Move((2,0),self.white))
self.board.place_stone(Move((2,1),self.white))
self.board.place_stone(Move((2,2),self.white))
board_copy = copy.copy(self.board)
self.board.toggle_dead((0,0))
self.board.toggle_dead((0,1))
player,state = self.board.get_point((0,0))
self.assertEquals(state, STONE)
self.assertEquals(player, self.black)
player,state = self.board.get_point((0,1))
self.assertEquals(state, STONE)
self.assertEquals(player, self.black)
self.assertEquals(self.board, board_copy)
def testMarkingDeadSubgroup(self):
'''Mark as dead distinct black groups linked through black territory'''
# b . b w
# . b w w
# b b w w
# w w w w
self.board.place_stone(Move((0,0),self.black))
self.board.place_stone(Move((0,2),self.black))
self.board.place_stone(Move((0,3),self.white))
self.board.place_stone(Move((1,1),self.black))
self.board.place_stone(Move((1,2),self.black))
self.board.place_stone(Move((1,3),self.white))
self.board.place_stone(Move((2,0),self.black))
self.board.place_stone(Move((2,1),self.white))
self.board.place_stone(Move((2,2),self.white))
self.board.place_stone(Move((2,3),self.white))
self.board.place_stone(Move((3,0),self.white))
self.board.place_stone(Move((3,1),self.white))
self.board.place_stone(Move((3,2),self.white))
self.board.place_stone(Move((3,3),self.white))
# Mark territory
self.board.set_territory((0,1),self.black)
self.board.set_territory((1,0),self.black)
self.board.toggle_dead((0,0))
player,state = self.board.get_point((0,0))
self.assertEquals(state, DEAD_STONE)
self.assertEquals(player, self.black)
player,state = self.board.get_point((0,2))
self.assertEquals(state, DEAD_STONE)
self.assertEquals(player, self.black)
player,state = self.board.get_point((2,0))
self.assertEquals(state, DEAD_STONE)
self.assertEquals(player, self.black)
player,state = self.board.get_point((1,1))
self.assertEquals(state, DEAD_STONE)
self.assertEquals(player, self.black)
player,state = self.board.get_point((1,2))
self.assertEquals(state, DEAD_STONE)
self.assertEquals(player, self.black)
def testMarkingDistinctGroup(self):
'''Mark as dead distinct black groups that are divided by neutral territory'''
# b b w
# . . w
# b b w
# w w w
pass
def testTerritory(self):
# b . w
# . b w
# b w .
self.board.place_stone(Move((0,0),self.black))
self.board.place_stone(Move((0,2),self.black))
self.board.place_stone(Move((1,1),self.black))
self.board.place_stone(Move((1,2),self.white))
self.board.place_stone(Move((2,0),self.white))
self.board.place_stone(Move((2,1),self.white))
self.board.mark_territory()
self.assertTrue(self.board.get_territory((0,1)) is self.black)
self.assertTrue(self.board.get_territory((1,0)) is None)
self.assertTrue(self.board.get_territory((2,2)) is None)
def testBigTerritory(self):
# b . w
# . b w
# . b w
# b w .
# w . .
self.board.place_stone(Move((0,0),self.black))
self.board.place_stone(Move((0,3),self.black))
self.board.place_stone(Move((0,4),self.white))
self.board.place_stone(Move((1,1),self.black))
self.board.place_stone(Move((1,2),self.black))
self.board.place_stone(Move((1,3),self.white))
self.board.place_stone(Move((2,0),self.white))
self.board.place_stone(Move((2,1),self.white))
self.board.place_stone(Move((2,2),self.white))
self.board.mark_territory()
self.assertTrue(self.board.get_territory((0,1)) is self.black)
self.assertTrue(self.board.get_territory((0,2)) is self.black)
self.assertTrue(self.board.get_territory((1,0)) is None)
self.assertTrue(self.board.get_territory((2,3)) is self.white)
def testTerritoryDeadStones(self):
pass
def suite():
suite1 = unittest.makeSuite(BoardSizeTest)
suite2 = unittest.makeSuite(GroupTest)
alltests = unittest.TestSuite((suite1, suite2))
return alltests
if __name__ == "__main__":
unittest.main()
| 35.770751
| 80
| 0.709945
| 1,467
| 9,050
| 4.29516
| 0.100205
| 0.157118
| 0.159975
| 0.217108
| 0.738772
| 0.72671
| 0.703222
| 0.679733
| 0.645929
| 0.627202
| 0
| 0.03283
| 0.114807
| 9,050
| 252
| 81
| 35.912698
| 0.753714
| 0.190608
| 0
| 0.558824
| 0
| 0
| 0.002493
| 0
| 0
| 0
| 0
| 0
| 0.241176
| 1
| 0.094118
| false
| 0.011765
| 0.023529
| 0
| 0.147059
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
aba4cce3ec70bf18c20853f1a06ad254355ddb7d
| 90
|
py
|
Python
|
ygo/message_handlers/retry.py
|
yncat/yugioh-game
|
90406c45d02325552df8a5a5ea3e25e055a14cb1
|
[
"MIT"
] | 23
|
2017-09-23T13:29:17.000Z
|
2022-03-02T19:03:11.000Z
|
ygo/message_handlers/retry.py
|
yncat/yugioh-game
|
90406c45d02325552df8a5a5ea3e25e055a14cb1
|
[
"MIT"
] | 160
|
2017-09-15T13:24:30.000Z
|
2022-02-11T15:10:34.000Z
|
ygo/message_handlers/retry.py
|
yncat/yugioh-game
|
90406c45d02325552df8a5a5ea3e25e055a14cb1
|
[
"MIT"
] | 21
|
2017-09-15T13:17:29.000Z
|
2022-01-31T09:28:06.000Z
|
def msg_retry(self, buf):
print("retry")
return buf[1:]
MESSAGES = {1: msg_retry}
| 15
| 26
| 0.633333
| 14
| 90
| 3.928571
| 0.642857
| 0.290909
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.027778
| 0.2
| 90
| 5
| 27
| 18
| 0.736111
| 0
| 0
| 0
| 0
| 0
| 0.058824
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 0
| 0.5
| 0.25
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
aba4d3fcfbf22a2b4b56760343d6ee6cd252c43f
| 87
|
py
|
Python
|
gitapp/apps.py
|
diyajaiswal11/GithubAPI
|
f4fe2a09b41cd34b3bd6565c9b1f1419a3229ce3
|
[
"MIT"
] | 11
|
2020-08-19T20:12:08.000Z
|
2021-09-10T06:12:16.000Z
|
gitapp/apps.py
|
diyajaiswal11/GithubAPI
|
f4fe2a09b41cd34b3bd6565c9b1f1419a3229ce3
|
[
"MIT"
] | 6
|
2020-08-17T21:52:09.000Z
|
2021-06-10T20:32:12.000Z
|
gitapp/apps.py
|
diyajaiswal11/GithubAPI
|
f4fe2a09b41cd34b3bd6565c9b1f1419a3229ce3
|
[
"MIT"
] | 1
|
2021-08-16T08:10:23.000Z
|
2021-08-16T08:10:23.000Z
|
from django.apps import AppConfig
class GitappConfig(AppConfig):
name = 'gitapp'
| 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
|
abc50969a15fe9f5f9aac398f643d0458238453a
| 1,463
|
py
|
Python
|
sdk/python/pulumi_azure_native/dataprotection/__init__.py
|
polivbr/pulumi-azure-native
|
09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7
|
[
"Apache-2.0"
] | null | null | null |
sdk/python/pulumi_azure_native/dataprotection/__init__.py
|
polivbr/pulumi-azure-native
|
09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7
|
[
"Apache-2.0"
] | null | null | null |
sdk/python/pulumi_azure_native/dataprotection/__init__.py
|
polivbr/pulumi-azure-native
|
09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7
|
[
"Apache-2.0"
] | null | null | null |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
from .. import _utilities
import typing
# Export this package's modules as members:
from ._enums import *
from .backup_instance import *
from .backup_policy import *
from .backup_vault import *
from .get_backup_instance import *
from .get_backup_policy import *
from .get_backup_vault import *
from .get_resource_guard import *
from .resource_guard import *
from ._inputs import *
from . import outputs
# Make subpackages available:
if typing.TYPE_CHECKING:
import pulumi_azure_native.dataprotection.v20210101 as __v20210101
v20210101 = __v20210101
import pulumi_azure_native.dataprotection.v20210201preview as __v20210201preview
v20210201preview = __v20210201preview
import pulumi_azure_native.dataprotection.v20210601preview as __v20210601preview
v20210601preview = __v20210601preview
import pulumi_azure_native.dataprotection.v20210701 as __v20210701
v20210701 = __v20210701
else:
v20210101 = _utilities.lazy_import('pulumi_azure_native.dataprotection.v20210101')
v20210201preview = _utilities.lazy_import('pulumi_azure_native.dataprotection.v20210201preview')
v20210601preview = _utilities.lazy_import('pulumi_azure_native.dataprotection.v20210601preview')
v20210701 = _utilities.lazy_import('pulumi_azure_native.dataprotection.v20210701')
| 40.638889
| 100
| 0.806562
| 169
| 1,463
| 6.650888
| 0.35503
| 0.088968
| 0.120996
| 0.163701
| 0.441281
| 0.398577
| 0.177936
| 0
| 0
| 0
| 0
| 0.151254
| 0.12782
| 1,463
| 35
| 101
| 41.8
| 0.729624
| 0.157895
| 0
| 0
| 1
| 0
| 0.155102
| 0.155102
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.777778
| 0
| 0.777778
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
abdfa366b88c0b7f995e3013745469c6b78a4a90
| 163
|
py
|
Python
|
raipy/__init__.py
|
threemeninaboat3247/raipy
|
b924a950b40874107b6974c5e49eb24e3c97bf90
|
[
"MIT"
] | null | null | null |
raipy/__init__.py
|
threemeninaboat3247/raipy
|
b924a950b40874107b6974c5e49eb24e3c97bf90
|
[
"MIT"
] | null | null | null |
raipy/__init__.py
|
threemeninaboat3247/raipy
|
b924a950b40874107b6974c5e49eb24e3c97bf90
|
[
"MIT"
] | null | null | null |
from PyQt5.QtWidgets import QApplication
import sys
from raipy.GUI import GUIWindow
def exe():
app = QApplication(sys.argv)
ex=GUIWindow()
app.exec_()
| 20.375
| 40
| 0.730061
| 22
| 163
| 5.363636
| 0.681818
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.007463
| 0.177914
| 163
| 8
| 41
| 20.375
| 0.873134
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.142857
| false
| 0
| 0.428571
| 0
| 0.571429
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
e612910c506aa01e433126ad00baf6e655c2711c
| 80
|
py
|
Python
|
tests/__init__.py
|
taoteg/cookiecutter_process_test
|
98ff6d831dd8bac4bce66af6458cf9b116ffd1fd
|
[
"MIT"
] | null | null | null |
tests/__init__.py
|
taoteg/cookiecutter_process_test
|
98ff6d831dd8bac4bce66af6458cf9b116ffd1fd
|
[
"MIT"
] | 1
|
2021-11-15T17:48:49.000Z
|
2021-11-15T17:48:49.000Z
|
tests/__init__.py
|
taoteg/cookiecutter_process_test
|
98ff6d831dd8bac4bce66af6458cf9b116ffd1fd
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
"""Unit test package for cookiecutter_process_test."""
| 20
| 54
| 0.6625
| 10
| 80
| 5.1
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.014493
| 0.1375
| 80
| 3
| 55
| 26.666667
| 0.724638
| 0.8875
| 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
|
e6279f2c49f9c526442bcb74615ebb70218765af
| 74
|
py
|
Python
|
regression_model/regression_model/data_manager/data_validator.py
|
OuedraogoAbdoul/deploy_ml_model
|
e59fdc51e425cafe7b181eea5e3505ab99e0799d
|
[
"MIT"
] | null | null | null |
regression_model/regression_model/data_manager/data_validator.py
|
OuedraogoAbdoul/deploy_ml_model
|
e59fdc51e425cafe7b181eea5e3505ab99e0799d
|
[
"MIT"
] | null | null | null |
regression_model/regression_model/data_manager/data_validator.py
|
OuedraogoAbdoul/deploy_ml_model
|
e59fdc51e425cafe7b181eea5e3505ab99e0799d
|
[
"MIT"
] | null | null | null |
form regression_model.config.yml import
from strictyaml import YAML, load
| 37
| 40
| 0.851351
| 11
| 74
| 5.636364
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.108108
| 74
| 2
| 41
| 37
| 0.939394
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 1
| null | null | 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
e643006d267a7274b4878e1293ad18af6453352f
| 105
|
py
|
Python
|
genomicfeatures/apps.py
|
brand-fabian/varfish-server
|
6a084d891d676ff29355e72a29d4f7b207220283
|
[
"MIT"
] | 14
|
2019-09-30T12:44:17.000Z
|
2022-02-04T14:45:16.000Z
|
genomicfeatures/apps.py
|
brand-fabian/varfish-server
|
6a084d891d676ff29355e72a29d4f7b207220283
|
[
"MIT"
] | 244
|
2021-03-26T15:13:15.000Z
|
2022-03-31T15:48:04.000Z
|
genomicfeatures/apps.py
|
brand-fabian/varfish-server
|
6a084d891d676ff29355e72a29d4f7b207220283
|
[
"MIT"
] | 8
|
2020-05-19T21:55:13.000Z
|
2022-03-31T07:02:58.000Z
|
from django.apps import AppConfig
class GenomicFeaturesConfig(AppConfig):
name = "genomicfeatures"
| 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
|
e6474ef963083ef39deb04ca9adfeb188571238d
| 158
|
py
|
Python
|
tests/test_application.py
|
Bennu-Li/phantoscope
|
64445b83d155c9c4dc81d435ee1387c5ff1d2ee9
|
[
"Apache-2.0"
] | null | null | null |
tests/test_application.py
|
Bennu-Li/phantoscope
|
64445b83d155c9c4dc81d435ee1387c5ff1d2ee9
|
[
"Apache-2.0"
] | null | null | null |
tests/test_application.py
|
Bennu-Li/phantoscope
|
64445b83d155c9c4dc81d435ee1387c5ff1d2ee9
|
[
"Apache-2.0"
] | null | null | null |
import pytest
from test_basic import client
def test_get_application_list(client):
rv = client.get("/v1/application/")
assert rv.status_code == 200
| 19.75
| 39
| 0.746835
| 23
| 158
| 4.913043
| 0.695652
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.030075
| 0.158228
| 158
| 7
| 40
| 22.571429
| 0.819549
| 0
| 0
| 0
| 0
| 0
| 0.101266
| 0
| 0
| 0
| 0
| 0
| 0.2
| 1
| 0.2
| false
| 0
| 0.4
| 0
| 0.6
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
050e4f7a448378019eefd3d05e3d9d4beccafdef
| 514
|
py
|
Python
|
backend/interfaces.py
|
J3n3ns/ICT2x01-Team28
|
25fb23e4fedac5af4443abbe42dc953e90588427
|
[
"Apache-2.0"
] | null | null | null |
backend/interfaces.py
|
J3n3ns/ICT2x01-Team28
|
25fb23e4fedac5af4443abbe42dc953e90588427
|
[
"Apache-2.0"
] | null | null | null |
backend/interfaces.py
|
J3n3ns/ICT2x01-Team28
|
25fb23e4fedac5af4443abbe42dc953e90588427
|
[
"Apache-2.0"
] | null | null | null |
import typing
import feedback
class IUser:
def getModuleProfessors(self) -> typing.List:
pass
def getModuleStudents(self) -> typing.List:
pass
class IModule:
def getComponentsForModule(self) -> typing.List:
pass
class IComponent:
def addFeedback(self) -> None:
pass
def getFeedback(self) -> feedback.Feedback:
pass
def setFeedback(self) -> None:
pass
class IFeedback:
def getFeedback(self) -> feedback.Feedback:
pass
| 15.117647
| 52
| 0.634241
| 52
| 514
| 6.269231
| 0.365385
| 0.092025
| 0.128834
| 0.165644
| 0.374233
| 0.233129
| 0
| 0
| 0
| 0
| 0
| 0
| 0.280156
| 514
| 34
| 53
| 15.117647
| 0.881081
| 0
| 0
| 0.45
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.35
| false
| 0.35
| 0.1
| 0
| 0.65
| 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
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
052aed676886c18dab13a681299062b61a37daae
| 270
|
py
|
Python
|
near/api/rollthedice.py
|
brenov/near
|
7af0ec4aba1b56067019675d39eb3657c8ee591f
|
[
"MIT"
] | null | null | null |
near/api/rollthedice.py
|
brenov/near
|
7af0ec4aba1b56067019675d39eb3657c8ee591f
|
[
"MIT"
] | null | null | null |
near/api/rollthedice.py
|
brenov/near
|
7af0ec4aba1b56067019675d39eb3657c8ee591f
|
[
"MIT"
] | null | null | null |
from flask_restful import Resource
from random import randint
class RollTheDice(Resource):
def rollADice(self, higherBound):
return {
'response' : randint(1, higherBound)
}
def get(self, faces):
return self.rollADice(faces)
| 22.5
| 48
| 0.655556
| 29
| 270
| 6.068966
| 0.62069
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005025
| 0.262963
| 270
| 11
| 49
| 24.545455
| 0.879397
| 0
| 0
| 0
| 0
| 0
| 0.02963
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.222222
| false
| 0
| 0.222222
| 0.222222
| 0.777778
| 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
|
055580b1950428e8c9061ea3fead76ca844cb2ad
| 528
|
py
|
Python
|
models.py
|
jwestgard/elk
|
8b4732b87627cfb549e7b6d472983c9d5994b613
|
[
"MIT"
] | null | null | null |
models.py
|
jwestgard/elk
|
8b4732b87627cfb549e7b6d472983c9d5994b613
|
[
"MIT"
] | null | null | null |
models.py
|
jwestgard/elk
|
8b4732b87627cfb549e7b6d472983c9d5994b613
|
[
"MIT"
] | null | null | null |
from app import db
class Asset(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(64), index=True)
bytes = db.Column(db.Integer)
batch_id = db.Column(db.Integer, db.ForeignKey('batch.id'))
def __repr__(self):
return '<Asset %r>' % (self.name)
class Batches(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(64))
date = db.Column(db.DateTime)
def __repr__(self):
return '<Batch %r>' % (self.name)
| 24
| 63
| 0.625
| 78
| 528
| 4.089744
| 0.358974
| 0.175549
| 0.219436
| 0.213166
| 0.448276
| 0.388715
| 0.388715
| 0.388715
| 0.388715
| 0.388715
| 0
| 0.009662
| 0.215909
| 528
| 21
| 64
| 25.142857
| 0.76087
| 0
| 0
| 0.285714
| 0
| 0
| 0.05303
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.142857
| false
| 0
| 0.071429
| 0.142857
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
057c764224b54ec502e9140ca2da1dc830a294b6
| 707
|
py
|
Python
|
configs/deepim/lmPbrSO/FlowNet512_1.5AugCosyAAEGray_AggressiveV2_Flat_lmPbr_SO/FlowNet512_1.5AugCosyAAEGray_AggressiveV2_Flat_Pbr_06_cat.py
|
THU-DA-6D-Pose-Group/self6dpp
|
c267cfa55e440e212136a5e9940598720fa21d16
|
[
"Apache-2.0"
] | 33
|
2021-12-15T07:11:47.000Z
|
2022-03-29T08:58:32.000Z
|
configs/deepim/lmPbrSO/FlowNet512_1.5AugCosyAAEGray_AggressiveV2_Flat_lmPbr_SO/FlowNet512_1.5AugCosyAAEGray_AggressiveV2_Flat_Pbr_06_cat.py
|
THU-DA-6D-Pose-Group/self6dpp
|
c267cfa55e440e212136a5e9940598720fa21d16
|
[
"Apache-2.0"
] | 3
|
2021-12-15T11:39:54.000Z
|
2022-03-29T07:24:23.000Z
|
configs/deepim/lmPbrSO/FlowNet512_1.5AugCosyAAEGray_AggressiveV2_Flat_lmPbr_SO/FlowNet512_1.5AugCosyAAEGray_AggressiveV2_Flat_Pbr_06_cat.py
|
THU-DA-6D-Pose-Group/self6dpp
|
c267cfa55e440e212136a5e9940598720fa21d16
|
[
"Apache-2.0"
] | null | null | null |
_base_ = "./FlowNet512_1.5AugCosyAAEGray_AggressiveV2_Flat_Pbr_01_ape.py"
OUTPUT_DIR = "output/deepim/lmPbrSO/FlowNet512_1.5AugCosyAAEGray_AggressiveV2_Flat_lmPbr_SO/cat"
DATASETS = dict(TRAIN=("lm_pbr_cat_train",), TEST=("lm_real_cat_test",))
# bbnc5
# objects cat Avg(1)
# ad_2 19.26 19.26
# ad_5 62.48 62.48
# ad_10 91.52 91.52
# rete_2 78.24 78.24
# rete_5 99.60 99.60
# rete_10 100.00 100.00
# re_2 79.74 79.74
# re_5 99.60 99.60
# re_10 100.00 100.00
# te_2 97.70 97.70
# te_5 100.00 100.00
# te_10 100.00 100.00
# proj_2 83.63 83.63
# proj_5 99.10 99.10
# proj_10 100.00 100.00
# re 1.45 1.45
# te 0.01 0.01
| 29.458333
| 96
| 0.62942
| 140
| 707
| 2.928571
| 0.385714
| 0.121951
| 0.097561
| 0.121951
| 0.409756
| 0.068293
| 0
| 0
| 0
| 0
| 0
| 0.335217
| 0.248939
| 707
| 23
| 97
| 30.73913
| 0.436911
| 0.598303
| 0
| 0
| 0
| 0
| 0.662879
| 0.541667
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
05950d9328d453adf39354822b750e0baaf3435f
| 103
|
py
|
Python
|
autoscrape.py
|
2105-may24-devops/anthony-project-0
|
a5d1058a4fd0ffccdab0624f1360c69bacf2fd02
|
[
"Unlicense"
] | null | null | null |
autoscrape.py
|
2105-may24-devops/anthony-project-0
|
a5d1058a4fd0ffccdab0624f1360c69bacf2fd02
|
[
"Unlicense"
] | 8
|
2021-06-04T07:23:49.000Z
|
2021-08-07T17:55:47.000Z
|
autoscrape.py
|
2105-may24-devops/anthony-project-0
|
a5d1058a4fd0ffccdab0624f1360c69bacf2fd02
|
[
"Unlicense"
] | 1
|
2021-07-14T19:59:44.000Z
|
2021-07-14T19:59:44.000Z
|
from data_zero_functions import *
import sys
if __name__ == "__main__":
rapid_scraper(sys.argv[1])
| 17.166667
| 33
| 0.747573
| 15
| 103
| 4.4
| 0.866667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.011364
| 0.145631
| 103
| 6
| 34
| 17.166667
| 0.738636
| 0
| 0
| 0
| 0
| 0
| 0.076923
| 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
|
553793bab0e806d3a9b69008a6e5bdb278c04640
| 147
|
py
|
Python
|
python/recursion-comparison.py
|
namusanga/Recursion-Iteration-Blog
|
5e63aca138a4c8908cac6e1e61c068431a453004
|
[
"MIT"
] | null | null | null |
python/recursion-comparison.py
|
namusanga/Recursion-Iteration-Blog
|
5e63aca138a4c8908cac6e1e61c068431a453004
|
[
"MIT"
] | null | null | null |
python/recursion-comparison.py
|
namusanga/Recursion-Iteration-Blog
|
5e63aca138a4c8908cac6e1e61c068431a453004
|
[
"MIT"
] | null | null | null |
# calculting factorial using recursion
def Fact(n):
return (n * Fact(n-1) if (n > 1) else 1.0)
#main
num = int(input("n = "))
print(Fact(num))
| 21
| 46
| 0.62585
| 26
| 147
| 3.538462
| 0.653846
| 0.108696
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.033613
| 0.190476
| 147
| 7
| 47
| 21
| 0.739496
| 0.272109
| 0
| 0
| 0
| 0
| 0.038095
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 0.25
| 0.5
| 0.25
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 4
|
555f97ac65e638f3bddd96a705176e8e529c6cc1
| 131
|
py
|
Python
|
python/interview/02metaclass.py
|
summer-vacation/AlgoExec
|
55c6c3e7890b596b709b50cafa415b9594c03edd
|
[
"MIT"
] | null | null | null |
python/interview/02metaclass.py
|
summer-vacation/AlgoExec
|
55c6c3e7890b596b709b50cafa415b9594c03edd
|
[
"MIT"
] | 2
|
2019-12-09T06:12:51.000Z
|
2019-12-16T14:38:34.000Z
|
python/interview/02metaclass.py
|
summer-vacation/AlgoExec
|
55c6c3e7890b596b709b50cafa415b9594c03edd
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
"""
File Name: 02metaclass.py
Author : jynnezhang
Date: 2020/12/1 9:52 上午
Description:
"""
| 16.375
| 31
| 0.564885
| 17
| 131
| 4.352941
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.134021
| 0.259542
| 131
| 7
| 32
| 18.714286
| 0.628866
| 0.923664
| 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
|
55744426af5fc1ab7e31a2f3cd6110ee33a18cc8
| 357
|
py
|
Python
|
test_.py
|
sinkaroid/pururin
|
1f4342f690864498e5dded9e58fe34389cfe48ec
|
[
"MIT"
] | 4
|
2022-03-10T12:19:34.000Z
|
2022-03-11T01:17:10.000Z
|
test_.py
|
sinkaroid/pururin
|
1f4342f690864498e5dded9e58fe34389cfe48ec
|
[
"MIT"
] | null | null | null |
test_.py
|
sinkaroid/pururin
|
1f4342f690864498e5dded9e58fe34389cfe48ec
|
[
"MIT"
] | null | null | null |
import pururin
data = pururin.Client()
print(data.get_book(61119))
print(data.get_random())
print(data.get_random_with_query("tomoe gozen"))
print(data.search_by_highest_rated("jeanne alter"))
print(data.search_by_most_viewed("succubus"))
print(data.search_by_newest("gangbang"))
print(data.search_by_random("yuri"))
print(data.search_by_title("futanari"))
| 32.454545
| 51
| 0.80112
| 55
| 357
| 4.890909
| 0.490909
| 0.267658
| 0.27881
| 0.315985
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.01462
| 0.042017
| 357
| 11
| 52
| 32.454545
| 0.77193
| 0
| 0
| 0
| 0
| 0
| 0.142458
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.1
| 0
| 0.1
| 0.8
| 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
|
557817956119c98fbf07c89eaaa80445bf2173c4
| 96
|
py
|
Python
|
railway_api/apps.py
|
pritomzap/railway_project
|
1ea0393405313c7631025ef15778a05c8ae02ce4
|
[
"MIT"
] | null | null | null |
railway_api/apps.py
|
pritomzap/railway_project
|
1ea0393405313c7631025ef15778a05c8ae02ce4
|
[
"MIT"
] | null | null | null |
railway_api/apps.py
|
pritomzap/railway_project
|
1ea0393405313c7631025ef15778a05c8ae02ce4
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
class RailwayApiConfig(AppConfig):
name = 'railway_api'
| 16
| 34
| 0.770833
| 11
| 96
| 6.636364
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.15625
| 96
| 5
| 35
| 19.2
| 0.901235
| 0
| 0
| 0
| 0
| 0
| 0.114583
| 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
|
557a267eb9e5867f09612a862b5405b932f873ba
| 92
|
py
|
Python
|
milt_sear/apps.py
|
georgiawang5332/prodmanager
|
5dbff0789deb0c4f696149345ded3e338c6f59ec
|
[
"MIT"
] | null | null | null |
milt_sear/apps.py
|
georgiawang5332/prodmanager
|
5dbff0789deb0c4f696149345ded3e338c6f59ec
|
[
"MIT"
] | null | null | null |
milt_sear/apps.py
|
georgiawang5332/prodmanager
|
5dbff0789deb0c4f696149345ded3e338c6f59ec
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
class MiltSearConfig(AppConfig):
name = 'milt_sear'
| 15.333333
| 33
| 0.76087
| 11
| 92
| 6.272727
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.163043
| 92
| 5
| 34
| 18.4
| 0.896104
| 0
| 0
| 0
| 0
| 0
| 0.097826
| 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
|
558fcca0723b3d81698bcdf7f05c8c1650d4e30e
| 90
|
py
|
Python
|
pinax/likes/__init__.py
|
pinax/pinax-likes
|
dedbe4b130e58da7a9674e9dbc737a0f67dd89f6
|
[
"MIT"
] | 81
|
2015-11-05T01:39:34.000Z
|
2021-07-23T15:46:19.000Z
|
pinax/likes/__init__.py
|
pinax/pinax-likes
|
dedbe4b130e58da7a9674e9dbc737a0f67dd89f6
|
[
"MIT"
] | 34
|
2016-01-06T18:31:05.000Z
|
2021-03-12T23:04:58.000Z
|
pinax/likes/__init__.py
|
pinax/pinax-likes
|
dedbe4b130e58da7a9674e9dbc737a0f67dd89f6
|
[
"MIT"
] | 24
|
2016-01-27T17:41:04.000Z
|
2021-02-28T13:10:23.000Z
|
import pkg_resources
__version__ = pkg_resources.get_distribution("pinax-likes").version
| 22.5
| 67
| 0.844444
| 11
| 90
| 6.272727
| 0.727273
| 0.347826
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.066667
| 90
| 3
| 68
| 30
| 0.821429
| 0
| 0
| 0
| 0
| 0
| 0.122222
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
5598948d1f8258084be788a9a076f1f7e0f2484b
| 253
|
py
|
Python
|
boto3_exceptions/cloudhsm.py
|
siteshen/boto3_exceptions
|
d6174c2577c9d4b17a09a89cd0e4bd1fe555b26b
|
[
"MIT"
] | 2
|
2021-06-22T00:00:35.000Z
|
2021-07-15T03:25:52.000Z
|
boto3_exceptions/cloudhsm.py
|
siteshen/boto3_exceptions
|
d6174c2577c9d4b17a09a89cd0e4bd1fe555b26b
|
[
"MIT"
] | null | null | null |
boto3_exceptions/cloudhsm.py
|
siteshen/boto3_exceptions
|
d6174c2577c9d4b17a09a89cd0e4bd1fe555b26b
|
[
"MIT"
] | null | null | null |
import boto3
exceptions = boto3.client('cloudhsm').exceptions
CloudHsmInternalException = exceptions.CloudHsmInternalException
CloudHsmServiceException = exceptions.CloudHsmServiceException
InvalidRequestException = exceptions.InvalidRequestException
| 31.625
| 64
| 0.885375
| 16
| 253
| 14
| 0.5
| 0.3125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.008439
| 0.063241
| 253
| 7
| 65
| 36.142857
| 0.936709
| 0
| 0
| 0
| 0
| 0
| 0.031621
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.2
| 0
| 0.2
| 0
| 1
| 0
| 1
| 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
|
e9bc41389b5c8be06bc4e1f32c50858879e5854f
| 230
|
py
|
Python
|
microblog/__init__.py
|
houssamTrizi/flask_micro_blog_package
|
5dcf4174eecb90e2d8d16bc56c47d5fe8cf27cb3
|
[
"MIT"
] | null | null | null |
microblog/__init__.py
|
houssamTrizi/flask_micro_blog_package
|
5dcf4174eecb90e2d8d16bc56c47d5fe8cf27cb3
|
[
"MIT"
] | null | null | null |
microblog/__init__.py
|
houssamTrizi/flask_micro_blog_package
|
5dcf4174eecb90e2d8d16bc56c47d5fe8cf27cb3
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
from __future__ import print_function
from ._version import get_versions
__author__ = 'Houssam Eddine Trizi'
__email__ = 'houssam.trizi@gmail.com'
__version__ = get_versions()['version']
del get_versions
| 23
| 39
| 0.765217
| 29
| 230
| 5.344828
| 0.655172
| 0.212903
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.004951
| 0.121739
| 230
| 9
| 40
| 25.555556
| 0.762376
| 0.091304
| 0
| 0
| 0
| 0
| 0.242718
| 0.11165
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0.166667
| 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
|
e9cf67750cf4a96344f3150a7d105dbbe44ce7f5
| 378
|
py
|
Python
|
AIoT/Vitis-AI/VART/example/adas_detection_py/priority_queue.py
|
kaka-lin/ML-Notes
|
047b88d59346b2ec719b1b3e2fcd605e1ccfaf91
|
[
"MIT"
] | null | null | null |
AIoT/Vitis-AI/VART/example/adas_detection_py/priority_queue.py
|
kaka-lin/ML-Notes
|
047b88d59346b2ec719b1b3e2fcd605e1ccfaf91
|
[
"MIT"
] | 6
|
2020-06-10T02:56:37.000Z
|
2022-02-27T10:13:12.000Z
|
AIoT/Vitis-AI/VART/example/adas_detection_py/priority_queue.py
|
kaka-lin/ML-Notes
|
047b88d59346b2ec719b1b3e2fcd605e1ccfaf91
|
[
"MIT"
] | null | null | null |
import random
class PriorityQueue(object):
def __init__(self, idx, img):
self.idx = idx
self.img = img
def __str__(self):
return str(self.__dict__)
def __repr__(self):
return str(self.__dict__)
def __lt__(self, other):
return self.idx < other.idx
def __getitem__(self, key):
return self.__dict__.get(key)
| 19.894737
| 37
| 0.613757
| 48
| 378
| 4.166667
| 0.395833
| 0.105
| 0.13
| 0.17
| 0.24
| 0.24
| 0
| 0
| 0
| 0
| 0
| 0
| 0.283069
| 378
| 18
| 38
| 21
| 0.738007
| 0
| 0
| 0.153846
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.384615
| false
| 0
| 0.076923
| 0.307692
| 0.846154
| 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
|
e9d03294968d0577dba4825f822451ac50c76526
| 69
|
py
|
Python
|
retic/__init__.py
|
reticpy/retic
|
033c2a67d1895780d7c561988121ec5615d5bf91
|
[
"MIT"
] | 3
|
2020-06-02T04:11:11.000Z
|
2021-12-29T14:38:17.000Z
|
retic/__init__.py
|
reticpy/retic
|
033c2a67d1895780d7c561988121ec5615d5bf91
|
[
"MIT"
] | null | null | null |
retic/__init__.py
|
reticpy/retic
|
033c2a67d1895780d7c561988121ec5615d5bf91
|
[
"MIT"
] | 1
|
2020-12-08T22:39:16.000Z
|
2020-12-08T22:39:16.000Z
|
# Libs
from retic.lib import *
# TODO: Add version
__version__ = ""
| 11.5
| 23
| 0.681159
| 9
| 69
| 4.777778
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.202899
| 69
| 5
| 24
| 13.8
| 0.781818
| 0.318841
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.2
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
756e517ece1d40b1f1e2f4a6f898bc0cb50e0a5d
| 96
|
py
|
Python
|
devilry/devilry_examiner/__init__.py
|
aless80/devilry-django
|
416c262e75170d5662542f15e2d7fecf5ab84730
|
[
"BSD-3-Clause"
] | null | null | null |
devilry/devilry_examiner/__init__.py
|
aless80/devilry-django
|
416c262e75170d5662542f15e2d7fecf5ab84730
|
[
"BSD-3-Clause"
] | null | null | null |
devilry/devilry_examiner/__init__.py
|
aless80/devilry-django
|
416c262e75170d5662542f15e2d7fecf5ab84730
|
[
"BSD-3-Clause"
] | null | null | null |
# Load AppConfig.
default_app_config = 'devilry.devilry_examiner.apps.DevilryExaminerAppConfig'
| 32
| 77
| 0.854167
| 10
| 96
| 7.9
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.0625
| 96
| 2
| 78
| 48
| 0.877778
| 0.15625
| 0
| 0
| 0
| 0
| 0.683544
| 0.683544
| 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
|
7585c8fb19163035805c83fa8149ff61b767e8f1
| 145
|
py
|
Python
|
6 kyu/Monkey Talk.py
|
mwk0408/codewars_solutions
|
9b4f502b5f159e68024d494e19a96a226acad5e5
|
[
"MIT"
] | 6
|
2020-09-03T09:32:25.000Z
|
2020-12-07T04:10:01.000Z
|
6 kyu/Monkey Talk.py
|
mwk0408/codewars_solutions
|
9b4f502b5f159e68024d494e19a96a226acad5e5
|
[
"MIT"
] | 1
|
2021-12-13T15:30:21.000Z
|
2021-12-13T15:30:21.000Z
|
6 kyu/Monkey Talk.py
|
mwk0408/codewars_solutions
|
9b4f502b5f159e68024d494e19a96a226acad5e5
|
[
"MIT"
] | null | null | null |
def monkey_talk(phrase):
res=" ".join("eek" if j[0] in "aeiouAEIOU" else "ook" for j in phrase.split())
return res[0].upper()+res[1:]+"."
| 48.333333
| 82
| 0.613793
| 25
| 145
| 3.52
| 0.76
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02459
| 0.158621
| 145
| 3
| 83
| 48.333333
| 0.696721
| 0
| 0
| 0
| 0
| 0
| 0.123288
| 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
|
759bd4be68429c53dbabcf8755deb3032e78ded7
| 80
|
py
|
Python
|
hw.py
|
osfjsr/bcal
|
914dc04a16ef34b93fc35961623f80d097409ed5
|
[
"MIT"
] | null | null | null |
hw.py
|
osfjsr/bcal
|
914dc04a16ef34b93fc35961623f80d097409ed5
|
[
"MIT"
] | null | null | null |
hw.py
|
osfjsr/bcal
|
914dc04a16ef34b93fc35961623f80d097409ed5
|
[
"MIT"
] | null | null | null |
<script>$ chmod +x myscript.py</script
#!/bin/python3
print("Hello, World!")
| 20
| 39
| 0.6625
| 11
| 80
| 4.818182
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.014286
| 0.125
| 80
| 3
| 40
| 26.666667
| 0.742857
| 0.1625
| 0
| 0
| 0
| 0
| 0.206349
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
75cc9a781363a6c808ec14014148b4350ddf454f
| 17,775
|
py
|
Python
|
sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_custom_form_client_async.py
|
szaher/azure-sdk-for-python
|
577513d37aeb430a11ee3478b68c693a65b7e347
|
[
"MIT"
] | null | null | null |
sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_custom_form_client_async.py
|
szaher/azure-sdk-for-python
|
577513d37aeb430a11ee3478b68c693a65b7e347
|
[
"MIT"
] | null | null | null |
sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_custom_form_client_async.py
|
szaher/azure-sdk-for-python
|
577513d37aeb430a11ee3478b68c693a65b7e347
|
[
"MIT"
] | null | null | null |
# coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
# pylint: disable=protected-access
from typing import ( # pylint: disable=unused-import
Optional,
Any,
List,
IO,
Iterable,
TYPE_CHECKING,
)
import six
from azure.core.polling import async_poller
from azure.core.polling.async_base_polling import AsyncLROBasePolling
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.pipeline.policies import AzureKeyCredentialPolicy
from .._generated.aio._form_recognizer_client_async import FormRecognizerClient as FormRecognizer
from .._generated.models import TrainRequest, TrainSourceFilter
from .._response_handlers import (
prepare_unlabeled_result,
prepare_labeled_result,
)
from .._generated.models import AnalyzeOperationResult, Model
from .._helpers import get_content_type, POLLING_INTERVAL, COGNITIVE_KEY_HEADER
from .._models import (
ModelInfo,
ModelsSummary,
CustomModel,
CustomLabeledModel,
)
from .._user_agent import USER_AGENT
from .._polling import TrainingPolling, AnalyzePolling
if TYPE_CHECKING:
from azure.core.credentials import AzureKeyCredential
from .._models import (
ExtractedPage,
ExtractedLabeledForm
)
class CustomFormClient(object):
"""CustomFormClient.
:param str endpoint: Supported Cognitive Services endpoints (protocol and hostname,
for example: https://westus2.api.cognitive.microsoft.com).
:param credential: Credentials needed for the client to connect to Azure.
This is an instance of AzureKeyCredential if using an API key.
:type credential: ~azure.core.credentials.AzureKeyCredential
"""
def __init__(
self,
endpoint: str,
credential: "AzureKeyCredential",
**kwargs: Any
) -> None:
self._client = FormRecognizer(
endpoint=endpoint,
credential=credential,
sdk_moniker=USER_AGENT,
authentication_policy=AzureKeyCredentialPolicy(credential, COGNITIVE_KEY_HEADER),
**kwargs
)
@distributed_trace_async
async def begin_training(
self,
source: str,
source_prefix_filter: Optional[str] = "",
include_sub_folders: Optional[bool] = False,
**kwargs: Any
) -> CustomModel:
"""Create and train a custom model. The request must include a source parameter that is an
externally accessible Azure storage blob container Uri (preferably a Shared Access Signature Uri).
Models are trained using documents that are of the following content type - 'application/pdf',
'image/jpeg', 'image/png', 'image/tiff'. Other type of content in the container is ignored.
:param str source: An Azure Storage blob container URI.
:param str source_prefix_filter: A case-sensitive prefix string to filter documents in the source path for
training. For example, when using a Azure storage blob Uri, use the prefix to restrict sub
folders for training.
:param bool include_sub_folders: A flag to indicate if sub folders within the set of prefix folders
will also need to be included when searching for content to be preprocessed.
:return: CustomModel
:rtype: ~azure.ai.formrecognizer.CustomModel
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop("cls", None)
response = await self._client.train_custom_model_async(
train_request=TrainRequest(
source=source,
source_filter=TrainSourceFilter(
prefix=source_prefix_filter,
include_sub_folders=include_sub_folders
)
),
cls=lambda pipeline_response, _, response_headers: pipeline_response,
**kwargs
)
def callback(raw_response):
model = self._client._deserialize(Model, raw_response)
return CustomModel._from_generated(model)
deserialization_callback = cls if cls else callback
return await async_poller(
self._client._client,
response,
deserialization_callback,
AsyncLROBasePolling(timeout=POLLING_INTERVAL, lro_algorithms=[TrainingPolling()], **kwargs)
)
@distributed_trace_async
async def begin_labeled_training(
self,
source,
source_prefix_filter: Optional[str] = "",
include_sub_folders: Optional[bool] = False,
**kwargs: Any
) -> CustomLabeledModel:
"""Create and train a custom model with labels. The request must include a source parameter that is an
externally accessible Azure storage blob container Uri (preferably a Shared Access Signature Uri).
Models are trained using documents that are of the following content type - 'application/pdf',
'image/jpeg', 'image/png', 'image/tiff'. Other type of content in the container is ignored.
:param str source: An Azure Storage blob container URI.
:param str source_prefix_filter: A case-sensitive prefix string to filter documents in the source path for
training. For example, when using a Azure storage blob Uri, use the prefix to restrict sub
folders for training.
:param bool include_sub_folders: A flag to indicate if sub folders within the set of prefix folders
will also need to be included when searching for content to be preprocessed.
:return: CustomLabeledModel
:rtype: ~azure.ai.formrecognizer.CustomLabeledModel
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop("cls", None)
response = await self._client.train_custom_model_async(
train_request=TrainRequest(
source=source,
source_filter=TrainSourceFilter(
prefix=source_prefix_filter,
include_sub_folders=include_sub_folders
),
use_label_file=True
),
cls=lambda pipeline_response, _, response_headers: pipeline_response,
**kwargs
)
def callback(raw_response):
model = self._client._deserialize(Model, raw_response)
return CustomLabeledModel._from_generated(model)
deserialization_callback = cls if cls else callback
return await async_poller(
self._client._client,
response,
deserialization_callback,
AsyncLROBasePolling(timeout=POLLING_INTERVAL, lro_algorithms=[TrainingPolling()], **kwargs)
)
@distributed_trace_async
async def begin_extract_form_pages(
self,
stream: IO[bytes],
model_id: str,
**kwargs: Any
) -> List["ExtractedPage"]:
"""Analyze Form.
:param stream: .pdf, .jpg, .png or .tiff type file stream.
:type stream: stream
:param str model_id: Model identifier.
:keyword bool include_text_details: Include text lines and element references in the result.
:keyword str content_type: Media type of the body sent to the API.
:return: List[ExtractedPage]
:rtype: list[~azure.ai.formrecognizer.ExtractedPage]
:raises: ~azure.core.exceptions.HttpResponseError
"""
if isinstance(stream, six.string_types):
raise TypeError("Call begin_extract_form_pages_from_url() to analyze a document from a url.")
include_text_details = kwargs.pop("include_text_details", False)
content_type = kwargs.pop("content_type", None)
if content_type is None:
content_type = get_content_type(stream)
def callback(raw_response, _, headers): # pylint: disable=unused-argument
extracted_form = self._client._deserialize(AnalyzeOperationResult, raw_response)
if extracted_form.analyze_result.document_results:
raise ValueError("Cannot call begin_extract_form_pages() with the ID of a model trained with labels. "
"Please call begin_extract_labeled_forms() instead.")
return prepare_unlabeled_result(extracted_form)
return await self._client.analyze_with_custom_model(
file_stream=stream,
model_id=model_id,
include_text_details=include_text_details,
content_type=content_type,
cls=kwargs.pop("cls", callback),
polling=AsyncLROBasePolling(timeout=POLLING_INTERVAL, lro_algorithms=[AnalyzePolling()], **kwargs),
**kwargs
)
@distributed_trace_async
async def begin_extract_form_pages_from_url(
self,
url: str,
model_id: str,
**kwargs: Any
) -> List["ExtractedPage"]:
"""Analyze Form.
:param url: The url of the document.
:type url: str
:param str model_id: Model identifier.
:keyword bool include_text_details: Include text lines and element references in the result.
:return: List[ExtractedPage]
:rtype: list[~azure.ai.formrecognizer.ExtractedPage]
:raises: ~azure.core.exceptions.HttpResponseError
"""
if not isinstance(url, six.string_types):
raise TypeError("Call begin_extract_form_pages() to analyze a document from a stream.")
include_text_details = kwargs.pop("include_text_details", False)
def callback(raw_response, _, headers): # pylint: disable=unused-argument
extracted_form = self._client._deserialize(AnalyzeOperationResult, raw_response)
if extracted_form.analyze_result.document_results:
raise ValueError("Cannot call begin_extract_form_pages_from_url() with the ID of a model trained "
"with labels. Please call begin_extract_labeled_forms_from_url() instead.")
return prepare_unlabeled_result(extracted_form)
return await self._client.analyze_with_custom_model(
file_stream={"source": url},
model_id=model_id,
include_text_details=include_text_details,
cls=kwargs.pop("cls", callback),
polling=AsyncLROBasePolling(timeout=POLLING_INTERVAL, lro_algorithms=[AnalyzePolling()], **kwargs),
**kwargs
)
@distributed_trace_async
async def begin_extract_labeled_forms(
self,
stream: IO[bytes],
model_id: str,
**kwargs: Any
) -> List["ExtractedLabeledForm"]:
"""Analyze Form.
:param stream: .pdf, .jpg, .png or .tiff type file stream.
:type stream: stream
:param str model_id: Model identifier.
:keyword bool include_text_details: Include text lines and element references in the result.
:keyword str content_type: Media type of the body sent to the API.
:return: List[ExtractedLabeledForm]
:rtype: list[~azure.ai.formrecognizer.ExtractedLabeledForm]
:raises: ~azure.core.exceptions.HttpResponseError
"""
if isinstance(stream, six.string_types):
raise TypeError("Call begin_extract_labeled_forms_from_url() to analyze a document from a url.")
include_text_details = kwargs.pop("include_text_details", False)
content_type = kwargs.pop("content_type", None)
if content_type is None:
content_type = get_content_type(stream)
def callback(raw_response, _, headers): # pylint: disable=unused-argument
extracted_form = self._client._deserialize(AnalyzeOperationResult, raw_response)
if not extracted_form.analyze_result.document_results:
raise ValueError("Cannot call begin_extract_labeled_forms() with the ID of a model trained without "
"labels. Please call begin_extract_form_pages() instead.")
return prepare_labeled_result(extracted_form)
return await self._client.analyze_with_custom_model(
file_stream=stream,
model_id=model_id,
include_text_details=include_text_details,
content_type=content_type,
cls=kwargs.pop("cls", callback),
polling=AsyncLROBasePolling(timeout=POLLING_INTERVAL, lro_algorithms=[AnalyzePolling()], **kwargs),
**kwargs
)
@distributed_trace_async
async def begin_extract_labeled_forms_from_url(
self,
url: str,
model_id: str,
**kwargs: Any
) -> List["ExtractedLabeledForm"]:
"""Analyze Form.
:param url: The url of the document.
:type url: str
:param str model_id: Model identifier.
:keyword bool include_text_details: Include text lines and element references in the result.
:return: List[ExtractedLabeledForm]
:rtype: list[~azure.ai.formrecognizer.ExtractedLabeledForm]
:raises: ~azure.core.exceptions.HttpResponseError
"""
if not isinstance(url, six.string_types):
raise TypeError("Call begin_extract_labeled_forms() to analyze a document from a stream.")
include_text_details = kwargs.pop("include_text_details", False)
def callback(raw_response, _, headers): # pylint: disable=unused-argument
extracted_form = self._client._deserialize(AnalyzeOperationResult, raw_response)
if not extracted_form.analyze_result.document_results:
raise ValueError("Cannot call begin_extract_labeled_forms_from_url() with the ID of a model trained "
"without labels. Please call begin_extract_form_pages_from_url() instead.")
return prepare_labeled_result(extracted_form)
return await self._client.analyze_with_custom_model(
file_stream={"source": url},
model_id=model_id,
include_text_details=include_text_details,
cls=kwargs.pop("cls", callback),
polling=AsyncLROBasePolling(timeout=POLLING_INTERVAL, lro_algorithms=[AnalyzePolling()], **kwargs),
**kwargs
)
@distributed_trace_async
async def delete_custom_model(self, model_id: str, **kwargs: Any) -> None:
"""Mark model for deletion. Model artifacts will be permanently removed within a predetermined period.
Delete Custom Model.
:param model_id: Model identifier.
:type model_id: str
:rtype: None
:raises: ~azure.core.exceptions.HttpResponseError
"""
return await self._client.delete_custom_model(
model_id=model_id,
**kwargs
)
@distributed_trace
def list_custom_models(self, **kwargs: Any) -> Iterable[ModelInfo]:
"""List Custom Models.
:return: AsyncItemPaged[~azure.ai.formrecognizer.ModelInfo]
:raises: ~azure.core.exceptions.HttpResponseError
"""
return self._client.list_custom_models(
cls=kwargs.pop("cls", lambda objs: [ModelInfo._from_generated(x) for x in objs]),
**kwargs
)
@distributed_trace_async
async def get_models_summary(self, **kwargs: Any) -> ModelsSummary:
"""Get information about all custom models.
:return: Summary of models on account - count, limit, last updated.
:rtype: ~azure.ai.formrecognizer.ModelsSummary
:raises: ~azure.core.exceptions.HttpResponseError
"""
response = await self._client.get_custom_models(**kwargs)
return ModelsSummary._from_generated(response.summary)
@distributed_trace_async
async def get_custom_model(self, model_id: str, **kwargs: Any) -> CustomModel:
"""Get detailed information about a custom model.
:param str model_id: Model identifier.
:return: CustomModel
:rtype: ~azure.ai.formrecognizer.CustomModel
:raises: ~azure.core.exceptions.HttpResponseError
"""
response = await self._client.get_custom_model(model_id=model_id, include_keys=True, **kwargs)
if response.keys:
return CustomModel._from_generated(response)
raise ValueError("Model id '{}' is a model that was trained with labels. Call get_custom_labeled_model() "
"with the model id.".format(model_id))
@distributed_trace_async
async def get_custom_labeled_model(self, model_id: str, **kwargs: Any) -> CustomLabeledModel:
"""Get detailed information about a custom labeled model.
:param str model_id: Model identifier.
:return: CustomLabeledModel
:rtype: ~azure.ai.formrecognizer.CustomLabeledModel
:raises: ~azure.core.exceptions.HttpResponseError
"""
response = await self._client.get_custom_model(model_id=model_id, include_keys=True, **kwargs)
if response.keys is None:
return CustomLabeledModel._from_generated(response)
raise ValueError("Model id '{}' was not trained with labels. Call get_custom_model() with the model id."
.format(model_id))
async def __aenter__(self) -> "CustomFormClient":
await self._client.__aenter__()
return self
async def __aexit__(self, *args: "Any") -> None:
await self._client.__aexit__(*args)
async def close(self) -> None:
"""Close the :class:`~azure.ai.formrecognizer.CustomFormClient` session.
"""
await self._client.__aexit__()
| 43.143204
| 118
| 0.660478
| 1,946
| 17,775
| 5.806269
| 0.136177
| 0.021683
| 0.031861
| 0.024338
| 0.770865
| 0.765731
| 0.735729
| 0.714665
| 0.696787
| 0.695548
| 0
| 0.000152
| 0.258059
| 17,775
| 411
| 119
| 43.248175
| 0.856612
| 0.047595
| 0
| 0.575397
| 0
| 0
| 0.110428
| 0.034989
| 0
| 0
| 0
| 0
| 0
| 1
| 0.031746
| false
| 0
| 0.06746
| 0
| 0.174603
| 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
|
f93b6e301ca3ec36ed8da0e22a4949edc951638b
| 21
|
py
|
Python
|
data/studio21_generated/introductory/3740/starter_code.py
|
vijaykumawat256/Prompt-Summarization
|
614f5911e2acd2933440d909de2b4f86653dc214
|
[
"Apache-2.0"
] | null | null | null |
data/studio21_generated/introductory/3740/starter_code.py
|
vijaykumawat256/Prompt-Summarization
|
614f5911e2acd2933440d909de2b4f86653dc214
|
[
"Apache-2.0"
] | null | null | null |
data/studio21_generated/introductory/3740/starter_code.py
|
vijaykumawat256/Prompt-Summarization
|
614f5911e2acd2933440d909de2b4f86653dc214
|
[
"Apache-2.0"
] | null | null | null |
def sort_time(arr):
| 10.5
| 19
| 0.714286
| 4
| 21
| 3.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.142857
| 21
| 2
| 20
| 10.5
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
f96c6b7b7039f52f366fdc53f7a8e561ab77d1da
| 99
|
py
|
Python
|
api/courseloop/davematthews/apps.py
|
akhatua2/CourseWeb
|
b36a17bb02832d2641cd11160fce8f281164a857
|
[
"MIT"
] | 5
|
2020-08-14T20:04:59.000Z
|
2020-08-19T16:50:16.000Z
|
api/courseloop/davematthews/apps.py
|
akhatua2/CourseWeb
|
b36a17bb02832d2641cd11160fce8f281164a857
|
[
"MIT"
] | null | null | null |
api/courseloop/davematthews/apps.py
|
akhatua2/CourseWeb
|
b36a17bb02832d2641cd11160fce8f281164a857
|
[
"MIT"
] | 8
|
2020-08-10T19:47:37.000Z
|
2020-08-16T20:08:58.000Z
|
from django.apps import AppConfig
class DavematthewsConfig(AppConfig):
name = 'davematthews'
| 16.5
| 36
| 0.777778
| 10
| 99
| 7.7
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.151515
| 99
| 5
| 37
| 19.8
| 0.916667
| 0
| 0
| 0
| 0
| 0
| 0.121212
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
f9712bd16a272daf813e14f3ab950e88249592dd
| 111
|
py
|
Python
|
tweetslist/forms.py
|
wr47h/TweetsList
|
168de24cfd5e0c913f16963c9bd7b6228a58d8ac
|
[
"MIT"
] | null | null | null |
tweetslist/forms.py
|
wr47h/TweetsList
|
168de24cfd5e0c913f16963c9bd7b6228a58d8ac
|
[
"MIT"
] | null | null | null |
tweetslist/forms.py
|
wr47h/TweetsList
|
168de24cfd5e0c913f16963c9bd7b6228a58d8ac
|
[
"MIT"
] | 1
|
2019-10-05T07:57:39.000Z
|
2019-10-05T07:57:39.000Z
|
from django import forms
class PostForm(forms.Form):
name = forms.CharField(label='Name', max_length=100)
| 22.2
| 56
| 0.747748
| 16
| 111
| 5.125
| 0.8125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.03125
| 0.135135
| 111
| 4
| 57
| 27.75
| 0.822917
| 0
| 0
| 0
| 0
| 0
| 0.036036
| 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
|
f991cd5e20b30b084ee74db4af14cd81a0c48593
| 220
|
py
|
Python
|
django-app/main/textanalyzers/vaderanalyzer.py
|
honchardev/crypto-sentiment-app
|
176a6ed61246490c42d2a2b7af4d45f67e3c7499
|
[
"MIT"
] | 9
|
2019-07-07T02:57:50.000Z
|
2022-01-07T10:03:30.000Z
|
django-app/main/textanalyzers/vaderanalyzer.py
|
honchardev/crypto-sentiment-app
|
176a6ed61246490c42d2a2b7af4d45f67e3c7499
|
[
"MIT"
] | null | null | null |
django-app/main/textanalyzers/vaderanalyzer.py
|
honchardev/crypto-sentiment-app
|
176a6ed61246490c42d2a2b7af4d45f67e3c7499
|
[
"MIT"
] | null | null | null |
from .abstractanalyzer import AbstractAnalyzer
from vaderSentiment import vaderSentiment
class VaderAnalyzer(AbstractAnalyzer):
def __init__(self):
pass
def analyze(self, text_content):
pass
| 16.923077
| 46
| 0.740909
| 21
| 220
| 7.52381
| 0.619048
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.209091
| 220
| 12
| 47
| 18.333333
| 0.908046
| 0
| 0
| 0.285714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0.285714
| 0.285714
| 0
| 0.714286
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
f9bfc37031062f063c7b5b7daa2bf9faab67b1bd
| 64
|
py
|
Python
|
codewof/programming/management/__init__.py
|
taskmaker1/codewof
|
92d52cd3ee91f0f311ff01a92cf6ec07e5593b8d
|
[
"MIT"
] | 3
|
2019-08-29T04:11:22.000Z
|
2021-06-22T16:05:51.000Z
|
codewof/programming/management/__init__.py
|
taskmaker1/codewof
|
92d52cd3ee91f0f311ff01a92cf6ec07e5593b8d
|
[
"MIT"
] | 265
|
2019-05-30T03:51:46.000Z
|
2022-03-31T01:05:12.000Z
|
codewof/programming/management/__init__.py
|
samuelsandri/codewof
|
c9b8b378c06b15a0c42ae863b8f46581de04fdfc
|
[
"MIT"
] | 7
|
2019-06-29T12:13:37.000Z
|
2021-09-06T06:49:14.000Z
|
"""Module for the management of the programming application."""
| 32
| 63
| 0.765625
| 8
| 64
| 6.125
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 64
| 1
| 64
| 64
| 0.875
| 0.890625
| 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
|
f9c5f40f682427e6fd0a4de6e605302220d0253a
| 110
|
py
|
Python
|
tests/test_db_health.py
|
PadamSethia/peeps
|
4304d96997572972d3701dddabd86dbb2ba05060
|
[
"MIT"
] | 2
|
2019-02-06T17:29:43.000Z
|
2019-04-20T09:34:36.000Z
|
tests/test_db_health.py
|
highoncarbs/peep
|
4304d96997572972d3701dddabd86dbb2ba05060
|
[
"MIT"
] | 10
|
2018-07-10T07:12:02.000Z
|
2018-09-14T07:55:00.000Z
|
tests/test_db_health.py
|
PadamSethia/peep
|
4304d96997572972d3701dddabd86dbb2ba05060
|
[
"MIT"
] | null | null | null |
# Testing the connection of Database and SQLAlchemy
import unittest
class BasicTest(unittest.TestCase):
| 18.333333
| 51
| 0.790909
| 13
| 110
| 6.692308
| 0.923077
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.163636
| 110
| 6
| 52
| 18.333333
| 0.945652
| 0.445455
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.5
| null | null | 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
ddd355d3659b42728e2ede639a55bb01e1ebcaa9
| 190
|
py
|
Python
|
pyxFiles/setup.py
|
johanlahti/urban-lu-model
|
a8f7419b6f13bc4c273f1c0c6262a5daf4f87deb
|
[
"MIT"
] | 29
|
2015-01-03T15:17:01.000Z
|
2022-01-16T02:27:53.000Z
|
pyxFiles/setup.py
|
lanlugar/urban-lu-model
|
a8f7419b6f13bc4c273f1c0c6262a5daf4f87deb
|
[
"MIT"
] | null | null | null |
pyxFiles/setup.py
|
lanlugar/urban-lu-model
|
a8f7419b6f13bc4c273f1c0c6262a5daf4f87deb
|
[
"MIT"
] | 13
|
2017-11-16T08:06:43.000Z
|
2021-07-01T14:44:19.000Z
|
from distutils.core import setup
from Cython.Build import cythonize
import numpy
setup(
name = "cython files",
ext_modules = cythonize("*.pyx", include_dirs=[numpy.get_include()])
)
| 23.75
| 72
| 0.736842
| 25
| 190
| 5.48
| 0.68
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.147368
| 190
| 8
| 73
| 23.75
| 0.845679
| 0
| 0
| 0
| 0
| 0
| 0.089005
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.428571
| 0
| 0.428571
| 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
|
ddd36446f5809851804a17070cb66a07d7a5726d
| 45
|
py
|
Python
|
package/__init__.py
|
Adrian0350/PySQL
|
4781a41b140c285b29a0104f096734d53a02edf3
|
[
"MIT"
] | 1
|
2018-01-02T22:03:06.000Z
|
2018-01-02T22:03:06.000Z
|
package/__init__.py
|
Adrian0350/PySQL
|
4781a41b140c285b29a0104f096734d53a02edf3
|
[
"MIT"
] | null | null | null |
package/__init__.py
|
Adrian0350/PySQL
|
4781a41b140c285b29a0104f096734d53a02edf3
|
[
"MIT"
] | null | null | null |
from . import package
__version__ = '0.0.1'
| 11.25
| 21
| 0.688889
| 7
| 45
| 3.857143
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.081081
| 0.177778
| 45
| 3
| 22
| 15
| 0.648649
| 0
| 0
| 0
| 0
| 0
| 0.111111
| 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
|
dde248b078c0ec1fdac9ccefeeace2cabd40709d
| 153
|
py
|
Python
|
src/scrapper/scrapper/items/series_list_item.py
|
JeyKip/autoinfo-scrapper
|
ca0cb87b1d9486b71928fb08df734fc1413b7967
|
[
"MIT"
] | null | null | null |
src/scrapper/scrapper/items/series_list_item.py
|
JeyKip/autoinfo-scrapper
|
ca0cb87b1d9486b71928fb08df734fc1413b7967
|
[
"MIT"
] | null | null | null |
src/scrapper/scrapper/items/series_list_item.py
|
JeyKip/autoinfo-scrapper
|
ca0cb87b1d9486b71928fb08df734fc1413b7967
|
[
"MIT"
] | null | null | null |
from scrapy import Item, Field
class SeriesListItem(Item):
model_id = Field()
submodel_id = Field()
year_id = Field()
series = Field()
| 17
| 30
| 0.653595
| 19
| 153
| 5.105263
| 0.631579
| 0.216495
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.24183
| 153
| 8
| 31
| 19.125
| 0.836207
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.166667
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
fb0b38744a547dcf480f7f03ac6dd8a19f878ce8
| 156
|
py
|
Python
|
lib/asyncHTTP.py
|
LetSpotify/letspotify-server
|
d83c8b26a41d4f767b22f960e1ae233de5cad9be
|
[
"MIT"
] | null | null | null |
lib/asyncHTTP.py
|
LetSpotify/letspotify-server
|
d83c8b26a41d4f767b22f960e1ae233de5cad9be
|
[
"MIT"
] | null | null | null |
lib/asyncHTTP.py
|
LetSpotify/letspotify-server
|
d83c8b26a41d4f767b22f960e1ae233de5cad9be
|
[
"MIT"
] | null | null | null |
def handle_request(response):
if response.error:
print("Error:", response.error)
else:
print('called')
print(response.body)
| 22.285714
| 39
| 0.608974
| 17
| 156
| 5.529412
| 0.588235
| 0.276596
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.262821
| 156
| 6
| 40
| 26
| 0.817391
| 0
| 0
| 0
| 0
| 0
| 0.076923
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0
| 0
| 0.166667
| 0.5
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
fb14176bf7793ac2d2a5268d43dc9020aef7e89a
| 493
|
py
|
Python
|
pyctcdecode/tests/helpers.py
|
Rexiome/pyctcdecode
|
4d04495049098a01bbc5fd2f94428cb7eca755d3
|
[
"Apache-2.0"
] | 203
|
2021-06-08T22:49:56.000Z
|
2022-03-31T11:55:21.000Z
|
pyctcdecode/tests/helpers.py
|
Rexiome/pyctcdecode
|
4d04495049098a01bbc5fd2f94428cb7eca755d3
|
[
"Apache-2.0"
] | 40
|
2021-06-11T20:58:07.000Z
|
2022-03-23T10:58:27.000Z
|
pyctcdecode/tests/helpers.py
|
Rexiome/pyctcdecode
|
4d04495049098a01bbc5fd2f94428cb7eca755d3
|
[
"Apache-2.0"
] | 39
|
2021-06-09T21:03:35.000Z
|
2022-03-26T13:14:23.000Z
|
import os
import shutil
import tempfile
import unittest
class TempfileTestCase(unittest.TestCase):
def setUp(self):
"""Create a temp dir."""
self.temp_dir = tempfile.mkdtemp()
def tearDown(self):
"""Remove the temp dir."""
shutil.rmtree(self.temp_dir)
def clear_dir(self):
"""Clear the contents of the temp dir."""
if os.path.exists(self.temp_dir):
shutil.rmtree(self.temp_dir)
os.makedirs(self.temp_dir)
| 23.47619
| 49
| 0.626775
| 64
| 493
| 4.734375
| 0.421875
| 0.184818
| 0.181518
| 0.125413
| 0.19802
| 0.19802
| 0.19802
| 0
| 0
| 0
| 0
| 0
| 0.257606
| 493
| 20
| 50
| 24.65
| 0.827869
| 0.15213
| 0
| 0.153846
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.230769
| false
| 0
| 0.307692
| 0
| 0.615385
| 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
| 1
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
34bede3495aae03f8300d9e1e85e45e6842aa28f
| 100
|
py
|
Python
|
python/yaml2json.py
|
sparameswaran/nsx-t-gen
|
3fc26baff9e8f8da1990432c5d200899b6d7e33a
|
[
"Apache-2.0"
] | 23
|
2018-05-02T08:31:44.000Z
|
2021-04-30T13:39:30.000Z
|
python/yaml2json.py
|
lewang321/nsx-t-gen
|
3fc26baff9e8f8da1990432c5d200899b6d7e33a
|
[
"Apache-2.0"
] | 17
|
2018-04-26T02:42:40.000Z
|
2018-10-11T18:49:32.000Z
|
python/yaml2json.py
|
lewang321/nsx-t-gen
|
3fc26baff9e8f8da1990432c5d200899b6d7e33a
|
[
"Apache-2.0"
] | 11
|
2018-05-14T12:46:58.000Z
|
2021-04-30T13:39:25.000Z
|
#!/usr/bin/env python
import sys, yaml, json
y = yaml.load(sys.stdin.read())
print json.dumps(y)
| 12.5
| 31
| 0.68
| 18
| 100
| 3.777778
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.14
| 100
| 7
| 32
| 14.285714
| 0.790698
| 0.2
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.333333
| null | null | 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
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
34f63ef50bc98c1f5417b73341575ade5f12147a
| 92
|
py
|
Python
|
test/__init__.py
|
jonDuke/lambdata-jduke
|
712495aca7870398b24388c9e1388bfedf48dad2
|
[
"MIT"
] | null | null | null |
test/__init__.py
|
jonDuke/lambdata-jduke
|
712495aca7870398b24388c9e1388bfedf48dad2
|
[
"MIT"
] | 2
|
2021-04-01T08:17:59.000Z
|
2021-04-01T08:20:37.000Z
|
test/__init__.py
|
jonDuke/lambdata-jduke
|
712495aca7870398b24388c9e1388bfedf48dad2
|
[
"MIT"
] | null | null | null |
# __init__.py
# treat the surrounding folder like a module
# so files in it can be imported
| 23
| 44
| 0.76087
| 16
| 92
| 4.125
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.195652
| 92
| 4
| 45
| 23
| 0.891892
| 0.923913
| 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
|
5508835cfae878beadf458104b372cd58aeae434
| 558
|
py
|
Python
|
flask_db_demo/service.py
|
Face-Recognition-Learning-Group/flask_demo
|
37acf220f82e0e6135004ebe5186241cbf276d08
|
[
"Apache-2.0"
] | null | null | null |
flask_db_demo/service.py
|
Face-Recognition-Learning-Group/flask_demo
|
37acf220f82e0e6135004ebe5186241cbf276d08
|
[
"Apache-2.0"
] | null | null | null |
flask_db_demo/service.py
|
Face-Recognition-Learning-Group/flask_demo
|
37acf220f82e0e6135004ebe5186241cbf276d08
|
[
"Apache-2.0"
] | null | null | null |
# -*- coding: utf-8 -*-
# @Author : Ecohnoch(xcy)
# @File : service.py
# @Function : TODO
import uuid
import db_ops
def make_item(a, b, c, with_id=False):
item = {}
if with_id:
id_ = uuid.uuid1()
item['id'] = id_
item['a'] = a
item['b'] = b
item['c'] = c
return item
def insert_(item):
return db_ops.insert_(item)
def modify_(id_, item):
return db_ops.modify_(id_, item)
def query_(id_, with_id=False):
return db_ops.query_(id_, with_id=with_id)
def delete_(id_):
return db_ops.delete_(id_)
| 19.241379
| 46
| 0.603943
| 87
| 558
| 3.563218
| 0.356322
| 0.080645
| 0.141935
| 0.096774
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.004728
| 0.241935
| 558
| 29
| 47
| 19.241379
| 0.728132
| 0.155914
| 0
| 0
| 0
| 0
| 0.010707
| 0
| 0
| 0
| 0
| 0.034483
| 0
| 1
| 0.263158
| false
| 0
| 0.105263
| 0.210526
| 0.631579
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
550ab1618f4139cc15e17f90dd8a6d21612be1c3
| 515
|
py
|
Python
|
newsweec/utils/bot_utils.py
|
Adwaith-Rajesh/newsweec
|
f3b66fb6f74cb68be4e716269032db340abe8320
|
[
"MIT"
] | 13
|
2020-08-30T10:52:29.000Z
|
2021-08-18T12:20:39.000Z
|
newsweec/utils/bot_utils.py
|
Adwaith-Rajesh/newsweec
|
f3b66fb6f74cb68be4e716269032db340abe8320
|
[
"MIT"
] | null | null | null |
newsweec/utils/bot_utils.py
|
Adwaith-Rajesh/newsweec
|
f3b66fb6f74cb68be4e716269032db340abe8320
|
[
"MIT"
] | 1
|
2021-06-07T04:01:37.000Z
|
2021-06-07T04:01:37.000Z
|
# all the meta funcs related to the bot
from telebot.types import CallbackQuery
from telebot.types import Message
from ._dataclasses import MessageInfo
def message_info_generator(msg: Message) -> MessageInfo:
"""Get important info from the message
like:
chat_id, message_id, user_id, msg_text
"""
return MessageInfo(user_id=msg.from_user.id, chat_id=msg.chat.id,
message_id=msg.message_id, text=msg.text)
def call_back_data_generator(cb: CallbackQuery):
pass
| 27.105263
| 69
| 0.724272
| 73
| 515
| 4.90411
| 0.438356
| 0.055866
| 0.089385
| 0.122905
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.2
| 515
| 18
| 70
| 28.611111
| 0.868932
| 0.238835
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0.125
| 0.375
| 0
| 0.75
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 1
| 0
| 1
| 0
|
0
| 4
|
9b2cca39d49982469712991b0ab1392f356daa55
| 96
|
py
|
Python
|
drf_cassandra_boilerplate/api_example/apps.py
|
LowerSilesians/drf-cassandra-boilerplate
|
22d2a533d7240e1f11e3cb9b869b04301de6e4a0
|
[
"Apache-2.0"
] | 1
|
2017-07-04T07:52:46.000Z
|
2017-07-04T07:52:46.000Z
|
drf_cassandra_boilerplate/api_example/apps.py
|
LowerSilesians/drf-cassandra-boilerplate
|
22d2a533d7240e1f11e3cb9b869b04301de6e4a0
|
[
"Apache-2.0"
] | null | null | null |
drf_cassandra_boilerplate/api_example/apps.py
|
LowerSilesians/drf-cassandra-boilerplate
|
22d2a533d7240e1f11e3cb9b869b04301de6e4a0
|
[
"Apache-2.0"
] | null | null | null |
from django.apps import AppConfig
class ApiExampleConfig(AppConfig):
name = 'api_example'
| 16
| 34
| 0.770833
| 11
| 96
| 6.636364
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.15625
| 96
| 5
| 35
| 19.2
| 0.901235
| 0
| 0
| 0
| 0
| 0
| 0.114583
| 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
|
9b304eff0f61749c25d2b99c78626158e839a721
| 468
|
py
|
Python
|
src/serveme/logoutController.py
|
Adam-Albawab/ServeMe
|
0ec2cc72decea1063223c695ba45e67d0861b2d8
|
[
"MIT"
] | null | null | null |
src/serveme/logoutController.py
|
Adam-Albawab/ServeMe
|
0ec2cc72decea1063223c695ba45e67d0861b2d8
|
[
"MIT"
] | null | null | null |
src/serveme/logoutController.py
|
Adam-Albawab/ServeMe
|
0ec2cc72decea1063223c695ba45e67d0861b2d8
|
[
"MIT"
] | null | null | null |
from flask import Blueprint, render_template, redirect, url_for, request, flash
from werkzeug.security import generate_password_hash, check_password_hash
from flask_login import login_user, logout_user, login_required
from .models import User, Provider
from . import db
import uuid
logoutController = Blueprint('logoutController', __name__)
@logoutController.route('/logout')
@login_required
def logout():
logout_user()
return redirect(url_for('main.index'))
| 33.428571
| 79
| 0.809829
| 60
| 468
| 6.033333
| 0.533333
| 0.049724
| 0.077348
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.108974
| 468
| 14
| 80
| 33.428571
| 0.868106
| 0
| 0
| 0
| 1
| 0
| 0.070362
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.083333
| false
| 0.083333
| 0.5
| 0
| 0.666667
| 0.166667
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
|
0
| 4
|
9b3251597b844277dee845bf3341f0b0788782b7
| 805
|
py
|
Python
|
reps/envs/__init__.py
|
hanyas/reps
|
447c461b89dec516ce3368d841cfe9734be78199
|
[
"MIT"
] | 8
|
2021-06-21T18:58:56.000Z
|
2021-12-13T09:47:41.000Z
|
reps/envs/__init__.py
|
hanyas/reps
|
447c461b89dec516ce3368d841cfe9734be78199
|
[
"MIT"
] | null | null | null |
reps/envs/__init__.py
|
hanyas/reps
|
447c461b89dec516ce3368d841cfe9734be78199
|
[
"MIT"
] | 1
|
2021-06-29T04:42:45.000Z
|
2021-06-29T04:42:45.000Z
|
from .discrete.grid import Grid
from .episodic.benchmarks import Sphere
from .episodic.benchmarks import Rosenbrock
from .episodic.benchmarks import Rastrigin
from .episodic.benchmarks import Styblinski
from .episodic.benchmarks import Himmelblau
from .contextual.benchmarks import CSphere
from .control.lqr.lqr import LQR
from .control.pendulum.pendulum import Pendulum
from .control.pendulum.pendulum import PendulumWithCartesianObservation
from .control.cartpole.cartpole import Cartpole
from .control.cartpole.cartpole import CartpoleWithCartesianObservation
from .control.hybrid.pole import PoleWithWall
from .control.hybrid.hb_pole import HybridPoleWithWall
from .control.hybrid.hb_pendulum import HybridPendulum
from .control.hybrid.hb_pendulum import HybridPendulumWithCartesianObservation
| 33.541667
| 78
| 0.86087
| 92
| 805
| 7.5
| 0.282609
| 0.143478
| 0.15942
| 0.202899
| 0.286957
| 0.095652
| 0
| 0
| 0
| 0
| 0
| 0
| 0.088199
| 805
| 23
| 79
| 35
| 0.940055
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 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
|
9b326395d5b5d0e9ee990799c90a7befb5defa9e
| 351
|
py
|
Python
|
mlrun/frameworks/_ml_common/plans/__init__.py
|
george0st/mlrun
|
6467d3a5ceadf6cd35512b84b3ddc3da611cf39a
|
[
"Apache-2.0"
] | null | null | null |
mlrun/frameworks/_ml_common/plans/__init__.py
|
george0st/mlrun
|
6467d3a5ceadf6cd35512b84b3ddc3da611cf39a
|
[
"Apache-2.0"
] | null | null | null |
mlrun/frameworks/_ml_common/plans/__init__.py
|
george0st/mlrun
|
6467d3a5ceadf6cd35512b84b3ddc3da611cf39a
|
[
"Apache-2.0"
] | null | null | null |
# flake8: noqa - this is until we take care of the F401 violations with respect to __all__ & sphinx
from .calibration_curve_plan import CalibrationCurvePlan
from .confusion_matrix_plan import ConfusionMatrixPlan
from .dataset_plan import DatasetPlan
from .feature_importance_plan import FeatureImportancePlan
from .roc_curve_plan import ROCCurvePlan
| 50.142857
| 100
| 0.85755
| 46
| 351
| 6.26087
| 0.717391
| 0.173611
| 0.104167
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.012903
| 0.116809
| 351
| 6
| 101
| 58.5
| 0.916129
| 0.279202
| 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
|
9b40678f266e0d35f1e336e50ae7846e9f01ba3f
| 216
|
py
|
Python
|
old_test_project/ajax_create/models.py
|
bburan/django-autocomplete-light
|
064676061b101d5d47655e8598b21cbaf7716ae8
|
[
"MIT"
] | 1
|
2015-07-01T02:26:51.000Z
|
2015-07-01T02:26:51.000Z
|
old_test_project/ajax_create/models.py
|
bburan/django-autocomplete-light
|
064676061b101d5d47655e8598b21cbaf7716ae8
|
[
"MIT"
] | null | null | null |
old_test_project/ajax_create/models.py
|
bburan/django-autocomplete-light
|
064676061b101d5d47655e8598b21cbaf7716ae8
|
[
"MIT"
] | null | null | null |
from django.db import models
class Creatable(models.Model):
name = models.CharField(max_length=100)
related = models.ManyToManyField('self', blank=True)
def __unicode__(self):
return self.name
| 21.6
| 56
| 0.712963
| 27
| 216
| 5.518519
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.017045
| 0.185185
| 216
| 9
| 57
| 24
| 0.829545
| 0
| 0
| 0
| 0
| 0
| 0.018519
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0.166667
| 0.166667
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
9b69c089e4965bac9492193dceb349410c34ffb7
| 21
|
py
|
Python
|
skillful/tests/__init__.py
|
bmweiner/skillful
|
8646f54faf62cb63f165f7699b8ace5b4a08233c
|
[
"MIT"
] | 2
|
2017-12-08T08:39:31.000Z
|
2021-09-01T17:45:35.000Z
|
skillful/tests/__init__.py
|
bmweiner/skillful
|
8646f54faf62cb63f165f7699b8ace5b4a08233c
|
[
"MIT"
] | null | null | null |
skillful/tests/__init__.py
|
bmweiner/skillful
|
8646f54faf62cb63f165f7699b8ace5b4a08233c
|
[
"MIT"
] | 3
|
2017-03-09T21:31:09.000Z
|
2021-09-01T17:45:42.000Z
|
"""skillful tests"""
| 10.5
| 20
| 0.619048
| 2
| 21
| 6.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.095238
| 21
| 1
| 21
| 21
| 0.684211
| 0.666667
| 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
|
9b6b77b64174e29db267a9bb06f840f75b049ead
| 279
|
py
|
Python
|
tests/util/context.py
|
leoschet/crypto-forecaster
|
e7913aaa79aa70d451fd230497aa92d83e6f73eb
|
[
"MIT"
] | null | null | null |
tests/util/context.py
|
leoschet/crypto-forecaster
|
e7913aaa79aa70d451fd230497aa92d83e6f73eb
|
[
"MIT"
] | null | null | null |
tests/util/context.py
|
leoschet/crypto-forecaster
|
e7913aaa79aa70d451fd230497aa92d83e6f73eb
|
[
"MIT"
] | 1
|
2018-06-16T14:59:51.000Z
|
2018-06-16T14:59:51.000Z
|
"""
To run any of the tests, one must use the -m flag. For this to work,
one should also write the file path using the python module notation.
i.e.: python -m test.aode
"""
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
| 27.9
| 82
| 0.709677
| 52
| 279
| 3.730769
| 0.673077
| 0.092784
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.004237
| 0.154122
| 279
| 9
| 83
| 31
| 0.817797
| 0.591398
| 0
| 0
| 0
| 0
| 0.018868
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
9b6c2fd198bc7fcb6999d3fce8c2d4b2c235bdb1
| 104
|
py
|
Python
|
src/deckman/main.py
|
rembo10/deckman
|
fe6bbd4ea1ee290479403ba8c9547a740c8fdd7f
|
[
"WTFPL"
] | null | null | null |
src/deckman/main.py
|
rembo10/deckman
|
fe6bbd4ea1ee290479403ba8c9547a740c8fdd7f
|
[
"WTFPL"
] | null | null | null |
src/deckman/main.py
|
rembo10/deckman
|
fe6bbd4ea1ee290479403ba8c9547a740c8fdd7f
|
[
"WTFPL"
] | null | null | null |
#!/usr/bin/env python
def start():
print("Hello, world.")
if __name__ == '__main__':
start()
| 11.555556
| 26
| 0.586538
| 13
| 104
| 4.076923
| 0.923077
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.211538
| 104
| 8
| 27
| 13
| 0.646341
| 0.192308
| 0
| 0
| 0
| 0
| 0.253012
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| true
| 0
| 0
| 0
| 0.25
| 0.25
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
9ba5fd000057126b6fc98c559e89cd2abb134ba7
| 702
|
py
|
Python
|
Plugins/Transforms/__init__.py
|
bvbohnen/X4_Customizer
|
6f865008690916a66a44c97331d9a2692baedb35
|
[
"MIT"
] | 25
|
2018-12-10T12:52:11.000Z
|
2022-01-29T14:42:57.000Z
|
Plugins/Transforms/__init__.py
|
bvbohnen/X4_Customizer
|
6f865008690916a66a44c97331d9a2692baedb35
|
[
"MIT"
] | 4
|
2019-08-01T19:09:11.000Z
|
2022-01-02T01:47:42.000Z
|
Plugins/Transforms/__init__.py
|
bvbohnen/X4_Customizer
|
6f865008690916a66a44c97331d9a2692baedb35
|
[
"MIT"
] | 6
|
2019-02-16T08:39:04.000Z
|
2021-12-21T06:11:58.000Z
|
'''
Subpackage with all transforms.
'''
# TODO: convert all of these to * syntax with __all__ defined.
from .Director import Adjust_Mission_Rewards
from .Director import Adjust_Mission_Reward_Mod_Chance
from .Exe import *
from .Jobs import Adjust_Job_Count
# Subpackages; these can import all since these already picked out
# the individual transforms.
#from .Weapon import *
#from .Director import *
from .Map import Scale_Sector_Size
from .Misc import Apply_Live_Editor_Patches
from .Scripts import *
from .Ships import *
from .Surface_Elements import *
from .Text import Color_Text
from .Wares import Adjust_Ware_Price_Spread
from .Wares import Adjust_Ware_Prices
from .Weapons import *
| 21.272727
| 66
| 0.794872
| 100
| 702
| 5.34
| 0.54
| 0.11236
| 0.101124
| 0.089888
| 0.209738
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.149573
| 702
| 32
| 67
| 21.9375
| 0.894472
| 0.327635
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.03125
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
9bb8ba999963f25014d243d9a56aa4f620f7dcd1
| 151
|
py
|
Python
|
tests/test_os.py
|
voltur01/remotebit
|
e114a316f0a8b62c9cdc2e87326ef11ccdb12598
|
[
"MIT"
] | 2
|
2021-04-27T06:11:33.000Z
|
2021-06-02T06:04:18.000Z
|
tests/test_os.py
|
voltur01/remotebit
|
e114a316f0a8b62c9cdc2e87326ef11ccdb12598
|
[
"MIT"
] | null | null | null |
tests/test_os.py
|
voltur01/remotebit
|
e114a316f0a8b62c9cdc2e87326ef11ccdb12598
|
[
"MIT"
] | null | null | null |
# SPDX-License-Identifier: MIT
# Copyright (c) 2021 Volodymyr Turanskyy
from testing_utils import *
from microbit import *
import os
n = os.uname()
| 15.1
| 40
| 0.748344
| 21
| 151
| 5.333333
| 0.809524
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.031746
| 0.165563
| 151
| 9
| 41
| 16.777778
| 0.857143
| 0.443709
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.75
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
32f811014f056002da3f6b5e83931d7255ac175c
| 241
|
py
|
Python
|
weaviate/batch/__init__.py
|
cdpierse/weaviate-python-client
|
9571e97b3eb7266655a7635b8de47b18ccf64732
|
[
"BSD-3-Clause"
] | null | null | null |
weaviate/batch/__init__.py
|
cdpierse/weaviate-python-client
|
9571e97b3eb7266655a7635b8de47b18ccf64732
|
[
"BSD-3-Clause"
] | null | null | null |
weaviate/batch/__init__.py
|
cdpierse/weaviate-python-client
|
9571e97b3eb7266655a7635b8de47b18ccf64732
|
[
"BSD-3-Clause"
] | null | null | null |
"""
Module for uploading objects and references to Weaviate in batches.
"""
from .crud_batch import Batch
from .requests import ReferenceBatchRequest, ObjectsBatchRequest
__all__ = ['Batch', 'ReferenceBatchRequest', 'ObjectsBatchRequest']
| 26.777778
| 67
| 0.79668
| 24
| 241
| 7.791667
| 0.75
| 0.427807
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.116183
| 241
| 8
| 68
| 30.125
| 0.877934
| 0.278008
| 0
| 0
| 0
| 0
| 0.271084
| 0.126506
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
32f8d65952289798c56c88f622765918bfd17aac
| 270
|
py
|
Python
|
dbscan/optics.py
|
PepSalehi/algorithms
|
1c20f57185e6324aa840ccff98e69764b4213131
|
[
"MIT"
] | 209
|
2015-01-02T03:47:12.000Z
|
2022-03-06T16:54:47.000Z
|
dbscan/optics.py
|
Kerwin-Xie/algorithms
|
4347a9b7bf54ef378d16d26ef9e357ddc710664b
|
[
"MIT"
] | 3
|
2015-12-06T14:40:34.000Z
|
2021-03-22T17:40:24.000Z
|
dbscan/optics.py
|
Kerwin-Xie/algorithms
|
4347a9b7bf54ef378d16d26ef9e357ddc710664b
|
[
"MIT"
] | 114
|
2015-01-31T08:37:10.000Z
|
2022-02-23T04:42:28.000Z
|
#!/usr/bin/env python
"""Pseudocode for the OPTICS algorithm."""
def optics(objects, epsilon, min_points):
"""
Clustering.
Parameters
----------
objects : set
epsilon : float
min_points : int
"""
assert min_points >= 1
# TODO
| 15
| 42
| 0.574074
| 29
| 270
| 5.241379
| 0.758621
| 0.177632
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005128
| 0.277778
| 270
| 17
| 43
| 15.882353
| 0.774359
| 0.533333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.058824
| 0.5
| 1
| 0.5
| false
| 0
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
fd09e06208625e151bf2ece6b16e6551b1733172
| 119
|
py
|
Python
|
scheduling/__main__.py
|
georges-da-costa/Scheduling-of-malleable-HPC-MPI-applications
|
6e84247684f5a5ccb800e7850145fd3026a28e51
|
[
"MIT"
] | null | null | null |
scheduling/__main__.py
|
georges-da-costa/Scheduling-of-malleable-HPC-MPI-applications
|
6e84247684f5a5ccb800e7850145fd3026a28e51
|
[
"MIT"
] | 1
|
2020-05-07T18:55:23.000Z
|
2020-05-07T18:55:23.000Z
|
scheduling/__main__.py
|
georges-da-costa/Scheduling-of-malleable-HPC-MPI-applications
|
6e84247684f5a5ccb800e7850145fd3026a28e51
|
[
"MIT"
] | 2
|
2021-06-03T15:11:43.000Z
|
2022-02-17T10:22:24.000Z
|
#!/usr/bin/env python
import sys
import scheduling
if __name__ == "__main__":
scheduling.main(args=sys.argv[1:])
| 14.875
| 38
| 0.705882
| 17
| 119
| 4.470588
| 0.764706
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.009804
| 0.142857
| 119
| 7
| 39
| 17
| 0.735294
| 0.168067
| 0
| 0
| 0
| 0
| 0.081633
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 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
|
fd0cc89117e3eca8cc7bb1d78f4ed4fcdbac41bf
| 105
|
py
|
Python
|
core/api/request/books_get_request.py
|
averak/rits-exp3-vr
|
63fdff1ea4ba0a394000391faac799d972dde251
|
[
"MIT"
] | null | null | null |
core/api/request/books_get_request.py
|
averak/rits-exp3-vr
|
63fdff1ea4ba0a394000391faac799d972dde251
|
[
"MIT"
] | null | null | null |
core/api/request/books_get_request.py
|
averak/rits-exp3-vr
|
63fdff1ea4ba0a394000391faac799d972dde251
|
[
"MIT"
] | null | null | null |
from pydantic import BaseModel
class BooksGetRequest(BaseModel):
keyword: str
max_results: int
| 15
| 33
| 0.761905
| 12
| 105
| 6.583333
| 0.916667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.190476
| 105
| 6
| 34
| 17.5
| 0.929412
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.25
| 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
| 0
| 0
| 1
| 0
|
0
| 4
|
fd3e1b6567389d475dbfe0197e60d30d7b1e846d
| 642
|
py
|
Python
|
mongoengine_plus/aio/async_query_set.py
|
cuenca-mx/mongoengine-plus
|
01e55db2af58477bac2621ff51708daae3416268
|
[
"MIT"
] | null | null | null |
mongoengine_plus/aio/async_query_set.py
|
cuenca-mx/mongoengine-plus
|
01e55db2af58477bac2621ff51708daae3416268
|
[
"MIT"
] | 43
|
2021-04-30T20:02:49.000Z
|
2022-03-30T16:16:30.000Z
|
mongoengine_plus/aio/async_query_set.py
|
cuenca-mx/mongoengine-plus
|
01e55db2af58477bac2621ff51708daae3416268
|
[
"MIT"
] | null | null | null |
from mongoengine import QuerySet
from .utils import create_awaitable
class AsyncQuerySet(QuerySet):
async def async_first(self):
return await create_awaitable(self.first)
async def async_get(self, *q_objs, **query):
return await create_awaitable(self.get, *q_objs, **query)
async def async_count(self, with_limit_and_skip=False):
return await create_awaitable(self.count, with_limit_and_skip)
async def async_to_list(self):
return await create_awaitable(list, self)
async def async_update(self, *u_objs, **query):
return await create_awaitable(self.update, *u_objs, **query)
| 30.571429
| 70
| 0.727414
| 89
| 642
| 5
| 0.325843
| 0.202247
| 0.146067
| 0.292135
| 0.386517
| 0.175281
| 0.175281
| 0
| 0
| 0
| 0
| 0
| 0.183801
| 642
| 20
| 71
| 32.1
| 0.849237
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.153846
| 0
| 0.615385
| 0
| 0
| 0
| 0
| null | 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
fd3f15b0f8f30f1865869db6b85db5e234e99e9e
| 602
|
py
|
Python
|
examples/code_scoreboard/demo.py
|
Arcensoth/beet
|
8a20a6fbee8724d8c26fe7e9ade68dffa57406bd
|
[
"MIT"
] | 46
|
2021-03-09T23:34:52.000Z
|
2022-03-08T01:30:04.000Z
|
examples/code_scoreboard/demo.py
|
Arcensoth/beet
|
8a20a6fbee8724d8c26fe7e9ade68dffa57406bd
|
[
"MIT"
] | 127
|
2021-02-24T00:41:44.000Z
|
2022-03-31T05:14:31.000Z
|
examples/code_scoreboard/demo.py
|
Arcensoth/beet
|
8a20a6fbee8724d8c26fe7e9ade68dffa57406bd
|
[
"MIT"
] | 9
|
2021-03-11T18:18:28.000Z
|
2022-03-11T20:32:01.000Z
|
from beet import Context
def beet_default(ctx: Context):
ctx.generate.objective()
ctx.generate.objective("{hash}", "something")
ctx.generate.objective("hello", criterion="playerKillCount")
ctx.generate.objective("world", display="Something")
generate = ctx.generate["foo"]["bar"]
generate.objective()
generate.objective("{hash}", "something")
generate.objective("hello", criterion="playerKillCount")
generate.objective("world", display="Something")
ctx.generate.objective(
"{hash}", "something", display={"text": "Update name", "color": "red"}
)
| 31.684211
| 78
| 0.67608
| 61
| 602
| 6.655738
| 0.377049
| 0.376847
| 0.246305
| 0.221675
| 0.576355
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.147841
| 602
| 18
| 79
| 33.444444
| 0.791423
| 0
| 0
| 0
| 1
| 0
| 0.23588
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.071429
| false
| 0
| 0.071429
| 0
| 0.142857
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
fd56d28c514c35f29afe6d70ada455656116603e
| 46
|
py
|
Python
|
test01.py
|
HarryBaek/Python_Linux
|
684265674a861089beac4270342059e22628d0cc
|
[
"Apache-2.0"
] | null | null | null |
test01.py
|
HarryBaek/Python_Linux
|
684265674a861089beac4270342059e22628d0cc
|
[
"Apache-2.0"
] | null | null | null |
test01.py
|
HarryBaek/Python_Linux
|
684265674a861089beac4270342059e22628d0cc
|
[
"Apache-2.0"
] | null | null | null |
a = 1
b = 2
c = 3
print(a)
print(b)
print(c)
| 5.75
| 8
| 0.521739
| 12
| 46
| 2
| 0.583333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.090909
| 0.282609
| 46
| 7
| 9
| 6.571429
| 0.636364
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.5
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
bd0e40f0e0dfd300ed7d23e3a0b78c70e7983888
| 80
|
py
|
Python
|
hello-world-python/handler.py
|
jonhealy1/lambda_serverless
|
9d88933accaf3a22bb4383f39ced4be9c606e35e
|
[
"MIT"
] | null | null | null |
hello-world-python/handler.py
|
jonhealy1/lambda_serverless
|
9d88933accaf3a22bb4383f39ced4be9c606e35e
|
[
"MIT"
] | null | null | null |
hello-world-python/handler.py
|
jonhealy1/lambda_serverless
|
9d88933accaf3a22bb4383f39ced4be9c606e35e
|
[
"MIT"
] | null | null | null |
def hello(event, context):
print("second update!")
return "hello-world"
| 20
| 27
| 0.6625
| 10
| 80
| 5.3
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.1875
| 80
| 3
| 28
| 26.666667
| 0.815385
| 0
| 0
| 0
| 0
| 0
| 0.3125
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.666667
| 0.333333
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
bd2a7f09027e19e1902119d7a26cf4b292278020
| 129
|
py
|
Python
|
Python/python_programming_stu/chapter09_class/9-3.book_reader_class.py
|
min9288/Multicampus
|
2aaac730b35e530f8f91cb1ba41c08ee18d59142
|
[
"MIT"
] | 2
|
2022-01-18T09:27:42.000Z
|
2022-03-29T14:59:00.000Z
|
Python/python_programming_stu/chapter09_class/9-3.book_reader_class.py
|
min9288/Multicampus
|
2aaac730b35e530f8f91cb1ba41c08ee18d59142
|
[
"MIT"
] | null | null | null |
Python/python_programming_stu/chapter09_class/9-3.book_reader_class.py
|
min9288/Multicampus
|
2aaac730b35e530f8f91cb1ba41c08ee18d59142
|
[
"MIT"
] | null | null | null |
class BookReader:
country = 'South Korea'
print(BookReader.country )
BookReader.country = 'USA'
print(BookReader.country )
| 16.125
| 27
| 0.744186
| 14
| 129
| 6.857143
| 0.5
| 0.708333
| 0.458333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.147287
| 129
| 7
| 28
| 18.428571
| 0.872727
| 0
| 0
| 0.4
| 0
| 0
| 0.109375
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0.4
| 0.4
| 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
|
bd3551ac48c03b372270d744f7cb60a95d649032
| 149
|
py
|
Python
|
Gui/Raiz/Root.py
|
ScripterSevla/Testes
|
a661f937b6a54176a938d6d8fddb828ee5ec75a4
|
[
"Apache-2.0"
] | null | null | null |
Gui/Raiz/Root.py
|
ScripterSevla/Testes
|
a661f937b6a54176a938d6d8fddb828ee5ec75a4
|
[
"Apache-2.0"
] | null | null | null |
Gui/Raiz/Root.py
|
ScripterSevla/Testes
|
a661f937b6a54176a938d6d8fddb828ee5ec75a4
|
[
"Apache-2.0"
] | null | null | null |
from tkinter import *
class Root(Tk):
def __init__(self, *args, **kwargs):
Tk.__init__(self, *args, **kwargs)
self.grid()
| 12.416667
| 43
| 0.57047
| 18
| 149
| 4.277778
| 0.666667
| 0.207792
| 0.311688
| 0.467532
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.275168
| 149
| 11
| 44
| 13.545455
| 0.712963
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.2
| 0
| 0.6
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
1fb8e4dbf4c2f7dc115330ce3028bbf34233f715
| 57
|
py
|
Python
|
feedshepherd/__init__.py
|
CraigKelly/feedshepherd
|
74d1a3d85ce0465d18365d829db71b63d1e82ee6
|
[
"MIT"
] | null | null | null |
feedshepherd/__init__.py
|
CraigKelly/feedshepherd
|
74d1a3d85ce0465d18365d829db71b63d1e82ee6
|
[
"MIT"
] | null | null | null |
feedshepherd/__init__.py
|
CraigKelly/feedshepherd
|
74d1a3d85ce0465d18365d829db71b63d1e82ee6
|
[
"MIT"
] | null | null | null |
"""feedshepherd
All your (fairly simple) feed needs
"""
| 11.4
| 35
| 0.701754
| 7
| 57
| 5.714286
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.157895
| 57
| 4
| 36
| 14.25
| 0.833333
| 0.859649
| 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
|
1f1631fedd509572a30a4e44ee2d7a94c3251ba8
| 161
|
py
|
Python
|
teacher/urls.py
|
Portfolio-APPS/web-app
|
57dc3243fc17d1429f30b9337e2633197505671c
|
[
"MIT"
] | null | null | null |
teacher/urls.py
|
Portfolio-APPS/web-app
|
57dc3243fc17d1429f30b9337e2633197505671c
|
[
"MIT"
] | 7
|
2020-06-05T18:11:24.000Z
|
2022-03-11T23:20:15.000Z
|
teacher/urls.py
|
Portfolio-APPS/web-app
|
57dc3243fc17d1429f30b9337e2633197505671c
|
[
"MIT"
] | null | null | null |
from django.urls import path, include, re_path
from . import views
urlpatterns = [
re_path(r'^edit/teacher/$', views.edit_teacher, name='edit_teacher'),
]
| 20.125
| 73
| 0.720497
| 23
| 161
| 4.869565
| 0.565217
| 0.294643
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.142857
| 161
| 7
| 74
| 23
| 0.811594
| 0
| 0
| 0
| 0
| 0
| 0.167702
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4
| 0
| 0.4
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
1f1ce96a9d9cfc091e1313ce20933dc650d3f87e
| 62
|
py
|
Python
|
project/apps/certification/__init__.py
|
kostik/vrs
|
a347c2d901e1a6b60a85480c9d2b247157881fce
|
[
"BSD-3-Clause"
] | 1
|
2016-11-09T18:57:23.000Z
|
2016-11-09T18:57:23.000Z
|
project/apps/certification/__init__.py
|
kostik/vrs
|
a347c2d901e1a6b60a85480c9d2b247157881fce
|
[
"BSD-3-Clause"
] | null | null | null |
project/apps/certification/__init__.py
|
kostik/vrs
|
a347c2d901e1a6b60a85480c9d2b247157881fce
|
[
"BSD-3-Clause"
] | 4
|
2016-09-30T08:24:09.000Z
|
2019-02-28T14:09:19.000Z
|
default_app_config = 'certification.apps.CertificationConfig'
| 31
| 61
| 0.870968
| 6
| 62
| 8.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.048387
| 62
| 1
| 62
| 62
| 0.881356
| 0
| 0
| 0
| 0
| 0
| 0.612903
| 0.612903
| 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
|
1f845b22fd931fbf469ebb19db146e22f69c2a08
| 208
|
py
|
Python
|
moretext/__init__.py
|
pm5/python-moretext
|
42cbbc22feeb22d51553a3935ee2162b5369b25b
|
[
"MIT-0"
] | null | null | null |
moretext/__init__.py
|
pm5/python-moretext
|
42cbbc22feeb22d51553a3935ee2162b5369b25b
|
[
"MIT-0"
] | null | null | null |
moretext/__init__.py
|
pm5/python-moretext
|
42cbbc22feeb22d51553a3935ee2162b5369b25b
|
[
"MIT-0"
] | null | null | null |
import httplib2
import json
def sentences():
h = httplib2.Http()
(resp_headers, content) = h.request('http://more.handlino.com/sentences.json', 'GET')
return json.loads(content.decode('utf-8'))
| 23.111111
| 89
| 0.6875
| 28
| 208
| 5.071429
| 0.714286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.016854
| 0.144231
| 208
| 8
| 90
| 26
| 0.780899
| 0
| 0
| 0
| 0
| 0
| 0.227053
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
2f4346f5630e319ea0027474b4171d292f02f3c7
| 140
|
py
|
Python
|
src/api/pdi/application/operation/GetDataOperationJobExecutionLogList/GetDataOperationJobExecutionLogListRequest.py
|
ahmetcagriakca/pythondataintegrator
|
079b968d6c893008f02c88dbe34909a228ac1c7b
|
[
"MIT"
] | 1
|
2020-12-18T21:37:28.000Z
|
2020-12-18T21:37:28.000Z
|
src/api/pdi/application/operation/GetDataOperationJobExecutionLogList/GetDataOperationJobExecutionLogListRequest.py
|
ahmetcagriakca/pythondataintegrator
|
079b968d6c893008f02c88dbe34909a228ac1c7b
|
[
"MIT"
] | null | null | null |
src/api/pdi/application/operation/GetDataOperationJobExecutionLogList/GetDataOperationJobExecutionLogListRequest.py
|
ahmetcagriakca/pythondataintegrator
|
079b968d6c893008f02c88dbe34909a228ac1c7b
|
[
"MIT"
] | 1
|
2020-12-18T21:37:31.000Z
|
2020-12-18T21:37:31.000Z
|
from pdip.cqrs.decorators import requestclass
@requestclass
class GetDataOperationJobExecutionLogListRequest:
ExecutionId: int = None
| 20
| 49
| 0.835714
| 12
| 140
| 9.75
| 0.916667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.121429
| 140
| 6
| 50
| 23.333333
| 0.95122
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 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
| 0
| 1
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
2f52afaf910046981f4050c293501f53ef1d39e5
| 26
|
py
|
Python
|
src/ehrpreper/core/writer/__init__.py
|
ClaudioBorges/ehrpreper
|
294d2659ad6a49fb2d203bd99bc000e920fc6e98
|
[
"Apache-2.0"
] | null | null | null |
src/ehrpreper/core/writer/__init__.py
|
ClaudioBorges/ehrpreper
|
294d2659ad6a49fb2d203bd99bc000e920fc6e98
|
[
"Apache-2.0"
] | null | null | null |
src/ehrpreper/core/writer/__init__.py
|
ClaudioBorges/ehrpreper
|
294d2659ad6a49fb2d203bd99bc000e920fc6e98
|
[
"Apache-2.0"
] | null | null | null |
"""init py for writer."""
| 13
| 25
| 0.576923
| 4
| 26
| 3.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.153846
| 26
| 1
| 26
| 26
| 0.681818
| 0.730769
| 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
|
85d77d87d66f8b42402f7feec67c8ab1a03335d0
| 225
|
py
|
Python
|
server/src/settings.py
|
budtmo/GIoT
|
4cfdeacbe53b2bee10613519d86fa1bb0d9057b4
|
[
"Apache-2.0"
] | null | null | null |
server/src/settings.py
|
budtmo/GIoT
|
4cfdeacbe53b2bee10613519d86fa1bb0d9057b4
|
[
"Apache-2.0"
] | null | null | null |
server/src/settings.py
|
budtmo/GIoT
|
4cfdeacbe53b2bee10613519d86fa1bb0d9057b4
|
[
"Apache-2.0"
] | null | null | null |
import os
DB_HOST = os.getenv('DB_HOST', '127.0.0.1')
DB_PORT = os.getenv('DB_PORT', 5432)
DB_NAME = os.getenv('DB_NAME', 'GIoT')
DB_USER = os.getenv('DB_USER', 'root')
DB_PASS = os.getenv('DB_PASS', 'root')
APP_PORT = 8080
| 25
| 43
| 0.675556
| 43
| 225
| 3.27907
| 0.395349
| 0.283688
| 0.35461
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.070352
| 0.115556
| 225
| 8
| 44
| 28.125
| 0.638191
| 0
| 0
| 0
| 0
| 0
| 0.248889
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.142857
| 0.142857
| 0
| 0.142857
| 0
| 0
| 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
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
85f9427215dfa440535c88b99f6a4d519bc4c6d3
| 146
|
py
|
Python
|
setup.py
|
owezzy/myDiary
|
40bc10805412415418fda615cd53426dec1178d3
|
[
"MIT"
] | null | null | null |
setup.py
|
owezzy/myDiary
|
40bc10805412415418fda615cd53426dec1178d3
|
[
"MIT"
] | null | null | null |
setup.py
|
owezzy/myDiary
|
40bc10805412415418fda615cd53426dec1178d3
|
[
"MIT"
] | null | null | null |
from setuptools import setup, find_packages
setup(
name='diary-api',
packages=find_packages(where='app'),
package_dir={'': 'app'},
)
| 18.25
| 43
| 0.671233
| 18
| 146
| 5.277778
| 0.722222
| 0.252632
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.164384
| 146
| 7
| 44
| 20.857143
| 0.778689
| 0
| 0
| 0
| 0
| 0
| 0.10274
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.166667
| 0
| 0.166667
| 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
|
c8294c0d6845cf090b21362185fc371e958f7c30
| 112
|
py
|
Python
|
Codes/05. Example 02.py
|
mrfoxie/Python-for-beginners
|
4aaff536cf4c311fd4fbd6cb913a546c4db66c50
|
[
"MIT"
] | null | null | null |
Codes/05. Example 02.py
|
mrfoxie/Python-for-beginners
|
4aaff536cf4c311fd4fbd6cb913a546c4db66c50
|
[
"MIT"
] | null | null | null |
Codes/05. Example 02.py
|
mrfoxie/Python-for-beginners
|
4aaff536cf4c311fd4fbd6cb913a546c4db66c50
|
[
"MIT"
] | null | null | null |
# Ask two question: person's name and favourite color.
# Then, print a message like "Siddh likes orange color."
| 37.333333
| 56
| 0.75
| 18
| 112
| 4.666667
| 0.944444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.169643
| 112
| 2
| 57
| 56
| 0.903226
| 0.955357
| 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
|
c84d017ed8c79d7e88217ee30b8da301140ecd59
| 13,076
|
py
|
Python
|
tests/base/test_complex.py
|
ria02/InquirerPy
|
e748d21846ae91553cfb78f61464e35432e04bea
|
[
"MIT"
] | 120
|
2021-01-17T08:57:14.000Z
|
2022-03-19T16:17:41.000Z
|
tests/base/test_complex.py
|
ria02/InquirerPy
|
e748d21846ae91553cfb78f61464e35432e04bea
|
[
"MIT"
] | 37
|
2021-01-29T12:10:11.000Z
|
2022-03-08T04:47:39.000Z
|
tests/base/test_complex.py
|
ria02/InquirerPy
|
e748d21846ae91553cfb78f61464e35432e04bea
|
[
"MIT"
] | 5
|
2021-04-29T21:57:14.000Z
|
2022-02-01T12:34:21.000Z
|
import unittest
from unittest.mock import ANY, call, patch
from prompt_toolkit.validation import ValidationError, Validator
from InquirerPy.base.complex import BaseComplexPrompt
from InquirerPy.prompts.fuzzy import FuzzyPrompt
class TestBaseComplex(unittest.TestCase):
def test_register_kb(self) -> None:
fuzzy_prompt = FuzzyPrompt(message="hello", choices=["1", "2", "3"])
@fuzzy_prompt.register_kb("c-q")
def hello(_):
pass
self.assertFalse(fuzzy_prompt._invalid)
fuzzy_prompt._invalid = True
hello("") # type: ignore
self.assertFalse(fuzzy_prompt._invalid)
@patch.object(BaseComplexPrompt, "register_kb")
def test_after_render(self, mocked_kb):
prompt = FuzzyPrompt(message="", choices=lambda _: [1, 2, 3])
self.assertEqual(prompt._rendered, False)
prompt._after_render(None)
self.assertEqual(prompt._rendered, True)
mocked_kb.assert_has_calls(
[
call("down", filter=ANY),
]
)
mocked_kb.assert_has_calls(
[
call("c-n", filter=ANY),
]
)
def test_prompt_message(self):
prompt = FuzzyPrompt(message="Select one of them", choices=lambda _: [1, 2, 3])
self.assertEqual(
prompt._get_prompt_message(),
[
("class:questionmark", "?"),
("class:question", " Select one of them"),
("class:instruction", " "),
],
)
prompt.status["answered"] = True
prompt.status["result"] = ["hello"]
prompt.status["skipped"] = False
self.assertEqual(
prompt._get_prompt_message(),
[
("class:answermark", "?"),
("class:answered_question", " Select one of them"),
("class:answer", " ['hello']"),
],
)
prompt = FuzzyPrompt(
message=lambda result: "no" if not result else "hello",
choices=[1, 2, 3],
session_result={"1": True},
)
self.assertEqual(
prompt._get_prompt_message(),
[
("class:questionmark", "?"),
("class:question", " hello"),
("class:instruction", " "),
],
)
def test_content_control(self):
prompt = FuzzyPrompt(message="Select one of them", choices=lambda _: [1, 2, 3])
prompt.content_control = None # type: ignore
try:
prompt.content_control
except NotImplementedError:
pass
else:
self.fail("NotImplemented not raised.")
def test_result_name_simple(self):
prompt = FuzzyPrompt(message="Select one of them", choices=[1, 2, 3])
self.assertEqual(prompt.result_name, "1")
prompt.content_control.selected_choice_index = 1
self.assertEqual(prompt.result_name, "2")
prompt.content_control.selected_choice_index = 4
self.assertEqual(prompt.result_name, "")
def test_result_name_multi(self):
prompt = FuzzyPrompt(
message="Select one of them", choices=[1, 2, 3], multiselect=True
)
self.assertEqual(prompt.result_name, [])
prompt.content_control.choices[0]["enabled"] = True
prompt.content_control.choices[2]["enabled"] = True
self.assertEqual(prompt.result_name, ["1", "3"])
def test_result_value_simple(self):
prompt = FuzzyPrompt(message="Select one of them", choices=[1, 2, 3])
self.assertEqual(prompt.result_value, 1)
prompt.content_control.selected_choice_index = 1
self.assertEqual(prompt.result_value, 2)
prompt.content_control.selected_choice_index = 4
self.assertEqual(prompt.result_value, "")
def test_result_value_multi(self):
prompt = FuzzyPrompt(
message="Select one of them", choices=[1, 2, 3], multiselect=True
)
self.assertEqual(prompt.result_value, [])
prompt.content_control.choices[0]["enabled"] = True
prompt.content_control.choices[2]["enabled"] = True
self.assertEqual(prompt.result_value, [1, 3])
def test_application(self):
prompt = FuzzyPrompt(message="Select one of them", choices=lambda _: [1, 2, 3])
prompt._application = None # type: ignore
try:
prompt.application
except NotImplementedError:
pass
else:
self.fail("NotImplemented not raised.")
def test_handle_down(self):
prompt = FuzzyPrompt(
message="Select one of them",
choices=[
"haah",
"haha",
"what",
"waht",
{"name": "weaht", "value": "weaht", "enabled": True},
],
)
self.assertEqual(prompt.content_control.selected_choice_index, 0)
prompt._handle_down(None)
self.assertEqual(prompt.content_control.selected_choice_index, 1)
prompt._handle_down(None)
prompt._handle_down(None)
prompt._handle_down(None)
self.assertEqual(prompt.content_control.selected_choice_index, 4)
prompt._handle_down(None)
self.assertEqual(prompt.content_control.selected_choice_index, 0)
prompt._handle_down(None)
self.assertEqual(prompt.content_control.selected_choice_index, 1)
def test_handle_down_no_cycle(self):
prompt = FuzzyPrompt(
message="Select one of them",
choices=[
"haah",
"haha",
"what",
"waht",
{"name": "weaht", "value": "weaht", "enabled": True},
],
cycle=False,
)
self.assertEqual(prompt.content_control.selected_choice_index, 0)
prompt._handle_down(None)
self.assertEqual(prompt.content_control.selected_choice_index, 1)
prompt._handle_down(None)
prompt._handle_down(None)
prompt._handle_down(None)
self.assertEqual(prompt.content_control.selected_choice_index, 4)
prompt._handle_down(None)
prompt._handle_down(None)
prompt._handle_down(None)
self.assertEqual(prompt.content_control.selected_choice_index, 4)
def test_handle_up(self):
prompt = FuzzyPrompt(
message="Select one of them",
choices=[
"haah",
"haha",
"what",
"waht",
{"name": "weaht", "value": "weaht", "enabled": True},
],
)
self.assertEqual(prompt.content_control.selected_choice_index, 0)
prompt._handle_up(None)
self.assertEqual(prompt.content_control.selected_choice_index, 4)
prompt._handle_up(None)
prompt._handle_up(None)
self.assertEqual(prompt.content_control.selected_choice_index, 2)
prompt._handle_up(None)
prompt._handle_up(None)
prompt._handle_up(None)
self.assertEqual(prompt.content_control.selected_choice_index, 4)
def test_handle_up_no_cycle(self):
prompt = FuzzyPrompt(
message="Select one of them",
choices=[
"haah",
"haha",
"what",
"waht",
{"name": "weaht", "value": "weaht", "enabled": True},
],
cycle=False,
)
self.assertEqual(prompt.content_control.selected_choice_index, 0)
prompt._handle_up(None)
self.assertEqual(prompt.content_control.selected_choice_index, 0)
prompt._handle_up(None)
prompt._handle_up(None)
self.assertEqual(prompt.content_control.selected_choice_index, 0)
prompt._handle_down(None)
prompt._handle_down(None)
self.assertEqual(prompt.content_control.selected_choice_index, 2)
prompt._handle_up(None)
prompt._handle_up(None)
prompt._handle_up(None)
prompt._handle_up(None)
self.assertEqual(prompt.content_control.selected_choice_index, 0)
prompt = FuzzyPrompt(
message="Select one of them",
choices=[
"haah",
"haha",
"what",
"waht",
{"name": "weaht", "value": "weaht", "enabled": True},
],
cycle=False,
)
@patch("InquirerPy.base.complex.shutil.get_terminal_size")
@patch("InquirerPy.utils.shutil.get_terminal_size")
def test_extra_lines_with_long_instruction(self, mocked_term, mocked_term2):
mocked_term.return_value = (24, 80)
mocked_term2.return_value = (24, 80)
message = 15 * "i"
qmark = "[?]"
instruction = 3 * "i"
long_instruction = 24 * "i"
prompt = FuzzyPrompt(
message=message,
qmark=qmark,
instruction=instruction,
long_instruction=long_instruction,
choices=[
"haah",
"haha",
"what",
"waht",
{"name": "weaht", "value": "weaht", "enabled": True},
],
)
self.assertEqual(prompt.extra_long_instruction_line_count, 0)
long_instruction = 25 * "i"
prompt = FuzzyPrompt(
message=message,
qmark=qmark,
instruction=instruction,
long_instruction=long_instruction,
choices=[
"haah",
"haha",
"what",
"waht",
{"name": "weaht", "value": "weaht", "enabled": True},
],
)
self.assertEqual(prompt.extra_long_instruction_line_count, 1)
@patch("InquirerPy.base.complex.shutil.get_terminal_size")
@patch("InquirerPy.utils.shutil.get_terminal_size")
def test_extra_lines_due_to_offset(self, mocked_term, mocked_term2):
mocked_term.return_value = (24, 80)
mocked_term2.return_value = (24, 80)
message = 15 * "i"
qmark = "[?]"
instruction = 3 * "i"
prompt = FuzzyPrompt(
message=message,
qmark=qmark,
instruction=instruction,
choices=[
"haah",
"haha",
"what",
"waht",
{"name": "weaht", "value": "weaht", "enabled": True},
],
)
self.assertEqual(
prompt.extra_line_count,
(len(qmark) + 1 + len(message) + 1 + len(instruction) + 1 - 1) // 24,
)
instruction = 4 * "i"
prompt = FuzzyPrompt(
message=message,
qmark=qmark,
instruction=instruction,
choices=[
"haah",
"haha",
"what",
"waht",
{"name": "weaht", "value": "weaht", "enabled": True},
],
)
self.assertEqual(
prompt.extra_line_count,
(len(qmark) + 1 + len(message) + 1 + len(instruction) + 1 - 1) // 24,
)
@patch("InquirerPy.base.complex.shutil.get_terminal_size")
def test_height_offset(self, mocked_term) -> None:
mocked_term.return_value = (24, 80)
message = 15 * "i"
qmark = "[?]"
instruction = 4 * "i"
prompt = FuzzyPrompt(
message=message, qmark=qmark, instruction=instruction, choices=[1, 2, 3]
)
self.assertEqual(prompt.height_offset, 4)
prompt._wrap_lines = False
self.assertEqual(prompt.height_offset, 3)
prompt = FuzzyPrompt(
message=message,
qmark=qmark,
instruction=instruction,
choices=[1, 2, 3],
border=True,
)
self.assertEqual(prompt.height_offset, 6)
instruction = 3 * "i" # width total should be 24 and no extra lines needed
prompt = FuzzyPrompt(
message=message, qmark=qmark, instruction=instruction, choices=[1, 2, 3]
)
self.assertEqual(prompt.height_offset, 3)
def test_get_error_message(self):
class SelectionValidator(Validator):
def validate(self, document) -> None:
if document.text == 1:
raise ValidationError(
message="hello", cursor_position=document.cursor_position
)
prompt = FuzzyPrompt(
message="",
choices=[1, 2, 3],
validate=SelectionValidator(),
invalid_message="minimum 2 selections",
)
self.assertEqual(prompt._invalid_message, "minimum 2 selections")
self.assertFalse(prompt._invalid)
prompt._handle_enter(None)
self.assertEqual(prompt._invalid_message, "hello")
self.assertTrue(prompt._invalid)
self.assertEqual(
prompt._get_error_message(), [("class:validation-toolbar", "hello")]
)
| 34.68435
| 87
| 0.561028
| 1,294
| 13,076
| 5.446677
| 0.115147
| 0.093644
| 0.131101
| 0.087401
| 0.787174
| 0.752412
| 0.716515
| 0.710556
| 0.698638
| 0.694381
| 0
| 0.015749
| 0.325023
| 13,076
| 376
| 88
| 34.776596
| 0.782801
| 0.006806
| 0
| 0.668622
| 0
| 0
| 0.098059
| 0.021029
| 0
| 0
| 0
| 0
| 0.146628
| 1
| 0.055718
| false
| 0.008798
| 0.014663
| 0
| 0.076246
| 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
|
c85261f331d944b1224c42b57835b52952d07c3a
| 89
|
py
|
Python
|
measure/apps.py
|
mpsk2/tut-backend
|
af467809b79b6c1ee84e506cebc7e5ac3fa675bd
|
[
"MIT"
] | 1
|
2021-11-30T19:38:55.000Z
|
2021-11-30T19:38:55.000Z
|
measure/apps.py
|
mpsk2/tut-backend
|
af467809b79b6c1ee84e506cebc7e5ac3fa675bd
|
[
"MIT"
] | null | null | null |
measure/apps.py
|
mpsk2/tut-backend
|
af467809b79b6c1ee84e506cebc7e5ac3fa675bd
|
[
"MIT"
] | 1
|
2022-02-25T22:48:21.000Z
|
2022-02-25T22:48:21.000Z
|
from django.apps import AppConfig
class MeasureConfig(AppConfig):
name = 'measure'
| 14.833333
| 33
| 0.752809
| 10
| 89
| 6.7
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.168539
| 89
| 5
| 34
| 17.8
| 0.905405
| 0
| 0
| 0
| 0
| 0
| 0.078652
| 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
|
c86376c65fe56b034546a4f6ba73240fb242eed9
| 12,383
|
py
|
Python
|
sovtokenfees/sovtokenfees/test/authorize/metadata/test_auth_rule_with_metadata_complex.py
|
ArtObr/token-plugin
|
6d595ee6640c581fccab60d996b95242339be521
|
[
"Apache-2.0"
] | null | null | null |
sovtokenfees/sovtokenfees/test/authorize/metadata/test_auth_rule_with_metadata_complex.py
|
ArtObr/token-plugin
|
6d595ee6640c581fccab60d996b95242339be521
|
[
"Apache-2.0"
] | null | null | null |
sovtokenfees/sovtokenfees/test/authorize/metadata/test_auth_rule_with_metadata_complex.py
|
ArtObr/token-plugin
|
6d595ee6640c581fccab60d996b95242339be521
|
[
"Apache-2.0"
] | null | null | null |
from indy_common.authorize.auth_constraints import AuthConstraint, IDENTITY_OWNER, AuthConstraintOr, AuthConstraintAnd
from indy_common.constants import TRUST_ANCHOR
from plenum.common.constants import TRUSTEE, STEWARD
from sovtokenfees.test.authorize.metadata.helper import validate, PLUGIN_FIELD
MAX_SIG_COUNT = 3
def test_plugin_and_or_rule_same_role(write_auth_req_validator, write_request_validation,
signatures, is_owner, amount):
validate(
auth_constraint=AuthConstraintAnd(auth_constraints=[
AuthConstraintOr(auth_constraints=[
AuthConstraint(role=TRUSTEE, sig_count=2, need_to_be_owner=False),
AuthConstraint(role=TRUSTEE, sig_count=2, need_to_be_owner=False,
metadata={PLUGIN_FIELD: '2'}),
]),
AuthConstraintOr(auth_constraints=[
AuthConstraint(role=STEWARD, sig_count=3, need_to_be_owner=False),
AuthConstraint(role=STEWARD, sig_count=3, need_to_be_owner=False,
metadata={PLUGIN_FIELD: '2'}),
])
]),
valid_actions=[
({TRUSTEE: 2, STEWARD: 3}, False, 2),
({TRUSTEE: 3, STEWARD: 3}, False, 2),
({TRUSTEE: 2, STEWARD: 3}, True, 2),
({TRUSTEE: 3, STEWARD: 3}, True, 2),
({TRUSTEE: 2, STEWARD: 3}, False, None),
({TRUSTEE: 3, STEWARD: 3}, False, None),
({TRUSTEE: 2, STEWARD: 3}, False, 0),
({TRUSTEE: 3, STEWARD: 3}, False, 0),
({TRUSTEE: 2, STEWARD: 3}, True, None),
({TRUSTEE: 3, STEWARD: 3}, True, None),
({TRUSTEE: 2, STEWARD: 3}, True, 0),
({TRUSTEE: 3, STEWARD: 3}, True, 0),
],
all_signatures=signatures, is_owner=is_owner, amount=amount,
write_auth_req_validator=write_auth_req_validator,
write_request_validation=write_request_validation
)
def test_plugin_and_or_rule_diff_role(write_auth_req_validator, write_request_validation,
signatures, is_owner, amount):
validate(
auth_constraint=AuthConstraintAnd(auth_constraints=[
AuthConstraintOr(auth_constraints=[
AuthConstraint(role=TRUSTEE, sig_count=2, need_to_be_owner=False,
metadata={PLUGIN_FIELD: '3'}),
AuthConstraint(role=STEWARD, sig_count=2, need_to_be_owner=False,
metadata={PLUGIN_FIELD: '3'}),
]),
AuthConstraintOr(auth_constraints=[
AuthConstraint(role=TRUST_ANCHOR, sig_count=3, need_to_be_owner=False,
metadata={PLUGIN_FIELD: '3'}),
AuthConstraint(role=IDENTITY_OWNER, sig_count=3, need_to_be_owner=True,
metadata={PLUGIN_FIELD: '3'}),
])
]),
valid_actions=[
({TRUSTEE: 2, TRUST_ANCHOR: 3}, False, 3),
({TRUSTEE: 3, TRUST_ANCHOR: 3}, False, 3),
({TRUSTEE: 2, TRUST_ANCHOR: 3}, True, 3),
({TRUSTEE: 3, TRUST_ANCHOR: 3}, True, 3),
({TRUSTEE: 2, IDENTITY_OWNER: 3}, True, 3),
({TRUSTEE: 3, IDENTITY_OWNER: 3}, True, 3),
({STEWARD: 2, TRUST_ANCHOR: 3}, False, 3),
({STEWARD: 3, TRUST_ANCHOR: 3}, False, 3),
({STEWARD: 2, TRUST_ANCHOR: 3}, True, 3),
({STEWARD: 3, TRUST_ANCHOR: 3}, True, 3),
({STEWARD: 2, IDENTITY_OWNER: 3}, True, 3),
({STEWARD: 3, IDENTITY_OWNER: 3}, True, 3),
],
all_signatures=signatures, is_owner=is_owner, amount=amount,
write_auth_req_validator=write_auth_req_validator,
write_request_validation=write_request_validation
)
def test_plugin_or_and_rule_diff_roles(write_auth_req_validator, write_request_validation,
signatures, is_owner, amount):
validate(
auth_constraint=AuthConstraintOr(auth_constraints=[
AuthConstraintAnd(auth_constraints=[
AuthConstraint(role=TRUSTEE, sig_count=3, need_to_be_owner=False),
]),
AuthConstraintAnd(auth_constraints=[
AuthConstraint(role=TRUSTEE, sig_count=1, need_to_be_owner=False),
AuthConstraint(role=STEWARD, sig_count=2, need_to_be_owner=False),
]),
AuthConstraintAnd(auth_constraints=[
AuthConstraint(role=TRUSTEE, sig_count=1, need_to_be_owner=False,
metadata={PLUGIN_FIELD: '2'}),
AuthConstraint(role=TRUST_ANCHOR, sig_count=2, need_to_be_owner=True,
metadata={PLUGIN_FIELD: '2'}),
]),
AuthConstraintAnd(auth_constraints=[
AuthConstraint(role=TRUSTEE, sig_count=2, need_to_be_owner=False,
metadata={PLUGIN_FIELD: '3'}),
AuthConstraint(role=IDENTITY_OWNER, sig_count=3, need_to_be_owner=True,
metadata={PLUGIN_FIELD: '3'}),
]),
]),
valid_actions=[
({TRUSTEE: 3}, False, None),
({TRUSTEE: 3}, True, None),
({TRUSTEE: 3}, False, 0),
({TRUSTEE: 3}, True, 0),
({TRUSTEE: 1, STEWARD: 2}, False, None),
({TRUSTEE: 2, STEWARD: 2}, False, None),
({TRUSTEE: 1, STEWARD: 3}, False, None),
({TRUSTEE: 2, STEWARD: 3}, False, None),
({TRUSTEE: 3, STEWARD: 3}, False, None),
({TRUSTEE: 1, STEWARD: 2}, False, 0),
({TRUSTEE: 2, STEWARD: 2}, False, 0),
({TRUSTEE: 1, STEWARD: 3}, False, 0),
({TRUSTEE: 2, STEWARD: 3}, False, 0),
({TRUSTEE: 3, STEWARD: 3}, False, 0),
({TRUSTEE: 1, STEWARD: 2}, True, None),
({TRUSTEE: 2, STEWARD: 2}, True, None),
({TRUSTEE: 1, STEWARD: 3}, True, None),
({TRUSTEE: 2, STEWARD: 3}, True, None),
({TRUSTEE: 3, STEWARD: 3}, True, None),
({TRUSTEE: 1, STEWARD: 2}, True, 0),
({TRUSTEE: 2, STEWARD: 2}, True, 0),
({TRUSTEE: 1, STEWARD: 3}, True, 0),
({TRUSTEE: 2, STEWARD: 3}, True, 0),
({TRUSTEE: 3, STEWARD: 3}, True, 0),
({TRUSTEE: 1, TRUST_ANCHOR: 2}, True, 2),
({TRUSTEE: 2, TRUST_ANCHOR: 2}, True, 2),
({TRUSTEE: 1, TRUST_ANCHOR: 3}, True, 2),
({TRUSTEE: 2, TRUST_ANCHOR: 3}, True, 2),
({TRUSTEE: 3, TRUST_ANCHOR: 3}, True, 2),
({TRUSTEE: 2, IDENTITY_OWNER: 3}, True, 3),
({TRUSTEE: 3, IDENTITY_OWNER: 3}, True, 3),
],
all_signatures=signatures, is_owner=is_owner, amount=amount,
write_auth_req_validator=write_auth_req_validator,
write_request_validation=write_request_validation
)
def test_plugin_complex(write_auth_req_validator, write_request_validation,
signatures, is_owner, amount):
validate(
auth_constraint=AuthConstraintOr(auth_constraints=[
# 1st
AuthConstraintAnd(auth_constraints=[
AuthConstraint(role=TRUSTEE, sig_count=3, need_to_be_owner=False,
metadata={PLUGIN_FIELD: '1'}),
AuthConstraintOr(auth_constraints=[
AuthConstraintAnd(auth_constraints=[
AuthConstraint(role=STEWARD, sig_count=1, need_to_be_owner=False,
metadata={PLUGIN_FIELD: '1'}),
AuthConstraint(role=TRUST_ANCHOR, sig_count=1, need_to_be_owner=False,
metadata={PLUGIN_FIELD: '1'}),
]),
AuthConstraint(role=STEWARD, sig_count=2, need_to_be_owner=False,
metadata={PLUGIN_FIELD: '1'}),
AuthConstraint(role=TRUST_ANCHOR, sig_count=2, need_to_be_owner=False,
metadata={PLUGIN_FIELD: '1'}),
])
]),
# 2d
AuthConstraintAnd(auth_constraints=[
AuthConstraint(role=TRUSTEE, sig_count=3, need_to_be_owner=False,
metadata={PLUGIN_FIELD: '3'}),
AuthConstraint(role=IDENTITY_OWNER, sig_count=1, need_to_be_owner=True,
metadata={PLUGIN_FIELD: '3'})
]),
# 3d
AuthConstraintAnd(auth_constraints=[
AuthConstraint(role=TRUSTEE, sig_count=3, need_to_be_owner=False),
AuthConstraintOr(auth_constraints=[
AuthConstraint(role=STEWARD, sig_count=2, need_to_be_owner=False),
AuthConstraint(role=TRUST_ANCHOR, sig_count=2, need_to_be_owner=True),
])
]),
# 4th
AuthConstraintAnd(auth_constraints=[
AuthConstraint(role=TRUSTEE, sig_count=2, need_to_be_owner=False,
metadata={PLUGIN_FIELD: '2'}),
AuthConstraint(role=IDENTITY_OWNER, sig_count=1, need_to_be_owner=True,
metadata={PLUGIN_FIELD: '2'})
]),
]),
valid_actions=[
# 1st
({TRUSTEE: 3, STEWARD: 1, TRUST_ANCHOR: 1}, False, 1),
({TRUSTEE: 3, STEWARD: 2, TRUST_ANCHOR: 1}, False, 1),
({TRUSTEE: 3, STEWARD: 1, TRUST_ANCHOR: 2}, False, 1),
({TRUSTEE: 3, STEWARD: 2, TRUST_ANCHOR: 2}, False, 1),
({TRUSTEE: 3, STEWARD: 1, TRUST_ANCHOR: 3}, False, 1),
({TRUSTEE: 3, STEWARD: 3, TRUST_ANCHOR: 1}, False, 1),
({TRUSTEE: 3, STEWARD: 3, TRUST_ANCHOR: 3}, False, 1),
({TRUSTEE: 3, STEWARD: 1, TRUST_ANCHOR: 1}, True, 1),
({TRUSTEE: 3, STEWARD: 2, TRUST_ANCHOR: 1}, True, 1),
({TRUSTEE: 3, STEWARD: 1, TRUST_ANCHOR: 2}, True, 1),
({TRUSTEE: 3, STEWARD: 2, TRUST_ANCHOR: 2}, True, 1),
({TRUSTEE: 3, STEWARD: 1, TRUST_ANCHOR: 3}, True, 1),
({TRUSTEE: 3, STEWARD: 3, TRUST_ANCHOR: 1}, True, 1),
({TRUSTEE: 3, STEWARD: 3, TRUST_ANCHOR: 3}, True, 1),
({TRUSTEE: 3, STEWARD: 2}, False, 1),
({TRUSTEE: 3, STEWARD: 3}, False, 1),
({TRUSTEE: 3, STEWARD: 2}, True, 1),
({TRUSTEE: 3, STEWARD: 3}, True, 1),
({TRUSTEE: 3, TRUST_ANCHOR: 2}, False, 1),
({TRUSTEE: 3, TRUST_ANCHOR: 3}, False, 1),
({TRUSTEE: 3, TRUST_ANCHOR: 2}, True, 1),
({TRUSTEE: 3, TRUST_ANCHOR: 3}, True, 1),
# 2d
({TRUSTEE: 3, IDENTITY_OWNER: 1}, True, 3),
({TRUSTEE: 3, IDENTITY_OWNER: 2}, True, 3),
({TRUSTEE: 3, IDENTITY_OWNER: 3}, True, 3),
# 3d
({TRUSTEE: 3, STEWARD: 2}, False, None),
({TRUSTEE: 3, STEWARD: 3}, False, None),
({TRUSTEE: 3, STEWARD: 2}, True, None),
({TRUSTEE: 3, STEWARD: 3}, True, None),
({TRUSTEE: 3, STEWARD: 2}, False, 0),
({TRUSTEE: 3, STEWARD: 3}, False, 0),
({TRUSTEE: 3, STEWARD: 2}, True, 0),
({TRUSTEE: 3, STEWARD: 3}, True, 0),
({TRUSTEE: 3, TRUST_ANCHOR: 2}, False, None),
({TRUSTEE: 3, TRUST_ANCHOR: 3}, False, None),
({TRUSTEE: 3, TRUST_ANCHOR: 2}, True, None),
({TRUSTEE: 3, TRUST_ANCHOR: 3}, True, None),
({TRUSTEE: 3, TRUST_ANCHOR: 2}, False, 0),
({TRUSTEE: 3, TRUST_ANCHOR: 3}, False, 0),
({TRUSTEE: 3, TRUST_ANCHOR: 2}, True, 0),
({TRUSTEE: 3, TRUST_ANCHOR: 3}, True, 0),
# 4th
({TRUSTEE: 2, IDENTITY_OWNER: 1}, True, 2),
({TRUSTEE: 2, IDENTITY_OWNER: 2}, True, 2),
({TRUSTEE: 2, IDENTITY_OWNER: 3}, True, 2),
({TRUSTEE: 3, IDENTITY_OWNER: 1}, True, 2),
({TRUSTEE: 3, IDENTITY_OWNER: 2}, True, 2),
({TRUSTEE: 3, IDENTITY_OWNER: 3}, True, 2),
],
all_signatures=signatures, is_owner=is_owner, amount=amount,
write_auth_req_validator=write_auth_req_validator,
write_request_validation=write_request_validation
)
| 45.862963
| 118
| 0.538157
| 1,357
| 12,383
| 4.674282
| 0.046426
| 0.079458
| 0.085133
| 0.055337
| 0.947816
| 0.884913
| 0.756582
| 0.727416
| 0.61895
| 0.580482
| 0
| 0.041928
| 0.331664
| 12,383
| 269
| 119
| 46.033457
| 0.724505
| 0.00218
| 0
| 0.546256
| 0
| 0
| 0.001539
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.017621
| false
| 0
| 0.017621
| 0
| 0.035242
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
c07a74c731d03291cf121cf9de43e5e034af1bf0
| 519
|
py
|
Python
|
stubs/m5stack_flowui-v1_4_0-beta/flowlib/lib/dht12.py
|
mattytrentini/micropython-stubs
|
4d596273823b69e9e5bcf5fa67f249c374ee0bbc
|
[
"MIT"
] | null | null | null |
stubs/m5stack_flowui-v1_4_0-beta/flowlib/lib/dht12.py
|
mattytrentini/micropython-stubs
|
4d596273823b69e9e5bcf5fa67f249c374ee0bbc
|
[
"MIT"
] | null | null | null |
stubs/m5stack_flowui-v1_4_0-beta/flowlib/lib/dht12.py
|
mattytrentini/micropython-stubs
|
4d596273823b69e9e5bcf5fa67f249c374ee0bbc
|
[
"MIT"
] | null | null | null |
"""
Module: 'flowlib.lib.dht12' on M5 FlowUI v1.4.0-beta
"""
# MCU: (sysname='esp32', nodename='esp32', release='1.11.0', version='v1.11-284-g5d8e1c867 on 2019-08-30', machine='ESP32 module with ESP32')
# Stubber: 1.3.1 - updated
from typing import Any
class DHT12:
""""""
def humidity(self, *argv) -> Any:
pass
def measure(self, *argv) -> Any:
pass
def temperature(self, *argv) -> Any:
pass
class DHTBaseI2C:
""""""
def measure(self, *argv) -> Any:
pass
| 19.222222
| 141
| 0.587669
| 71
| 519
| 4.295775
| 0.591549
| 0.104918
| 0.144262
| 0.196721
| 0.222951
| 0.163934
| 0
| 0
| 0
| 0
| 0
| 0.111111
| 0.236994
| 519
| 26
| 142
| 19.961538
| 0.659091
| 0.420039
| 0
| 0.545455
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.363636
| false
| 0.363636
| 0.090909
| 0
| 0.636364
| 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
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
c096c05401eb3ef0af74d3b703f69a1ec2d804a5
| 106
|
py
|
Python
|
tests/unit/__init__.py
|
DeFi-Coder-News-Letter/StormSurge-pydex
|
735efe9a9c2f16290ddff2c565dab655278fbddf
|
[
"MIT"
] | 28
|
2019-02-09T12:48:21.000Z
|
2022-02-10T02:35:43.000Z
|
tests/unit/__init__.py
|
ccamateur/pydex
|
e6a0fdb81751a34df40d8563a4f33fdd39a91a70
|
[
"MIT"
] | 20
|
2019-02-09T02:16:48.000Z
|
2021-02-02T21:55:33.000Z
|
tests/unit/__init__.py
|
ccamateur/pydex
|
e6a0fdb81751a34df40d8563a4f33fdd39a91a70
|
[
"MIT"
] | 5
|
2019-02-09T11:58:39.000Z
|
2021-08-24T15:14:17.000Z
|
"""
Unit tests for pyDEX project should all go in this module
author: officialcryptomaster@gmail.com
"""
| 17.666667
| 57
| 0.764151
| 15
| 106
| 5.4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.150943
| 106
| 5
| 58
| 21.2
| 0.9
| 0.915094
| 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
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.