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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4f6203e1d2da3f3edd17cf0df239bdbf7dc7f4b5
| 1,092
|
py
|
Python
|
packages/pyright-internal/src/tests/samples/literals7.py
|
SandyChapman/pyright
|
94ea7243311f85f68d96d467aac8bcb6cd82f855
|
[
"MIT"
] | null | null | null |
packages/pyright-internal/src/tests/samples/literals7.py
|
SandyChapman/pyright
|
94ea7243311f85f68d96d467aac8bcb6cd82f855
|
[
"MIT"
] | null | null | null |
packages/pyright-internal/src/tests/samples/literals7.py
|
SandyChapman/pyright
|
94ea7243311f85f68d96d467aac8bcb6cd82f855
|
[
"MIT"
] | null | null | null |
# This sample tests the handling of very large integer values used in
# literals.
from typing import Literal
# This should generate an error.
y1: Literal[
900001231231231456487987456452132130000000000000000000000000000001
] = 900001231231231456487987456452132130000000000000000000000000000000
y2: Literal[
900001231231231456487987456452132130000000000000000000000000000001
] = 900001231231231456487987456452132130000000000000000000000000000001
reveal_type(
y2,
expected_text="Literal[900001231231231456487987456452132130000000000000000000000000000001]",
)
y3 = y2 + 1
reveal_type(
y3,
expected_text="Literal[900001231231231456487987456452132130000000000000000000000000000002]",
)
y4 = 0xFFFFFFFFFFF123456789456123456789456123456789456123
reveal_type(
y4,
expected_text="Literal[1606938044258905427252460960878516708721138816242982137979171]",
)
y5 = 0b101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
reveal_type(y5, expected_text="Literal[886151997189943915269204706853563050]")
| 31.2
| 127
| 0.858974
| 65
| 1,092
| 14.307692
| 0.584615
| 0.043011
| 0.08172
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.671717
| 0.093407
| 1,092
| 34
| 128
| 32.117647
| 0.267677
| 0.098901
| 0
| 0.217391
| 1
| 0
| 0.270408
| 0.270408
| 0
| 0
| 0.053061
| 0
| 0
| 1
| 0
| false
| 0
| 0.043478
| 0
| 0.043478
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
4f6c9676089eed4c6d873cdfaf28cc843e078bf5
| 242
|
py
|
Python
|
restaurant_project/apps/utils/permissions.py
|
reakfog/restaurant_api
|
fc25b603e194df2157f2b322cbce629e0e40a713
|
[
"BSD-3-Clause"
] | null | null | null |
restaurant_project/apps/utils/permissions.py
|
reakfog/restaurant_api
|
fc25b603e194df2157f2b322cbce629e0e40a713
|
[
"BSD-3-Clause"
] | null | null | null |
restaurant_project/apps/utils/permissions.py
|
reakfog/restaurant_api
|
fc25b603e194df2157f2b322cbce629e0e40a713
|
[
"BSD-3-Clause"
] | 1
|
2021-09-29T08:44:38.000Z
|
2021-09-29T08:44:38.000Z
|
from rest_framework.permissions import SAFE_METHODS, BasePermission
class IsAuthorOrReadOnly(BasePermission):
def has_object_permission(self, request, view, obj):
return request.method in SAFE_METHODS or request.user == obj.user
| 40.333333
| 73
| 0.797521
| 30
| 242
| 6.266667
| 0.766667
| 0.117021
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.136364
| 242
| 6
| 73
| 40.333333
| 0.899522
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0.25
| 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
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
4f8f53e8e8a4299dd3af5eb28e17c3388ce89c19
| 73
|
py
|
Python
|
cuda_device.py
|
takecx/FBA_Matting
|
89f5ccfa169adc2c20e6fd677a6655af3694fa61
|
[
"MIT"
] | null | null | null |
cuda_device.py
|
takecx/FBA_Matting
|
89f5ccfa169adc2c20e6fd677a6655af3694fa61
|
[
"MIT"
] | null | null | null |
cuda_device.py
|
takecx/FBA_Matting
|
89f5ccfa169adc2c20e6fd677a6655af3694fa61
|
[
"MIT"
] | null | null | null |
import torch
CUDA_DEVICE = 'gpu' if torch.cuda.is_available() else 'cpu'
| 24.333333
| 59
| 0.753425
| 12
| 73
| 4.416667
| 0.833333
| 0.339623
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.123288
| 73
| 3
| 59
| 24.333333
| 0.828125
| 0
| 0
| 0
| 0
| 0
| 0.081081
| 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
|
4f950e36acb54ff118730a516736c5fa87cbebff
| 148
|
py
|
Python
|
src/models/vaes/__init__.py
|
yizhe-ang/vi-lab
|
65a46e41845982def17e553a46be849d948f9f45
|
[
"MIT"
] | 1
|
2022-02-19T17:03:18.000Z
|
2022-02-19T17:03:18.000Z
|
src/models/vaes/__init__.py
|
lemonwaffle/vi-lab
|
65a46e41845982def17e553a46be849d948f9f45
|
[
"MIT"
] | null | null | null |
src/models/vaes/__init__.py
|
lemonwaffle/vi-lab
|
65a46e41845982def17e553a46be849d948f9f45
|
[
"MIT"
] | null | null | null |
from .vae import VAE
from .mvae import MultimodalVAE
from .pmvae import PartitionedMultimodalVAE
from .hier_pmvae import HierPMVAE_v1, HierPMVAE_v2
| 29.6
| 50
| 0.851351
| 20
| 148
| 6.15
| 0.55
| 0.178862
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.015267
| 0.114865
| 148
| 4
| 51
| 37
| 0.923664
| 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
|
4fa42bbaa9ccfcf7b3e3d9a61c4920b6a51ee2f7
| 493
|
py
|
Python
|
iridium/plugins/ironic/common.py
|
Toure/Rhea
|
fda0e4cd7c568943725245393bfe762bc858e917
|
[
"Apache-2.0"
] | 1
|
2015-08-19T15:55:46.000Z
|
2015-08-19T15:55:46.000Z
|
iridium/plugins/ironic/common.py
|
Toure/Rhea
|
fda0e4cd7c568943725245393bfe762bc858e917
|
[
"Apache-2.0"
] | null | null | null |
iridium/plugins/ironic/common.py
|
Toure/Rhea
|
fda0e4cd7c568943725245393bfe762bc858e917
|
[
"Apache-2.0"
] | null | null | null |
from iridium.plugins import Plugin
class Common(Plugin):
def __init__(self, ironic_session):
self.ironic_session = ironic_session
def chassis_create(self, name, count):
pass
def chassis_delete(self, name):
pass
def node_create(self, name, count):
pass
def node_delete(self, name):
pass
def driver_info(self):
pass
def port_create(self, name, count):
pass
def port_delete(self, name):
pass
| 18.259259
| 44
| 0.622718
| 62
| 493
| 4.725806
| 0.354839
| 0.163823
| 0.143345
| 0.194539
| 0.409556
| 0.266212
| 0
| 0
| 0
| 0
| 0
| 0
| 0.296146
| 493
| 27
| 45
| 18.259259
| 0.84438
| 0
| 0
| 0.388889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.444444
| false
| 0.388889
| 0.055556
| 0
| 0.555556
| 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
|
4fa58ada287a4261a1f0be4f23a4c76918f6410a
| 166
|
py
|
Python
|
exercicio 5.py
|
llucaslopes/Exercicios_LP_1B
|
766de286613de5b291ddf55aebff0bcdbd8019f7
|
[
"MIT"
] | null | null | null |
exercicio 5.py
|
llucaslopes/Exercicios_LP_1B
|
766de286613de5b291ddf55aebff0bcdbd8019f7
|
[
"MIT"
] | null | null | null |
exercicio 5.py
|
llucaslopes/Exercicios_LP_1B
|
766de286613de5b291ddf55aebff0bcdbd8019f7
|
[
"MIT"
] | null | null | null |
a = input ("Digite algo")
print(a.isalpha())
print(a.isalnum())
print(a.isascii())
print(a.isdecimal())
print(a.isdigit())
print(a.isidentifier())
print(a.islower())
| 18.444444
| 25
| 0.686747
| 25
| 166
| 4.56
| 0.48
| 0.368421
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.072289
| 166
| 8
| 26
| 20.75
| 0.74026
| 0
| 0
| 0
| 0
| 0
| 0.066265
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.875
| 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
|
96f68c915029b49c3f3ed7bd6a2c2210cf443ad4
| 108
|
py
|
Python
|
tic_tac_toe/admin.py
|
ricardopereiraesilva/Tic_Tac_Toe_OO_Python_Django
|
d0e5065018acb24f94461a20447601e4aef0e5a1
|
[
"MIT"
] | 1
|
2021-05-06T17:01:34.000Z
|
2021-05-06T17:01:34.000Z
|
tic_tac_toe/admin.py
|
ricardopereiraesilva/Tic_Tac_Toe_OO_Python_Django
|
d0e5065018acb24f94461a20447601e4aef0e5a1
|
[
"MIT"
] | null | null | null |
tic_tac_toe/admin.py
|
ricardopereiraesilva/Tic_Tac_Toe_OO_Python_Django
|
d0e5065018acb24f94461a20447601e4aef0e5a1
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import JVDjangoDBModel
admin.site.register(JVDjangoDBModel)
| 18
| 36
| 0.842593
| 13
| 108
| 7
| 0.692308
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.101852
| 108
| 5
| 37
| 21.6
| 0.938144
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
8c044f5bf9629ab0761884432eed92444057ad86
| 164
|
py
|
Python
|
torchsampler/__init__.py
|
LeeTaeHoon97/imbalanced-dataset-sampler
|
f7ab182e5e1438661accf23edfca11dd1b52d2f3
|
[
"MIT"
] | 1,753
|
2018-05-30T08:21:42.000Z
|
2022-03-31T10:46:30.000Z
|
torchsampler/__init__.py
|
LeeTaeHoon97/imbalanced-dataset-sampler
|
f7ab182e5e1438661accf23edfca11dd1b52d2f3
|
[
"MIT"
] | 34
|
2018-12-20T09:16:23.000Z
|
2022-03-08T05:13:12.000Z
|
torchsampler/__init__.py
|
LeeTaeHoon97/imbalanced-dataset-sampler
|
f7ab182e5e1438661accf23edfca11dd1b52d2f3
|
[
"MIT"
] | 257
|
2018-05-29T22:05:25.000Z
|
2022-03-28T04:38:29.000Z
|
from torchsampler.__about__ import * # noqa: F401 F403
from torchsampler.imbalanced import ImbalancedDatasetSampler
__all__ = [
'ImbalancedDatasetSampler',
]
| 23.428571
| 60
| 0.792683
| 14
| 164
| 8.714286
| 0.714286
| 0.262295
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.042553
| 0.140244
| 164
| 6
| 61
| 27.333333
| 0.822695
| 0.091463
| 0
| 0
| 0
| 0
| 0.163265
| 0.163265
| 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
|
8c0ac1f28db4b8d945d06577a5f944756a8ab34d
| 340
|
py
|
Python
|
pattern/utils/loss.py
|
HAXRD/pattern
|
09f37920ce727265765ec59a2304b011d81e3454
|
[
"MIT"
] | null | null | null |
pattern/utils/loss.py
|
HAXRD/pattern
|
09f37920ce727265765ec59a2304b011d81e3454
|
[
"MIT"
] | null | null | null |
pattern/utils/loss.py
|
HAXRD/pattern
|
09f37920ce727265765ec59a2304b011d81e3454
|
[
"MIT"
] | null | null | null |
import torch
def mse(output, target):
loss = torch.mean((output - target) ** 2)
return loss
def hybrid_mse(output, target, coe1=1, coe2=0.2):
comp1 = torch.mean((output - target) ** 2)
comp2 = torch.mean((torch.sum(output, dim=-1) - torch.sum(target, dim=-1)) ** 2)
loss = coe1 * comp1 + coe2 * comp2
return loss
| 26.153846
| 84
| 0.620588
| 51
| 340
| 4.117647
| 0.372549
| 0.228571
| 0.142857
| 0.2
| 0.209524
| 0
| 0
| 0
| 0
| 0
| 0
| 0.059925
| 0.214706
| 340
| 12
| 85
| 28.333333
| 0.726592
| 0
| 0
| 0.222222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.222222
| false
| 0
| 0.111111
| 0
| 0.555556
| 0
| 0
| 0
| 0
| null | 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
8c164298666cade002d25721b3ec74f6674a5c33
| 582
|
py
|
Python
|
panda/api/__init__.py
|
higs4281/panda
|
133baa47882a289773a30c9656e2ea4efe569387
|
[
"MIT"
] | 72
|
2015-02-12T22:28:11.000Z
|
2022-01-20T08:35:31.000Z
|
panda/api/__init__.py
|
higs4281/panda
|
133baa47882a289773a30c9656e2ea4efe569387
|
[
"MIT"
] | 24
|
2015-01-12T21:52:35.000Z
|
2021-12-13T19:39:46.000Z
|
panda/api/__init__.py
|
higs4281/panda
|
133baa47882a289773a30c9656e2ea4efe569387
|
[
"MIT"
] | 31
|
2015-01-09T19:20:19.000Z
|
2021-10-20T01:21:23.000Z
|
#!/usr/bin/env python
from panda.api.activity_log import ActivityLogResource
from panda.api.category import CategoryResource
from panda.api.data import DataResource
from panda.api.datasets import DatasetResource
from panda.api.data_uploads import DataUploadResource
from panda.api.exports import ExportResource
from panda.api.notifications import NotificationResource
from panda.api.related_uploads import RelatedUploadResource
from panda.api.search_subscriptions import SearchSubscriptionResource
from panda.api.tasks import TaskResource
from panda.api.users import UserResource
| 38.8
| 69
| 0.871134
| 74
| 582
| 6.797297
| 0.432432
| 0.196819
| 0.262425
| 0.063618
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.082474
| 582
| 14
| 70
| 41.571429
| 0.941948
| 0.034364
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
4fb543091a28a26ddaed34d99cc5d9e17a0de998
| 29
|
py
|
Python
|
open_connect/resources/__init__.py
|
lpatmo/actionify_the_news
|
998d8ca6b35d0ef1b16efca70f50e59503f5a62d
|
[
"MIT"
] | 66
|
2015-11-30T20:35:38.000Z
|
2019-06-12T17:40:32.000Z
|
open_connect/resources/__init__.py
|
lpatmo/actionify_the_news
|
998d8ca6b35d0ef1b16efca70f50e59503f5a62d
|
[
"MIT"
] | 18
|
2015-11-30T22:03:05.000Z
|
2019-07-02T00:50:29.000Z
|
open_connect/resources/__init__.py
|
lpatmo/actionify_the_news
|
998d8ca6b35d0ef1b16efca70f50e59503f5a62d
|
[
"MIT"
] | 11
|
2015-11-30T20:56:01.000Z
|
2019-07-01T17:06:09.000Z
|
"""Resources for Connect."""
| 14.5
| 28
| 0.655172
| 3
| 29
| 6.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.103448
| 29
| 1
| 29
| 29
| 0.730769
| 0.758621
| 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
|
4ffd14e2793ef41e19a4856894f3699a7dc3ab24
| 219
|
py
|
Python
|
torchvision/models/quantization/mobilenet.py
|
fubel/vision
|
6845355fd80a48ca7ec80c06aa2d97d50f0b077d
|
[
"BSD-3-Clause"
] | 1
|
2021-03-10T11:45:31.000Z
|
2021-03-10T11:45:31.000Z
|
torchvision/models/quantization/mobilenet.py
|
fubel/vision
|
6845355fd80a48ca7ec80c06aa2d97d50f0b077d
|
[
"BSD-3-Clause"
] | null | null | null |
torchvision/models/quantization/mobilenet.py
|
fubel/vision
|
6845355fd80a48ca7ec80c06aa2d97d50f0b077d
|
[
"BSD-3-Clause"
] | null | null | null |
from .mobilenetv2 import QuantizableMobileNetV2, mobilenet_v2, __all__ as mv2_all
from .mobilenetv3 import QuantizableMobileNetV3, mobilenet_v3_large, mobilenet_v3_small, __all__ as mv3_all
__all__ = mv2_all + mv3_all
| 43.8
| 107
| 0.853881
| 29
| 219
| 5.724138
| 0.517241
| 0.060241
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.056122
| 0.105023
| 219
| 4
| 108
| 54.75
| 0.790816
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 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
|
8b26a97af578ac72d33b663bde21014694ccbde0
| 108
|
py
|
Python
|
decorators/has_state_decorator/__init__.py
|
ozgen92/classier
|
dd865978f9066e1572e13c8f74c52f82a549972d
|
[
"MIT"
] | null | null | null |
decorators/has_state_decorator/__init__.py
|
ozgen92/classier
|
dd865978f9066e1572e13c8f74c52f82a549972d
|
[
"MIT"
] | null | null | null |
decorators/has_state_decorator/__init__.py
|
ozgen92/classier
|
dd865978f9066e1572e13c8f74c52f82a549972d
|
[
"MIT"
] | null | null | null |
_MARK_TYPE_NAME = "HAS_STATE_METHODS"
import classier.decorators.has_state_decorator.has_state as has_state
| 36
| 69
| 0.87963
| 17
| 108
| 5.058824
| 0.647059
| 0.372093
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.064815
| 108
| 3
| 69
| 36
| 0.851485
| 0
| 0
| 0
| 0
| 0
| 0.155963
| 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
|
8b2f8fa6a587f0bb88ba2943f0307773bed8d1ef
| 501
|
py
|
Python
|
GE_RealEstate/listings/views.py
|
gbesparza24/capstone
|
691268af09d878798fe291fd4c269efe1ec84d47
|
[
"MIT"
] | null | null | null |
GE_RealEstate/listings/views.py
|
gbesparza24/capstone
|
691268af09d878798fe291fd4c269efe1ec84d47
|
[
"MIT"
] | null | null | null |
GE_RealEstate/listings/views.py
|
gbesparza24/capstone
|
691268af09d878798fe291fd4c269efe1ec84d47
|
[
"MIT"
] | null | null | null |
from django.shortcuts import render
from django.http import HttpResponse
from .models import Listing
import requests
import json
# Create your views here.
def index(request):
listings = Listing.objects.all()
context = {
'listings' : listings
}
return render(request, 'listings/listings.html', context)
def listing(request,listing_id):
return render(request, 'listings/listing.html')
def search(request):
return render(request, 'listings/search.html')
| 17.892857
| 61
| 0.710579
| 59
| 501
| 6.016949
| 0.440678
| 0.169014
| 0.160563
| 0.228169
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.193613
| 501
| 28
| 62
| 17.892857
| 0.878713
| 0.045908
| 0
| 0
| 0
| 0
| 0.148847
| 0.090147
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.333333
| 0.133333
| 0.733333
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 4
|
8ca2b1a2092653552a953abf4cc9cb84e43877e6
| 100
|
py
|
Python
|
data/__init__.py
|
LordMartian/pytorch-template
|
d404a50abdeea892c068ba90a3e93759e6f7c4ab
|
[
"MIT"
] | null | null | null |
data/__init__.py
|
LordMartian/pytorch-template
|
d404a50abdeea892c068ba90a3e93759e6f7c4ab
|
[
"MIT"
] | null | null | null |
data/__init__.py
|
LordMartian/pytorch-template
|
d404a50abdeea892c068ba90a3e93759e6f7c4ab
|
[
"MIT"
] | null | null | null |
"""
Author: Smeet Shah
Description: __init__ file for data package
"""
from .my_dataset import *
| 12.5
| 44
| 0.72
| 13
| 100
| 5.153846
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.18
| 100
| 7
| 45
| 14.285714
| 0.817073
| 0.64
| 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
|
8caaac1cdde4fb47c55c42533a5b86fecad721ad
| 178
|
py
|
Python
|
dogcatapp/serializers.py
|
nyansilo/portfolio_web
|
c6c0ef4d93b193b3bfe5f3ede7f4f3a5dd38c29c
|
[
"MIT"
] | null | null | null |
dogcatapp/serializers.py
|
nyansilo/portfolio_web
|
c6c0ef4d93b193b3bfe5f3ede7f4f3a5dd38c29c
|
[
"MIT"
] | null | null | null |
dogcatapp/serializers.py
|
nyansilo/portfolio_web
|
c6c0ef4d93b193b3bfe5f3ede7f4f3a5dd38c29c
|
[
"MIT"
] | null | null | null |
from rest_framework import serializers
from . models import DogCatModel
class dogcatSerializers(serializers.ModelSerializer):
class Meta:
model=DogCatModel
fields='__all__'
| 25.428571
| 53
| 0.831461
| 19
| 178
| 7.526316
| 0.736842
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.11236
| 178
| 7
| 54
| 25.428571
| 0.905063
| 0
| 0
| 0
| 0
| 0
| 0.039106
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 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
|
8cc166706fad0c06353cdbf4be85b3f87bdb4edb
| 67
|
py
|
Python
|
folder_example/entities/event.py
|
haderazzini/py2docx
|
2065a00bf2630d0974a572521a3006f4ee1eafee
|
[
"MIT"
] | null | null | null |
folder_example/entities/event.py
|
haderazzini/py2docx
|
2065a00bf2630d0974a572521a3006f4ee1eafee
|
[
"MIT"
] | null | null | null |
folder_example/entities/event.py
|
haderazzini/py2docx
|
2065a00bf2630d0974a572521a3006f4ee1eafee
|
[
"MIT"
] | null | null | null |
print('Event')
#-------------Lorem
for i in [5,4,5]:
print(i)
| 11.166667
| 19
| 0.447761
| 11
| 67
| 2.727273
| 0.727273
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.054545
| 0.179104
| 67
| 6
| 20
| 11.166667
| 0.490909
| 0.268657
| 0
| 0
| 0
| 0
| 0.102041
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.666667
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
8cda7f9365a1c9c5f060e7b23a6e3b76de99ee16
| 108
|
py
|
Python
|
evaluators/prequential/implicit_feedback/__init__.py
|
joaoms/incRec
|
99729099ed51fd1d40a7468da4ddc8279532b53f
|
[
"MIT"
] | 5
|
2020-07-05T16:17:19.000Z
|
2020-07-26T17:06:44.000Z
|
evaluators/prequential/implicit_feedback/__init__.py
|
joaoms/incRec
|
99729099ed51fd1d40a7468da4ddc8279532b53f
|
[
"MIT"
] | 1
|
2020-07-05T14:23:17.000Z
|
2020-07-05T14:23:17.000Z
|
evaluators/prequential/implicit_feedback/__init__.py
|
joaoms/incRec
|
99729099ed51fd1d40a7468da4ddc8279532b53f
|
[
"MIT"
] | 1
|
2020-12-30T11:42:05.000Z
|
2020-12-30T11:42:05.000Z
|
from .prequential_evaluator import PrequentialEvaluatorImplicit
__all__ = ["PrequentialEvaluatorImplicit"]
| 27
| 63
| 0.87037
| 7
| 108
| 12.714286
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.074074
| 108
| 3
| 64
| 36
| 0.89
| 0
| 0
| 0
| 0
| 0
| 0.259259
| 0.259259
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
8cfa9da15bd9498f957ff243459b3191528e8bd1
| 151
|
py
|
Python
|
static_autocollect/apps.py
|
jayvdb/django-static-autocollect
|
01b803936c60f7b21bac7d6a1eb4bb64eed12491
|
[
"BSD-3-Clause"
] | 9
|
2016-06-03T23:46:12.000Z
|
2021-01-13T09:31:34.000Z
|
static_autocollect/apps.py
|
jayvdb/django-static-autocollect
|
01b803936c60f7b21bac7d6a1eb4bb64eed12491
|
[
"BSD-3-Clause"
] | 4
|
2020-02-11T23:15:30.000Z
|
2021-03-25T21:40:28.000Z
|
static_autocollect/apps.py
|
jayvdb/django-static-autocollect
|
01b803936c60f7b21bac7d6a1eb4bb64eed12491
|
[
"BSD-3-Clause"
] | 3
|
2017-03-17T12:59:18.000Z
|
2020-06-02T12:52:00.000Z
|
from __future__ import unicode_literals
from django.apps import AppConfig
class StaticAutocollectConfig(AppConfig):
name = 'static_autocollect'
| 18.875
| 41
| 0.821192
| 16
| 151
| 7.375
| 0.8125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.13245
| 151
| 7
| 42
| 21.571429
| 0.900763
| 0
| 0
| 0
| 0
| 0
| 0.119205
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
5071456ac3673a0557010387cf18df59ec2579e6
| 2,238
|
py
|
Python
|
2016/day1/puzzle1.py
|
tcmitchell/AdventOfCode
|
caaac1aa37c999d4804f9f4154bf7033a06e98af
|
[
"MIT"
] | null | null | null |
2016/day1/puzzle1.py
|
tcmitchell/AdventOfCode
|
caaac1aa37c999d4804f9f4154bf7033a06e98af
|
[
"MIT"
] | null | null | null |
2016/day1/puzzle1.py
|
tcmitchell/AdventOfCode
|
caaac1aa37c999d4804f9f4154bf7033a06e98af
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python
import time
print 'Hello, World!'
with open('input.txt', 'rb') as f:
data = f.read()
print len(data)
commands = data.split(',')
commands = [c.strip() for c in commands]
commands = [(c[0], int(c[1:])) for c in commands]
print len(commands)
for i in range(25):
print commands[i]
class Direction(object):
North = 0
East = 1
South = 2
West = 3
class Robot(object):
def __init__(self):
self.x = 0
self.y = 0
self.direction = Direction.North
def move(self, count):
if self.direction == Direction.North:
self.y += count
elif self.direction == Direction.South:
self.y -= count
elif self.direction == Direction.East:
self.x += count
elif self.direction == Direction.West:
self.x -= count
else:
raise Exception("Unknown Direction")
def turn(self, direction):
if direction == 'L':
self.turnLeft()
elif direction == 'R':
self.turnRight()
else:
raise Exception("Turn unknown direction")
def turnLeft(self):
if self.direction == Direction.North:
self.direction = Direction.West
elif self.direction == Direction.South:
self.direction = Direction.East
elif self.direction == Direction.East:
self.direction = Direction.North
elif self.direction == Direction.West:
self.direction = Direction.South
else:
raise Exception("turnLeft Unknown Direction")
def turnRight(self):
if self.direction == Direction.North:
self.direction = Direction.East
elif self.direction == Direction.South:
self.direction = Direction.West
elif self.direction == Direction.East:
self.direction = Direction.South
elif self.direction == Direction.West:
self.direction = Direction.North
else:
raise Exception("turnLeft Unknown Direction")
robot = Robot()
for (direction, count) in commands:
print direction, count
robot.turn(direction)
robot.move(count)
print 'Robot:', robot.x, robot.y
# time.sleep(1)
| 26.963855
| 57
| 0.588472
| 256
| 2,238
| 5.128906
| 0.234375
| 0.217822
| 0.351866
| 0.178218
| 0.515613
| 0.511805
| 0.389947
| 0.33511
| 0.083778
| 0
| 0
| 0.007029
| 0.300715
| 2,238
| 82
| 58
| 27.292683
| 0.831949
| 0.015192
| 0
| 0.402985
| 0
| 0
| 0.056312
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.014925
| null | null | 0.089552
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
50c07666d6d2786556ea79a2ff9207253bdd11b7
| 165
|
py
|
Python
|
problem0682.py
|
kmarcini/Project-Euler-Python
|
d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3
|
[
"BSD-3-Clause"
] | null | null | null |
problem0682.py
|
kmarcini/Project-Euler-Python
|
d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3
|
[
"BSD-3-Clause"
] | null | null | null |
problem0682.py
|
kmarcini/Project-Euler-Python
|
d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3
|
[
"BSD-3-Clause"
] | null | null | null |
###########################
#
# #682 5-Smooth Pairs - Project Euler
# https://projecteuler.net/problem=682
#
# Code by Kevin Marciniak
#
###########################
| 18.333333
| 38
| 0.466667
| 15
| 165
| 5.133333
| 0.933333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.047945
| 0.115152
| 165
| 8
| 39
| 20.625
| 0.479452
| 0.575758
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
50c7eb977f4341a6a36c81778f637dc34129c0a9
| 6,955
|
py
|
Python
|
python/medifor/v1/analytic_pb2_grpc.py
|
xkortex/medifor
|
2e715256ab170208255c935d1ae8e844ade27574
|
[
"Apache-2.0"
] | 9
|
2019-09-16T20:37:37.000Z
|
2021-07-26T05:04:36.000Z
|
python/medifor/v1/analytic_pb2_grpc.py
|
xkortex/medifor
|
2e715256ab170208255c935d1ae8e844ade27574
|
[
"Apache-2.0"
] | 19
|
2019-10-28T22:18:56.000Z
|
2022-03-12T00:08:34.000Z
|
python/medifor/v1/analytic_pb2_grpc.py
|
xkortex/medifor-lite
|
4567e16f59930417506e784e94f3fedb4afcc0c3
|
[
"Apache-2.0"
] | 11
|
2019-08-02T18:56:43.000Z
|
2021-04-05T20:32:55.000Z
|
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from medifor.v1 import analytic_pb2 as medifor_dot_v1_dot_analytic__pb2
class AnalyticStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.DetectImageManipulation = channel.unary_unary(
'/mediforproto.Analytic/DetectImageManipulation',
request_serializer=medifor_dot_v1_dot_analytic__pb2.ImageManipulationRequest.SerializeToString,
response_deserializer=medifor_dot_v1_dot_analytic__pb2.ImageManipulation.FromString,
)
self.DetectImageSplice = channel.unary_unary(
'/mediforproto.Analytic/DetectImageSplice',
request_serializer=medifor_dot_v1_dot_analytic__pb2.ImageSpliceRequest.SerializeToString,
response_deserializer=medifor_dot_v1_dot_analytic__pb2.ImageSplice.FromString,
)
self.DetectVideoManipulation = channel.unary_unary(
'/mediforproto.Analytic/DetectVideoManipulation',
request_serializer=medifor_dot_v1_dot_analytic__pb2.VideoManipulationRequest.SerializeToString,
response_deserializer=medifor_dot_v1_dot_analytic__pb2.VideoManipulation.FromString,
)
self.DetectImageCameraMatch = channel.unary_unary(
'/mediforproto.Analytic/DetectImageCameraMatch',
request_serializer=medifor_dot_v1_dot_analytic__pb2.ImageCameraMatchRequest.SerializeToString,
response_deserializer=medifor_dot_v1_dot_analytic__pb2.ImageCameraMatch.FromString,
)
self.DetectImageCameras = channel.unary_unary(
'/mediforproto.Analytic/DetectImageCameras',
request_serializer=medifor_dot_v1_dot_analytic__pb2.ImageCamerasRequest.SerializeToString,
response_deserializer=medifor_dot_v1_dot_analytic__pb2.ImageCameras.FromString,
)
self.DetectVideoCameraMatch = channel.unary_unary(
'/mediforproto.Analytic/DetectVideoCameraMatch',
request_serializer=medifor_dot_v1_dot_analytic__pb2.VideoCameraMatchRequest.SerializeToString,
response_deserializer=medifor_dot_v1_dot_analytic__pb2.VideoCameraMatch.FromString,
)
self.Kill = channel.unary_unary(
'/mediforproto.Analytic/Kill',
request_serializer=medifor_dot_v1_dot_analytic__pb2.Empty.SerializeToString,
response_deserializer=medifor_dot_v1_dot_analytic__pb2.Empty.FromString,
)
class AnalyticServicer(object):
# missing associated documentation comment in .proto file
pass
def DetectImageManipulation(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def DetectImageSplice(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def DetectVideoManipulation(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def DetectImageCameraMatch(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def DetectImageCameras(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def DetectVideoCameraMatch(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def Kill(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_AnalyticServicer_to_server(servicer, server):
rpc_method_handlers = {
'DetectImageManipulation': grpc.unary_unary_rpc_method_handler(
servicer.DetectImageManipulation,
request_deserializer=medifor_dot_v1_dot_analytic__pb2.ImageManipulationRequest.FromString,
response_serializer=medifor_dot_v1_dot_analytic__pb2.ImageManipulation.SerializeToString,
),
'DetectImageSplice': grpc.unary_unary_rpc_method_handler(
servicer.DetectImageSplice,
request_deserializer=medifor_dot_v1_dot_analytic__pb2.ImageSpliceRequest.FromString,
response_serializer=medifor_dot_v1_dot_analytic__pb2.ImageSplice.SerializeToString,
),
'DetectVideoManipulation': grpc.unary_unary_rpc_method_handler(
servicer.DetectVideoManipulation,
request_deserializer=medifor_dot_v1_dot_analytic__pb2.VideoManipulationRequest.FromString,
response_serializer=medifor_dot_v1_dot_analytic__pb2.VideoManipulation.SerializeToString,
),
'DetectImageCameraMatch': grpc.unary_unary_rpc_method_handler(
servicer.DetectImageCameraMatch,
request_deserializer=medifor_dot_v1_dot_analytic__pb2.ImageCameraMatchRequest.FromString,
response_serializer=medifor_dot_v1_dot_analytic__pb2.ImageCameraMatch.SerializeToString,
),
'DetectImageCameras': grpc.unary_unary_rpc_method_handler(
servicer.DetectImageCameras,
request_deserializer=medifor_dot_v1_dot_analytic__pb2.ImageCamerasRequest.FromString,
response_serializer=medifor_dot_v1_dot_analytic__pb2.ImageCameras.SerializeToString,
),
'DetectVideoCameraMatch': grpc.unary_unary_rpc_method_handler(
servicer.DetectVideoCameraMatch,
request_deserializer=medifor_dot_v1_dot_analytic__pb2.VideoCameraMatchRequest.FromString,
response_serializer=medifor_dot_v1_dot_analytic__pb2.VideoCameraMatch.SerializeToString,
),
'Kill': grpc.unary_unary_rpc_method_handler(
servicer.Kill,
request_deserializer=medifor_dot_v1_dot_analytic__pb2.Empty.FromString,
response_serializer=medifor_dot_v1_dot_analytic__pb2.Empty.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'mediforproto.Analytic', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
| 46.677852
| 103
| 0.781021
| 696
| 6,955
| 7.41523
| 0.12069
| 0.063941
| 0.067429
| 0.084286
| 0.767293
| 0.717109
| 0.712071
| 0.575276
| 0.470258
| 0.288122
| 0
| 0.010178
| 0.152408
| 6,955
| 148
| 104
| 46.993243
| 0.86531
| 0.089001
| 0
| 0.313559
| 1
| 0
| 0.120799
| 0.06357
| 0
| 0
| 0
| 0
| 0
| 1
| 0.076271
| false
| 0.076271
| 0.016949
| 0
| 0.110169
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
50ce22a3c7ae2b5692abd1454f876901da5876c8
| 4,900
|
py
|
Python
|
headers.py
|
Megha-Bose/Brick-Breaker-Game
|
b543ec8277193dcca0ec15afab4a4775744b9587
|
[
"MIT"
] | 1
|
2021-04-08T04:15:36.000Z
|
2021-04-08T04:15:36.000Z
|
headers.py
|
Megha-Bose/Brick-Breaker-Game
|
b543ec8277193dcca0ec15afab4a4775744b9587
|
[
"MIT"
] | null | null | null |
headers.py
|
Megha-Bose/Brick-Breaker-Game
|
b543ec8277193dcca0ec15afab4a4775744b9587
|
[
"MIT"
] | null | null | null |
import time, os, sys
import numpy as np
import signal
import random
from alarmexception import AlarmException
from getch import _getChUnix as getChar
from colorama import init, Fore, Back, Style
init()
HEIGHT=40
WIDTH=90
PADDLE_LEN = 10
INPUT_CHAR=''
LIVES = [20]
LEVEL = [1]
SCORE = [0]
START = [0]
START_LVL = [0]
FALL_TIME = [4]
SHIFT = [0]
GAMETIME = 100
LEFT_MARGIN = 10
BALL_SPEED = 1
PLACED = [0]
MULTI_BALL = 2
GRAB_FLAG = [1]
SHOOT_FLAG = [0]
END_SHOOT = [0]
EXP_PAD_FLAG = 0
SHR_PAD_FLAG = 0
BALL_X_FLAG = 0
FAST_BALL_FLAG = 0
THRU_BALL_FLAG = 0
SCREEN = 100
RAINBOW_FLAG = [1, 1]
L1_ENTER = [0]
L2_ENTER = [0]
L3_ENTER = [0]
L4_ENTER = [0]
NUM_BALLS = [1]
POWERUP_LIFE = [6]
POWERUP_SPEED = [1]
BOMB_SPEED = [1]
ENEMY_HEALTH = [5]
def reposition_cursor(x, y):
print("\033[%d;%dH" % (x, y))
# POWER UPS:
EXP_PAD = Fore.LIGHTGREEN_EX + "+" + Fore.RESET
SHR_PAD = Fore.LIGHTMAGENTA_EX + "-" + Fore.RESET
BALL_X = Fore.LIGHTWHITE_EX + "x" + Fore.RESET
FAST_BALL = Fore.LIGHTYELLOW_EX + "*" + Fore.RESET
THRU_BALL = Fore.LIGHTCYAN_EX + "$" + Fore.RESET
GRAB = Fore.LIGHTWHITE_EX + "&" + Fore.RESET
def win():
os.system('aplay -q ./sounds/sound_win.wav&')
print(Fore.LIGHTMAGENTA_EX + Style.BRIGHT+ " __ __ ___".center(SCREEN))
print(Fore.LIGHTMAGENTA_EX + Style.BRIGHT+ " \ \ / / | |".center(SCREEN))
print(Fore.LIGHTMAGENTA_EX + Style.BRIGHT+ " \ \_/ /_ __ __ _ ___ _ ____ _ ___ | |".center(SCREEN))
print(Fore.LIGHTMAGENTA_EX + Style.BRIGHT+ " \ / _ \| | | | | | | | | |/___ \| |__ \ | |".center(SCREEN))
print(Fore.LIGHTMAGENTA_EX + Style.BRIGHT+ " | | (_| | |_| | | |_| |_| | |__| | | | | |_|".center(SCREEN))
print(Fore.LIGHTMAGENTA_EX + Style.BRIGHT+ " |_|\___/\_____/ \__,__,__/\____/|_| |_| (_)".center(SCREEN)+Style.RESET_ALL)
print(Fore.LIGHTMAGENTA_EX + Style.BRIGHT+ " ".center(SCREEN)+Style.RESET_ALL)
print(Fore.LIGHTMAGENTA_EX + Style.BRIGHT+ " ".center(SCREEN)+Style.RESET_ALL)
print(Fore.LIGHTMAGENTA_EX + Style.BRIGHT+ " ".center(SCREEN)+Style.RESET_ALL)
def escape():
os.system('aplay -q ./sounds/sound_game_over.wav&')
print(Fore.LIGHTMAGENTA_EX + Style.BRIGHT+ " __ __ _ _ ___".center(SCREEN))
print(Fore.LIGHTMAGENTA_EX + Style.BRIGHT+ " \ \ / / |_| _| |_ | |".center(SCREEN))
print(Fore.LIGHTMAGENTA_EX + Style.BRIGHT+ " \ \_/ /_ __ __ _____ _ ___ _ /_ _\ | |".center(SCREEN))
print(Fore.LIGHTMAGENTA_EX + Style.BRIGHT+ " \ / _ \| | | | | _ | | | | | | | | | | |".center(SCREEN))
print(Fore.LIGHTMAGENTA_EX + Style.BRIGHT+ " | | (_| | |_| | | |_| | | |_| | | | | | |_|".center(SCREEN))
print(Fore.LIGHTMAGENTA_EX + Style.BRIGHT+ " |_|\___/\_____/ \__, , \___/ |_| |_| (_)".center(SCREEN)+Style.RESET_ALL)
print(Fore.LIGHTMAGENTA_EX + Style.BRIGHT+ " | | ".center(SCREEN)+Style.RESET_ALL)
print(Fore.LIGHTMAGENTA_EX + Style.BRIGHT+ " |_| ".center(SCREEN)+Style.RESET_ALL)
print(Fore.LIGHTMAGENTA_EX + Style.BRIGHT+ " ".center(SCREEN)+Style.RESET_ALL)
def game_over():
os.system('aplay -q ./sounds/sound_game_over.wav&')
print(Fore.LIGHTMAGENTA_EX + Style.BRIGHT+ " ".center(SCREEN))
print(Fore.LIGHTMAGENTA_EX + Style.BRIGHT+ " _____ ____ ".center(SCREEN))
print(Fore.LIGHTMAGENTA_EX + Style.BRIGHT+ " / ____| / __ \ ".center(SCREEN))
print(Fore.LIGHTMAGENTA_EX + Style.BRIGHT+ "| | __ __ _ _ __ ___ ___ | | | |_ _____ _ __ ".center(SCREEN))
print(Fore.LIGHTMAGENTA_EX + Style.BRIGHT +"| | |_ |/ _` | '_ ` _ \ / _ \ | | | \ \ / / _ \ '__|".center(SCREEN))
print(Fore.LIGHTMAGENTA_EX + Style.BRIGHT +"| |__| | (_| | | | | | | __/ | |__| |\ V / __/ | ".center(SCREEN))
print(Fore.LIGHTMAGENTA_EX + Style.BRIGHT +" \_____|\__,_|_| |_| |_|\___| \____/ \_/ \___|_| ".center(SCREEN))
print(Fore.LIGHTMAGENTA_EX + Style.BRIGHT+ " ".center(SCREEN)+Style.RESET_ALL)
print(Fore.LIGHTMAGENTA_EX + Style.BRIGHT+ " ".center(SCREEN)+Style.RESET_ALL)
print(Fore.LIGHTMAGENTA_EX + Style.BRIGHT+ " ".center(SCREEN)+Style.RESET_ALL)
| 51.041667
| 152
| 0.524286
| 476
| 4,900
| 4.804622
| 0.220588
| 0.202886
| 0.228247
| 0.281592
| 0.672059
| 0.672059
| 0.661128
| 0.661128
| 0.661128
| 0.661128
| 0
| 0.015371
| 0.322857
| 4,900
| 95
| 153
| 51.578947
| 0.6739
| 0.002041
| 0
| 0.129412
| 0
| 0.082353
| 0.323854
| 0.016571
| 0
| 0
| 0
| 0
| 0
| 1
| 0.047059
| false
| 0
| 0.082353
| 0
| 0.129412
| 0.341176
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
50d4845d4fee830af8e01165eb268f73bf388d1d
| 90
|
py
|
Python
|
kruptos/csapp/apps.py
|
ashwani762/Kruptos
|
9cd04ee6147c2dc14764e45c3481690ae399e664
|
[
"Apache-2.0"
] | null | null | null |
kruptos/csapp/apps.py
|
ashwani762/Kruptos
|
9cd04ee6147c2dc14764e45c3481690ae399e664
|
[
"Apache-2.0"
] | 12
|
2019-11-04T13:36:37.000Z
|
2022-03-11T23:32:50.000Z
|
kruptos/csapp/apps.py
|
ashwani762/Kruptos
|
9cd04ee6147c2dc14764e45c3481690ae399e664
|
[
"Apache-2.0"
] | null | null | null |
from django.apps import AppConfig
class CsappConfig(AppConfig):
name = 'csapp'
| 15
| 34
| 0.7
| 10
| 90
| 6.3
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.222222
| 90
| 5
| 35
| 18
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0.058824
| 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
|
50f6f77180142771062fbb4012cc4c7a7405798a
| 117
|
py
|
Python
|
AnuOyeboade/phase1/BASIC/DAY6/Q50.py
|
CodedLadiesInnovateTech/-python-challenge-solutions
|
430cd3eb84a2905a286819eef384ee484d8eb9e7
|
[
"MIT"
] | 6
|
2020-05-23T19:53:25.000Z
|
2021-05-08T20:21:30.000Z
|
AnuOyeboade/phase1/BASIC/DAY6/Q50.py
|
CodedLadiesInnovateTech/-python-challenge-solutions
|
430cd3eb84a2905a286819eef384ee484d8eb9e7
|
[
"MIT"
] | 8
|
2020-05-14T18:53:12.000Z
|
2020-07-03T00:06:20.000Z
|
AnuOyeboade/phase1/BASIC/DAY6/Q50.py
|
CodedLadiesInnovateTech/-python-challenge-solutions
|
430cd3eb84a2905a286819eef384ee484d8eb9e7
|
[
"MIT"
] | 39
|
2020-05-10T20:55:02.000Z
|
2020-09-12T17:40:59.000Z
|
#Write a Python program to print without newline or space.
print("The Lord is good.", end="")
print("All the time")
| 23.4
| 58
| 0.709402
| 20
| 117
| 4.15
| 0.85
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.162393
| 117
| 4
| 59
| 29.25
| 0.846939
| 0.487179
| 0
| 0
| 0
| 0
| 0.491525
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
0f9e8e95017e0bb433fc20c78c291c674b17773a
| 82
|
py
|
Python
|
dl_in_iot_course/l02_quantization/__init__.py
|
madziejm/dl-in-iot-course-1
|
4958e207f18a74a2c6a7fb6d883079ff95d34f3a
|
[
"Apache-2.0"
] | null | null | null |
dl_in_iot_course/l02_quantization/__init__.py
|
madziejm/dl-in-iot-course-1
|
4958e207f18a74a2c6a7fb6d883079ff95d34f3a
|
[
"Apache-2.0"
] | 1
|
2021-11-09T08:47:50.000Z
|
2021-11-09T08:47:50.000Z
|
dl_in_iot_course/l02_quantization/__init__.py
|
madziejm/dl-in-iot-course-1
|
4958e207f18a74a2c6a7fb6d883079ff95d34f3a
|
[
"Apache-2.0"
] | 2
|
2021-11-04T19:52:21.000Z
|
2021-11-05T18:58:44.000Z
|
"""
Module containing tasks regarding quantization of DL models using TFLite.
"""
| 20.5
| 73
| 0.768293
| 10
| 82
| 6.3
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.146341
| 82
| 3
| 74
| 27.333333
| 0.9
| 0.890244
| 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
|
0faa234b963b3396da0a1e2d9ce93122b81bf920
| 230
|
py
|
Python
|
Desafios/Desafio006.py
|
OtavioCampagnoli/Aprendendo-Python
|
37bf341d3edbb5392c1ccf866ac0109d5905f68f
|
[
"MIT"
] | null | null | null |
Desafios/Desafio006.py
|
OtavioCampagnoli/Aprendendo-Python
|
37bf341d3edbb5392c1ccf866ac0109d5905f68f
|
[
"MIT"
] | null | null | null |
Desafios/Desafio006.py
|
OtavioCampagnoli/Aprendendo-Python
|
37bf341d3edbb5392c1ccf866ac0109d5905f68f
|
[
"MIT"
] | null | null | null |
#Crie um algoritmo que leia um número e mostre o seu dobro, triplo e raiz quadrada.
n = int(input('Informe um número'))
print(f'O número informado é {n}\nSeu dobro é {n*2}\nSeu triplo é {n*3}\nSua raiz quadrada é {n**(1/2):.2f}')
| 57.5
| 109
| 0.695652
| 47
| 230
| 3.404255
| 0.595745
| 0.05
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.025773
| 0.156522
| 230
| 4
| 109
| 57.5
| 0.798969
| 0.356522
| 0
| 0
| 0
| 0.5
| 0.783784
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.5
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
0fc0dc9ac873fc7dfeff2053a1741d095e4cba02
| 267
|
py
|
Python
|
models/temporal_link/temporal_weights.py
|
zankner/DNC
|
2596fa3a1ee9bf0a9f160f3f953639e70bb25fe7
|
[
"MIT"
] | 3
|
2020-03-20T17:46:33.000Z
|
2020-03-23T16:48:59.000Z
|
models/temporal_link/temporal_weights.py
|
zankner/DNC
|
2596fa3a1ee9bf0a9f160f3f953639e70bb25fe7
|
[
"MIT"
] | null | null | null |
models/temporal_link/temporal_weights.py
|
zankner/DNC
|
2596fa3a1ee9bf0a9f160f3f953639e70bb25fe7
|
[
"MIT"
] | 1
|
2020-03-20T17:55:55.000Z
|
2020-03-20T17:55:55.000Z
|
import tensorflow as tf
def temporal_weights(temporal_links, read_weights):
forward_weights = tf.matmul(read_weights,
temporal_links, transpose_b = True)
backward_weights = tf.matmul(read_weights, temporal_links)
return forward_weights, backward_weights
| 33.375
| 60
| 0.808989
| 35
| 267
| 5.828571
| 0.457143
| 0.220588
| 0.294118
| 0.186275
| 0.382353
| 0.382353
| 0.382353
| 0
| 0
| 0
| 0
| 0
| 0.127341
| 267
| 7
| 61
| 38.142857
| 0.875536
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0.166667
| 0
| 0.5
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
0fcd2906762c0be441254000478ca51f428af531
| 154
|
py
|
Python
|
imggram/apps.py
|
detrakt/myblog
|
0c6aa1e270a9aad5a654c684f5e1803eb9e10f0f
|
[
"MIT"
] | null | null | null |
imggram/apps.py
|
detrakt/myblog
|
0c6aa1e270a9aad5a654c684f5e1803eb9e10f0f
|
[
"MIT"
] | null | null | null |
imggram/apps.py
|
detrakt/myblog
|
0c6aa1e270a9aad5a654c684f5e1803eb9e10f0f
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class ImggramConfig(AppConfig):
name = 'imggram'
| 17.111111
| 39
| 0.733766
| 18
| 154
| 6
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.007752
| 0.162338
| 154
| 8
| 40
| 19.25
| 0.829457
| 0.136364
| 0
| 0
| 0
| 0
| 0.053435
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
0feef59b60729f8eceac61abcc47a1d3b96a5c7e
| 173
|
py
|
Python
|
app.py
|
CabraKill/dockerFlaskInfra
|
d3c151406d7848a2e1e13399b6f3fec6ed6fcb9b
|
[
"MIT"
] | 2
|
2021-06-07T16:48:43.000Z
|
2021-07-27T12:44:13.000Z
|
app.py
|
CabraKill/dockerFlaskInfra
|
d3c151406d7848a2e1e13399b6f3fec6ed6fcb9b
|
[
"MIT"
] | null | null | null |
app.py
|
CabraKill/dockerFlaskInfra
|
d3c151406d7848a2e1e13399b6f3fec6ed6fcb9b
|
[
"MIT"
] | null | null | null |
from src.endpointController import EndpointController
from src import app
@app.route("/")
def home():
return "Hello, You!"
endpointController = EndpointController()
| 15.727273
| 53
| 0.751445
| 18
| 173
| 7.222222
| 0.611111
| 0.107692
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.144509
| 173
| 10
| 54
| 17.3
| 0.878378
| 0
| 0
| 0
| 0
| 0
| 0.069364
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0.333333
| 0.166667
| 0.666667
| 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
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 4
|
ba0a12b11f3a1d37a3b53552913dc98cb91dab6a
| 758
|
py
|
Python
|
tests/data/program_analysis/interface/interface_03.py
|
rsulli55/automates
|
1647a8eef85c4f03086a10fa72db3b547f1a0455
|
[
"Apache-2.0"
] | 17
|
2018-12-19T16:32:38.000Z
|
2021-10-05T07:58:15.000Z
|
tests/data/program_analysis/interface/interface_03.py
|
rsulli55/automates
|
1647a8eef85c4f03086a10fa72db3b547f1a0455
|
[
"Apache-2.0"
] | 183
|
2018-12-20T17:03:01.000Z
|
2022-02-23T22:21:42.000Z
|
tests/data/program_analysis/interface/interface_03.py
|
rsulli55/automates
|
1647a8eef85c4f03086a10fa72db3b547f1a0455
|
[
"Apache-2.0"
] | 5
|
2019-01-04T22:37:49.000Z
|
2022-01-19T17:34:16.000Z
|
import sys
from typing import List
import math
from automates.program_analysis.for2py.format import *
from automates.program_analysis.for2py.arrays import *
from automates.program_analysis.for2py.static_save import *
from automates.program_analysis.for2py.strings import *
from dataclasses import dataclass
from automates.program_analysis.for2py.types_ext import Float32
import automates.program_analysis.for2py.math_ext as math
from numbers import Real
from random import random
from automates.program_analysis.for2py.tmp.m_interface03_mod import *
def main():
control_arg = controltype()
iswitch_arg = switchtype()
get_control(control_arg)
get_iswitch(iswitch_arg)
put_control(control_arg)
put_iswitch(iswitch_arg)
main()
| 29.153846
| 69
| 0.813984
| 102
| 758
| 5.833333
| 0.362745
| 0.188235
| 0.282353
| 0.352941
| 0.373109
| 0.201681
| 0
| 0
| 0
| 0
| 0
| 0.016591
| 0.12533
| 758
| 25
| 70
| 30.32
| 0.880845
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.047619
| false
| 0
| 0.619048
| 0
| 0.666667
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
ba1a25db3b84c7f10e821f187796db662ff468bf
| 81
|
py
|
Python
|
abc/abc208/a.py
|
takanori536/atcoder
|
9e10e5e09b39e064e14f03688c7cdddf6c13b505
|
[
"CC0-1.0"
] | null | null | null |
abc/abc208/a.py
|
takanori536/atcoder
|
9e10e5e09b39e064e14f03688c7cdddf6c13b505
|
[
"CC0-1.0"
] | null | null | null |
abc/abc208/a.py
|
takanori536/atcoder
|
9e10e5e09b39e064e14f03688c7cdddf6c13b505
|
[
"CC0-1.0"
] | null | null | null |
a, b = map(int, input().split())
print('Yes' if a * 6 >= b and a <= b else 'No')
| 27
| 47
| 0.518519
| 17
| 81
| 2.470588
| 0.764706
| 0.095238
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.015873
| 0.222222
| 81
| 2
| 48
| 40.5
| 0.650794
| 0
| 0
| 0
| 0
| 0
| 0.061728
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
ba2895e59d6e7ff4ac1683ca09e5416f5ea2ff7c
| 75
|
py
|
Python
|
examples/06-bulldozer-with-bucket/BulldozerBucket.py
|
henkjannl/py-animate
|
dbc93c8a264ef008954901ea76286331ad1737ee
|
[
"MIT"
] | null | null | null |
examples/06-bulldozer-with-bucket/BulldozerBucket.py
|
henkjannl/py-animate
|
dbc93c8a264ef008954901ea76286331ad1737ee
|
[
"MIT"
] | null | null | null |
examples/06-bulldozer-with-bucket/BulldozerBucket.py
|
henkjannl/py-animate
|
dbc93c8a264ef008954901ea76286331ad1737ee
|
[
"MIT"
] | null | null | null |
from Animate import Animate
Animate.Model('BulldozerBucket.xlsx', 'Script')
| 37.5
| 47
| 0.813333
| 9
| 75
| 6.777778
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.066667
| 75
| 2
| 47
| 37.5
| 0.871429
| 0
| 0
| 0
| 0
| 0
| 0.342105
| 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
|
ba2af61b8c90f6d29216340716ecce3b3e304998
| 234
|
py
|
Python
|
flowers_agent/messenger_bot/admin.py
|
darkowic/flowers-agent
|
f47ac7ba228781d1c3b096f42ea6a2da2b1af32b
|
[
"MIT"
] | null | null | null |
flowers_agent/messenger_bot/admin.py
|
darkowic/flowers-agent
|
f47ac7ba228781d1c3b096f42ea6a2da2b1af32b
|
[
"MIT"
] | 2
|
2020-02-11T23:20:23.000Z
|
2020-06-05T19:06:22.000Z
|
flowers_agent/messenger_bot/admin.py
|
darkowic/flowers-agent
|
f47ac7ba228781d1c3b096f42ea6a2da2b1af32b
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import MessengerUser, Flower
@admin.register(MessengerUser)
class MessengerUserAdmin(admin.ModelAdmin):
pass
@admin.register(Flower)
class FlowerAdmin(admin.ModelAdmin):
pass
| 16.714286
| 43
| 0.790598
| 26
| 234
| 7.115385
| 0.538462
| 0.140541
| 0.205405
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.128205
| 234
| 13
| 44
| 18
| 0.906863
| 0
| 0
| 0.25
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.25
| 0.25
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
e8402e5289ab2b50e4b411810a5afff31eb12173
| 84
|
py
|
Python
|
conan_ue4cli/data/packages/toolchain-wrapper/wrappers/clang++.py
|
JJC1138/conan-ue4cli
|
76163a21cb63976cacfea46b024d80c12cf39313
|
[
"MIT"
] | null | null | null |
conan_ue4cli/data/packages/toolchain-wrapper/wrappers/clang++.py
|
JJC1138/conan-ue4cli
|
76163a21cb63976cacfea46b024d80c12cf39313
|
[
"MIT"
] | null | null | null |
conan_ue4cli/data/packages/toolchain-wrapper/wrappers/clang++.py
|
JJC1138/conan-ue4cli
|
76163a21cb63976cacfea46b024d80c12cf39313
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
from ClangInterposition import interpose
interpose(cxx=True)
| 21
| 40
| 0.821429
| 11
| 84
| 6.272727
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.012987
| 0.083333
| 84
| 3
| 41
| 28
| 0.883117
| 0.25
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 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
|
e849885b6cd50e2efe46e9bebaf773edb3ed46fd
| 31
|
py
|
Python
|
other/code_festival_final_d.py
|
ryosuke0825/atcoder_python
|
185cdbe7db44ecca1aaf357858d16d31ce515ddb
|
[
"MIT"
] | null | null | null |
other/code_festival_final_d.py
|
ryosuke0825/atcoder_python
|
185cdbe7db44ecca1aaf357858d16d31ce515ddb
|
[
"MIT"
] | null | null | null |
other/code_festival_final_d.py
|
ryosuke0825/atcoder_python
|
185cdbe7db44ecca1aaf357858d16d31ce515ddb
|
[
"MIT"
] | null | null | null |
A = int(input())
print(A+1, 2)
| 10.333333
| 16
| 0.548387
| 7
| 31
| 2.428571
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.076923
| 0.16129
| 31
| 2
| 17
| 15.5
| 0.576923
| 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
|
e860c2056a10a501985a1dff92183d92e5f2f489
| 89
|
py
|
Python
|
src/protect/apps.py
|
smujuzi/Consumer-Protection-Portal
|
0acb82693bd3167ba25107939c9c093402ef8c6e
|
[
"BSD-3-Clause"
] | null | null | null |
src/protect/apps.py
|
smujuzi/Consumer-Protection-Portal
|
0acb82693bd3167ba25107939c9c093402ef8c6e
|
[
"BSD-3-Clause"
] | null | null | null |
src/protect/apps.py
|
smujuzi/Consumer-Protection-Portal
|
0acb82693bd3167ba25107939c9c093402ef8c6e
|
[
"BSD-3-Clause"
] | null | null | null |
from django.apps import AppConfig
class HostingConfig(AppConfig):
name = 'protect'
| 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
|
e8ccf101cf10b5e2446cba00253b5a77619cbdcf
| 105
|
py
|
Python
|
know_your_priest/apps.py
|
ollc-code/django-back
|
205f3adc61f9e62c88dfcc170999cef495cebed7
|
[
"MIT"
] | null | null | null |
know_your_priest/apps.py
|
ollc-code/django-back
|
205f3adc61f9e62c88dfcc170999cef495cebed7
|
[
"MIT"
] | null | null | null |
know_your_priest/apps.py
|
ollc-code/django-back
|
205f3adc61f9e62c88dfcc170999cef495cebed7
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
class KnowYourPriestConfig(AppConfig):
name = 'know_your_priest'
| 17.5
| 38
| 0.790476
| 12
| 105
| 6.75
| 0.916667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.142857
| 105
| 5
| 39
| 21
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0.152381
| 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
|
e8cd74a0d69c377f7e7446fceda41f07949e9303
| 168
|
py
|
Python
|
spiffyline/theme/exceptions.py
|
snakeyworm/spiffyline
|
cb95a378d8d8e03b1995d5a5fddbc3fb27f9184a
|
[
"MIT"
] | null | null | null |
spiffyline/theme/exceptions.py
|
snakeyworm/spiffyline
|
cb95a378d8d8e03b1995d5a5fddbc3fb27f9184a
|
[
"MIT"
] | null | null | null |
spiffyline/theme/exceptions.py
|
snakeyworm/spiffyline
|
cb95a378d8d8e03b1995d5a5fddbc3fb27f9184a
|
[
"MIT"
] | null | null | null |
# Raised when VT-100 can't be enabled
class VT100Error( Exception ):
def __init__( self ):
super().__init__( "Couldn't enable VT-100 terminal emulation" )
| 28
| 71
| 0.684524
| 23
| 168
| 4.652174
| 0.826087
| 0.093458
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.067669
| 0.208333
| 168
| 5
| 72
| 33.6
| 0.736842
| 0.208333
| 0
| 0
| 0
| 0
| 0.315385
| 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
|
2ce41b55bd123eb2d1c06cb3a99bed2655eba5c6
| 324
|
py
|
Python
|
tests/test_printing_utils.py
|
gleich/Recent-Pinner
|
994c4799568c33af376332498aaf905929ca8f40
|
[
"MIT"
] | 1
|
2021-09-24T22:46:16.000Z
|
2021-09-24T22:46:16.000Z
|
tests/test_printing_utils.py
|
gleich/Recent-Pinner
|
994c4799568c33af376332498aaf905929ca8f40
|
[
"MIT"
] | null | null | null |
tests/test_printing_utils.py
|
gleich/Recent-Pinner
|
994c4799568c33af376332498aaf905929ca8f40
|
[
"MIT"
] | null | null | null |
import printing_utils
def test_print_with_time():
"""Test for the print_with_time function in the /src/printing_utils.py file
"""
printing_utils.print_with_time("Here is a message in blue font", 0)
assert True == True # Required to have assert. We aren't checking output for this function, just that it runs
| 46.285714
| 113
| 0.746914
| 54
| 324
| 4.296296
| 0.685185
| 0.168103
| 0.168103
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.003759
| 0.179012
| 324
| 7
| 113
| 46.285714
| 0.868421
| 0.512346
| 0
| 0
| 0
| 0
| 0.196078
| 0
| 0
| 0
| 0
| 0
| 0.25
| 1
| 0.25
| true
| 0
| 0.25
| 0
| 0.5
| 0.75
| 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
| 1
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
2cef203935caed0bf67afa1b40a73610d586214e
| 100
|
py
|
Python
|
v2/__init__.py
|
oxygenman/DanceRevolution
|
9cf8d7301c7d3ced501d47c6f39d1b15ba2ad80e
|
[
"MIT"
] | null | null | null |
v2/__init__.py
|
oxygenman/DanceRevolution
|
9cf8d7301c7d3ced501d47c6f39d1b15ba2ad80e
|
[
"MIT"
] | null | null | null |
v2/__init__.py
|
oxygenman/DanceRevolution
|
9cf8d7301c7d3ced501d47c6f39d1b15ba2ad80e
|
[
"MIT"
] | null | null | null |
import os, sys
current_dir = os.path.abspath(os.path.dirname(__file__))
sys.path.append(current_dir)
| 33.333333
| 56
| 0.8
| 17
| 100
| 4.352941
| 0.588235
| 0.27027
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.06
| 100
| 3
| 57
| 33.333333
| 0.787234
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
fa04608d274bb406ae74454f2e38f0f4281a2763
| 140
|
py
|
Python
|
rosters/apps.py
|
gregcowell/roster-wizard
|
8a594ba0a6b38fda34bcc924c70a37b1c1692ddf
|
[
"MIT"
] | 18
|
2019-10-27T02:53:57.000Z
|
2021-12-30T06:02:12.000Z
|
rosters/apps.py
|
gregcowell/roster-wizard
|
8a594ba0a6b38fda34bcc924c70a37b1c1692ddf
|
[
"MIT"
] | 9
|
2020-06-06T02:24:55.000Z
|
2021-09-11T03:54:05.000Z
|
rosters/apps.py
|
gregcowell/roster-wizard
|
8a594ba0a6b38fda34bcc924c70a37b1c1692ddf
|
[
"MIT"
] | 7
|
2020-04-20T03:25:56.000Z
|
2021-09-09T06:50:24.000Z
|
"""Applications."""
from django.apps import AppConfig
class RostersConfig(AppConfig):
"""Configure app name."""
name = "rosters"
| 15.555556
| 33
| 0.678571
| 14
| 140
| 6.785714
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.171429
| 140
| 8
| 34
| 17.5
| 0.818966
| 0.235714
| 0
| 0
| 0
| 0
| 0.072917
| 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
|
fa60e45669e40bdde6b2aeb11e82b0cabe820d27
| 1,705
|
py
|
Python
|
gemato/util.py
|
mgorny/gemato
|
b679f4b85962effa6a22fa7b944a695d020cb9a4
|
[
"BSD-2-Clause"
] | 27
|
2017-11-21T23:29:37.000Z
|
2021-08-10T06:17:02.000Z
|
gemato/util.py
|
mgorny/gemato
|
b679f4b85962effa6a22fa7b944a695d020cb9a4
|
[
"BSD-2-Clause"
] | 17
|
2017-11-13T17:06:59.000Z
|
2020-09-05T15:37:53.000Z
|
gemato/util.py
|
mgorny/gemato
|
b679f4b85962effa6a22fa7b944a695d020cb9a4
|
[
"BSD-2-Clause"
] | 3
|
2017-11-27T08:09:08.000Z
|
2020-07-21T09:28:02.000Z
|
# gemato: Utility functions
# vim:fileencoding=utf-8
# (c) 2017-2020 Michał Górny
# Licensed under the terms of 2-clause BSD license
class MultiprocessingPoolWrapper:
"""
A portability wrapper for multiprocessing.Pool that supports
context manager API (and any future hacks we might need).
Note: the multiprocessing behavior has been temporarily removed
due to unresolved deadlocks. It will be restored once the cause
of the issues is found and fixed or worked around.
"""
__slots__ = []
def __init__(self, processes):
pass
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, exc_cb):
pass
def map(self, func, it, chunksize=None):
return map(func, it)
def imap_unordered(self, *args, **kwargs):
"""
Use imap_unordered() if available and safe to use. Fall back
to regular map() otherwise.
"""
return self.map(*args, **kwargs)
def path_starts_with(path, prefix):
"""
Returns True if the specified @path starts with the @prefix,
performing component-wide comparison. Otherwise returns False.
"""
return prefix == "" or (path + "/").startswith(prefix.rstrip("/") + "/")
def path_inside_dir(path, directory):
"""
Returns True if the specified @path is inside @directory,
performing component-wide comparison. Otherwise returns False.
"""
return ((directory == "" and path != "")
or path.rstrip("/").startswith(directory.rstrip("/") + "/"))
def throw_exception(e):
"""
Raise the given exception. Needed for onerror= argument
to os.walk(). Useful for other callbacks.
"""
raise e
| 27.5
| 76
| 0.652199
| 211
| 1,705
| 5.146919
| 0.582938
| 0.012891
| 0.025783
| 0.029466
| 0.163904
| 0.163904
| 0.110497
| 0.110497
| 0
| 0
| 0
| 0.007734
| 0.241642
| 1,705
| 61
| 77
| 27.95082
| 0.832173
| 0.502053
| 0
| 0.105263
| 0
| 0
| 0.008264
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.421053
| false
| 0.105263
| 0
| 0.105263
| 0.789474
| 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
|
fa61a40e082bfbee8c1f11edd2d64bb299561edc
| 141
|
py
|
Python
|
my_weather_api/admin.py
|
swingthrough/weather-api-task-django
|
b7de39fef470ed5eb36c28fc7ea23f3780d0535c
|
[
"MIT"
] | null | null | null |
my_weather_api/admin.py
|
swingthrough/weather-api-task-django
|
b7de39fef470ed5eb36c28fc7ea23f3780d0535c
|
[
"MIT"
] | null | null | null |
my_weather_api/admin.py
|
swingthrough/weather-api-task-django
|
b7de39fef470ed5eb36c28fc7ea23f3780d0535c
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import WeatherForecastDay
# Register your models here.
admin.site.register(WeatherForecastDay)
| 28.2
| 39
| 0.843972
| 17
| 141
| 7
| 0.647059
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.099291
| 141
| 5
| 39
| 28.2
| 0.937008
| 0.184397
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
fa6a050604db1f7ea765ca3d1ae726c502bb8ee8
| 134
|
py
|
Python
|
athletes/app_forms/team_forms.py
|
shermanng10/superathletebuilder
|
dbaf98d5bbb5d93575985a89f244d1732b16c7bc
|
[
"MIT"
] | null | null | null |
athletes/app_forms/team_forms.py
|
shermanng10/superathletebuilder
|
dbaf98d5bbb5d93575985a89f244d1732b16c7bc
|
[
"MIT"
] | null | null | null |
athletes/app_forms/team_forms.py
|
shermanng10/superathletebuilder
|
dbaf98d5bbb5d93575985a89f244d1732b16c7bc
|
[
"MIT"
] | null | null | null |
from django import forms
from ..models import Team
class TeamForm(forms.ModelForm):
class Meta:
model = Team
fields = '__all__'
| 16.75
| 32
| 0.738806
| 18
| 134
| 5.277778
| 0.722222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.179104
| 134
| 7
| 33
| 19.142857
| 0.863636
| 0
| 0
| 0
| 0
| 0
| 0.052239
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 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
|
d72e00cbdc610ba1e9abc38ce93c01d911e18944
| 967
|
py
|
Python
|
python-algorithm/leetcode/problem_1278.py
|
isudox/nerd-algorithm
|
c1fbe153953cf3fc24395f75d102016fdf9ea0fa
|
[
"MIT"
] | 5
|
2017-06-11T09:19:34.000Z
|
2019-01-16T16:58:31.000Z
|
python-algorithm/leetcode/problem_1278.py
|
isudox/leetcode-solution
|
60085e64deaf396a171367affc94b18114565c43
|
[
"MIT"
] | 5
|
2020-03-22T13:53:54.000Z
|
2020-03-23T08:49:35.000Z
|
python-algorithm/leetcode/problem_1278.py
|
isudox/nerd-algorithm
|
c1fbe153953cf3fc24395f75d102016fdf9ea0fa
|
[
"MIT"
] | 1
|
2019-03-02T15:50:43.000Z
|
2019-03-02T15:50:43.000Z
|
"""1278. Palindrome Partitioning III
https://leetcode.com/problems/palindrome-partitioning-iii/
You are given a string s containing lowercase letters and an integer k.
You need to :
First, change some characters of s to other lowercase English letters.
Then divide s into k non-empty disjoint substrings such that each substring
is palindrome.
Return the minimal number of characters that you need to change to divide the
string.
Example 1:
Input: s = "abc", k = 2
Output: 1
Explanation: You can split the string into "ab" and "c", and change 1
character in "ab" to make it palindrome.
Example 2:
Input: s = "aabbc", k = 3
Output: 0
Explanation: You can split the string into "aa", "bb" and "c", all of them
are palindrome.
Example 3:
Input: s = "leetcode", k = 8
Output: 0
Constraints:
1 <= k <= s.length <= 100.
s only contains lowercase English letters.
"""
class Solution:
def palindrome_partition(self, s: str, k: int) -> int:
return 0
| 21.977273
| 77
| 0.720786
| 156
| 967
| 4.461538
| 0.519231
| 0.038793
| 0.071839
| 0.063218
| 0.100575
| 0.100575
| 0.100575
| 0
| 0
| 0
| 0
| 0.024266
| 0.190279
| 967
| 43
| 78
| 22.488372
| 0.864623
| 0.893485
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0.333333
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
d730e9cf0421e4352d51a2df6d17e2155dfeaecd
| 234
|
py
|
Python
|
pydotorg/tests/test_classes.py
|
buketkonuk/pythondotorg
|
4d8d9728eea7c7b2fef32eb6f24fda409cf24a06
|
[
"Apache-2.0"
] | 911
|
2015-01-03T22:16:06.000Z
|
2022-03-31T23:56:22.000Z
|
pydotorg/tests/test_classes.py
|
buketkonuk/pythondotorg
|
4d8d9728eea7c7b2fef32eb6f24fda409cf24a06
|
[
"Apache-2.0"
] | 1,342
|
2015-01-02T16:14:45.000Z
|
2022-03-28T08:01:20.000Z
|
pydotorg/tests/test_classes.py
|
buketkonuk/pythondotorg
|
4d8d9728eea7c7b2fef32eb6f24fda409cf24a06
|
[
"Apache-2.0"
] | 551
|
2015-01-04T02:17:31.000Z
|
2022-03-23T11:59:25.000Z
|
from django.template import Template, Context
from django.test import TestCase
class TemplateTestCase(TestCase):
def render_string(self, content, context):
t = Template(content)
return t.render(Context(context))
| 26
| 46
| 0.739316
| 28
| 234
| 6.142857
| 0.571429
| 0.116279
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.179487
| 234
| 8
| 47
| 29.25
| 0.895833
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0.333333
| 0
| 0.833333
| 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
|
d7316f0bac431054abf646a6368e7c4285b0aa83
| 3,715
|
py
|
Python
|
tests/src/Backend_tests/Telemetry_icons/login_tests.py
|
JalajaTR/cQube
|
6bf58ab25f0c36709630987ab730bbd5d9192c03
|
[
"MIT"
] | null | null | null |
tests/src/Backend_tests/Telemetry_icons/login_tests.py
|
JalajaTR/cQube
|
6bf58ab25f0c36709630987ab730bbd5d9192c03
|
[
"MIT"
] | 2
|
2022-02-01T00:55:12.000Z
|
2022-03-29T22:29:09.000Z
|
tests/src/Backend_tests/Telemetry_icons/login_tests.py
|
JalajaTR/cQube
|
6bf58ab25f0c36709630987ab730bbd5d9192c03
|
[
"MIT"
] | null | null | null |
import unittest
from Backlog_scripts.login_without_credentials import login_no_credentials
from Data.parameters import Data
from reuse_func import GetData
class cQube_login_page_test(unittest.TestCase):
@classmethod
def setUpClass(self):
self.data = GetData()
self.driver = self.data.get_driver()
self.data.open_cqube_appln(self.driver)
self.data.page_loading(self.driver)
def test_logintocqube(self):
self.data.page_loading(self.driver)
self.data.login_cqube(self.driver)
if 'homePage' in self.driver.current_url:
print('Login to cQube is successfull ')
self.driver.find_element_by_id(Data.logout).click()
print(self.driver.title)
self.data.page_loading(self.driver)
def test_invalidusernameandpassword(self):
self.data.page_loading(self.driver)
count = 0
self.driver.find_element_by_id('username').send_keys('abc')
self.data.page_loading(self.driver)
self.driver.find_element_by_id('password').send_keys('abc@123')
self.data.page_loading(self.driver)
self.driver.find_element_by_id(Data.login).click()
self.data.page_loading(self.driver)
error = self.driver.find_element_by_class_name("kc-feedback-text").text
print(error)
if error in self.driver.page_source:
print('login failed due to invalid credentials')
else:
print('login is succesfull for invalid credentials')
self.driver.find_element_by_id('username').clear()
self.driver.find_element_by_id('password').clear()
self.data.page_loading(self.driver)
def test_invalidusername(self):
self.data.page_loading(self.driver)
count = 0
self.driver.find_element_by_id('username').send_keys('abc')
self.data.page_loading(self.driver)
self.driver.find_element_by_id('password').send_keys('Tibil@123')
self.data.page_loading(self.driver)
self.driver.find_element_by_id(Data.login).click()
self.data.page_loading(self.driver)
error = self.driver.find_element_by_class_name("kc-feedback-text").text
if str(error) in self.driver.page_source:
print('login failed due to invalid credentials')
else:
print('login is succesfull for invalid credentials')
self.driver.find_element_by_id('username').clear()
self.driver.find_element_by_id('password').clear()
self.data.page_loading(self.driver)
def test_invalidpassword(self):
self.data.page_loading(self.driver)
count = 0
self.driver.find_element_by_id('username').send_keys('abc')
self.data.page_loading(self.driver)
self.driver.find_element_by_id('password').send_keys('abc@123')
self.data.page_loading(self.driver)
self.driver.find_element_by_id(Data.login).click()
self.data.page_loading(self.driver)
error = self.driver.find_element_by_class_name("kc-feedback-text").text
if str(error) in self.driver.page_source:
print('login failed due to invalid credentials')
else:
print('login is succesfull for invalid credentials')
self.driver.find_element_by_id('username').clear()
self.driver.find_element_by_id('password').clear()
self.data.page_loading(self.driver)
def test_login_no_credentials(self):
b = login_no_credentials(self.driver)
res = b.test_login_without_credentials()
self.assertEqual(0,res,msg='Error message is not correct')
self.data.page_loading(self.driver)
@classmethod
def tearDownClass(cls):
cls.driver.close()
| 40.380435
| 79
| 0.684791
| 496
| 3,715
| 4.899194
| 0.163306
| 0.193416
| 0.093827
| 0.14856
| 0.733333
| 0.733333
| 0.721399
| 0.694239
| 0.664609
| 0.664609
| 0
| 0.004405
| 0.205653
| 3,715
| 92
| 80
| 40.380435
| 0.819044
| 0
| 0
| 0.658228
| 0
| 0
| 0.131324
| 0
| 0
| 0
| 0
| 0
| 0.012658
| 1
| 0.088608
| false
| 0.101266
| 0.050633
| 0
| 0.151899
| 0.113924
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
d74e30965fff1814e6176d68c0145cf4d098dc97
| 144
|
py
|
Python
|
exceptions.py
|
bradbatt/ScreencapToTextBot
|
3a6e18b6b8d3737b69293db11e0363b232894356
|
[
"Apache-2.0"
] | 14
|
2018-03-04T23:42:24.000Z
|
2021-01-30T05:09:59.000Z
|
exceptions.py
|
AlexCovizzi/ScreencapToTextBot
|
8d44673671743aeaf2a4bca7eaa5cb511655d4f4
|
[
"Apache-2.0"
] | 1
|
2021-06-02T03:07:24.000Z
|
2021-06-02T03:07:24.000Z
|
exceptions.py
|
bradbatt/ScreencapToTextBot
|
3a6e18b6b8d3737b69293db11e0363b232894356
|
[
"Apache-2.0"
] | 3
|
2018-03-04T14:31:51.000Z
|
2018-04-04T13:05:05.000Z
|
# stops the current iteration in a loop
class MinorException(Exception):
pass
# stops the bot
class CriticalException(Exception):
pass
| 18
| 39
| 0.756944
| 18
| 144
| 6.055556
| 0.722222
| 0.146789
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.1875
| 144
| 8
| 40
| 18
| 0.931624
| 0.354167
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
d7673e1672f2bbe4615605e4037104c8c5ad87fe
| 137
|
py
|
Python
|
fluidlab/output.py
|
fluiddyn/fluidlab
|
77e7ae3129788089814e38eba93802026a07fcf6
|
[
"CECILL-B"
] | 4
|
2020-01-19T04:12:12.000Z
|
2021-11-09T08:30:25.000Z
|
fluidlab/output.py
|
fluiddyn/fluidlab
|
77e7ae3129788089814e38eba93802026a07fcf6
|
[
"CECILL-B"
] | null | null | null |
fluidlab/output.py
|
fluiddyn/fluidlab
|
77e7ae3129788089814e38eba93802026a07fcf6
|
[
"CECILL-B"
] | null | null | null |
"""Output utilities
===================
Tiny module to hide fluiddyn for users of fluidlab.
"""
from fluiddyn.output.figs import show
| 15.222222
| 51
| 0.649635
| 17
| 137
| 5.235294
| 0.882353
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.145985
| 137
| 8
| 52
| 17.125
| 0.760684
| 0.649635
| 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
|
d76fc490a7eb496ae2e938f8735094a892976d71
| 132
|
py
|
Python
|
tests/__init__.py
|
GluuFederation/redislite
|
2b8c50b2175883545b90779b46e8006dfcd4d86b
|
[
"BSD-3-Clause"
] | 572
|
2015-03-06T18:21:21.000Z
|
2022-03-31T07:06:35.000Z
|
tests/__init__.py
|
GluuFederation/redislite
|
2b8c50b2175883545b90779b46e8006dfcd4d86b
|
[
"BSD-3-Clause"
] | 141
|
2015-03-03T21:24:10.000Z
|
2022-03-30T15:25:06.000Z
|
tests/__init__.py
|
GluuFederation/redislite
|
2b8c50b2175883545b90779b46e8006dfcd4d86b
|
[
"BSD-3-Clause"
] | 70
|
2015-03-03T20:52:06.000Z
|
2022-02-23T22:07:06.000Z
|
# Copyright (c) 2015, Yahoo Inc.
# Copyrights licensed under the New BSD License
# See the accompanying LICENSE.txt file for terms.
| 33
| 50
| 0.765152
| 20
| 132
| 5.05
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.036364
| 0.166667
| 132
| 3
| 51
| 44
| 0.881818
| 0.94697
| 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
|
ad03462f70973175ed35718a7007ecb849115382
| 19
|
py
|
Python
|
intrepyd/components/__init__.py
|
bobosoft/intrepyd
|
13f0912b31f86f9bcc50f52ef4ad870e33f0cf65
|
[
"BSD-3-Clause"
] | 2
|
2021-04-25T17:38:03.000Z
|
2022-03-20T20:48:50.000Z
|
intrepyd/components/__init__.py
|
bobosoft/intrepyd
|
13f0912b31f86f9bcc50f52ef4ad870e33f0cf65
|
[
"BSD-3-Clause"
] | 1
|
2016-11-30T22:25:00.000Z
|
2017-01-16T22:43:39.000Z
|
intrepyd/components/__init__.py
|
bobosoft/intrepyd
|
13f0912b31f86f9bcc50f52ef4ad870e33f0cf65
|
[
"BSD-3-Clause"
] | null | null | null |
"""
Components
"""
| 4.75
| 10
| 0.526316
| 1
| 19
| 10
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.157895
| 19
| 3
| 11
| 6.333333
| 0.625
| 0.526316
| 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
|
ad38f699c9870744db8d02e8dab3b5be12a18633
| 90
|
py
|
Python
|
my_classes/ModulesPackages_PackageNamespaces/.history/import_varients_20210805220716.py
|
minefarmer/deep-Dive-1
|
b0675b853180c5b5781888266ea63a3793b8d855
|
[
"Unlicense"
] | null | null | null |
my_classes/ModulesPackages_PackageNamespaces/.history/import_varients_20210805220716.py
|
minefarmer/deep-Dive-1
|
b0675b853180c5b5781888266ea63a3793b8d855
|
[
"Unlicense"
] | null | null | null |
my_classes/ModulesPackages_PackageNamespaces/.history/import_varients_20210805220716.py
|
minefarmer/deep-Dive-1
|
b0675b853180c5b5781888266ea63a3793b8d855
|
[
"Unlicense"
] | null | null | null |
"""Import Variants and some misconceptions
# module1.py
import math
is marth in sys.
"""
| 12.857143
| 42
| 0.733333
| 13
| 90
| 5.076923
| 0.923077
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.013333
| 0.166667
| 90
| 7
| 43
| 12.857143
| 0.866667
| 0.911111
| 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
|
ad3ff1016aebb7447be8769e29587e81f18c8e06
| 1,067
|
py
|
Python
|
graphite_feeder/handler/event/enum/appliance/__init__.py
|
majamassarini/automate-graphite-feeder
|
0f17f99bbdaab86e10e0b7d424d055ff44fc4ca0
|
[
"MIT"
] | null | null | null |
graphite_feeder/handler/event/enum/appliance/__init__.py
|
majamassarini/automate-graphite-feeder
|
0f17f99bbdaab86e10e0b7d424d055ff44fc4ca0
|
[
"MIT"
] | null | null | null |
graphite_feeder/handler/event/enum/appliance/__init__.py
|
majamassarini/automate-graphite-feeder
|
0f17f99bbdaab86e10e0b7d424d055ff44fc4ca0
|
[
"MIT"
] | null | null | null |
import home
from graphite_feeder.handler.event.enum import Handler as Parent
class Handler(Parent):
TITLE = "Force"
KLASS = home.event.Enum
COLOR_LIST = "404040,666666,808080,999999,B3B3B3"
def _get_url(self, name):
url = 'target=alias(offset(keepLastValue({name}.{metric}), -1),"Not")&'.format(
name=name, metric=self.metric
)
url += 'target=alias(offset(keepLastValue({name}.{metric}), 0),"Off")&'.format(
name=name, metric=self.metric
)
url += 'target=alias(offset(keepLastValue({name}.{metric}), 1),"On")&'.format(
name=name, metric=self.metric
)
return url
from graphite_feeder.handler.event.enum.appliance import light
from graphite_feeder.handler.event.enum.appliance import curtain
from graphite_feeder.handler.event.enum.appliance import socket
from graphite_feeder.handler.event.enum.appliance import sound
from graphite_feeder.handler.event.enum.appliance import thermostat
from graphite_feeder.handler.event.enum.appliance import sprinkler
| 34.419355
| 87
| 0.70478
| 134
| 1,067
| 5.537313
| 0.335821
| 0.097035
| 0.169811
| 0.235849
| 0.739892
| 0.739892
| 0.653639
| 0.653639
| 0.196766
| 0.196766
| 0
| 0.033975
| 0.172446
| 1,067
| 30
| 88
| 35.566667
| 0.806342
| 0
| 0
| 0.130435
| 0
| 0
| 0.210872
| 0.175258
| 0
| 0
| 0
| 0
| 0
| 1
| 0.043478
| false
| 0
| 0.347826
| 0
| 0.608696
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
ad57b288e2dff68595feb97df78ecabb030769bf
| 1,081
|
py
|
Python
|
pyaction/__init__.py
|
a-maliarov/pyaction
|
2de500df5087a9d2225c898537c1673ef5835869
|
[
"MIT"
] | 9
|
2020-10-12T05:20:55.000Z
|
2020-10-18T07:30:26.000Z
|
pyaction/__init__.py
|
a-maliarov/pyaction
|
2de500df5087a9d2225c898537c1673ef5835869
|
[
"MIT"
] | 2
|
2021-04-29T22:15:46.000Z
|
2021-12-07T11:06:57.000Z
|
pyaction/__init__.py
|
a-maliarov/pyaction
|
2de500df5087a9d2225c898537c1673ef5835869
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
"""
pyaction
~~~~~~~~
PyAction is a module dedicated to eliminate rewriting the same code from
project to project by providing a set of tools according to specific python
fields.
Library hierarchy (this must be set and be followed in any case):
pyaction/
field_name/
__init__.py
objects.py
utils.py
Rules:
1. An __init__ file within a field folder should provide a short description
of the field and contain imports of the main objects within this field to be
operated by the end user.
2. The file called "objects.py" should contain all the main objects of the
field to be used by the end user.
3. The file called "utils.py" should contain all the utilities to be used by
the "objects.py" and not the end user.
4. The file called "exceptions.py" should contain all the exceptions to be
used by both developers and the end users.
"""
from .general import *
from .multiprocessing_ import *
from .datetime_ import *
from .beautifulsoup_ import *
#-----------------------------------------------------------------------------
| 29.216216
| 78
| 0.686401
| 163
| 1,081
| 4.478528
| 0.453988
| 0.021918
| 0.041096
| 0.073973
| 0.121918
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005675
| 0.185014
| 1,081
| 36
| 79
| 30.027778
| 0.822928
| 0.883441
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
a8f0b52f2ad1221a9accd4a1a8bbf3c08582c9dd
| 144
|
py
|
Python
|
vpnmon.py
|
clambin/vpnmon
|
4bd180da0b85806200b078649b04e674c0fa9c51
|
[
"MIT"
] | null | null | null |
vpnmon.py
|
clambin/vpnmon
|
4bd180da0b85806200b078649b04e674c0fa9c51
|
[
"MIT"
] | null | null | null |
vpnmon.py
|
clambin/vpnmon
|
4bd180da0b85806200b078649b04e674c0fa9c51
|
[
"MIT"
] | null | null | null |
from vpnmon.vpnmon import vpnmon
from vpnmon.configuration import get_configuration
if __name__ == '__main__':
vpnmon(get_configuration())
| 24
| 50
| 0.798611
| 17
| 144
| 6.176471
| 0.470588
| 0.190476
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 144
| 5
| 51
| 28.8
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0.055556
| 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
|
d143f2a31f097a77602e147c61a50544bd97b0f3
| 10,399
|
py
|
Python
|
stonesoup/updater/tests/test_kalman.py
|
Red-Portal/Stone-Soup-1
|
267621c86161a839da9b144c2745d28d9166d903
|
[
"MIT"
] | 157
|
2019-04-14T20:43:11.000Z
|
2022-03-30T08:30:33.000Z
|
stonesoup/updater/tests/test_kalman.py
|
Red-Portal/Stone-Soup-1
|
267621c86161a839da9b144c2745d28d9166d903
|
[
"MIT"
] | 364
|
2019-04-18T15:54:49.000Z
|
2022-03-31T09:50:02.000Z
|
stonesoup/updater/tests/test_kalman.py
|
Red-Portal/Stone-Soup-1
|
267621c86161a839da9b144c2745d28d9166d903
|
[
"MIT"
] | 86
|
2019-04-20T02:01:18.000Z
|
2022-03-28T01:03:11.000Z
|
# -*- coding: utf-8 -*-
"""Test for updater.kalman module"""
import pytest
import numpy as np
from stonesoup.models.measurement.linear import LinearGaussian
from stonesoup.types.detection import Detection
from stonesoup.types.hypothesis import SingleHypothesis
from stonesoup.types.prediction import (
GaussianStatePrediction, GaussianMeasurementPrediction)
from stonesoup.types.state import GaussianState, SqrtGaussianState
from stonesoup.updater.kalman import (KalmanUpdater,
ExtendedKalmanUpdater,
UnscentedKalmanUpdater,
SqrtKalmanUpdater,
IteratedKalmanUpdater)
@pytest.mark.parametrize(
"UpdaterClass, measurement_model, prediction, measurement",
[
( # Standard Kalman
KalmanUpdater,
LinearGaussian(ndim_state=2, mapping=[0],
noise_covar=np.array([[0.04]])),
GaussianStatePrediction(np.array([[-6.45], [0.7]]),
np.array([[4.1123, 0.0013],
[0.0013, 0.0365]])),
Detection(np.array([[-6.23]]))
),
( # Extended Kalman
ExtendedKalmanUpdater,
LinearGaussian(ndim_state=2, mapping=[0],
noise_covar=np.array([[0.04]])),
GaussianStatePrediction(np.array([[-6.45], [0.7]]),
np.array([[4.1123, 0.0013],
[0.0013, 0.0365]])),
Detection(np.array([[-6.23]]))
),
( # Unscented Kalman
UnscentedKalmanUpdater,
LinearGaussian(ndim_state=2, mapping=[0],
noise_covar=np.array([[0.04]])),
GaussianStatePrediction(np.array([[-6.45], [0.7]]),
np.array([[4.1123, 0.0013],
[0.0013, 0.0365]])),
Detection(np.array([[-6.23]]))
),
( # Iterated Kalman
IteratedKalmanUpdater,
LinearGaussian(ndim_state=2, mapping=[0],
noise_covar=np.array([[0.04]])),
GaussianStatePrediction(np.array([[-6.45], [0.7]]),
np.array([[4.1123, 0.0013],
[0.0013, 0.0365]])),
Detection(np.array([[-6.23]]))
),
],
ids=["standard", "extended", "unscented", "iterated"]
)
def test_kalman(UpdaterClass, measurement_model, prediction, measurement):
# Calculate evaluation variables
eval_measurement_prediction = GaussianMeasurementPrediction(
measurement_model.matrix() @ prediction.mean,
measurement_model.matrix() @ prediction.covar
@ measurement_model.matrix().T
+ measurement_model.covar(),
cross_covar=prediction.covar @ measurement_model.matrix().T)
kalman_gain = eval_measurement_prediction.cross_covar @ np.linalg.inv(
eval_measurement_prediction.covar)
eval_posterior = GaussianState(
prediction.mean
+ kalman_gain @ (measurement.state_vector
- eval_measurement_prediction.mean),
prediction.covar
- kalman_gain@eval_measurement_prediction.covar @ kalman_gain.T)
# Initialise a kalman updater
updater = UpdaterClass(measurement_model=measurement_model)
# Get and assert measurement prediction
measurement_prediction = updater.predict_measurement(prediction)
assert(np.allclose(measurement_prediction.mean,
eval_measurement_prediction.mean,
0, atol=1.e-14))
assert(np.allclose(measurement_prediction.covar,
eval_measurement_prediction.covar,
0, atol=1.e-14))
assert(np.allclose(measurement_prediction.cross_covar,
eval_measurement_prediction.cross_covar,
0, atol=1.e-14))
# Perform and assert state update (without measurement prediction)
posterior = updater.update(SingleHypothesis(
prediction=prediction,
measurement=measurement))
assert(np.allclose(posterior.mean, eval_posterior.mean, 0, atol=1.e-14))
assert(np.allclose(posterior.covar, eval_posterior.covar, 0, atol=1.e-14))
assert(np.array_equal(posterior.hypothesis.prediction, prediction))
assert (np.allclose(
posterior.hypothesis.measurement_prediction.state_vector,
measurement_prediction.state_vector, 0, atol=1.e-14))
assert (np.allclose(posterior.hypothesis.measurement_prediction.covar,
measurement_prediction.covar, 0, atol=1.e-14))
assert(np.array_equal(posterior.hypothesis.measurement, measurement))
assert(posterior.timestamp == prediction.timestamp)
# Perform and assert state update
posterior = updater.update(SingleHypothesis(
prediction=prediction,
measurement=measurement,
measurement_prediction=measurement_prediction))
assert(np.allclose(posterior.mean, eval_posterior.mean, 0, atol=1.e-14))
assert(np.allclose(posterior.covar, eval_posterior.covar, 0, atol=1.e-14))
assert(np.array_equal(posterior.hypothesis.prediction, prediction))
assert (np.allclose(
posterior.hypothesis.measurement_prediction.state_vector,
measurement_prediction.state_vector, 0, atol=1.e-14))
assert (np.allclose(posterior.hypothesis.measurement_prediction.covar,
measurement_prediction.covar, 0, atol=1.e-14))
assert(np.array_equal(posterior.hypothesis.measurement, measurement))
assert(posterior.timestamp == prediction.timestamp)
def test_sqrt_kalman():
measurement_model = LinearGaussian(ndim_state=2, mapping=[0],
noise_covar=np.array([[0.04]]))
prediction = GaussianStatePrediction(np.array([[-6.45], [0.7]]),
np.array([[4.1123, 0.0013],
[0.0013, 0.0365]]))
sqrt_prediction = SqrtGaussianState(prediction.state_vector,
np.linalg.cholesky(prediction.covar))
measurement = Detection(np.array([[-6.23]]))
# Calculate evaluation variables
eval_measurement_prediction = GaussianMeasurementPrediction(
measurement_model.matrix() @ prediction.mean,
measurement_model.matrix() @ prediction.covar
@ measurement_model.matrix().T
+ measurement_model.covar(),
cross_covar=prediction.covar @ measurement_model.matrix().T)
kalman_gain = eval_measurement_prediction.cross_covar @ np.linalg.inv(
eval_measurement_prediction.covar)
eval_posterior = GaussianState(
prediction.mean
+ kalman_gain @ (measurement.state_vector
- eval_measurement_prediction.mean),
prediction.covar
- kalman_gain @ eval_measurement_prediction.covar @ kalman_gain.T)
# Test Square root form returns the same as standard form
updater = KalmanUpdater(measurement_model=measurement_model)
sqrt_updater = SqrtKalmanUpdater(measurement_model=measurement_model, qr_method=False)
qr_updater = SqrtKalmanUpdater(measurement_model=measurement_model, qr_method=True)
posterior = updater.update(SingleHypothesis(prediction=prediction,
measurement=measurement))
posterior_s = sqrt_updater.update(SingleHypothesis(prediction=sqrt_prediction,
measurement=measurement))
posterior_q = qr_updater.update(SingleHypothesis(prediction=sqrt_prediction,
measurement=measurement))
assert np.allclose(posterior_s.mean, eval_posterior.mean, 0, atol=1.e-14)
assert np.allclose(posterior_q.mean, eval_posterior.mean, 0, atol=1.e-14)
assert np.allclose(posterior.covar, eval_posterior.covar, 0, atol=1.e-14)
assert np.allclose(eval_posterior.covar,
posterior_s.sqrt_covar@posterior_s.sqrt_covar.T, 0,
atol=1.e-14)
assert np.allclose(posterior.covar,
posterior_s.sqrt_covar@posterior_s.sqrt_covar.T, 0,
atol=1.e-14)
assert np.allclose(posterior.covar,
posterior_q.sqrt_covar@posterior_q.sqrt_covar.T, 0,
atol=1.e-14)
# I'm not sure this is going to be true in all cases. Keep in order to find edge cases
assert np.allclose(posterior_s.covar, posterior_q.covar, 0, atol=1.e-14)
# Next create a prediction with a covariance that will cause problems
prediction = GaussianStatePrediction(np.array([[-6.45], [0.7]]),
np.array([[1e24, 1e-24],
[1e-24, 1e24]]))
sqrt_prediction = SqrtGaussianState(prediction.state_vector,
np.linalg.cholesky(prediction.covar))
posterior = updater.update(SingleHypothesis(prediction=prediction,
measurement=measurement))
posterior_s = sqrt_updater.update(SingleHypothesis(
prediction=sqrt_prediction, measurement=measurement))
posterior_q = qr_updater.update(SingleHypothesis(prediction=sqrt_prediction,
measurement=measurement))
# The new posterior will be
eval_posterior = GaussianState(
prediction.mean
+ kalman_gain @ (measurement.state_vector
- eval_measurement_prediction.mean),
np.array([[0.04, 0],
[0, 1e24]])) # Accessed by looking through the Decimal() quantities...
# It's actually [0.039999999999 1e-48], [1e-24 1e24 + 1e-48]] ish
# Test that the square root form succeeds where the standard form fails
assert not np.allclose(posterior.covar, eval_posterior.covar, rtol=5.e-3)
assert np.allclose(posterior_s.sqrt_covar@posterior_s.sqrt_covar.T,
eval_posterior.covar, rtol=5.e-3)
assert np.allclose(posterior_q.sqrt_covar@posterior_s.sqrt_covar.T,
eval_posterior.covar, rtol=5.e-3)
| 49.995192
| 90
| 0.613905
| 1,060
| 10,399
| 5.870755
| 0.139623
| 0.104612
| 0.051422
| 0.020247
| 0.770207
| 0.717339
| 0.712839
| 0.704965
| 0.655632
| 0.653543
| 0
| 0.039569
| 0.285508
| 10,399
| 207
| 91
| 50.236715
| 0.797981
| 0.073949
| 0
| 0.668571
| 0
| 0
| 0.009264
| 0
| 0
| 0
| 0
| 0
| 0.154286
| 1
| 0.011429
| false
| 0
| 0.045714
| 0
| 0.057143
| 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
|
d1525fc76d51e48fb734f0de0f9de6882157f2c0
| 882
|
py
|
Python
|
JetMETCorrections/MCJet/python/RelValQCD_cfi.py
|
ckamtsikis/cmssw
|
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
|
[
"Apache-2.0"
] | 852
|
2015-01-11T21:03:51.000Z
|
2022-03-25T21:14:00.000Z
|
JetMETCorrections/MCJet/python/RelValQCD_cfi.py
|
ckamtsikis/cmssw
|
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
|
[
"Apache-2.0"
] | 30,371
|
2015-01-02T00:14:40.000Z
|
2022-03-31T23:26:05.000Z
|
JetMETCorrections/MCJet/python/RelValQCD_cfi.py
|
ckamtsikis/cmssw
|
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
|
[
"Apache-2.0"
] | 3,240
|
2015-01-02T05:53:18.000Z
|
2022-03-31T17:24:21.000Z
|
import FWCore.ParameterSet.Config as cms
readFiles = cms.untracked.vstring()
source = cms.Source ("PoolSource",fileNames = readFiles)
readFiles.extend( (
" /store/relval/CMSSW_3_4_0_pre2/RelValQCD_FlatPt_15_3000/GEN-SIM-RECO/MC_3XY_V10-v1/0003/D085615A-A5BD-DE11-8897-0026189437E8.root",
"/store/relval/CMSSW_3_4_0_pre2/RelValQCD_FlatPt_15_3000/GEN-SIM-RECO/MC_3XY_V10-v1/0003/9A67BC35-AFBD-DE11-9FE5-001731AF67B5.root",
"/store/relval/CMSSW_3_4_0_pre2/RelValQCD_FlatPt_15_3000/GEN-SIM-RECO/MC_3XY_V10-v1/0003/5C70929C-C0BD-DE11-B1C6-002618943829.root",
"/store/relval/CMSSW_3_4_0_pre2/RelValQCD_FlatPt_15_3000/GEN-SIM-RECO/MC_3XY_V10-v1/0003/54E06430-B1BD-DE11-BC8C-003048679168.root",
"/store/relval/CMSSW_3_4_0_pre2/RelValQCD_FlatPt_15_3000/GEN-SIM-RECO/MC_3XY_V10-v1/0003/32097BFD-A3BD-DE11-894F-001A92810ADE.root"
)
)
| 67.846154
| 143
| 0.777778
| 143
| 882
| 4.482517
| 0.377622
| 0.085803
| 0.124805
| 0.132605
| 0.555382
| 0.555382
| 0.555382
| 0.555382
| 0.555382
| 0.555382
| 0
| 0.24625
| 0.092971
| 882
| 12
| 144
| 73.5
| 0.555
| 0
| 0
| 0
| 0
| 0.454545
| 0.743764
| 0.731293
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.090909
| 0
| 0.090909
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
0f018bf28755ac434f023c15d6838737ae80e945
| 2,426
|
py
|
Python
|
tools/src/test/python/dlpx/virtualization/_internal/fake_plugin/direct/upgrade_warnings.py
|
SumoSourabh/virtualization-sdk
|
d1c06e7aeb8adf48243599871423922d642d2c10
|
[
"Apache-2.0"
] | 10
|
2020-01-08T22:34:20.000Z
|
2022-02-24T17:19:54.000Z
|
tools/src/test/python/dlpx/virtualization/_internal/fake_plugin/direct/upgrade_warnings.py
|
SumoSourabh/virtualization-sdk
|
d1c06e7aeb8adf48243599871423922d642d2c10
|
[
"Apache-2.0"
] | 298
|
2019-12-18T00:20:13.000Z
|
2022-03-30T04:36:57.000Z
|
tools/src/test/python/dlpx/virtualization/_internal/fake_plugin/direct/upgrade_warnings.py
|
SumoSourabh/virtualization-sdk
|
d1c06e7aeb8adf48243599871423922d642d2c10
|
[
"Apache-2.0"
] | 30
|
2019-12-13T19:53:38.000Z
|
2022-03-05T14:54:54.000Z
|
#
# Copyright (c) 2019 by Delphix. All rights reserved.
#
# flake8: noqa
from dlpx.virtualization.platform import Plugin, Status
direct = Plugin()
@direct.discovery.repository()
def repository_discovery(source_connection):
return []
@direct.discovery.source_config()
def source_config_discovery(source_connection, repository):
return []
@direct.linked.pre_snapshot()
def direct_pre_snapshot(direct_source, repository, source_config,
optional_snapshot_parameters):
return
@direct.linked.post_snapshot()
def direct_post_snapshot(direct_source, repository, source_config,
optional_snapshot_parameters):
return None
@direct.virtual.configure()
def configure(virtual_source, repository, snapshot):
return None
@direct.virtual.mount_specification()
def mount_specification(repository, virtual_source):
return None
@direct.virtual.post_snapshot()
def postSnapshot(repository, source_config, virtual_source):
return None
@direct.virtual.pre_snapshot()
def preSnapshot(repository, source_config, virtual_source):
pass
@direct.virtual.reconfigure()
def reconfigure(virtual_source, repository, source_config, snapshot):
pass
@direct.virtual.start()
def start(repository, source_config, virtual_source):
pass
@direct.virtual.status()
def status(repository, source_config, virtual_source):
return Status.ACTIVE
@direct.virtual.stop()
def stop(repository, source_config, virtual_source):
pass
@direct.virtual.unconfigure()
def unconfigure(repository, source_config, virtual_source):
pass
@direct.virtual.cleanup()
def cleanup(repository, source_config, virtual_source):
pass
@direct.upgrade.repository('2019.11.20')
def repo_upgrade(old_repository):
return old_repository
@direct.upgrade.source_config('2019.11.22')
def sc_upgrade(old_source_config):
return old_source_config
# Added second arg to check if length arg check fails.
@direct.upgrade.linked_source('2019.11.24')
def ls_upgrade(old_linked, old_source):
return old_linked
# Renamed old_virtual_source to old_linked_source to test named arg checks.
@direct.upgrade.virtual_source('2019.11.26')
def ls_upgrade(old_linked_source):
return old_linked_source
# Renamed old_snapshot to bad_input_name to test named arg checks.
@direct.upgrade.snapshot('2019.11.30')
def snap_upgrade(bad_input_name):
return bad_input_name
| 22.462963
| 75
| 0.76958
| 308
| 2,426
| 5.821429
| 0.233766
| 0.10039
| 0.122699
| 0.113218
| 0.359175
| 0.33575
| 0.260457
| 0.19855
| 0.082543
| 0.082543
| 0
| 0.0215
| 0.137263
| 2,426
| 107
| 76
| 22.672897
| 0.835165
| 0.105524
| 0
| 0.229508
| 0
| 0
| 0.023127
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.311475
| false
| 0.098361
| 0.016393
| 0.213115
| 0.540984
| 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
|
0f27e8aaaa2ea8b376a49e412e5a43ab936cd847
| 208
|
py
|
Python
|
fillup.py
|
sharkwheels/sendCatsWeb
|
979556b7804eaaadff2b22f57986241c18550aa2
|
[
"MIT"
] | null | null | null |
fillup.py
|
sharkwheels/sendCatsWeb
|
979556b7804eaaadff2b22f57986241c18550aa2
|
[
"MIT"
] | null | null | null |
fillup.py
|
sharkwheels/sendCatsWeb
|
979556b7804eaaadff2b22f57986241c18550aa2
|
[
"MIT"
] | null | null | null |
### lets see if this works first ##############
from app import writeCountToDatabase
from app import sendCatsToDatabase
writeCountToDatabase(0)
print "reset counter"
sendCatsToDatabase()
print "pulled cats"
| 23.111111
| 47
| 0.759615
| 23
| 208
| 6.869565
| 0.73913
| 0.088608
| 0.164557
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005464
| 0.120192
| 208
| 9
| 48
| 23.111111
| 0.857924
| 0.134615
| 0
| 0
| 0
| 0
| 0.148148
| 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
|
0f2a58b14b5f4294fe6b9e378d26e42dd48b21a8
| 245
|
py
|
Python
|
src/databricksbundle/storage/StorageConfiguratorInterface.py
|
matejoravec/databricks-bundle
|
bd14ddf96356df234c1be9334f89d4fe86704a89
|
[
"MIT"
] | 2
|
2021-03-31T11:22:42.000Z
|
2022-01-02T13:23:48.000Z
|
src/databricksbundle/storage/StorageConfiguratorInterface.py
|
matejoravec/databricks-bundle
|
bd14ddf96356df234c1be9334f89d4fe86704a89
|
[
"MIT"
] | 2
|
2021-05-12T08:24:57.000Z
|
2021-12-14T06:54:36.000Z
|
src/databricksbundle/storage/StorageConfiguratorInterface.py
|
matejoravec/databricks-bundle
|
bd14ddf96356df234c1be9334f89d4fe86704a89
|
[
"MIT"
] | 2
|
2021-08-24T13:55:32.000Z
|
2022-03-22T07:07:47.000Z
|
from abc import ABC
from box import Box
from pyspark.sql.session import SparkSession
class StorageConfiguratorInterface(ABC):
def configure(self, spark: SparkSession, config: Box):
pass
def get_type(self) -> str:
pass
| 20.416667
| 58
| 0.714286
| 31
| 245
| 5.612903
| 0.612903
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.216327
| 245
| 11
| 59
| 22.272727
| 0.90625
| 0
| 0
| 0.25
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0.25
| 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
|
0f2c5ab9f628180dcb08a5b31823622cf46b454b
| 108
|
py
|
Python
|
pybryt/__main__.py
|
tonybaloney/pybryt
|
3ba34e71b5de8ad47b3718c491d0600f02d0b178
|
[
"MIT"
] | null | null | null |
pybryt/__main__.py
|
tonybaloney/pybryt
|
3ba34e71b5de8ad47b3718c491d0600f02d0b178
|
[
"MIT"
] | null | null | null |
pybryt/__main__.py
|
tonybaloney/pybryt
|
3ba34e71b5de8ad47b3718c491d0600f02d0b178
|
[
"MIT"
] | null | null | null |
"""Command-line interface for PyBryt"""
from .cli import main as cli
if __name__ == "__main__":
cli()
| 15.428571
| 39
| 0.666667
| 15
| 108
| 4.266667
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.194444
| 108
| 6
| 40
| 18
| 0.735632
| 0.305556
| 0
| 0
| 0
| 0
| 0.115942
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
0f56b12fa097dcc14576520df8e24f9f56dc1ca4
| 221
|
py
|
Python
|
contacts/admin.py
|
CzechInvest/ciis
|
c6102598f564a717472e5e31e7eb894bba2c8104
|
[
"MIT"
] | 1
|
2019-05-26T22:24:01.000Z
|
2019-05-26T22:24:01.000Z
|
contacts/admin.py
|
CzechInvest/ciis
|
c6102598f564a717472e5e31e7eb894bba2c8104
|
[
"MIT"
] | 6
|
2019-01-22T14:53:43.000Z
|
2020-09-22T16:20:28.000Z
|
contacts/admin.py
|
CzechInvest/ciis
|
c6102598f564a717472e5e31e7eb894bba2c8104
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import ContactPerson
from .models import Organisation
# Register your models here.
#admin.site.register(ContactPerson)
#admin.site.register(Organisation, OrganisationAdmin)
| 24.555556
| 53
| 0.828054
| 26
| 221
| 7.038462
| 0.5
| 0.10929
| 0.174863
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.099548
| 221
| 8
| 54
| 27.625
| 0.919598
| 0.506787
| 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
|
0f605fd4de5375d6c95ca0bc46a5758c7aab78fd
| 239
|
py
|
Python
|
Model/Type.py
|
kingcos/collins-crawler
|
bc8b31775b7538514190348851395e1e33ca8033
|
[
"MIT"
] | 1
|
2021-12-23T06:28:06.000Z
|
2021-12-23T06:28:06.000Z
|
Model/Type.py
|
kingcos/collins-crawler
|
bc8b31775b7538514190348851395e1e33ca8033
|
[
"MIT"
] | null | null | null |
Model/Type.py
|
kingcos/collins-crawler
|
bc8b31775b7538514190348851395e1e33ca8033
|
[
"MIT"
] | null | null | null |
# -*- coding:utf-8 -*-
class Type:
id = ''
word_id = ''
name = ''
meanings = []
def desc(self):
name = self.name if self.name is not None else ''
return '(\'' + self.word_id + '\', \'' + name + '\')'
| 18.384615
| 61
| 0.447699
| 28
| 239
| 3.75
| 0.642857
| 0.228571
| 0.190476
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006289
| 0.334728
| 239
| 12
| 62
| 19.916667
| 0.654088
| 0.083682
| 0
| 0
| 0
| 0
| 0.156682
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.125
| false
| 0
| 0
| 0
| 0.875
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
7e2cffb9ab4d3784aaab5ed65408528f91247407
| 232
|
py
|
Python
|
desafiosCursoEmVideo/ex018.py
|
gomesGabriel/Pythonicos
|
b491cefbb0479dd83fee267304d0fa30b99786a5
|
[
"MIT"
] | 1
|
2019-09-02T12:14:58.000Z
|
2019-09-02T12:14:58.000Z
|
desafiosCursoEmVideo/ex018.py
|
gomesGabriel/Pythonicos
|
b491cefbb0479dd83fee267304d0fa30b99786a5
|
[
"MIT"
] | null | null | null |
desafiosCursoEmVideo/ex018.py
|
gomesGabriel/Pythonicos
|
b491cefbb0479dd83fee267304d0fa30b99786a5
|
[
"MIT"
] | null | null | null |
import math
n1 = float(input('Digite um valor: '))
print('O seno: {:.5f}' .format(math.sin(math.radians(n1))))
print('O cosseno: {:.5f}' .format(math.cos(math.radians(n1))))
print('O tg: {:.5f}' .format(math.tan(math.radians(n1))))
| 38.666667
| 62
| 0.646552
| 38
| 232
| 3.947368
| 0.5
| 0.12
| 0.24
| 0.24
| 0.253333
| 0
| 0
| 0
| 0
| 0
| 0
| 0.033019
| 0.086207
| 232
| 5
| 63
| 46.4
| 0.674528
| 0
| 0
| 0
| 0
| 0
| 0.258621
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.2
| 0
| 0.2
| 0.6
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
7e4b9a5212d75de098ecb47a8fd0fb5deabf62b3
| 58
|
py
|
Python
|
tests/__init__.py
|
bookshelfdave/ksv.py
|
bb58e7f4b59c115246178156793d76f0b96f5594
|
[
"Apache-2.0"
] | 2
|
2018-11-08T20:19:36.000Z
|
2020-02-15T06:16:51.000Z
|
tests/__init__.py
|
bookshelfdave/ksv.py
|
bb58e7f4b59c115246178156793d76f0b96f5594
|
[
"Apache-2.0"
] | 1
|
2020-05-20T13:06:15.000Z
|
2020-05-20T14:09:06.000Z
|
tests/__init__.py
|
bookshelfdave/ksv.py
|
bb58e7f4b59c115246178156793d76f0b96f5594
|
[
"Apache-2.0"
] | 1
|
2020-05-19T16:54:58.000Z
|
2020-05-19T16:54:58.000Z
|
# -*- coding: utf-8 -*-
"""Unit test package for ksv."""
| 14.5
| 32
| 0.534483
| 8
| 58
| 3.875
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.021277
| 0.189655
| 58
| 3
| 33
| 19.333333
| 0.638298
| 0.844828
| 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
|
7e57a5473228cde1714c9e39f0a1aaf150d2460b
| 159
|
py
|
Python
|
mmtrack/models/track_heads/__init__.py
|
dzambrano/mmtracking
|
ec7a2e36fbf99effed4602a4df929f495efe73c5
|
[
"Apache-2.0"
] | 2
|
2021-06-25T21:50:05.000Z
|
2021-12-30T14:45:09.000Z
|
mmtrack/models/track_heads/__init__.py
|
RangiLyu/mmtracking
|
a4824091a0b24eb0add16a9233fec3be73ad6e32
|
[
"Apache-2.0"
] | null | null | null |
mmtrack/models/track_heads/__init__.py
|
RangiLyu/mmtracking
|
a4824091a0b24eb0add16a9233fec3be73ad6e32
|
[
"Apache-2.0"
] | null | null | null |
# Copyright (c) OpenMMLab. All rights reserved.
from .siamese_rpn_head import CorrelationHead, SiameseRPNHead
__all__ = ['CorrelationHead', 'SiameseRPNHead']
| 31.8
| 61
| 0.798742
| 16
| 159
| 7.5625
| 0.8125
| 0.479339
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.106918
| 159
| 4
| 62
| 39.75
| 0.852113
| 0.283019
| 0
| 0
| 0
| 0
| 0.258929
| 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
|
7e8b34b0fac6f2be02d4cdb803c18d77eef9ec73
| 51
|
py
|
Python
|
thumb_gen/version.py
|
truethari/thumb-gen
|
8d754832ba348ecc5b77bdf83a8df30c0f6464d2
|
[
"MIT"
] | 13
|
2021-03-22T17:58:37.000Z
|
2022-02-21T05:54:42.000Z
|
thumb_gen/version.py
|
truethari/thumb-gen
|
8d754832ba348ecc5b77bdf83a8df30c0f6464d2
|
[
"MIT"
] | 1
|
2021-11-30T12:00:41.000Z
|
2021-12-05T01:33:58.000Z
|
thumb_gen/version.py
|
truethari/thumb-gen
|
8d754832ba348ecc5b77bdf83a8df30c0f6464d2
|
[
"MIT"
] | 2
|
2021-03-26T04:35:20.000Z
|
2021-10-05T17:57:10.000Z
|
__version__ = "4.0.1"
config_version = "2021.04.03"
| 25.5
| 29
| 0.705882
| 9
| 51
| 3.444444
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.23913
| 0.098039
| 51
| 2
| 29
| 25.5
| 0.434783
| 0
| 0
| 0
| 0
| 0
| 0.288462
| 0
| 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
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
7e9bd8b7d1a2dcee18088b62e4a64c6f2e5244f9
| 697
|
py
|
Python
|
tests/conftest.py
|
bcgov/dbc-pylib
|
95080d68e42c9ef25d3a4468cd6c36a717004b89
|
[
"Apache-2.0"
] | 1
|
2020-01-24T15:20:24.000Z
|
2020-01-24T15:20:24.000Z
|
tests/conftest.py
|
bcgov/dbc-pylib
|
95080d68e42c9ef25d3a4468cd6c36a717004b89
|
[
"Apache-2.0"
] | 6
|
2020-04-17T19:32:31.000Z
|
2022-03-29T21:35:59.000Z
|
tests/conftest.py
|
bcgov/dbc-pylib
|
95080d68e42c9ef25d3a4468cd6c36a717004b89
|
[
"Apache-2.0"
] | 2
|
2018-06-11T17:58:14.000Z
|
2018-09-28T06:48:51.000Z
|
'''
Created on Aug 7, 2018
@author: kjnether
'''
import pytest
# cludgy fix to the arcgis pathing problems
import ArcGisUtil.ConfigurePy3Paths
p3registry = ArcGisUtil.ConfigurePy3Paths.Py3PathRegistry()
p3registry.addToPATHEnvVar()
p3registry.addToPythonPath()
from fixtures.Parser_fixtures import *
from fixtures.FMWParser_Fixture import *
from fixtures.Secrets_Fixture import *
from fixtures.KirkAPI import *
from fixtures.FMEServerApiData_fixtures import *
from fixtures.pyKirkData_fixtures import *
from fixtures.FMEServer_fixture import *
from fixtures.PMP_Info import *
from fixtures.layerfile_fixture import *
from fixtures.arcproregistryreader_fixture import *
| 27.88
| 60
| 0.804878
| 76
| 697
| 7.263158
| 0.473684
| 0.217391
| 0.293478
| 0.181159
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.018242
| 0.134864
| 697
| 24
| 61
| 29.041667
| 0.897181
| 0.120517
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.8
| 0
| 0.8
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
7eb56e2e6a5b570fe700cf4c6569d67ce0ef0d66
| 143
|
py
|
Python
|
reddit2telegram/channels/r_kamenrider/app.py
|
mainyordle/reddit2telegram
|
1163e15aed3b6ff0fba65b222d3d9798f644c386
|
[
"MIT"
] | 187
|
2016-09-20T09:15:54.000Z
|
2022-03-29T12:22:33.000Z
|
reddit2telegram/channels/r_kamenrider/app.py
|
mainyordle/reddit2telegram
|
1163e15aed3b6ff0fba65b222d3d9798f644c386
|
[
"MIT"
] | 84
|
2016-09-22T14:25:07.000Z
|
2022-03-19T01:26:17.000Z
|
reddit2telegram/channels/r_kamenrider/app.py
|
mainyordle/reddit2telegram
|
1163e15aed3b6ff0fba65b222d3d9798f644c386
|
[
"MIT"
] | 172
|
2016-09-21T15:39:39.000Z
|
2022-03-16T15:15:58.000Z
|
#encoding:utf-8
subreddit = 'KamenRider'
t_channel = '@r_KamenRider'
def send_post(submission, r2t):
return r2t.send_simple(submission)
| 15.888889
| 38
| 0.748252
| 19
| 143
| 5.421053
| 0.789474
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.024194
| 0.132867
| 143
| 8
| 39
| 17.875
| 0.806452
| 0.097902
| 0
| 0
| 0
| 0
| 0.179688
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 0.25
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 4
|
0e1955b68cce1b702906426b7e563b839e7ebf78
| 165
|
py
|
Python
|
problem0755.py
|
kmarcini/Project-Euler-Python
|
d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3
|
[
"BSD-3-Clause"
] | null | null | null |
problem0755.py
|
kmarcini/Project-Euler-Python
|
d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3
|
[
"BSD-3-Clause"
] | null | null | null |
problem0755.py
|
kmarcini/Project-Euler-Python
|
d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3
|
[
"BSD-3-Clause"
] | null | null | null |
###########################
#
# #755 Not Zeckendorf - Project Euler
# https://projecteuler.net/problem=755
#
# Code by Kevin Marciniak
#
###########################
| 18.333333
| 38
| 0.472727
| 14
| 165
| 5.571429
| 0.928571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.041096
| 0.115152
| 165
| 8
| 39
| 20.625
| 0.493151
| 0.575758
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
0e2fad196976b7ef1c2d188238ad90994005f923
| 10,300
|
py
|
Python
|
simulator/aes.py
|
Daeinar/dfa-aes
|
e68e83d068e9ef64ff5c5ebee062381b711185fc
|
[
"MIT"
] | 35
|
2016-12-16T23:14:58.000Z
|
2022-02-20T14:21:57.000Z
|
simulator/aes.py
|
Daeinar/dfa-aes
|
e68e83d068e9ef64ff5c5ebee062381b711185fc
|
[
"MIT"
] | 1
|
2020-08-25T00:59:57.000Z
|
2020-08-25T00:59:57.000Z
|
simulator/aes.py
|
Daeinar/dfa-aes
|
e68e83d068e9ef64ff5c5ebee062381b711185fc
|
[
"MIT"
] | 12
|
2015-09-08T07:44:29.000Z
|
2022-01-18T15:01:32.000Z
|
#!/usr/bin/env python
#
# Licensed by "The MIT License". See file LICENSE.
#
# Implementation of AES-128 with the option to simulate fault
# injections in round 8.
# expk are already expanded keys reconstructed from the fault analysis.
#
def encrypt(p,k=None,expk=None,fault=0x00,floc=0):
plaintext = to_matrix(p)
if expk == None:
expanded_key = expandkey(k)
else:
expanded_key = expk
state = add_roundkey(plaintext, get_roundkey(expanded_key,0))
for r in range(1,10):
if (r == 8):
state[ floc % 4 ][ floc / 4 ] ^= fault # fault injection
state = add_roundkey( mixcolumns(shiftrows( subbytes(state))), get_roundkey(expanded_key,r))
# final round
return to_bitstring( add_roundkey(shiftrows( subbytes(state)), get_roundkey(expanded_key,10)))
def decrypt(c,k):
ciphertext = to_matrix(c)
expanded_key = expandkey(k)
state = inv_subbytes(invShiftRows( add_roundkey(ciphertext, get_roundkey(expanded_key,10))))
for r in range(9,0,-1):
roundKey = get_roundkey(expanded_key,r)
state = inv_subbytes(invShiftRows(inv_mixcolumns( add_roundkey(state,roundKey))))
return to_bitstring(add_roundkey(state, get_roundkey(expanded_key,0)))
def add_roundkey(state,roundKey):
for i in range(0,4):
for j in range(0,4):
state[i][j] ^= roundKey[i][j]
return state
def get_roundkey(expanded_key,r):
key = 0
for i in xrange(4):
key ^= expanded_key[4*r+i] << 96-32*i
return to_matrix(key)
def ks_core(t,r):
b = ((t << 8) & 0xffffffff) ^ (t >> 24)
c = rcon[r] << 24
for i in xrange(4):
c ^= sbox[(b >> 24 - 8*i) & 0xff] << 24 - 8*i
return c
def expandkey(key):
Nb = 4
Nk = 4
Nr = 10
rconi = 1
expanded_key = [(key >> 96-32*i) & 0xffffffff for i in xrange(4)]
for i in xrange(Nk,Nb * (Nr + 1)):
t = expanded_key[i-1]
if (i % Nk == 0):
t = ks_core(t,rconi)
rconi += 1
expanded_key.append(expanded_key[i-Nk] ^ t)
i += 1
return expanded_key
def subbytes(state):
return apply_subbytes(state,False)
def inv_subbytes(state):
return apply_subbytes(state,True)
def apply_subbytes(state,isInv):
for i in range(0,4):
for j in range(0,4):
if (not isInv):
state[i][j] = sbox[state[i][j]]
else:
state[i][j] = inv_sbox[state[i][j]]
return state
def shiftrows(state):
return apply_shiftrows(state,False)
def inv_shiftrows(state):
return apply_shiftrows(state,True)
def apply_shiftrows(state,isInv):
for i in range(1,4):
for j in range(1,i+1):
if(not isInv):
state[i].append(state[i].pop(0)) # left-shift
else:
state[i].insert(0,state[i].pop()) # right-shift
return state
def mixcolumns(state):
return apply_mixcolumns(state,False)
def inv_mixcolumns(state):
return apply_mixcolumns(state,True)
def apply_mixcolumns(state,isInv):
s = [
[0x00,0x00,0x00,0x00],
[0x00,0x00,0x00,0x00],
[0x00,0x00,0x00,0x00],
[0x00,0x00,0x00,0x00],
]
if (not isInv):
# matrix for mixcolumns
m = [
[0x02,0x03,0x01,0x01],
[0x01,0x02,0x03,0x01],
[0x01,0x01,0x02,0x03],
[0x03,0x01,0x01,0x02]
]
else:
# matrx for invMixColumns
m = [
[0x0e,0x0b,0x0d,0x09],
[0x09,0x0e,0x0b,0x0d],
[0x0d,0x09,0x0e,0x0b],
[0x0b,0x0d,0x09,0x0e]
]
for i in range(0,4):
for j in range(0,4):
for k in range(0,4):
s[i][j] ^= gm(state[k][j],m[i][k])
return s
# galois multiplication
def gm(a,b):
f = 0x11b # AES polynomial: x^8 + x^4 + x^3 + x + 1
g = 0
for i in range(8):
if (b & 1) == 1: g ^= a
hbs = (a & 0x80) # check if highest bit is set
a <<= 1
if hbs == 0x80: a ^= f
b >>= 1
return g
#Rijndael S-box
sbox = [
0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,
0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15,
0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75,
0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84,
0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf,
0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8,
0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2,
0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73,
0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb,
0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79,
0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08,
0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a,
0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e,
0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf,
0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16 ]
# Rijndael Inverted S-box
inv_sbox = [
0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb,
0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb,
0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e,
0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25,
0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92,
0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84,
0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06,
0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b,
0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73,
0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e,
0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b,
0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4,
0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f,
0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef,
0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61,
0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d ]
# Rijndael Rcon
rcon = [
0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a,
0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39,
0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a,
0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8,
0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef,
0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc,
0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b,
0x36, 0x6c, 0xd8, 0xab, 0x4D, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3,
0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94,
0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20,
0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35,
0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f,
0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04,
0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63,
0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd,
0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb ]
def to_matrix(s):
m = []
for i in xrange(4):
m.append([(s >> (120-8*(4*j+i))) & 0xff for j in xrange(4)])
return m
def to_bitstring(s):
m = 0
for i in xrange(len(s)):
for j in xrange(len(s[i])):
m ^= s[i][j] << (120-8*(4*j+i))
return m
def printmatrix(m):
for i in xrange(4):
for j in xrange(4):
print "{:02x} ".format(m[i][j]),
print ""
print ""
def printkeys(keys):
for i in xrange(len(keys)):
print "{:08x}".format(keys[i])
print ""
def test_aes():
# KEY, PLAINTEXT, CIPHERTEXT
L = [(0x00000000000000000000000000000000,0x80000000000000000000000000000000,0x3ad78e726c1ec02b7ebfe92b23d9ec34),
(0x00000000000000000000000000000000,0xc0000000000000000000000000000000,0xaae5939c8efdf2f04e60b9fe7117b2c2),
(0x00000000000000000000000000000000,0xe0000000000000000000000000000000,0xf031d4d74f5dcbf39daaf8ca3af6e527),
(0x00000000000000000000000000000000,0xf0000000000000000000000000000000,0x96d9fd5cc4f07441727df0f33e401a36),
(0x00000000000000000000000000000000,0xf8000000000000000000000000000000,0x30ccdb044646d7e1f3ccea3dca08b8c0),
(0x00000000000000000000000000000000,0xff800000000000000000000000000000,0xa81738252621dd180a34f3455b4baa2f),
(0x00000000000000000000000000000000,0xffffffffffffffffffffe00000000000,0x9ca547f7439edc3e255c0f4d49aa8990),
(0x2b7e151628aed2a6abf7158809cf4f3c,0x6bc1bee22e409f96e93d7e117393172a,0x3ad77bb40d7a3660a89ecaf32466ef97),
(0x2b7e151628aed2a6abf7158809cf4f3c,0xae2d8a571e03ac9c9eb76fac45af8e51,0xf5d3d58503b9699de785895a96fdbaaf),
(0x2b7e151628aed2a6abf7158809cf4f3c,0x30c81c46a35ce411e5fbc1191a0a52ef,0x43b1cd7f598ece23881b00e3ed030688),
(0x2b7e151628aed2a6abf7158809cf4f3c,0xf69f2445df4f9b17ad2b417be66c3710,0x7b0c785e27e8ad3f8223207104725dd4)]
for e in L:
assert e[2] == encrypt(e[1],e[0])
print "All tests passed."
if __name__ == '__main__':
test_aes()
| 41.700405
| 114
| 0.672816
| 1,527
| 10,300
| 4.495088
| 0.273084
| 0.025641
| 0.024476
| 0.030303
| 0.286131
| 0.234557
| 0.189103
| 0.169289
| 0.169289
| 0.169289
| 0
| 0.332111
| 0.179417
| 10,300
| 246
| 115
| 41.869919
| 0.480005
| 0.047379
| 0
| 0.162562
| 0
| 0
| 0.003881
| 0
| 0
| 0
| 0.45215
| 0
| 0.004926
| 0
| null | null | 0.004926
| 0
| null | null | 0.039409
| 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
| 0
| 0
| null | 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
0e3caae88f80aa66fbe3c8cd5052ca522877ed29
| 176
|
py
|
Python
|
api/db/base.py
|
p0lygun/astounding-arapaimas
|
f82dbb2ec75ab7d98da6a46a1276c12583048b3c
|
[
"MIT"
] | null | null | null |
api/db/base.py
|
p0lygun/astounding-arapaimas
|
f82dbb2ec75ab7d98da6a46a1276c12583048b3c
|
[
"MIT"
] | 19
|
2021-07-11T10:02:08.000Z
|
2021-07-20T14:58:29.000Z
|
api/db/base.py
|
p0lygun/astounding-arapaimas
|
f82dbb2ec75ab7d98da6a46a1276c12583048b3c
|
[
"MIT"
] | null | null | null |
# Import all the models, so that Base has them before being imported by Alembic
from api.db.base_class import Base # noqa: F401
from api.models.user import User # noqa: F401
| 44
| 79
| 0.767045
| 31
| 176
| 4.322581
| 0.677419
| 0.104478
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.041379
| 0.176136
| 176
| 3
| 80
| 58.666667
| 0.882759
| 0.5625
| 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
|
0e4bd28dd4c3cded2c8d662b10b2c86c68c14775
| 259
|
py
|
Python
|
moto/cloudformation/__init__.py
|
argos83/moto
|
d3df810065c9c453d40fcc971f9be6b7b2846061
|
[
"Apache-2.0"
] | 1
|
2021-03-06T22:01:41.000Z
|
2021-03-06T22:01:41.000Z
|
moto/cloudformation/__init__.py
|
marciogh/moto
|
d3df810065c9c453d40fcc971f9be6b7b2846061
|
[
"Apache-2.0"
] | null | null | null |
moto/cloudformation/__init__.py
|
marciogh/moto
|
d3df810065c9c453d40fcc971f9be6b7b2846061
|
[
"Apache-2.0"
] | 1
|
2017-10-19T00:53:28.000Z
|
2017-10-19T00:53:28.000Z
|
from __future__ import unicode_literals
from .models import cloudformation_backends
from ..core.models import MockAWS, base_decorator
cloudformation_backend = cloudformation_backends['us-east-1']
mock_cloudformation = base_decorator(cloudformation_backends)
| 37
| 61
| 0.864865
| 30
| 259
| 7.066667
| 0.566667
| 0.311321
| 0.254717
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.004184
| 0.07722
| 259
| 6
| 62
| 43.166667
| 0.882845
| 0
| 0
| 0
| 0
| 0
| 0.034749
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.6
| 0
| 0.6
| 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
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
0e74b4541f79189673d35b2ce9384c870329e8bb
| 715
|
py
|
Python
|
startup/47-IOS_gui.py
|
NSLS-II-IOS/profile_collection
|
0c47a5c4564896a38cd5506c01dfc43e0f9da042
|
[
"BSD-3-Clause"
] | null | null | null |
startup/47-IOS_gui.py
|
NSLS-II-IOS/profile_collection
|
0c47a5c4564896a38cd5506c01dfc43e0f9da042
|
[
"BSD-3-Clause"
] | 11
|
2020-08-12T19:10:12.000Z
|
2021-05-19T18:57:16.000Z
|
startup/47-IOS_gui.py
|
NSLS-II-IOS/profile_collection
|
0c47a5c4564896a38cd5506c01dfc43e0f9da042
|
[
"BSD-3-Clause"
] | 1
|
2020-03-20T14:20:37.000Z
|
2020-03-20T14:20:37.000Z
|
ios_ui_config_file = "/home/bsobhani/git/bsstudio-xf/23id2/ios_gui.ui"
def update_gui():
#import os
#os.system("git -C /opt/bsstudio/bsstudio-xf pull")
#os.system("git -C /home2/xf21id1/git/bsstudio pull")
#os.system("git -C /home2/xf21id1/git/bsstudio-xf pull")
pass
def ios_gui(filename=ios_ui_config_file):
# Note: install it in the developer mode with the following command before
# it's packaged with conda
# $ cd /home2/xf21id1/git/bsstudio/
# $ pip install -e .
import os
#os.environ["BSSTUDIO_LOG_FILE_NAME"] = "/var/log/bsstudio/bsstudio.log"
import sys
sys.path.append("/home/bsobhani/code/bsstudio/")
import bsstudio
bsstudio.load(filename)
| 34.047619
| 78
| 0.692308
| 107
| 715
| 4.514019
| 0.457944
| 0.091097
| 0.068323
| 0.074534
| 0.161491
| 0.161491
| 0.161491
| 0.161491
| 0.161491
| 0
| 0
| 0.025381
| 0.173427
| 715
| 20
| 79
| 35.75
| 0.791878
| 0.548252
| 0
| 0
| 0
| 0
| 0.242038
| 0.242038
| 0
| 0
| 0
| 0
| 0
| 1
| 0.222222
| false
| 0.111111
| 0.333333
| 0
| 0.555556
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 1
| 0
| 1
| 0
|
0
| 4
|
0e8453e121460b396ee648b144ba377e189677e3
| 317
|
py
|
Python
|
orthnet/poly/__init__.py
|
Orcuslc/OrthNet
|
ed7e9f5f608ebe56b56631d4e776e62403f15d38
|
[
"MIT"
] | 32
|
2018-03-01T18:42:25.000Z
|
2022-01-10T23:35:11.000Z
|
orthnet/poly/__init__.py
|
Orcuslc/OrthNet
|
ed7e9f5f608ebe56b56631d4e776e62403f15d38
|
[
"MIT"
] | 2
|
2020-02-14T11:59:02.000Z
|
2020-05-19T10:51:13.000Z
|
orthnet/poly/__init__.py
|
Orcuslc/OrthNet
|
ed7e9f5f608ebe56b56631d4e776e62403f15d38
|
[
"MIT"
] | 6
|
2018-03-02T06:56:47.000Z
|
2022-01-27T21:58:37.000Z
|
from ._legendre import Legendre, Legendre_Normalized
from ._laguerre import Laguerre
from ._hermite import Hermite, Hermite2
from ._chebyshev import Chebyshev, Chebyshev2
from ._jacobi import Jacobi
__all__ = ['Legendre', 'Legendre_Normalized', 'Laguerre', 'Hermite', 'Hermite2', 'Chebyshev', 'Chebyshev2', 'Jacobi']
| 45.285714
| 117
| 0.788644
| 34
| 317
| 7.029412
| 0.323529
| 0.133891
| 0.217573
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.014085
| 0.104101
| 317
| 7
| 117
| 45.285714
| 0.827465
| 0
| 0
| 0
| 0
| 0
| 0.235849
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.833333
| 0
| 0.833333
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
0e979f347d7841763979bca0ed3fac56772f03b8
| 1,336
|
py
|
Python
|
lambdata_20/example_module.py
|
rassamyjs/lambdata-20-try2
|
e334d52c6f48db31877a29c41c2879127338f9c6
|
[
"MIT"
] | null | null | null |
lambdata_20/example_module.py
|
rassamyjs/lambdata-20-try2
|
e334d52c6f48db31877a29c41c2879127338f9c6
|
[
"MIT"
] | null | null | null |
lambdata_20/example_module.py
|
rassamyjs/lambdata-20-try2
|
e334d52c6f48db31877a29c41c2879127338f9c6
|
[
"MIT"
] | null | null | null |
""" Lambdata - a collection of Data Science helper functions"""
# # accessing libraries through pipenv
import pandas as pd
import numpy as np
from pandas import DataFrame
FAVORITE_NUMBERS = [3.71, 101, 55, 12, 3.14]
COLORS = ['cyan', 'teal', 'mauve', 'blue', 'crimson']
def increment(x):
return x + 1
# def df_nullsum(df):
# """counts null values"""
# print(df.isnull().sum().sum())
# pass
# def df_shuffle(df):
# """shuffles df"""
# print(df.sample(frac =1))
# pass
# # TODO: helper fuction
# # State abbreviation -> to full name and vise versa
# # FL --> Florida, Florida --> FL, etc
# def add_state_names_columns(my_df):
# """
# Add a column of corresponding state names to a dataframe.
# Params (my_df) a DataFrame with a column called "abbrev" that has state abbreviations
# Return a the dataframe with an extra column
# """
# new_df = my_df.copy()
# names_map = {"CA": "California", "CO": "Colorado", "CT": "Connecticut"}
# new_df["name"] = new_df["abbrev"].map(names_map)
# return my_df
# if __name__ == "__main__":
# df = DataFrame({"abbrev": ["CA", "CO", "CT", "DC", "TX"]})
# print(df.head())
# mapped_df = add_state_names_columns(df)
# print(mapped_df.head())
| 24.740741
| 92
| 0.589072
| 175
| 1,336
| 4.337143
| 0.548571
| 0.02108
| 0.034256
| 0.052701
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.015106
| 0.256737
| 1,336
| 54
| 93
| 24.740741
| 0.749245
| 0.737275
| 0
| 0
| 0
| 0
| 0.091603
| 0
| 0
| 0
| 0
| 0.018519
| 0
| 1
| 0.142857
| false
| 0
| 0.428571
| 0.142857
| 0.714286
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 4
|
0ea08cbf0319a5cf18ee9c8481dcb8da21bd66bb
| 62,806
|
py
|
Python
|
web/transiq/restapi/views/sme.py
|
manibhushan05/transiq
|
763fafb271ce07d13ac8ce575f2fee653cf39343
|
[
"Apache-2.0"
] | null | null | null |
web/transiq/restapi/views/sme.py
|
manibhushan05/transiq
|
763fafb271ce07d13ac8ce575f2fee653cf39343
|
[
"Apache-2.0"
] | 14
|
2020-06-05T23:06:45.000Z
|
2022-03-12T00:00:18.000Z
|
web/transiq/restapi/views/sme.py
|
manibhushan05/transiq
|
763fafb271ce07d13ac8ce575f2fee653cf39343
|
[
"Apache-2.0"
] | null | null | null |
from datetime import datetime, timedelta
from django.contrib.postgres.fields.jsonb import KeyTextTransform
from django.db.models import Q
from django.db.models.expressions import RawSQL
from django.utils.decorators import method_decorator
from django.views.decorators.cache import cache_page
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import viewsets, status, generics, filters
from rest_framework.renderers import TemplateHTMLRenderer, JSONRenderer
from rest_framework.response import Response
from rest_framework.views import APIView
from django.conf import settings
from api.utils import to_int
from authentication.models import Profile
from employee.models import Employee
from restapi.filter.sme import SmeFilter, SmeTaskEmailFilter, RateTypeFilter, ContractRouteFilter, LocationFilter, \
ConsignorConsigneeFilter, ContactDetailsFilter, CustomerContractFilter, PreferredVehicleFilter
from restapi.helper_api import generate_username, error_response, success_response, get_employee_roles
from restapi.models import BookingStatusesMapping, SmePaymentFollowupComments
from restapi.pagination import CustomeDatatablesPaginator
from restapi.parser.updatawebdata import parse_update_sme_data
from restapi.search import CustomSearch
from restapi.serializers.authentication import UserSerializer, ProfileSerializer
from restapi.serializers.sme import SmeSerializer, CustomerContractSerializer, SmeTaskEmailSerializer, \
RateTypeSerializer, ContractRouteSerializer, ContactDetailsSerializer, LocationSerializer, \
ConsignorConsigneeSerializer, PreferredVehicleSerializer, SmeEnquirySerializer, SmeSummarySerializer
from restapi.tasks import send_customer_welcome_email
from restapi.utils import get_or_none
from sme.models import Sme, CustomerContract, SmeTaskEmail, RateType, ContractRoute, ContactDetails, Location, \
ConsignorConsignee, PreferredVehicle, SmeEnquiry, SmeSummary
from team.models import Invoice, PendingInwardPaymentEntry, ManualBooking
class SmeTaskEmailListView(generics.ListAPIView):
queryset = SmeTaskEmail.objects.order_by('-id').exclude(deleted=True)
serializer_class = SmeTaskEmailSerializer
filter_backends = (filters.SearchFilter, filters.OrderingFilter, DjangoFilterBackend)
filter_class = SmeTaskEmailFilter
search_fields = ('name', 'id')
def list(self, request, *args, **kwargs):
queryset = self.filter_queryset(self.get_queryset())
data = {"status": "Successfull", "status_code": status.HTTP_200_OK, "msg": "Broker List"}
page = self.paginate_queryset(queryset)
if page is not None:
serializer = self.get_serializer(page, many=True)
data["data"] = serializer.data
return self.get_paginated_response(data)
serializer = self.get_serializer(queryset, many=True)
data["data"] = serializer.data
return Response(data)
class SmeCreatePageView(APIView):
renderer_classes = (TemplateHTMLRenderer, JSONRenderer)
template_name = 'team/registrations/register-customer.html'
def get(self, request):
return Response(status=status.HTTP_200_OK)
class SmeTaskEmailViewSet(viewsets.ViewSet):
"""
API for CRUP operation on Sme Task Email
"""
def create(self, request):
request.data["created_by"] = self.request.user.username
request.data["changed_by"] = self.request.user.username
sme_task_email_serializer = SmeTaskEmailSerializer(data=request.data)
if sme_task_email_serializer.is_valid():
sme_task_email_serializer.save()
response = {
"status_code": status.HTTP_201_CREATED,
"status": "Success",
"msg": "Sme Task Email Created",
"data": sme_task_email_serializer.data
}
return Response(data=response, status=status.HTTP_201_CREATED)
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "Error",
"msg": "Sme Task Email not Created",
"data": sme_task_email_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
def update(self, request, pk=None):
request.data["changed_by"] = self.request.user.username
sme_task_email = get_or_none(SmeTaskEmail, id=pk)
if not isinstance(sme_task_email, SmeTaskEmail):
return Response({"error": "Sme Task Email does not exist"}, status=status.HTTP_404_NOT_FOUND)
sme_task_email_serializer = SmeTaskEmailSerializer(sme_task_email, data=request.data)
if sme_task_email_serializer.is_valid():
sme_task_email_serializer.save()
response = {
"status_code": status.HTTP_202_ACCEPTED,
"status": "Success",
"msg": "Sme Task Email Updated",
"data": sme_task_email_serializer.data
}
return Response(data=response, status=status.HTTP_202_ACCEPTED)
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "Error",
"msg": "Sme Task Email not Updated",
"data": sme_task_email_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
def partial_update(self, request, pk=None):
request.data["changed_by"] = self.request.user.username
sme_task_email = get_or_none(SmeTaskEmail, id=pk)
if not isinstance(sme_task_email, SmeTaskEmail):
return Response({"error": "Sme Task Email does not exist"}, status=status.HTTP_404_NOT_FOUND)
sme_task_email_serializer = SmeTaskEmailSerializer(
instance=sme_task_email,
data=request.data,
partial=True
)
if sme_task_email_serializer.is_valid():
sme_task_email_serializer.save()
response = {
"status_code": status.HTTP_202_ACCEPTED,
"status": "Success",
"msg": "Sme Task Email Updated",
"data": sme_task_email_serializer.data
}
return Response(data=response, status=status.HTTP_202_ACCEPTED)
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "Error",
"msg": "Sme Task Email not Updated",
"data": sme_task_email_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
def retrieve(self, request, pk=None):
sme_task_email = get_or_none(SmeTaskEmail, id=pk)
if isinstance(sme_task_email, SmeTaskEmail):
sme_task_email_serializer = SmeTaskEmailSerializer(sme_task_email)
return Response(sme_task_email_serializer.data, status=status.HTTP_200_OK)
return Response({"error": "Sme Task Email does not exist"}, status=status.HTTP_404_NOT_FOUND)
class SmeListView(generics.ListAPIView):
# queryset = Sme.objects.order_by('-id').exclude(deleted=True).exclude(name__profile=None)
serializer_class = SmeSerializer
filter_backends = (CustomSearch, filters.OrderingFilter, DjangoFilterBackend)
filter_class = SmeFilter
search_fields = (
'id', 'name__profile__name', 'name__profile__phone', 'name__profile__contact_person_name',
'aaho_office__branch_name', 'email_tasks__name', 'company_code', 'customer_address', 'credit_period',
'aaho_poc__username__username', 'aaho_poc__username__profile__name', 'city__name', 'gstin', 'created_on',
'material')
def list(self, request, *args, **kwargs):
queryset = self.filter_queryset(self.get_queryset())
data = {"status": "success", "status_code": status.HTTP_200_OK, "msg": "Customer List"}
if self.request.GET.get('sme_data_category') == 'poc_invoices':
serializer = self.get_serializer(queryset, many=True)
data["data"] = self.add_invoice_details(serializer.data, 'invoice_raised')
data["data"] = sorted(data["data"],
key=lambda k: (int(k.get('invoice_details', 0).get('overdue_amount', 0)),
int(k.get('invoice_details', 0).get('pending_amount', 0))),
reverse=True)
page = self.paginate_queryset(data["data"])
if page is not None:
data["data"] = page
return self.get_paginated_response(data)
return Response(data)
else:
page = self.paginate_queryset(queryset)
if page is not None:
serializer = self.get_serializer(page, many=True)
data["data"] = serializer.data
return self.get_paginated_response(data)
serializer = self.get_serializer(queryset, many=True)
data["data"] = serializer.data
return Response(data)
def get_queryset(self):
user = self.request.user
employee = get_or_none(Employee, username=user)
if self.request.GET.get('sme_data_category') == 'poc_invoices' and isinstance(employee, Employee):
invoice_confirmed_bookings = BookingStatusesMapping.objects.filter(
booking_status_chain__booking_status__status__in=['invoice_raised', 'party_invoice_sent',
'invoice_confirmed']).exclude(deleted=True). \
values_list('manual_booking_id', flat=True)
complete_bookings = BookingStatusesMapping.objects.filter(
booking_status_chain__booking_status__status__iexact='inward_followup_completed').exclude(deleted=True). \
values_list('manual_booking_id', flat=True)
pending_payments_bookings = [x for x in invoice_confirmed_bookings if x not in complete_bookings]
emp_roles_response = get_employee_roles(user)
if emp_roles_response['status'] == 'success' and ('management' in emp_roles_response['roles']
or 'tech' in emp_roles_response['roles']):
smes = Sme.objects.order_by('-id').exclude(deleted=True).exclude(name__profile=None)
elif emp_roles_response['status'] == 'success' and ('city_head' in emp_roles_response['roles']):
smes = Sme.objects.filter(aaho_office_id__in=employee.office_multiple.values_list('id')).exclude(
deleted=True).exclude(name__profile=None).order_by('-id')
else:
smes = Sme.objects.filter(aaho_poc__username=self.request.user).order_by('-id').exclude(
deleted=True).exclude(name__profile=None)
sme_ids = list(ManualBooking.objects.filter(id__in=pending_payments_bookings,
customer_to_be_billed_to__in=smes,
inward_payment_status__in=['no_payment', 'partial_received'],
invoice_status__in=['invoice_raised', 'invoice_sent',
'invoice_confirmed']).
values_list('customer_to_be_billed_to_id', flat=True))
# sme_ids = set(sme_ids)
return smes.filter(id__in=sme_ids)
elif self.request.GET.get('sme_data_category') == 'web_customers_records' and isinstance(employee, Employee):
emp_roles_response = get_employee_roles(user)
if emp_roles_response['status'] == 'failure':
return Sme.objects.none()
elif ('management' in emp_roles_response['roles'] or 'tech' in emp_roles_response['roles']):
return Sme.objects.exclude(Q(deleted=True) | Q(name__profile=None))
else:
return Sme.objects.filter(aaho_office__in=employee.office_multiple.all())
return Sme.objects.exclude(deleted=True).exclude(name__profile=None)
def add_invoice_details(self, data, status):
pending_amount = 0
overdue_invoices = 0
overdue_amount = 0
pending_invoices = 0
# invoice_confirmed_bookings = BookingStatusesMapping.objects.filter(
# booking_status_chain__booking_status__status__in=['invoice_raised', 'party_invoice_sent',
# 'invoice_confirmed']).exclude(deleted=True). \
# values_list('manual_booking_id', flat=True)
# complete_bookings = BookingStatusesMapping.objects.filter(
# booking_status_chain__booking_status__status__iexact='inward_followup_completed').exclude(deleted=True). \
# values_list('manual_booking_id', flat=True)
# pending_payments_bookings = [x for x in invoice_confirmed_bookings if x not in complete_bookings]
for sme in data:
# invs = Invoice.objects.filter(bookings__in=pending_payments_bookings, customer_fk__id=sme['id'],
# payment_received=False).distinct()
try:
sme_summary = SmeSummary.objects.get(sme__id=sme['id'])
except SmeSummary.DoesNotExist:
sme_summary = None
if sme_summary:
billed_sme_summary = sme_summary.billed_accounting_summary
else:
billed_sme_summary = None
# for inv in invs:
# pending_amount += to_int(inv.get_customer_balance)
# if inv.is_overdue:
# overdue_invoices += 1
# overdue_amount += to_int(inv.get_overdue_balance)
latest_sme_comment = SmePaymentFollowupComments.objects.filter(sme__id=sme['id'],
due_date__isnull=False).exclude(
deleted=True).last()
if latest_sme_comment:
sme_due_date = str(latest_sme_comment.due_date)
else:
sme_due_date = None
sme['invoice_details'] = {'pending_invoices': str(billed_sme_summary[
'pending_invoices'] if 'pending_invoices' in billed_sme_summary else 0) if billed_sme_summary else pending_invoices,
'pending_amount': str(sum(billed_sme_summary[
'pending_payments'].values()) if 'pending_payments' in billed_sme_summary else 0) if billed_sme_summary else pending_amount,
'overdue_invoices': str(billed_sme_summary[
'overdue_invoices'] if 'overdue_invoices' in billed_sme_summary else 0) if billed_sme_summary else overdue_invoices,
'overdue_amount': str(billed_sme_summary[
'overdue_amount'] if 'overdue_amount' in billed_sme_summary else 0) if billed_sme_summary else overdue_amount,
'pending_inward_adjustment': str(to_int(sum(
[amount + tds for amount, tds in
PendingInwardPaymentEntry.objects.filter(adjusted_flag=False,
customer_id=sme['id']).values_list(
'amount', 'tds')]))),
'sme_due_date': sme_due_date}
# overdue_invoices = 0
# pending_amount = 0
# overdue_amount = 0
return data
class SmeSummaryListView(generics.ListAPIView):
serializer_class = SmeSummarySerializer
pagination_class = CustomeDatatablesPaginator
filter_backends = (CustomSearch, filters.OrderingFilter, DjangoFilterBackend)
# filter_class = OwnerVehicleFilter
search_fields = ('id', 'sme__company_code', 'sme__name__profile__name')
def list(self, request, *args, **kwargs):
queryset = self.filter_queryset(self.get_queryset())
data = {"status": "Success", "status_code": status.HTTP_200_OK, "msg": "Accounting Summary List"}
page = self.paginate_queryset(queryset)
if page is not None:
serializer = self.get_serializer(page, many=True)
data["data"] = serializer.data
return self.get_paginated_response(data)
serializer = self.get_serializer(queryset, many=True)
data["data"] = serializer.data
return Response(data)
def get_queryset(self):
summary_type = self.request.GET.get('summary_type', None)
queryset = SmeSummary.objects.exclude(deleted=True)
emp_roles_response = get_employee_roles(self.request.user)
if summary_type == 'billed_customer':
queryset = queryset.exclude(billed_accounting_summary=None).annotate(
total_amount=RawSQL("(billed_accounting_summary->>%s)::numeric", ("total_amount",))).order_by(
'-total_amount')
if emp_roles_response['status'] == 'success' and ('city_head' in emp_roles_response['roles']):
employee = get_or_none(Employee, username=self.request.user)
if isinstance(employee, Employee):
queryset = queryset.filter(sme__aaho_office__in=employee.office_multiple.all())
elif summary_type == 'placed_order_customer':
queryset = queryset.exclude(placed_order_accounting_summary=None).annotate(
total_amount=RawSQL("(placed_order_accounting_summary->>%s)::numeric", ("total_amount",))).order_by(
'-total_amount')
if emp_roles_response['status'] == 'success' and ('city_head' in emp_roles_response['roles']):
employee = get_or_none(Employee, username=self.request.user)
if isinstance(employee, Employee):
queryset = queryset.filter(sme__aaho_office__in=employee.office_multiple.all())
else:
queryset = SmeSummary.objects.none()
return queryset
class SmeViewSet(viewsets.ViewSet):
"""
API for CRUP operation on Sme
"""
renderer_classes = (JSONRenderer, TemplateHTMLRenderer)
def create(self, request):
request.data["created_by"] = self.request.user.username
request.data["changed_by"] = self.request.user.username
if 'company_code' in request.data and request.data.get('company_code', None):
if Sme.objects.filter(company_code__iexact=request.data['company_code']).exists():
return error_response(status=status.HTTP_400_BAD_REQUEST, msg='customer code already exists', data={})
try:
profile_data = {
"name": request.data["name"],
"phone": request.data.get("phone"),
"email": request.data.get("email", None),
"alternate_phone": request.data.get("alternate_phone", None),
"contact_person_name": request.data.get("contact_person_name", None),
"contact_person_phone": request.data.get("phone"),
"comment": request.data.get("remarks", None),
"address": request.data.get("customer_address", None)
}
except KeyError:
return Response({"error": "Key Error"}, status=status.HTTP_400_BAD_REQUEST)
username = generate_username(profile_data["name"], profile_data["phone"], profile_data["email"])
password = "X@RWERT21RW!@#"
user = UserSerializer(data={"username": username, "password": password})
if user.is_valid():
user = user.save()
profile_data["user"] = user.id
profile = ProfileSerializer(data=profile_data)
if profile.is_valid():
profile.save()
request.data["name"] = user.username
sme_serializer = SmeSerializer(data=request.data)
if sme_serializer.is_valid():
sme = sme_serializer.save()
if settings.ENABLE_CELERY:
send_customer_welcome_email.delay(sme.id)
else:
send_customer_welcome_email(sme.id)
return success_response(status=status.HTTP_201_CREATED, msg='Customer is created',
data=sme_serializer.data)
user.delete()
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "failure",
"msg": "Sme not Created",
"data": sme_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
user.delete()
return Response(profile.errors, status=status.HTTP_400_BAD_REQUEST)
return Response(user.errors, status=status.HTTP_400_BAD_REQUEST)
def update(self, request, pk=None):
request.data["changed_by"] = self.request.user.username
sme = get_or_none(Sme, id=pk)
if not isinstance(sme, Sme):
return Response({"error": "Sme does not exist"}, status=status.HTTP_404_NOT_FOUND)
sme_serializer = SmeSerializer(sme, data=request.data)
if sme_serializer.is_valid():
sme_serializer.save()
response = {
"status_code": status.HTTP_202_ACCEPTED,
"status": "success",
"msg": "Sme Updated",
"data": sme_serializer.data
}
return Response(data=response, status=status.HTTP_202_ACCEPTED)
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "failure",
"msg": "Sme not Updated",
"data": sme_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
def partial_update(self, request, pk=None):
sme = get_or_none(Sme, id=pk)
if not isinstance(sme, Sme):
return error_response(status=status.HTTP_400_BAD_REQUEST, msg='Sme Doesnot Exists', data={})
profile = get_or_none(Profile, user=sme.name)
parsed_data = parse_update_sme_data(request.data, id=pk)
parsed_data["changed_by"] = self.request.user.username
if isinstance(profile, Profile) and parsed_data['profile_data']:
profile_serializer = ProfileSerializer(instance=profile, data=parsed_data['profile_data'], partial=True)
if profile_serializer.is_valid():
profile_serializer.save()
else:
return error_response(
status=status.HTTP_400_BAD_REQUEST, msg='Invalid owner data', data=profile_serializer.errors)
else:
return error_response(status=status.HTTP_400_BAD_REQUEST, msg='Profile Doesnot Exists', data={})
sme_serializer = SmeSerializer(
instance=sme,
data=parsed_data,
partial=True
)
if sme_serializer.is_valid():
sme_serializer.save()
return success_response(status=status.HTTP_202_ACCEPTED, msg='SME updated', data=sme_serializer.data)
return error_response(status=status.HTTP_400_BAD_REQUEST, msg='Something went wrong',
data=sme_serializer.errors)
def retrieve_app(self, request, pk=None):
sme = get_or_none(Sme, id=pk)
if isinstance(sme, Sme):
sme_serializer = SmeSerializer(sme)
return success_response(data=sme_serializer.data, status=status.HTTP_200_OK, msg='Sme Found')
return error_response(data={}, status=status.HTTP_404_NOT_FOUND, msg='Sme not found')
def retrieve(self, request, pk=None):
sme = get_or_none(Sme, id=pk)
if isinstance(sme, Sme):
sme_serializer = SmeSerializer(sme)
return Response(template_name='team/registrations/customer-update.html', data=sme_serializer.data,
status=status.HTTP_200_OK)
return Response({"error": "Sme does not exist"}, status=status.HTTP_404_NOT_FOUND)
class RateTypeListView(generics.ListAPIView):
queryset = RateType.objects.order_by('-id').exclude(deleted=True)
serializer_class = RateTypeSerializer
filter_backends = (filters.SearchFilter, filters.OrderingFilter, DjangoFilterBackend)
filter_class = RateTypeFilter
search_fields = ('name', 'id')
def list(self, request, *args, **kwargs):
queryset = self.filter_queryset(self.get_queryset())
data = {"status": "Successfull", "status_code": status.HTTP_200_OK, "msg": "Broker List"}
page = self.paginate_queryset(queryset)
if page is not None:
serializer = self.get_serializer(page, many=True)
data["data"] = serializer.data
return self.get_paginated_response(data)
serializer = self.get_serializer(queryset, many=True)
data["data"] = serializer.data
return Response(data)
class RateTypeViewSet(viewsets.ViewSet):
"""
API for CRUP operation on RateType
"""
def create(self, request):
request.data["created_by"] = self.request.user.username
request.data["changed_by"] = self.request.user.username
rate_type_serializer = RateTypeSerializer(data=request.data)
if rate_type_serializer.is_valid():
rate_type_serializer.save()
response = {
"status_code": status.HTTP_201_CREATED,
"status": "Success",
"msg": "RateType Created",
"data": rate_type_serializer.data
}
return Response(data=response, status=status.HTTP_201_CREATED)
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "Error",
"msg": "RateType not Created",
"data": rate_type_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
def update(self, request, pk=None):
request.data["changed_by"] = self.request.user.username
rate_type = get_or_none(RateType, id=pk)
if not isinstance(rate_type, RateType):
return Response({"error": "RateType does not exist"}, status=status.HTTP_404_NOT_FOUND)
rate_type_serializer = RateTypeSerializer(rate_type, data=request.data)
if rate_type_serializer.is_valid():
rate_type_serializer.save()
response = {
"status_code": status.HTTP_202_ACCEPTED,
"status": "Success",
"msg": "RateType Updated",
"data": rate_type_serializer.data
}
return Response(data=response, status=status.HTTP_202_ACCEPTED)
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "Error",
"msg": "RateType not Updated",
"data": rate_type_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
def partial_update(self, request, pk=None):
request.data["changed_by"] = self.request.user.username
rate_type = get_or_none(RateType, id=pk)
if not isinstance(rate_type, RateType):
return Response({"error": "RateType does not exist"}, status=status.HTTP_404_NOT_FOUND)
rate_type_serializer = RateTypeSerializer(
instance=rate_type,
data=request.data,
partial=True
)
if rate_type_serializer.is_valid():
rate_type_serializer.save()
response = {
"status_code": status.HTTP_202_ACCEPTED,
"status": "Success",
"msg": "RateType Updated",
"data": rate_type_serializer.data
}
return Response(data=response, status=status.HTTP_202_ACCEPTED)
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "Error",
"msg": "RateType not Updated",
"data": rate_type_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
def retrieve(self, request, pk=None):
rate_type = get_or_none(RateType, id=pk)
if isinstance(rate_type, RateType):
rate_type_serializer = RateTypeSerializer(rate_type)
return Response(rate_type_serializer.data, status=status.HTTP_200_OK)
return Response({"error": "RateType does not exist"}, status=status.HTTP_404_NOT_FOUND)
class CustomerContractListView(generics.ListAPIView):
queryset = CustomerContract.objects.order_by('-id').exclude(deleted=True)
serializer_class = CustomerContractSerializer
filter_backends = (filters.SearchFilter, filters.OrderingFilter, DjangoFilterBackend)
filter_class = CustomerContractFilter
search_fields = ('customer__name__username', 'id', 'customer__company_code', 'billing_frequency')
def list(self, request, *args, **kwargs):
queryset = self.filter_queryset(self.get_queryset())
data = {"status": "Successfull", "status_code": status.HTTP_200_OK, "msg": "Broker List"}
page = self.paginate_queryset(queryset)
if page is not None:
serializer = self.get_serializer(page, many=True)
data["data"] = serializer.data
return self.get_paginated_response(data)
serializer = self.get_serializer(queryset, many=True)
data["data"] = serializer.data
return Response(data)
class CustomerContractViewSet(viewsets.ViewSet):
"""
API for CRUP operation on Customer Contract
"""
def create(self, request):
request.data["created_by"] = self.request.user.username
request.data["changed_by"] = self.request.user.username
customer_contract_serializer = CustomerContractSerializer(data=request.data)
if customer_contract_serializer.is_valid():
customer_contract_serializer.save()
response = {
"status_code": status.HTTP_201_CREATED,
"status": "Success",
"msg": "Customer Contract Created",
"data": customer_contract_serializer.data
}
return Response(data=response, status=status.HTTP_201_CREATED)
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "Error",
"msg": "Customer Contract not Created",
"data": customer_contract_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
def update(self, request, pk=None):
request.data["changed_by"] = self.request.user.username
customer_contract = get_or_none(CustomerContract, id=pk)
if not isinstance(customer_contract, CustomerContract):
return Response({"error": "Customer Contract does not exist"}, status=status.HTTP_404_NOT_FOUND)
customer_contract_serializer = CustomerContractSerializer(customer_contract, data=request.data)
if customer_contract_serializer.is_valid():
customer_contract_serializer.save()
response = {
"status_code": status.HTTP_202_ACCEPTED,
"status": "Success",
"msg": "Customer Contract Updated",
"data": customer_contract_serializer.data
}
return Response(data=response, status=status.HTTP_202_ACCEPTED)
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "Error",
"msg": "Customer Contract not Updated",
"data": customer_contract_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
def partial_update(self, request, pk=None):
request.data["changed_by"] = self.request.user.username
customer_contract = get_or_none(CustomerContract, id=pk)
if not isinstance(customer_contract, CustomerContract):
return Response({"error": "Customer Contract does not exist"}, status=status.HTTP_404_NOT_FOUND)
customer_contract_serializer = CustomerContractSerializer(
instance=customer_contract,
data=request.data,
partial=True
)
if customer_contract_serializer.is_valid():
customer_contract_serializer.save()
response = {
"status_code": status.HTTP_202_ACCEPTED,
"status": "Success",
"msg": "Customer Contract Updated",
"data": customer_contract_serializer.data
}
return Response(data=response, status=status.HTTP_202_ACCEPTED)
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "Error",
"msg": "Customer Contract not Updated",
"data": customer_contract_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
def retrieve(self, request, pk=None):
customer_contract = get_or_none(CustomerContract, id=pk)
if isinstance(customer_contract, CustomerContract):
customer_contract_serializer = CustomerContractSerializer(customer_contract)
return Response(customer_contract_serializer.data, status=status.HTTP_200_OK)
return Response({"error": "Customer Contract does not exist"}, status=status.HTTP_404_NOT_FOUND)
def contract_customer_data(self, request):
sme_id = request.GET.get('sme_id')
customer = get_or_none(Sme, id=sme_id)
if isinstance(customer, Sme):
today = datetime.now().date()
if customer.customercontract_set.filter(Q(start_date__lte=today) & Q(end_date__gte=today)).exclude(
deleted=True).exists():
data = {'id': customer.id, 'name': customer.get_name(), 'code': customer.company_code,
'is_contract': True}
else:
data = {'id': customer.id, 'name': customer.get_name(), 'code': customer.company_code,
'is_contract': False}
else:
data = {'id': -1, 'name': '', 'code': '', 'is_contract': False}
return Response(data=data, status=status.HTTP_200_OK)
class ContractRouteListView(generics.ListAPIView):
queryset = ContractRoute.objects.order_by('-id').exclude(deleted=True)
serializer_class = ContractRouteSerializer
filter_backends = (filters.SearchFilter, filters.OrderingFilter, DjangoFilterBackend)
filter_class = ContractRouteFilter
search_fields = ('source__name', 'id', 'destination__name', 'rate_type__name')
def list(self, request, *args, **kwargs):
queryset = self.filter_queryset(self.get_queryset())
data = {"status": "Successfull", "status_code": status.HTTP_200_OK, "msg": "Broker List"}
page = self.paginate_queryset(queryset)
if page is not None:
serializer = self.get_serializer(page, many=True)
data["data"] = serializer.data
return self.get_paginated_response(data)
serializer = self.get_serializer(queryset, many=True)
data["data"] = serializer.data
return Response(data)
class ContractRouteViewSet(viewsets.ViewSet):
"""
API for CRUP operation on Contract Route
"""
def create(self, request):
request.data["created_by"] = self.request.user.username
request.data["changed_by"] = self.request.user.username
contract_route_serializer = ContractRouteSerializer(data=request.data)
if contract_route_serializer.is_valid():
contract_route_serializer.save()
response = {
"status_code": status.HTTP_201_CREATED,
"status": "Success",
"msg": "Contract Route Created",
"data": contract_route_serializer.data
}
return Response(data=response, status=status.HTTP_201_CREATED)
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "Error",
"msg": "Contract Route not Created",
"data": contract_route_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
def update(self, request, pk=None):
request.data["changed_by"] = self.request.user.username
contract_route = get_or_none(ContractRoute, id=pk)
if not isinstance(contract_route, ContractRoute):
return Response({"error": "Contract Route does not exist"}, status=status.HTTP_404_NOT_FOUND)
contract_route_serializer = ContractRouteSerializer(contract_route, data=request.data)
if contract_route_serializer.is_valid():
contract_route_serializer.save()
response = {
"status_code": status.HTTP_202_ACCEPTED,
"status": "Success",
"msg": "Contract Route Updated",
"data": contract_route_serializer.data
}
return Response(data=response, status=status.HTTP_202_ACCEPTED)
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "Error",
"msg": "Contract Route not Updated",
"data": contract_route_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
def partial_update(self, request, pk=None):
request.data["changed_by"] = self.request.user.username
contract_route = get_or_none(ContractRoute, id=pk)
if not isinstance(contract_route, ContractRoute):
return Response({"error": "Contract Route does not exist"}, status=status.HTTP_404_NOT_FOUND)
contract_route_serializer = ContractRouteSerializer(
instance=contract_route,
data=request.data,
partial=True
)
if contract_route_serializer.is_valid():
contract_route_serializer.save()
response = {
"status_code": status.HTTP_202_ACCEPTED,
"status": "Success",
"msg": "Contract Route Updated",
"data": contract_route_serializer.data
}
return Response(data=response, status=status.HTTP_202_ACCEPTED)
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "Error",
"msg": "Contract Route not Updated",
"data": contract_route_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
def retrieve(self, request, pk=None):
contract_route = get_or_none(ContractRoute, id=pk)
if isinstance(contract_route, ContractRoute):
contract_route_serializer = ContractRouteSerializer(contract_route)
return Response(contract_route_serializer.data, status=status.HTTP_200_OK)
return Response({"error": "Contract Route does not exist"}, status=status.HTTP_404_NOT_FOUND)
class ContactDetailsListView(generics.ListAPIView):
queryset = ContactDetails.objects.order_by('-id').exclude(deleted=True)
serializer_class = ContactDetailsSerializer
filter_backends = (filters.SearchFilter, filters.OrderingFilter, DjangoFilterBackend)
filter_class = ContactDetailsFilter
search_fields = ('sme__name__username', 'id', 'type', 'name', 'phone', 'email', 'designation', 'status')
def list(self, request, *args, **kwargs):
queryset = self.filter_queryset(self.get_queryset())
data = {"status": "Successfull", "status_code": status.HTTP_200_OK, "msg": "Broker List"}
page = self.paginate_queryset(queryset)
if page is not None:
serializer = self.get_serializer(page, many=True)
data["data"] = serializer.data
return self.get_paginated_response(data)
serializer = self.get_serializer(queryset, many=True)
data["data"] = serializer.data
return Response(data)
class ContactDetailsViewSet(viewsets.ViewSet):
"""
API for CRUP operation on Contact Details
"""
def create(self, request):
request.data["created_by"] = self.request.user.username
request.data["changed_by"] = self.request.user.username
contact_details_serializer = ContactDetailsSerializer(data=request.data)
if contact_details_serializer.is_valid():
contact_details_serializer.save()
response = {
"status_code": status.HTTP_201_CREATED,
"status": "Success",
"msg": "Contact Details Created",
"data": contact_details_serializer.data
}
return Response(data=response, status=status.HTTP_201_CREATED)
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "Error",
"msg": "Contact Details not Created",
"data": contact_details_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
def update(self, request, pk=None):
request.data["changed_by"] = self.request.user.username
contact_details = get_or_none(ContactDetails, id=pk)
if not isinstance(contact_details, ContactDetails):
return Response({"error": "Contact Details does not exist"}, status=status.HTTP_404_NOT_FOUND)
contact_details_serializer = ContactDetailsSerializer(contact_details, data=request.data)
if contact_details_serializer.is_valid():
contact_details_serializer.save()
response = {
"status_code": status.HTTP_202_ACCEPTED,
"status": "Success",
"msg": "Contact Details Updated",
"data": contact_details_serializer.data
}
return Response(data=response, status=status.HTTP_202_ACCEPTED)
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "Error",
"msg": "Contact Details not Updated",
"data": contact_details_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
def partial_update(self, request, pk=None):
request.data["changed_by"] = self.request.user.username
contact_details = get_or_none(ContactDetails, id=pk)
if not isinstance(contact_details, ContactDetails):
return Response({"error": "Contact Details does not exist"}, status=status.HTTP_404_NOT_FOUND)
contact_details_serializer = ContactDetailsSerializer(
instance=contact_details,
data=request.data,
partial=True
)
if contact_details_serializer.is_valid():
contact_details_serializer.save()
response = {
"status_code": status.HTTP_202_ACCEPTED,
"status": "Success",
"msg": "Contact Details Updated",
"data": contact_details_serializer.data
}
return Response(data=response, status=status.HTTP_202_ACCEPTED)
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "Error",
"msg": "Contact Details not Updated",
"data": contact_details_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
def retrieve(self, request, pk=None):
contact_details = get_or_none(ContactDetails, id=pk)
if isinstance(contact_details, ContactDetails):
contact_details_serializer = ContactDetailsSerializer(contact_details)
return Response(contact_details_serializer.data, status=status.HTTP_200_OK)
return Response({"error": "Contact Details does not exist"}, status=status.HTTP_404_NOT_FOUND)
class LocationListView(generics.ListAPIView):
queryset = Location.objects.order_by('-id').exclude(deleted=True)
serializer_class = LocationSerializer
filter_backends = (filters.SearchFilter, filters.OrderingFilter, DjangoFilterBackend)
filter_class = LocationFilter
search_fields = (
'sme__name__username', 'sme__company_code', 'id', 'type', 'contact__name', 'address', 'city__name', 'material',
'status')
def list(self, request, *args, **kwargs):
queryset = self.filter_queryset(self.get_queryset())
data = {"status": "Successfull", "status_code": status.HTTP_200_OK, "msg": "Broker List"}
page = self.paginate_queryset(queryset)
if page is not None:
serializer = self.get_serializer(page, many=True)
data["data"] = serializer.data
return self.get_paginated_response(data)
serializer = self.get_serializer(queryset, many=True)
data["data"] = serializer.data
return Response(data)
class LocationViewSet(viewsets.ViewSet):
"""
API for CRUP operation on Location
"""
def create(self, request):
request.data["created_by"] = self.request.user.username
request.data["changed_by"] = self.request.user.username
location_serializer = LocationSerializer(data=request.data)
if location_serializer.is_valid():
location_serializer.save()
response = {
"status_code": status.HTTP_201_CREATED,
"status": "Success",
"msg": "Location Created",
"data": location_serializer.data
}
return Response(data=response, status=status.HTTP_201_CREATED)
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "Error",
"msg": "Location not Created",
"data": location_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
def update(self, request, pk=None):
request.data["changed_by"] = self.request.user.username
location = get_or_none(Location, id=pk)
if not isinstance(location, Location):
return Response({"error": "Location does not exist"}, status=status.HTTP_404_NOT_FOUND)
location_serializer = LocationSerializer(location, data=request.data)
if location_serializer.is_valid():
location_serializer.save()
response = {
"status_code": status.HTTP_202_ACCEPTED,
"status": "Success",
"msg": "Location Updated",
"data": location_serializer.data
}
return Response(data=response, status=status.HTTP_202_ACCEPTED)
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "Error",
"msg": "Location not Updated",
"data": location_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
def partial_update(self, request, pk=None):
request.data["changed_by"] = self.request.user.username
location = get_or_none(Location, id=pk)
if not isinstance(location, Location):
return Response({"error": "Location does not exist"}, status=status.HTTP_404_NOT_FOUND)
location_serializer = LocationSerializer(
instance=location,
data=request.data,
partial=True
)
if location_serializer.is_valid():
location_serializer.save()
response = {
"status_code": status.HTTP_202_ACCEPTED,
"status": "Success",
"msg": "Location Updated",
"data": location_serializer.data
}
return Response(data=response, status=status.HTTP_202_ACCEPTED)
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "Error",
"msg": "Location not Updated",
"data": location_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
def retrieve(self, request, pk=None):
location = get_or_none(Location, id=pk)
if isinstance(location, Location):
location_serializer = LocationSerializer(location)
return Response(location_serializer.data, status=status.HTTP_200_OK)
return Response({"error": "Location does not exist"}, status=status.HTTP_404_NOT_FOUND)
class ConsignorConsigneeListView(generics.ListAPIView):
queryset = ConsignorConsignee.objects.order_by('-id').exclude(deleted=True)
serializer_class = ConsignorConsigneeSerializer
filter_backends = (filters.SearchFilter, filters.OrderingFilter, DjangoFilterBackend)
filter_class = ConsignorConsigneeFilter
search_fields = (
'sme__name__username', 'sme__company_code', 'id', 'type', 'pin', 'address', 'city__name', 'phone', 'tax_id',
'status')
def list(self, request, *args, **kwargs):
queryset = self.filter_queryset(self.get_queryset())
data = {"status": "Successfull", "status_code": status.HTTP_200_OK, "msg": "Broker List"}
page = self.paginate_queryset(queryset)
if page is not None:
serializer = self.get_serializer(page, many=True)
data["data"] = serializer.data
return self.get_paginated_response(data)
serializer = self.get_serializer(queryset, many=True)
data["data"] = serializer.data
return Response(data)
class ConsignorConsigneeViewSet(viewsets.ViewSet):
"""
API for CRUP operation on ConsignorConsignee
"""
def create(self, request):
request.data["created_by"] = self.request.user.username
request.data["changed_by"] = self.request.user.username
consignor_consignee_serializer = ConsignorConsigneeSerializer(data=request.data)
if consignor_consignee_serializer.is_valid():
consignor_consignee_serializer.save()
response = {
"status_code": status.HTTP_201_CREATED,
"status": "Success",
"msg": "ConsignorConsignee Created",
"data": consignor_consignee_serializer.data
}
return Response(data=response, status=status.HTTP_201_CREATED)
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "Error",
"msg": "ConsignorConsignee not Created",
"data": consignor_consignee_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
def update(self, request, pk=None):
request.data["changed_by"] = self.request.user.username
consignor_consignee = get_or_none(ConsignorConsignee, id=pk)
if not isinstance(consignor_consignee, ConsignorConsignee):
return Response({"error": "ConsignorConsignee does not exist"}, status=status.HTTP_404_NOT_FOUND)
consignor_consignee_serializer = ConsignorConsigneeSerializer(consignor_consignee, data=request.data)
if consignor_consignee_serializer.is_valid():
consignor_consignee_serializer.save()
response = {
"status_code": status.HTTP_202_ACCEPTED,
"status": "Success",
"msg": "ConsignorConsignee Updated",
"data": consignor_consignee_serializer.data
}
return Response(data=response, status=status.HTTP_202_ACCEPTED)
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "Error",
"msg": "ConsignorConsignee not Updated",
"data": consignor_consignee_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
def partial_update(self, request, pk=None):
request.data["changed_by"] = self.request.user.username
consignor_consignee = get_or_none(ConsignorConsignee, id=pk)
if not isinstance(consignor_consignee, ConsignorConsignee):
return Response({"error": "ConsignorConsignee does not exist"}, status=status.HTTP_404_NOT_FOUND)
consignor_consignee_serializer = ConsignorConsigneeSerializer(
instance=consignor_consignee,
data=request.data,
partial=True
)
if consignor_consignee_serializer.is_valid():
consignor_consignee_serializer.save()
response = {
"status_code": status.HTTP_202_ACCEPTED,
"status": "Success",
"msg": "ConsignorConsignee Updated",
"data": consignor_consignee_serializer.data
}
return Response(data=response, status=status.HTTP_202_ACCEPTED)
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "Error",
"msg": "ConsignorConsignee not Updated",
"data": consignor_consignee_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
def retrieve(self, request, pk=None):
consignor_consignee = get_or_none(ConsignorConsignee, id=pk)
if isinstance(consignor_consignee, ConsignorConsignee):
consignor_consignee_serializer = ConsignorConsigneeSerializer(consignor_consignee)
return Response(consignor_consignee_serializer.data, status=status.HTTP_200_OK)
return Response({"error": "ConsignorConsignee does not exist"}, status=status.HTTP_404_NOT_FOUND)
class PreferredVehicleListView(generics.ListAPIView):
queryset = PreferredVehicle.objects.order_by('-id').exclude(deleted=True)
serializer_class = PreferredVehicleSerializer
filter_backends = (filters.SearchFilter, filters.OrderingFilter, DjangoFilterBackend)
filter_class = PreferredVehicleFilter
search_fields = (
'sme__name__username', 'sme__company_code', 'id', 'category__vehicle_type', 'category__truck_body_type',
'created_by__username'
)
def list(self, request, *args, **kwargs):
queryset = self.filter_queryset(self.get_queryset())
data = {"status": "Successfull", "status_code": status.HTTP_200_OK, "msg": "Broker List"}
page = self.paginate_queryset(queryset)
if page is not None:
serializer = self.get_serializer(page, many=True)
data["data"] = serializer.data
return self.get_paginated_response(data)
serializer = self.get_serializer(queryset, many=True)
data["data"] = serializer.data
return Response(data)
class PreferredVehicleViewSet(viewsets.ViewSet):
"""
API for CRUP operation on Preferred Vehicle
"""
def create(self, request):
request.data["created_by"] = self.request.user.username
request.data["changed_by"] = self.request.user.username
preferred_vehicle_serializer = PreferredVehicleSerializer(data=request.data)
if preferred_vehicle_serializer.is_valid():
preferred_vehicle_serializer.save()
response = {
"status_code": status.HTTP_201_CREATED,
"status": "Success",
"msg": "Preferred Vehicle Created",
"data": preferred_vehicle_serializer.data
}
return Response(data=response, status=status.HTTP_201_CREATED)
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "Error",
"msg": "Preferred Vehicle not Created",
"data": preferred_vehicle_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
def update(self, request, pk=None):
request.data["changed_by"] = self.request.user.username
preferred_vehicle = get_or_none(PreferredVehicle, id=pk)
if not isinstance(preferred_vehicle, PreferredVehicle):
return Response({"error": "Preferred Vehicle does not exist"}, status=status.HTTP_404_NOT_FOUND)
preferred_vehicle_serializer = PreferredVehicleSerializer(preferred_vehicle, data=request.data)
if preferred_vehicle_serializer.is_valid():
preferred_vehicle_serializer.save()
response = {
"status_code": status.HTTP_202_ACCEPTED,
"status": "Success",
"msg": "Preferred Vehicle Updated",
"data": preferred_vehicle_serializer.data
}
return Response(data=response, status=status.HTTP_202_ACCEPTED)
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "Error",
"msg": "Preferred Vehicle not Updated",
"data": preferred_vehicle_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
def partial_update(self, request, pk=None):
request.data["changed_by"] = self.request.user.username
preferred_vehicle = get_or_none(PreferredVehicle, id=pk)
if not isinstance(preferred_vehicle, PreferredVehicle):
return Response({"error": "Preferred Vehicle does not exist"}, status=status.HTTP_404_NOT_FOUND)
preferred_vehicle_serializer = PreferredVehicleSerializer(
instance=preferred_vehicle,
data=request.data,
partial=True
)
if preferred_vehicle_serializer.is_valid():
preferred_vehicle_serializer.save()
response = {
"status_code": status.HTTP_202_ACCEPTED,
"status": "Success",
"msg": "Preferred Vehicle Updated",
"data": preferred_vehicle_serializer.data
}
return Response(data=response, status=status.HTTP_202_ACCEPTED)
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "Error",
"msg": "Preferred Vehicle not Updated",
"data": preferred_vehicle_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
def retrieve(self, request, pk=None):
preferred_vehicle = get_or_none(PreferredVehicle, id=pk)
if isinstance(preferred_vehicle, PreferredVehicle):
preferred_vehicle_serializer = PreferredVehicleSerializer(preferred_vehicle)
return Response(preferred_vehicle_serializer.data, status=status.HTTP_200_OK)
return Response({"error": "Preferred Vehicle does not exist"}, status=status.HTTP_404_NOT_FOUND)
class SmeEnquiryViewSet(viewsets.ViewSet):
"""
API for CRUP operation on SmeEnquiry
"""
def create(self, request):
request.data["created_by"] = self.request.user.username
request.data["changed_by"] = self.request.user.username
sme = get_or_none(Sme, name=request.user)
if not isinstance(sme, Sme):
return error_response(status=status.HTTP_400_BAD_REQUEST, msg="Customer Does not exists", data={})
request.data['sme'] = sme.id
sme_enquiry_serializer = SmeEnquirySerializer(data=request.data)
if sme_enquiry_serializer.is_valid():
sme_enquiry_serializer.save()
response = {
"status_code": status.HTTP_201_CREATED,
"status": "Success",
"msg": "SmeEnquiry Created",
"data": sme_enquiry_serializer.data
}
return Response(data=response, status=status.HTTP_201_CREATED)
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "Error",
"msg": "SmeEnquiry not Created",
"data": sme_enquiry_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
def update(self, request, pk=None):
request.data["changed_by"] = self.request.user.username
sme_enquiry = get_or_none(SmeEnquiry, id=pk)
if not isinstance(sme_enquiry, SmeEnquiry):
return Response({"error": "SmeEnquiry does not exist"}, status=status.HTTP_404_NOT_FOUND)
sme_enquiry_serializer = SmeEnquirySerializer(sme_enquiry, data=request.data)
if sme_enquiry_serializer.is_valid():
sme_enquiry_serializer.save()
response = {
"status_code": status.HTTP_202_ACCEPTED,
"status": "Success",
"msg": "SmeEnquiry Updated",
"data": sme_enquiry_serializer.data
}
return Response(data=response, status=status.HTTP_202_ACCEPTED)
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "Error",
"msg": "SmeEnquiry not Updated",
"data": sme_enquiry_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
def partial_update(self, request, pk=None):
request.data["changed_by"] = self.request.user.username
sme_enquiry = get_or_none(SmeEnquiry, id=pk)
if not isinstance(sme_enquiry, SmeEnquiry):
return Response({"error": "SmeEnquiry does not exist"}, status=status.HTTP_404_NOT_FOUND)
sme_enquiry_serializer = SmeEnquirySerializer(
instance=sme_enquiry,
data=request.data,
partial=True
)
if sme_enquiry_serializer.is_valid():
sme_enquiry_serializer.save()
response = {
"status_code": status.HTTP_202_ACCEPTED,
"status": "Success",
"msg": "SmeEnquiry Updated",
"data": sme_enquiry_serializer.data
}
return Response(data=response, status=status.HTTP_202_ACCEPTED)
response = {
"status_code": status.HTTP_400_BAD_REQUEST,
"status": "Error",
"msg": "SmeEnquiry not Updated",
"data": sme_enquiry_serializer.errors
}
return Response(data=response, status=status.HTTP_400_BAD_REQUEST)
def retrieve(self, request, pk=None):
sme_enquiry = get_or_none(SmeEnquiry, id=pk)
if isinstance(sme_enquiry, SmeEnquiry):
sme_enquiry_serializer = SmeEnquirySerializer(sme_enquiry)
return Response(sme_enquiry_serializer.data, status=status.HTTP_200_OK)
return Response({"error": "SmeEnquiry does not exist"}, status=status.HTTP_404_NOT_FOUND)
| 46.870149
| 192
| 0.636468
| 6,564
| 62,806
| 5.823126
| 0.051188
| 0.046569
| 0.046464
| 0.035057
| 0.772964
| 0.753604
| 0.726238
| 0.709154
| 0.695602
| 0.654083
| 0
| 0.011992
| 0.265771
| 62,806
| 1,339
| 193
| 46.905153
| 0.816889
| 0.024695
| 0
| 0.640141
| 0
| 0
| 0.118856
| 0.008568
| 0
| 0
| 0
| 0
| 0
| 1
| 0.049514
| false
| 0.001768
| 0.023873
| 0.000884
| 0.260831
| 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
|
0ea88ce3938673111d61cc9c6f8e546e59e2eb57
| 90
|
py
|
Python
|
api/drivers/admin.py
|
AlohaLATAM/alohaweb1.0
|
aa2c5cba5e04c6716731e4e4f3d5683ec2a579b1
|
[
"MIT"
] | null | null | null |
api/drivers/admin.py
|
AlohaLATAM/alohaweb1.0
|
aa2c5cba5e04c6716731e4e4f3d5683ec2a579b1
|
[
"MIT"
] | 2
|
2020-06-05T19:16:17.000Z
|
2021-06-10T20:54:31.000Z
|
api/drivers/admin.py
|
AlohaLATAM/alohaweb1.0
|
aa2c5cba5e04c6716731e4e4f3d5683ec2a579b1
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from . models import Driver
admin.site.register(Driver)
| 18
| 32
| 0.811111
| 13
| 90
| 5.615385
| 0.692308
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.122222
| 90
| 5
| 33
| 18
| 0.924051
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
7ee211845a39904f9428405c6803c874a443659d
| 176
|
py
|
Python
|
groups/forms.py
|
UmarSyal/port_proj--social
|
f7fd04f20dec37ac4f3b686975443e2ff87c7264
|
[
"MIT"
] | null | null | null |
groups/forms.py
|
UmarSyal/port_proj--social
|
f7fd04f20dec37ac4f3b686975443e2ff87c7264
|
[
"MIT"
] | null | null | null |
groups/forms.py
|
UmarSyal/port_proj--social
|
f7fd04f20dec37ac4f3b686975443e2ff87c7264
|
[
"MIT"
] | null | null | null |
from django import forms
from groups.models import Group
class GroupForm(forms.ModelForm):
class Meta:
model = Group
fields = ('name', 'description',)
| 22
| 41
| 0.659091
| 20
| 176
| 5.8
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.25
| 176
| 8
| 41
| 22
| 0.878788
| 0
| 0
| 0
| 0
| 0
| 0.084746
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 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
|
7ef6d71e1a097d86495b6111bf30fdd792c38b2f
| 453
|
py
|
Python
|
Computer science/Programming languages/Python/Basics/Modules and packages/How to read the documentation/A little about strings/exercise.py
|
chanchanchong/PYTHON-TRACK-IN-HYPERSKILL
|
462fe08ff4a2b183fd45a0235ab1ec7a788bd54c
|
[
"MIT"
] | null | null | null |
Computer science/Programming languages/Python/Basics/Modules and packages/How to read the documentation/A little about strings/exercise.py
|
chanchanchong/PYTHON-TRACK-IN-HYPERSKILL
|
462fe08ff4a2b183fd45a0235ab1ec7a788bd54c
|
[
"MIT"
] | null | null | null |
Computer science/Programming languages/Python/Basics/Modules and packages/How to read the documentation/A little about strings/exercise.py
|
chanchanchong/PYTHON-TRACK-IN-HYPERSKILL
|
462fe08ff4a2b183fd45a0235ab1ec7a788bd54c
|
[
"MIT"
] | null | null | null |
# A little about strings
# Often programmers face a problem that can be solved by
# analogy. You are already familiar with the string data type,
# Now you need to study the relevant section of the
# documentation about strings to solve this problem. In the
# documentation you will find the necessary similar examples.
# Your task is correct the code so that the output would be the
# following:
print(r"It isn`t in the section 'C:\some\name_of_file'")
| 45.3
| 63
| 0.774834
| 78
| 453
| 4.474359
| 0.730769
| 0.068768
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.174393
| 453
| 10
| 64
| 45.3
| 0.933155
| 0.836645
| 0
| 0
| 0
| 0
| 0.69697
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
7d02cb0909bb95680ad7440947dff96f41448e9c
| 360
|
py
|
Python
|
serialisables.py
|
thatfuckingbird/hydrus-websocket-server
|
b55454740dca5101448bf92224432f8bdbec7e77
|
[
"WTFPL"
] | null | null | null |
serialisables.py
|
thatfuckingbird/hydrus-websocket-server
|
b55454740dca5101448bf92224432f8bdbec7e77
|
[
"WTFPL"
] | null | null | null |
serialisables.py
|
thatfuckingbird/hydrus-websocket-server
|
b55454740dca5101448bf92224432f8bdbec7e77
|
[
"WTFPL"
] | null | null | null |
# SerialisableBase
# GetSerialisableTuple
#( self.SERIALISABLE_TYPE, self.SERIALISABLE_VERSION, serialisable_info )
# SerialisableBaseNamed
#( self.SERIALISABLE_TYPE, self._name, self.SERIALISABLE_VERSION, self._GetSerialisableInfo() )
#from hydrus.core import HydrusSerialisable
#SERIALISABLE_TYPE_
#from hydrus.client import ClientSearch
#PREDICATE_TYPE_
| 27.692308
| 95
| 0.838889
| 35
| 360
| 8.314286
| 0.514286
| 0.219931
| 0.137457
| 0.164948
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.083333
| 360
| 12
| 96
| 30
| 0.881818
| 0.938889
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 0
| 0
| 0
| null | 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
7d1034b7e657d407a151f76b6fbe235bb4ab8da1
| 113
|
py
|
Python
|
scripts/tcutils/pkgs/Traffic/traffic/__init__.py
|
rombie/contrail-test
|
a68c71d6f282142501a7e2e889bbb232fdd82dc3
|
[
"Apache-2.0"
] | 5
|
2020-09-29T00:36:57.000Z
|
2022-02-16T06:51:32.000Z
|
tcutils/pkgs/Traffic/traffic/__init__.py
|
vkolli/contrail-test-perf
|
db04b8924a2c330baabe3059788b149d957a7d67
|
[
"Apache-2.0"
] | 27
|
2019-11-02T02:18:34.000Z
|
2022-02-24T18:49:08.000Z
|
tcutils/pkgs/Traffic/traffic/__init__.py
|
vkolli/contrail-test-perf
|
db04b8924a2c330baabe3059788b149d957a7d67
|
[
"Apache-2.0"
] | 20
|
2019-11-28T16:02:25.000Z
|
2022-01-06T05:56:58.000Z
|
"""Traffic generator package using scapy
Scapy Documentation: http://www.secdev.org/projects/scapy/doc/
"""
| 18.833333
| 65
| 0.734513
| 14
| 113
| 5.928571
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.123894
| 113
| 5
| 66
| 22.6
| 0.838384
| 0.893805
| 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
|
7d28538e854bdc0d87eb91236a58d00dfc0cea03
| 99
|
py
|
Python
|
grimm/admin/__init__.py
|
SincerelyUnique/grimm-backend
|
1536d92a90fcffb7703f2a1c7205e2b871398ec2
|
[
"MIT"
] | 1
|
2021-06-09T03:51:01.000Z
|
2021-06-09T03:51:01.000Z
|
grimm/admin/__init__.py
|
SincerelyUnique/grimm-backend
|
1536d92a90fcffb7703f2a1c7205e2b871398ec2
|
[
"MIT"
] | null | null | null |
grimm/admin/__init__.py
|
SincerelyUnique/grimm-backend
|
1536d92a90fcffb7703f2a1c7205e2b871398ec2
|
[
"MIT"
] | null | null | null |
from flask_restx import Namespace
admin = Namespace('Admin', 'Admin API and User API.', path='/')
| 24.75
| 63
| 0.717172
| 14
| 99
| 5
| 0.714286
| 0.4
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.141414
| 99
| 3
| 64
| 33
| 0.823529
| 0
| 0
| 0
| 0
| 0
| 0.292929
| 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
|
7d3635e925a087d819304eea6f01c589546bd6d7
| 87
|
py
|
Python
|
akshitha.py
|
akshithagu76/fossotober
|
4c0095dd03520db5a3d87f7f4fcba5ac0eb7396b
|
[
"MIT"
] | null | null | null |
akshitha.py
|
akshithagu76/fossotober
|
4c0095dd03520db5a3d87f7f4fcba5ac0eb7396b
|
[
"MIT"
] | null | null | null |
akshitha.py
|
akshithagu76/fossotober
|
4c0095dd03520db5a3d87f7f4fcba5ac0eb7396b
|
[
"MIT"
] | null | null | null |
print("Akshitha Sai");
print("AM.EN.U4CSE18122");
print("CSE");
print("marvel rocks");
| 17.4
| 26
| 0.678161
| 12
| 87
| 4.916667
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.074074
| 0.068966
| 87
| 4
| 27
| 21.75
| 0.654321
| 0
| 0
| 0
| 0
| 0
| 0.494253
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
7d46614a0e0ffc297dc514d701ff27bd39fed449
| 2,012
|
py
|
Python
|
ticketshop/ticketapp/tests/test_emails.py
|
gdetrez/fscons-ticketshop
|
a237339748dfdcef1b1b6e84cfc3342ce2dea8cd
|
[
"MIT"
] | null | null | null |
ticketshop/ticketapp/tests/test_emails.py
|
gdetrez/fscons-ticketshop
|
a237339748dfdcef1b1b6e84cfc3342ce2dea8cd
|
[
"MIT"
] | null | null | null |
ticketshop/ticketapp/tests/test_emails.py
|
gdetrez/fscons-ticketshop
|
a237339748dfdcef1b1b6e84cfc3342ce2dea8cd
|
[
"MIT"
] | null | null | null |
import re
from django.test import TestCase
from django.core import mail
from ticketapp.models import TicketPurchase, TicketType
#
#class ConfirmationEmailTest(TestCase):
#
# def setUp(self):
# """
# Create a purchase object and mark it as paid,
# which should trigger the sending of an email
# """
# t = TicketType.objects.create(
# name='Super hero ticket', price='1337' )
# p = TicketPurchase.objects.create(
# name="Batman", email="batman@gotham.gov" )
# p.ticket_set.create( name = "Batman", ticket_type = t )
# p.ticket_set.create( name = "Robin", ticket_type = t )
# p.mark_as_paid()
#
# def test_anEmailIsSend(self):
# """
# Test that an email has been send
# """
# # Test that one message has been sent.
# self.assertEqual(len(mail.outbox), 1)
#
# def test_subjectIs(self):
# """
# Email's subject should be 'Registration confirmation'
# """
# self.assertEqual("Registration confirmation", mail.outbox[0].subject)
#
# def test_fromEmail(self):
# """
# Email should be from 'FSCONS <info@fscons.org>'
# """
# self.assertEqual(
# "FSCONS <info@fscons.org>",
# mail.outbox[0].from_email)
#
# def test_toEmail(self):
# """
# Email should be to the purchase contact info
# """
# to = [ "Batman <batman@gotham.gov>" ]
# self.assertEqual( to, mail.outbox[0].recipients())
#
# def test_body(self):
# """
# Test email body
# """
# self.assertRegexpMatches( mail.outbox[0].body,
# re.compile( "Dear Batman,", flags=re.MULTILINE ) )
# self.assertRegexpMatches( mail.outbox[0].body,
# re.compile( "^Batman \(Super hero ticket\)", re.MULTILINE ) )
# self.assertRegexpMatches( mail.outbox[0].body,
# re.compile( "^Robin \(Super hero ticket\)", re.MULTILINE ) )
| 32.451613
| 78
| 0.570577
| 221
| 2,012
| 5.140271
| 0.371041
| 0.06162
| 0.058099
| 0.087148
| 0.214789
| 0.143486
| 0.143486
| 0.143486
| 0.102113
| 0.102113
| 0
| 0.007698
| 0.289761
| 2,012
| 61
| 79
| 32.983607
| 0.787264
| 0.880716
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
7d4c96d5e53a963c7fcb6c60dc78ea687f3f3423
| 203
|
py
|
Python
|
python/logging/simple/log.py
|
bosserbosser/codetest
|
987563900d912e891b53eeda8e2cf36f3c769430
|
[
"Apache-2.0"
] | null | null | null |
python/logging/simple/log.py
|
bosserbosser/codetest
|
987563900d912e891b53eeda8e2cf36f3c769430
|
[
"Apache-2.0"
] | null | null | null |
python/logging/simple/log.py
|
bosserbosser/codetest
|
987563900d912e891b53eeda8e2cf36f3c769430
|
[
"Apache-2.0"
] | null | null | null |
#!/usr/bin/env python
import logging
logging.debug('this is deb')
logging.info('this is inf')
logging.warning('this is war')
logging.error('this is err')
logging.log(logging.INFO, 'this is inf too')
| 16.916667
| 44
| 0.719212
| 34
| 203
| 4.294118
| 0.529412
| 0.205479
| 0.205479
| 0.232877
| 0.273973
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.123153
| 203
| 11
| 45
| 18.454545
| 0.820225
| 0.098522
| 0
| 0
| 0
| 0
| 0.325967
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.166667
| 0
| 0.166667
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
ada7edb007b7032b31582de84784d369575c9c37
| 156
|
py
|
Python
|
test/native/github-actions/password_native.py
|
hugovk/pg8000
|
6dae73131c3a676d29a54ed027e917834a4e7cba
|
[
"BSD-3-Clause"
] | 337
|
2019-01-24T18:35:53.000Z
|
2022-03-29T12:06:36.000Z
|
test/native/github-actions/password_native.py
|
hugovk/pg8000
|
6dae73131c3a676d29a54ed027e917834a4e7cba
|
[
"BSD-3-Clause"
] | 94
|
2016-03-03T21:20:38.000Z
|
2022-03-02T19:37:04.000Z
|
test/native/github-actions/password_native.py
|
hugovk/pg8000
|
6dae73131c3a676d29a54ed027e917834a4e7cba
|
[
"BSD-3-Clause"
] | 27
|
2019-02-03T01:14:43.000Z
|
2021-11-14T12:19:35.000Z
|
def test_password(con):
"""Called by GitHub Actions with auth method password.
We just need to check that we can get a connection.
"""
pass
| 26
| 58
| 0.679487
| 24
| 156
| 4.375
| 0.916667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.25
| 156
| 5
| 59
| 31.2
| 0.897436
| 0.660256
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 1
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
adb27d8ff4b8f5f6a26a79e8d0fb02fe8d938511
| 375
|
py
|
Python
|
hooks/rthook.py
|
natcap/opal
|
7b960d51344483bae30d14ccfa6004bd550f3737
|
[
"BSD-3-Clause"
] | 1
|
2020-04-15T23:23:27.000Z
|
2020-04-15T23:23:27.000Z
|
hooks/rthook.py
|
natcap/opal
|
7b960d51344483bae30d14ccfa6004bd550f3737
|
[
"BSD-3-Clause"
] | null | null | null |
hooks/rthook.py
|
natcap/opal
|
7b960d51344483bae30d14ccfa6004bd550f3737
|
[
"BSD-3-Clause"
] | null | null | null |
import sys
import os
import multiprocessing
# import adept and static_maps here so that we absolutely guarantee that we're
# going to have access to these packages when palisades needs to do its dynamic
# imports.
import natcap.opal
from natcap.opal import static_maps
multiprocessing.freeze_support()
os.environ['MATPLOTLIBDATA'] = os.path.join(sys._MEIPASS, 'mpl-data')
| 26.785714
| 79
| 0.8
| 57
| 375
| 5.192982
| 0.701754
| 0.067568
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.133333
| 375
| 13
| 80
| 28.846154
| 0.910769
| 0.434667
| 0
| 0
| 0
| 0
| 0.105769
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.142857
| 0.714286
| 0
| 0.714286
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
|
0
| 4
|
adbcb07e2fa96e49d908a160193da7150d50cc53
| 1,119
|
py
|
Python
|
tests/test_q0101.py
|
mirzadm/ctci-5th-py
|
ba2f4de0aba4c7c04d7e0ddf3120ce312d9e5d66
|
[
"MIT"
] | null | null | null |
tests/test_q0101.py
|
mirzadm/ctci-5th-py
|
ba2f4de0aba4c7c04d7e0ddf3120ce312d9e5d66
|
[
"MIT"
] | 1
|
2018-07-04T23:10:20.000Z
|
2018-07-04T23:10:20.000Z
|
tests/test_q0101.py
|
mirzadm/ctci-5th-py
|
ba2f4de0aba4c7c04d7e0ddf3120ce312d9e5d66
|
[
"MIT"
] | null | null | null |
"""Unit tests for q0101.py."""
import unittest
from src.q0101 import (is_all_unique_str as is_unique,
is_all_unique_dict as is_unique_dict,
is_all_unique_set as is_unique_set)
class TestUniqueness(unittest.TestCase):
"""Tests for string, dictionary, and set implementations."""
def test_str(self):
self.assertTrue(is_unique(''))
self.assertTrue(is_unique('a'))
self.assertFalse(is_unique('aa'))
self.assertTrue(is_unique('abc'))
self.assertFalse(is_unique('abb'))
def test_dict(self):
self.assertTrue(is_unique_dict(''))
self.assertTrue(is_unique_dict('a'))
self.assertFalse(is_unique_dict('aa'))
self.assertTrue(is_unique_dict('abc'))
self.assertFalse(is_unique_dict('abb'))
def test_set(self):
self.assertTrue(is_unique_set(''))
self.assertTrue(is_unique_set('a'))
self.assertFalse(is_unique_set('aa'))
self.assertTrue(is_unique_set('abc'))
self.assertFalse(is_unique_set('abb'))
if __name__ == '__main__':
unittest.main()
| 31.083333
| 64
| 0.647006
| 144
| 1,119
| 4.680556
| 0.243056
| 0.21365
| 0.21365
| 0.293769
| 0.562315
| 0
| 0
| 0
| 0
| 0
| 0
| 0.009174
| 0.220733
| 1,119
| 35
| 65
| 31.971429
| 0.763761
| 0.070599
| 0
| 0
| 0
| 0
| 0.034014
| 0
| 0
| 0
| 0
| 0
| 0.6
| 1
| 0.12
| false
| 0
| 0.08
| 0
| 0.24
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
adedeabc33480b4facc7f80d4d94cdca71572fd1
| 21
|
py
|
Python
|
navcomputer/const.py
|
sergei/ottopi
|
1de5202ba1e7757e6acc98b375da6f806f7107fa
|
[
"Apache-2.0"
] | null | null | null |
navcomputer/const.py
|
sergei/ottopi
|
1de5202ba1e7757e6acc98b375da6f806f7107fa
|
[
"Apache-2.0"
] | 19
|
2021-02-24T21:53:33.000Z
|
2022-03-03T07:52:54.000Z
|
navcomputer/const.py
|
sergei/ottopi
|
1de5202ba1e7757e6acc98b375da6f806f7107fa
|
[
"Apache-2.0"
] | null | null | null |
METERS_IN_NM = 1852.
| 10.5
| 20
| 0.761905
| 4
| 21
| 3.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.222222
| 0.142857
| 21
| 1
| 21
| 21
| 0.555556
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 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
|
70aad2e6d449ae4cbc2686a0b8eb726a255deb18
| 175
|
py
|
Python
|
anyfft/reikna/_version.py
|
tlambert03/anyfft
|
2b5fb526fa96d7ed607765383adb8c198f505232
|
[
"BSD-3-Clause"
] | null | null | null |
anyfft/reikna/_version.py
|
tlambert03/anyfft
|
2b5fb526fa96d7ed607765383adb8c198f505232
|
[
"BSD-3-Clause"
] | null | null | null |
anyfft/reikna/_version.py
|
tlambert03/anyfft
|
2b5fb526fa96d7ed607765383adb8c198f505232
|
[
"BSD-3-Clause"
] | null | null | null |
# file generated by setuptools_scm
# don't change, don't track in version control
version = "0.1.dev1+ga7b326d.d20210618"
version_tuple = (0, 1, "dev1+ga7b326d", "d20210618")
| 35
| 52
| 0.742857
| 27
| 175
| 4.740741
| 0.666667
| 0.0625
| 0.09375
| 0.21875
| 0.359375
| 0
| 0
| 0
| 0
| 0
| 0
| 0.196078
| 0.125714
| 175
| 4
| 53
| 43.75
| 0.640523
| 0.44
| 0
| 0
| 1
| 0
| 0.515789
| 0.284211
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
70fcc25d82b7382262dce89687b62c9d3e4c67ac
| 110
|
py
|
Python
|
src/helpers/files_helper.py
|
doriandres/christine-bot-audio
|
d1bed16ae96280c9a8f7eb24522a31a1286bd3ac
|
[
"MIT"
] | null | null | null |
src/helpers/files_helper.py
|
doriandres/christine-bot-audio
|
d1bed16ae96280c9a8f7eb24522a31a1286bd3ac
|
[
"MIT"
] | null | null | null |
src/helpers/files_helper.py
|
doriandres/christine-bot-audio
|
d1bed16ae96280c9a8f7eb24522a31a1286bd3ac
|
[
"MIT"
] | null | null | null |
from os import remove
def clean_files(filename):
remove(f"{filename}.pcm")
remove(f"{filename}.wav")
| 18.333333
| 29
| 0.690909
| 16
| 110
| 4.6875
| 0.6875
| 0.186667
| 0.4
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.154545
| 110
| 5
| 30
| 22
| 0.806452
| 0
| 0
| 0
| 0
| 0
| 0.254545
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
cb14afe6488798b64b920a1133327cfd7a95b573
| 136
|
py
|
Python
|
webscrapbook/resources/app.py
|
vsc55/PyWebScrapBook
|
0d0cb7653a44b7a79b940ffe20b9a2feea0c6227
|
[
"MIT"
] | 39
|
2019-04-10T18:07:40.000Z
|
2022-02-07T07:11:30.000Z
|
webscrapbook/resources/app.py
|
vsc55/PyWebScrapBook
|
0d0cb7653a44b7a79b940ffe20b9a2feea0c6227
|
[
"MIT"
] | 56
|
2019-05-07T23:29:14.000Z
|
2022-02-24T10:33:43.000Z
|
webscrapbook/resources/app.py
|
vsc55/PyWebScrapBook
|
0d0cb7653a44b7a79b940ffe20b9a2feea0c6227
|
[
"MIT"
] | 15
|
2019-06-12T05:16:43.000Z
|
2022-01-16T13:24:11.000Z
|
import os
from webscrapbook.app import make_app
root = os.path.abspath(os.path.join(__file__, '..', '..'))
application = make_app(root)
| 27.2
| 58
| 0.727941
| 20
| 136
| 4.65
| 0.6
| 0.150538
| 0.236559
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.102941
| 136
| 4
| 59
| 34
| 0.762295
| 0
| 0
| 0
| 0
| 0
| 0.029412
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
cb206e4e2d1caad9ae6a321f94d0ed5e53766112
| 98
|
py
|
Python
|
Chapter 07/Chap07_Example7.41.py
|
Anancha/Programming-Techniques-using-Python
|
e80c329d2a27383909d358741a5cab03cb22fd8b
|
[
"MIT"
] | null | null | null |
Chapter 07/Chap07_Example7.41.py
|
Anancha/Programming-Techniques-using-Python
|
e80c329d2a27383909d358741a5cab03cb22fd8b
|
[
"MIT"
] | null | null | null |
Chapter 07/Chap07_Example7.41.py
|
Anancha/Programming-Techniques-using-Python
|
e80c329d2a27383909d358741a5cab03cb22fd8b
|
[
"MIT"
] | null | null | null |
myl1 = [12,10,38,22]
myl1.sort(reverse = True)
print(myl1)
myl1.sort(reverse = False)
print(myl1)
| 16.333333
| 26
| 0.704082
| 17
| 98
| 4.058824
| 0.588235
| 0.231884
| 0.434783
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.149425
| 0.112245
| 98
| 5
| 27
| 19.6
| 0.643678
| 0
| 0
| 0.4
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 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
|
cb3307f578d7e3a9b589b378ca6680caab23fdc1
| 92
|
py
|
Python
|
tower_app/apps.py
|
CS24-Team-Dream/CS24-BW-MUD
|
da0bda632709e4dc7851c74c77c3a8f8b07d93fb
|
[
"MIT"
] | 1
|
2020-04-10T21:33:57.000Z
|
2020-04-10T21:33:57.000Z
|
tower_app/apps.py
|
CS24-Team-Dream/Pytower
|
da0bda632709e4dc7851c74c77c3a8f8b07d93fb
|
[
"MIT"
] | 6
|
2020-06-05T20:30:20.000Z
|
2021-09-22T18:25:07.000Z
|
tower_app/apps.py
|
ayunas/pytower
|
da0bda632709e4dc7851c74c77c3a8f8b07d93fb
|
[
"MIT"
] | 1
|
2020-01-13T15:24:39.000Z
|
2020-01-13T15:24:39.000Z
|
from django.apps import AppConfig
class TowerAppConfig(AppConfig):
name = 'tower_app'
| 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
|
cb37d946fa649fc578757fc96b595ab57dcd9455
| 99
|
py
|
Python
|
lgmsaccounts/apps.py
|
Shazam14/PythonProjects
|
6f4bc944358668007b2dbe8d6e71b9f7e818a3c0
|
[
"MIT"
] | null | null | null |
lgmsaccounts/apps.py
|
Shazam14/PythonProjects
|
6f4bc944358668007b2dbe8d6e71b9f7e818a3c0
|
[
"MIT"
] | null | null | null |
lgmsaccounts/apps.py
|
Shazam14/PythonProjects
|
6f4bc944358668007b2dbe8d6e71b9f7e818a3c0
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
class LgmsaccountsConfig(AppConfig):
name = 'lgmsaccounts'
| 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
|
cb6a1261c88b37bea150f9ceb966cd8a8845779b
| 77
|
py
|
Python
|
relate/__main__.py
|
inducer/courseflow
|
0f9786e3616dbedf08365d81a731f672b97ba9f5
|
[
"Unlicense"
] | 284
|
2015-01-09T12:02:28.000Z
|
2022-03-27T14:30:46.000Z
|
relate/__main__.py
|
inducer/courseflow
|
0f9786e3616dbedf08365d81a731f672b97ba9f5
|
[
"Unlicense"
] | 799
|
2015-02-26T08:49:46.000Z
|
2022-03-31T16:09:26.000Z
|
relate/__main__.py
|
inducer/courseflow
|
0f9786e3616dbedf08365d81a731f672b97ba9f5
|
[
"Unlicense"
] | 120
|
2015-01-30T18:00:56.000Z
|
2022-03-28T06:24:43.000Z
|
if __name__ == "__main__":
from relate.bin.relate import main
main()
| 19.25
| 38
| 0.662338
| 10
| 77
| 4.3
| 0.7
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.220779
| 77
| 3
| 39
| 25.666667
| 0.716667
| 0
| 0
| 0
| 0
| 0
| 0.103896
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
cba57251297ed1f68262b5d51a05788ab56c9ae3
| 81
|
py
|
Python
|
tests/utils/object_store/__init__.py
|
moinnadeem/composer
|
bc3f41b766bd4450f05a99f44db4a6b3901ea1c8
|
[
"Apache-2.0"
] | 945
|
2021-10-13T16:24:20.000Z
|
2022-03-31T21:21:54.000Z
|
tests/utils/object_store/__init__.py
|
moinnadeem/composer
|
bc3f41b766bd4450f05a99f44db4a6b3901ea1c8
|
[
"Apache-2.0"
] | 544
|
2021-10-13T20:23:27.000Z
|
2022-03-31T02:47:54.000Z
|
tests/utils/object_store/__init__.py
|
moinnadeem/composer
|
bc3f41b766bd4450f05a99f44db4a6b3901ea1c8
|
[
"Apache-2.0"
] | 39
|
2021-10-13T14:33:33.000Z
|
2022-03-31T11:13:19.000Z
|
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0
| 27
| 42
| 0.802469
| 11
| 81
| 5.909091
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.083333
| 0.111111
| 81
| 2
| 43
| 40.5
| 0.819444
| 0.938272
| 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
|
cbbef5b1cd4bd905dc5292a7f1ea1f9b73e1aa21
| 187
|
py
|
Python
|
src/typeDefs/wbesRtmPxiRecord.py
|
dheerajgupta0001/rtm_files_data_ingest
|
7e9ac97686d43f234ddeba8585f495c0d24200a9
|
[
"MIT"
] | null | null | null |
src/typeDefs/wbesRtmPxiRecord.py
|
dheerajgupta0001/rtm_files_data_ingest
|
7e9ac97686d43f234ddeba8585f495c0d24200a9
|
[
"MIT"
] | null | null | null |
src/typeDefs/wbesRtmPxiRecord.py
|
dheerajgupta0001/rtm_files_data_ingest
|
7e9ac97686d43f234ddeba8585f495c0d24200a9
|
[
"MIT"
] | 1
|
2021-03-22T12:48:50.000Z
|
2021-03-22T12:48:50.000Z
|
from typing import TypedDict
import datetime as dt
class IWbesRtmPxiDataRecord(TypedDict):
date_time: dt.datetime
beneficiary: str
beneficiary_type: str
data_val: float
| 18.7
| 39
| 0.764706
| 23
| 187
| 6.086957
| 0.73913
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.192513
| 187
| 9
| 40
| 20.777778
| 0.927152
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.285714
| 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
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.