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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a8d74f3cfb963afbf0326e3a3f7e5bfe03135acd
| 279
|
py
|
Python
|
appmgmt/views/__init__.py
|
ekivemark/BlueButtonDev
|
c751a5c52a83df6b97ef2c653a4492d959610c42
|
[
"Apache-2.0"
] | 5
|
2016-03-02T23:25:39.000Z
|
2020-10-29T07:28:42.000Z
|
appmgmt/views/__init__.py
|
HowardEdidin/BlueButtonFHIR_API
|
b8433055507bcc334f70bc864eacd379a04f69db
|
[
"Apache-2.0"
] | 13
|
2020-02-11T22:50:32.000Z
|
2022-03-11T23:12:48.000Z
|
appmgmt/views/__init__.py
|
HowardEdidin/BlueButtonFHIR_API
|
b8433055507bcc334f70bc864eacd379a04f69db
|
[
"Apache-2.0"
] | 4
|
2016-02-02T19:17:24.000Z
|
2020-10-10T16:10:31.000Z
|
# -*- coding: utf-8 -*-
"""
bofhirdev
FILE: __init__.py
Created: 10/29/15 4:11 PM
"""
__author__ = 'Mark Scrimshire:@ekivemark'
from appmgmt.views.application import *
from appmgmt.views.main import *
from appmgmt.views.organization import *
from appmgmt.views.trust import *
| 18.6
| 41
| 0.731183
| 38
| 279
| 5.157895
| 0.684211
| 0.22449
| 0.326531
| 0.336735
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.041322
| 0.132616
| 279
| 14
| 42
| 19.928571
| 0.768595
| 0.272401
| 0
| 0
| 0
| 0
| 0.134715
| 0.108808
| 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
| 1
| 0
|
0
| 5
|
7682d4d3aded2670b2fbac760968aaa98452be92
| 103
|
py
|
Python
|
models/pre_reqs.py
|
andehwong/taylor_stacks
|
9301c53286cc8c6f8ced1eefd597456702f337f1
|
[
"MIT"
] | null | null | null |
models/pre_reqs.py
|
andehwong/taylor_stacks
|
9301c53286cc8c6f8ced1eefd597456702f337f1
|
[
"MIT"
] | null | null | null |
models/pre_reqs.py
|
andehwong/taylor_stacks
|
9301c53286cc8c6f8ced1eefd597456702f337f1
|
[
"MIT"
] | null | null | null |
class PreRequisites:
def __init__(self, course_list=None):
self.course_list = course_list
| 20.6
| 41
| 0.718447
| 13
| 103
| 5.153846
| 0.615385
| 0.447761
| 0.41791
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.203884
| 103
| 4
| 42
| 25.75
| 0.817073
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
4f455cbb4559a570b24a34bef3ea606a40bbb2ab
| 116
|
py
|
Python
|
MovieRecommend/movieviewer/admin.py
|
tyanakiev/MovieRecommend
|
869613bdb5e9b1f869fe89382316f11a7a7c4352
|
[
"MIT"
] | null | null | null |
MovieRecommend/movieviewer/admin.py
|
tyanakiev/MovieRecommend
|
869613bdb5e9b1f869fe89382316f11a7a7c4352
|
[
"MIT"
] | null | null | null |
MovieRecommend/movieviewer/admin.py
|
tyanakiev/MovieRecommend
|
869613bdb5e9b1f869fe89382316f11a7a7c4352
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
# Register your models here.
from .models import Movie
admin.site.register(Movie)
| 19.333333
| 32
| 0.801724
| 17
| 116
| 5.470588
| 0.647059
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.12931
| 116
| 5
| 33
| 23.2
| 0.920792
| 0.224138
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
4f75033b6adbbb71564cf2822fd11416bc1836e0
| 38
|
py
|
Python
|
setup.py
|
makotookamura/GmoCoin
|
025d3e68364bf52418dbc3445987ff21528db732
|
[
"Apache-2.0"
] | 5
|
2020-05-06T13:02:12.000Z
|
2020-11-06T04:11:45.000Z
|
setup.py
|
makotookamura/GmoCoin
|
025d3e68364bf52418dbc3445987ff21528db732
|
[
"Apache-2.0"
] | 44
|
2020-11-15T01:17:38.000Z
|
2021-07-20T13:45:12.000Z
|
setup.py
|
makotookamura/GmoCoin
|
025d3e68364bf52418dbc3445987ff21528db732
|
[
"Apache-2.0"
] | 1
|
2022-02-20T22:18:38.000Z
|
2022-02-20T22:18:38.000Z
|
from setuptools import setup
setup()
| 9.5
| 28
| 0.789474
| 5
| 38
| 6
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.157895
| 38
| 4
| 29
| 9.5
| 0.9375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
4f8ae2ee6cd56d54ef4f2b985fb576cfb1c0b3d7
| 42
|
py
|
Python
|
DBus.py
|
whitelynx/karvy
|
e380a19ace60168b374855ea1ee9c347936b67fe
|
[
"MIT"
] | 3
|
2020-04-19T19:56:18.000Z
|
2021-09-30T03:07:42.000Z
|
DBus.py
|
whitelynx/karvy
|
e380a19ace60168b374855ea1ee9c347936b67fe
|
[
"MIT"
] | null | null | null |
DBus.py
|
whitelynx/karvy
|
e380a19ace60168b374855ea1ee9c347936b67fe
|
[
"MIT"
] | 1
|
2020-10-27T13:43:38.000Z
|
2020-10-27T13:43:38.000Z
|
import dbus
systemBus = dbus.SystemBus()
| 10.5
| 28
| 0.761905
| 5
| 42
| 6.4
| 0.6
| 0.8125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.142857
| 42
| 3
| 29
| 14
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
4fa39d40604d714fbf43d4c73891cfb2c040641c
| 85
|
py
|
Python
|
src/impscan/conda_meta/__init__.py
|
lmmx/impscan
|
fd809f9f32302e3b67bc921164f34fdd837cf92b
|
[
"MIT"
] | null | null | null |
src/impscan/conda_meta/__init__.py
|
lmmx/impscan
|
fd809f9f32302e3b67bc921164f34fdd837cf92b
|
[
"MIT"
] | 15
|
2021-06-24T15:30:57.000Z
|
2021-07-30T14:04:38.000Z
|
src/impscan/conda_meta/__init__.py
|
lmmx/impscan
|
fd809f9f32302e3b67bc921164f34fdd837cf92b
|
[
"MIT"
] | null | null | null |
from . import formats, streaming_formats
__all__ = ["formats", "streaming_formats"]
| 21.25
| 42
| 0.764706
| 9
| 85
| 6.555556
| 0.555556
| 0.542373
| 0.779661
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.117647
| 85
| 3
| 43
| 28.333333
| 0.786667
| 0
| 0
| 0
| 0
| 0
| 0.282353
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
4fa4b9281842f5d0bdd26adbde7c63ff91654a2f
| 119
|
py
|
Python
|
tagger/commander/__init__.py
|
9bstudios/mecco_tagger
|
08af7cc0939602ae15e43fa081bbc0825b2ef7a7
|
[
"MIT"
] | null | null | null |
tagger/commander/__init__.py
|
9bstudios/mecco_tagger
|
08af7cc0939602ae15e43fa081bbc0825b2ef7a7
|
[
"MIT"
] | null | null | null |
tagger/commander/__init__.py
|
9bstudios/mecco_tagger
|
08af7cc0939602ae15e43fa081bbc0825b2ef7a7
|
[
"MIT"
] | null | null | null |
# python
__version__ = "0.36"
__author__ = "Adam"
from Commander import *
from MeshEditor import *
from Var import *
| 13.222222
| 24
| 0.722689
| 15
| 119
| 5.2
| 0.733333
| 0.25641
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.030928
| 0.184874
| 119
| 8
| 25
| 14.875
| 0.773196
| 0.05042
| 0
| 0
| 0
| 0
| 0.072072
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.6
| 0
| 0.6
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
96ebd0b99171cfdc8c68e9074997111347fb23f9
| 17,560
|
py
|
Python
|
src/viz/eval.py
|
Jatin-WIAI/ct-segmentation
|
e1e90ea376a21f35011399be9e5c66f8e0450241
|
[
"Apache-2.0"
] | null | null | null |
src/viz/eval.py
|
Jatin-WIAI/ct-segmentation
|
e1e90ea376a21f35011399be9e5c66f8e0450241
|
[
"Apache-2.0"
] | null | null | null |
src/viz/eval.py
|
Jatin-WIAI/ct-segmentation
|
e1e90ea376a21f35011399be9e5c66f8e0450241
|
[
"Apache-2.0"
] | null | null | null |
from copy import deepcopy
import matplotlib.pyplot as plt
import numpy as np
import wandb
from src.utils.threshold import *
from scipy.stats import norm
from sklearn.calibration import calibration_curve
from sklearn.metrics import (auc, average_precision_score, det_curve,
matthews_corrcoef, precision_recall_curve,
precision_score, roc_auc_score, roc_curve)
def plot_reliability_curve(y_true_arr, y_pred_proba_arr, labels_arr, n_bins=10, log_wandb=False, **kwargs):
"""Function for plotting reliability curve (test of extent of calibration)
The user provides a list of N GT arrays, N predicted probabilities, N labels,
and that results in N reliability curves.
Args:
y_true_arr (list/np.array): list of all GT arrays
y_pred_proba_arr (list/np.array): list of all predicted probabilities
labels_arr (list/np.array): list of labels
n_bins (int, optional): Number of bins to use. Defaults to 10.
log_wandb (bool, optional): If true, figure is logged to W&B. Defaults to False.
Returns:
plt.Figure, plt.Axes: Tuple of fig, ax
"""
fig, ax = plt.subplots(figsize=(12, 8))
ax.plot([0, 1], [0, 1], '--', c='black', label='Perfect Calibration')
for i, (y_true, y_pred_proba) in enumerate(zip(y_true_arr, y_pred_proba_arr)):
frac_pos, pred_prob = calibration_curve(
y_true, y_pred_proba[:, 1], n_bins=n_bins)
ax.plot(pred_prob, frac_pos, '-o', label=f'{labels_arr[i]}')
ax.set_title('Reliability Diagram')
ax.set_xlabel('Predicted Probability, Positive Class')
ax.set_ylabel('Fraction of Positives')
ax.grid()
ax.legend()
if log_wandb:
wandb.log({"reliab_curve": [wandb.Image(fig)]})
plt.close(fig)
return fig, ax
def plot_pr_curve(y_true_arr, y_pred_proba_arr, labels_arr, pos_label=None, plot_thres_for_idx=None,
plot_prevalance_for_idx=None, log_wandb=False):
"""Function for plotting PR curve
Args:
y_true_arr (list/np.array): list of all GT arrays
y_pred_proba_arr (list/np.array): list of all predicted probabilities
labels_arr (list/np.array): list of labels
pos_label (str, optional): What is the label of the positive class. Defaults to 'Yes'.
plot_thres_for_idx (int, optional): If true, best threshold (F1) is plotted
for the PR curve corresponding to this index. Defaults to None.
plot_prevalance_for_idx (int, optional): If true, prevelance of pos class is
plotted for the PR curve corresponding to this index. Defaults to None.
log_wandb (bool, optional): If true, figure is logged to W&B. Defaults to False.
Returns:
plt.Figure, plt.Axes: The tuple of figure and axes
"""
fig, ax = plt.subplots(figsize=(12, 8))
for i, (y_true, y_pred_proba) in enumerate(zip(y_true_arr, y_pred_proba_arr)):
p, r, _ = precision_recall_curve(
y_true, y_pred_proba[:, 1], pos_label=pos_label)
ap = average_precision_score(y_true, y_pred_proba[:, 1],
pos_label=pos_label)
ax.plot(r, p, label=f'{labels_arr[i]} (AP - {round(ap, 2)})')
if plot_thres_for_idx is not None:
y_true = y_true_arr[plot_thres_for_idx]
y_pred_proba = y_pred_proba_arr[plot_thres_for_idx]
_, idx = get_best_threshold_f1(
y_true, y_pred_proba, pos_label=pos_label)
p, r, _ = precision_recall_curve(
y_true, y_pred_proba[:, 1], pos_label=pos_label)
ax.plot([r[idx]], [p[idx]], '-o', c=ax.lines[plot_thres_for_idx].get_color(),
label=f'Best {labels_arr[plot_thres_for_idx]} Threshold (F1)')
if plot_prevalance_for_idx is not None:
y_true = y_true_arr[plot_prevalance_for_idx]
ax.plot([0, 1], [sum(y_true == pos_label)/len(y_true)]*2, c='black', ls='--',
label=f'{labels_arr[plot_prevalance_for_idx]} Prevelance ' +
f'({round(sum(y_true == pos_label)/len(y_true), 2)})')
ax.set_xlabel('Recall')
ax.set_ylabel('Precision')
ax.set_title('PR Curve')
ax.grid()
ax.legend()
if log_wandb:
wandb.log({"pr_curve": [wandb.Image(fig)]})
plt.close(fig)
return fig, ax
def plot_roc_curve(y_true_arr, y_pred_proba_arr, labels_arr, pos_label=None, plot_thres_for_idx=None,
log_wandb=False):
"""Function for plotting ROC curve
Args:
y_true_arr (list/np.array): list of all GT arrays
y_pred_proba_arr (list/np.array): list of all predicted probabilities
labels_arr (list/np.array): list of labels
pos_label (str, optional): What is the label of the positive class. Defaults to 'Yes'.
plot_thres_for_idx (int, optional): If true, best threshold (F1) is plotted
for the ROC curve corresponding to this index. Defaults to None.
log_wandb (bool, optional): If true, figure is logged to W&B. Defaults to False.
Returns:
plt.Figure, plt.Axes: The tuple of figure and axes
"""
fig, ax = plt.subplots(figsize=(12, 8))
for i, (y_true, y_pred_proba) in enumerate(zip(y_true_arr, y_pred_proba_arr)):
fpr, tpr, _ = roc_curve(
y_true, y_pred_proba[:, 1], pos_label=pos_label)
auc = roc_auc_score(y_true, y_pred_proba[:, 1])
ax.plot(fpr, tpr, label=f'{labels_arr[i]} (AUC - {round(auc, 3)})')
if plot_thres_for_idx is not None:
y_true = y_true_arr[plot_thres_for_idx]
y_pred_proba = y_pred_proba_arr[plot_thres_for_idx]
_, idx = get_best_threshold_gmean(
y_true, y_pred_proba, pos_label=pos_label)
fpr, tpr, _ = roc_curve(
y_true, y_pred_proba[:, 1], pos_label=pos_label)
ax.plot([fpr[idx]], [tpr[idx]], '-o', c=ax.lines[plot_thres_for_idx].get_color(),
label=f'Best {labels_arr[plot_thres_for_idx]} Threshold (GMean)')
ax.set_xlabel('False Positive Rate')
ax.set_ylabel('True Positive Rate')
ax.set_title('ROC Curve')
ax.legend()
ax.grid()
if log_wandb:
wandb.log({"roc_curve": [wandb.Image(fig)]})
plt.close(fig)
return fig, ax
def plot_det_curve(y_true_arr, y_pred_proba_arr, labels_arr, pos_label=None, plot_thres_for_idx=None,
log_wandb=False):
"""Function for plotting DET curve
Args:
y_true_arr (list/np.array): list of all GT arrays
y_pred_proba_arr (list/np.array): list of all predicted probabilities
labels_arr (list/np.array): list of labels
pos_label (str, optional): What is the label of the positive class. Defaults to 'Yes'.
plot_thres_for_idx (int, optional): If true, best threshold (F1) is plotted
for the DET curve corresponding to this index. Defaults to None.
log_wandb (bool, optional): If true, figure is logged to W&B. Defaults to False.
Returns:
plt.Figure, plt.Axes: The tuple of figure and axes
"""
fig, ax = plt.subplots(figsize=(12, 8))
for i, (y_true, y_pred_proba) in enumerate(zip(y_true_arr, y_pred_proba_arr)):
fpr, fnr, _ = det_curve(
y_true, y_pred_proba[:, 1], pos_label=pos_label)
auc_score = auc(fpr, fnr)
ax.plot(norm.ppf(fpr), norm.ppf(fnr),
label=f'{labels_arr[i]} (AUC - {round(auc_score, 3)})')
if plot_thres_for_idx is not None:
y_true = y_true_arr[plot_thres_for_idx]
y_pred_proba = y_pred_proba_arr[plot_thres_for_idx]
_, idx = get_best_threshold_gmean(
y_true, y_pred_proba, pos_label=pos_label)
fpr, fnr, _ = det_curve(
y_true, y_pred_proba[:, 1], pos_label=pos_label)
ax.plot([norm.ppf(fpr[idx])], [norm.ppf(fnr[idx])], '-o',
c=ax.lines[plot_thres_for_idx].get_color(),
label=f'Best {labels_arr[plot_thres_for_idx]} Threshold (GMean)')
ax.set_xlabel('False Positive Rate')
ax.set_ylabel('False Negative Rate')
ax.set_title('DET Curve')
ax.legend()
ax.grid()
ticks = [0.001, 0.01, 0.05, 0.20, 0.5, 0.80, 0.95, 0.99, 0.999]
tick_locations = norm.ppf(ticks)
tick_labels = [
'{:.0%}'.format(s) if (100*s).is_integer() else '{:.1%}'.format(s)
for s in ticks
]
ax.set_xticks(tick_locations)
ax.set_xticklabels(tick_labels)
ax.set_yticks(tick_locations)
ax.set_yticklabels(tick_labels)
if log_wandb:
wandb.log({"det_curve": [wandb.Image(fig)]})
plt.close(fig)
return fig, ax
def plot_f1(y_true_arr, y_pred_proba_arr, labels_arr, pos_label=None, plot_thres_for_idx=None,
log_wandb=False):
"""Function for plotting F1 curve (F1 vs threshold)
F1 is defined as the harmonic mean between Precision and Recall
Args:
y_true_arr (list/np.array): list of all GT arrays
y_pred_proba_arr (list/np.array): list of all predicted probabilities
labels_arr (list/np.array): list of labels
pos_label (str, optional): What is the label of the positive class. Defaults to 'Yes'.
plot_thres_for_idx (int, optional): If true, best threshold (F1) is plotted
for the F1 curve corresponding to this index. Defaults to None.
log_wandb (bool, optional): If true, figure is logged to W&B. Defaults to False.
Returns:
plt.Figure, plt.Axes: The tuple of figure and axes
"""
fig, ax = plt.subplots(figsize=(12, 8))
for i, (y_true, y_pred_proba) in enumerate(zip(y_true_arr, y_pred_proba_arr)):
p, r, pr_thresholds = precision_recall_curve(
y_true, y_pred_proba[:, 1], pos_label=pos_label)
f1 = 2*(p*r/(p + r))
ax.plot(pr_thresholds, f1[:-1], label=f'{labels_arr[i]}')
if plot_thres_for_idx is not None:
y_true = y_true_arr[plot_thres_for_idx]
y_pred_proba = y_pred_proba_arr[plot_thres_for_idx]
_, idx = get_best_threshold_f1(
y_true, y_pred_proba, pos_label=pos_label)
p, r, pr_thresholds = precision_recall_curve(
y_true, y_pred_proba[:, 1], pos_label=pos_label)
f1 = 2*(p*r/(p + r))
ax.plot([pr_thresholds[idx]], [f1[idx]], '-o', c=ax.lines[plot_thres_for_idx].get_color(),
label=f'Best {labels_arr[plot_thres_for_idx]} Threshold (F1)')
ax.set_title('F1 vs threshold')
ax.set_xlabel('Threshold')
ax.set_ylabel('F1')
ax.grid()
ax.legend()
if log_wandb:
wandb.log({"f1": [wandb.Image(fig)]})
plt.close(fig)
return fig, ax
def plot_matthews_coeff(y_true_arr, y_pred_proba_arr, labels_arr, pos_label=None, plot_thres_for_idx=None,
log_wandb=False):
# ! Todo - MCC is returning error, and it is taking too much time. Need to debug.
"""Function for plotting MCC curve (MCC vs threshold)
Matthews Correlation Coefficient (MCC) is different from F1 and other metrics as it takes into
account performance on all 4 elements of the binary confusion matrix.
Check out https://en.wikipedia.org/wiki/Matthews_correlation_coefficient for a detailed definition.
Args:
y_true_arr (list/np.array): list of all GT arrays
y_pred_proba_arr (list/np.array): list of all predicted probabilities
labels_arr (list/np.array): list of labels
pos_label (str, optional): What is the label of the positive class. Defaults to 'Yes'.
plot_thres_for_idx (int, optional): If true, best threshold (F1) is plotted
for the MCC curve corresponding to this index. Defaults to None.
log_wandb (bool, optional): If true, figure is logged to W&B. Defaults to False.
Returns:
plt.Figure, plt.Axes: The tuple of figure and axes
"""
fig, ax = plt.subplots(figsize=(12, 8))
for i, (y_true, y_pred_proba) in enumerate(zip(y_true_arr, y_pred_proba_arr)):
thresholds = np.sort(y_pred_proba[:, 1])
y_true = deepcopy(y_true)
mcc_arr = []
for thres in thresholds:
y_pred = (y_pred_proba[:, 1] > thres).astype(int)
y_true[y_true == pos_label] = 1
y_true[y_true != pos_label] = 0
mcc = matthews_corrcoef(
y_true.to_numpy().astype(int), y_pred)
mcc_arr.append(mcc)
ax.plot(thresholds, mcc_arr, label=f'{labels_arr[i]}')
# if plot_thres_for_idx is not None:
# y_true = y_true_arr[plot_thres_for_idx]
# y_pred_proba = y_pred_proba_arr[plot_thres_for_idx]
# _, idx = get_best_threshold_f1(y_true, y_pred_proba, pos_label=pos_label)
# p, r, pr_thresholds = precision_recall_curve(
# y_true, y_pred_proba[:, 1], pos_label=pos_label)
# f1 = 2*(p*r/(p + r))
# ax.plot([pr_thresholds[idx]], [f1[idx]], '-o', c=ax.lines[plot_thres_for_idx].get_color(),
# label=f'Best {labels_arr[plot_thres_for_idx]} Threshold (F1)')
ax.set_title('MCC vs threshold')
ax.set_xlabel('Threshold')
ax.set_ylabel('MCC')
ax.grid()
ax.legend()
if log_wandb:
wandb.log({"matthews_coeff": [wandb.Image(fig)]})
plt.close(fig)
return fig, ax
def plot_fm_index(y_true_arr, y_pred_proba_arr, labels_arr, pos_label=None, plot_thres_for_idx=None,
log_wandb=False):
"""Function for plotting FM curve (Folkwes-Mallows) - FM vs Threshold.
FM is defined as sqrt(Precision*Recall).
Just like F1 is the harmonic mean of P and R, FM is the geometric mean.
Practically, its values end up being v close to the corresponding F1 values.
They can be interchangeably used.
Args:
y_true_arr (list/np.array): list of all GT arrays
y_pred_proba_arr (list/np.array): list of all predicted probabilities
labels_arr (list/np.array): list of labels
pos_label (str, optional): What is the label of the positive class. Defaults to 'Yes'.
plot_thres_for_idx (int, optional): If true, best threshold (F1) is plotted
for the FM curve corresponding to this index. Defaults to None.
log_wandb (bool, optional): If true, figure is logged to W&B. Defaults to False.
Returns:
plt.Figure, plt.Axes: The tuple of figure and axes
"""
fig, ax = plt.subplots(figsize=(12, 8))
for i, (y_true, y_pred_proba) in enumerate(zip(y_true_arr, y_pred_proba_arr)):
p, r, pr_thresholds = precision_recall_curve(
y_true, y_pred_proba[:, 1], pos_label=pos_label)
fm = np.sqrt(p*r)
ax.plot(pr_thresholds, fm[:-1], label=f'{labels_arr[i]}')
if plot_thres_for_idx is not None:
y_true = y_true_arr[plot_thres_for_idx]
y_pred_proba = y_pred_proba_arr[plot_thres_for_idx]
_, idx = get_best_threshold_fowlkes_mallows(
y_true, y_pred_proba, pos_label=pos_label)
p, r, _ = precision_recall_curve(
y_true, y_pred_proba[:, 1], pos_label=pos_label)
fm = np.sqrt(p*r)
ax.plot([pr_thresholds[idx]], [fm[idx]], '-o', c=ax.lines[plot_thres_for_idx].get_color(),
label=f'Best {labels_arr[plot_thres_for_idx]} Threshold (FM Index)')
ax.set_title('Fowlkes–Mallows index vs threshold')
ax.set_xlabel('Threshold')
ax.set_ylabel('Fowlkes–Mallows index')
ax.grid()
ax.legend()
if log_wandb:
wandb.log({"fm_index": [wandb.Image(fig)]})
plt.close(fig)
return fig, ax
def plot_gmean(y_true_arr, y_pred_proba_arr, labels_arr, pos_label=None, plot_thres_for_idx=None,
log_wandb=False):
"""Function for plotting Gmean curve (Gmean vs Threshold)
GMean is defined as sqrt(tpr * (1 - fpr)), where tpr, fpr are the true positive,
and false positive rates respectively.
Args:
y_true_arr (list/np.array): list of all GT arrays
y_pred_proba_arr (list/np.array): list of all predicted probabilities
labels_arr (list/np.array): list of labels
pos_label (str, optional): What is the label of the positive class. Defaults to 'Yes'.
plot_thres_for_idx (int, optional): If true, best threshold (F1) is plotted
for the Gmean curve corresponding to this index. Defaults to None.
log_wandb (bool, optional): If true, figure is logged to W&B. Defaults to False.
Returns:
plt.Figure, plt.Axes: The tuple of figure and axes
"""
fig, ax = plt.subplots(figsize=(12, 8))
for i, (y_true, y_pred_proba) in enumerate(zip(y_true_arr, y_pred_proba_arr)):
fpr, tpr, roc_thresholds = roc_curve(
y_true, y_pred_proba[:, 1], pos_label=pos_label)
gmean = np.sqrt(tpr * (1-fpr))
ax.plot(roc_thresholds[1:], gmean[1:], label=f'{labels_arr[i]}')
if plot_thres_for_idx is not None:
y_true = y_true_arr[plot_thres_for_idx]
y_pred_proba = y_pred_proba_arr[plot_thres_for_idx]
_, idx = get_best_threshold_gmean(
y_true, y_pred_proba, pos_label=pos_label)
fpr, tpr, roc_thresholds = roc_curve(
y_true, y_pred_proba[:, 1], pos_label=pos_label)
gmean = np.sqrt(tpr * (1-fpr))
ax.plot([roc_thresholds[idx]], [gmean[idx]], '-o',
c=ax.lines[plot_thres_for_idx].get_color(),
label=f'Best {labels_arr[plot_thres_for_idx]} Threshold (GMean)')
ax.set_title('GMean vs threshold')
ax.set_xlabel('Threshold')
ax.set_ylabel('GMean')
ax.grid()
ax.legend()
if log_wandb:
wandb.log({"gmean": [wandb.Image(fig)]})
plt.close(fig)
return fig, ax
| 41.611374
| 107
| 0.651822
| 2,761
| 17,560
| 3.881565
| 0.088736
| 0.038257
| 0.06625
| 0.068583
| 0.77811
| 0.759541
| 0.754036
| 0.746944
| 0.741905
| 0.696464
| 0
| 0.009914
| 0.235991
| 17,560
| 421
| 108
| 41.710214
| 0.78876
| 0.360877
| 0
| 0.587719
| 0
| 0
| 0.101347
| 0.023409
| 0
| 0
| 0
| 0.002375
| 0
| 1
| 0.035088
| false
| 0
| 0.035088
| 0
| 0.105263
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
96ff2457d4db41b9ba7cc34889225f94e9d21a0d
| 76
|
py
|
Python
|
tests/pyflakes_bears/pep8_naming_test_files/E02/valid.py
|
MacBox7/coala-pyflakes
|
637f8a2e77973384be79d30b0dae1f43072e60c8
|
[
"MIT"
] | null | null | null |
tests/pyflakes_bears/pep8_naming_test_files/E02/valid.py
|
MacBox7/coala-pyflakes
|
637f8a2e77973384be79d30b0dae1f43072e60c8
|
[
"MIT"
] | 12
|
2018-05-21T06:12:59.000Z
|
2018-07-30T10:37:16.000Z
|
tests/pyflakes_bears/pep8_naming_test_files/E02/valid.py
|
MacBox7/coala-pyflakes
|
637f8a2e77973384be79d30b0dae1f43072e60c8
|
[
"MIT"
] | 1
|
2018-06-10T16:16:47.000Z
|
2018-06-10T16:16:47.000Z
|
def foo():
'''
>>> from mod import good as bad
'''
pass
| 12.666667
| 39
| 0.421053
| 9
| 76
| 3.555556
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.421053
| 76
| 5
| 40
| 15.2
| 0.727273
| 0.407895
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| 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
| 1
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
4fb7abcc8362249508823da8e96c2c68fcad7632
| 128
|
py
|
Python
|
contenedores/admin.py
|
tedesco8/dj_restApi
|
58e54fa5f444a6fdec8f622ceab6480daa8368ea
|
[
"MIT"
] | 1
|
2020-03-25T14:18:13.000Z
|
2020-03-25T14:18:13.000Z
|
contenedores/admin.py
|
tedesco8/api-rest-django
|
58e54fa5f444a6fdec8f622ceab6480daa8368ea
|
[
"MIT"
] | 9
|
2020-11-19T16:25:31.000Z
|
2021-09-22T19:38:38.000Z
|
contenedores/admin.py
|
tedesco8/api-rest-django
|
58e54fa5f444a6fdec8f622ceab6480daa8368ea
|
[
"MIT"
] | 1
|
2020-03-04T03:34:56.000Z
|
2020-03-04T03:34:56.000Z
|
from django.contrib import admin
from contenedores.models import *
# Register your models here.
admin.site.register(Contenedor)
| 25.6
| 33
| 0.820313
| 17
| 128
| 6.176471
| 0.705882
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.109375
| 128
| 5
| 34
| 25.6
| 0.921053
| 0.203125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
4ffda25dda548615cf215830cb8ab0dcea6e0008
| 19
|
py
|
Python
|
examples/round/ex2.py
|
mcorne/python-by-example
|
15339c0909c84b51075587a6a66391100971c033
|
[
"MIT"
] | null | null | null |
examples/round/ex2.py
|
mcorne/python-by-example
|
15339c0909c84b51075587a6a66391100971c033
|
[
"MIT"
] | null | null | null |
examples/round/ex2.py
|
mcorne/python-by-example
|
15339c0909c84b51075587a6a66391100971c033
|
[
"MIT"
] | null | null | null |
print(round(-0.5))
| 9.5
| 18
| 0.631579
| 4
| 19
| 3
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111111
| 0.052632
| 19
| 1
| 19
| 19
| 0.555556
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
8ca556817ff8b309f5815088c12f76fcc22932ce
| 155
|
py
|
Python
|
book/admin.py
|
YevgeniiKaidashov/book-store
|
dda5e8b1560699a6d20249d1ef92f65a60f1eadd
|
[
"MIT"
] | 1
|
2019-04-28T08:30:43.000Z
|
2019-04-28T08:30:43.000Z
|
book/admin.py
|
YevgeniiKaidashov/book-store
|
dda5e8b1560699a6d20249d1ef92f65a60f1eadd
|
[
"MIT"
] | null | null | null |
book/admin.py
|
YevgeniiKaidashov/book-store
|
dda5e8b1560699a6d20249d1ef92f65a60f1eadd
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from book.models import Book, Author
# Register your models here.
admin.site.register(Book)
admin.site.register(Author)
| 19.375
| 36
| 0.8
| 23
| 155
| 5.391304
| 0.521739
| 0.145161
| 0.274194
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.116129
| 155
| 7
| 37
| 22.142857
| 0.905109
| 0.167742
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
8cb2be5c48441cbe53ca661a886e3648aa65460f
| 410
|
py
|
Python
|
python/anyascii/_data/_2b4.py
|
casept/anyascii
|
d4f426b91751254b68eaa84c6cd23099edd668e6
|
[
"ISC"
] | null | null | null |
python/anyascii/_data/_2b4.py
|
casept/anyascii
|
d4f426b91751254b68eaa84c6cd23099edd668e6
|
[
"ISC"
] | null | null | null |
python/anyascii/_data/_2b4.py
|
casept/anyascii
|
d4f426b91751254b68eaa84c6cd23099edd668e6
|
[
"ISC"
] | null | null | null |
b=' Yue Shan Kuai Na Ba Ling Fan Zhi Ping Tian Yi Zhou Ni Guan Hong Bu Ke Wei Jiao Bu Kan Lei Lou Zhuan Meng Yan Han Ba Zi Fu Guo Cong Qian Za Yang Liu Ji Xu Qiao Jun Mou Shen Xuan Wan Ji Lu Nie He Zong Yu'
| 410
| 410
| 0.373171
| 51
| 410
| 3
| 0.941176
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.619512
| 410
| 1
| 410
| 410
| 0.980769
| 0
| 0
| 0
| 0
| 1
| 0.987835
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
8ce955b13cbf94bfd6f4e7e10ca49601ebb35cec
| 91
|
py
|
Python
|
models/baseline/__init__.py
|
Thesharing/lfesm
|
e956ed76f5a85259000742db093726d4b4c51751
|
[
"Apache-2.0"
] | 6
|
2020-01-31T13:14:11.000Z
|
2021-05-16T11:43:17.000Z
|
models/baseline/__init__.py
|
Cyprestar/scm-fsim
|
924fb184451fa4ca0eb419a1dcc0bd6cea2edf3a
|
[
"Apache-2.0"
] | 5
|
2020-11-16T06:23:31.000Z
|
2022-01-04T10:17:16.000Z
|
models/baseline/__init__.py
|
Cyprestar/scm-fsim
|
924fb184451fa4ca0eb419a1dcc0bd6cea2edf3a
|
[
"Apache-2.0"
] | 4
|
2020-11-04T02:42:57.000Z
|
2022-03-21T06:36:20.000Z
|
from .bert import BERTBaseline
from .cnn import CNNBaseline
from .lstm import LSTMBaseline
| 22.75
| 30
| 0.835165
| 12
| 91
| 6.333333
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.131868
| 91
| 3
| 31
| 30.333333
| 0.962025
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
50679659170a4b5587b49ec001688dc775e5914c
| 194
|
py
|
Python
|
app/urls.py
|
shikharvaish28/mr-caption
|
b24107e55ee587ff16275e9428b4dfd8091d31c9
|
[
"MIT"
] | 3
|
2018-10-10T16:27:40.000Z
|
2018-10-10T16:27:46.000Z
|
app/urls.py
|
shikharvaish28/mr-caption
|
b24107e55ee587ff16275e9428b4dfd8091d31c9
|
[
"MIT"
] | null | null | null |
app/urls.py
|
shikharvaish28/mr-caption
|
b24107e55ee587ff16275e9428b4dfd8091d31c9
|
[
"MIT"
] | 1
|
2018-10-08T13:32:09.000Z
|
2018-10-08T13:32:09.000Z
|
from django.conf.urls import url
from . import views
from django.conf import settings
from django.views.static import serve
urlpatterns = [
url(r'^$', views.get_image , name='get_image'),
]
| 24.25
| 51
| 0.742268
| 29
| 194
| 4.896552
| 0.517241
| 0.211268
| 0.197183
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.14433
| 194
| 8
| 52
| 24.25
| 0.855422
| 0
| 0
| 0
| 0
| 0
| 0.05641
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.571429
| 0
| 0.571429
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
5080bcd64d7348d9b49c180691bef5a20a1d2798
| 5,678
|
py
|
Python
|
predict_api_test.py
|
johnson7788/mt-dnn
|
26e5c4a5bfdbf1a1dd1c903e606db1c070568237
|
[
"MIT"
] | null | null | null |
predict_api_test.py
|
johnson7788/mt-dnn
|
26e5c4a5bfdbf1a1dd1c903e606db1c070568237
|
[
"MIT"
] | null | null | null |
predict_api_test.py
|
johnson7788/mt-dnn
|
26e5c4a5bfdbf1a1dd1c903e606db1c070568237
|
[
"MIT"
] | 1
|
2021-07-14T08:57:20.000Z
|
2021-07-14T08:57:20.000Z
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2021/6/30 2:00 下午
# @File : api_test.py
# @Author: johnson
# @Contact : github: johnson7788
# @Desc :
import requests
import json
def dopredict_absa(test_data, host="127.0.0.1:3326"):
"""
预测结果
:param test_data:
:return:
"""
url = f"http://{host}/api/absa_predict"
data = {'data': test_data}
headers = {'content-type': 'application/json'}
r = requests.post(url, headers=headers, data=json.dumps(data), timeout=360)
print(r.json())
return r.json()
def dopredict_absa_fullscore(test_data, host="127.0.0.1:3326"):
"""
预测结果
:param test_data:
:return:
"""
url = f"http://{host}/api/absa_predict_fullscore"
data = {'data': test_data}
headers = {'content-type': 'application/json'}
r = requests.post(url, headers=headers, data=json.dumps(data), timeout=360)
print(r.json())
return r.json()
def dopredict_dem8(test_data, host="127.0.0.1:3326"):
"""
预测结果
:param test_data: [('持妆不能输雅诗兰黛上妆即定妆雅诗兰黛DW粉底是我的心头好持妆遮瑕磨皮粉底液测评', '遮瑕', '成分'),...]
:return:
"""
url = f"http://{host}/api/dem8_predict"
data = {'data': test_data}
headers = {'content-type': 'application/json'}
r = requests.post(url, headers=headers, data=json.dumps(data), timeout=360)
print(r.json())
return r.json()
def dopredict_purchase(test_data, host="127.0.0.1:3326"):
"""
预测结果
:param test_data: [('持妆不能输雅诗兰黛上妆即定妆雅诗兰黛DW粉底是我的心头好持妆遮瑕磨皮粉底液测评', '遮瑕', '成分'),...]
:return:
"""
url = f"http://{host}/api/purchase_predict"
data = {'data': test_data}
headers = {'content-type': 'application/json'}
r = requests.post(url, headers=headers, data=json.dumps(data), timeout=360)
print(r.json())
return r.json()
def dem8(test_data, host="127.0.0.1:3326"):
"""
预测结果, 多个aspect关键字的情况
:param test_data: [('持妆不能输雅诗兰黛上妆即定妆雅诗兰黛DW粉底是我的心头好持妆遮瑕磨皮粉底液测评', ['遮瑕','粉底'], '成分'),...]
:return:
"""
url = f"http://{host}/api/dem8"
data = {'data': test_data}
headers = {'content-type': 'application/json'}
r = requests.post(url, headers=headers, data=json.dumps(data), timeout=360)
print(r.json())
return r.json()
def dopredict_absa_dem8(test_data, host="127.0.0.1:3326"):
"""
预测属性之后预测情感
:param test_data: [('持妆不能输雅诗兰黛上妆即定妆雅诗兰黛DW粉底是我的心头好持妆遮瑕磨皮粉底液测评', '遮瑕', '成分'),...]
:return:
"""
url = f"http://{host}/api/absa_dem8_predict"
data = {'data': test_data}
headers = {'content-type': 'application/json'}
r = requests.post(url, headers=headers, data=json.dumps(data), timeout=360)
print(r.json())
return r.json()
def dopredict_absa_sentence(test_data, host="127.0.0.1:3326"):
"""
预测属性之后预测情感
:param test_data: [('持妆不能输雅诗兰黛上妆即定妆雅诗兰黛DW粉底是我的心头好持妆遮瑕磨皮粉底液测评', '遮瑕', '成分'),...]
:return:
"""
url = f"http://{host}/api/absa_predict_sentence"
data = {'data': test_data}
headers = {'content-type': 'application/json'}
r = requests.post(url, headers=headers, data=json.dumps(data), timeout=360)
print(r.json())
return r.json()
if __name__ == '__main__':
# host = "127.0.0.1:3326"
# host = "192.168.50.139:3326"
host = "192.168.50.189:3326"
absa_data = [('这个遮瑕效果很差,很不好用', '遮瑕'), ('抗氧化效果一般', '抗氧化'), ('海洋冰泉水润清透是MG面膜深受顾客喜爱的经典款面膜之一,已经使用了两年多了。该产品外包装精致、里面的面膜质感很好,与面部的贴合度、大小符合度都不错,使面膜的精华液能很好的均匀的敷于脸部各个部位。适用于各种肌肤,补水效果好,用后皮肤水润、光滑,以后还会回购的。', '水润'), ('海洋冰泉水润清透是MG面膜深受顾客喜爱的经典款面膜之一,已经使用了两年多了。该产品外包装精致、里面的面膜质感很好,与面部的贴合度、大小符合度都不错,使面膜的精华液能很好的均匀的敷于脸部各个部位。适用于各种肌肤,补水效果好,用后皮肤水润、光滑,以后还会回购的。', '质感'), ('海洋冰泉水润清透是MG面膜深受顾客喜爱的经典款面膜之一,已经使用了两年多了。该产品外包装精致、里面的面膜质感很好,与面部的贴合度、大小符合度都不错,使面膜的精华液能很好的均匀的敷于脸部各个部位。适用于各种肌肤,补水效果好,用后皮肤水润、光滑,以后还会回购的。', '补水')]
dem8_data = [('持妆不能输雅诗兰黛上妆即定妆雅诗兰黛DW粉底是我的心头好持妆遮瑕磨皮粉底液测评', '遮瑕', '成分'), ('活动有赠品比较划算,之前买过快用完了,一支可以分两次使用,早上抗氧化必备VC', '抗氧化','成分'), ('海洋冰泉水润清透是MG面膜深受顾客喜爱的经典款面膜之一,已经使用了两年多了。该产品外包装精致、里面的面膜质感很好,与面部的贴合度、大小符合度都不错,使面膜的精华液能很好的均匀的敷于脸部各个部位。适用于各种肌肤,补水效果好,用后皮肤水润、光滑,以后还会回购的。', '水润', '功效'), ('海洋冰泉水润清透是MG面膜深受顾客喜爱的经典款面膜之一,已经使用了两年多了。该产品外包装精致、里面的面膜质感很好,与面部的贴合度、大小符合度都不错,使面膜的精华液能很好的均匀的敷于脸部各个部位。适用于各种肌肤,补水效果好,用后皮肤水润、光滑,以后还会回购的。', '质感','功效'), ('海洋冰泉水润清透是MG面膜深受顾客喜爱的经典款面膜之一,已经使用了两年多了。该产品外包装精致、里面的面膜质感很好,与面部的贴合度、大小符合度都不错,使面膜的精华液能很好的均匀的敷于脸部各个部位。适用于各种肌肤,补水效果好,用后皮肤水润、光滑,以后还会回购的。', '补水','功效')]
purchase_data = [['飘了大概两周 终于到了\n希望我的头发别再掉了\n但是我又纠结要不要用,\n看到各种各样的评价,还说有疯狂的脱发期,那我要不要用?\n担心越用越脱啊。再加上我头发甚至连头皮都是干巴巴的类型。\n#REGENERATE \n#Grow Gorgeous Grow Gorgeous强效防脱增发精华头发增长生发液密发增发英国进口 \n#Dr.Hauschka 德国世家 \n#Alpecin 咖啡因C1 洗发水 \n#Alpecin 咖啡因防脱免洗发根滋养液 ', '买了alpecin洗发水增发液纠结要不要用?', 'grow gorgeous强效防脱增发精华']]
# dem8_dd = [('持妆不能输雅诗兰黛上妆即定妆雅诗兰黛DW粉底是我的心头好持妆遮瑕磨皮粉底液测评', ['遮瑕','粉底'], '成分'), ('活动有赠品比较划算,之前买过快用完了,一支可以分两次使用,早上抗氧化必备VC', ['抗氧化'],'成分'), ('海洋冰泉水润清透是MG面膜深受顾客喜爱的经典款面膜之一,已经使用了两年多了。该产品外包装精致、里面的面膜质感很好,与面部的贴合度、大小符合度都不错,使面膜的精华液能很好的均匀的敷于脸部各个部位。适用于各种肌肤,补水效果好,用后皮肤水润、光滑,以后还会回购的。',['水润','补水'], '功效'), ('海洋冰泉水润清透是MG面膜深受顾客喜爱的经典款面膜之一,已经使用了两年多了。该产品外包装精致、里面的面膜质感很好,与面部的贴合度、大小符合度都不错,使面膜的精华液能很好的均匀的敷于脸部各个部位。适用于各种肌肤,补水效果好,用后皮肤水润、光滑,以后还会回购的。', ['质感'],'功效'), ('海洋冰泉水润清透是MG面膜深受顾客喜爱的经典款面膜之一,已经使用了两年多了。该产品外包装精致、里面的面膜质感很好,与面部的贴合度、大小符合度都不错,使面膜的精华液能很好的均匀的敷于脸部各个部位。适用于各种肌肤,补水效果好,用后皮肤水润、光滑,以后还会回购的。', ['补水'],'功效')]
# dopredict_absa(host=host,test_data=absa_data)
# dopredict_absa_fullscore(host=host,test_data=absa_data)
# dopredict_dem8(host=host,test_data=dem8_data)
# dopredict_purchase(host=host,test_data=purchase_data)
# dem8(host=host,test_data=dem8_dd)
# 句子情感
sentence_data = ['持妆不能输雅诗兰黛上妆即定妆雅诗兰黛DW粉底是我的心头好持妆遮瑕磨皮粉底液测评', '活动有赠品比较划算,之前买过快用完了,一支可以分两次使用,早上抗氧化必备VC']
dopredict_absa_sentence(host=host, test_data=sentence_data)
# dopredict_absa_dem8(test_data=dem8_data,host=host)
| 50.247788
| 587
| 0.695491
| 672
| 5,678
| 5.763393
| 0.178571
| 0.057836
| 0.102246
| 0.12316
| 0.785179
| 0.757552
| 0.741544
| 0.724503
| 0.715724
| 0.714691
| 0
| 0.032532
| 0.12839
| 5,678
| 112
| 588
| 50.696429
| 0.750051
| 0.289362
| 0
| 0.603448
| 0
| 0.12069
| 0.474462
| 0.280529
| 0
| 0
| 0
| 0
| 0
| 1
| 0.12069
| false
| 0
| 0.034483
| 0
| 0.275862
| 0.12069
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
508873eb5178d446a2c52e11efd55b13d9bc2a2e
| 132
|
py
|
Python
|
sdcclient/monitor/dashboard_converters/__init__.py
|
DaveCanHaz/sysdig-sdk-python
|
2c8cb5674add8d5e7efcd6f3ff9fe9c1e7a88dac
|
[
"MIT"
] | null | null | null |
sdcclient/monitor/dashboard_converters/__init__.py
|
DaveCanHaz/sysdig-sdk-python
|
2c8cb5674add8d5e7efcd6f3ff9fe9c1e7a88dac
|
[
"MIT"
] | null | null | null |
sdcclient/monitor/dashboard_converters/__init__.py
|
DaveCanHaz/sysdig-sdk-python
|
2c8cb5674add8d5e7efcd6f3ff9fe9c1e7a88dac
|
[
"MIT"
] | null | null | null |
from ._dashboard_versions import convert_dashboard_between_versions
from ._dashboard_scope import convert_scope_string_to_expression
| 66
| 67
| 0.931818
| 17
| 132
| 6.588235
| 0.588235
| 0.232143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.05303
| 132
| 2
| 68
| 66
| 0.896
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
50afc4dd291d7f0361deff36d9cb64825c833cae
| 123
|
py
|
Python
|
jcramda/__init__.py
|
bspiritxp/jcramda
|
290f41fa8f6e5f729f666e800ffee28c2c9d4b06
|
[
"MIT"
] | null | null | null |
jcramda/__init__.py
|
bspiritxp/jcramda
|
290f41fa8f6e5f729f666e800ffee28c2c9d4b06
|
[
"MIT"
] | 1
|
2022-02-11T03:25:11.000Z
|
2022-02-11T03:25:11.000Z
|
jcramda/__init__.py
|
bspiritxp/jcramda
|
290f41fa8f6e5f729f666e800ffee28c2c9d4b06
|
[
"MIT"
] | null | null | null |
from .core import *
from .base import *
from .factor import (Just, Nothing, Maybe)
_ = HP = EmptyParam
Version = '1.0.5'
| 15.375
| 42
| 0.674797
| 18
| 123
| 4.555556
| 0.777778
| 0.243902
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.030303
| 0.195122
| 123
| 7
| 43
| 17.571429
| 0.79798
| 0
| 0
| 0
| 0
| 0
| 0.04065
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.6
| 0
| 0.6
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
50ee9fbf74d4436e5d6dbcb15464c8ee1eb3874d
| 54
|
py
|
Python
|
Python/Tests/TestData/DebuggerProject/BreakpointTest3.py
|
nanshuiyu/pytools
|
9f9271fe8cf564b4f94e9456d400f4306ea77c23
|
[
"Apache-2.0"
] | null | null | null |
Python/Tests/TestData/DebuggerProject/BreakpointTest3.py
|
nanshuiyu/pytools
|
9f9271fe8cf564b4f94e9456d400f4306ea77c23
|
[
"Apache-2.0"
] | null | null | null |
Python/Tests/TestData/DebuggerProject/BreakpointTest3.py
|
nanshuiyu/pytools
|
9f9271fe8cf564b4f94e9456d400f4306ea77c23
|
[
"Apache-2.0"
] | null | null | null |
def f():
print('hello')
print('calling f')
f()
| 9
| 19
| 0.518519
| 8
| 54
| 3.5
| 0.625
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.240741
| 54
| 5
| 20
| 10.8
| 0.682927
| 0
| 0
| 0
| 0
| 0
| 0.285714
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| true
| 0
| 0
| 0
| 0.25
| 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
0fbf13f646bf2b311ab2fc007b5e93f8d3e236cc
| 47
|
py
|
Python
|
b3cdi/__init__.py
|
abbudao/b3_cdi_curve
|
b717c8c84f65e1d65c25726992f987d6f6042e23
|
[
"MIT"
] | 1
|
2020-11-18T19:18:28.000Z
|
2020-11-18T19:18:28.000Z
|
b3cdi/__init__.py
|
abbudao/b3_cdi_curve
|
b717c8c84f65e1d65c25726992f987d6f6042e23
|
[
"MIT"
] | null | null | null |
b3cdi/__init__.py
|
abbudao/b3_cdi_curve
|
b717c8c84f65e1d65c25726992f987d6f6042e23
|
[
"MIT"
] | 1
|
2020-11-18T19:18:42.000Z
|
2020-11-18T19:18:42.000Z
|
from .b3cdi import sync_db, create_time_series
| 23.5
| 46
| 0.851064
| 8
| 47
| 4.625
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02381
| 0.106383
| 47
| 1
| 47
| 47
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
0fcda5767e9f2b5bb4a71f6c8e9cbbc5ff63263c
| 26,011
|
py
|
Python
|
py/tests/smoketest.py
|
v-zion/phrase-machine
|
1b784ff122713c803726598599f02b211da2c75d
|
[
"MIT"
] | null | null | null |
py/tests/smoketest.py
|
v-zion/phrase-machine
|
1b784ff122713c803726598599f02b211da2c75d
|
[
"MIT"
] | null | null | null |
py/tests/smoketest.py
|
v-zion/phrase-machine
|
1b784ff122713c803726598599f02b211da2c75d
|
[
"MIT"
] | null | null | null |
# -*- encoding: utf-8 -*-
text = u"""
Mr. Speaker, Mr. President, distinguished Members of the Congress, honored guests, and fellow citizens:
I come before you to report on the state of our Union, and I'm pleased to report that after 4 years of united effort, the American people have brought forth a nation renewed, stronger, freer, and more secure than before.
Four years ago we began to change, forever I hope, our assumptions about government and its place in our lives. Out of that change has come great and robust growth-in our confidence, our economy, and our role in the world.
Tonight America is stronger because of the values that we hold dear. We believe faith and freedom must be our guiding stars, for they show us truth, they make us brave, give us hope, and leave us wiser than we were. Our progress began not in Washington, DC, but in the hearts of our families, communities, workplaces, and voluntary groups which, together, are unleashing the invincible spirit of one great nation under God.
Four years ago we said we would invigorate our economy by giving people greater freedom and incentives to take risks and letting them keep more of what they earned. We did what we promised, and a great industrial giant is reborn.
Tonight we can take pride in 25 straight months of economic growth, the strongest in 34 years; a 3-year inflation average of 3.9 percent, the lowest in 17 years; and 7.3 million new jobs in 2 years, with more of our citizens working than ever before.
New freedom in our lives has planted the rich seeds for future success:
For an America of wisdom that honors the family, knowing that if
the family goes, so goes our civilization;
For an America of vision that sees tomorrow's dreams in the learning and hard work we do today;
For an America of courage whose service men and women, even as we meet, proudly stand watch on the frontiers of freedom;
For an America of compassion that opens its heart to those who cry out for help.
We have begun well. But it's only a beginning. We're not here to congratulate ourselves on what we have done but to challenge ourselves to finish what has not yet been done.
We're here to speak for millions in our inner cities who long for real jobs, safe neighborhoods, and schools that truly teach. We're here to speak for the American farmer, the entrepreneur, and every worker in industries fighting to modernize and compete. And, yes, we're here to stand, and proudly so, for all who struggle to break free from totalitarianism, for all who know in their hearts that freedom is the one true path to peace and human happiness.
Proverbs tell us, without a vision the people perish. When asked what great principle holds our Union together, Abraham Lincoln said: "Something in
Declaration giving liberty, not alone to the people of this country, but hope to the world for all future time."
We honor the giants of our history not by going back but forward to the dreams their vision foresaw. My fellow citizens, this nation is poised for greatness. The time has come to proceed toward a great new challenge—a second American Revolution of hope and opportunity; a revolution carrying us to new heights of progress by pushing back frontiers of knowledge and space; a revolution of spirit that taps the soul of America, enabling us to summon greater strength than we've ever known; and a revolution that carries beyond our shores the golden promise of human freedom in a world of peace.
Let us begin by challenging our conventional wisdom. There are no constraints on the human mind, no walls around the human spirit, no barriers to our progress except those we ourselves erect. Already, pushing down tax rates has freed our economy to vault forward to record growth.
In Europe, they're calling it "the American Miracle." Day by day, we're shattering accepted notions of what is possible. When I was growing up, we failed to see how a new thing called radio would transform our marketplace. Well, today, many have not yet seen how advances in technology are transforming our lives.
In the late 1950's workers at the AT&T semiconductor plant in Pennsylvania produced five transistors a day for $7.50 apiece. They now produce over a million for less than a penny apiece.
New laser techniques could revolutionize heart bypass surgery, cut diagnosis time for viruses linked to cancer from weeks to minutes, reduce hospital costs dramatically, and hold out new promise for saving human lives.
Our automobile industry has overhauled assembly lines, increased worker productivity, and is competitive once again.
We stand on the threshold of a great ability to produce more, do more, be more. Our economy is not getting older and weaker; it's getting younger and stronger. It doesn't need rest and supervision; it needs new challenge, greater freedom. And that word "freedom" is the key to the second American revolution that we need to bring about.
Let us move together with an historic reform of tax simplification for fairness and growth. Last year I asked Treasury Secretary-then-Regan to develop a plan to simplify the tax code, so all taxpayers would be treated more fairly and personal tax rates could come further down.
We have cut tax rates by almost 25 percent, yet the tax system remains unfair and limits our potential for growth. Exclusions and exemptions cause similar incomes to be taxed at different levels. Low-income families face steep tax barriers that make hard lives even harder. The Treasury Department has produced an excellent reform plan, whose principles will guide the final proposal that we will ask you to enact.
One thing that tax reform will not be is a tax increase in disguise. We will not jeopardize the mortgage interest deduction that families need. We will reduce personal tax rates as low as possible by removing many tax preferences. We will propose a top rate of no more than 35 percent, and possibly lower. And we will propose reducing corporate rates, while maintaining incentives for capital formation.
To encourage opportunity and jobs rather than dependency and welfare, we will propose that individuals living at or near the poverty line be totally exempt from Federal income tax. To restore fairness to families, we will propose increasing significantly the personal exemption.
And tonight, I am instructing Treasury Secretary James Baker—I have to get used to saying that—to begin working with congressional authors and committees for bipartisan legislation conforming to these principles. We will call upon the American people for support and upon every man and woman in this Chamber. Together, we can pass, this year, a tax bill for fairness, simplicity, and growth, making this economy the engine of our dreams and America the investment capital of the world. So let us begin.
Tax simplification will be a giant step toward unleashing the tremendous pent-up power of our economy. But a second American revolution must carry the promise of opportunity for all. It is time to liberate the spirit of enterprise in the most distressed areas of our country.
This government will meet its responsibility to help those in need. But policies that increase dependency, break up families, and destroy self-respect are not progressive; they're reactionary. Despite our strides in civil rights, blacks, Hispanics, and all minorities will not have full and equal power until they have full economic power.
We have repeatedly sought passage of enterprise zones to help those in the abandoned corners of our land find jobs, learn skills, and build better lives. This legislation is supported by a majority of you.
Mr. Speaker, I know we agree that 'there must be no forgotten Americans. Let us place new dreams in a million hearts and create a new generation of entrepreneurs by passing enterprise zones this year. And, Tip, you could make that a birthday present.
Nor must we lose the chance to pass our youth employment opportunity wage proposal. We can help teenagers, who have the highest unemployment rate, find summer jobs, so they can know the pride of work and have confidence in their futures.
We'll continue to support the Job Training Partnership Act, which has a nearly two-thirds job placement rate. Credits in education and health care vouchers will help working families shop for services that they need.
Our administration is already encouraging certain low-income public housing residents to own and manage their own dwellings. It's time that all public housing residents have that opportunity of ownership.
The Federal Government can help create a new atmosphere of freedom. But States and localities, many of which enjoy surpluses from the recovery, must not permit their tax and regulatory policies to stand as barriers to growth.
Let us resolve that we will stop spreading dependency and start spreading opportunity; that we will stop spreading bondage and start spreading freedom.
There are some who say that growth initiatives must await final action on deficit reductions. Well, the best way to reduce deficits is through economic growth. More businesses will be started, more investments made, more jobs created, and more people will be on payrolls paying taxes. The best way to reduce government spending is to reduce the need for spending by increasing prosperity. Each added percentage point per year of real GNP growth will lead to cumulative reduction in deficits of nearly $200 billion over 5 years.
To move steadily toward a balanced budget, we must also lighten government's claim on our total economy. We will not do this by raising taxes. We must make sure that our economy grows faster than the growth in spending by the Federal Government. In our fiscal year 1986 budget, overall government program spending will be frozen at the current level. It must not be one dime higher than fiscal year 1985, and three points are key.
First, the social safety net for the elderly, the needy, the disabled, and unemployed will be left intact. Growth of our major health care programs, Medicare and Medicaid, will be slowed, but protections for the elderly and needy will be preserved.
Second, we must not relax our efforts to restore military strength just as we near our goal of a fully equipped, trained, and ready professional corps. National security is government's first responsibility; so in past years defense spending took about half the Federal budget. Today it takes less than a third. We've already reduced our planned defense expenditures by nearly a hundred billion dollars over the past 4 years and reduced projected spending again this year.
You know, we only have a military-industrial complex until a time of danger, and then it becomes the arsenal of democracy. Spending for defense is investing in things that are priceless—peace and freedom.
Third, we must reduce or eliminate costly government subsidies. For example, deregulation of the airline industry has led to cheaper airfares, but on Amtrak taxpayers pay about $35 per passenger every time an Amtrak train leaves the station, It's time we ended this huge Federal subsidy.
Our farm program costs have quadrupled in recent years. Yet I know from visiting farmers, many in great financial distress, that we need an orderly transition to a market-oriented farm economy. We can help farmers best not by expanding Federal payments but by making fundamental reforms, keeping interest rates heading down, and knocking down foreign trade barriers to American farm exports.
We're moving ahead with Grace commission reforms to eliminate waste and improve government's management practices. In the long run, we must protect the taxpayers from government. And I ask again that you pass, as 32 States have now called for, an amendment mandating the Federal Government spend no more than it takes in. And I ask for the authority, used responsibly by 43 Governors, to veto individual items in appropriation bills. Senator Mattingly has introduced a bill permitting a 2-year trial run of the line-item veto. I hope you'll pass and send that legislation to my desk.
Nearly 50 years of government living beyond its means has brought us to a time of reckoning. Ours is but a moment in history. But one moment of courage, idealism, and bipartisan unity can change American history forever.
Sound monetary policy is key to long-running economic strength and stability. We will continue to cooperate with the Federal Reserve Board, seeking a steady policy that ensures price stability without keeping interest rates artificially high or needlessly holding down growth.
Reducing unneeded red tape and regulations, and deregulating the energy, transportation, and financial industries have unleashed new competition, giving consumers more choices, better services, and lower prices. In just one set of grant programs we have reduced 905 pages of regulations to 31. We seek to fully deregulate natural gas to bring on new supplies and bring us closer to energy independence. Consistent with safety standards, we will continue removing restraints on the bus and railroad industries, we will soon end up legislation—or send up legislation, I should say—to return Conrail to the private sector where it belongs, and we will support further deregulation of the trucking industry.
Every dollar the Federal Government does not take from us, every decision it does not make for us will make our economy stronger, our lives more abundant, our future more free.
Our second American revolution will push on to new possibilities not only on Earth but in the next frontier of space. Despite budget restraints, we will seek record funding for research and development.
We've seen the success of the space shuttle. Now we're going to develop a permanently manned space station and new opportunities for free enterprise, because in the next decade Americans and our friends around the world will be living and working together in space.
In the zero gravity of space, we could manufacture in 30 days lifesaving medicines it would take 30 years to make on Earth. We can make crystals of exceptional purity to produce super computers, creating jobs, technologies, and medical breakthroughs beyond anything we ever dreamed possible.
As we do all this, we'll continue to protect our natural resources. We will seek reauthorization and expanded funding for the Superfund program to continue cleaning up hazardous waste sites which threaten human health and the environment.
Now, there's another great heritage to speak of this evening. Of all the changes that have swept America the past 4 years, none brings greater promise than our rediscovery of the values of faith, freedom, family, work, and neighborhood.
We see signs of renewal in increased attendance in places of worship; renewed optimism and faith in our future; love of country rediscovered by our young, who are leading the way. We've rediscovered that work is good in and of itself, that it ennobles us to create and contribute no matter how seemingly humble our jobs. We've seen a powerful new current from an old and honorable tradition—American generosity.
From thousands answering Peace Corps appeals to help boost food production in Africa, to millions volunteering time, corporations adopting schools, and communities pulling together to help the neediest among us at home, we have refound our values. Private sector initiatives are crucial to our future.
I thank the Congress for passing equal access legislation giving religious groups the same right to use classrooms after school that other groups enjoy. But no citizen need tremble, nor the world shudder, if a child stands in a classroom and breathes a prayer. We ask you again, give children back a right they had for a century and a half or more in this country.
The question of abortion grips our nation. Abortion is either the taking of a human life or it isn't. And if it is—and medical technology is increasingly showing it is—it must be stopped. It is a terrible irony that while some turn to abortion, so many others who cannot become parents cry out for children to adopt. We have room for these children. We can fill the cradles of those who want a child to love. And tonight I ask you in the Congress to move this year on legislation to protect the unborn.
In the area of education, we're returning to excellence, and again, the heroes are our people, not government. We're stressing basics of discipline, rigorous testing, and homework, while helping children become computer-smart as well. For 20 years scholastic aptitude test scores of our high school students went down, but now they have gone up 2 of the last 3 years. We must go forward in our commitment to the new basics, giving parents greater authority and making sure good teachers are rewarded for hard work and achievement through merit pay.
Of all the changes in the past 20 years, none has more threatened our sense of national well-being than the explosion of violent crime. One does not have to be attacked to be a victim. The woman who must run to her car after shopping at night is a victim. The couple draping their door with locks and chains are victims; as is the tired, decent cleaning woman who can't ride a subway home without being afraid.
We do not seek to violate the rights of defendants. But shouldn't we feel more compassion for the victims of crime than for those who commit crime? For the first time in 20 years, the crime index has fallen 2 years in a row. We've convicted over 7,400 drug offenders and put them, as well as leaders of organized crime, behind bars in record numbers.
But we must do more. I urge the House to follow the Senate and enact proposals permitting use of all reliable evidence that police officers acquire in good faith. These proposals would also reform the habeas corpus laws and allow, in keeping with the will of the overwhelming majority of Americans, the use of the death penalty where necessary.
There can be no economic revival in ghettos when the most violent among us are allowed to roam free. It's time we restored domestic tranquility. And we mean to do just that.
Just as we're positioned as never before to secure justice in our economy, we're poised as never before to create a safer, freer, more peaceful world. Our alliances are stronger than ever. Our economy is stronger than ever. We have resumed our historic role as a leader of the free world. And all of these together are a great force for peace.
Since 1981 we've been committed to seeking fair and verifiable arms agreements that would lower the risk of war and reduce the size of nuclear arsenals. Now our determination to maintain a strong defense has influenced the Soviet Union to return to the bargaining table. Our negotiators must be able to go to that table with the united support of the American people. All of us have no greater dream than to see the day when nuclear weapons are banned from this Earth forever.
Each Member of the Congress has a role to play in modernizing our defenses, thus supporting our chances for a meaningful arms agreement. Your vote this spring on the Peacekeeper missile will be a critical test of our resolve to maintain the strength we need and move toward mutual and verifiable arms reductions.
For the past 20 years we've believed that no war will be launched as long as each side knows it can retaliate with a deadly counterstrike. Well, I believe there's a better way of eliminating the threat of nuclear war. It is a Strategic Defense Initiative aimed ultimately at finding a nonnuclear defense against ballistic missiles. It's the most hopeful possibility of the nuclear age. But it's not very well understood.
Some say it will bring war to the heavens, but its purpose is to deter war in the heavens and on Earth. Now, some say the research would be expensive. Perhaps, but it could save millions of lives, indeed humanity itself. And some say if we build such a system, the Soviets will build a defense system of their own. Well, they already have strategic defenses that surpass ours; a civil defense system, where we have almost none; and a research program covering roughly the same areas of technology that we're now exploring. And finally some say the research will take a long time. Well, the answer to that is: Let's get started.
Harry Truman once said that, ultimately, our security and the world's hopes for peace and human progress "lie not in measures of defense or in the control of weapons, but in the growth and expansion of freedom and self-government."
And tonight, we declare anew to our fellow citizens of the world: Freedom is not the sole prerogative of a chosen few; it is the universal right of all God's children. Look to where peace and prosperity flourish today. It is in homes that freedom built. Victories against poverty are greatest and peace most secure where people live by laws that ensure free press, free speech, and freedom to worship, vote, and create wealth.
Our mission is to nourish and defend freedom and democracy, and to communicate these ideals everywhere we can. America's economic success is freedom's success; it can be repeated a hundred times in a hundred different nations. Many countries in east Asia and the Pacific have few resources other than the enterprise of their own people. But through low tax rates and free markets they've soared ahead of centralized economies. And now China is opening up its economy to meet its needs.
We need a stronger and simpler approach to the process of making and implementing trade policy, and we'll be studying potential changes in that process in the next few weeks. We've seen the benefits of free trade and lived through the disasters of protectionism. Tonight I ask all our trading partners, developed and developing alike, to join us in a new round of trade negotiations to expand trade and competition and strengthen the global economy—and to begin it in this next year.
There are more than 3 billion human beings living in Third World countries with an average per capita income of $650 a year. Many are victims of dictatorships that impoverished them with taxation and corruption. Let us ask our allies to join us in a practical program of trade and assistance that fosters economic development through personal incentives to help these people climb from poverty on their own.
We cannot play innocents abroad in a world that's not innocent; nor can we be passive when freedom is under siege. Without resources, diplomacy cannot succeed. Our security assistance programs help friendly governments defend themselves and give them confidence to work for peace. And I hope that you in the Congress will understand that, dollar for dollar, security assistance contributes as much to global security as our own defense budget.
We must stand by all our democratic allies. And we must not break faith with those who are risking their lives—on every continent, from Afghanistan to Nicaragua—to defy Soviet-supported aggression and secure rights which have been ours from birth.
The Sandinista dictatorship of Nicaragua, with full Cuban-Soviet bloc support, not only persecutes its people, the church, and denies a free press, but arms and provides bases for Communist terrorists attacking neighboring states. Support for freedom fighters is self-defense and totally consistent with the OAS and U.N. Charters. It is essential that the Congress continue all facets of our assistance to Central America. I want to work with you to support the democratic forces whose struggle is tied to our own security.
And tonight, I've spoken of great plans and great dreams. They're dreams we can make come true. Two hundred years of American history should have taught us that nothing is impossible.
Ten years ago a young girl left Vietnam with her family, part of the exodus that followed the fall of Saigon. They came to the United States with no possessions and not knowing a word of English. Ten years ago—the young girl studied hard, learned English, and finished high school in the top of her class. And this May, May 22d to be exact, is a big date on her calendar. Just 10 years from the time she left Vietnam, she will graduate from the United States Military Academy at West Point. I thought you might like to meet an American hero named Jean Nguyen.
Now, there's someone else here tonight, born 79 years ago. She lives in the inner city, where she cares for infants born of mothers who are heroin addicts. The children, born in withdrawal, are sometimes even dropped on her doorstep. She helps them with love. Go to her house some night, and maybe you'll see her silhouette against the window as she walks the floor talking softly, soothing a child in her arms-Mother Hale of Harlem, and she, too, is an American hero.
Jean, Mother Hale, your lives tell us that the oldest American saying is new again: Anything is possible in America if we have the faith, the will, and the heart. History is asking us once again to be a force for good in the world. Let us begin in unity, with justice, and love.
Thank you, and God bless you.
"""
import phrasemachine
phrases = phrasemachine.get_phrases(text)
print "%s phrase types" % len(phrases['counts'])
print "%s phrase hits" % sum(phrases['counts'].values())
print "Top phrases:"
print phrases['counts'].most_common(10)
print "From crappy tokenization:"
crappy_tokens = text.split()
print phrasemachine.get_phrases(tokens=crappy_tokens)['counts'].most_common(10)
print "Phrase spans"
phrases = phrasemachine.get_phrases(text, output=['token_spans','tokens'])
print "%s phrase hits" % len(phrases['token_spans'])
print phrases['token_spans'][:20]
print phrases['token_spans'][-20:]
print "First several phrase hits"
print [(s,e, phrases['tokens'][s:e]) for (s,e) in phrases['token_spans'][:10]]
print "From crappy tokenization"
xx = phrasemachine.get_phrases(tokens=crappy_tokens, output='token_spans')['token_spans']
print [(s,e, crappy_tokens[s:e]) for (s,e) in xx[:10]]
| 232.241071
| 704
| 0.801968
| 4,454
| 26,011
| 4.682533
| 0.309385
| 0.005035
| 0.002302
| 0.002685
| 0.022535
| 0.009638
| 0.001438
| 0
| 0
| 0
| 0
| 0.004531
| 0.168544
| 26,011
| 111
| 705
| 234.333333
| 0.959218
| 0.000884
| 0
| 0
| 0
| 0.735294
| 0.974987
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0.117647
| 0.009804
| null | null | 0.137255
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
0fe46b785c473f4f62f7154443d8ea722d1cd1a1
| 100
|
py
|
Python
|
tests/conftest.py
|
testdrivenio/django-performance-testing
|
e41494ebc5a7e698a34e6c383f4055b42a0e16a9
|
[
"MIT"
] | 6
|
2020-03-30T13:16:24.000Z
|
2022-02-03T21:26:18.000Z
|
tests/conftest.py
|
testdrivenio/django-performance-testing
|
e41494ebc5a7e698a34e6c383f4055b42a0e16a9
|
[
"MIT"
] | 3
|
2021-06-09T17:43:48.000Z
|
2022-02-10T07:48:28.000Z
|
tests/conftest.py
|
testdrivenio/django-performance-testing
|
e41494ebc5a7e698a34e6c383f4055b42a0e16a9
|
[
"MIT"
] | 2
|
2020-02-26T21:02:22.000Z
|
2020-11-14T16:55:17.000Z
|
from django.conf import settings
def pytest_configure(config):
settings.NPLUSONE_RAISE = True
| 16.666667
| 34
| 0.79
| 13
| 100
| 5.923077
| 0.923077
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.15
| 100
| 5
| 35
| 20
| 0.905882
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| 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
| 1
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
0fef58625e1ce69a0dbcb7262a464834098fce6d
| 17,601
|
py
|
Python
|
tests/testdata.py
|
bousquf/okta-cli
|
8073ee171bd0ae690f087fa8f3260cbd24cefbda
|
[
"MIT"
] | 28
|
2019-02-10T00:10:36.000Z
|
2022-03-02T14:33:36.000Z
|
tests/testdata.py
|
bousquf/okta-cli
|
8073ee171bd0ae690f087fa8f3260cbd24cefbda
|
[
"MIT"
] | 9
|
2020-03-27T03:39:08.000Z
|
2021-12-03T21:09:57.000Z
|
tests/testdata.py
|
bousquf/okta-cli
|
8073ee171bd0ae690f087fa8f3260cbd24cefbda
|
[
"MIT"
] | 11
|
2019-04-30T06:26:41.000Z
|
2022-02-06T03:41:31.000Z
|
_perms_self_read_only = [
{
"principal": "SELF",
"action": "READ_ONLY"
}
]
_perms_self_read_write = [
{
"principal": "SELF",
"action": "READ_WRITE"
}
]
_perms_self_hide = [
{
"principal": "SELF",
"action": "HIDE"
}
]
# a dump of an okta user schema with some example
# properties (int, bool)
okta_user_schema = {
"id": "https://paracelsus.okta.com/meta/schemas/user/default",
"$schema": "http://json-schema.org/draft-04/schema#",
"name": "user",
"title": "User",
"description": "Okta user profile template with default permission settings",
"lastUpdated": "2019-02-04T14:38:16.000Z",
"created": "2018-07-23T08:46:45.000Z",
"definitions": {
"custom": {
"id": "#custom",
"type": "object",
"properties": {
"abool": {
"title": "A bool",
"description": "A boolean variable",
"type": "boolean",
"mutability": "READ_WRITE",
"scope": "NONE",
"permissions": _perms_self_read_only,
"master": {"type": "PROFILE_MASTER"}
},
"anint": {
"title": "An int",
"description": "An integer value",
"type": "integer",
"mutability": "READ_WRITE",
"scope": "NONE",
"permissions": _perms_self_read_only,
"master": {"type": "PROFILE_MASTER"}
},
},
},
"base": {
"id": "#base",
"type": "object",
"properties": {
"login": {
"title": "Username",
"type": "string",
"required": True,
"mutability": "READ_WRITE",
"scope": "NONE",
"minLength": 5,
"maxLength": 100,
"pattern": ".+",
"permissions": _perms_self_read_only,
"master": {"type": "PROFILE_MASTER"}
},
"firstName": {
"title": "First name",
"type": "string",
"required": True,
"mutability": "READ_WRITE",
"scope": "NONE",
"minLength": 1,
"maxLength": 50,
"permissions": _perms_self_read_write,
"master": {"type": "PROFILE_MASTER"}
},
"lastName": {
"title": "Last name",
"type": "string",
"required": True,
"mutability": "READ_WRITE",
"scope": "NONE",
"minLength": 1,
"maxLength": 50,
"permissions": _perms_self_read_write,
"master": {"type": "PROFILE_MASTER"}
},
"middleName": {
"title": "Middle name",
"type": "string",
"mutability": "READ_WRITE",
"scope": "NONE",
"permissions": _perms_self_read_only,
"master": {"type": "PROFILE_MASTER"}
},
"honorificPrefix": {
"title": "Honorific prefix",
"type": "string",
"mutability": "READ_WRITE",
"scope": "NONE",
"permissions": _perms_self_read_write,
"master": {"type": "PROFILE_MASTER"}
},
"honorificSuffix": {
"title": "Honorific suffix",
"type": "string",
"mutability": "READ_WRITE",
"scope": "NONE",
"permissions": _perms_self_read_only,
"master": {"type": "PROFILE_MASTER"}
},
"email": {
"title": "Primary email",
"type": "string",
"required": True,
"format": "email",
"mutability": "READ_WRITE",
"scope": "NONE",
"permissions": _perms_self_read_write,
"master": {"type": "PROFILE_MASTER"}
},
"title": {
"title": "Title",
"type": "string",
"mutability": "READ_WRITE",
"scope": "NONE",
"permissions": _perms_self_read_write,
"master": {"type": "PROFILE_MASTER"}
},
"displayName": {
"title": "Display name",
"type": "string",
"mutability": "READ_WRITE",
"scope": "NONE",
"permissions": _perms_self_read_only,
"master": {"type": "PROFILE_MASTER"}
},
"nickName": {
"title": "Nickname",
"type": "string",
"mutability": "READ_WRITE",
"scope": "NONE",
"permissions": _perms_self_read_only,
"master": {"type": "PROFILE_MASTER"}
},
"profileUrl": {
"title": "Profile Url",
"type": "string",
"format": "uri",
"mutability": "READ_WRITE",
"scope": "NONE",
"permissions": _perms_self_read_only,
"master": {"type": "PROFILE_MASTER"}
},
"secondEmail": {
"title": "Secondary email",
"type": "string",
"format": "email",
"mutability": "READ_WRITE",
"scope": "NONE",
"permissions": _perms_self_read_write,
"master": {"type": "PROFILE_MASTER"}
},
"mobilePhone": {
"title": "Mobile phone",
"type": "string",
"mutability": "READ_WRITE",
"scope": "NONE",
"maxLength": 100,
"permissions": _perms_self_read_write,
"master": {"type": "PROFILE_MASTER"}
},
"primaryPhone": {
"title": "Primary phone",
"type": "string",
"mutability": "READ_WRITE",
"scope": "NONE",
"maxLength": 100,
"permissions": _perms_self_read_write,
"master": {"type": "PROFILE_MASTER"}
},
"streetAddress": {
"title": "Street address",
"type": "string",
"mutability": "READ_WRITE",
"scope": "NONE",
"permissions": _perms_self_hide,
"master": {"type": "PROFILE_MASTER"}
},
"city": {
"title": "City",
"type": "string",
"mutability": "READ_WRITE",
"scope": "NONE",
"permissions": _perms_self_hide,
"master": {"type": "PROFILE_MASTER"}
},
"state": {
"title": "State",
"type": "string",
"mutability": "READ_WRITE",
"scope": "NONE",
"permissions": _perms_self_hide,
"master": {"type": "PROFILE_MASTER"}
},
"zipCode": {
"title": "Zip code",
"type": "string",
"mutability": "READ_WRITE",
"scope": "NONE",
"permissions": _perms_self_hide,
"master": {"type": "PROFILE_MASTER"}
},
"countryCode": {
"title": "Country code",
"type": "string",
"format": "country-code",
"mutability": "READ_WRITE",
"scope": "NONE",
"permissions": _perms_self_hide,
"master": {"type": "PROFILE_MASTER"}
},
"postalAddress": {
"title": "Postal Address",
"type": "string",
"mutability": "READ_WRITE",
"scope": "NONE",
"permissions": _perms_self_hide,
"master": {"type": "PROFILE_MASTER"}
},
"preferredLanguage": {
"title": "Preferred language",
"type": "string",
"format": "language-code",
"mutability": "READ_WRITE",
"scope": "NONE",
"permissions": _perms_self_read_only,
"master": {"type": "PROFILE_MASTER"}
},
"locale": {
"title": "Locale",
"type": "string",
"format": "locale",
"mutability": "READ_WRITE",
"scope": "NONE",
"permissions": _perms_self_read_only,
"master": {"type": "PROFILE_MASTER"}
},
"timezone": {
"title": "Time zone",
"type": "string",
"format": "timezone",
"mutability": "READ_WRITE",
"scope": "NONE",
"permissions": _perms_self_read_only,
"master": {"type": "PROFILE_MASTER"}
},
"userType": {
"title": "User type",
"type": "string",
"mutability": "READ_WRITE",
"scope": "NONE",
"permissions": _perms_self_read_only,
"master": {"type": "PROFILE_MASTER"}
},
"employeeNumber": {
"title": "Employee number",
"type": "string",
"mutability": "READ_WRITE",
"scope": "NONE",
"permissions": _perms_self_read_only,
"master": {"type": "PROFILE_MASTER"}
},
"costCenter": {
"title": "Cost center",
"type": "string",
"mutability": "READ_WRITE",
"scope": "NONE",
"permissions": _perms_self_read_only,
"master": {"type": "PROFILE_MASTER"}
},
"organization": {
"title": "Organization",
"type": "string",
"mutability": "READ_WRITE",
"scope": "NONE",
"permissions": _perms_self_read_only,
"master": {"type": "PROFILE_MASTER"}
},
"division": {
"title": "Division",
"type": "string",
"mutability": "READ_WRITE",
"scope": "NONE",
"permissions": _perms_self_read_only,
"master": {"type": "PROFILE_MASTER"}
},
"department": {
"title": "Department",
"type": "string",
"mutability": "READ_WRITE",
"scope": "NONE",
"permissions": _perms_self_read_write,
"master": {"type": "PROFILE_MASTER"}
},
"managerId": {
"title": "ManagerId",
"type": "string",
"mutability": "READ_WRITE",
"scope": "NONE",
"permissions": _perms_self_read_only,
"master": {"type": "PROFILE_MASTER"}
},
"manager": {
"title": "Manager",
"type": "string",
"mutability": "READ_WRITE",
"scope": "NONE",
"permissions": _perms_self_read_only,
"master": {"type": "PROFILE_MASTER"}
}
},
"required": [
"login",
"firstName",
"lastName",
"email"
]
}
},
"type": "object",
"properties": {
"profile": {
"allOf": [
{
"$ref": "#/definitions/custom"
},
{
"$ref": "#/definitions/base"
}
]
}
}
}
okta_groups_list = [
{
"id": "group1",
"created": "2018-09-13T12:51:16.000Z",
"lastUpdated": "2018-10-17T12:00:38.000Z",
"lastMembershipUpdated": "2019-01-16T08:48:12.000Z",
"objectClass": [
"okta:user_group"
],
"type": "OKTA_GROUP",
"profile": {
"name": "Group One",
"description": ""
},
"_links": {
"logo": [
{
"name": "medium",
"href": "https://some.logo",
"type": "image/png"
},
{
"name": "large",
"href": "https://some_large.logo",
"type": "image/png"
}
],
"users": {"href": "http://okta/api/v1/groups/group1/users"},
"apps": {"href": "http://okta/api/v1/groups/group1/apps"},
}
},
{
"id": "group2",
"created": "2018-09-13T12:51:16.000Z",
"lastUpdated": "2018-10-17T12:00:38.000Z",
"lastMembershipUpdated": "2019-01-16T08:48:12.000Z",
"objectClass": [
"okta:user_group"
],
"type": "OKTA_GROUP",
"profile": {
"name": "Group Two",
"description": ""
},
"_links": {
"logo": [
{
"name": "medium",
"href": "https://some.logo",
"type": "image/png"
},
{
"name": "large",
"href": "https://some_large.logo",
"type": "image/png"
}
],
"users": {"href": "http://okta/api/v1/groups/group2/users"},
"apps": {"href": "http://okta/api/v1/groups/group2/apps"},
}
},
{
"id": "group3",
"created": "2018-09-13T12:51:16.000Z",
"lastUpdated": "2018-10-17T12:00:38.000Z",
"lastMembershipUpdated": "2019-01-16T08:48:12.000Z",
"objectClass": [
"okta:user_group"
],
"type": "OKTA_GROUP",
"profile": {
"name": "Group 3",
"description": ""
},
"_links": {
"logo": [
{
"name": "medium",
"href": "https://some.logo",
"type": "image/png"
},
{
"name": "large",
"href": "https://some_large.logo",
"type": "image/png"
}
],
"users": {"href": "http://okta/api/v1/groups/group3/users"},
"apps": {"href": "http://okta/api/v1/groups/group3/apps"},
}
},
]
| 39.552809
| 81
| 0.33197
| 1,031
| 17,601
| 5.452958
| 0.166828
| 0.070438
| 0.111526
| 0.140875
| 0.708289
| 0.708289
| 0.708289
| 0.701885
| 0.68481
| 0.674315
| 0
| 0.02706
| 0.535992
| 17,601
| 444
| 82
| 39.641892
| 0.66132
| 0.003977
| 0
| 0.547945
| 0
| 0
| 0.296554
| 0.018656
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
e83ba07acf40738ae68a036f80df8fbcfc90932e
| 408
|
py
|
Python
|
outputformat/__init__.py
|
JuPeg/outputformat
|
bfbb659a05edeb57bf3049ed3836b4842e5a8af0
|
[
"MIT"
] | 146
|
2021-12-30T12:57:22.000Z
|
2022-03-30T08:14:53.000Z
|
outputformat/__init__.py
|
JuPeg/outputformat
|
bfbb659a05edeb57bf3049ed3836b4842e5a8af0
|
[
"MIT"
] | 1
|
2022-01-03T19:03:41.000Z
|
2022-01-03T19:03:41.000Z
|
outputformat/__init__.py
|
JuPeg/outputformat
|
bfbb659a05edeb57bf3049ed3836b4842e5a8af0
|
[
"MIT"
] | 6
|
2021-12-30T16:01:47.000Z
|
2022-02-23T08:31:39.000Z
|
from outputformat.title import boxtitle
from outputformat.title import linetitle
from outputformat.title import bigtitle
from outputformat.list import showlist
from outputformat.plot import bar
from outputformat.plot import barlist
from outputformat.dict import showdict
from outputformat.misc import br
from outputformat.misc import b
from outputformat.color import c
from outputformat.color import rainbow
| 34
| 40
| 0.865196
| 55
| 408
| 6.418182
| 0.363636
| 0.498584
| 0.17847
| 0.229462
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.107843
| 408
| 11
| 41
| 37.090909
| 0.96978
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
e8474ee4171b46a0e1537b469c5c84d93f9697f2
| 67
|
py
|
Python
|
PacManTaro/create_app.py
|
SomHackathon2020/somhackathon2020-pacmantaro
|
9fb3fb83ada72fa043e61d2c44b8b02f14cbe60a
|
[
"MIT"
] | 3
|
2020-02-09T10:56:49.000Z
|
2020-02-09T12:14:26.000Z
|
PacManTaro/create_app.py
|
SomHackathon2020/somhackathon2020-pacmantaro
|
9fb3fb83ada72fa043e61d2c44b8b02f14cbe60a
|
[
"MIT"
] | null | null | null |
PacManTaro/create_app.py
|
SomHackathon2020/somhackathon2020-pacmantaro
|
9fb3fb83ada72fa043e61d2c44b8b02f14cbe60a
|
[
"MIT"
] | null | null | null |
from __init__ import db, create_app
db.create_all(app=create_app())
| 33.5
| 35
| 0.820896
| 12
| 67
| 4
| 0.583333
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.074627
| 67
| 2
| 36
| 33.5
| 0.774194
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
e8572a7e02a2e363db2073ce95c9ebce16c8e8ac
| 83
|
py
|
Python
|
stf_utils/common/exceptions.py
|
z00sts/stf-utils
|
844c38145a82614872b35d9771dde45e7d7d083c
|
[
"MIT"
] | 52
|
2016-04-01T02:43:26.000Z
|
2022-02-18T08:36:45.000Z
|
stf_utils/common/exceptions.py
|
z00sts/stf-utils
|
844c38145a82614872b35d9771dde45e7d7d083c
|
[
"MIT"
] | 44
|
2016-03-22T05:02:17.000Z
|
2019-09-06T15:43:37.000Z
|
stf_utils/common/exceptions.py
|
z00sts/stf-utils
|
844c38145a82614872b35d9771dde45e7d7d083c
|
[
"MIT"
] | 23
|
2016-03-21T10:55:45.000Z
|
2021-05-25T01:17:56.000Z
|
class APIException(Exception):
pass
class ADBException(Exception):
pass
| 10.375
| 30
| 0.722892
| 8
| 83
| 7.5
| 0.625
| 0.433333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.204819
| 83
| 7
| 31
| 11.857143
| 0.909091
| 0
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
e86be447d4493428f150f2a567444f15ac87df09
| 347
|
py
|
Python
|
tests/test_bboxformat.py
|
tensorturtle/rebox
|
8835f4d2482aff7d2d0852930bdbbdf49320a8d3
|
[
"MIT"
] | 13
|
2021-10-19T01:46:22.000Z
|
2022-03-23T19:13:30.000Z
|
tests/test_bboxformat.py
|
tensorturtle/rebox
|
8835f4d2482aff7d2d0852930bdbbdf49320a8d3
|
[
"MIT"
] | 3
|
2021-08-08T13:18:51.000Z
|
2021-08-10T10:06:25.000Z
|
tests/test_bboxformat.py
|
tensorturtle/bboxconvert
|
8835f4d2482aff7d2d0852930bdbbdf49320a8d3
|
[
"MIT"
] | 2
|
2021-07-27T03:06:48.000Z
|
2022-01-24T10:19:46.000Z
|
import pytest
from rebox import BBoxFormat
@pytest.fixture
def example_format():
return BBoxFormat("XYXY", 10)
def test_style(example_format):
assert example_format.style == "XYXY"
def test_scale(example_format):
assert example_format.scale == 10
def test_is_relative(example_format):
assert example_format.is_relative == True
| 21.6875
| 45
| 0.769452
| 47
| 347
| 5.425532
| 0.404255
| 0.356863
| 0.223529
| 0.305882
| 0.376471
| 0
| 0
| 0
| 0
| 0
| 0
| 0.013468
| 0.144092
| 347
| 15
| 46
| 23.133333
| 0.845118
| 0
| 0
| 0
| 0
| 0
| 0.023055
| 0
| 0
| 0
| 0
| 0
| 0.272727
| 1
| 0.363636
| false
| 0
| 0.181818
| 0.090909
| 0.636364
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
e86d7bb7adc6a7573c9402851337b42bd4d3d8ca
| 248
|
py
|
Python
|
website_project/admin.py
|
jakubpliszka/website_project
|
de6925253fe5397b584086f1b9acc86532301d68
|
[
"MIT"
] | null | null | null |
website_project/admin.py
|
jakubpliszka/website_project
|
de6925253fe5397b584086f1b9acc86532301d68
|
[
"MIT"
] | null | null | null |
website_project/admin.py
|
jakubpliszka/website_project
|
de6925253fe5397b584086f1b9acc86532301d68
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from website_project.models import ArrivalFlight, DepartureFlight, Destination
# Register your models here.
admin.site.register(DepartureFlight)
admin.site.register(ArrivalFlight)
admin.site.register(Destination)
| 27.555556
| 78
| 0.846774
| 29
| 248
| 7.206897
| 0.517241
| 0.129187
| 0.244019
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.080645
| 248
| 8
| 79
| 31
| 0.916667
| 0.104839
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.4
| 0
| 0.4
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
e86e63a4a80e6a28ae6f42c9ba80c7fe0b2213a8
| 775
|
py
|
Python
|
ecojunk/core/api/permissions.py
|
PIN-UPV/EcoJunkWebServer
|
53a42687c303ffe345f59dc1f11fa41c3526f6d7
|
[
"MIT"
] | 1
|
2018-10-02T11:54:26.000Z
|
2018-10-02T11:54:26.000Z
|
ecojunk/core/api/permissions.py
|
PIN-UPV/EcoJunkWebServer
|
53a42687c303ffe345f59dc1f11fa41c3526f6d7
|
[
"MIT"
] | 8
|
2018-10-03T08:02:39.000Z
|
2018-11-21T07:42:26.000Z
|
ecojunk/core/api/permissions.py
|
PIN-UPV/EcoJunkWebServer
|
53a42687c303ffe345f59dc1f11fa41c3526f6d7
|
[
"MIT"
] | 1
|
2018-10-02T11:54:32.000Z
|
2018-10-02T11:54:32.000Z
|
from rest_framework import permissions
class NoDeletes(permissions.BasePermission):
"""Doesn't allow deletes for the resource."""
def has_permission(self, request, view):
if request.method == "DELETE":
return False
return True
def has_object_permission(self, request, view, obj):
if request.method == "DELETE":
return False
return True
class NoUpdates(permissions.BasePermission):
"""Doesn't allow updates for the resource."""
def has_permission(self, request, view):
if request.method == "PATCH":
return False
return True
def has_object_permission(self, request, view, obj):
if request.method == "PATCH":
return False
return True
| 25.833333
| 56
| 0.633548
| 87
| 775
| 5.563218
| 0.367816
| 0.049587
| 0.173554
| 0.206612
| 0.842975
| 0.694215
| 0.694215
| 0.694215
| 0.561983
| 0.561983
| 0
| 0
| 0.276129
| 775
| 29
| 57
| 26.724138
| 0.862745
| 0.101935
| 0
| 0.842105
| 0
| 0
| 0.032117
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.210526
| false
| 0
| 0.052632
| 0
| 0.789474
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
e89a1bbf4a2114a81baaa2b55241d82bf24d2c9d
| 47
|
py
|
Python
|
pyUSID/__version__.py
|
sulaymandesai/pyUSID
|
fa4d152856e4717c92b1fbe34222eb2e1c042707
|
[
"MIT"
] | null | null | null |
pyUSID/__version__.py
|
sulaymandesai/pyUSID
|
fa4d152856e4717c92b1fbe34222eb2e1c042707
|
[
"MIT"
] | null | null | null |
pyUSID/__version__.py
|
sulaymandesai/pyUSID
|
fa4d152856e4717c92b1fbe34222eb2e1c042707
|
[
"MIT"
] | null | null | null |
version = '0.0.9'
time = '2020-09-17 11:20:25'
| 15.666667
| 28
| 0.595745
| 11
| 47
| 2.545455
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.425
| 0.148936
| 47
| 2
| 29
| 23.5
| 0.275
| 0
| 0
| 0
| 0
| 0
| 0.510638
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
e8a7c97d7015452b6c76ca3374e54172089b338e
| 234
|
py
|
Python
|
qulab/db/query.py
|
liuqichun3809/quantum-lab
|
05bea707b314ea1687866f56ee439079336cfbbc
|
[
"MIT"
] | 3
|
2020-08-30T16:11:49.000Z
|
2021-03-05T12:09:30.000Z
|
qulab/db/query.py
|
liuqichun3809/quantum-lab
|
05bea707b314ea1687866f56ee439079336cfbbc
|
[
"MIT"
] | null | null | null |
qulab/db/query.py
|
liuqichun3809/quantum-lab
|
05bea707b314ea1687866f56ee439079336cfbbc
|
[
"MIT"
] | 2
|
2019-07-24T15:12:31.000Z
|
2019-09-20T02:17:28.000Z
|
from .schema.app import getApplication, listApplication
from .schema.code_mod import getModuleByFullname
from .schema.drv_inst import getInstrumentByName
from .schema.record import query_records
from .schema.user import getUserByName
| 39
| 55
| 0.863248
| 29
| 234
| 6.862069
| 0.586207
| 0.251256
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.089744
| 234
| 5
| 56
| 46.8
| 0.934272
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
e8d00bb66182638b8928e3dc7e618036a28233c3
| 43
|
py
|
Python
|
tests/__init__.py
|
ziv1234/python-dynalite-devices
|
870daea2e540973fb913afdfff8425dae546708a
|
[
"MIT"
] | 3
|
2020-04-23T09:03:19.000Z
|
2021-12-07T15:33:20.000Z
|
tests/__init__.py
|
ziv1234/python-dynalite-devices
|
870daea2e540973fb913afdfff8425dae546708a
|
[
"MIT"
] | 3
|
2021-02-23T14:02:18.000Z
|
2022-03-03T07:22:22.000Z
|
tests/__init__.py
|
ziv1234/python-dynalite-devices
|
870daea2e540973fb913afdfff8425dae546708a
|
[
"MIT"
] | 3
|
2020-05-05T05:08:22.000Z
|
2022-01-05T04:31:53.000Z
|
"""Testing for Dynalite Communications."""
| 21.5
| 42
| 0.744186
| 4
| 43
| 8
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.093023
| 43
| 1
| 43
| 43
| 0.820513
| 0.837209
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
2cf1e8de55bdfecda5f2b91f609ae0da92575b9d
| 376
|
py
|
Python
|
create_bumblebee_app.py
|
Omarzintan/bumblebee-ai
|
0b8c5cecf032730e23b1b710a88538f5e4ea70c9
|
[
"MIT"
] | 3
|
2021-05-06T16:29:26.000Z
|
2022-01-09T03:32:40.000Z
|
create_bumblebee_app.py
|
Omarzintan/bumblebee-ai
|
0b8c5cecf032730e23b1b710a88538f5e4ea70c9
|
[
"MIT"
] | 1
|
2021-05-20T17:59:12.000Z
|
2021-05-20T17:59:12.000Z
|
create_bumblebee_app.py
|
Omarzintan/bumblebee-ai
|
0b8c5cecf032730e23b1b710a88538f5e4ea70c9
|
[
"MIT"
] | null | null | null |
from helpers import bumblebee_root, python3_path
with open("bumblebee_app", "w") as file:
file.write("#!/bin/sh\n")
file.write("export BUMBLEBEE_PATH="+bumblebee_root+"\n")
file.write("export PYTHON3_PATH="+python3_path+"\n")
file.write("export SERVER_URL=http://127.0.0.1:5000\n")
file.write("\n")
file.write("$PYTHON3_PATH $BUMBLEBEE_PATH/main.py")
| 37.6
| 60
| 0.694149
| 58
| 376
| 4.327586
| 0.465517
| 0.215139
| 0.199203
| 0.191235
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.042296
| 0.119681
| 376
| 9
| 61
| 41.777778
| 0.716012
| 0
| 0
| 0
| 0
| 0
| 0.401596
| 0.06117
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.125
| 0
| 0.125
| 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
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
fa0ad380650fa790ff534a87b82e7be4358d7c0f
| 145
|
py
|
Python
|
general/admin.py
|
ma1VAR3/Enhanced-Noticeboard
|
cef224ab4754989923db15bb800e982a0a30c1ae
|
[
"MIT"
] | null | null | null |
general/admin.py
|
ma1VAR3/Enhanced-Noticeboard
|
cef224ab4754989923db15bb800e982a0a30c1ae
|
[
"MIT"
] | null | null | null |
general/admin.py
|
ma1VAR3/Enhanced-Noticeboard
|
cef224ab4754989923db15bb800e982a0a30c1ae
|
[
"MIT"
] | 2
|
2021-02-01T03:05:29.000Z
|
2021-02-02T04:42:27.000Z
|
from django.contrib import admin
# Register your models here.
from .models import Event,FAQ
admin.site.register(Event)
admin.site.register(FAQ)
| 20.714286
| 32
| 0.8
| 22
| 145
| 5.272727
| 0.545455
| 0.155172
| 0.293103
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.110345
| 145
| 6
| 33
| 24.166667
| 0.899225
| 0.17931
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
fa2190ac4ee159b0e2ddd16c61b8c63c789a139a
| 109
|
py
|
Python
|
hubspot/crm/association_type.py
|
fakepop/hubspot-api-python
|
f04103a09f93f5c26c99991b25fa76801074f3d3
|
[
"Apache-2.0"
] | 117
|
2020-04-06T08:22:53.000Z
|
2022-03-18T03:41:29.000Z
|
hubspot/crm/association_type.py
|
fakepop/hubspot-api-python
|
f04103a09f93f5c26c99991b25fa76801074f3d3
|
[
"Apache-2.0"
] | 62
|
2020-04-06T16:21:06.000Z
|
2022-03-17T16:50:44.000Z
|
hubspot/crm/association_type.py
|
fakepop/hubspot-api-python
|
f04103a09f93f5c26c99991b25fa76801074f3d3
|
[
"Apache-2.0"
] | 45
|
2020-04-06T16:13:52.000Z
|
2022-03-30T21:33:17.000Z
|
class AssociationType:
COMPANY_TO_CONTACT = "company_to_contact"
CONTACT_TO_DEAL = "contact_to_deal"
| 27.25
| 45
| 0.788991
| 14
| 109
| 5.571429
| 0.428571
| 0.230769
| 0.410256
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.146789
| 109
| 3
| 46
| 36.333333
| 0.83871
| 0
| 0
| 0
| 0
| 0
| 0.302752
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
fa65e75f27a4ac7b777e06372c0c91e439eb9abc
| 59
|
py
|
Python
|
malaya_speech/train/model/fastspeechsplit/__init__.py
|
ishine/malaya-speech
|
fd34afc7107af1656dff4b3201fa51dda54fde18
|
[
"MIT"
] | 111
|
2020-08-31T04:58:54.000Z
|
2022-03-29T15:44:18.000Z
|
malaya_speech/train/model/fastspeechsplit/__init__.py
|
ishine/malaya-speech
|
fd34afc7107af1656dff4b3201fa51dda54fde18
|
[
"MIT"
] | 14
|
2020-12-16T07:27:22.000Z
|
2022-03-15T17:39:01.000Z
|
malaya_speech/train/model/fastspeechsplit/__init__.py
|
ishine/malaya-speech
|
fd34afc7107af1656dff4b3201fa51dda54fde18
|
[
"MIT"
] | 29
|
2021-02-09T08:57:15.000Z
|
2022-03-12T14:09:19.000Z
|
from .model import Model, Model_F0
from . import inference
| 19.666667
| 34
| 0.79661
| 9
| 59
| 5.111111
| 0.555556
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02
| 0.152542
| 59
| 2
| 35
| 29.5
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
d7013a02b214517ac16dac7f4d8c27e152c81b58
| 60
|
py
|
Python
|
nemo/backends/pytorch/torchvision/__init__.py
|
vsl9/NeMo
|
4137c2b4e3cba0ec5ca1da7b58b3ff97fdb25e50
|
[
"Apache-2.0"
] | 10
|
2020-03-17T08:32:06.000Z
|
2021-04-19T19:03:50.000Z
|
nemo/backends/pytorch/torchvision/__init__.py
|
vsl9/NeMo
|
4137c2b4e3cba0ec5ca1da7b58b3ff97fdb25e50
|
[
"Apache-2.0"
] | 3
|
2020-11-13T17:45:41.000Z
|
2022-03-12T00:28:59.000Z
|
nemo/backends/pytorch/torchvision/__init__.py
|
vsl9/NeMo
|
4137c2b4e3cba0ec5ca1da7b58b3ff97fdb25e50
|
[
"Apache-2.0"
] | 3
|
2020-03-10T05:10:07.000Z
|
2020-12-08T01:33:35.000Z
|
# Copyright (c) 2019 NVIDIA Corporation
from .data import *
| 20
| 39
| 0.75
| 8
| 60
| 5.625
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.08
| 0.166667
| 60
| 2
| 40
| 30
| 0.82
| 0.616667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
d7066adff8f44144c2c2ad35f9b1b288b372772f
| 11,257
|
py
|
Python
|
RankBasedMonteCarlo/Methods.py
|
tazzben/RankBasedMonteCarlo
|
1471891668ef545950a966085e8afd0582f6dd9b
|
[
"MIT"
] | null | null | null |
RankBasedMonteCarlo/Methods.py
|
tazzben/RankBasedMonteCarlo
|
1471891668ef545950a966085e8afd0582f6dd9b
|
[
"MIT"
] | null | null | null |
RankBasedMonteCarlo/Methods.py
|
tazzben/RankBasedMonteCarlo
|
1471891668ef545950a966085e8afd0582f6dd9b
|
[
"MIT"
] | null | null | null |
import numpy
import pandas
import sys
import multiprocessing
class _RankBasedMonteCarlo:
def _RandomRank(self, ns):
objects = numpy.concatenate(
[numpy.repeat((i + 1), n) for i, n in enumerate(ns)], axis=None
)
numpy.random.shuffle(objects)
return pandas.DataFrame({"Group": objects.tolist(),}).assign(
Rank=range(1, objects.size + 1)
)
def _RandomStatistic(self, sampleSizes):
sample = self._RandomRank(sampleSizes)
return self._CalculateStatistic(sample)
def _PoolMonteCarlo(self, ns, reps):
p = multiprocessing.Pool()
r = []
for i, result in enumerate(
p.imap_unordered(self._RandomStatistic, (ns,) * reps)
):
r.append(result)
sys.stderr.write("\r{: .2f}% done".format(100 * i / reps))
p.close()
p.join()
return numpy.array(r)
def _CalculateStatistic(self, sample):
return sample["Rank"].median()
def PrintCriticalValueTable(
self,
ns,
reps=10000,
observedValue=None,
PrintToScreen=True,
cvs=[0.01, 0.025, 0.05, 0.1],
reverseDist=False,
):
"""
Prints the critical values and p-value, if an observed test statistic is
supplied. The method returns a dictionary of critical values and p-value as
a tuple.
Parameters
----------
ns : tuple
A tuple listing the number of observations per group. For instance (6,5)
reps : int
The number of repetitions the process completes before producing critical
values. Default is 10,000.
observedValue : float
Optional value used to determine p-value
PrintToScreen : bool
Specifies if the critical values are printed to the screen. Defaults
to True.
cvs : list
Specifies a list of critical values.
reviseDist : bool
Parameter to reverse the direction of the null distribution for the
purposes of calculating p-values. Defaults to standard.
Returns
_______
criticalValues : dictionary
A dictionary of critical values corresponding to
the specified parameter list.
pvalue : float or None
The p-value of the observedValue specified in the parameter list
(None if unspecified).
"""
r = self._PoolMonteCarlo(ns, reps)
cvresults = []
for i in cvs:
qvalue = numpy.quantile(r, i)
cvresults.append(qvalue)
if PrintToScreen:
print(
"\n"
+ pandas.DataFrame(
zip(cvs, cvresults), columns=["Quantile", "Critical Value"]
).to_string(index=False)
)
try:
observedValue = float(observedValue)
pvalue = (
len(r[(r > observedValue)]) / reps
if reverseDist
else len(r[(r < observedValue)]) / reps
)
if PrintToScreen:
print(
"Percent of distribution "
+ ("above" if reverseDist else "below")
+ " the observed value:"
+ "{: .4f}".format(pvalue)
)
return (dict(zip(cvs, cvresults)), pvalue)
except:
return (dict(zip(cvs, cvresults)), None)
class MonteCarloKolmogorovSmirnov(_RankBasedMonteCarlo):
""" Calculates the null hypothesis distribution of the two sample Kolmogorov-Smirnov test
"""
def _CalculateStatistic(self, sample):
n1len = len(sample[sample["Group"] == 1].index)
n2len = len(sample[sample["Group"] == 2].index)
return numpy.array(
[
numpy.abs(
len(sample[((sample["Group"] == 1) & (sample["Rank"] <= x))].index)
/ n1len
- len(
sample[((sample["Group"] == 2) & (sample["Rank"] <= x))].index
)
/ n2len
)
for x in sample["Rank"]
]
).max()
def PrintCriticalValueTable(
self,
ns,
reps=10000,
observedValue=None,
PrintToScreen=True,
cvs=[0.9, 0.95, 0.975, 0.99],
reverseDist=True,
):
"""
Prints the critical values and p-value, if an observed test statistic is
supplied. The method returns a dictionary of critical values and p-value as
a tuple.
Parameters
----------
ns : tuple
A tuple listing the number of observations per group. For instance (6,5)
reps : int
The number of repetitions the process completes before producing critical
values. Default is 10,000.
observedValue : float
Optional value used to determine p-value
PrintToScreen : bool
Specifies if the critical values are printed to the screen. Defaults
to True.
cvs : list
Specifies a list of critical values.
reviseDist : bool
Parameter to reverse the direction of the null distribution for the
purposes of calculating p-values. Defaults to standard.
Returns
_______
criticalValues : dictionary
A dictionary of critical values corresponding to
the specified parameter list.
pvalue : float or None
The p-value of the observedValue specified in the parameter list
(None if unspecified).
"""
return super().PrintCriticalValueTable(
ns, reps, observedValue, PrintToScreen, cvs, reverseDist
)
class MonteCarloKuiper(_RankBasedMonteCarlo):
""" Calculates the null hypothesis distribution of the two sample Kuiper test
"""
def _CalculateStatistic(self, sample):
n1len = len(sample[sample["Group"] == 1].index)
n2len = len(sample[sample["Group"] == 2].index)
dPos = numpy.array(
[
len(sample[((sample["Group"] == 1) & (sample["Rank"] <= x))].index)
/ n1len
- len(sample[((sample["Group"] == 2) & (sample["Rank"] <= x))].index)
/ n2len
for x in sample["Rank"]
]
).max()
dNeg = numpy.array(
[
len(sample[((sample["Group"] == 2) & (sample["Rank"] <= x))].index)
/ n2len
- len(sample[((sample["Group"] == 1) & (sample["Rank"] <= x))].index)
/ n1len
for x in sample["Rank"]
]
).max()
return dPos + dNeg
def PrintCriticalValueTable(
self,
ns,
reps=10000,
observedValue=None,
PrintToScreen=True,
cvs=[0.9, 0.95, 0.975, 0.99],
reverseDist=True,
):
"""
Prints the critical values and p-value, if an observed test statistic is
supplied. The method returns a dictionary of critical values and p-value as
a tuple.
Parameters
----------
ns : tuple
A tuple listing the number of observations per group. For instance (6,5)
reps : int
The number of repetitions the process completes before producing critical
values. Default is 10,000.
observedValue : float
Optional value used to determine p-value
PrintToScreen : bool
Specifies if the critical values are printed to the screen. Defaults
to True.
cvs : list
Specifies a list of critical values.
reviseDist : bool
Parameter to reverse the direction of the null distribution for the
purposes of calculating p-values. Defaults to standard.
Returns
_______
criticalValues : dictionary
A dictionary of critical values corresponding to
the specified parameter list.
pvalue : float or None
The p-value of the observedValue specified in the parameter list
(None if unspecified).
"""
return super().PrintCriticalValueTable(
ns, reps, observedValue, PrintToScreen, cvs, reverseDist
)
class MonteCarloMannWhitney(_RankBasedMonteCarlo):
""" Calculates the null hypothesis distribution of the Mann-Whitney test
"""
def _CalculateStatistic(self, sample):
n1len = len(sample[sample["Group"] == 1].index)
U1 = sample[sample["Group"] == 1]["Rank"].sum() - (n1len * (n1len + 1)) / 2
return U1
class MonteCarloKruskalWallis(_RankBasedMonteCarlo):
""" Calculates the null hypothesis distribution of the Kruskal–Wallis test
"""
def _CalculateStatistic(self, sample):
n = len(sample.index)
rbar = 0.5 * (n + 1)
divisor = 0
numerator = 0
for group in pandas.unique(sample["Group"]):
grouplen = len(sample[sample["Group"] == group].index)
groupmean = sample[sample["Group"] == group]["Rank"].mean()
divisor += numpy.array(
[
numpy.power((x - rbar), 2)
for x in sample[sample["Group"] == group]["Rank"]
]
).sum()
numerator += grouplen * numpy.power((groupmean - rbar), 2)
return ((n - 1) * numerator) / divisor
def PrintCriticalValueTable(
self,
ns,
reps=10000,
observedValue=None,
PrintToScreen=True,
cvs=[0.9, 0.95, 0.975, 0.99],
reverseDist=True,
):
"""
Prints the critical values and p-value, if an observed test statistic is
supplied. The method returns a dictionary of critical values and p-value as
a tuple.
Parameters
----------
ns : tuple
A tuple listing the number of observations per group. For instance (6,5)
reps : int
The number of repetitions the process completes before producing critical
values. Default is 10,000.
observedValue : float
Optional value used to determine p-value
PrintToScreen : bool
Specifies if the critical values are printed to the screen. Defaults
to True.
cvs : list
Specifies a list of critical values.
reviseDist : bool
Parameter to reverse the direction of the null distribution for the
purposes of calculating p-values. Defaults to standard.
Returns
_______
criticalValues : dictionary
A dictionary of critical values corresponding to
the specified parameter list.
pvalue : float or None
The p-value of the observedValue specified in the parameter list
(None if unspecified).
"""
return super().PrintCriticalValueTable(
ns, reps, observedValue, PrintToScreen, cvs, reverseDist
)
| 33.804805
| 94
| 0.552723
| 1,162
| 11,257
| 5.314974
| 0.160069
| 0.054404
| 0.041289
| 0.03886
| 0.768135
| 0.745952
| 0.731865
| 0.731865
| 0.711464
| 0.711464
| 0
| 0.019581
| 0.360309
| 11,257
| 332
| 95
| 33.906627
| 0.837939
| 0.450742
| 0
| 0.418182
| 0
| 0
| 0.040687
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.072727
| false
| 0
| 0.024242
| 0.006061
| 0.206061
| 0.012121
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
d722341e91fde997cd6ae5d779ea250134837235
| 1,157
|
py
|
Python
|
deepdab/ai/__init__.py
|
lantunes/deepdab
|
0e30f102b9d7c37d3691540496b1649f2704d586
|
[
"Apache-2.0"
] | 1
|
2019-04-04T02:26:51.000Z
|
2019-04-04T02:26:51.000Z
|
deepdab/ai/__init__.py
|
lantunes/deepdab
|
0e30f102b9d7c37d3691540496b1649f2704d586
|
[
"Apache-2.0"
] | null | null | null |
deepdab/ai/__init__.py
|
lantunes/deepdab
|
0e30f102b9d7c37d3691540496b1649f2704d586
|
[
"Apache-2.0"
] | null | null | null |
from .tabular_policy import *
from .td0_policy import *
from .td1_tabular_policy import *
from .td1_gradient_policy import *
from .td1_gradient_policy_v2 import *
from .td1_gradient_policy_cnn import *
from .td1_gradient_policy_linear_v2 import *
from .td1_gradient_policy_mlp_v2 import *
from .td1_gradient_policy_cnn_v2 import *
from .td1_gradient_policy_cnn_v2b import *
from .td1_gradient_policy_cnn_v2c import *
from .td1_gradient_policy_cnn_v2d import *
from .td1_gradient_3x3_policy_cnn_v2 import *
from .level1_heuristic_policy import *
from .level2_heuristic_policy import *
from .causal_entropic_policy import *
from .pg_policy_cnn import *
from .mcts_game import *
from .mcts_policy import *
from .mcts_policy2 import *
from .mcts_root_parallel_policy import *
from .pg_policy_cnn2 import *
from .pg_policy_mcts_cnn2 import *
from .pg_policy_3x3_cnn import *
from .mcts_policy_net_policy import *
from .mcts_policy_net_policy_cpuct import *
from .pg_policy_cnn3 import *
from .pg_policy_cnn4 import *
from .pg_policy_cnn2_adversarial import *
from .pg_policy_cnn2b import *
from .sl_value_3x3_cnn import *
from .pg_policy_3x3_cnn_5layer import *
| 35.060606
| 45
| 0.834054
| 182
| 1,157
| 4.82967
| 0.197802
| 0.352673
| 0.162685
| 0.238908
| 0.56314
| 0.399317
| 0.109215
| 0
| 0
| 0
| 0
| 0.036929
| 0.110631
| 1,157
| 32
| 46
| 36.15625
| 0.817298
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
d78d417a9946e184ad415d5e1948b6b670534e75
| 87
|
py
|
Python
|
pyeccodes/defs/grib2/tables/local/ecmf/4/1_2_table.py
|
ecmwf/pyeccodes
|
dce2c72d3adcc0cb801731366be53327ce13a00b
|
[
"Apache-2.0"
] | 7
|
2020-04-14T09:41:17.000Z
|
2021-08-06T09:38:19.000Z
|
pyeccodes/defs/grib2/tables/local/ecmf/4/1_2_table.py
|
ecmwf/pyeccodes
|
dce2c72d3adcc0cb801731366be53327ce13a00b
|
[
"Apache-2.0"
] | null | null | null |
pyeccodes/defs/grib2/tables/local/ecmf/4/1_2_table.py
|
ecmwf/pyeccodes
|
dce2c72d3adcc0cb801731366be53327ce13a00b
|
[
"Apache-2.0"
] | 3
|
2020-04-30T12:44:48.000Z
|
2020-12-15T08:40:26.000Z
|
def load(h):
return ({'abbr': 191, 'code': 191, 'title': 'funny reference time'},)
| 29
| 73
| 0.586207
| 12
| 87
| 4.25
| 0.916667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.083333
| 0.172414
| 87
| 2
| 74
| 43.5
| 0.625
| 0
| 0
| 0
| 0
| 0
| 0.37931
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0
| 0.5
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
ad0706e87db3da5b6e0f3321c800e889dd63b66f
| 75
|
py
|
Python
|
src/test/resources/python-code-examples/throw_return.py
|
florayym/depends
|
6c437a78268d91d54059b560c0273ae3c9253452
|
[
"BSD-3-Clause",
"MIT"
] | 146
|
2019-03-09T03:02:59.000Z
|
2022-03-28T11:28:41.000Z
|
src/test/resources/python-code-examples/throw_return.py
|
florayym/depends
|
6c437a78268d91d54059b560c0273ae3c9253452
|
[
"BSD-3-Clause",
"MIT"
] | 27
|
2019-03-11T02:12:54.000Z
|
2021-12-21T00:24:13.000Z
|
src/test/resources/python-code-examples/throw_return.py
|
florayym/depends
|
6c437a78268d91d54059b560c0273ae3c9253452
|
[
"BSD-3-Clause",
"MIT"
] | 41
|
2019-03-09T03:04:50.000Z
|
2022-01-14T06:53:14.000Z
|
class Bar():
pass
def t1():
raise Bar()
def t2():
return Bar()
| 6.818182
| 14
| 0.52
| 11
| 75
| 3.545455
| 0.727273
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.038462
| 0.306667
| 75
| 10
| 15
| 7.5
| 0.711538
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| true
| 0.166667
| 0
| 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
| 1
| 1
| 1
| 0
| 1
| 0
| 0
|
0
| 5
|
ad26491c3ba25dfdfa993b707c490b7194c94836
| 53
|
py
|
Python
|
test.py
|
T-Terra/password-manager
|
87df40dbdb8d9e24b1e20ef40c2db8a55a64890c
|
[
"MIT"
] | null | null | null |
test.py
|
T-Terra/password-manager
|
87df40dbdb8d9e24b1e20ef40c2db8a55a64890c
|
[
"MIT"
] | null | null | null |
test.py
|
T-Terra/password-manager
|
87df40dbdb8d9e24b1e20ef40c2db8a55a64890c
|
[
"MIT"
] | null | null | null |
from lib.screen import screen_insert
screen_insert()
| 17.666667
| 36
| 0.849057
| 8
| 53
| 5.375
| 0.625
| 0.55814
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.09434
| 53
| 3
| 37
| 17.666667
| 0.895833
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
ad2e3ad0758b96b25bd669d36e9eeb2f333fee03
| 65
|
py
|
Python
|
tests/conftest.py
|
reinhard-mueller/webargs
|
907a394762403ab4309bc950c93e19eafb92806e
|
[
"MIT"
] | 601
|
2015-01-02T20:56:39.000Z
|
2018-12-27T00:41:15.000Z
|
tests/conftest.py
|
reinhard-mueller/webargs
|
907a394762403ab4309bc950c93e19eafb92806e
|
[
"MIT"
] | 219
|
2018-12-27T22:21:05.000Z
|
2022-03-17T16:19:35.000Z
|
tests/conftest.py
|
reinhard-mueller/webargs
|
907a394762403ab4309bc950c93e19eafb92806e
|
[
"MIT"
] | 104
|
2015-02-03T18:20:00.000Z
|
2018-12-17T08:11:34.000Z
|
import pytest
pytest.register_assert_rewrite("webargs.testing")
| 16.25
| 49
| 0.846154
| 8
| 65
| 6.625
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.061538
| 65
| 3
| 50
| 21.666667
| 0.868852
| 0
| 0
| 0
| 0
| 0
| 0.230769
| 0
| 0
| 0
| 0
| 0
| 0.5
| 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
| 1
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
ad5cd562cfdf6969dabd29458489a377a2fa0dcf
| 71
|
py
|
Python
|
pyrovision/models/__init__.py
|
frgfm/pyronear
|
9dd063ac958a5c5e96815bb31c8f75b62ce026e7
|
[
"Apache-2.0"
] | 9
|
2019-10-01T08:37:49.000Z
|
2020-05-11T03:58:52.000Z
|
pyrovision/models/__init__.py
|
frgfm/pyronear
|
9dd063ac958a5c5e96815bb31c8f75b62ce026e7
|
[
"Apache-2.0"
] | 71
|
2019-09-20T18:45:33.000Z
|
2020-06-01T15:45:26.000Z
|
pyrovision/models/__init__.py
|
frgfm/pyronear
|
9dd063ac958a5c5e96815bb31c8f75b62ce026e7
|
[
"Apache-2.0"
] | 14
|
2019-09-24T15:19:27.000Z
|
2020-05-01T14:40:12.000Z
|
from .resnet import *
from .mobilenetv3 import *
from .rexnet import *
| 17.75
| 26
| 0.746479
| 9
| 71
| 5.888889
| 0.555556
| 0.377358
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.016949
| 0.169014
| 71
| 3
| 27
| 23.666667
| 0.881356
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
ad7f74c293e495e258526ea2b523c5ac6be8c36f
| 152
|
py
|
Python
|
labnote/__init__.py
|
LiorZ/labnote
|
d3732e8ce6414796c1631ac009147e7488012066
|
[
"BSD-2-Clause-FreeBSD"
] | 19
|
2017-02-23T04:02:54.000Z
|
2021-02-04T12:34:57.000Z
|
labnote/__init__.py
|
LiorZ/labnote
|
d3732e8ce6414796c1631ac009147e7488012066
|
[
"BSD-2-Clause-FreeBSD"
] | 1
|
2019-03-06T23:27:46.000Z
|
2019-03-06T23:27:46.000Z
|
labnote/__init__.py
|
LiorZ/labnote
|
d3732e8ce6414796c1631ac009147e7488012066
|
[
"BSD-2-Clause-FreeBSD"
] | 4
|
2017-06-16T03:47:44.000Z
|
2022-02-18T03:40:49.000Z
|
"""
labnote
"""
__version__ = 0.9
from labnote.notebook import Notebook
from labnote.entry import Entry
from labnote.categories import CategoryManager
| 16.888889
| 46
| 0.802632
| 19
| 152
| 6.210526
| 0.526316
| 0.279661
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.015038
| 0.125
| 152
| 8
| 47
| 19
| 0.87218
| 0.046053
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.75
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
ad88a984e64dd490d3507b24f5661807ea5a5084
| 60
|
py
|
Python
|
didyprog/_allennlp/modules/__init__.py
|
minhnhat93/didyprog
|
78886ed939d269b9b2bcb192bf849aa34082880c
|
[
"MIT"
] | 57
|
2018-07-11T09:02:12.000Z
|
2022-03-16T03:47:19.000Z
|
didyprog/_allennlp/modules/__init__.py
|
minhnhat93/didyprog
|
78886ed939d269b9b2bcb192bf849aa34082880c
|
[
"MIT"
] | 7
|
2018-11-27T08:07:58.000Z
|
2020-06-04T21:45:47.000Z
|
didyprog/_allennlp/modules/__init__.py
|
minhnhat93/didyprog
|
78886ed939d269b9b2bcb192bf849aa34082880c
|
[
"MIT"
] | 18
|
2018-07-11T08:32:26.000Z
|
2022-03-07T07:45:00.000Z
|
from .conditional_random_field import ConditionalRandomField
| 60
| 60
| 0.933333
| 6
| 60
| 9
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.05
| 60
| 1
| 60
| 60
| 0.947368
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
ad891ba0db3078367abe491717e1d732d3a1a4f2
| 46
|
py
|
Python
|
core/models/icnet/__init__.py
|
matthew-wave/pool
|
698c140d161f369ef6a198dec9ab8b91a4532fa8
|
[
"MIT"
] | 6
|
2020-04-17T10:13:28.000Z
|
2020-10-13T08:16:32.000Z
|
core/models/icnet/__init__.py
|
matthew-wave/pool
|
698c140d161f369ef6a198dec9ab8b91a4532fa8
|
[
"MIT"
] | null | null | null |
core/models/icnet/__init__.py
|
matthew-wave/pool
|
698c140d161f369ef6a198dec9ab8b91a4532fa8
|
[
"MIT"
] | 1
|
2021-05-14T08:11:08.000Z
|
2021-05-14T08:11:08.000Z
|
from core.models.icnet.icnet import get_icnet
| 23
| 45
| 0.847826
| 8
| 46
| 4.75
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.086957
| 46
| 1
| 46
| 46
| 0.904762
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
a8ed4715c858b6835ad6c7261c815e718240b999
| 6,592
|
py
|
Python
|
graphql/execution/experimental/tests/skip_test_resolver.py
|
phil303/graphql-core
|
f983e19cc8cd818275621e2909fb485cf227fe0c
|
[
"MIT"
] | null | null | null |
graphql/execution/experimental/tests/skip_test_resolver.py
|
phil303/graphql-core
|
f983e19cc8cd818275621e2909fb485cf227fe0c
|
[
"MIT"
] | null | null | null |
graphql/execution/experimental/tests/skip_test_resolver.py
|
phil303/graphql-core
|
f983e19cc8cd818275621e2909fb485cf227fe0c
|
[
"MIT"
] | 1
|
2020-01-17T00:41:46.000Z
|
2020-01-17T00:41:46.000Z
|
import mock
import pytest
from promise import Promise
from ....error import GraphQLError, GraphQLLocatedError
from ....language import ast
from ....type import (GraphQLEnumType, GraphQLField, GraphQLInt,
GraphQLInterfaceType, GraphQLList, GraphQLNonNull,
GraphQLObjectType, GraphQLScalarType, GraphQLSchema,
GraphQLString, GraphQLUnionType)
from ..fragment import Fragment
from ..resolver import field_resolver, type_resolver
@pytest.mark.parametrize("type,value,expected", [
(GraphQLString, 1, "1"),
(GraphQLInt, "1", 1),
(GraphQLNonNull(GraphQLString), 0, "0"),
(GraphQLNonNull(GraphQLInt), 0, 0),
(GraphQLList(GraphQLString), [1, 2], ['1', '2']),
(GraphQLList(GraphQLInt), ['1', '2'], [1, 2]),
(GraphQLList(GraphQLNonNull(GraphQLInt)), [0], [0]),
(GraphQLNonNull(GraphQLList(GraphQLInt)), [], []),
])
def test_type_resolver(type, value, expected):
resolver = type_resolver(type, lambda: value)
resolved = resolver()
assert resolved == expected
@pytest.mark.parametrize("type,value,expected", [
(GraphQLString, 1, "1"),
(GraphQLInt, "1", 1),
(GraphQLNonNull(GraphQLString), 0, "0"),
(GraphQLNonNull(GraphQLInt), 0, 0),
(GraphQLList(GraphQLString), [1, 2], ['1', '2']),
(GraphQLList(GraphQLInt), ['1', '2'], [1, 2]),
(GraphQLList(GraphQLNonNull(GraphQLInt)), [0], [0]),
(GraphQLNonNull(GraphQLList(GraphQLInt)), [], []),
])
def test_type_resolver_promise(type, value, expected):
promise_value = Promise()
resolver = type_resolver(type, lambda: promise_value)
resolved_promise = resolver()
assert not resolved_promise.is_fulfilled
promise_value.fulfill(value)
assert resolved_promise.is_fulfilled
resolved = resolved_promise.get()
assert resolved == expected
def raises():
raise Exception("raises")
def test_resolver_exception():
info = mock.MagicMock()
with pytest.raises(GraphQLLocatedError):
resolver = type_resolver(GraphQLString, raises, info=info)
resolver()
def test_field_resolver_mask_exception():
info = mock.MagicMock()
exe_context = mock.MagicMock()
exe_context.errors = []
field = GraphQLField(GraphQLString, resolver=raises)
resolver = field_resolver(field, info=info, exe_context=exe_context)
resolved = resolver()
assert resolved is None
assert len(exe_context.errors) == 1
assert str(exe_context.errors[0]) == 'raises'
def test_nonnull_field_resolver_mask_exception():
info = mock.MagicMock()
info.parent_type = 'parent_type'
info.field_name = 'field_name'
exe_context = mock.MagicMock()
exe_context.errors = []
field = GraphQLField(GraphQLNonNull(GraphQLString), resolver=raises)
resolver = field_resolver(field, info=info, exe_context=exe_context)
with pytest.raises(GraphQLLocatedError) as exc_info:
resolver()
assert str(exc_info.value) == 'raises'
def test_nonnull_field_resolver_fails_on_null_value():
info = mock.MagicMock()
info.parent_type = 'parent_type'
info.field_name = 'field_name'
exe_context = mock.MagicMock()
exe_context.errors = []
field = GraphQLField(GraphQLNonNull(GraphQLString), resolver=lambda *_: None)
resolver = field_resolver(field, info=info, exe_context=exe_context)
with pytest.raises(GraphQLError) as exc_info:
resolver()
assert str(exc_info.value) == 'Cannot return null for non-nullable field parent_type.field_name.'
def test_nonnull_list_field_resolver_fails_silently_on_null_value():
info = mock.MagicMock()
info.parent_type = 'parent_type'
info.field_name = 'field_name'
exe_context = mock.MagicMock()
exe_context.errors = []
field = GraphQLField(GraphQLList(GraphQLNonNull(GraphQLString)), resolver=lambda *_: ['1', None])
resolver = field_resolver(field, info=info, exe_context=exe_context)
assert resolver() is None
assert len(exe_context.errors) == 1
assert str(exe_context.errors[0]) == 'Cannot return null for non-nullable field parent_type.field_name.'
def test_nonnull_list_field_resolver_fails_on_null_value_top():
from ....pyutils.default_ordered_dict import DefaultOrderedDict
from ...base import collect_fields
DataType = GraphQLObjectType('DataType', {
'nonNullString': GraphQLField(GraphQLNonNull(GraphQLString), resolver=lambda *_: None),
})
info = mock.MagicMock()
info.parent_type = 'parent_type'
info.field_name = 'field_name'
exe_context = mock.MagicMock()
exe_context.errors = []
field = GraphQLField(GraphQLNonNull(DataType), resolver=lambda *_: 1)
selection_set = ast.SelectionSet(selections=[
ast.Field(
name=ast.Name(value='nonNullString'),
)
])
field_asts = collect_fields(
exe_context,
DataType,
selection_set,
DefaultOrderedDict(list),
set()
)
# node_fragment = Fragment(type=Node, field_asts=node_field_asts)
datetype_fragment = Fragment(type=DataType, field_asts=field_asts, context=exe_context)
resolver = field_resolver(field, info=info, exe_context=exe_context, fragment=datetype_fragment)
with pytest.raises(GraphQLError) as exc_info:
resolver()
assert not exe_context.errors
assert str(exc_info.value) == 'Cannot return null for non-nullable field parent_type.field_name.'
def test_nonnull_list_field_resolver_fails_on_null_value_top():
from ....pyutils.default_ordered_dict import DefaultOrderedDict
from ...base import collect_fields
DataType = GraphQLObjectType('DataType', {
'nonNullString': GraphQLField(GraphQLString, resolver=lambda *_: None),
})
info = mock.MagicMock()
info.parent_type = 'parent_type'
info.field_name = 'field_name'
exe_context = mock.MagicMock()
exe_context.errors = []
field = GraphQLField(GraphQLNonNull(DataType), resolver=lambda *_: 1)
selection_set = ast.SelectionSet(selections=[
ast.Field(
name=ast.Name(value='nonNullString'),
)
])
field_asts = collect_fields(
exe_context,
DataType,
selection_set,
DefaultOrderedDict(list),
set()
)
# node_fragment = Fragment(type=Node, field_asts=node_field_asts)
datetype_fragment = Fragment(type=DataType, field_asts=field_asts, context=exe_context)
resolver = field_resolver(field, info=info, exe_context=exe_context, fragment=datetype_fragment)
data = resolver()
assert data == {
'nonNullString': None
}
| 35.251337
| 108
| 0.698422
| 733
| 6,592
| 6.047749
| 0.121419
| 0.074442
| 0.039702
| 0.036319
| 0.778931
| 0.765396
| 0.747801
| 0.732236
| 0.732236
| 0.692984
| 0
| 0.008006
| 0.185225
| 6,592
| 186
| 109
| 35.44086
| 0.817352
| 0.019266
| 0
| 0.668831
| 0
| 0
| 0.069947
| 0.010678
| 0
| 0
| 0
| 0
| 0.097403
| 1
| 0.064935
| false
| 0
| 0.077922
| 0
| 0.142857
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
d1227ce50816f79af00187566cf0ea6040d361f6
| 189
|
py
|
Python
|
mathmatical_indunction.py
|
mushahidmehdi/MITx-6.00.1x
|
44a1b9bb87b5feb8d5a5ac7a8dec59e689dab5be
|
[
"MIT"
] | null | null | null |
mathmatical_indunction.py
|
mushahidmehdi/MITx-6.00.1x
|
44a1b9bb87b5feb8d5a5ac7a8dec59e689dab5be
|
[
"MIT"
] | null | null | null |
mathmatical_indunction.py
|
mushahidmehdi/MITx-6.00.1x
|
44a1b9bb87b5feb8d5a5ac7a8dec59e689dab5be
|
[
"MIT"
] | null | null | null |
# for a given numbers of array
# for example 1+2+3+4+5+6.........+n = (n(n+1))/2
# Semierly, assume!
# for n = 0 LHS ====> 0 ------> (0(1+0))/2 == 0
# k(k+1)/2 +(k+2) == ((k+1)(k+1))/2
| 31.5
| 50
| 0.439153
| 42
| 189
| 1.97619
| 0.452381
| 0.096386
| 0.072289
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.138158
| 0.195767
| 189
| 5
| 51
| 37.8
| 0.407895
| 0.941799
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
d14810782ac0ccf118cb7e93cf79bf0c47129c8d
| 106
|
py
|
Python
|
lib/protocols/__init__.py
|
PetterKraabol/vigilate-lopy
|
ef82171ab5a662faf528d7df9ebf7f1f09776758
|
[
"MIT"
] | null | null | null |
lib/protocols/__init__.py
|
PetterKraabol/vigilate-lopy
|
ef82171ab5a662faf528d7df9ebf7f1f09776758
|
[
"MIT"
] | null | null | null |
lib/protocols/__init__.py
|
PetterKraabol/vigilate-lopy
|
ef82171ab5a662faf528d7df9ebf7f1f09776758
|
[
"MIT"
] | null | null | null |
from .protocol import Protocol
from .http import HTTP
from .lorawan import LoRaWAN
from .uart import UART
| 21.2
| 30
| 0.811321
| 16
| 106
| 5.375
| 0.375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.150943
| 106
| 4
| 31
| 26.5
| 0.955556
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
d168c0b0fa29bccf4d1d2b8b6835092eb7bdce31
| 199
|
py
|
Python
|
Network_and_802.11/scapy/route.py
|
hacky1997/My-Gray-Hacker-Resources
|
e9b10ac7b0e557a9e624a5a6e761f9af4488d777
|
[
"MIT"
] | 14
|
2017-06-14T06:10:07.000Z
|
2019-02-22T03:21:15.000Z
|
Network_and_802.11/scapy/route.py
|
rookie-12/My-Gray-Hacker-Resources
|
e9b10ac7b0e557a9e624a5a6e761f9af4488d777
|
[
"MIT"
] | 1
|
2021-04-30T21:19:32.000Z
|
2021-04-30T21:19:32.000Z
|
Network_and_802.11/scapy/route.py
|
rookie-12/My-Gray-Hacker-Resources
|
e9b10ac7b0e557a9e624a5a6e761f9af4488d777
|
[
"MIT"
] | 7
|
2015-10-01T09:47:05.000Z
|
2022-01-21T14:25:37.000Z
|
#!/usr/bin/env python
__author__ = "bt3"
from scapy.all import *
print conf.route
conf.route.add(host='192.168.118.2', gw='192.168.1.114')
print conf.route
conf.route.resync()
print conf.route
| 13.266667
| 56
| 0.708543
| 35
| 199
| 3.914286
| 0.657143
| 0.328467
| 0.306569
| 0.262774
| 0.335766
| 0
| 0
| 0
| 0
| 0
| 0
| 0.12
| 0.120603
| 199
| 15
| 57
| 13.266667
| 0.662857
| 0.100503
| 0
| 0.428571
| 0
| 0
| 0.162011
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.142857
| null | null | 0.428571
| 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
| 1
|
0
| 5
|
0f05f8df0a1a8b68694335b994001089e2868124
| 38
|
py
|
Python
|
pysnobal/tests/__init__.py
|
scotthavens/pysnobal
|
9cff1e6cb2f1da4240132af4e1d2f5740092d2ef
|
[
"CC0-1.0"
] | 1
|
2022-01-26T16:47:44.000Z
|
2022-01-26T16:47:44.000Z
|
pysnobal/tests/__init__.py
|
scotthavens/pysnobal
|
9cff1e6cb2f1da4240132af4e1d2f5740092d2ef
|
[
"CC0-1.0"
] | null | null | null |
pysnobal/tests/__init__.py
|
scotthavens/pysnobal
|
9cff1e6cb2f1da4240132af4e1d2f5740092d2ef
|
[
"CC0-1.0"
] | 1
|
2022-02-08T22:31:27.000Z
|
2022-02-08T22:31:27.000Z
|
"""Unit test package for pysnobal."""
| 19
| 37
| 0.684211
| 5
| 38
| 5.2
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.131579
| 38
| 1
| 38
| 38
| 0.787879
| 0.815789
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
0f18ac05265bf684a351a1d9eb055e84e86aa3c5
| 37
|
py
|
Python
|
tests/unit/__init__.py
|
hdiogenes/flow_manager
|
29cacaca73b1c044b47abfced1740705b0b2d1b2
|
[
"MIT"
] | null | null | null |
tests/unit/__init__.py
|
hdiogenes/flow_manager
|
29cacaca73b1c044b47abfced1740705b0b2d1b2
|
[
"MIT"
] | 79
|
2017-10-04T17:47:19.000Z
|
2021-05-30T21:38:19.000Z
|
tests/unit/__init__.py
|
hdiogenes/flow_manager
|
29cacaca73b1c044b47abfced1740705b0b2d1b2
|
[
"MIT"
] | 15
|
2017-10-05T13:07:51.000Z
|
2021-06-01T12:16:27.000Z
|
"""kytos/flow_manager unit tests."""
| 18.5
| 36
| 0.702703
| 5
| 37
| 5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.081081
| 37
| 1
| 37
| 37
| 0.735294
| 0.810811
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
0f2c7d6b734963d1aa294bfb2c282e55d7f45049
| 127
|
py
|
Python
|
app/image_path_finder.py
|
nvllsvm/Tuatara
|
d681c33480d321b901f153e8348a4a812b33999c
|
[
"MIT"
] | null | null | null |
app/image_path_finder.py
|
nvllsvm/Tuatara
|
d681c33480d321b901f153e8348a4a812b33999c
|
[
"MIT"
] | null | null | null |
app/image_path_finder.py
|
nvllsvm/Tuatara
|
d681c33480d321b901f153e8348a4a812b33999c
|
[
"MIT"
] | null | null | null |
from config import image_directory
def main(filename):
filename = image_directory + filename + '.jpg'
return filename
| 21.166667
| 50
| 0.740157
| 15
| 127
| 6.133333
| 0.666667
| 0.304348
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.188976
| 127
| 5
| 51
| 25.4
| 0.893204
| 0
| 0
| 0
| 0
| 0
| 0.031496
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
7e15170668fe1df794116050824010aac1a744ee
| 178
|
py
|
Python
|
topics/topic_3/8_testing_system.py
|
VladBaryliuk/my_trainings
|
10c4bf2147c361ab918c591577a076b0d276ede0
|
[
"Apache-2.0"
] | null | null | null |
topics/topic_3/8_testing_system.py
|
VladBaryliuk/my_trainings
|
10c4bf2147c361ab918c591577a076b0d276ede0
|
[
"Apache-2.0"
] | null | null | null |
topics/topic_3/8_testing_system.py
|
VladBaryliuk/my_trainings
|
10c4bf2147c361ab918c591577a076b0d276ede0
|
[
"Apache-2.0"
] | null | null | null |
def testing_system(right_answer, Iras_answer):
if right_answer == Iras_answer:
print("YES")
else:
print("NO")
testing_system(int(input()), int(input()))
| 22.25
| 46
| 0.640449
| 23
| 178
| 4.695652
| 0.565217
| 0.240741
| 0.277778
| 0.388889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.207865
| 178
| 8
| 47
| 22.25
| 0.765957
| 0
| 0
| 0
| 0
| 0
| 0.027933
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0
| 0
| 0.166667
| 0.333333
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
7e244b1fceff6cfc40dbff642054b1e68a302a54
| 178
|
py
|
Python
|
vinhos/filters.py
|
LucasPanao/vinho
|
1b94a5475e76fcf6efa90cf2e55de82530704f96
|
[
"MIT"
] | null | null | null |
vinhos/filters.py
|
LucasPanao/vinho
|
1b94a5475e76fcf6efa90cf2e55de82530704f96
|
[
"MIT"
] | null | null | null |
vinhos/filters.py
|
LucasPanao/vinho
|
1b94a5475e76fcf6efa90cf2e55de82530704f96
|
[
"MIT"
] | null | null | null |
import django_filters
from .models import Vinhos
class VinhoFilter(django_filters.FilterSet):
class Meta:
model = Vinhos
fields = ['nome_vinho', 'tipo_vinho']
| 29.666667
| 45
| 0.713483
| 21
| 178
| 5.857143
| 0.714286
| 0.211382
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.202247
| 178
| 6
| 45
| 29.666667
| 0.866197
| 0
| 0
| 0
| 0
| 0
| 0.111732
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
7e345d956ce3a7a8060b5b6ef4375878432424fa
| 98
|
py
|
Python
|
run_preprocessing.py
|
PervasiveWellbeingTech/inquire-web-backend
|
0a078943701472897c288ca1f2683ed749685e92
|
[
"Apache-2.0"
] | 1
|
2020-10-07T09:35:47.000Z
|
2020-10-07T09:35:47.000Z
|
run_preprocessing.py
|
PervasiveWellbeingTech/inquire-web-backend
|
0a078943701472897c288ca1f2683ed749685e92
|
[
"Apache-2.0"
] | 1
|
2021-06-02T03:08:57.000Z
|
2021-06-02T03:08:57.000Z
|
run_preprocessing.py
|
PervasiveWellbeingTech/inquire-web-backend
|
0a078943701472897c288ca1f2683ed749685e92
|
[
"Apache-2.0"
] | null | null | null |
from raw_preprocessing.preprocessor import run_parse
if __name__ == '__main__':
run_parse(10)
| 24.5
| 52
| 0.785714
| 13
| 98
| 5.076923
| 0.846154
| 0.242424
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.023529
| 0.132653
| 98
| 4
| 53
| 24.5
| 0.752941
| 0
| 0
| 0
| 0
| 0
| 0.080808
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 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
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
7e74f8a96f8fd4cf427dc7c53233b12ecc13a54e
| 57
|
py
|
Python
|
glidernet_scraper/ogn/ddb/__init__.py
|
i4nf0x/soarspy
|
1beb21267c0d8bb8afb75e60bdc4399978144f09
|
[
"Apache-2.0"
] | null | null | null |
glidernet_scraper/ogn/ddb/__init__.py
|
i4nf0x/soarspy
|
1beb21267c0d8bb8afb75e60bdc4399978144f09
|
[
"Apache-2.0"
] | null | null | null |
glidernet_scraper/ogn/ddb/__init__.py
|
i4nf0x/soarspy
|
1beb21267c0d8bb8afb75e60bdc4399978144f09
|
[
"Apache-2.0"
] | null | null | null |
from ogn.ddb.utils import get_ddb_devices # noqa: F401
| 28.5
| 56
| 0.77193
| 10
| 57
| 4.2
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.0625
| 0.157895
| 57
| 1
| 57
| 57
| 0.8125
| 0.175439
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
7ea2c9fd000462d8cfa48f59adde1a960878e449
| 159
|
py
|
Python
|
mmdeploy/apis/onnx/__init__.py
|
grimoire/mmdeploy
|
e84bc30f4a036dd19cb3af854203922a91098e84
|
[
"Apache-2.0"
] | 746
|
2021-12-27T10:50:28.000Z
|
2022-03-31T13:34:14.000Z
|
mmdeploy/apis/onnx/__init__.py
|
grimoire/mmdeploy
|
e84bc30f4a036dd19cb3af854203922a91098e84
|
[
"Apache-2.0"
] | 253
|
2021-12-28T05:59:13.000Z
|
2022-03-31T18:22:25.000Z
|
mmdeploy/apis/onnx/__init__.py
|
grimoire/mmdeploy
|
e84bc30f4a036dd19cb3af854203922a91098e84
|
[
"Apache-2.0"
] | 147
|
2021-12-27T10:50:33.000Z
|
2022-03-30T10:44:20.000Z
|
# Copyright (c) OpenMMLab. All rights reserved.
from .export import export
from .partition import extract_partition
__all__ = ['export', 'extract_partition']
| 26.5
| 47
| 0.779874
| 19
| 159
| 6.210526
| 0.578947
| 0.271186
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125786
| 159
| 5
| 48
| 31.8
| 0.848921
| 0.283019
| 0
| 0
| 0
| 0
| 0.205357
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
7eb708a80d2a8dcfb2340bbf079c30e2f6f313a0
| 226
|
py
|
Python
|
worlds_worst_serverless/worlds_worst_mapper/guidelines.py
|
nigelmathes/worlds-worst-serverless
|
3f46474ce3da7e85671b6e988f2c55e8cee1554f
|
[
"MIT"
] | null | null | null |
worlds_worst_serverless/worlds_worst_mapper/guidelines.py
|
nigelmathes/worlds-worst-serverless
|
3f46474ce3da7e85671b6e988f2c55e8cee1554f
|
[
"MIT"
] | 11
|
2020-01-28T23:04:13.000Z
|
2021-06-06T02:49:23.000Z
|
worlds_worst_serverless/worlds_worst_mapper/guidelines.py
|
nigelmathes/worlds-worst-serverless
|
3f46474ce3da7e85671b6e988f2c55e8cee1554f
|
[
"MIT"
] | null | null | null |
ACTIONS_MAP = {
"attack": "do_combat",
"area": "do_combat",
"block": "do_combat",
"disrupt": "do_combat",
"dodge": "do_combat",
"change character": "change_class",
"change class": "change_class",
}
| 22.6
| 39
| 0.588496
| 25
| 226
| 5
| 0.48
| 0.32
| 0.272
| 0.352
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.212389
| 226
| 9
| 40
| 25.111111
| 0.702247
| 0
| 0
| 0
| 0
| 0
| 0.548673
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
0e4568e6997978f64fee850ce9c9ed7e73a1e467
| 48
|
py
|
Python
|
dbsl/lib/util/__init__.py
|
wezacon/DBSL.py
|
1d9ce5a66f8f24f5b992bca9712ad73daac194b4
|
[
"MIT"
] | null | null | null |
dbsl/lib/util/__init__.py
|
wezacon/DBSL.py
|
1d9ce5a66f8f24f5b992bca9712ad73daac194b4
|
[
"MIT"
] | null | null | null |
dbsl/lib/util/__init__.py
|
wezacon/DBSL.py
|
1d9ce5a66f8f24f5b992bca9712ad73daac194b4
|
[
"MIT"
] | null | null | null |
from .objects import *
from .exceptions import *
| 24
| 25
| 0.770833
| 6
| 48
| 6.166667
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.145833
| 48
| 2
| 25
| 24
| 0.902439
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
7eda5b41db0fedc1e6d8440285168a921567160b
| 179
|
py
|
Python
|
tests/test_manage.py
|
ptpedroj/hotelapi
|
5d5eb588b3cd95bff0afdc13cd233fc13cfd7626
|
[
"FSFAP"
] | null | null | null |
tests/test_manage.py
|
ptpedroj/hotelapi
|
5d5eb588b3cd95bff0afdc13cd233fc13cfd7626
|
[
"FSFAP"
] | null | null | null |
tests/test_manage.py
|
ptpedroj/hotelapi
|
5d5eb588b3cd95bff0afdc13cd233fc13cfd7626
|
[
"FSFAP"
] | null | null | null |
import hotelapi.manage as mgr
class TestSettings:
def test_app(self):
assert hasattr(mgr, "app")
def test_manager(self):
assert hasattr(mgr, "manager")
| 17.9
| 38
| 0.659218
| 23
| 179
| 5.043478
| 0.608696
| 0.12069
| 0.293103
| 0.344828
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.240223
| 179
| 10
| 38
| 17.9
| 0.852941
| 0
| 0
| 0
| 0
| 0
| 0.055556
| 0
| 0
| 0
| 0
| 0
| 0.333333
| 1
| 0.333333
| false
| 0
| 0.166667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
adcc104d838edef5a55185e80a7f8d2af94edd20
| 181
|
py
|
Python
|
hyperparameter_optimization.py
|
shomikverma/chemprop
|
ddaa874fe1f6ef4fbdf6b980c3157bed2ae85faa
|
[
"MIT"
] | 689
|
2020-02-14T20:22:33.000Z
|
2022-03-31T13:45:09.000Z
|
hyperparameter_optimization.py
|
shomikverma/chemprop
|
ddaa874fe1f6ef4fbdf6b980c3157bed2ae85faa
|
[
"MIT"
] | 214
|
2020-02-23T19:54:15.000Z
|
2022-03-30T21:47:06.000Z
|
hyperparameter_optimization.py
|
shomikverma/chemprop
|
ddaa874fe1f6ef4fbdf6b980c3157bed2ae85faa
|
[
"MIT"
] | 296
|
2020-02-14T15:39:13.000Z
|
2022-03-28T16:27:17.000Z
|
"""Optimizes hyperparameters using Bayesian optimization."""
from chemprop.hyperparameter_optimization import chemprop_hyperopt
if __name__ == '__main__':
chemprop_hyperopt()
| 25.857143
| 66
| 0.80663
| 17
| 181
| 7.941176
| 0.764706
| 0.237037
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.110497
| 181
| 6
| 67
| 30.166667
| 0.838509
| 0.298343
| 0
| 0
| 0
| 0
| 0.066116
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 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
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
adee65faba20d83d162feaa8214d419a109d2a41
| 206
|
py
|
Python
|
jobapp/admin.py
|
GyaniSherlock/Home-Service-Job-Portal
|
9d6fee66ec18387f786d28c0862c8eedd8835487
|
[
"MIT"
] | null | null | null |
jobapp/admin.py
|
GyaniSherlock/Home-Service-Job-Portal
|
9d6fee66ec18387f786d28c0862c8eedd8835487
|
[
"MIT"
] | null | null | null |
jobapp/admin.py
|
GyaniSherlock/Home-Service-Job-Portal
|
9d6fee66ec18387f786d28c0862c8eedd8835487
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import *
# Register your models here.
admin.site.register(Category)
admin.site.register(Applicant)
admin.site.register(Job)
admin.site.register(BookmarkJob)
| 18.727273
| 32
| 0.800971
| 28
| 206
| 5.892857
| 0.5
| 0.218182
| 0.412121
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.097087
| 206
| 10
| 33
| 20.6
| 0.887097
| 0.126214
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
adf5526edc2f8e5c750577cc31fcba06fd7d2a2a
| 137
|
py
|
Python
|
opps/api/admin.py
|
jeanmask/opps
|
031c6136c38d43aa6d1ccb25a94f7bcd65ccbf87
|
[
"MIT"
] | 159
|
2015-01-03T16:36:35.000Z
|
2022-03-29T20:50:13.000Z
|
opps/api/admin.py
|
jeanmask/opps
|
031c6136c38d43aa6d1ccb25a94f7bcd65ccbf87
|
[
"MIT"
] | 81
|
2015-01-02T21:26:16.000Z
|
2021-05-29T12:24:52.000Z
|
opps/api/admin.py
|
jeanmask/opps
|
031c6136c38d43aa6d1ccb25a94f7bcd65ccbf87
|
[
"MIT"
] | 75
|
2015-01-23T13:41:03.000Z
|
2021-09-24T03:45:23.000Z
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
from .models import ApiKey
admin.site.register(ApiKey)
| 15.222222
| 32
| 0.715328
| 20
| 137
| 4.9
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.008475
| 0.138686
| 137
| 8
| 33
| 17.125
| 0.822034
| 0.306569
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
bc203ec44495b1a5d07ee3fd4120ce00b2cb798c
| 19,075
|
py
|
Python
|
boa3_test/tests/compiler_tests/test_bytes.py
|
DanPopa46/neo3-boa
|
e4ef340744b5bd25ade26f847eac50789b97f3e9
|
[
"Apache-2.0"
] | null | null | null |
boa3_test/tests/compiler_tests/test_bytes.py
|
DanPopa46/neo3-boa
|
e4ef340744b5bd25ade26f847eac50789b97f3e9
|
[
"Apache-2.0"
] | null | null | null |
boa3_test/tests/compiler_tests/test_bytes.py
|
DanPopa46/neo3-boa
|
e4ef340744b5bd25ade26f847eac50789b97f3e9
|
[
"Apache-2.0"
] | null | null | null |
import unittest
from boa3.boa3 import Boa3
from boa3.exception.CompilerError import MismatchedTypes, NotSupportedOperation, UnresolvedOperation
from boa3.neo.vm.opcode.Opcode import Opcode
from boa3.neo.vm.type.Integer import Integer
from boa3_test.tests.boa_test import BoaTest
from boa3_test.tests.test_classes.TestExecutionException import TestExecutionException
from boa3_test.tests.test_classes.testengine import TestEngine
class TestBytes(BoaTest):
default_folder: str = 'test_sc/bytes_test'
def test_bytes_literal_value(self):
data = b'\x01\x02\x03'
expected_output = (
Opcode.INITSLOT # function signature
+ b'\x01'
+ b'\x00'
+ Opcode.PUSHDATA1 # a = b'\x01\x02\x03'
+ Integer(len(data)).to_byte_array(min_length=1)
+ data
+ Opcode.STLOC0
+ Opcode.RET # return
)
path = self.get_contract_path('BytesLiteral.py')
output = Boa3.compile(path)
self.assertEqual(expected_output, output)
def test_bytes_get_value(self):
expected_output = (
Opcode.INITSLOT # function signature
+ b'\x00'
+ b'\x01'
+ Opcode.LDARG0 # arg[0]
+ Opcode.PUSH0
+ Opcode.DUP
+ Opcode.SIGN
+ Opcode.PUSHM1
+ Opcode.JMPNE
+ Integer(5).to_byte_array(min_length=1, signed=True)
+ Opcode.OVER
+ Opcode.SIZE
+ Opcode.ADD
+ Opcode.PICKITEM
+ Opcode.RET # return
)
path = self.get_contract_path('BytesGetValue.py')
output = Boa3.compile(path)
self.assertEqual(expected_output, output)
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'Main', bytes([1, 2, 3]))
self.assertEqual(1, result)
result = self.run_smart_contract(engine, path, 'Main', b'0')
self.assertEqual(48, result)
def test_bytes_get_value_negative_index(self):
expected_output = (
Opcode.INITSLOT # function signature
+ b'\x00'
+ b'\x01'
+ Opcode.LDARG0 # arg[0]
+ Opcode.PUSHM1
+ Opcode.DUP
+ Opcode.SIGN
+ Opcode.PUSHM1
+ Opcode.JMPNE
+ Integer(5).to_byte_array(min_length=1, signed=True)
+ Opcode.OVER
+ Opcode.SIZE
+ Opcode.ADD
+ Opcode.PICKITEM
+ Opcode.RET # return
)
path = self.get_contract_path('BytesGetValueNegativeIndex.py')
output = Boa3.compile(path)
self.assertEqual(expected_output, output)
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'Main', bytes([1, 2, 3]))
self.assertEqual(3, result)
result = self.run_smart_contract(engine, path, 'Main', b'0')
self.assertEqual(48, result)
def test_bytes_set_value(self):
path = self.get_contract_path('BytesSetValue.py')
self.assertCompilerLogs(UnresolvedOperation, path)
def test_bytes_clear(self):
path = self.get_contract_path('BytesClear.py')
self.assertCompilerLogs(MismatchedTypes, path)
def test_bytes_reverse(self):
path = self.get_contract_path('BytesReverse.py')
self.assertCompilerLogs(MismatchedTypes, path)
def test_bytes_to_int(self):
path = self.get_contract_path('BytesToInt.py')
output = Boa3.compile(path)
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'bytes_to_int')
self.assertEqual(513, result)
def test_bytes_to_int_with_builtin(self):
path = self.get_contract_path('BytesToIntWithBuiltin.py')
output = Boa3.compile(path)
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'bytes_to_int')
self.assertEqual(513, result)
def test_bytes_to_int_mismatched_types(self):
path = self.get_contract_path('BytesToIntWithBuiltinMismatchedTypes.py')
self.assertCompilerLogs(MismatchedTypes, path)
def test_bytes_to_int_with_byte_array_builtin(self):
path = self.get_contract_path('BytesToIntWithBytearrayBuiltin.py')
self.assertCompilerLogs(MismatchedTypes, path)
def test_bytes_to_bool(self):
path = self.get_contract_path('BytesToBool.py')
output = Boa3.compile(path)
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'bytes_to_bool', b'\x00')
self.assertEqual(False, result)
result = self.run_smart_contract(engine, path, 'bytes_to_bool', b'\x01')
self.assertEqual(True, result)
result = self.run_smart_contract(engine, path, 'bytes_to_bool', b'\x02')
self.assertEqual(True, result)
def test_bytes_to_bool_with_builtin(self):
path = self.get_contract_path('BytesToBoolWithBuiltin.py')
output = Boa3.compile(path)
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'bytes_to_bool', b'\x00')
self.assertEqual(False, result)
result = self.run_smart_contract(engine, path, 'bytes_to_bool', b'\x01')
self.assertEqual(True, result)
result = self.run_smart_contract(engine, path, 'bytes_to_bool', b'\x02')
self.assertEqual(True, result)
def test_bytes_to_bool_with_builtin_hard_coded_false(self):
path = self.get_contract_path('BytesToBoolWithBuiltinHardCodedFalse.py')
output = Boa3.compile(path)
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'bytes_to_bool', expected_result_type=bool)
self.assertEqual(False, result)
def test_bytes_to_bool_with_builtin_hard_coded_true(self):
path = self.get_contract_path('BytesToBoolWithBuiltinHardCodedTrue.py')
output = Boa3.compile(path)
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'bytes_to_bool')
self.assertEqual(True, result)
def test_bytes_to_bool_mismatched_types(self):
path = self.get_contract_path('BytesToBoolWithBuiltinMismatchedTypes.py')
self.assertCompilerLogs(MismatchedTypes, path)
def test_bytes_to_str(self):
path = self.get_contract_path('BytesToStr.py')
output = Boa3.compile(path)
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'bytes_to_str')
self.assertEqual('abc', result)
def test_bytes_to_str_with_builtin(self):
path = self.get_contract_path('BytesToStrWithBuiltin.py')
output = Boa3.compile(path)
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'bytes_to_str')
self.assertEqual('123', result)
def test_bytes_to_str_mismatched_types(self):
path = self.get_contract_path('BytesToStrWithBuiltinMismatchedTypes.py')
self.assertCompilerLogs(MismatchedTypes, path)
def test_bytes_from_byte_array(self):
data = b'\x01\x02\x03'
expected_output = (
Opcode.INITSLOT # function signature
+ b'\x02'
+ b'\x00'
+ Opcode.PUSHDATA1 # a = bytearray(b'\x01\x02\x03')
+ Integer(len(data)).to_byte_array(min_length=1)
+ data
+ Opcode.STLOC0
+ Opcode.LDLOC0 # b = a
+ Opcode.STLOC1
+ Opcode.RET # return
)
path = self.get_contract_path('BytesFromBytearray.py')
output = Boa3.compile(path)
self.assertEqual(expected_output, output)
def test_assign_with_slice(self):
path = self.get_contract_path('AssignSlice.py')
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'main', b'unittest',
expected_result_type=bytearray)
self.assertEqual(b'unittest'[1:2], result)
result = self.run_smart_contract(engine, path, 'main', b'123',
expected_result_type=bytearray)
self.assertEqual(b'123'[1:2], result)
with self.assertRaises(TestExecutionException):
self.run_smart_contract(engine, path, 'main', bytearray())
def test_byte_array_get_value(self):
expected_output = (
Opcode.INITSLOT # function signature
+ b'\x00'
+ b'\x01'
+ Opcode.LDARG0 # arg[0]
+ Opcode.PUSH0
+ Opcode.DUP
+ Opcode.SIGN
+ Opcode.PUSHM1
+ Opcode.JMPNE
+ Integer(5).to_byte_array(min_length=1, signed=True)
+ Opcode.OVER
+ Opcode.SIZE
+ Opcode.ADD
+ Opcode.PICKITEM
+ Opcode.RET # return
)
path = self.get_contract_path('BytearrayGetValue.py')
output = Boa3.compile(path)
self.assertEqual(expected_output, output)
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'Main', bytes([1, 2, 3]))
self.assertEqual(1, result)
result = self.run_smart_contract(engine, path, 'Main', b'0')
self.assertEqual(48, result)
def test_byte_array_get_value_negative_index(self):
expected_output = (
Opcode.INITSLOT # function signature
+ b'\x00'
+ b'\x01'
+ Opcode.LDARG0 # arg[0]
+ Opcode.PUSHM1
+ Opcode.DUP
+ Opcode.SIGN
+ Opcode.PUSHM1
+ Opcode.JMPNE
+ Integer(5).to_byte_array(min_length=1, signed=True)
+ Opcode.OVER
+ Opcode.SIZE
+ Opcode.ADD
+ Opcode.PICKITEM
+ Opcode.RET # return
)
path = self.get_contract_path('BytearrayGetValueNegativeIndex.py')
output = Boa3.compile(path)
self.assertEqual(expected_output, output)
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'Main', bytes([1, 2, 3]))
self.assertEqual(3, result)
result = self.run_smart_contract(engine, path, 'Main', b'0')
self.assertEqual(48, result)
@unittest.skip("bytestring setitem is not working yet")
def test_byte_array_set_value(self):
expected_output = (
Opcode.INITSLOT # function signature
+ b'\x00'
+ b'\x01'
+ Opcode.LDARG0 # arg[0] = 0x01
+ Opcode.PUSH0
+ Opcode.DUP
+ Opcode.SIGN
+ Opcode.PUSHM1
+ Opcode.JMPNE
+ Integer(5).to_byte_array(min_length=1, signed=True)
+ Opcode.OVER
+ Opcode.SIZE
+ Opcode.ADD
+ Opcode.PUSH1
+ Opcode.SETITEM
+ Opcode.LDARG0
+ Opcode.RET # return
)
path = self.get_contract_path('BytearraySetValue.py')
output = Boa3.compile(path)
self.assertEqual(expected_output, output)
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'Main', b'123')
self.assertEqual(b'\x0123', result)
result = self.run_smart_contract(engine, path, 'Main', b'0')
self.assertEqual(b'\x01', result)
@unittest.skip("bytestring setitem is not working yet")
def test_byte_array_set_value_negative_index(self):
expected_output = (
Opcode.INITSLOT # function signature
+ b'\x00'
+ b'\x01'
+ Opcode.LDARG0 # arg[-1] = 0x01
+ Opcode.PUSHM1
+ Opcode.DUP
+ Opcode.SIGN
+ Opcode.PUSHM1
+ Opcode.JMPNE
+ Integer(5).to_byte_array(min_length=1, signed=True)
+ Opcode.OVER
+ Opcode.SIZE
+ Opcode.ADD
+ Opcode.PUSH1
+ Opcode.SETITEM
+ Opcode.LDARG0
+ Opcode.RET # return
)
path = self.get_contract_path('BytearraySetValueNegativeIndex.py')
output = Boa3.compile(path)
self.assertEqual(expected_output, output)
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'Main', b'123')
self.assertEqual(b'12\x01', result)
result = self.run_smart_contract(engine, path, 'Main', b'0')
self.assertEqual(b'\x01', result)
def test_byte_array_literal_value(self):
path = self.get_contract_path('BytearrayLiteral.py')
self.assertCompilerLogs(MismatchedTypes, path)
def test_byte_array_from_literal_bytes(self):
data = b'\x01\x02\x03'
expected_output = (
Opcode.INITSLOT # function signature
+ b'\x01'
+ b'\x00'
+ Opcode.PUSHDATA1 # a = bytearray(b'\x01\x02\x03')
+ Integer(len(data)).to_byte_array(min_length=1)
+ data
+ Opcode.STLOC0
+ Opcode.RET # return
)
path = self.get_contract_path('BytearrayFromLiteralBytes.py')
output = Boa3.compile(path)
self.assertEqual(expected_output, output)
def test_byte_array_from_variable_bytes(self):
data = b'\x01\x02\x03'
expected_output = (
Opcode.INITSLOT # function signature
+ b'\x02'
+ b'\x00'
+ Opcode.PUSHDATA1 # a = b'\x01\x02\x03'
+ Integer(len(data)).to_byte_array(min_length=1)
+ data
+ Opcode.STLOC0
+ Opcode.PUSHDATA1 # b = bytearray(a)
+ Integer(len(data)).to_byte_array(min_length=1)
+ data
+ Opcode.STLOC1
+ Opcode.RET # return
)
path = self.get_contract_path('BytearrayFromVariableBytes.py')
output = Boa3.compile(path)
self.assertEqual(expected_output, output)
def test_byte_array_string(self):
path = self.get_contract_path('BytearrayFromString.py')
self.assertCompilerLogs(NotSupportedOperation, path)
def test_byte_array_append(self):
path = self.get_contract_path('BytearrayAppend.py')
output = Boa3.compile(path)
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'Main',
expected_result_type=bytes)
self.assertEqual(b'\x01\x02\x03\x04', result)
def test_byte_array_append_with_builtin(self):
path = self.get_contract_path('BytearrayAppendWithBuiltin.py')
output = Boa3.compile(path)
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'Main',
expected_result_type=bytes)
self.assertEqual(b'\x01\x02\x03\x04', result)
def test_byte_array_append_mutable_sequence_with_builtin(self):
path = self.get_contract_path('BytearrayAppendWithMutableSequence.py')
output = Boa3.compile(path)
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'Main',
expected_result_type=bytes)
self.assertEqual(b'\x01\x02\x03\x04', result)
def test_byte_array_clear(self):
path = self.get_contract_path('BytearrayClear.py')
output = Boa3.compile(path)
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'Main',
expected_result_type=bytes)
self.assertEqual(b'', result)
@unittest.skip("reverse items doesn't work with bytestring")
def test_byte_array_reverse(self):
path = self.get_contract_path('BytearrayReverse.py')
Boa3.compile(path)
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'Main',
expected_result_type=bytes)
self.assertEqual(b'\x03\x02\x01', result)
def test_byte_array_extend(self):
path = self.get_contract_path('BytearrayExtend.py')
Boa3.compile(path)
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'Main',
expected_result_type=bytes)
self.assertEqual(b'\x01\x02\x03\x04\x05\x06', result)
def test_byte_array_extend_with_builtin(self):
path = self.get_contract_path('BytearrayExtendWithBuiltin.py')
Boa3.compile(path)
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'Main',
expected_result_type=bytes)
self.assertEqual(b'\x01\x02\x03\x04\x05\x06', result)
def test_byte_array_to_int(self):
path = self.get_contract_path('BytearrayToInt.py')
output = Boa3.compile(path)
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'bytes_to_int')
self.assertEqual(513, result)
def test_byte_array_to_int_with_builtin(self):
path = self.get_contract_path('BytearrayToIntWithBuiltin.py')
output = Boa3.compile(path)
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'bytes_to_int')
self.assertEqual(513, result)
def test_byte_array_to_int_with_bytes_builtin(self):
path = self.get_contract_path('BytearrayToIntWithBytesBuiltin.py')
output = Boa3.compile(path)
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'bytes_to_int')
self.assertEqual(513, result)
def test_boa2_byte_array_test(self):
path = self.get_contract_path('BytearrayBoa2Test.py')
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'main',
expected_result_type=bytes)
self.assertEqual(b'\t\x01\x02', result)
def test_boa2_byte_array_test2(self):
path = self.get_contract_path('BytearrayBoa2Test2.py')
self.assertCompilerLogs(MismatchedTypes, path)
def test_boa2_byte_array_test3(self):
path = self.get_contract_path('BytearrayBoa2Test3.py')
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'main')
self.assertEqual(b'\x01\x02\xaa\xfe', result)
def test_boa2_slice_test(self):
path = self.get_contract_path('SliceBoa2Test.py')
self.compile_and_save(path)
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'main',
expected_result_type=bytes)
self.assertEqual(b'\x01\x02\x03\x04', result)
def test_boa2_slice_test2(self):
path = self.get_contract_path('SliceBoa2Test2.py')
engine = TestEngine()
result = self.run_smart_contract(engine, path, 'main',
expected_result_type=bytes)
self.assertEqual(b'\x02\x03\x04\x02\x03\x04\x05\x06\x01\x02\x03\x04\x03\x04', result)
| 36.967054
| 100
| 0.607916
| 2,110
| 19,075
| 5.270142
| 0.086256
| 0.03813
| 0.042536
| 0.073471
| 0.83741
| 0.82518
| 0.783273
| 0.728417
| 0.685791
| 0.671673
| 0
| 0.028774
| 0.289436
| 19,075
| 515
| 101
| 37.038835
| 0.791648
| 0.023119
| 0
| 0.697892
| 0
| 0.002342
| 0.100425
| 0.042901
| 0
| 0
| 0
| 0
| 0.142857
| 1
| 0.100703
| false
| 0
| 0.018735
| 0
| 0.124122
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
cb1b5ef0f04599d16bbe18c6f96fb881138c97b8
| 57
|
py
|
Python
|
src/loss.py
|
muzammil360/DL-learn
|
16e90d099246e75eb7a9cc4a6e0515c0178423e0
|
[
"MIT"
] | null | null | null |
src/loss.py
|
muzammil360/DL-learn
|
16e90d099246e75eb7a9cc4a6e0515c0178423e0
|
[
"MIT"
] | null | null | null |
src/loss.py
|
muzammil360/DL-learn
|
16e90d099246e75eb7a9cc4a6e0515c0178423e0
|
[
"MIT"
] | null | null | null |
def getLossFunc():
print("This is loss function ")
pass
| 19
| 32
| 0.719298
| 8
| 57
| 5.125
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.157895
| 57
| 3
| 33
| 19
| 0.854167
| 0
| 0
| 0
| 0
| 0
| 0.37931
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| true
| 0.333333
| 0
| 0
| 0.333333
| 0.333333
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
cb1b9f98857aee2459585f912ff8c55a6ecfb9cd
| 122
|
py
|
Python
|
src/nerf/__init__.py
|
qway/nerfmeshes
|
d983dcbbcfec1337c9f2040969213c6d1ea0c39e
|
[
"MIT"
] | 113
|
2020-10-30T11:27:43.000Z
|
2022-03-28T04:28:36.000Z
|
mesh/src/nerf/__init__.py
|
ashwinpn/Computer-Vision
|
9dc3abfe416385171b76e2bad6872e10f36a12b4
|
[
"MIT"
] | 11
|
2020-09-07T07:15:56.000Z
|
2022-02-26T19:21:00.000Z
|
mesh/src/nerf/__init__.py
|
ashwinpn/Computer-Vision
|
9dc3abfe416385171b76e2bad6872e10f36a12b4
|
[
"MIT"
] | 17
|
2020-11-05T06:24:07.000Z
|
2022-03-18T21:30:35.000Z
|
from .cfgnode import CfgNode
from .tree import *
from .nerf_helpers import *
from .modules import *
from .models import *
| 20.333333
| 28
| 0.762295
| 17
| 122
| 5.411765
| 0.470588
| 0.326087
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.163934
| 122
| 5
| 29
| 24.4
| 0.901961
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
cb354a6caf06a102f1ddf89d2b6bf1b55d8140d6
| 660
|
py
|
Python
|
openid/test/test_htmldiscover.py
|
cjwatson/python-openid
|
557dc2eac99b29feda2c7f207f7ad6cbe90dde09
|
[
"Apache-2.0"
] | 176
|
2015-01-04T07:41:11.000Z
|
2022-03-28T10:03:22.000Z
|
openid/test/test_htmldiscover.py
|
cjwatson/python-openid
|
557dc2eac99b29feda2c7f207f7ad6cbe90dde09
|
[
"Apache-2.0"
] | 44
|
2018-02-27T21:13:04.000Z
|
2020-09-02T08:20:59.000Z
|
openid/test/test_htmldiscover.py
|
cjwatson/python-openid
|
557dc2eac99b29feda2c7f207f7ad6cbe90dde09
|
[
"Apache-2.0"
] | 80
|
2015-01-30T10:26:28.000Z
|
2022-02-19T20:02:58.000Z
|
from __future__ import unicode_literals
import unittest
from openid.consumer.discover import OpenIDServiceEndpoint
class TestFromHTML(unittest.TestCase):
"""Test `OpenIDServiceEndpoint.fromHTML`."""
def test_empty(self):
self.assertEqual(OpenIDServiceEndpoint.fromHTML('http://example.url/', ''), [])
def test_invalid_html(self):
self.assertEqual(OpenIDServiceEndpoint.fromHTML('http://example.url/', "http://not.in.a.link.tag/"), [])
def test_no_op_url(self):
html = '<html><head><link rel="openid.server"></head></html>'
self.assertEqual(OpenIDServiceEndpoint.fromHTML('http://example.url/', html), [])
| 33
| 112
| 0.704545
| 72
| 660
| 6.305556
| 0.472222
| 0.255507
| 0.237885
| 0.290749
| 0.400881
| 0.400881
| 0.400881
| 0.273128
| 0
| 0
| 0
| 0
| 0.133333
| 660
| 19
| 113
| 34.736842
| 0.793706
| 0.057576
| 0
| 0
| 0
| 0
| 0.217532
| 0.055195
| 0
| 0
| 0
| 0
| 0.272727
| 1
| 0.272727
| false
| 0
| 0.272727
| 0
| 0.636364
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
cb70e73dec595d6fbaa5b9412f6b4c33d3504ed5
| 134
|
py
|
Python
|
tests/integration_tests/resources/dsl/deployment_update/execute_custom_workflow/modification/push_into_props.py
|
TS-at-WS/cloudify-manager
|
3e062e8dec16c89d2ab180d0b761cbf76d3f7ddc
|
[
"Apache-2.0"
] | 124
|
2015-01-22T22:28:37.000Z
|
2022-02-26T23:12:06.000Z
|
tests/integration_tests/resources/dsl/deployment_update/execute_custom_workflow/modification/push_into_props.py
|
TS-at-WS/cloudify-manager
|
3e062e8dec16c89d2ab180d0b761cbf76d3f7ddc
|
[
"Apache-2.0"
] | 345
|
2015-01-08T15:49:40.000Z
|
2022-03-29T08:33:00.000Z
|
tests/integration_tests/resources/dsl/deployment_update/execute_custom_workflow/modification/push_into_props.py
|
TS-at-WS/cloudify-manager
|
3e062e8dec16c89d2ab180d0b761cbf76d3f7ddc
|
[
"Apache-2.0"
] | 77
|
2015-01-07T14:04:35.000Z
|
2022-03-07T22:46:00.000Z
|
from cloudify import ctx
from cloudify.state import ctx_parameters as p
ctx.instance.runtime_properties['update_id'] = p.update_id
| 19.142857
| 58
| 0.813433
| 21
| 134
| 5
| 0.619048
| 0.228571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.119403
| 134
| 6
| 59
| 22.333333
| 0.889831
| 0
| 0
| 0
| 0
| 0
| 0.067669
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
cba9207a7352fe9d4ea90feab57d95b372c82ed3
| 105
|
py
|
Python
|
231-power-of-two/231-power-of-two.py
|
MayaScarlet/leetcode-python
|
8ef0c5cadf2e975957085c0ef84a8c3d90a64b6a
|
[
"MIT"
] | null | null | null |
231-power-of-two/231-power-of-two.py
|
MayaScarlet/leetcode-python
|
8ef0c5cadf2e975957085c0ef84a8c3d90a64b6a
|
[
"MIT"
] | null | null | null |
231-power-of-two/231-power-of-two.py
|
MayaScarlet/leetcode-python
|
8ef0c5cadf2e975957085c0ef84a8c3d90a64b6a
|
[
"MIT"
] | null | null | null |
class Solution:
def isPowerOfTwo(self, n: int) -> bool:
return n and not (n & n - 1)
| 26.25
| 43
| 0.533333
| 15
| 105
| 3.733333
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.014706
| 0.352381
| 105
| 4
| 44
| 26.25
| 0.808824
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0.333333
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
cbae7c79d8a9d7a30fb918b680ff722a06f6cfdb
| 649
|
py
|
Python
|
exasol_integration_test_docker_environment/lib/test_environment/database_setup/upload_virtual_schema_jdbc_adapter.py
|
exasol/integration-test-docker-environment
|
35850f67cd4cde010f03dd556d1a0f74b3291eb8
|
[
"MIT"
] | 4
|
2020-06-25T20:47:31.000Z
|
2021-09-10T15:22:51.000Z
|
exasol_integration_test_docker_environment/lib/test_environment/database_setup/upload_virtual_schema_jdbc_adapter.py
|
exasol/integration-test-docker-environment
|
35850f67cd4cde010f03dd556d1a0f74b3291eb8
|
[
"MIT"
] | 113
|
2020-06-02T08:51:08.000Z
|
2022-03-31T08:47:41.000Z
|
exasol_integration_test_docker_environment/lib/test_environment/database_setup/upload_virtual_schema_jdbc_adapter.py
|
exasol/integration-test-docker-environment
|
35850f67cd4cde010f03dd556d1a0f74b3291eb8
|
[
"MIT"
] | 2
|
2020-05-19T10:57:47.000Z
|
2020-06-22T13:32:20.000Z
|
from exasol_integration_test_docker_environment.lib.test_environment.database_setup.upload_file_to_db import \
UploadFileToBucketFS
class UploadVirtualSchemaJDBCAdapter(UploadFileToBucketFS):
def get_log_file(self):
return "/exa/logs/cored/*bucketfsd*"
def get_pattern_to_wait_for(self):
return "virtualschema-jdbc-adapter.jar.*linked"
def get_file_to_upload(self):
return "downloads/virtualschema-jdbc-adapter/virtualschema-jdbc-adapter.jar"
def get_upload_target(self):
return "jdbc_adapter/virtualschema-jdbc-adapter.jar"
def get_sync_time_estimation(self) -> int:
return 10
| 30.904762
| 110
| 0.761171
| 79
| 649
| 5.949367
| 0.518987
| 0.06383
| 0.204255
| 0.17234
| 0.187234
| 0.187234
| 0.187234
| 0.187234
| 0
| 0
| 0
| 0.003643
| 0.154083
| 649
| 20
| 111
| 32.45
| 0.852459
| 0
| 0
| 0
| 0
| 0
| 0.269646
| 0.269646
| 0
| 0
| 0
| 0
| 0
| 1
| 0.384615
| false
| 0
| 0.076923
| 0.384615
| 0.923077
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
cbb23736d134ee0303c8c558bc6cfee5b1a9826b
| 2,720
|
py
|
Python
|
pybamm/geometry/standard_spatial_vars.py
|
zlgenuine/pybamm
|
5c43d17225710c5bea8e61b3863688eb7080e678
|
[
"BSD-3-Clause"
] | null | null | null |
pybamm/geometry/standard_spatial_vars.py
|
zlgenuine/pybamm
|
5c43d17225710c5bea8e61b3863688eb7080e678
|
[
"BSD-3-Clause"
] | null | null | null |
pybamm/geometry/standard_spatial_vars.py
|
zlgenuine/pybamm
|
5c43d17225710c5bea8e61b3863688eb7080e678
|
[
"BSD-3-Clause"
] | null | null | null |
import pybamm
whole_cell = ["negative electrode", "separator", "positive electrode"]
# Domains at cell centres
x_n = pybamm.SpatialVariable(
"x_n",
domain=["negative electrode"],
auxiliary_domains={"secondary": "current collector"},
coord_sys="cartesian",
)
x_s = pybamm.SpatialVariable(
"x_s",
domain=["separator"],
auxiliary_domains={"secondary": "current collector"},
coord_sys="cartesian",
)
x_p = pybamm.SpatialVariable(
"x_p",
domain=["positive electrode"],
auxiliary_domains={"secondary": "current collector"},
coord_sys="cartesian",
)
x = pybamm.SpatialVariable(
"x",
domain=whole_cell,
auxiliary_domains={"secondary": "current collector"},
coord_sys="cartesian",
)
y = pybamm.SpatialVariable("y", domain="current collector", coord_sys="cartesian")
z = pybamm.SpatialVariable("z", domain="current collector", coord_sys="cartesian")
r_n = pybamm.SpatialVariable(
"r_n",
domain=["negative particle"],
auxiliary_domains={
"secondary": "negative electrode",
"tertiary": "current collector",
},
coord_sys="spherical polar",
)
r_p = pybamm.SpatialVariable(
"r_p",
domain=["positive particle"],
auxiliary_domains={
"secondary": "positive electrode",
"tertiary": "current collector",
},
coord_sys="spherical polar",
)
# Domains at cell edges
x_n_edge = pybamm.SpatialVariable(
"x_n_edge",
domain=["negative electrode"],
auxiliary_domains={"secondary": "current collector"},
coord_sys="cartesian",
)
x_s_edge = pybamm.SpatialVariable(
"x_s_edge",
domain=["separator"],
auxiliary_domains={"secondary": "current collector"},
coord_sys="cartesian",
)
x_p_edge = pybamm.SpatialVariable(
"x_p_edge",
domain=["positive electrode"],
auxiliary_domains={"secondary": "current collector"},
coord_sys="cartesian",
)
x_edge = pybamm.SpatialVariable(
"x_edge",
domain=whole_cell,
auxiliary_domains={"secondary": "current collector"},
coord_sys="cartesian",
)
y_edge = pybamm.SpatialVariable(
"y_edge", domain="current collector", coord_sys="cartesian"
)
z_edge = pybamm.SpatialVariable(
"z_edge", domain="current collector", coord_sys="cartesian"
)
r_n_edge = pybamm.SpatialVariable(
"r_n_edge",
domain=["negative particle"],
auxiliary_domains={
"secondary": "negative electrode",
"tertiary": "current collector",
},
coord_sys="spherical polar",
)
r_p_edge = pybamm.SpatialVariable(
"r_p_edge",
domain=["positive particle"],
auxiliary_domains={
"secondary": "positive electrode",
"tertiary": "current collector",
},
coord_sys="spherical polar",
)
| 26.153846
| 82
| 0.673897
| 287
| 2,720
| 6.15331
| 0.114983
| 0.19026
| 0.19026
| 0.217441
| 0.703284
| 0.703284
| 0.703284
| 0.653454
| 0.607022
| 0.607022
| 0
| 0
| 0.178676
| 2,720
| 103
| 83
| 26.407767
| 0.79051
| 0.016544
| 0
| 0.468085
| 0
| 0
| 0.348428
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.010638
| 0
| 0.010638
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
cbca7c58ba6d87fbf125bfc9c3845c0a9d5b281f
| 548
|
py
|
Python
|
MyPythonDeepLearning/Python/myclass.py
|
medit74/DeepLearning
|
a25b72ff2229a376158adda6f8b8f270d9df1e66
|
[
"Apache-2.0"
] | 1
|
2017-05-17T08:22:03.000Z
|
2017-05-17T08:22:03.000Z
|
MyPythonDeepLearning/Python/myclass.py
|
medit74/DeepLearning
|
a25b72ff2229a376158adda6f8b8f270d9df1e66
|
[
"Apache-2.0"
] | null | null | null |
MyPythonDeepLearning/Python/myclass.py
|
medit74/DeepLearning
|
a25b72ff2229a376158adda6f8b8f270d9df1e66
|
[
"Apache-2.0"
] | null | null | null |
'''
Created on 2017. 4. 12.
@author: Byoungho Kang
'''
class Calculator:
def __init__(self, first, second):
self.first = first
self.second = second
def plus(self):
return self.first + self.second
def minus(self):
return self.first - self.second
def multiply(self):
return self.first * self.second
def divide(self):
return self.first / self.second
c = Calculator(3, 4)
print(c.plus(), c.minus(), c.multiply(), c.divide())
| 20.296296
| 52
| 0.54927
| 66
| 548
| 4.5
| 0.348485
| 0.181818
| 0.252525
| 0.255892
| 0.420875
| 0.420875
| 0.323232
| 0
| 0
| 0
| 0
| 0.024523
| 0.330292
| 548
| 27
| 52
| 20.296296
| 0.784741
| 0.085766
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.357143
| false
| 0
| 0
| 0.285714
| 0.714286
| 0.071429
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
cbd54c8de7f6ac13503e29c7d60d52081f60260f
| 20,915
|
py
|
Python
|
ichnaea/api/locate/locate_v2/tests.py
|
JaredKerim-Mozilla/ichnaea
|
cfaef2b903960374050be3ea2e4c1520687de56b
|
[
"Apache-1.1"
] | null | null | null |
ichnaea/api/locate/locate_v2/tests.py
|
JaredKerim-Mozilla/ichnaea
|
cfaef2b903960374050be3ea2e4c1520687de56b
|
[
"Apache-1.1"
] | null | null | null |
ichnaea/api/locate/locate_v2/tests.py
|
JaredKerim-Mozilla/ichnaea
|
cfaef2b903960374050be3ea2e4c1520687de56b
|
[
"Apache-1.1"
] | null | null | null |
from uuid import uuid1
from sqlalchemy import text
from ichnaea.models import (
ApiKey,
Radio,
)
from ichnaea.api.exceptions import (
DailyLimitExceeded,
InvalidAPIKey,
LocationNotFound,
ParseError,
)
from ichnaea.api.locate.locate_v2.schema import LocateV2Schema
from ichnaea.tests.base import AppTestCase, TestCase
from ichnaea.tests.factories import (
CellFactory,
CellAreaFactory,
WifiFactory,
)
from ichnaea import util
class TestLocateV2Schema(TestCase):
def test_multiple_radio_fields_uses_radioType(self):
schema = LocateV2Schema()
data = schema.deserialize({'cellTowers': [{
'radio': 'gsm',
'radioType': 'cdma',
}]})
self.assertEqual(data['cell'][0]['radio'], 'cdma')
self.assertFalse('radioType' in data['cell'][0])
class TestLocateV2(AppTestCase):
def setUp(self):
super(TestLocateV2, self).setUp()
self.url = '/v1/geolocate'
self.metric = 'geolocate'
self.metric_url = 'request.v1.geolocate'
def test_ok_cell(self):
cell = CellFactory()
self.session.flush()
res = self.app.post_json(
'%s?key=test' % self.url, {
'radioType': cell.radio.name,
'cellTowers': [{
'mobileCountryCode': cell.mcc,
'mobileNetworkCode': cell.mnc,
'locationAreaCode': cell.lac,
'cellId': cell.cid,
'signalStrength': -70,
'timingAdvance': 1},
]},
status=200)
self.check_stats(
counter=[self.metric_url + '.200',
self.metric + '.api_key.test',
self.metric + '.api_log.test.cell_hit']
)
self.assertEqual(res.content_type, 'application/json')
self.assertEqual(res.json, {'location': {'lat': cell.lat,
'lng': cell.lon},
'accuracy': cell.range})
def test_ok_cellarea(self):
cell = CellAreaFactory()
self.session.flush()
res = self.app.post_json(
'%s?key=test' % self.url, {
'radioType': cell.radio.name,
'cellTowers': [{
'mobileCountryCode': cell.mcc,
'mobileNetworkCode': cell.mnc,
'locationAreaCode': cell.lac,
'signalStrength': -70,
'timingAdvance': 1},
]},
status=200)
self.check_stats(
counter=[self.metric_url + '.200',
self.metric + '.api_key.test',
self.metric + '.api_log.test.cell_lac_hit']
)
self.assertEqual(res.content_type, 'application/json')
self.assertEqual(res.json, {'location': {'lat': cell.lat,
'lng': cell.lon},
'accuracy': cell.range})
def test_ok_cellarea_when_lacf_enabled(self):
cell = CellAreaFactory()
self.session.flush()
res = self.app.post_json(
'%s?key=test' % self.url,
{
'radioType': cell.radio.name,
'cellTowers': [{
'mobileCountryCode': cell.mcc,
'mobileNetworkCode': cell.mnc,
'locationAreaCode': cell.lac,
'signalStrength': -70,
'timingAdvance': 1},
],
'fallbacks': {
'lacf': 1,
},
},
status=200)
self.check_stats(
counter=[self.metric_url + '.200',
self.metric + '.api_key.test',
self.metric + '.api_log.test.cell_lac_hit']
)
self.assertEqual(res.content_type, 'application/json')
self.assertEqual(res.json, {'location': {'lat': cell.lat,
'lng': cell.lon},
'accuracy': cell.range})
def test_cellarea_not_found_when_lacf_disabled(self):
cell = CellAreaFactory()
self.session.flush()
res = self.app.post_json(
'%s?key=test' % self.url,
{
'radioType': cell.radio.name,
'cellTowers': [{
'mobileCountryCode': cell.mcc,
'mobileNetworkCode': cell.mnc,
'locationAreaCode': cell.lac,
'signalStrength': -70,
'timingAdvance': 1},
],
'fallbacks': {
'lacf': 0,
},
},
status=404)
self.check_stats(
counter=[self.metric_url + '.404',
self.metric + '.api_key.test']
)
self.assertEqual(res.content_type, 'application/json')
self.assertEqual(res.json, LocationNotFound.json_body())
def test_ok_partial_cell(self):
cell = CellFactory()
self.session.flush()
res = self.app.post_json(
'%s?key=test' % self.url, {
'cellTowers': [{
'radioType': cell.radio.name,
'mobileCountryCode': cell.mcc,
'mobileNetworkCode': cell.mnc,
'locationAreaCode': cell.lac,
'cellId': cell.cid,
'psc': cell.psc}, {
'radioType': cell.radio.name,
'mobileCountryCode': cell.mcc,
'mobileNetworkCode': cell.mnc,
'psc': cell.psc + 1,
}]},
status=200)
self.assertEqual(res.content_type, 'application/json')
self.assertEqual(res.json, {'location': {'lat': cell.lat,
'lng': cell.lon},
'accuracy': cell.range})
def test_ok_wifi(self):
wifi = WifiFactory()
offset = 0.0001
wifis = [
wifi,
WifiFactory(lat=wifi.lat + offset),
WifiFactory(lat=wifi.lat + offset * 2),
WifiFactory(lat=None, lon=None),
]
self.session.flush()
res = self.app.post_json(
'%s?key=test' % self.url, {
'wifiAccessPoints': [
{'macAddress': wifis[0].key, 'channel': 6},
{'macAddress': wifis[1].key, 'frequency': 2437},
{'macAddress': wifis[2].key, 'signalStrength': -77},
{'macAddress': wifis[3].key, 'signalToNoiseRatio': 13},
]},
status=200)
self.check_stats(
counter=[self.metric + '.api_key.test',
self.metric + '.api_log.test.wifi_hit'])
self.assertEqual(res.content_type, 'application/json')
self.assertEqual(res.json, {'location': {'lat': wifi.lat + offset,
'lng': wifi.lon},
'accuracy': wifi.range})
def test_wifi_not_found(self):
wifis = WifiFactory.build_batch(2)
res = self.app.post_json(
'%s?key=test' % self.url, {
'wifiAccessPoints': [
{'macAddress': wifis[0].key},
{'macAddress': wifis[1].key},
]},
status=404)
self.assertEqual(res.content_type, 'application/json')
self.assertEqual(res.json, LocationNotFound.json_body())
# Make sure to get two counters, a timer, and no traceback
self.check_stats(
counter=[self.metric + '.api_key.test',
self.metric + '.api_log.test.wifi_miss',
(self.metric_url + '.404', 1)],
timer=[self.metric_url])
def test_cell_mcc_mnc_strings(self):
# mcc and mnc are officially defined as strings, where '01' is
# different from '1'. In practice many systems ours included treat
# them as integers, so both of these are encoded as 1 instead.
# Some clients sends us these values as strings, some as integers,
# so we want to make sure we support both.
cell = CellFactory(mnc=1)
self.session.flush()
res = self.app.post_json(
'%s?key=test' % self.url, {
'cellTowers': [{
'radioType': cell.radio.name,
'mobileCountryCode': str(cell.mcc),
'mobileNetworkCode': '01',
'locationAreaCode': cell.lac,
'cellId': cell.cid},
]},
status=200)
self.assertEqual(res.content_type, 'application/json')
self.assertEqual(res.json, {'location': {'lat': cell.lat,
'lng': cell.lon},
'accuracy': cell.range})
def test_geoip_fallback(self):
london = self.geoip_data['London']
wifis = WifiFactory.build_batch(4)
res = self.app.post_json(
'%s?key=test' % self.url,
{'wifiAccessPoints': [
{'macAddress': wifis[0].key},
{'macAddress': wifis[1].key},
{'macAddress': wifis[2].key},
{'macAddress': wifis[3].key},
]},
extra_environ={'HTTP_X_FORWARDED_FOR': london['ip']},
status=200)
self.assertEqual(res.content_type, 'application/json')
self.assertEqual(res.json, {'location': {'lat': london['latitude'],
'lng': london['longitude']},
'accuracy': london['accuracy']})
def test_empty_request_means_geoip(self):
london = self.geoip_data['London']
res = self.app.post_json(
'%s?key=test' % self.url, {},
extra_environ={'HTTP_X_FORWARDED_FOR': london['ip']},
status=200)
self.assertEqual(res.content_type, 'application/json')
self.assertEqual(res.json, {'location': {'lat': london['latitude'],
'lng': london['longitude']},
'accuracy': london['accuracy']})
def test_incomplete_request_means_geoip(self):
london = self.geoip_data['London']
res = self.app.post_json(
'%s?key=test' % self.url, {'wifiAccessPoints': []},
extra_environ={'HTTP_X_FORWARDED_FOR': london['ip']},
status=200)
self.assertEqual(res.content_type, 'application/json')
self.assertEqual(res.json, {'location': {'lat': london['latitude'],
'lng': london['longitude']},
'accuracy': london['accuracy']})
def test_parse_error(self):
res = self.app.post('%s?key=test' % self.url, '\xae', status=400)
self.assertEqual(res.content_type, 'application/json')
self.assertEqual(res.json, ParseError.json_body())
self.check_stats(counter=[self.metric + '.api_key.test'])
def test_no_api_key(self):
cell = CellFactory()
self.session.flush()
res = self.app.post_json(
self.url, {
'cellTowers': [{
'radioType': cell.radio.name,
'mobileCountryCode': cell.mcc,
'mobileNetworkCode': cell.mnc,
'locationAreaCode': cell.lac,
'cellId': cell.cid},
]
},
status=400)
self.assertEqual(res.content_type, 'application/json')
self.assertEqual(res.json, InvalidAPIKey.json_body())
self.check_stats(
counter=[self.metric + '.no_api_key'])
def test_unknown_api_key(self):
cell = CellFactory()
self.session.flush()
res = self.app.post_json(
'%s?key=unknown_key' % self.url, {
'radioType': cell.radio.name,
'cellTowers': [
{'mobileCountryCode': cell.mcc,
'mobileNetworkCode': cell.mnc,
'locationAreaCode': cell.lac,
'cellId': cell.cid},
]
},
status=400)
self.assertEqual(res.content_type, 'application/json')
self.assertEqual(res.json, InvalidAPIKey.json_body())
self.check_stats(
counter=[self.metric + '.unknown_api_key'])
def test_api_key_limit(self):
london = self.geoip_data['London']
api_key = uuid1().hex
self.session.add(ApiKey(valid_key=api_key, maxreq=5, shortname='dis'))
self.session.flush()
# exhaust today's limit
dstamp = util.utcnow().strftime('%Y%m%d')
key = 'apilimit:%s:%s' % (api_key, dstamp)
self.redis_client.incr(key, 10)
res = self.app.post_json(
'%s?key=%s' % (self.url, api_key), {},
extra_environ={'HTTP_X_FORWARDED_FOR': london['ip']},
status=403)
self.assertEqual(res.content_type, 'application/json')
self.assertEqual(res.json, DailyLimitExceeded.json_body())
def test_lte_radio(self):
cell = CellFactory(radio=Radio.lte)
self.session.flush()
res = self.app.post_json(
'%s?key=test' % self.url, {
'cellTowers': [{
'radio': cell.radio.name,
'mobileCountryCode': cell.mcc,
'mobileNetworkCode': cell.mnc,
'locationAreaCode': cell.lac,
'cellId': cell.cid},
]},
status=200)
self.check_stats(
counter=[self.metric_url + '.200', self.metric + '.api_key.test'])
self.assertEqual(res.content_type, 'application/json')
location = res.json['location']
self.assertAlmostEquals(location['lat'], cell.lat)
self.assertAlmostEquals(location['lng'], cell.lon)
self.assertEqual(res.json['accuracy'], cell.range)
def test_ok_cell_radio_in_celltowers(self):
# This test covers a bug related to FxOS calling the
# geolocate API incorrectly.
cell = CellFactory()
self.session.flush()
res = self.app.post_json(
'%s?key=test' % self.url, {
'cellTowers': [
{'radio': cell.radio.name,
'mobileCountryCode': cell.mcc,
'mobileNetworkCode': cell.mnc,
'locationAreaCode': cell.lac,
'cellId': cell.cid},
]},
status=200)
self.assertEqual(res.json, {'location': {'lat': cell.lat,
'lng': cell.lon},
'accuracy': cell.range})
def test_ok_cell_radiotype_in_celltowers(self):
# This test covers an extension to the geolocate API
cell = CellFactory()
self.session.flush()
res = self.app.post_json(
'%s?key=test' % self.url, {
'cellTowers': [
{'radioType': cell.radio.name,
'mobileCountryCode': cell.mcc,
'mobileNetworkCode': cell.mnc,
'locationAreaCode': cell.lac,
'cellId': cell.cid},
]},
status=200)
self.assertEqual(res.json, {'location': {'lat': cell.lat,
'lng': cell.lon},
'accuracy': cell.range})
def test_ok_cell_radio_in_celltowers_dupes(self):
# This test covers a bug related to FxOS calling the
# geolocate API incorrectly.
cell = CellFactory()
self.session.flush()
res = self.app.post_json(
'%s?key=test' % self.url, {
'cellTowers': [
{'radio': cell.radio.name,
'mobileCountryCode': cell.mcc,
'mobileNetworkCode': cell.mnc,
'locationAreaCode': cell.lac,
'cellId': cell.cid},
{'radio': cell.radio.name,
'mobileCountryCode': cell.mcc,
'mobileNetworkCode': cell.mnc,
'locationAreaCode': cell.lac,
'cellId': cell.cid},
]},
status=200)
self.assertEqual(res.json, {'location': {'lat': cell.lat,
'lng': cell.lon},
'accuracy': cell.range})
def test_inconsistent_cell_radio_in_towers(self):
cell = CellFactory(radio=Radio.umts, range=15000)
cell2 = CellFactory(radio=Radio.gsm, range=35000,
lat=cell.lat + 0.0002, lon=cell.lon)
self.session.flush()
res = self.app.post_json(
'%s?key=test' % self.url, {
'radioType': Radio.cdma.name,
'cellTowers': [
{'radio': 'wcdma',
'mobileCountryCode': cell.mcc,
'mobileNetworkCode': cell.mnc,
'locationAreaCode': cell.lac,
'cellId': cell.cid},
{'radio': cell2.radio.name,
'mobileCountryCode': cell2.mcc,
'mobileNetworkCode': cell2.mnc,
'locationAreaCode': cell2.lac,
'cellId': cell2.cid},
]},
status=200)
location = res.json['location']
self.assertAlmostEquals(location['lat'], cell.lat)
self.assertAlmostEquals(location['lng'], cell.lon)
self.assertEqual(res.json['accuracy'], cell.range)
def test_inconsistent_cell_radio_type_in_towers(self):
cell = CellFactory(radio=Radio.umts, range=15000)
cell2 = CellFactory(radio=Radio.gsm, range=35000,
lat=cell.lat + 0.0002, lon=cell.lon)
self.session.flush()
res = self.app.post_json(
'%s?key=test' % self.url, {
'radioType': Radio.cdma.name,
'cellTowers': [
{'radio': 'cdma',
'radioType': 'wcdma',
'mobileCountryCode': cell.mcc,
'mobileNetworkCode': cell.mnc,
'locationAreaCode': cell.lac,
'cellId': cell.cid},
{'radioType': cell2.radio.name,
'mobileCountryCode': cell2.mcc,
'mobileNetworkCode': cell2.mnc,
'locationAreaCode': cell2.lac,
'cellId': cell2.cid},
]},
status=200)
location = res.json['location']
self.assertAlmostEquals(location['lat'], cell.lat)
self.assertAlmostEquals(location['lng'], cell.lon)
self.assertEqual(res.json['accuracy'], cell.range)
class TestLocateV2Errors(AppTestCase):
# this is a standalone class to ensure DB isolation for dropping tables
def tearDown(self):
self.setup_tables(self.db_rw.engine)
super(TestLocateV2Errors, self).tearDown()
def test_database_error(self):
london = self.geoip_data['London']
self.session.execute(text('drop table wifi;'))
self.session.execute(text('drop table cell;'))
cell = CellFactory.build()
wifis = WifiFactory.build_batch(2)
res = self.app.post_json(
'/v1/geolocate?key=test', {
'cellTowers': [{
'radioType': cell.radio.name,
'mobileCountryCode': cell.mcc,
'mobileNetworkCode': cell.mnc,
'locationAreaCode': cell.lac,
'cellId': cell.cid},
],
'wifiAccessPoints': [
{'macAddress': wifis[0].key},
{'macAddress': wifis[1].key},
]},
extra_environ={'HTTP_X_FORWARDED_FOR': london['ip']},
status=200)
self.assertEqual(res.content_type, 'application/json')
self.assertEqual(res.json, {'location': {'lat': london['latitude'],
'lng': london['longitude']},
'accuracy': london['accuracy']})
self.check_stats(
timer=['request.v1.geolocate'],
counter=[
'request.v1.geolocate.200',
'geolocate.geoip_hit',
])
self.check_raven([('ProgrammingError', 2)])
| 37.889493
| 78
| 0.493904
| 1,915
| 20,915
| 5.284073
| 0.129504
| 0.059294
| 0.069374
| 0.030438
| 0.772211
| 0.762526
| 0.744836
| 0.739302
| 0.733472
| 0.72438
| 0
| 0.015629
| 0.378962
| 20,915
| 551
| 79
| 37.958258
| 0.763415
| 0.030983
| 0
| 0.688034
| 0
| 0
| 0.166395
| 0.008147
| 0
| 0
| 0
| 0
| 0.100427
| 1
| 0.053419
| false
| 0
| 0.017094
| 0
| 0.076923
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
1db0b37efe2a3b98a1d227ee6b1ae2aa250d2373
| 270
|
py
|
Python
|
src/freeway/errors.py
|
cesioarg/freeway
|
1c81bfd4e8bfc42910bb1b4f7cb98253b0165973
|
[
"MIT"
] | null | null | null |
src/freeway/errors.py
|
cesioarg/freeway
|
1c81bfd4e8bfc42910bb1b4f7cb98253b0165973
|
[
"MIT"
] | null | null | null |
src/freeway/errors.py
|
cesioarg/freeway
|
1c81bfd4e8bfc42910bb1b4f7cb98253b0165973
|
[
"MIT"
] | null | null | null |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# cython: language_level=2, boundscheck=False
class NoValidVersion(Exception):
pass
class VersionZero(Exception):
pass
class ExceededPaddingVersion(Exception):
pass
class NoVersionNumber(Exception):
pass
| 13.5
| 45
| 0.714815
| 28
| 270
| 6.857143
| 0.678571
| 0.270833
| 0.28125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.008929
| 0.17037
| 270
| 19
| 46
| 14.210526
| 0.848214
| 0.303704
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 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
| 5
|
1de9f88abbe2761b701e1c15ff3e37d40e33d2b0
| 117
|
py
|
Python
|
openet/tests/test_interp.py
|
pblankenau2/openet-core-beta
|
685c08bd50a346c3b2893d32a9ddd3881ff7fd0f
|
[
"Apache-2.0"
] | 1
|
2020-11-17T02:58:35.000Z
|
2020-11-17T02:58:35.000Z
|
openet/tests/test_interp.py
|
pblankenau2/openet-core-beta
|
685c08bd50a346c3b2893d32a9ddd3881ff7fd0f
|
[
"Apache-2.0"
] | null | null | null |
openet/tests/test_interp.py
|
pblankenau2/openet-core-beta
|
685c08bd50a346c3b2893d32a9ddd3881ff7fd0f
|
[
"Apache-2.0"
] | 1
|
2020-11-17T02:58:52.000Z
|
2020-11-17T02:58:52.000Z
|
import ee
import pytest
import openet.interp as interp
def test_ee_init():
assert ee.Number(1).getInfo() == 1
| 13
| 38
| 0.717949
| 19
| 117
| 4.315789
| 0.684211
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.020833
| 0.179487
| 117
| 8
| 39
| 14.625
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.2
| 1
| 0.2
| true
| 0
| 0.6
| 0
| 0.8
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
1dffb4d2e246611414741ac0e3967e4c20e86eaf
| 128
|
py
|
Python
|
boa3_test/test_sc/relational_test/ListEqualityWithSlice.py
|
hal0x2328/neo3-boa
|
6825a3533384cb01660773050719402a9703065b
|
[
"Apache-2.0"
] | 25
|
2020-07-22T19:37:43.000Z
|
2022-03-08T03:23:55.000Z
|
boa3_test/test_sc/relational_test/ListEqualityWithSlice.py
|
hal0x2328/neo3-boa
|
6825a3533384cb01660773050719402a9703065b
|
[
"Apache-2.0"
] | 419
|
2020-04-23T17:48:14.000Z
|
2022-03-31T13:17:45.000Z
|
boa3_test/test_sc/relational_test/ListEqualityWithSlice.py
|
hal0x2328/neo3-boa
|
6825a3533384cb01660773050719402a9703065b
|
[
"Apache-2.0"
] | 15
|
2020-05-21T21:54:24.000Z
|
2021-11-18T06:17:24.000Z
|
from typing import List
from boa3.builtin import public
@public
def main(a: List[str], b: str) -> bool:
return a[0] == b
| 14.222222
| 39
| 0.664063
| 22
| 128
| 3.863636
| 0.681818
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.019802
| 0.210938
| 128
| 8
| 40
| 16
| 0.821782
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.4
| 0.2
| 0.8
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 5
|
3804d28953813a7541e3498b8a15a24dee164ae2
| 65
|
py
|
Python
|
transformer/__init__.py
|
ShouryaMehra/FastSpeech-Fast-and-High-Quality-End-to-End-Text-to-Speech
|
64e820671e6c792512ff14c59639d93ce5e989b3
|
[
"MIT"
] | null | null | null |
transformer/__init__.py
|
ShouryaMehra/FastSpeech-Fast-and-High-Quality-End-to-End-Text-to-Speech
|
64e820671e6c792512ff14c59639d93ce5e989b3
|
[
"MIT"
] | null | null | null |
transformer/__init__.py
|
ShouryaMehra/FastSpeech-Fast-and-High-Quality-End-to-End-Text-to-Speech
|
64e820671e6c792512ff14c59639d93ce5e989b3
|
[
"MIT"
] | null | null | null |
from .Models import Encoder, Decoder
from .Layers import PostNet
| 32.5
| 37
| 0.815385
| 9
| 65
| 5.888889
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.138462
| 65
| 2
| 38
| 32.5
| 0.946429
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
6974a14ef1c934ceded3a9d38b3165061ea39cb3
| 201
|
py
|
Python
|
commerce/auctions/admin.py
|
pedrogiudici/Auctions
|
fc7faac67208068bf069cbf5ea22ee2bc30bd41a
|
[
"MIT"
] | null | null | null |
commerce/auctions/admin.py
|
pedrogiudici/Auctions
|
fc7faac67208068bf069cbf5ea22ee2bc30bd41a
|
[
"MIT"
] | null | null | null |
commerce/auctions/admin.py
|
pedrogiudici/Auctions
|
fc7faac67208068bf069cbf5ea22ee2bc30bd41a
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import AuctionListing, Bid, Comment
# Register your models here.
admin.site.register(AuctionListing)
admin.site.register(Bid)
admin.site.register(Comment)
| 28.714286
| 48
| 0.820896
| 27
| 201
| 6.111111
| 0.481481
| 0.163636
| 0.309091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.089552
| 201
| 7
| 49
| 28.714286
| 0.901639
| 0.129353
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.4
| 0
| 0.4
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
698203476403fdf7d97d8b8bd0d02349007db233
| 3,516
|
py
|
Python
|
module_utils/network_lsr/nm/connection.py
|
spetrosi/network
|
ef655447b3ce8d43bf7d93c1eddcfac62ee3d418
|
[
"BSD-3-Clause"
] | 1
|
2019-07-26T19:01:42.000Z
|
2019-07-26T19:01:42.000Z
|
roles/linux-system-roles.network/module_utils/network_lsr/nm/connection.py
|
ptoal/toallab-automation
|
833f589d56696eb7e2c3815416c428889e828d5c
|
[
"MIT"
] | null | null | null |
roles/linux-system-roles.network/module_utils/network_lsr/nm/connection.py
|
ptoal/toallab-automation
|
833f589d56696eb7e2c3815416c428889e828d5c
|
[
"MIT"
] | null | null | null |
# SPDX-License-Identifier: BSD-3-Clause
# Handle NM.RemoteConnection
import logging
# Relative import is not support by ansible 2.8 yet
# pylint: disable=import-error, no-name-in-module
from ansible.module_utils.network_lsr.nm import client # noqa:E501
from ansible.module_utils.network_lsr.nm import error # noqa:E501
# pylint: enable=import-error, no-name-in-module
def delete_remote_connection(nm_profile, timeout, check_mode):
if not nm_profile:
logging.info("NULL NM.RemoteConnection, no need to delete")
return False
if not check_mode:
main_loop = client.get_mainloop(timeout)
user_data = main_loop
nm_profile.delete_async(
main_loop.cancellable,
_nm_profile_delete_call_back,
user_data,
)
logging.debug(
"Deleting profile {id}/{uuid} with timeout {timeout}".format(
id=nm_profile.get_id(), uuid=nm_profile.get_uuid(), timeout=timeout
)
)
main_loop.run()
return True
def _nm_profile_delete_call_back(nm_profile, result, user_data):
main_loop = user_data
if main_loop.is_cancelled:
return
try:
success = nm_profile.delete_finish(result)
except Exception as e:
main_loop.fail(
error.LsrNetworkNmError(
"Connection deletion aborted on {id}/{uuid}: error={error}".format(
id=nm_profile.get_id(), uuid=nm_profile.get_uuid(), error=e
)
)
)
if success:
main_loop.quit()
else:
main_loop.fail(
error.LsrNetworkNmError(
"Connection deletion aborted on {id}/{uuid}: error=unknown".format(
id=nm_profile.get_id(), uuid=nm_profile.get_uuid()
)
)
)
def volatilize_remote_connection(nm_profile, timeout, check_mode):
if not nm_profile:
logging.info("NULL NM.RemoteConnection, no need to volatilize")
return False
if not check_mode:
main_loop = client.get_mainloop(timeout)
user_data = main_loop
nm_profile.update2(
None, # settings
client.NM.SettingsUpdate2Flags.IN_MEMORY_ONLY
| client.NM.SettingsUpdate2Flags.VOLATILE,
None, # args
main_loop.cancellable,
_nm_profile_volatile_update2_call_back,
user_data,
)
logging.debug(
"Volatilizing profile {id}/{uuid} with timeout {timeout}".format(
id=nm_profile.get_id(), uuid=nm_profile.get_uuid(), timeout=timeout
)
)
main_loop.run()
return True
def _nm_profile_volatile_update2_call_back(nm_profile, result, user_data):
main_loop = user_data
if main_loop.is_cancelled:
return
try:
success = nm_profile.update2_finish(result)
except Exception as e:
main_loop.fail(
error.LsrNetworkNmError(
"Connection volatilize aborted on {id}/{uuid}: error={error}".format(
id=nm_profile.get_id(), uuid=nm_profile.get_uuid(), error=e
)
)
)
if success:
main_loop.quit()
else:
main_loop.fail(
error.LsrNetworkNmError(
"Connection volatilize aborted on {id}/{uuid}: error=unknown".format(
id=nm_profile.get_id(), uuid=nm_profile.get_uuid()
)
)
)
| 30.842105
| 85
| 0.602958
| 408
| 3,516
| 4.943627
| 0.232843
| 0.116014
| 0.071393
| 0.05057
| 0.828954
| 0.799703
| 0.727814
| 0.727814
| 0.688151
| 0.688151
| 0
| 0.006168
| 0.308305
| 3,516
| 113
| 86
| 31.115044
| 0.823191
| 0.069113
| 0
| 0.55914
| 0
| 0
| 0.131168
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.043011
| false
| 0
| 0.032258
| 0
| 0.139785
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
69a554503ab1c27b046019936ea5f73c761fb6bd
| 111
|
py
|
Python
|
cart/tests.py
|
hcNick/django-cart
|
0f1974095864c2f25554914356506f850dbbb338
|
[
"MIT"
] | 1
|
2016-03-10T16:17:25.000Z
|
2016-03-10T16:17:25.000Z
|
cart/tests.py
|
miguelchavez/django-cart
|
72cffa20abd68fdb03493027ccda28e7047323ac
|
[
"MIT"
] | null | null | null |
cart/tests.py
|
miguelchavez/django-cart
|
72cffa20abd68fdb03493027ccda28e7047323ac
|
[
"MIT"
] | null | null | null |
from django.test import TestCase
import cart
class CartTestCase(TestCase):
def setUp(self):
pass
| 13.875
| 32
| 0.711712
| 14
| 111
| 5.642857
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.225225
| 111
| 7
| 33
| 15.857143
| 0.918605
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0.2
| 0.4
| 0
| 0.8
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
|
0
| 5
|
69bb0e084527ef199bf1e733b8d241b1df022278
| 65
|
py
|
Python
|
pynsett/inference/__init__.py
|
fractalego/python-nlulite
|
982b780adedebf2c8a1e119f0f8b46ae72a9c384
|
[
"MIT"
] | 26
|
2019-01-12T21:52:36.000Z
|
2022-03-30T11:28:52.000Z
|
pynsett/inference/__init__.py
|
fractalego/python-nlulite
|
982b780adedebf2c8a1e119f0f8b46ae72a9c384
|
[
"MIT"
] | 2
|
2022-02-04T12:03:10.000Z
|
2022-02-09T13:24:07.000Z
|
pynsett/inference/__init__.py
|
fractalego/python-nlulite
|
982b780adedebf2c8a1e119f0f8b46ae72a9c384
|
[
"MIT"
] | 3
|
2019-08-18T18:45:48.000Z
|
2022-02-04T11:39:38.000Z
|
from pynsett.inference.forward_inference import ForwardInference
| 32.5
| 64
| 0.907692
| 7
| 65
| 8.285714
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.061538
| 65
| 1
| 65
| 65
| 0.95082
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
69d5079f55a4dad86946c29a1ee41c94a3fa54e9
| 203
|
py
|
Python
|
maintenance_calendar/parser/json/json_calendar_parser.py
|
Fiware/ops.Maintenance-calendar
|
636244f70e03ba45c943b68b847cad16ce3b66c8
|
[
"Apache-2.0"
] | null | null | null |
maintenance_calendar/parser/json/json_calendar_parser.py
|
Fiware/ops.Maintenance-calendar
|
636244f70e03ba45c943b68b847cad16ce3b66c8
|
[
"Apache-2.0"
] | null | null | null |
maintenance_calendar/parser/json/json_calendar_parser.py
|
Fiware/ops.Maintenance-calendar
|
636244f70e03ba45c943b68b847cad16ce3b66c8
|
[
"Apache-2.0"
] | null | null | null |
from flask import json
from maintenance_calendar.parser.json.json_parser import JSONParser
class JSONCalendarParser(JSONParser):
def to_dict(self, data):
return json.loads(data)['calendar']
| 29
| 67
| 0.778325
| 26
| 203
| 5.961538
| 0.653846
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.137931
| 203
| 7
| 68
| 29
| 0.885714
| 0
| 0
| 0
| 0
| 0
| 0.039216
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.4
| 0.2
| 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
| 1
| 1
| 0
|
0
| 5
|
69f0b5ed24cdad2aca0583b5a6e05bf60da4a532
| 112
|
py
|
Python
|
pyticket/test.py
|
Lithimlin/pyticket
|
7ebefd2cd0cf24b195032f44aa6ffb8787ab10bd
|
[
"MIT-0",
"MIT"
] | 3
|
2019-06-07T13:39:39.000Z
|
2021-01-21T20:42:43.000Z
|
pyticket/test.py
|
Lithimlin/pyticket
|
7ebefd2cd0cf24b195032f44aa6ffb8787ab10bd
|
[
"MIT-0",
"MIT"
] | 32
|
2019-04-26T10:41:32.000Z
|
2021-06-08T04:09:27.000Z
|
pyticket/test.py
|
Lithimlin/pyticket
|
7ebefd2cd0cf24b195032f44aa6ffb8787ab10bd
|
[
"MIT-0",
"MIT"
] | 2
|
2019-08-15T08:00:26.000Z
|
2021-06-11T08:11:10.000Z
|
from django.test import TestCase
class CronCommandtest(TestCase):
def test_cron_command(self):
pass
| 22.4
| 32
| 0.75
| 14
| 112
| 5.857143
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.1875
| 112
| 5
| 33
| 22.4
| 0.901099
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0.25
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 5
|
69f48837768ee7bb01e7652006e58eb8d225f121
| 466
|
py
|
Python
|
anagrams/test_.py
|
technolingo/AlgoStructuresPy
|
4ac95542dec48b61dab3a0f33c5bacbe5a3cb3f1
|
[
"MIT"
] | null | null | null |
anagrams/test_.py
|
technolingo/AlgoStructuresPy
|
4ac95542dec48b61dab3a0f33c5bacbe5a3cb3f1
|
[
"MIT"
] | null | null | null |
anagrams/test_.py
|
technolingo/AlgoStructuresPy
|
4ac95542dec48b61dab3a0f33c5bacbe5a3cb3f1
|
[
"MIT"
] | null | null | null |
from .index import are_anagrams
def test_are_anagrams_true():
assert are_anagrams('', '') is True
assert are_anagrams('a', 'a') is True
assert are_anagrams('hello', 'llohe') is True
assert are_anagrams('Whoa! Hi!', 'Hi! Whoa!') is True
def test_are_anagrams_false():
assert are_anagrams('One One', 'Two two two') is False
assert are_anagrams('One one', 'One one c') is False
assert are_anagrams('tree, bench', 'fence, yard') is False
| 31.066667
| 62
| 0.684549
| 72
| 466
| 4.236111
| 0.319444
| 0.360656
| 0.390164
| 0.27541
| 0.495082
| 0.183607
| 0
| 0
| 0
| 0
| 0
| 0
| 0.182403
| 466
| 14
| 63
| 33.285714
| 0.800525
| 0
| 0
| 0
| 0
| 0
| 0.184549
| 0
| 0
| 0
| 0
| 0
| 0.7
| 1
| 0.2
| true
| 0
| 0.1
| 0
| 0.3
| 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
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
0e01c0381ef90e35bd2a65ecd86e3eefcd8102bd
| 96
|
py
|
Python
|
settings/__init__.py
|
siehr/django-testing-framework
|
7e411227afff1a5463ebc73ae5cb2c537f0d4f69
|
[
"MIT"
] | null | null | null |
settings/__init__.py
|
siehr/django-testing-framework
|
7e411227afff1a5463ebc73ae5cb2c537f0d4f69
|
[
"MIT"
] | 70
|
2021-03-06T14:36:42.000Z
|
2022-03-30T10:00:54.000Z
|
settings/__init__.py
|
siehr/django-testing-framework
|
7e411227afff1a5463ebc73ae5cb2c537f0d4f69
|
[
"MIT"
] | 1
|
2022-02-02T14:05:43.000Z
|
2022-02-02T14:05:43.000Z
|
import os, sys
try:
from .local import *
except ImportError:
from .development import *
| 16
| 30
| 0.697917
| 12
| 96
| 5.583333
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.229167
| 96
| 6
| 30
| 16
| 0.905405
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.8
| 0
| 0.8
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
0e0a8b45be3ec1fbd9a8346f1964d9f36a50b5c7
| 31
|
py
|
Python
|
tests/__init__.py
|
njamaleddine/django-csvtojson
|
82dde0a97c717eea58852016b7ff88898f21d02e
|
[
"MIT"
] | 1
|
2015-11-21T03:16:14.000Z
|
2015-11-21T03:16:14.000Z
|
tests/__init__.py
|
njamaleddine/django-csvtojson
|
82dde0a97c717eea58852016b7ff88898f21d02e
|
[
"MIT"
] | 5
|
2015-09-29T03:30:27.000Z
|
2015-10-01T02:03:57.000Z
|
tests/__init__.py
|
njamaleddine/django-csvtojson
|
82dde0a97c717eea58852016b7ff88898f21d02e
|
[
"MIT"
] | null | null | null |
""" TODO: Write some tests """
| 15.5
| 30
| 0.580645
| 4
| 31
| 4.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.193548
| 31
| 1
| 31
| 31
| 0.72
| 0.709677
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 1
| 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
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
0e12ed270b513824d2e27efff85df855cc4e3a59
| 44
|
py
|
Python
|
plusseg/data/samplers/__init__.py
|
tonysy/SegmentationToolbox.PyTorch
|
4d487dd81d0101bc5cdb7b2337776fdf1b5546ff
|
[
"MIT"
] | 13
|
2019-07-26T11:33:15.000Z
|
2021-09-22T06:48:52.000Z
|
plusseg/data/samplers/__init__.py
|
tonysy/SegmentationToolbox.PyTorch
|
4d487dd81d0101bc5cdb7b2337776fdf1b5546ff
|
[
"MIT"
] | 1
|
2018-11-05T14:07:07.000Z
|
2018-11-05T14:07:07.000Z
|
plusseg/data/samplers/__init__.py
|
tonysy/SegmentationToolbox.PyTorch
|
4d487dd81d0101bc5cdb7b2337776fdf1b5546ff
|
[
"MIT"
] | 2
|
2019-07-26T11:33:32.000Z
|
2020-03-04T13:47:50.000Z
|
from .distributed import DistributedSampler
| 22
| 43
| 0.886364
| 4
| 44
| 9.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.090909
| 44
| 1
| 44
| 44
| 0.975
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
38645ffdf0584ed64f3c713910593cc78c86fc86
| 4,196
|
py
|
Python
|
alphacsc/tests/test_init_d.py
|
vishalbelsare/alphacsc
|
7b7f2f3b0456ab338e95924c76828a26b3b8e4b2
|
[
"BSD-3-Clause"
] | null | null | null |
alphacsc/tests/test_init_d.py
|
vishalbelsare/alphacsc
|
7b7f2f3b0456ab338e95924c76828a26b3b8e4b2
|
[
"BSD-3-Clause"
] | null | null | null |
alphacsc/tests/test_init_d.py
|
vishalbelsare/alphacsc
|
7b7f2f3b0456ab338e95924c76828a26b3b8e4b2
|
[
"BSD-3-Clause"
] | null | null | null |
import pytest
import numpy as np
import functools
from numpy.testing import assert_allclose
from alphacsc.init_dict import init_dictionary
from alphacsc.update_d_multi import prox_uv, prox_d
from alphacsc.update_d_multi import check_solver_and_constraints
from alphacsc.learn_d_z_multi import learn_d_z_multi
from alphacsc.utils import check_random_state
from alphacsc.tests.conftest import parametrize_solver_and_constraint
@parametrize_solver_and_constraint
def test_init_array(rank1, solver_d, uv_constraint):
n_trials, n_channels, n_times = 5, 3, 100
n_times_atom, n_atoms = 10, 4
_, uv_constraint_ = check_solver_and_constraints(
rank1, solver_d, uv_constraint
)
if rank1:
expected_shape = (n_atoms, n_channels + n_times_atom)
prox = functools.partial(prox_uv, uv_constraint=uv_constraint_,
n_channels=n_channels)
else:
expected_shape = (n_atoms, n_channels, n_times_atom)
prox = prox_d
X = np.random.randn(n_trials, n_channels, n_times)
# Test that init_dictionary is doing what we expect for D_init array
D_init = np.random.randn(*expected_shape)
D_hat = init_dictionary(X, n_atoms, n_times_atom, D_init=D_init,
rank1=rank1, uv_constraint=uv_constraint_)
D_init = prox(D_init)
assert_allclose(D_hat, D_init)
assert id(D_hat) != id(D_init)
# Test that learn_d_z_multi is doing what we expect for D_init array
D_init = np.random.randn(*expected_shape)
_, _, D_hat, _, _ = learn_d_z_multi(
X, n_atoms, n_times_atom, D_init=D_init, n_iter=0,
rank1=rank1, solver_d=solver_d, uv_constraint=uv_constraint
)
D_init = prox(D_init)
assert_allclose(D_hat, D_init)
@parametrize_solver_and_constraint
def test_init_random(rank1, solver_d, uv_constraint):
""""""
n_trials, n_channels, n_times = 5, 3, 100
n_times_atom, n_atoms = 10, 4
_, uv_constraint_ = check_solver_and_constraints(
rank1, solver_d, uv_constraint
)
if rank1:
expected_shape = (n_atoms, n_channels + n_times_atom)
prox = functools.partial(prox_uv, uv_constraint=uv_constraint_,
n_channels=n_channels)
else:
expected_shape = (n_atoms, n_channels, n_times_atom)
prox = prox_d
X = np.random.randn(n_trials, n_channels, n_times)
# Test that init_dictionary is doing what we expect for D_init random
random_state = 42
D_hat = init_dictionary(X, n_atoms, n_times_atom, D_init='random',
rank1=rank1, uv_constraint=uv_constraint_,
random_state=random_state)
rng = check_random_state(random_state)
D_init = rng.randn(*expected_shape)
D_init = prox(D_init)
assert_allclose(D_hat, D_init, err_msg="The random state is not correctly "
"used in init_dictionary .")
# Test that learn_d_z_multi is doing what we expect for D_init random
random_state = 27
_, _, D_hat, _, _ = learn_d_z_multi(
X, n_atoms, n_times_atom, D_init='random', n_iter=0,
rank1=rank1, solver_d=solver_d, uv_constraint=uv_constraint,
random_state=random_state
)
rng = check_random_state(random_state)
D_init = rng.randn(*expected_shape)
D_init = prox(D_init)
assert_allclose(D_hat, D_init, err_msg="The random state is not correctly "
"used in learn_d_z_multi.")
@pytest.mark.parametrize("rank1", [True, False])
@pytest.mark.parametrize("D_init", [
None, 'random', 'chunk', 'kmeans'
])
def test_init_shape(D_init, rank1):
n_trials, n_channels, n_times = 5, 3, 100
n_times_atom, n_atoms = 10, 4
X = np.random.randn(n_trials, n_channels, n_times)
expected_shape = (n_atoms, n_channels, n_times_atom)
if rank1:
expected_shape = (n_atoms, n_channels + n_times_atom)
# Test that init_dictionary returns correct shape
uv_hat = init_dictionary(X, n_atoms, n_times_atom, D_init=D_init,
rank1=rank1, uv_constraint='separate',
random_state=42)
assert uv_hat.shape == expected_shape
| 34.677686
| 79
| 0.686845
| 626
| 4,196
| 4.198083
| 0.134185
| 0.05898
| 0.053272
| 0.068493
| 0.788052
| 0.788052
| 0.761416
| 0.730213
| 0.730213
| 0.711187
| 0
| 0.015848
| 0.233079
| 4,196
| 120
| 80
| 34.966667
| 0.800808
| 0.075548
| 0
| 0.545455
| 0
| 0
| 0.042669
| 0
| 0
| 0
| 0
| 0
| 0.079545
| 1
| 0.034091
| false
| 0
| 0.113636
| 0
| 0.147727
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
38a4c5ebee9b5218e3d9ded7230d99f7c382195d
| 110
|
py
|
Python
|
test/sample2.py
|
benmcp/gulp-pylint
|
91c2bcb85dff2cf94306494b81fb3f7d6fcf2a20
|
[
"MIT"
] | 1
|
2018-05-20T22:51:22.000Z
|
2018-05-20T22:51:22.000Z
|
test/sample2.py
|
benmcp/gulp-pylint
|
91c2bcb85dff2cf94306494b81fb3f7d6fcf2a20
|
[
"MIT"
] | null | null | null |
test/sample2.py
|
benmcp/gulp-pylint
|
91c2bcb85dff2cf94306494b81fb3f7d6fcf2a20
|
[
"MIT"
] | null | null | null |
"""
Sample module docstring
"""
def world():
"""
Sample function docstring
"""
print('world')
| 12.222222
| 29
| 0.563636
| 10
| 110
| 6.2
| 0.7
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.263636
| 110
| 8
| 30
| 13.75
| 0.765432
| 0.445455
| 0
| 0
| 0
| 0
| 0.131579
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| true
| 0
| 0
| 0
| 0.5
| 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
| 1
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
38d950706ed3250ee91162a4b027671d7c248e09
| 216
|
py
|
Python
|
django/contrib/gis/db/models/sql/__init__.py
|
webjunkie/django
|
5dbca13f3baa2e1bafd77e84a80ad6d8a074712e
|
[
"BSD-3-Clause"
] | 790
|
2015-01-03T02:13:39.000Z
|
2020-05-10T19:53:57.000Z
|
django/contrib/gis/db/models/sql/__init__.py
|
mradziej/django
|
5d38965743a369981c9a738a298f467f854a2919
|
[
"BSD-3-Clause"
] | 1,361
|
2015-01-08T23:09:40.000Z
|
2020-04-14T00:03:04.000Z
|
django/contrib/gis/db/models/sql/__init__.py
|
mradziej/django
|
5d38965743a369981c9a738a298f467f854a2919
|
[
"BSD-3-Clause"
] | 155
|
2015-01-08T22:59:31.000Z
|
2020-04-08T08:01:53.000Z
|
from django.contrib.gis.db.models.sql.conversion import AreaField, DistanceField, GeomField
from django.contrib.gis.db.models.sql.query import GeoQuery
from django.contrib.gis.db.models.sql.where import GeoWhereNode
| 54
| 91
| 0.842593
| 32
| 216
| 5.6875
| 0.5
| 0.164835
| 0.28022
| 0.32967
| 0.510989
| 0.510989
| 0.510989
| 0
| 0
| 0
| 0
| 0
| 0.064815
| 216
| 3
| 92
| 72
| 0.90099
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
38dd49a19e584194c110356bc1befd7919afa65e
| 19
|
py
|
Python
|
chargebee/version.py
|
Uszczi/chargebee-python
|
f98a749961631aefd88e7d530f35cabd422d924b
|
[
"MIT"
] | null | null | null |
chargebee/version.py
|
Uszczi/chargebee-python
|
f98a749961631aefd88e7d530f35cabd422d924b
|
[
"MIT"
] | null | null | null |
chargebee/version.py
|
Uszczi/chargebee-python
|
f98a749961631aefd88e7d530f35cabd422d924b
|
[
"MIT"
] | null | null | null |
VERSION = '2.14.0'
| 9.5
| 18
| 0.578947
| 4
| 19
| 2.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.25
| 0.157895
| 19
| 1
| 19
| 19
| 0.4375
| 0
| 0
| 0
| 0
| 0
| 0.315789
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 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
| 5
|
2a0e8f07521a2a8e0124b62c02cc3f018412c3b2
| 337
|
py
|
Python
|
Codewars/Create_phone_number - (6 kyu).py
|
maxcohen31/A-bored-math-student
|
007beb4dabf7b4406f48e9a3a967c29d032eab89
|
[
"MIT"
] | null | null | null |
Codewars/Create_phone_number - (6 kyu).py
|
maxcohen31/A-bored-math-student
|
007beb4dabf7b4406f48e9a3a967c29d032eab89
|
[
"MIT"
] | null | null | null |
Codewars/Create_phone_number - (6 kyu).py
|
maxcohen31/A-bored-math-student
|
007beb4dabf7b4406f48e9a3a967c29d032eab89
|
[
"MIT"
] | null | null | null |
# Create phone number
def create_phone_number(n):
full_str = ''.join([str(numb) for numb in x])
return f'({full_str[0:3]})' + ' ' + f'{full_str[3:6]}' + '-' + f'{full_str[6:10]}'
def create_phone_number_2(x):
phone_number = "({}{}{}) {}{}{}-{}{}{}{}".format(*x)
return phone_number
| 22.466667
| 86
| 0.507418
| 46
| 337
| 3.478261
| 0.434783
| 0.34375
| 0.31875
| 0.25
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.032
| 0.25816
| 337
| 14
| 87
| 24.071429
| 0.608
| 0.05638
| 0
| 0
| 0
| 0
| 0.234921
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.666667
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
2a18a94110a1afc079cd9bfd87a3040bb111fc9a
| 41
|
py
|
Python
|
tests/__init__.py
|
bibby/pypi-uploader
|
2adbe84542042d479618e5d6bc55a4453fda7d0a
|
[
"MIT"
] | null | null | null |
tests/__init__.py
|
bibby/pypi-uploader
|
2adbe84542042d479618e5d6bc55a4453fda7d0a
|
[
"MIT"
] | 1
|
2019-10-24T16:57:02.000Z
|
2019-10-28T15:03:43.000Z
|
tests/__init__.py
|
bibby/pypi-uploader
|
2adbe84542042d479618e5d6bc55a4453fda7d0a
|
[
"MIT"
] | 1
|
2018-12-19T18:35:51.000Z
|
2018-12-19T18:35:51.000Z
|
"""Tests for the :mod:`pypiuploader`."""
| 20.5
| 40
| 0.634146
| 5
| 41
| 5.2
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.097561
| 41
| 1
| 41
| 41
| 0.702703
| 0.829268
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
2a4a7fdc11b163be207a41d963ccf15df8532b2e
| 85
|
py
|
Python
|
aws-s3-django-postgresql-rest/app/core/admin.py
|
MdSauravChowdhury/cheat-project
|
8602d1479e0b2adad48265404e4509ab6a45b8e3
|
[
"MIT"
] | null | null | null |
aws-s3-django-postgresql-rest/app/core/admin.py
|
MdSauravChowdhury/cheat-project
|
8602d1479e0b2adad48265404e4509ab6a45b8e3
|
[
"MIT"
] | null | null | null |
aws-s3-django-postgresql-rest/app/core/admin.py
|
MdSauravChowdhury/cheat-project
|
8602d1479e0b2adad48265404e4509ab6a45b8e3
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import S3Box
admin.site.register(S3Box)
| 28.333333
| 32
| 0.835294
| 13
| 85
| 5.461538
| 0.692308
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.025974
| 0.094118
| 85
| 3
| 33
| 28.333333
| 0.896104
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
2a86ff4084e5661b92ba759f7bd1d2a93fb84d40
| 127
|
py
|
Python
|
core/fabkit/system/__init__.py
|
fabrickit/fabkit
|
ca099c7e543efb8f5c1d19453c8ceada0584e563
|
[
"MIT"
] | null | null | null |
core/fabkit/system/__init__.py
|
fabrickit/fabkit
|
ca099c7e543efb8f5c1d19453c8ceada0584e563
|
[
"MIT"
] | null | null | null |
core/fabkit/system/__init__.py
|
fabrickit/fabkit
|
ca099c7e543efb8f5c1d19453c8ceada0584e563
|
[
"MIT"
] | null | null | null |
# coding: utf-8
from package import Package # noqa
from service import Service # noqa
from observer import Observer # noqa
| 21.166667
| 37
| 0.755906
| 18
| 127
| 5.333333
| 0.5
| 0.166667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.009804
| 0.19685
| 127
| 5
| 38
| 25.4
| 0.931373
| 0.220472
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
aa5657852d191bdd8e1f86af6fd8ad08e7c4671b
| 128
|
py
|
Python
|
py_tdlib/constructors/input_passport_element_utility_bill.py
|
Mr-TelegramBot/python-tdlib
|
2e2d21a742ebcd439971a32357f2d0abd0ce61eb
|
[
"MIT"
] | 24
|
2018-10-05T13:04:30.000Z
|
2020-05-12T08:45:34.000Z
|
py_tdlib/constructors/input_passport_element_utility_bill.py
|
MrMahdi313/python-tdlib
|
2e2d21a742ebcd439971a32357f2d0abd0ce61eb
|
[
"MIT"
] | 3
|
2019-06-26T07:20:20.000Z
|
2021-05-24T13:06:56.000Z
|
py_tdlib/constructors/input_passport_element_utility_bill.py
|
MrMahdi313/python-tdlib
|
2e2d21a742ebcd439971a32357f2d0abd0ce61eb
|
[
"MIT"
] | 5
|
2018-10-05T14:29:28.000Z
|
2020-08-11T15:04:10.000Z
|
from ..factory import Type
class inputPassportElementUtilityBill(Type):
utility_bill = None # type: "inputPersonalDocument"
| 21.333333
| 53
| 0.796875
| 12
| 128
| 8.416667
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 128
| 5
| 54
| 25.6
| 0.901786
| 0.226563
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.333333
| 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
| 1
| 1
| 0
| 1
| 0
|
0
| 5
|
aa99affc8e83729d9348702b0aeac610e8b7ea8d
| 7,368
|
py
|
Python
|
algorithms/queens-attack-2.py
|
gajubadge11/HackerRank-1
|
7b136ccaa1ed47ae737467ace6b494c720ccb942
|
[
"MIT"
] | 340
|
2018-06-17T19:45:56.000Z
|
2022-03-22T02:26:15.000Z
|
algorithms/queens-attack-2.py
|
gajubadge11/HackerRank-1
|
7b136ccaa1ed47ae737467ace6b494c720ccb942
|
[
"MIT"
] | 3
|
2021-02-02T17:17:29.000Z
|
2021-05-18T10:06:04.000Z
|
algorithms/queens-attack-2.py
|
gajubadge11/HackerRank-1
|
7b136ccaa1ed47ae737467ace6b494c720ccb942
|
[
"MIT"
] | 229
|
2019-04-20T08:28:49.000Z
|
2022-03-31T04:23:52.000Z
|
#!/bin/python3
import sys
from collections import defaultdict
from math import fabs
def check_diag(queen, obst):
if queen[1] == obst[1]:
return 0
check = (queen[0] - obst[0])/(queen[1] - obst[1])
if fabs(check) == 1.0:
return int(check)
else:
return 0
def queensAttack(n, k, r_q, c_q, obstacles):
queen = [r_q, c_q]
res = 0
obst_by_row = list(filter(lambda x: x[0] == r_q, obstacles))
obst_by_col = list(filter(lambda x: x[1] == c_q, obstacles))
obst_by_plus_diag = list(filter(lambda x: check_diag(queen, x) == 1, obstacles))
obst_by_neg_diag = list(filter(lambda x: check_diag(queen, x) == -1, obstacles))
if not obst_by_col:
res += n-1
else:
obst_higher = list(filter(lambda x: x[0] > r_q, obst_by_col))
if obst_higher:
min_higher = min(obst_higher, key = lambda x: x[0])[0]
else:
min_higher = n+1
obst_lower = list(filter(lambda x: x[0] < r_q, obst_by_col))
if obst_lower:
max_lower = max(obst_lower, key = lambda x: x[0])[0]
else:
max_lower = 0
#print("high = {} low = {}".format(min_higher, max_lower))
res += min_higher - max_lower - 2
if not obst_by_row:
res += n-1
else:
obst_higher = list(filter(lambda x: x[1] > c_q, obst_by_row))
if obst_higher:
min_higher = min(obst_higher, key = lambda x: x[1])[1]
else:
min_higher = n+1
obst_lower = list(filter(lambda x: x[1] < c_q, obst_by_row))
if obst_lower:
max_lower = max(obst_lower, key = lambda x: x[1])[1]
else:
max_lower = 0
#print("high = {} low = {}".format(min_higher, max_lower))
res += min_higher - max_lower - 2
# diagonals
if not obst_by_plus_diag:
res += n-1 - abs(r_q - c_q)
#res += min(n - c_q, n - r_q) + min(c_q - 1, r_q - 1) # = n-1 + min(-c_q, -r_q) + min(c_q, r_q)
#print("res = {}".format(res))
else:
obst_higher = list(filter(lambda x: x[0] > r_q, obst_by_plus_diag))
if obst_higher:
min_higher = min(obst_higher, key = lambda x: x[0])[0]
else:
min_higher = n+1
obst_lower = list(filter(lambda x: x[0] < r_q, obst_by_plus_diag))
if obst_lower:
max_lower = max(obst_lower, key = lambda x: x[0])[0]
else:
max_lower = 0
#print("high = {} low = {}".format(min_higher, max_lower))
res += min_higher - max_lower - 2 - abs(r_q - c_q)
if not obst_by_neg_diag:
#print("n - c_q + r_q = {} - {} + {}".format(n, c_q, r_q))
#res += n-1 - abs(n - c_q + r_q)
#print("res = {}".format(res))
#res += min(n - c_q, r_q - 1) + min(c_q - 1, n - r_q)
# 2 variants:
# res += n - c_q + n - r_q = 2n - c_q - r_q
# res += r_q - 1 + c_q - 1 = r_q + c_q - 2
res += min(n - c_q, r_q - 1)
res += min(c_q - 1, n - r_q)
else:
obst_higher = list(filter(lambda x: x[0] > r_q, obst_by_neg_diag))
if obst_higher:
min_higher = min(obst_higher, key = lambda x: x[0])[1]
else:
min_higher = n+1
obst_lower = list(filter(lambda x: x[0] < r_q, obst_by_neg_diag))
if obst_lower:
max_lower = max(obst_lower, key = lambda x: x[0])[1]
else:
max_lower = 0
print("high = {} low = {}".format(min_higher, max_lower))
print("r_q = {} c_q = {}".format(r_q, c_q))
#res += min_higher - max_lower - 2 - abs(n - c_q + r_q)
if max_lower != 0:
res += max_lower - c_q - 1
if min_higher != n+1:
res += c_q - min_higher - 1
return res
# naive
def queensAttack_naive(n, k, r_q, c_q, obstacles):
obst_by_row = list(filter(lambda x: x[0] == r_q, obstacles))
obst_by_col = list(filter(lambda x: x[1] == c_q, obstacles))
obs_dict = gen_obs_dict(obstacles)
res = 0
if not obst_by_col:
res += n-1
else:
for row_ind in range(r_q+1, n+1):
#if not [row_ind, c_q] in obstacles:
key = str(row_ind) + "-" + str(c_q)
if obs_dict[key] != -1:
res += 1
else:
break
for row_ind in range(r_q-1, 0, -1):
#if not [row_ind, c_q] in obstacles:
key = str(row_ind) + "-" + str(c_q)
if obs_dict[key] != -1:
res += 1
else:
break
if not obst_by_row:
res += n-1
else:
for col_ind in range(c_q+1, n+1):
#if not [r_q, col_ind] in obstacles:
key = str(r_q) + "-" + str(col_ind)
if obs_dict[key] != -1:
res += 1
else:
break
for col_ind in range(c_q-1, 0, -1):
#if not [r_q, col_ind] in obstacles:
key = str(r_q) + "-" + str(col_ind)
if obs_dict[key] != -1:
res += 1
else:
break
row_ind, col_ind = r_q+1, c_q+1
while col_ind != 0 and row_ind != 0 and col_ind != n+1 and row_ind != n+1:
#if not [row_ind, col_ind] in obstacles:
key = str(row_ind) + "-" + str(col_ind)
if obs_dict[key] != -1:
res += 1
row_ind += 1
col_ind += 1
else:
break
row_ind, col_ind = r_q-1, c_q+1
while col_ind != 0 and row_ind != 0 and col_ind != n+1 and row_ind != n+1:
#if not [row_ind, col_ind] in obstacles:
key = str(row_ind) + "-" + str(col_ind)
if obs_dict[key] != -1:
res += 1
row_ind -= 1
col_ind += 1
else:
break
row_ind, col_ind = r_q+1, c_q-1
while col_ind != 0 and row_ind != 0 and col_ind != n+1 and row_ind != n+1:
#if not [row_ind, col_ind] in obstacles:
key = str(row_ind) + "-" + str(col_ind)
if obs_dict[key] != -1:
res += 1
row_ind += 1
col_ind -= 1
else:
break
row_ind, col_ind = r_q-1, c_q-1
while col_ind != 0 and row_ind != 0 and col_ind != n+1 and row_ind != n+1:
#if not [row_ind, col_ind] in obstacles:
key = str(row_ind) + "-" + str(col_ind)
if obs_dict[key] != -1:
res += 1
row_ind -= 1
col_ind -= 1
else:
break
return res
def gen_obs_dict(obstacles):
dict_out = defaultdict(int)
for obs in obstacles:
row, col = obs[0], obs[1]
key = str(row) + "-" + str(col)
dict_out[key] = -1
return dict_out
if __name__ == "__main__":
n, k = [int(x) for x in input().strip().split(' ')]
r_q, c_q = [int(x) for x in input().strip().split(' ')]
obstacles = []
for obstacles_i in range(k):
obstacles_t = [int(obstacles_temp) for obstacles_temp in input().strip().split(' ')]
obstacles.append(obstacles_t)
result = queensAttack_naive(n, k, r_q, c_q, obstacles)
print(result)
| 33.040359
| 103
| 0.491857
| 1,144
| 7,368
| 2.917832
| 0.065559
| 0.025764
| 0.047933
| 0.0713
| 0.807669
| 0.77831
| 0.764829
| 0.746255
| 0.690533
| 0.649191
| 0
| 0.029909
| 0.373779
| 7,368
| 222
| 104
| 33.189189
| 0.693541
| 0.128122
| 0
| 0.633136
| 0
| 0
| 0.008595
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.023669
| false
| 0
| 0.017751
| 0
| 0.076923
| 0.017751
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
aaaabd14a5d8846b843550a522232737d333ac7d
| 148
|
py
|
Python
|
pyladiesbrasilbot/utils/constants.py
|
naanadr/pyladies-bot
|
72328c7b255b48449f58f966a50e62cb6259cf79
|
[
"MIT"
] | 3
|
2020-11-02T14:41:41.000Z
|
2020-11-02T19:16:00.000Z
|
pyladiesbrasilbot/utils/constants.py
|
yzakius/pyladies-bot
|
72328c7b255b48449f58f966a50e62cb6259cf79
|
[
"MIT"
] | 7
|
2020-10-21T19:08:06.000Z
|
2020-10-22T20:19:22.000Z
|
pyladiesbrasilbot/utils/constants.py
|
naanadr/ladies-bot
|
72328c7b255b48449f58f966a50e62cb6259cf79
|
[
"MIT"
] | 1
|
2022-02-25T13:07:24.000Z
|
2022-02-25T13:07:24.000Z
|
DEFAULT_PHOTO_WELCOME = "pyladiesbrasilbot/files/welcome_pyladies_default.png"
DEFAULT_PICKEL_FILE_PHOTO = "pyladiesbrasilbot/files/photos.pickle"
| 37
| 78
| 0.871622
| 17
| 148
| 7.176471
| 0.647059
| 0.360656
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.047297
| 148
| 3
| 79
| 49.333333
| 0.865248
| 0
| 0
| 0
| 0
| 0
| 0.601351
| 0.601351
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 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
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.