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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
20ab84447435a398ce0b773d1c81b9b26e46b05f
| 22
|
py
|
Python
|
tests/__init__.py
|
Lokaltog/axis
|
f602ef8089ed0332317274e0433f4ede75109533
|
[
"MIT"
] | 16
|
2018-05-29T20:07:04.000Z
|
2022-01-27T14:15:16.000Z
|
tests/__init__.py
|
Lokaltog/axis
|
f602ef8089ed0332317274e0433f4ede75109533
|
[
"MIT"
] | 27
|
2017-11-05T12:14:17.000Z
|
2022-02-07T08:07:48.000Z
|
tests/__init__.py
|
Lokaltog/axis
|
f602ef8089ed0332317274e0433f4ede75109533
|
[
"MIT"
] | 6
|
2019-10-03T07:59:49.000Z
|
2021-07-18T16:57:28.000Z
|
"""Tests for Axis."""
| 11
| 21
| 0.545455
| 3
| 22
| 4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.136364
| 22
| 1
| 22
| 22
| 0.631579
| 0.681818
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
20c9733103a4aade6d17a1d2918920d52c4be9d2
| 360
|
py
|
Python
|
py/query_parsers/getUserDB.py
|
rSimulate/Cosmosium
|
f2489862b9b747458a6be9b884c9de75bd6eb3d2
|
[
"CC-BY-4.0"
] | 18
|
2015-01-02T05:22:43.000Z
|
2021-11-12T12:11:12.000Z
|
py/query_parsers/getUserDB.py
|
rSimulate/Cosmosium
|
f2489862b9b747458a6be9b884c9de75bd6eb3d2
|
[
"CC-BY-4.0"
] | 3
|
2015-07-14T19:11:54.000Z
|
2018-09-17T19:09:52.000Z
|
py/query_parsers/getUserDB.py
|
rSimulate/Cosmosium
|
f2489862b9b747458a6be9b884c9de75bd6eb3d2
|
[
"CC-BY-4.0"
] | 4
|
2016-02-24T05:19:07.000Z
|
2022-02-15T17:36:37.000Z
|
from py.game_logic.user.User import User
import pymongo
def createUser(name, icon, agency, subtext ):
use = User()
use.setProfileInfo(name,icon,agency,subtext)
return use
def getProfile(userName):
return createUser(str(db.test_user.find_one({"user":userName},{"user": 1,"_id":0})),'/img/profiles/martin2.png','MONGO_CORP', 'MONGO_QUOTE')
| 20
| 141
| 0.713889
| 51
| 360
| 4.921569
| 0.647059
| 0.079681
| 0.111554
| 0.167331
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.009554
| 0.127778
| 360
| 17
| 142
| 21.176471
| 0.789809
| 0
| 0
| 0
| 0
| 0
| 0.160112
| 0.070225
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0.125
| 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
| 1
| 1
| 0
|
0
| 4
|
45961bd373ef84861ae0f8e0364c17b13ad6ce2c
| 5,538
|
py
|
Python
|
es1/missionaries_and_cannibals_prob.py
|
biromiro/feup-iart
|
aa2c8eb4fc31401ac40c9a0b87f4ac9b74dd0904
|
[
"MIT"
] | null | null | null |
es1/missionaries_and_cannibals_prob.py
|
biromiro/feup-iart
|
aa2c8eb4fc31401ac40c9a0b87f4ac9b74dd0904
|
[
"MIT"
] | null | null | null |
es1/missionaries_and_cannibals_prob.py
|
biromiro/feup-iart
|
aa2c8eb4fc31401ac40c9a0b87f4ac9b74dd0904
|
[
"MIT"
] | null | null | null |
"""
a)
State Representation: (miss_a, cann_a, miss_b, cann_b, side)
Initial State: (3, 3, 0, 0, A)
For every state: miss_a >= cann_a && miss_b >= cann_b on result state
Operators: (miss_a, cann_a, miss_b, cann_b, A) -> (miss_a - 1, cann_a, miss_b + 1, cann_b, B)
(miss_a, cann_a, miss_b, cann_b, A) -> (miss_a , cann_a - 1, miss_b, cann_b + 1, B)
(miss_a, cann_a, miss_b, cann_b, A) -> (miss_a - 2, cann_a, miss_b + 2, cann_b, B)
(miss_a, cann_a, miss_b, cann_b, A) -> (miss_a - 1, cann_a - 1, miss_b + 1, cann_b + 1, B)
(miss_a, cann_a, miss_b, cann_b, A) -> (miss_a, cann_a - 2, miss_b, cann_b + 2, B)
(miss_a, cann_a, miss_b, cann_b, B) -> (miss_a + 1, cann_a, miss_b - 1, cann_b, A)
(miss_a, cann_a, miss_b, cann_b, B) -> (miss_a , cann_a + 1, miss_b, cann_b - 1, A)
(miss_a, cann_a, miss_b, cann_b, B) -> (miss_a + 2, cann_a, miss_b - 2, cann_b, A)
(miss_a, cann_a, miss_b, cann_b, B) -> (miss_a + 1, cann_a + 1, miss_b - 1, cann_b - 1, A)
(miss_a, cann_a, miss_b, cann_b, B) -> (miss_a, cann_a + 2, miss_b, cann_b - 2, A)
All operators have a cost of 1.
Objective Test: Check if the state is equal to (0, 0, 3, 3, B)
"""
from algorithms import *;
class MissionariesCannibalsNode:
def __init__(self, miss_a, cann_a, miss_b, cann_b, onSideA, previousNode = None):
self.miss_a = miss_a;
self.cann_a = cann_a;
self.miss_b = miss_b;
self.cann_b = cann_b;
self.onSideA = onSideA;
self.previousNode = previousNode;
def __eq__(self, other):
if isinstance(other, self.__class__):
return self.miss_a == other.miss_a and self.cann_a == other.cann_a and self.miss_b == other.miss_b and self.cann_b == other.cann_b and self.onSideA == other.onSideA;
return False;
def __repr__(self):
return f'({self.miss_a}, {self.cann_a}, {self.miss_b}, {self.cann_b}, {"A" if self.onSideA else "B"})';
def __str__(self):
return f'({self.miss_a}, {self.cann_a}, {self.miss_b}, {self.cann_b}, {"A" if self.onSideA else "B"})';
@staticmethod
def isValidState(miss_a, cann_a, miss_b, cann_b):
if (miss_a < 0 or cann_a < 0 or miss_b < 0 or cann_b < 0): return False;
return (miss_a >= cann_a or miss_a == 0) and (miss_b >= cann_b or miss_b == 0);
def edgeNodes(self):
edgeNodesList = []
if (self.onSideA):
if(MissionariesCannibalsNode.isValidState(self.miss_a - 1, self.cann_a, self.miss_b + 1, self.cann_b)):
edgeNodesList.append(MissionariesCannibalsNode(self.miss_a - 1, self.cann_a, self.miss_b + 1, self.cann_b, False, self));
if(MissionariesCannibalsNode.isValidState(self.miss_a, self.cann_a - 1, self.miss_b, self.cann_b + 1)):
edgeNodesList.append(MissionariesCannibalsNode(self.miss_a, self.cann_a - 1, self.miss_b, self.cann_b + 1, False, self));
if(MissionariesCannibalsNode.isValidState(self.miss_a - 2, self.cann_a, self.miss_b + 2, self.cann_b)):
edgeNodesList.append(MissionariesCannibalsNode(self.miss_a - 2, self.cann_a, self.miss_b + 2, self.cann_b, False, self));
if(MissionariesCannibalsNode.isValidState(self.miss_a, self.cann_a - 2, self.miss_b, self.cann_b + 2)):
edgeNodesList.append(MissionariesCannibalsNode(self.miss_a, self.cann_a - 2, self.miss_b, self.cann_b + 2, False, self));
if(MissionariesCannibalsNode.isValidState(self.miss_a - 1, self.cann_a - 1, self.miss_b + 1, self.cann_b + 1)):
edgeNodesList.append(MissionariesCannibalsNode(self.miss_a - 1, self.cann_a - 1, self.miss_b + 1, self.cann_b + 1, False, self));
elif (not self.onSideA):
if(MissionariesCannibalsNode.isValidState(self.miss_a + 1, self.cann_a, self.miss_b - 1, self.cann_b)):
edgeNodesList.append(MissionariesCannibalsNode(self.miss_a + 1, self.cann_a, self.miss_b - 1, self.cann_b, True, self));
if(MissionariesCannibalsNode.isValidState(self.miss_a, self.cann_a + 1, self.miss_b, self.cann_b - 1)):
edgeNodesList.append(MissionariesCannibalsNode(self.miss_a, self.cann_a + 1, self.miss_b, self.cann_b - 1, True, self));
if(MissionariesCannibalsNode.isValidState(self.miss_a + 2, self.cann_a, self.miss_b - 2, self.cann_b)):
edgeNodesList.append(MissionariesCannibalsNode(self.miss_a + 2, self.cann_a, self.miss_b - 2, self.cann_b, True, self));
if(MissionariesCannibalsNode.isValidState(self.miss_a, self.cann_a + 2, self.miss_b, self.cann_b - 2)):
edgeNodesList.append(MissionariesCannibalsNode(self.miss_a, self.cann_a + 2, self.miss_b, self.cann_b - 2, True, self));
if(MissionariesCannibalsNode.isValidState(self.miss_a + 1, self.cann_a + 1, self.miss_b - 1, self.cann_b - 1)):
edgeNodesList.append(MissionariesCannibalsNode(self.miss_a + 1, self.cann_a + 1, self.miss_b - 1, self.cann_b - 1, True, self));
return edgeNodesList;
MISS_NUM = 3;
CANN_NUM = 3;
initial = MissionariesCannibalsNode(MISS_NUM, CANN_NUM, 0, 0, True)
def condition(node):
return node == MissionariesCannibalsNode(0, 0, MISS_NUM, CANN_NUM, False);
print(bfs(initial, condition))
print(dfs(initial, condition))
print(it_deep(initial, condition))
| 57.6875
| 177
| 0.630914
| 863
| 5,538
| 3.774044
| 0.077636
| 0.081363
| 0.069082
| 0.058336
| 0.737488
| 0.724593
| 0.719374
| 0.719374
| 0.689285
| 0.688978
| 0
| 0.021996
| 0.236547
| 5,538
| 95
| 178
| 58.294737
| 0.748344
| 0.22138
| 0
| 0.037037
| 0
| 0.037037
| 0.042761
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.12963
| false
| 0
| 0.018519
| 0.055556
| 0.296296
| 0.055556
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
45ad29e55db5c4aa7310627ba31608cc4e0f943d
| 16,703
|
py
|
Python
|
gen.py
|
GBLin5566/An-Automated-Traditional-Chinese-Dialogue-Generating-System
|
3f6d0e3b52602eee1eb97c943cb806508f8647bb
|
[
"MIT"
] | 4
|
2018-01-22T01:48:10.000Z
|
2021-11-19T06:45:23.000Z
|
gen.py
|
GBLin5566/An-Automated-Traditional-Chinese-Dialogue-Generating-System
|
3f6d0e3b52602eee1eb97c943cb806508f8647bb
|
[
"MIT"
] | 1
|
2019-03-14T05:57:11.000Z
|
2019-03-14T17:08:59.000Z
|
gen.py
|
GBLin5566/An-Automated-Traditional-Chinese-Dialogue-Generating-System
|
3f6d0e3b52602eee1eb97c943cb806508f8647bb
|
[
"MIT"
] | 10
|
2017-07-22T09:33:05.000Z
|
2020-01-14T09:57:57.000Z
|
# -*- coding: utf-8 -*-
"""Generator for model"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from builtins import range
import argparse
import os
import sys
import random
import pickle
from math import exp
import torch
from torch.autograd import Variable
# Import my own cleaning lib, use jieba for other user
try:
from purewords import clean_sentence as clean
except ImportError:
from jieba import lcut as clean
import model
import utils
from utils import check_cuda_for_var, check_directory
parser = argparse.ArgumentParser(description=\
"Generator for HRNN/Seq2seq")
parser.add_argument('--data', type=str,
help="location of the data corpus(json file)")
parser.add_argument('--type', type=str,
help="generate dialog with hrnn/seq2seq model")
parser.add_argument('--save', type=str, default='model/',
help='path to load the final model\'s directory')
parser.add_argument('--seed', type=int, default=55665566,
help='random seed')
parser.add_argument('--beam', type=int, default=1,
help='beam size for beam search(default 1 will be greedy search)')
parser.add_argument('--eodlong', type=int, default=0,
help='whether force model to gen a longer dialog (1 for on, 0 for off, default = 0)')
parser.add_argument('--nosr', type=int, default=0,
help='whether force model don\'t self repeat (1 for on, 0 for off, default = 0)')
parser.add_argument('--number', type=int, default=0,
help='model number to restore')
parser.add_argument('--sbs', type=int, default=0,
help='Generate sentence by sentence (1 for on, 0 for off, default = 0)')
args = parser.parse_args()
torch.manual_seed(args.seed)
random.seed(args.seed)
DEBUG = False
if args.type != "hrnn" and args.type != "seq2seq":
raise ValueError("args.type should be hrnn or seq2seq, but got %s" % (args.type))
if args.beam <= 0:
raise ValueError("args.beam should be at least 1 or larger number")
if not os.path.isfile('dict.pkl'):
my_lang, _ = utils.build_lang(args.data)
with open('dict.pkl', 'wb') as filename:
pickle.dump(my_lang, filename)
else:
print("Load dict.pkl")
with open('dict.pkl', 'rb') as filename:
my_lang = pickle.load(filename)
if args.type == "hrnn":
# Load last HRNN model
if args.number == 0:
number = torch.load(os.path.join(args.save, 'checkpoint.pt'))
else:
number = args.number
encoder = torch.load(os.path.join(args.save, 'encoder'+str(number)+'.pt'))
context = torch.load(os.path.join(args.save, 'context'+str(number)+'.pt'))
decoder = torch.load(os.path.join(args.save, 'decoder'+str(number)+'.pt'))
if torch.cuda.is_available():
encoder = encoder.cuda()
context = context.cuda()
decoder = decoder.cuda()
def gen(sentence):
encoder.eval()
context.eval()
decoder.eval()
# Inference
gen_sentence = []
talking_history = []
context_hidden = context.init_hidden()
max_dialog_len = 20
max_sentence_len = 15
beam_size = args.beam
for _ in range(max_dialog_len):
decoder_input = Variable(torch.LongTensor([[my_lang.word2index["SOS"]]]))
decoder_input = check_cuda_for_var(decoder_input)
encoder_hidden = encoder.init_hidden()
decoder_hidden = decoder.init_hidden()
if len(gen_sentence) > 0:
for ei in range(len(gen_sentence)):
_, encoder_hidden = encoder(gen_sentence[ei], encoder_hidden)
# Clean generated sentence list
gen_sentence = []
else:
for ei in range(len(sentence)):
_, encoder_hidden = encoder(sentence[ei], encoder_hidden)
context_output, context_hidden = context(encoder_hidden, context_hidden)
# Beam search
index2state = {}
for index in range(beam_size):
index2state[index] = [decoder_input, decoder_hidden, [decoder_input.data[0][0]], 0.0]
# One step to get beam_size candidates
decoder_output, decoder_hidden = decoder(context_hidden,\
decoder_input, decoder_hidden)
scores, topi = decoder_output.data.topk(beam_size)
for index in range(beam_size):
ni = topi[0][index]
index2state[index][0] = check_cuda_for_var(Variable(torch.LongTensor([[ni]])))
index2state[index][1] = decoder_hidden
index2state[index][2].append(ni)
index2state[index][3] = scores[0][index]
for sentence_pointer in range(max_sentence_len):
current_scores = []
current2state = {}
# Init current2state
for index in range(beam_size):
for jndex in range(beam_size):
current2state[index * beam_size + jndex] = [0, 0, 0, 0]
for index in range(beam_size):
output, hidden = decoder(context_hidden, \
index2state[index][0], index2state[index][1])
tops, topi = output.data.topk(beam_size)
for jndex in range(beam_size):
ni = topi[0][jndex]
current_map = current2state[index * beam_size + jndex]
current_map[0] = check_cuda_for_var(Variable(torch.LongTensor([[ni]])))
current_map[1] = hidden
current_map[2] = index2state[index][2][:]
current_map[2].append(ni)
current_map[3] = tops[0][jndex] + index2state[index][3]
if args.eodlong == 1 and my_lang.word2index["EOD"] in current_map[2]:
current_map[3] *= exp(max_sentence_len - 12 - sentence_pointer)
current_scores.append(current_map[3])
_, top_of_beamsize2 = torch.FloatTensor(current_scores).topk(beam_size)
# Top beam's output is eos, break and output the top beam
if current2state[top_of_beamsize2[0]][2][-1] == my_lang.word2index["EOS"]:
if args.nosr == 1 and current2state[top_of_beamsize2[0]][2] in talking_history:
# Don't repeat itself
# Soft verion
current2state[top_of_beamsize2[0]][3] *= 2
# Hard version
#current2state[top_of_beamsize2[0][3]] *= 100000.0
else:
first_eos = current2state[top_of_beamsize2[0]][2].index(my_lang.word2index["EOS"])
gen_sentence = current2state[top_of_beamsize2[0]][2][:first_eos+1]
break
after_beam_dict = {}
for index, candidate in enumerate(top_of_beamsize2):
after_beam_dict[index] = current2state[candidate]
index2state = after_beam_dict
# Beam Search a good sentence and assign to gen_sentence
talking_history.append(gen_sentence)
gen_sentence = Variable(torch.LongTensor(gen_sentence))
gen_sentence = check_cuda_for_var(gen_sentence)
try:
string = ' '.join([my_lang.index2word[word.data[0]] for word in gen_sentence])
print(string)
if "EOD" in string:
break
except RuntimeError:
break
return talking_history
def genSbyS():
try:
encoder.eval()
context.eval()
decoder.eval()
context_hidden = context.init_hidden()
max_sentence_len = 15
beam_size = args.beam
talking_history = []
while True:
start = input("[%s] >>> " % (args.type.upper()))
if start == 'reset':
context_hidden = context.init_hidden()
talking_history = []
continue
clean_sentence = clean(start)
clean_sentence_idx = my_lang.sentence2index(clean_sentence)
if len(clean_sentence_idx) == 0:
continue
clean_sentence_idx = Variable(torch.LongTensor(clean_sentence_idx))
clean_sentence_idx = check_cuda_for_var(clean_sentence_idx)
sentence = clean_sentence_idx
decoder_input = Variable(torch.LongTensor([[my_lang.word2index["SOS"]]]))
decoder_input = check_cuda_for_var(decoder_input)
encoder_hidden = encoder.init_hidden()
decoder_hidden = decoder.init_hidden()
for ei in range(len(sentence)):
_, encoder_hidden = encoder(sentence[ei], encoder_hidden)
context_output, context_hidden = context(encoder_hidden, context_hidden)
# Beam search
index2state = {}
for index in range(beam_size):
index2state[index] = [decoder_input, decoder_hidden, [decoder_input.data[0][0]], 0.0]
# One step to get beam_size candidates
decoder_output, decoder_hidden = decoder(context_hidden,\
decoder_input, decoder_hidden)
scores, topi = decoder_output.data.topk(beam_size)
for index in range(beam_size):
ni = topi[0][index]
index2state[index][0] = check_cuda_for_var(Variable(torch.LongTensor([[ni]])))
index2state[index][1] = decoder_hidden
index2state[index][2].append(ni)
index2state[index][3] = scores[0][index]
for sentence_pointer in range(max_sentence_len):
current_scores = []
current2state = {}
# Init current2state
for index in range(beam_size):
for jndex in range(beam_size):
current2state[index * beam_size + jndex] = [0, 0, 0, 0]
for index in range(beam_size):
output, hidden = decoder(context_hidden, \
index2state[index][0], index2state[index][1])
tops, topi = output.data.topk(beam_size)
for jndex in range(beam_size):
ni = topi[0][jndex]
current_map = current2state[index * beam_size + jndex]
current_map[0] = check_cuda_for_var(Variable(torch.LongTensor([[ni]])))
current_map[1] = hidden
current_map[2] = index2state[index][2][:]
current_map[2].append(ni)
current_map[3] = tops[0][jndex] + index2state[index][3]
if args.eodlong == 1 and my_lang.word2index["EOD"] in current_map[2]:
current_map[3] *= exp(max_sentence_len - 12 - sentence_pointer)
current_scores.append(current_map[3])
_, top_of_beamsize2 = torch.FloatTensor(current_scores).topk(beam_size)
# Top beam's output is eos, break and output the top beam
if current2state[top_of_beamsize2[0]][2][-1] == my_lang.word2index["EOS"]:
if args.nosr == 1 and current2state[top_of_beamsize2[0]][2] in talking_history:
# Don't repeat itself
# Soft verion
current2state[top_of_beamsize2[0]][3] *= 2
# Hard version
#current2state[top_of_beamsize2[0][3]] *= 100000.0
else:
first_eos = current2state[top_of_beamsize2[0]][2].index(my_lang.word2index["EOS"])
gen_sentence = current2state[top_of_beamsize2[0]][2][:first_eos+1]
break
after_beam_dict = {}
for index, candidate in enumerate(top_of_beamsize2):
after_beam_dict[index] = current2state[candidate]
index2state = after_beam_dict
# Beam Search a good sentence and assign to gen_sentence
talking_history.append(gen_sentence)
gen_sentence = Variable(torch.LongTensor(gen_sentence))
gen_sentence = check_cuda_for_var(gen_sentence)
string = ' '.join([my_lang.index2word[word.data[0]] for word in gen_sentence])
print(string)
if "EOD" in string:
break
decoder_input = Variable(torch.LongTensor([[my_lang.word2index["SOS"]]]))
decoder_input = check_cuda_for_var(decoder_input)
encoder_hidden = encoder.init_hidden()
decoder_hidden = decoder.init_hidden()
for ei in range(len(gen_sentence)):
_, encoder_hidden = encoder(gen_sentence[ei], encoder_hidden)
context_output, context_hidden = context(encoder_hidden, context_hidden)
except KeyboardInterrupt:
print()
else:
# Load last Seq2seq model
number = torch.load(os.path.join(args.save, 'checkpoint.pt'))
encoder = torch.load(os.path.join(args.save, 'encoder'+str(number)+'.pt'))
decoder = torch.load(os.path.join(args.save, 'decoder'+str(number)+'.pt'))
if torch.cuda.is_available():
encoder = encoder.cuda()
decoder = decoder.cuda()
def gen(sentence):
max_length = 20
encoder.eval()
decoder.eval()
talking_history = []
gen_sentence = []
counter = 0
while counter < 10:
encoder_hidden = encoder.init_hidden()
encoder_outputs = Variable(torch.zeros(max_length, encoder.hidden_size))
decoder_input = Variable(torch.LongTensor([[my_lang.word2index["SOS"]]]))
encoder_outputs = check_cuda_for_var(encoder_outputs)
decoder_input = check_cuda_for_var(decoder_input)
if len(gen_sentence) > 0:
for ei in range(len(gen_sentence)):
encoder_output, encoder_hidden = encoder(gen_sentence[ei], encoder_hidden)
encoder_outputs[ei] = encoder_output[0][0]
# Clean generated sentence list
gen_sentence = []
else:
for ei in range(len(sentence)):
encoder_output, encoder_hidden = encoder(sentence[ei], encoder_hidden)
encoder_outputs[ei] = encoder_output[0][0]
decoder_hidden = encoder_hidden
while True:
if DEBUG:
print("[Debug] ", decoder_input.data)
gen_sentence.append(decoder_input.data[0][0])
if gen_sentence[-1] == my_lang.word2index["EOS"] or len(gen_sentence) >= max_length - 1:
break
decoder_output, decoder_hidden, decoder_attention = decoder(decoder_input, decoder_hidden, \
encoder_outputs)
_, topi = decoder_output.data.topk(1)
ni = topi[0][0]
decoder_input = Variable(torch.LongTensor([[ni]]))
decoder_input = check_cuda_for_var(decoder_input)
gen_sentence = Variable(torch.LongTensor(gen_sentence))
gen_sentence = check_cuda_for_var(gen_sentence)
string = ' '.join([my_lang.index2word[word.data[0]] for word in gen_sentence])
print(string)
talking_history.append(string)
if "EOD" in string or args.sbs:
break
counter += 1
return talking_history
# Generating string
try:
if args.sbs == 0 or args.type == 'seq2seq':
while True:
start = input("[%s] >>> " % (args.type.upper()))
clean_sentence = clean(start)
clean_sentence_idx = my_lang.sentence2index(clean_sentence)
clean_sentence_idx = Variable(torch.LongTensor(clean_sentence_idx))
clean_sentence_idx = check_cuda_for_var(clean_sentence_idx)
gen(clean_sentence_idx)
else:
genSbyS()
except KeyboardInterrupt:
print()
| 48.414493
| 110
| 0.565108
| 1,861
| 16,703
| 4.853842
| 0.117141
| 0.046275
| 0.021255
| 0.026569
| 0.74571
| 0.718255
| 0.702646
| 0.689915
| 0.654046
| 0.648068
| 0
| 0.022274
| 0.336107
| 16,703
| 344
| 111
| 48.555233
| 0.792317
| 0.046339
| 0
| 0.706667
| 0
| 0
| 0.047931
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.01
| false
| 0
| 0.06
| 0
| 0.076667
| 0.026667
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
45bcd814349ab20a5e5a56fdb877d35f210e45a3
| 143
|
py
|
Python
|
python/twisted/webservers/webecho.py
|
drichardson/examples
|
89cd96741f6110729138f5c904317dd1a42f63ff
|
[
"Unlicense"
] | 33
|
2015-04-21T20:10:42.000Z
|
2021-09-28T05:54:37.000Z
|
python/twisted/webservers/webecho.py
|
drichardson/examples
|
d8b285db4ad1cfd9a92091deab2eb385748f97c8
|
[
"Unlicense"
] | 1
|
2020-03-15T18:54:19.000Z
|
2020-03-15T18:54:19.000Z
|
python/twisted/webservers/webecho.py
|
drichardson/examples
|
89cd96741f6110729138f5c904317dd1a42f63ff
|
[
"Unlicense"
] | 19
|
2015-01-09T13:39:06.000Z
|
2021-09-15T05:39:33.000Z
|
from twisted.protocols import basic
from twisted.internet import protocol, reactor
class HttpEchoProtocol(basic.LineReceiver):
def __init__
| 23.833333
| 46
| 0.839161
| 17
| 143
| 6.823529
| 0.764706
| 0.189655
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111888
| 143
| 6
| 47
| 23.833333
| 0.913386
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.5
| null | null | 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
45e35e23f938edff8f5d7293af864aaef9b819ec
| 428
|
py
|
Python
|
TAKfreeServer/Controllers/ManageRacacatPinController.py
|
tma5/FreeTakServer
|
794eee7cc0086d5d54193b2033fab2396b90b0e2
|
[
"MIT"
] | null | null | null |
TAKfreeServer/Controllers/ManageRacacatPinController.py
|
tma5/FreeTakServer
|
794eee7cc0086d5d54193b2033fab2396b90b0e2
|
[
"MIT"
] | null | null | null |
TAKfreeServer/Controllers/ManageRacacatPinController.py
|
tma5/FreeTakServer
|
794eee7cc0086d5d54193b2033fab2396b90b0e2
|
[
"MIT"
] | null | null | null |
#######################################################
#
# ManageRacacatPinController.py
# Python implementation of the Class ManageRacacatPinController
# Generated by Enterprise Architect
# Created on: 15-Apr-2020 4:57:23 PM
# Original author: Giu Platania
#
#######################################################
class ManageRacacatPinController:
# default constructor def __init__(self):
pass
| 28.533333
| 64
| 0.542056
| 33
| 428
| 6.909091
| 0.909091
| 0.27193
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.030471
| 0.156542
| 428
| 15
| 65
| 28.533333
| 0.601108
| 0.553738
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 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
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
afd8a613791837c973da5e45512841674956397b
| 74
|
py
|
Python
|
pyecog/visualisation/pyqtgraph_examples.py
|
mikailweston/pyecog
|
9a1674ec95b63ad9aa0a2d3aedc1a74be6441446
|
[
"MIT"
] | 10
|
2016-09-07T16:01:39.000Z
|
2019-03-26T11:14:28.000Z
|
pyecog/visualisation/pyqtgraph_examples.py
|
mikailweston/pyecog
|
9a1674ec95b63ad9aa0a2d3aedc1a74be6441446
|
[
"MIT"
] | 54
|
2016-11-21T14:41:52.000Z
|
2022-03-18T08:41:11.000Z
|
pyecog/visualisation/pyqtgraph_examples.py
|
jcornford/pyecog
|
356439bd5e3c50fd0cd74eef90a897bd41363920
|
[
"MIT"
] | 5
|
2016-10-11T14:14:44.000Z
|
2017-08-02T11:45:48.000Z
|
__author__ = 'Jonathan'
import pyqtgraph.examples
pyqtgraph.examples.run()
| 24.666667
| 25
| 0.824324
| 8
| 74
| 7.125
| 0.75
| 0.596491
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.067568
| 74
| 3
| 26
| 24.666667
| 0.826087
| 0
| 0
| 0
| 0
| 0
| 0.106667
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
afe45f3ec3e4de1290e8dc5832721a7016ffd7cd
| 185
|
py
|
Python
|
01_Language/01_Functions/python/lstat.py
|
cliff363825/TwentyFour
|
09df59bd5d275e66463e343647f46027397d1233
|
[
"MIT"
] | 3
|
2020-06-28T07:42:51.000Z
|
2021-01-15T10:32:11.000Z
|
01_Language/01_Functions/python/lstat.py
|
cliff363825/TwentyFour
|
09df59bd5d275e66463e343647f46027397d1233
|
[
"MIT"
] | 9
|
2021-03-10T22:45:40.000Z
|
2022-02-27T06:53:20.000Z
|
01_Language/01_Functions/python/lstat.py
|
cliff363825/TwentyFour
|
09df59bd5d275e66463e343647f46027397d1233
|
[
"MIT"
] | 1
|
2021-01-15T10:51:24.000Z
|
2021-01-15T10:51:24.000Z
|
# coding: utf-8
import os
def lstat(filename):
return os.lstat(filename)
if __name__ == '__main__':
import link
link.link('test.txt', 'test')
print(lstat('test'))
| 12.333333
| 33
| 0.627027
| 25
| 185
| 4.32
| 0.64
| 0.240741
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006897
| 0.216216
| 185
| 14
| 34
| 13.214286
| 0.737931
| 0.07027
| 0
| 0
| 0
| 0
| 0.141176
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.142857
| false
| 0
| 0.285714
| 0.142857
| 0.571429
| 0.142857
| 1
| 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
| 0
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
afe4ecb877a8926e390aef6b5c379edad929be8c
| 60
|
py
|
Python
|
codes/course8/b1.py
|
BigShuang/big-shuang-python-introductory-course
|
c4fd1343c4c539567180072c749b68bda7c28075
|
[
"MIT"
] | null | null | null |
codes/course8/b1.py
|
BigShuang/big-shuang-python-introductory-course
|
c4fd1343c4c539567180072c749b68bda7c28075
|
[
"MIT"
] | null | null | null |
codes/course8/b1.py
|
BigShuang/big-shuang-python-introductory-course
|
c4fd1343c4c539567180072c749b68bda7c28075
|
[
"MIT"
] | null | null | null |
def show_first(word):
print(word[0])
show_first("abc")
| 12
| 21
| 0.666667
| 10
| 60
| 3.8
| 0.7
| 0.473684
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.019608
| 0.15
| 60
| 4
| 22
| 15
| 0.72549
| 0
| 0
| 0
| 0
| 0
| 0.05
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.333333
| 0.333333
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
affbaa242a95486d930b01ca8530dd5379aefaf1
| 112
|
py
|
Python
|
tests/staticfiles_tests/urls/helper.py
|
Yoann-Vie/esgi-hearthstone
|
115d03426c7e8e80d89883b78ac72114c29bed12
|
[
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null |
tests/staticfiles_tests/urls/helper.py
|
Yoann-Vie/esgi-hearthstone
|
115d03426c7e8e80d89883b78ac72114c29bed12
|
[
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null |
tests/staticfiles_tests/urls/helper.py
|
Yoann-Vie/esgi-hearthstone
|
115d03426c7e8e80d89883b78ac72114c29bed12
|
[
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null |
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns = staticfiles_urlpatterns()
| 28
| 68
| 0.848214
| 11
| 112
| 8.454545
| 0.636364
| 0.473118
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.098214
| 112
| 3
| 69
| 37.333333
| 0.920792
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
affc461046eca19aed3bccc1303c15af9277b607
| 91
|
py
|
Python
|
exporter/licences/apps.py
|
django-doctor/lite-frontend
|
330ff9575fd22d7c4c42698ac2d653244e6180d6
|
[
"MIT"
] | 3
|
2019-05-31T06:36:17.000Z
|
2020-02-12T16:02:24.000Z
|
exporter/licences/apps.py
|
django-doctor/lite-frontend
|
330ff9575fd22d7c4c42698ac2d653244e6180d6
|
[
"MIT"
] | 45
|
2020-08-11T14:37:46.000Z
|
2022-03-29T17:03:02.000Z
|
exporter/licences/apps.py
|
django-doctor/lite-frontend
|
330ff9575fd22d7c4c42698ac2d653244e6180d6
|
[
"MIT"
] | 3
|
2021-02-01T06:26:19.000Z
|
2022-02-21T23:02:46.000Z
|
from django.apps import AppConfig
class LicencesConfig(AppConfig):
name = "licences"
| 15.166667
| 33
| 0.758242
| 10
| 91
| 6.9
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.164835
| 91
| 5
| 34
| 18.2
| 0.907895
| 0
| 0
| 0
| 0
| 0
| 0.087912
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
b3063521480cd9ee62ab2278f339090fde15af1c
| 194
|
py
|
Python
|
telegram_bot/telegram_commands/new_multiplayer.py
|
dmitrijun/wikihow_guessr_telegram
|
b039770f16afdb4aad7d5bc84c353be1f0e6547b
|
[
"MIT"
] | null | null | null |
telegram_bot/telegram_commands/new_multiplayer.py
|
dmitrijun/wikihow_guessr_telegram
|
b039770f16afdb4aad7d5bc84c353be1f0e6547b
|
[
"MIT"
] | null | null | null |
telegram_bot/telegram_commands/new_multiplayer.py
|
dmitrijun/wikihow_guessr_telegram
|
b039770f16afdb4aad7d5bc84c353be1f0e6547b
|
[
"MIT"
] | null | null | null |
def new_multiplayer(bot, message):
"""
/new_multiplayer command handler
"""
chat_id = message.chat.id
bot.send_message(chat_id=chat_id, text="Not implemented yet")
| 27.714286
| 65
| 0.654639
| 25
| 194
| 4.84
| 0.56
| 0.198347
| 0.214876
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.231959
| 194
| 7
| 65
| 27.714286
| 0.812081
| 0.164948
| 0
| 0
| 0
| 0
| 0.138686
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
b30795ca001c3a2ef4e886a0818a593b541913d4
| 362
|
py
|
Python
|
awareness_detector/test/testrunner.py
|
hofbi/driver-awareness
|
c16edc6b1ed26c252959ab85bbc33fe4f5598424
|
[
"MIT"
] | null | null | null |
awareness_detector/test/testrunner.py
|
hofbi/driver-awareness
|
c16edc6b1ed26c252959ab85bbc33fe4f5598424
|
[
"MIT"
] | null | null | null |
awareness_detector/test/testrunner.py
|
hofbi/driver-awareness
|
c16edc6b1ed26c252959ab85bbc33fe4f5598424
|
[
"MIT"
] | 1
|
2022-02-04T11:53:29.000Z
|
2022-02-04T11:53:29.000Z
|
"""Awareness Detector Test Runner"""
import rosunit
if __name__ == "__main__":
rosunit.unitrun(
"awareness_detector", "test_geometry", "test.test_geometry.GeometryTestSuite"
)
rosunit.unitrun("awareness_detector", "test_sa", "test.test_sa.SATestSuite")
rosunit.unitrun("awareness_detector", "test_view", "test.test_view.ViewTestSuite")
| 32.909091
| 86
| 0.732044
| 39
| 362
| 6.358974
| 0.410256
| 0.274194
| 0.33871
| 0.375
| 0.423387
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.129834
| 362
| 10
| 87
| 36.2
| 0.787302
| 0.082873
| 0
| 0
| 0
| 0
| 0.54908
| 0.269939
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.142857
| 0
| 0.142857
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
b34a5c0666ed2308230a4db560b7bf539fac5fac
| 126
|
py
|
Python
|
detection/models/bbox_heads/__init__.py
|
HirataYurina/cascade-rcnn-tf2.2
|
f756b811ab31c9dab2a8f8afe68f46465422f64b
|
[
"MIT"
] | 1
|
2021-08-12T06:51:29.000Z
|
2021-08-12T06:51:29.000Z
|
detection/models/necks/__init__.py
|
HirataYurina/cascade-rcnn-tf2.2
|
f756b811ab31c9dab2a8f8afe68f46465422f64b
|
[
"MIT"
] | 3
|
2021-04-05T08:04:39.000Z
|
2021-11-12T19:16:26.000Z
|
detection/models/detectors/__init__.py
|
HirataYurina/cascade-rcnn-tf2.2
|
f756b811ab31c9dab2a8f8afe68f46465422f64b
|
[
"MIT"
] | 1
|
2021-09-06T06:05:31.000Z
|
2021-09-06T06:05:31.000Z
|
# -*- coding:utf-8 -*-
# author:栗山未来ii
# e-mail:1353593259@qq.com
# datetime:1993/12/01
# filename:aaa.py
# software: PyCharm
| 18
| 26
| 0.68254
| 19
| 126
| 4.526316
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.171171
| 0.119048
| 126
| 6
| 27
| 21
| 0.603604
| 0.896825
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
b35c7b0b6971ac88d14adf53ebe1e173083e1c1b
| 3,378
|
py
|
Python
|
app/tables.py
|
knmueller/golf-scoring
|
918af0d589ac9b7b5362c7d336dc8889f0f5369f
|
[
"MIT"
] | null | null | null |
app/tables.py
|
knmueller/golf-scoring
|
918af0d589ac9b7b5362c7d336dc8889f0f5369f
|
[
"MIT"
] | null | null | null |
app/tables.py
|
knmueller/golf-scoring
|
918af0d589ac9b7b5362c7d336dc8889f0f5369f
|
[
"MIT"
] | null | null | null |
from flask_table import Table, Col
# used for front, back, total
class PlayerScoreTable(Table):
classes = ['scoring_table', 'inline_table']
name = Col('Name', td_html_attrs={'class': 'table__cell'}, th_html_attrs={'class': 'table__cell'}) # player name
gross_score = Col('Gross Score', td_html_attrs={'class': 'table__cell'}, th_html_attrs={'class': 'table__cell'})
net_score = Col('Net Score', td_html_attrs={'class': 'table__cell'}, th_html_attrs={'class': 'table__cell'})
def get_thead_attrs(self):
return {'class': 'table__header'}
def get_tr_attrs(self, item):
return {'class': 'table__row'}
class NetScore(object):
def __init__(self, name, net_score):
self.name = name
self.net_score = net_score
class PlayerScore(NetScore):
def __init__(self, name, gross_score, net_score):
NetScore.__init__(self, name, net_score)
self.gross_score = gross_score
class TeamNetTable(Table):
classes = ['scoring_table']
name = Col('Name', td_html_attrs={'class': 'table__cell'}, th_html_attrs={'class': 'table__cell'}) # team name
player_one_net = Col('Player 1 Net', td_html_attrs={'class': 'table__cell'}, th_html_attrs={'class': 'table__cell'})
player_two_net = Col('Player 2 Net', td_html_attrs={'class': 'table__cell'}, th_html_attrs={'class': 'table__cell'})
net_score = Col('Net Score', td_html_attrs={'class': 'table__cell'}, th_html_attrs={'class': 'table__cell'})
def get_thead_attrs(self):
return {'class': 'table__header'}
def get_tr_attrs(self, item):
return {'class': 'table__row'}
class TeamNetScore(NetScore):
def __init__(self, name, player_one_net, player_two_net):
p1_net = player_one_net # if player_one_net is not None else 0
p2_net = player_two_net # if player_two_net is not None else 0
net_score = (p1_net if p1_net else 0) + (p2_net if p2_net else 0)
if p1_net is None and p2_net is None:
net_score = None
NetScore.__init__(self, name, net_score)
self.player_one_net = p1_net
self.player_two_net = p2_net
def __repr__(self):
return '<TeamTeamNetScore {} ; {} ; {} ; {}>'.format(self.name, self.player_one_net, self.player_two_net, self.net_score)
class TeamBestGrossTable(Table):
classes = ['scoring_table']
name = Col('Foursome', td_html_attrs={'class': 'table__cell'}, th_html_attrs={'class': 'table__cell'})
# dynamic columns
# holes 1 through 18 - (score1, score2, score3) sum
# score = Col('Score', td_html_attrs={'class': 'table__cell'}, th_html_attrs={'class': 'table__cell'})
def get_thead_attrs(self):
return {'class': 'table__header'}
def get_tr_attrs(self, item):
return {'class': 'table__row'}
class TeamBestGrossScore(object):
def __init__(self, name):
self.name = name
class ChampMatchTable(Table):
classes = ['scoring_table']
name = Col('Player', td_html_attrs={'class': 'table__cell'}, th_html_attrs={'class': 'table__cell'})
# dynamic columns
# holes 1 through 18 - (score1, score2, score3) sum
def get_thead_attrs(self):
return {'class': 'table__header'}
def get_tr_attrs(self, item):
return {'class': 'table__row'}
class ChampMatchScore(object):
def __init__(self, name):
self.name = name
| 35.93617
| 129
| 0.664298
| 467
| 3,378
| 4.379015
| 0.152034
| 0.136919
| 0.136919
| 0.185819
| 0.688509
| 0.643032
| 0.575061
| 0.543765
| 0.511491
| 0.511491
| 0
| 0.010302
| 0.195382
| 3,378
| 93
| 130
| 36.322581
| 0.74209
| 0.105388
| 0
| 0.5
| 0
| 0
| 0.197609
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.233333
| false
| 0
| 0.016667
| 0.15
| 0.766667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
b35e1d223b2984b70d9b5b506c46ef3279313d6c
| 658
|
py
|
Python
|
python/lru_cache.py
|
robotlightsyou/test
|
015f13943fc402d8ce86c5f6d2f5a7d032b3340a
|
[
"MIT"
] | 2
|
2019-05-26T15:09:34.000Z
|
2021-09-12T08:01:23.000Z
|
python/lru_cache.py
|
robotlightsyou/test
|
015f13943fc402d8ce86c5f6d2f5a7d032b3340a
|
[
"MIT"
] | null | null | null |
python/lru_cache.py
|
robotlightsyou/test
|
015f13943fc402d8ce86c5f6d2f5a7d032b3340a
|
[
"MIT"
] | 1
|
2021-04-11T20:28:21.000Z
|
2021-04-11T20:28:21.000Z
|
import functools
if False:
@functools.lru_cache()
def foo():
print('here!')
return 1
print(foo())
print(foo())
@functools.lru_cache()
def bar(test=None):
print('bar!', test)
return (2, test)
print(bar())
print(bar(1))
print(bar())
print(bar(1))
@functools.lru_cache()
class Baz:
def __init__(self, a=None):
print('baz', a)
@property
@functools.lru_cache()
def foo(self):
print('foo!')
return 1
# print(Baz())
# print(Baz(1))
# print(Baz())
# print(Baz(1))
baz = Baz()
print(baz.foo)
print(baz.foo)
print(Baz(1).foo)
print(Baz(1).foo)
| 14
| 31
| 0.545593
| 90
| 658
| 3.9
| 0.244444
| 0.205128
| 0.193732
| 0.17094
| 0.458689
| 0.099715
| 0
| 0
| 0
| 0
| 0
| 0.01875
| 0.270517
| 658
| 46
| 32
| 14.304348
| 0.7125
| 0.080547
| 0
| 0.533333
| 0
| 0
| 0.026667
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.133333
| false
| 0
| 0.033333
| 0
| 0.3
| 0.466667
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
6412b871ee292e5c7effe0f7cc823b3428b982f0
| 138
|
py
|
Python
|
class_import.py
|
shreya-n-kumari/python
|
2462cf01891770b078815f9925f37842aaec7b91
|
[
"MIT"
] | null | null | null |
class_import.py
|
shreya-n-kumari/python
|
2462cf01891770b078815f9925f37842aaec7b91
|
[
"MIT"
] | null | null | null |
class_import.py
|
shreya-n-kumari/python
|
2462cf01891770b078815f9925f37842aaec7b91
|
[
"MIT"
] | null | null | null |
from class_car import ElectricCar
Tesla = ElectricCar('tesla','model s',2016)
print(Tesla.get_name())
print(Tesla.describe_battery())
| 27.6
| 44
| 0.76087
| 19
| 138
| 5.368421
| 0.736842
| 0.313725
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.032258
| 0.101449
| 138
| 5
| 45
| 27.6
| 0.790323
| 0
| 0
| 0
| 0
| 0
| 0.088889
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.25
| 0
| 0.25
| 0.5
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
642226b977cfb58d17f615a36c7716e2a62fef7a
| 194
|
py
|
Python
|
global.py
|
joshavenue/python_notebook
|
8d46ba88ef4f05dea6801364bc134edb981df02e
|
[
"Unlicense"
] | null | null | null |
global.py
|
joshavenue/python_notebook
|
8d46ba88ef4f05dea6801364bc134edb981df02e
|
[
"Unlicense"
] | null | null | null |
global.py
|
joshavenue/python_notebook
|
8d46ba88ef4f05dea6801364bc134edb981df02e
|
[
"Unlicense"
] | null | null | null |
count = 0 # A global count variable
def remember():
global count
count += 1 # Count this invocation
print(str(count))
remember()
remember()
remember()
remember()
remember()
| 13.857143
| 40
| 0.649485
| 23
| 194
| 5.478261
| 0.521739
| 0.507937
| 0.571429
| 0.507937
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.013514
| 0.237113
| 194
| 13
| 41
| 14.923077
| 0.837838
| 0.231959
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.1
| false
| 0
| 0
| 0
| 0.1
| 0.1
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
6430efc0ee5b20cdc1053234ee3892e51ba21c13
| 1,085
|
py
|
Python
|
test/test_phones.py
|
Ksusha2626/Python_test
|
c4381067bbb9c23472540092532c00a62b2b727a
|
[
"Apache-2.0"
] | null | null | null |
test/test_phones.py
|
Ksusha2626/Python_test
|
c4381067bbb9c23472540092532c00a62b2b727a
|
[
"Apache-2.0"
] | null | null | null |
test/test_phones.py
|
Ksusha2626/Python_test
|
c4381067bbb9c23472540092532c00a62b2b727a
|
[
"Apache-2.0"
] | null | null | null |
import re
def test_phones_on_home_page(app):
contact_from_home_page = app.contact.get_contact_list()[0]
contact_from_edit_page = app.contact.get_contact_info_from_edit_page(0)
assert contact_from_home_page.all_phones_from_home_page == merge_phones_on_home_page(contact_from_edit_page)
def test_phones_on_contact_view_page(app):
contact_from_view_page = app.contact.get_contact_from_view_page(0)
contact_from_edit_page = app.contact.get_contact_info_from_edit_page(0)
assert contact_from_view_page.home_tel == contact_from_edit_page.home_tel
assert contact_from_view_page.mobile_tel == contact_from_edit_page.mobile_tel
assert contact_from_view_page.work_tel == contact_from_edit_page.work_tel
def clear(s):
return re.sub("[() -]", "", s)
def merge_phones_on_home_page(contact):
return "\n".join(filter(lambda x: x != "",
map(lambda x: clear(x),
filter(lambda x: x is not None,
[contact.home_tel, contact.mobile_tel, contact.work_tel]))))
| 40.185185
| 112
| 0.719816
| 165
| 1,085
| 4.236364
| 0.218182
| 0.204578
| 0.137339
| 0.16309
| 0.546495
| 0.37196
| 0.211731
| 0.211731
| 0.211731
| 0.211731
| 0
| 0.004561
| 0.191705
| 1,085
| 26
| 113
| 41.730769
| 0.792474
| 0
| 0
| 0.111111
| 0
| 0
| 0.007373
| 0
| 0
| 0
| 0
| 0
| 0.222222
| 1
| 0.222222
| false
| 0
| 0.055556
| 0.111111
| 0.388889
| 0
| 0
| 0
| 0
| null | 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 4
|
643a6847786b774658b31938f6750313888df672
| 138
|
py
|
Python
|
tests/test_resizers.py
|
ESA-PhiLab/eo4dl
|
1d82ca5835053aa6839164d563ffb1e56fba300c
|
[
"MIT"
] | 22
|
2019-10-21T07:25:45.000Z
|
2022-03-20T10:35:17.000Z
|
tests/test_resizers.py
|
ESA-PhiLab/eo4dl
|
1d82ca5835053aa6839164d563ffb1e56fba300c
|
[
"MIT"
] | 5
|
2019-10-28T13:30:12.000Z
|
2021-05-18T12:14:38.000Z
|
tests/test_resizers.py
|
ESA-PhiLab/eo4dl
|
1d82ca5835053aa6839164d563ffb1e56fba300c
|
[
"MIT"
] | 3
|
2019-10-22T09:09:08.000Z
|
2020-02-12T05:27:05.000Z
|
# import numpy as np
# import pytest
#
# from eo4ai.utils import resizers
#
#
# def test_BandsMaskResizer(all_dummy_datasets):
# pass
| 15.333333
| 48
| 0.731884
| 18
| 138
| 5.444444
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.00885
| 0.181159
| 138
| 8
| 49
| 17.25
| 0.858407
| 0.876812
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
ff430c0e7b2de4b6addedddc46852d2b10405d0a
| 51
|
py
|
Python
|
tests/components/garages_amsterdam/__init__.py
|
MrDelik/core
|
93a66cc357b226389967668441000498a10453bb
|
[
"Apache-2.0"
] | 30,023
|
2016-04-13T10:17:53.000Z
|
2020-03-02T12:56:31.000Z
|
tests/components/garages_amsterdam/__init__.py
|
MrDelik/core
|
93a66cc357b226389967668441000498a10453bb
|
[
"Apache-2.0"
] | 31,101
|
2020-03-02T13:00:16.000Z
|
2022-03-31T23:57:36.000Z
|
tests/components/garages_amsterdam/__init__.py
|
Vaarlion/core
|
f3de8b9f28de01abf72c0f5bb0b457eb1841f201
|
[
"Apache-2.0"
] | 11,956
|
2016-04-13T18:42:31.000Z
|
2020-03-02T09:32:12.000Z
|
"""Tests for the Garages Amsterdam integration."""
| 25.5
| 50
| 0.745098
| 6
| 51
| 6.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.117647
| 51
| 1
| 51
| 51
| 0.844444
| 0.862745
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
ff45614c8047c94e1aa076f07f77b599227475ea
| 243
|
py
|
Python
|
language_demos/input_output.py
|
t4d-classes/python_03222021_morning
|
9759293a2c3291baa4c50ec6b982e23532fc0e57
|
[
"MIT"
] | null | null | null |
language_demos/input_output.py
|
t4d-classes/python_03222021_morning
|
9759293a2c3291baa4c50ec6b982e23532fc0e57
|
[
"MIT"
] | null | null | null |
language_demos/input_output.py
|
t4d-classes/python_03222021_morning
|
9759293a2c3291baa4c50ec6b982e23532fc0e57
|
[
"MIT"
] | null | null | null |
first_name = input("Please enter your first name: ")
print(f"Your first name is: {first_name}")
print("a regular string: " + first_name)
print('a regular string' + first_name)
# string literal with the r prefix
print(r'a regular string')
| 20.25
| 52
| 0.720165
| 39
| 243
| 4.384615
| 0.435897
| 0.315789
| 0.245614
| 0.175439
| 0.380117
| 0.380117
| 0.380117
| 0.380117
| 0
| 0
| 0
| 0
| 0.160494
| 243
| 11
| 53
| 22.090909
| 0.838235
| 0.131687
| 0
| 0
| 0
| 0
| 0.541063
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.8
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
ff4a2658c7d97b2030dc3a1e1999d34a9efab45e
| 63
|
py
|
Python
|
python/coffer/coins/impl/_slip173.py
|
Steve132/wallet_standard
|
09c909b24dc17cf6a0a433644d8f1912e886ab1c
|
[
"MIT"
] | null | null | null |
python/coffer/coins/impl/_slip173.py
|
Steve132/wallet_standard
|
09c909b24dc17cf6a0a433644d8f1912e886ab1c
|
[
"MIT"
] | null | null | null |
python/coffer/coins/impl/_slip173.py
|
Steve132/wallet_standard
|
09c909b24dc17cf6a0a433644d8f1912e886ab1c
|
[
"MIT"
] | null | null | null |
#https://github.com/satoshilabs/slips/blob/master/slip-0173.md
| 31.5
| 62
| 0.793651
| 10
| 63
| 5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.064516
| 0.015873
| 63
| 1
| 63
| 63
| 0.741935
| 0.968254
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
44386021172ccef0643a821d69e16e2d04943f9f
| 4,478
|
py
|
Python
|
experiments/skeleton_omission.py
|
Yomguithereal/fog
|
0b2defd7c413b55766c4368e17e1238dfc3c8b81
|
[
"MIT"
] | 17
|
2018-04-26T15:37:45.000Z
|
2021-05-18T05:58:10.000Z
|
experiments/skeleton_omission.py
|
Yomguithereal/fog
|
0b2defd7c413b55766c4368e17e1238dfc3c8b81
|
[
"MIT"
] | 29
|
2018-04-27T14:54:20.000Z
|
2021-05-27T15:30:14.000Z
|
experiments/skeleton_omission.py
|
Yomguithereal/fog
|
0b2defd7c413b55766c4368e17e1238dfc3c8b81
|
[
"MIT"
] | 1
|
2019-11-27T18:14:49.000Z
|
2019-11-27T18:14:49.000Z
|
# Little experiments testing the recall of the skeleton and omission keys
#
# Note that counting the number of clusters may be erroneous but with
# a low Levenshtein distance, clusters are rarely very large and this is
# good enough.
#
import csv
from Levenshtein import distance as levenshtein
from fog.clustering import pairwise_connected_components, sorted_neighborhood
from fog.key import skeleton_key, omission_key
GROUND_TRUTH_LEV1 = 138
GROUND_TRUTH_LEV2 = 627
with open('./data/musicians.csv', 'r') as f:
reader = csv.DictReader(f)
artists = sorted(set(line['artist'] for line in reader))
print('Artists: %i' % len(artists))
# true_clusters = list(pairwise_connected_components(artists, distance=levenshtein, radius=2, processes=8))
# print(len(true_clusters))
print('GroundTruth-Lev1: %i' % GROUND_TRUTH_LEV1)
print('GroundTruth-Lev2: %i' % GROUND_TRUTH_LEV2)
skeleton_clusters = list(sorted_neighborhood(artists, distance=levenshtein, radius=1, key=skeleton_key))
print('Skeleton-Lev1: Found %i clusters (Recall: %f)' % (len(skeleton_clusters), len(skeleton_clusters) / GROUND_TRUTH_LEV1))
skeleton_clusters = list(sorted_neighborhood(artists, distance=levenshtein, radius=2, key=skeleton_key))
print('Skeleton-Lev2: Found %i clusters (Recall: %f)' % (len(skeleton_clusters), len(skeleton_clusters) / GROUND_TRUTH_LEV2))
omission_clusters = list(sorted_neighborhood(artists, distance=levenshtein, radius=1, key=omission_key))
print('Omission-Lev1: Found %i clusters (Recall: %f)' % (len(omission_clusters), len(omission_clusters) / GROUND_TRUTH_LEV1))
omission_clusters = list(sorted_neighborhood(artists, distance=levenshtein, radius=2, key=omission_key))
print('Omission-Lev2: Found %i clusters (Recall: %f)' % (len(omission_clusters), len(omission_clusters) / GROUND_TRUTH_LEV2))
compound_clusters = list(sorted_neighborhood(artists, distance=levenshtein, radius=1, keys=(omission_key, skeleton_key)))
print('Compound-Lev1: Found %i clusters (Recall: %f)' % (len(compound_clusters), len(compound_clusters) / GROUND_TRUTH_LEV1))
compound_clusters = list(sorted_neighborhood(artists, distance=levenshtein, radius=2, keys=(omission_key, skeleton_key)))
print('Compound-Lev2: Found %i clusters (Recall: %f)' % (len(compound_clusters), len(compound_clusters) / GROUND_TRUTH_LEV2))
lexicographic_clusters = list(sorted_neighborhood(artists, distance=levenshtein, radius=1, key=None))
print('Lexicographic-Lev1: Found %i clusters (Recall: %f)' % (len(lexicographic_clusters), len(lexicographic_clusters) / GROUND_TRUTH_LEV1))
lexicographic_clusters = list(sorted_neighborhood(artists, distance=levenshtein, radius=2, key=None))
print('Lexicographic-Lev2: Found %i clusters (Recall: %f)' % (len(lexicographic_clusters), len(lexicographic_clusters) / GROUND_TRUTH_LEV2))
reverse_lexicographic_clusters = list(sorted_neighborhood(artists, distance=levenshtein, radius=1, key=lambda x: x[::-1]))
print('ReverseLexicographic-Lev1: Found %i clusters (Recall: %f)' % (len(reverse_lexicographic_clusters), len(reverse_lexicographic_clusters) / GROUND_TRUTH_LEV1))
reverse_lexicographic_clusters = list(sorted_neighborhood(artists, distance=levenshtein, radius=2, key=lambda x: x[::-1]))
print('ReverseLexicographic-Lev2: Found %i clusters (Recall: %f)' % (len(reverse_lexicographic_clusters), len(reverse_lexicographic_clusters) / GROUND_TRUTH_LEV2))
compound_lexicographic_clusters = list(sorted_neighborhood(artists, distance=levenshtein, radius=1, keys=(None, lambda x: x[::-1])))
print('CompoundLexicographic-Lev1: Found %i clusters (Recall: %f)' % (len(compound_lexicographic_clusters), len(compound_lexicographic_clusters) / GROUND_TRUTH_LEV1))
compound_lexicographic_clusters = list(sorted_neighborhood(artists, distance=levenshtein, radius=2, keys=(None, lambda x: x[::-1])))
print('CompoundLexicographic-Lev2: Found %i clusters (Recall: %f)' % (len(compound_lexicographic_clusters), len(compound_lexicographic_clusters) / GROUND_TRUTH_LEV2))
mega_clusters = list(sorted_neighborhood(artists, distance=levenshtein, radius=1, keys=(None, lambda x: x[::-1])))
print('Mega-Lev1: Found %i clusters (Recall: %f)' % (len(mega_clusters), len(mega_clusters) / GROUND_TRUTH_LEV1))
mega_clusters = list(sorted_neighborhood(artists, distance=levenshtein, radius=2, keys=(None, lambda x: x[::-1], omission_key, skeleton_key)))
print('Mega-Lev2: Found %i clusters (Recall: %f)' % (len(mega_clusters), len(mega_clusters) / GROUND_TRUTH_LEV2))
| 53.309524
| 166
| 0.782269
| 581
| 4,478
| 5.817556
| 0.144578
| 0.05858
| 0.115385
| 0.142012
| 0.789645
| 0.734024
| 0.734024
| 0.681361
| 0.662722
| 0.646154
| 0
| 0.015218
| 0.090219
| 4,478
| 83
| 167
| 53.951807
| 0.814433
| 0.079276
| 0
| 0
| 0
| 0
| 0.184735
| 0.025766
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.1
| 0
| 0.1
| 0.425
| 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
| 1
|
0
| 4
|
445a6a47e9d6ce719070329cce543cbcf26685ef
| 115
|
py
|
Python
|
tests/utils.py
|
natachabertin/nbcv-api
|
54a476334f167ca6896ae6ee025d3d3c5da31485
|
[
"MIT"
] | 1
|
2021-03-12T21:58:12.000Z
|
2021-03-12T21:58:12.000Z
|
tests/utils.py
|
natachabertin/nbcv-api
|
54a476334f167ca6896ae6ee025d3d3c5da31485
|
[
"MIT"
] | null | null | null |
tests/utils.py
|
natachabertin/nbcv-api
|
54a476334f167ca6896ae6ee025d3d3c5da31485
|
[
"MIT"
] | null | null | null |
def get_the_first_id(entity, client):
response = client.get(f"/{entity}/")
return response.json()[0]['id']
| 28.75
| 40
| 0.66087
| 17
| 115
| 4.294118
| 0.705882
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.010101
| 0.13913
| 115
| 3
| 41
| 38.333333
| 0.727273
| 0
| 0
| 0
| 0
| 0
| 0.104348
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
447c2260d2f14a7f4dc1432a5325e7f2eaddbbcf
| 86
|
py
|
Python
|
dutool/__init__.py
|
revang/dutool
|
a206bad28920069e9049635e030f8479899c677c
|
[
"MIT"
] | null | null | null |
dutool/__init__.py
|
revang/dutool
|
a206bad28920069e9049635e030f8479899c677c
|
[
"MIT"
] | null | null | null |
dutool/__init__.py
|
revang/dutool
|
a206bad28920069e9049635e030f8479899c677c
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from .models import *
from .db import *
| 14.333333
| 22
| 0.616279
| 13
| 86
| 4.076923
| 0.846154
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.014085
| 0.174419
| 86
| 5
| 23
| 17.2
| 0.732394
| 0.476744
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
44938982d57f29c46d56536b5d981cedaa51dbf5
| 7,973
|
py
|
Python
|
s3/replication/manager/tests/system/test_subscribers_resource.py
|
rajkumarpatel2602/cortx-multisite
|
7557b27f72e4a3b5de98fa123ef46ef18a76aa85
|
[
"Apache-2.0"
] | 1
|
2022-01-13T12:26:30.000Z
|
2022-01-13T12:26:30.000Z
|
s3/replication/manager/tests/system/test_subscribers_resource.py
|
rajkumarpatel2602/cortx-multisite
|
7557b27f72e4a3b5de98fa123ef46ef18a76aa85
|
[
"Apache-2.0"
] | null | null | null |
s3/replication/manager/tests/system/test_subscribers_resource.py
|
rajkumarpatel2602/cortx-multisite
|
7557b27f72e4a3b5de98fa123ef46ef18a76aa85
|
[
"Apache-2.0"
] | null | null | null |
#!/usr/bin/env python3
#
# Copyright (c) 2021 Seagate Technology LLC and/or its Affiliates
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# For any questions about this software or licensing,
# please email opensource@seagate.com or cortx-questions@seagate.com.
#
import aiohttp
import pytest
from fixtures.subscribe import subscriber_record # noqa: F401;
# Global subscriber id to perform validations across test cases.
global_valid_subscriber_id = ""
@pytest.mark.asyncio
@pytest.mark.parametrize(
"test_case_name, expected_http_status",
[('valid_payload', 201),
('empty_payload', 500)])
async def test_post_subscriber(logger, test_config,
subscriber_record, # noqa: F811;
test_case_name, expected_http_status):
"""Post subscriber tests."""
test_data = {'valid_payload': subscriber_record, 'empty_payload': {}}
test_payload = test_data[test_case_name]
async with aiohttp.ClientSession() as session:
# Add subscriber
async with session.post(test_config['url'] + '/subscribers',
json=test_payload) as response:
logger.debug('HTTP Response: Status: {}'.format(response.status))
if test_case_name == 'valid_payload':
response_body = await response.json()
logger.debug('HTTP Response: Body: {}'.format(response_body))
global global_valid_subscriber_id
global_valid_subscriber_id = response_body["id"]
assert expected_http_status == response.status, \
"ERROR : Received http status : " + str(response.status) + \
"Expected http status :" + str(expected_http_status)
logger.info(
'POST successful: http status: {}'.format(response.status))
@pytest.mark.asyncio
@pytest.mark.parametrize(
"test_case_name, expected_http_status",
[('valid_subscriber', 200),
('missing_subscriber', 404)])
async def test_get_subscriber(logger, test_config,
subscriber_record, # noqa: F811;
test_case_name, expected_http_status):
"""GET specific subscriber tests."""
if test_case_name == "valid_subscriber":
global global_valid_subscriber_id
subscriber_id = global_valid_subscriber_id
elif test_case_name == "missing_subscriber":
subscriber_id = "invalid-subscriber-id"
else:
assert False, "Invalid test case."
async with aiohttp.ClientSession() as session:
# Add subscriber and attributes
async with session.get(test_config['url'] + '/subscribers/' +
subscriber_id) as response:
logger.debug('HTTP Response: Status: {}'.format(response.status))
if test_case_name == 'valid_subscriber':
response_body = await response.json()
logger.debug('HTTP Response Body: {}'.format(response_body))
assert expected_http_status == response.status, \
"ERROR : Received http status : " + str(response.status) + \
"Expected http status :" + str(expected_http_status)
logger.info(
'GET subscriber successful: http status: {}'.format(
response.status))
@pytest.mark.asyncio
async def test_get_subscribers(logger, test_config):
"""GET subscribers list, expected entries added in post."""
expected_http_status = 200
expected_count = 1
global global_valid_subscriber_id
subscriber_id = global_valid_subscriber_id
async with aiohttp.ClientSession() as session:
# Get subscribers list.
async with session.get(
test_config['url'] + '/subscribers') as response:
logger.debug('HTTP Response: Status: {}'.format(response.status))
subscribers_list = await response.json()
logger.debug('HTTP Response Body: {}'.format(subscribers_list))
assert expected_http_status == response.status, \
"ERROR : Received http status : " + str(response.status) + \
"Expected http status :" + str(expected_http_status)
assert len(subscribers_list) == expected_count, \
"ERROR : Invalid expected subscribers count." + \
"Received {} subscribers.\nExpected {} subscribers".format(
len(subscribers_list), expected_count)
# Access the first subscriber.
subscriber = next(iter(subscribers_list.items()))[1]
assert subscriber_id == subscriber["id"], \
"ERROR : Expected subscriber is missing." + \
"subscriber_id = {}".format(
subscriber_id
)
logger.info(
'GET subscribers successful: http status: {}'.format(
response.status))
@pytest.mark.asyncio
@pytest.mark.parametrize(
"test_case_name, expected_http_status",
[('valid_subscriber', 204),
('missing_subscriber', 404)])
async def test_delete_subscriber(logger, test_config,
subscriber_record, # noqa: F811;
test_case_name, expected_http_status):
"""DELETE specific subscriber tests."""
if test_case_name == "valid_subscriber":
global global_valid_subscriber_id
subscriber_id = global_valid_subscriber_id
elif test_case_name == "missing_subscriber":
subscriber_id = "invalid-subscriber-id"
else:
assert False, "Invalid test case."
async with aiohttp.ClientSession() as session:
# Add subscriber and attributes
async with session.delete(test_config['url'] + '/subscribers/' +
subscriber_id) as response:
logger.debug('HTTP Response: Status: {}'.format(response.status))
assert expected_http_status == response.status, \
"ERROR : Received http status : " + str(response.status) + \
"Expected http status :" + str(expected_http_status)
logger.info(
'DELETE subscriber successful: http status: {}'.format(
response.status))
@pytest.mark.asyncio
async def test_get_subscribers_empty(logger, test_config):
"""GET subscribers list, expected empty after delete."""
expected_http_status = 200
expected_count = 0
async with aiohttp.ClientSession() as session:
# Get subscribers list.
async with session.get(
test_config['url'] + '/subscribers') as response:
logger.debug('HTTP Response: Status: {}'.format(response.status))
subscribers_list = await response.json()
logger.debug('HTTP Response Body: {}'.format(subscribers_list))
assert expected_http_status == response.status, \
"ERROR : Received http status : " + str(response.status) + \
"Expected http status :" + str(expected_http_status)
assert len(subscribers_list) == expected_count, \
"ERROR : Invalid expected subscribers count." + \
"Received {} subscribers.\nExpected {} subscribers".format(
len(subscribers_list), expected_count)
logger.info(
'GET subscribers successful: http status: {}'.format(
response.status))
| 39.865
| 77
| 0.625862
| 844
| 7,973
| 5.719194
| 0.187204
| 0.068365
| 0.085768
| 0.053864
| 0.752641
| 0.74912
| 0.712451
| 0.695049
| 0.683862
| 0.683862
| 0
| 0.008328
| 0.27706
| 7,973
| 199
| 78
| 40.065327
| 0.829112
| 0.123542
| 0
| 0.728682
| 0
| 0
| 0.20905
| 0.01276
| 0
| 0
| 0
| 0
| 0.077519
| 1
| 0
| false
| 0
| 0.023256
| 0
| 0.023256
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
925348e0943141cd8864bde91a13f0a3729370f9
| 132
|
py
|
Python
|
Python3.x/Python3.x-1-high/102_socket.py
|
mrxuyong/Python-dev
|
8ae4c668a458819a60e39f3e231159afcceb97ee
|
[
"MIT"
] | null | null | null |
Python3.x/Python3.x-1-high/102_socket.py
|
mrxuyong/Python-dev
|
8ae4c668a458819a60e39f3e231159afcceb97ee
|
[
"MIT"
] | null | null | null |
Python3.x/Python3.x-1-high/102_socket.py
|
mrxuyong/Python-dev
|
8ae4c668a458819a60e39f3e231159afcceb97ee
|
[
"MIT"
] | null | null | null |
# -*- coding: UTF-8 -*-
# @author: xuyong
# @file: 102_socket.py
# @time: 2017/2/27 下午3:00
# @desc:
import socket
import sys
| 8.8
| 25
| 0.598485
| 20
| 132
| 3.9
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.134615
| 0.212121
| 132
| 14
| 26
| 9.428571
| 0.615385
| 0.674242
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
9256e80f9b90908960d838ec55638d2369e6919c
| 187
|
py
|
Python
|
images/events/thumbs/imagelist.py
|
rcastro2/CPWDCTE
|
91790bc4e1011158ec55c1c9cc60d652618c52f5
|
[
"MIT"
] | null | null | null |
images/events/thumbs/imagelist.py
|
rcastro2/CPWDCTE
|
91790bc4e1011158ec55c1c9cc60d652618c52f5
|
[
"MIT"
] | null | null | null |
images/events/thumbs/imagelist.py
|
rcastro2/CPWDCTE
|
91790bc4e1011158ec55c1c9cc60d652618c52f5
|
[
"MIT"
] | null | null | null |
import os
open("images.js", 'w').write("var thumbs = [" + ',\n'.join(["'images/events/thumbs/%s'"%file for file in os.listdir(os.getcwd()) if file.lower().endswith(".jpg") ]) + "]")
| 46.75
| 171
| 0.593583
| 28
| 187
| 3.964286
| 0.785714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.122995
| 187
| 3
| 172
| 62.333333
| 0.676829
| 0
| 0
| 0
| 0
| 0
| 0.304813
| 0.13369
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
926d877bab92ea07718322e911663df00e1fd712
| 25
|
py
|
Python
|
sphinx_astropy/__init__.py
|
wtbarnes/sphinx-astropy
|
85e3f541b6331403c84421abf1c920a9869cacb6
|
[
"BSD-3-Clause"
] | null | null | null |
sphinx_astropy/__init__.py
|
wtbarnes/sphinx-astropy
|
85e3f541b6331403c84421abf1c920a9869cacb6
|
[
"BSD-3-Clause"
] | null | null | null |
sphinx_astropy/__init__.py
|
wtbarnes/sphinx-astropy
|
85e3f541b6331403c84421abf1c920a9869cacb6
|
[
"BSD-3-Clause"
] | null | null | null |
__version__ = '1.4.dev0'
| 12.5
| 24
| 0.68
| 4
| 25
| 3.25
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.136364
| 0.12
| 25
| 1
| 25
| 25
| 0.454545
| 0
| 0
| 0
| 0
| 0
| 0.32
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
927752876b3b5a52a54af328e8089604271da99b
| 110
|
py
|
Python
|
rdmo/system_integration/apps.py
|
hkrock/rdmo
|
80bbd3b5749f48a918e9aa4549a96479bf665b93
|
[
"Apache-2.0"
] | null | null | null |
rdmo/system_integration/apps.py
|
hkrock/rdmo
|
80bbd3b5749f48a918e9aa4549a96479bf665b93
|
[
"Apache-2.0"
] | null | null | null |
rdmo/system_integration/apps.py
|
hkrock/rdmo
|
80bbd3b5749f48a918e9aa4549a96479bf665b93
|
[
"Apache-2.0"
] | null | null | null |
from django.apps import AppConfig
class SystemIntegrationConfig(AppConfig):
name = 'system_integration'
| 18.333333
| 41
| 0.8
| 11
| 110
| 7.909091
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.136364
| 110
| 5
| 42
| 22
| 0.915789
| 0
| 0
| 0
| 0
| 0
| 0.163636
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
92ba3e6332068aef35d6f0ece18ee03d900b32a3
| 211
|
py
|
Python
|
20-internationalization-i18n/instance/settings.py
|
quietcoolwu/docker_flask_app
|
4a020fa6683ca156b8ff350cf0991db516984ac5
|
[
"MIT"
] | null | null | null |
20-internationalization-i18n/instance/settings.py
|
quietcoolwu/docker_flask_app
|
4a020fa6683ca156b8ff350cf0991db516984ac5
|
[
"MIT"
] | null | null | null |
20-internationalization-i18n/instance/settings.py
|
quietcoolwu/docker_flask_app
|
4a020fa6683ca156b8ff350cf0991db516984ac5
|
[
"MIT"
] | null | null | null |
MAIL_USERNAME = 'buildasaasappwithflask@gmail.com'
MAIL_PASSWORD = 'helicopterpantswalrusfoot'
STRIPE_SECRET_KEY = 'sk_test_nycOOQdO9C16zxubr2WWtbug'
STRIPE_PUBLISHABLE_KEY = 'pk_test_ClU5mzNj1YxRRnrdZB5jEO29'
| 35.166667
| 59
| 0.872038
| 20
| 211
| 8.7
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.045455
| 0.061611
| 211
| 5
| 60
| 42.2
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0.57346
| 0.57346
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.25
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
2b8d4517f66a5e3b82803b5014e9dbacf0917639
| 1,285
|
py
|
Python
|
docs/examples/query_params.py
|
jsandovalc/treq
|
72b7b5e67b4517dba6fad138e03a072656c4521a
|
[
"MIT"
] | 4
|
2016-12-17T09:40:59.000Z
|
2020-05-19T19:49:42.000Z
|
docs/examples/query_params.py
|
jsandovalc/treq
|
72b7b5e67b4517dba6fad138e03a072656c4521a
|
[
"MIT"
] | null | null | null |
docs/examples/query_params.py
|
jsandovalc/treq
|
72b7b5e67b4517dba6fad138e03a072656c4521a
|
[
"MIT"
] | 1
|
2020-11-05T15:58:42.000Z
|
2020-11-05T15:58:42.000Z
|
import asyncio
import json
from _utils import print_response
import aiorequests
@asyncio.coroutine
def main():
print('List of tuples')
resp = yield from aiorequests.get('http://httpbin.org/get',
params=[('foo', 'bar'), ('baz', 'bax')])
content = yield from resp.text()
print(content)
print('Single value dictionary')
resp = yield from aiorequests.get('http://httpbin.org/get',
params={'foo': 'bar', 'baz': 'bax'})
content = yield from resp.text()
print(content)
print('Multi value dictionary')
resp = yield from aiorequests.get('http://httpbin.org/get',
params={'foo': ['bar', 'baz', 'bax']})
content = yield from resp.text()
print(content)
print('Mixed value dictionary')
resp = yield from aiorequests.get('http://httpbin.org/get',
params={'foo': ['bar', 'baz'], 'bax': 'quux'})
content = yield from resp.text()
print(content)
print('Preserved query parameters')
resp = yield from aiorequests.get('http://httpbin.org/get?foo=bar',
params={'baz': 'bax'})
content = yield from resp.text()
print(content)
asyncio.get_event_loop().run_until_complete(main())
| 31.341463
| 78
| 0.585214
| 149
| 1,285
| 5.006711
| 0.275168
| 0.120643
| 0.087131
| 0.160858
| 0.727882
| 0.727882
| 0.727882
| 0.727882
| 0.672922
| 0.557641
| 0
| 0
| 0.259144
| 1,285
| 40
| 79
| 32.125
| 0.783613
| 0
| 0
| 0.4375
| 0
| 0
| 0.220233
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.03125
| false
| 0
| 0.125
| 0
| 0.15625
| 0.34375
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
2b90e916b673ff1e46ec5570b5660d43a64bca95
| 819
|
py
|
Python
|
hpwnwaf.py
|
wjbsyc/homura_pwn_waf
|
1148016804e219836dceb93a380fd5da6be569fa
|
[
"MIT"
] | 69
|
2018-07-12T13:10:21.000Z
|
2022-02-22T01:53:26.000Z
|
hpwnwaf.py
|
wjbsyc/homura_pwn_waf
|
1148016804e219836dceb93a380fd5da6be569fa
|
[
"MIT"
] | null | null | null |
hpwnwaf.py
|
wjbsyc/homura_pwn_waf
|
1148016804e219836dceb93a380fd5da6be569fa
|
[
"MIT"
] | 17
|
2018-08-19T05:32:40.000Z
|
2021-09-29T07:23:22.000Z
|
#coding:utf-8
def replace_waf(pt):
main_addr = 0x4011e6 #main函数入口地址
new_main = pt.inject(asm=r'''
push rbp;
mov rbp,rsp;
mov r15,6;
push r15;
mov r15,7FFF000000000006H;
push r15;
mov r15,3B00010015H;
push r15;
mov r15 , 3800020015h;
push r15;
mov r15 , 3200030015h;
push r15;
mov r15 , 3100040015h;
push r15;
mov r15 , 2A00050015h;
push r15;
mov r15 , 2900060015h;
push r15;
mov r15 , 4000000000070035h;
push r15;
mov r15 , 20h;
push r15;
mov r15 , 0C000003E09000015h;
push r15;
mov r15 , 400000020h;
push r15;
mov r15,rsp;
push r15;
mov r15 , 0ch;
push r15;
mov r15,rsp;
push r15;
mov rdi,38;
mov rsi,1;
mov rdx,0;
mov rcx,0;
mov r8,0;
mov rax,157;
syscall;
mov rdi,22;
mov rsi,2;
mov rdx,r15;
mov rax,157;
syscall;
leave;
ret;
''')
pt.hook(main_addr, new_main)
| 14.625
| 33
| 0.667888
| 137
| 819
| 3.956204
| 0.357664
| 0.177122
| 0.276753
| 0.335793
| 0.095941
| 0.095941
| 0.095941
| 0.095941
| 0
| 0
| 0
| 0.311526
| 0.216117
| 819
| 55
| 34
| 14.890909
| 0.53271
| 0.026862
| 0
| 0.411765
| 0
| 0
| 0.861111
| 0.027778
| 0
| 0
| 0.010101
| 0
| 0
| 1
| 0.019608
| false
| 0
| 0
| 0
| 0.019608
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
2bbe2f90f9445d3366cabcd606c3d1f0ac93592e
| 99
|
py
|
Python
|
britecoreapi/apps.py
|
emmanuel-nike/django-generic-datamodel
|
f8d19ba55f2af2c238f7e8f493bd0e2c28a91d7c
|
[
"Unlicense"
] | null | null | null |
britecoreapi/apps.py
|
emmanuel-nike/django-generic-datamodel
|
f8d19ba55f2af2c238f7e8f493bd0e2c28a91d7c
|
[
"Unlicense"
] | 6
|
2021-05-08T17:05:14.000Z
|
2022-02-26T10:36:59.000Z
|
britecoreapi/apps.py
|
emmanuel-nike/django-generic-datamodel
|
f8d19ba55f2af2c238f7e8f493bd0e2c28a91d7c
|
[
"Unlicense"
] | 1
|
2022-02-13T17:22:39.000Z
|
2022-02-13T17:22:39.000Z
|
from django.apps import AppConfig
class BritecoreapiConfig(AppConfig):
name = 'britecoreapi'
| 16.5
| 36
| 0.777778
| 10
| 99
| 7.7
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.151515
| 99
| 5
| 37
| 19.8
| 0.916667
| 0
| 0
| 0
| 0
| 0
| 0.121212
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
2bcc3ce08bb3d95791beaf47a75a219f58ebeed0
| 47,344
|
py
|
Python
|
cellpack/mgl_tools/DejaVu/VisionInterface/MapPotOnGeom.py
|
mesoscope/cellpack
|
ec6b736fc706c1fae16392befa814b5337a3a692
|
[
"MIT"
] | null | null | null |
cellpack/mgl_tools/DejaVu/VisionInterface/MapPotOnGeom.py
|
mesoscope/cellpack
|
ec6b736fc706c1fae16392befa814b5337a3a692
|
[
"MIT"
] | 21
|
2021-10-02T00:07:05.000Z
|
2022-03-30T00:02:10.000Z
|
cellpack/mgl_tools/DejaVu/VisionInterface/MapPotOnGeom.py
|
mesoscope/cellpack
|
ec6b736fc706c1fae16392befa814b5337a3a692
|
[
"MIT"
] | null | null | null |
########################################################################
#
# Vision Macro - Python source code - file generated by vision
# Monday 06 March 2006 12:05:47
#
# The Scripps Research Institute (TSRI)
# Molecular Graphics Lab
# La Jolla, CA 92037, USA
#
# Copyright: Daniel Stoffler, Michel Sanner and TSRI
#
# revision: Guillaume Vareille
#
#########################################################################
#
# $Header$
#
# $Id$
#
from NetworkEditor.macros import MacroNode
class MapPotOnGeom(MacroNode):
def __init__(self, constrkw={}, name="Map Pot On Geom", **kw):
kw["name"] = name
apply(MacroNode.__init__, (self,), kw)
def beforeAddingToNetwork(self, net):
MacroNode.beforeAddingToNetwork(self, net)
## loading libraries ##
from Volume.VisionInterface.VolumeNodes import vollib
net.editor.addLibraryInstance(
vollib, "Volume.VisionInterface.VolumeNodes", "vollib"
)
from Vision.StandardNodes import stdlib
net.editor.addLibraryInstance(stdlib, "Vision.StandardNodes", "stdlib")
from DejaVu.VisionInterface.DejaVuNodes import vizlib
net.editor.addLibraryInstance(
vizlib, "DejaVu.VisionInterface.DejaVuNodes", "vizlib"
)
def afterAddingToNetwork(self):
from NetworkEditor.macros import MacroNode
MacroNode.afterAddingToNetwork(self)
## loading libraries ##
from Volume.VisionInterface.VolumeNodes import vollib
from Vision.StandardNodes import stdlib
from DejaVu.VisionInterface.DejaVuNodes import vizlib
## building macro network ##
Map_Pot_On_Geom_0 = self
from traceback import print_exc
## loading libraries ##
from Volume.VisionInterface.VolumeNodes import vollib
self.macroNetwork.getEditor().addLibraryInstance(
vollib, "Volume.VisionInterface.VolumeNodes", "vollib"
)
from Vision.StandardNodes import stdlib
self.macroNetwork.getEditor().addLibraryInstance(
stdlib, "Vision.StandardNodes", "stdlib"
)
from DejaVu.VisionInterface.DejaVuNodes import vizlib
self.macroNetwork.getEditor().addLibraryInstance(
vizlib, "DejaVu.VisionInterface.DejaVuNodes", "vizlib"
)
try:
## saving node input Ports ##
input_Ports_1 = self.macroNetwork.ipNode
except:
print "WARNING: failed to restore MacroInputNode named input Ports in network self.macroNetwork"
print_exc()
input_Ports_1 = None
try:
## saving node output Ports ##
output_Ports_2 = self.macroNetwork.opNode
output_Ports_2.move(230, 578)
except:
print "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
print_exc()
output_Ports_2 = None
try:
## saving node getSurfaceVFN ##
from DejaVu.VisionInterface.DejaVuNodes import getSurfaceVFN
getSurfaceVFN_3 = getSurfaceVFN(
constrkw={}, name="getSurfaceVFN", library=vizlib
)
self.macroNetwork.addNode(getSurfaceVFN_3, 55, 83)
apply(
getSurfaceVFN_3.inputPortByName["geometry"].configure,
(),
{"color": "red", "cast": True, "shape": "rect"},
)
apply(
getSurfaceVFN_3.outputPortByName["geom"].configure,
(),
{"color": "red", "shape": "rect"},
)
apply(
getSurfaceVFN_3.outputPortByName["vertices"].configure,
(),
{"color": "green", "shape": "rect"},
)
apply(
getSurfaceVFN_3.outputPortByName["faces"].configure,
(),
{"color": "purple", "shape": "rect"},
)
apply(
getSurfaceVFN_3.outputPortByName["normals"].configure,
(),
{"color": "blue", "shape": "rect"},
)
except:
print "WARNING: failed to restore getSurfaceVFN named getSurfaceVFN in network self.macroNetwork"
print_exc()
getSurfaceVFN_3 = None
try:
## saving node mul ##
from Vision.StandardNodes import Operator2
mul_4 = Operator2(constrkw={}, name="mul", library=stdlib)
self.macroNetwork.addNode(mul_4, 309, 139)
apply(
mul_4.inputPortByName["data1"].configure,
(),
{
"datatype": "normals3D",
"cast": True,
"shape": "rect",
"color": "blue",
},
)
apply(
mul_4.inputPortByName["data2"].configure,
(),
{
"datatype": "float",
"cast": True,
"shape": "circle",
"color": "green",
},
)
apply(
mul_4.inputPortByName["operation"].configure,
(),
{"color": "white", "cast": True, "shape": "diamond"},
)
apply(
mul_4.inputPortByName["applyToElements"].configure,
(),
{"color": "yellow", "cast": True, "shape": "circle"},
)
apply(
mul_4.outputPortByName["result"].configure,
(),
{"color": "white", "shape": "diamond"},
)
mul_4.inputPortByName["operation"].widget.set("mul", run=False)
mul_4.inputPortByName["applyToElements"].widget.set(1, run=False)
apply(mul_4.configure, (), {"expanded": False})
except:
print "WARNING: failed to restore Operator2 named mul in network self.macroNetwork"
print_exc()
mul_4 = None
try:
## saving node Offset ##
from Vision.StandardNodes import DialNE
Offset_5 = DialNE(constrkw={}, name="Offset", library=stdlib)
self.macroNetwork.addNode(Offset_5, 390, 20)
apply(
Offset_5.inputPortByName["dial"].configure,
(),
{"color": "green", "cast": True, "shape": "circle"},
)
apply(
Offset_5.inputPortByName["mini"].configure,
(),
{"color": "green", "cast": True, "shape": "circle"},
)
apply(
Offset_5.inputPortByName["maxi"].configure,
(),
{"color": "green", "cast": True, "shape": "circle"},
)
apply(
Offset_5.outputPortByName["value"].configure,
(),
{"color": "green", "shape": "circle"},
)
Offset_5.inputPortByName["dial"].widget.set(1.01, run=False)
except:
print "WARNING: failed to restore DialNE named Offset in network self.macroNetwork"
print_exc()
Offset_5 = None
try:
## saving node add ##
from Vision.StandardNodes import Operator2
add_6 = Operator2(constrkw={}, name="add", library=stdlib)
self.macroNetwork.addNode(add_6, 253, 183)
apply(
add_6.inputPortByName["data1"].configure,
(),
{
"datatype": "coordinates3D",
"cast": True,
"shape": "rect",
"color": "green",
},
)
apply(
add_6.inputPortByName["data2"].configure,
(),
{"color": "white", "cast": True, "shape": "diamond"},
)
apply(
add_6.inputPortByName["operation"].configure,
(),
{"color": "white", "cast": True, "shape": "diamond"},
)
apply(
add_6.inputPortByName["applyToElements"].configure,
(),
{"color": "yellow", "cast": True, "shape": "circle"},
)
apply(
add_6.outputPortByName["result"].configure,
(),
{"color": "white", "shape": "diamond"},
)
add_6.inputPortByName["operation"].widget.set("add", run=False)
add_6.inputPortByName["applyToElements"].widget.set(1, run=False)
apply(add_6.configure, (), {"expanded": False})
except:
print "WARNING: failed to restore Operator2 named add in network self.macroNetwork"
print_exc()
add_6 = None
try:
## saving node triInterp ##
from Volume.VisionInterface.VolumeNodes import TriInterp
triInterp_7 = TriInterp(constrkw={}, name="triInterp", library=vollib)
self.macroNetwork.addNode(triInterp_7, 189, 270)
apply(
triInterp_7.inputPortByName["grid"].configure,
(),
{"color": "#995699", "cast": True, "shape": "diamond"},
)
apply(
triInterp_7.inputPortByName["points"].configure,
(),
{"datatype": "list", "cast": True, "shape": "oval", "color": "cyan"},
)
apply(
triInterp_7.outputPortByName["data"].configure,
(),
{"color": "cyan", "shape": "oval"},
)
except:
print "WARNING: failed to restore TriInterp named triInterp in network self.macroNetwork"
print_exc()
triInterp_7 = None
try:
## saving node Color Map ##
from DejaVu.VisionInterface.DejaVuNodes import ColorMapNE
Color_Map_9 = ColorMapNE(constrkw={}, name="Color Map", library=vizlib)
self.macroNetwork.addNode(Color_Map_9, 213, 433)
apply(
Color_Map_9.inputPortByName["colorMap"].configure,
(),
{"color": "magenta", "cast": True, "shape": "rect"},
)
apply(
Color_Map_9.inputPortByName["values"].configure,
(),
{"color": "cyan", "cast": True, "shape": "oval"},
)
apply(
Color_Map_9.inputPortByName["mini"].configure,
(),
{"color": "green", "cast": True, "shape": "circle"},
)
apply(
Color_Map_9.inputPortByName["maxi"].configure,
(),
{"color": "green", "cast": True, "shape": "circle"},
)
apply(
Color_Map_9.inputPortByName["filename"].configure,
(),
{"color": "white", "cast": True, "shape": "oval"},
)
apply(
Color_Map_9.outputPortByName["mappedColors"].configure,
(),
{"color": "orange", "shape": "rect"},
)
apply(
Color_Map_9.outputPortByName["colorMap"].configure,
(),
{"color": "magenta", "shape": "rect"},
)
apply(
Color_Map_9.outputPortByName["legend"].configure,
(),
{"color": "red", "shape": "rect"},
)
Color_Map_9.inputPortByName["colorMap"].widget.set(
{
"mini": None,
"maxi": None,
"ramp": [
[1.0, 0.0, 0.0, 1.0],
[1.0, 0.0060000000000000053, 0.0060000000000000053, 1.0],
[1.0, 0.01100000000000001, 0.01100000000000001, 1.0],
[1.0, 0.02300000000000002, 0.02300000000000002, 1.0],
[1.0, 0.029000000000000026, 0.029000000000000026, 1.0],
[1.0, 0.03400000000000003, 0.03400000000000003, 1.0],
[1.0, 0.046000000000000041, 0.046000000000000041, 1.0],
[1.0, 0.051000000000000045, 0.051000000000000045, 1.0],
[1.0, 0.057000000000000051, 0.057000000000000051, 1.0],
[1.0, 0.06899999999999995, 0.06899999999999995, 1.0],
[1.0, 0.073999999999999955, 0.073999999999999955, 1.0],
[1.0, 0.085999999999999965, 0.085999999999999965, 1.0],
[1.0, 0.09099999999999997, 0.09099999999999997, 1.0],
[1.0, 0.096999999999999975, 0.096999999999999975, 1.0],
[1.0, 0.10899999999999999, 0.10899999999999999, 1.0],
[1.0, 0.11399999999999999, 0.11399999999999999, 1.0],
[1.0, 0.12, 0.12, 1.0],
[1.0, 0.13100000000000001, 0.13100000000000001, 1.0],
[1.0, 0.13700000000000001, 0.13700000000000001, 1.0],
[1.0, 0.14300000000000002, 0.14300000000000002, 1.0],
[1.0, 0.15400000000000003, 0.15400000000000003, 1.0],
[1.0, 0.16000000000000003, 0.16000000000000003, 1.0],
[1.0, 0.17100000000000004, 0.17100000000000004, 1.0],
[1.0, 0.17700000000000005, 0.17700000000000005, 1.0],
[1.0, 0.18300000000000005, 0.18300000000000005, 1.0],
[1.0, 0.19399999999999995, 0.19399999999999995, 1.0],
[1.0, 0.19999999999999996, 0.19999999999999996, 1.0],
[1.0, 0.20599999999999996, 0.20599999999999996, 1.0],
[1.0, 0.21699999999999997, 0.21699999999999997, 1.0],
[1.0, 0.22299999999999998, 0.22299999999999998, 1.0],
[1.0, 0.23399999999999999, 0.23399999999999999, 1.0],
[1.0, 0.23999999999999999, 0.23999999999999999, 1.0],
[1.0, 0.246, 0.246, 1.0],
[1.0, 0.25700000000000001, 0.25700000000000001, 1.0],
[1.0, 0.26300000000000001, 0.26300000000000001, 1.0],
[1.0, 0.26900000000000002, 0.26900000000000002, 1.0],
[1.0, 0.28000000000000003, 0.28000000000000003, 1.0],
[1.0, 0.28600000000000003, 0.28600000000000003, 1.0],
[1.0, 0.29100000000000004, 0.29100000000000004, 1.0],
[1.0, 0.30300000000000005, 0.30300000000000005, 1.0],
[1.0, 0.30900000000000005, 0.30900000000000005, 1.0],
[1.0, 0.31999999999999995, 0.31999999999999995, 1.0],
[1.0, 0.32599999999999996, 0.32599999999999996, 1.0],
[1.0, 0.33099999999999996, 0.33099999999999996, 1.0],
[1.0, 0.34299999999999997, 0.34299999999999997, 1.0],
[1.0, 0.34899999999999998, 0.34899999999999998, 1.0],
[1.0, 0.35399999999999998, 0.35399999999999998, 1.0],
[1.0, 0.36599999999999999, 0.36599999999999999, 1.0],
[1.0, 0.371, 0.371, 1.0],
[1.0, 0.377, 0.377, 1.0],
[1.0, 0.38900000000000001, 0.38900000000000001, 1.0],
[1.0, 0.39400000000000002, 0.39400000000000002, 1.0],
[1.0, 0.40600000000000003, 0.40600000000000003, 1.0],
[1.0, 0.41100000000000003, 0.41100000000000003, 1.0],
[1.0, 0.41700000000000004, 0.41700000000000004, 1.0],
[1.0, 0.42900000000000005, 0.42900000000000005, 1.0],
[1.0, 0.43400000000000005, 0.43400000000000005, 1.0],
[1.0, 0.43999999999999995, 0.43999999999999995, 1.0],
[1.0, 0.45099999999999996, 0.45099999999999996, 1.0],
[1.0, 0.45699999999999996, 0.45699999999999996, 1.0],
[1.0, 0.46899999999999997, 0.46899999999999997, 1.0],
[1.0, 0.47399999999999998, 0.47399999999999998, 1.0],
[1.0, 0.47999999999999998, 0.47999999999999998, 1.0],
[1.0, 0.49099999999999999, 0.49099999999999999, 1.0],
[1.0, 0.497, 0.497, 1.0],
[1.0, 0.503, 0.503, 1.0],
[1.0, 0.51400000000000001, 0.51400000000000001, 1.0],
[1.0, 0.52000000000000002, 0.52000000000000002, 1.0],
[1.0, 0.52600000000000002, 0.52600000000000002, 1.0],
[1.0, 0.53699999999999992, 0.53699999999999992, 1.0],
[1.0, 0.54299999999999993, 0.54299999999999993, 1.0],
[1.0, 0.55400000000000005, 0.55400000000000005, 1.0],
[1.0, 0.56000000000000005, 0.56000000000000005, 1.0],
[1.0, 0.56600000000000006, 0.56600000000000006, 1.0],
[1.0, 0.57699999999999996, 0.57699999999999996, 1.0],
[1.0, 0.58299999999999996, 0.58299999999999996, 1.0],
[1.0, 0.58899999999999997, 0.58899999999999997, 1.0],
[1.0, 0.59999999999999998, 0.59999999999999998, 1.0],
[1.0, 0.60599999999999998, 0.60599999999999998, 1.0],
[1.0, 0.61699999999999999, 0.61699999999999999, 1.0],
[1.0, 0.623, 0.623, 1.0],
[1.0, 0.629, 0.629, 1.0],
[1.0, 0.64000000000000001, 0.64000000000000001, 1.0],
[1.0, 0.64600000000000002, 0.64600000000000002, 1.0],
[1.0, 0.65100000000000002, 0.65100000000000002, 1.0],
[1.0, 0.66300000000000003, 0.66300000000000003, 1.0],
[1.0, 0.66900000000000004, 0.66900000000000004, 1.0],
[1.0, 0.67399999999999993, 0.67399999999999993, 1.0],
[1.0, 0.68599999999999994, 0.68599999999999994, 1.0],
[1.0, 0.69100000000000006, 0.69100000000000006, 1.0],
[1.0, 0.70300000000000007, 0.70300000000000007, 1.0],
[1.0, 0.70900000000000007, 0.70900000000000007, 1.0],
[1.0, 0.71399999999999997, 0.71399999999999997, 1.0],
[1.0, 0.72599999999999998, 0.72599999999999998, 1.0],
[1.0, 0.73099999999999998, 0.73099999999999998, 1.0],
[1.0, 0.73699999999999999, 0.73699999999999999, 1.0],
[1.0, 0.749, 0.749, 1.0],
[1.0, 0.754, 0.754, 1.0],
[1.0, 0.76000000000000001, 0.76000000000000001, 1.0],
[1.0, 0.77100000000000002, 0.77100000000000002, 1.0],
[1.0, 0.77700000000000002, 0.77700000000000002, 1.0],
[1.0, 0.78900000000000003, 0.78900000000000003, 1.0],
[1.0, 0.79400000000000004, 0.79400000000000004, 1.0],
[1.0, 0.80000000000000004, 0.80000000000000004, 1.0],
[1.0, 0.81099999999999994, 0.81099999999999994, 1.0],
[1.0, 0.81699999999999995, 0.81699999999999995, 1.0],
[1.0, 0.82299999999999995, 0.82299999999999995, 1.0],
[1.0, 0.83399999999999996, 0.83399999999999996, 1.0],
[1.0, 0.83999999999999997, 0.83999999999999997, 1.0],
[1.0, 0.85099999999999998, 0.85099999999999998, 1.0],
[1.0, 0.85699999999999998, 0.85699999999999998, 1.0],
[1.0, 0.86299999999999999, 0.86299999999999999, 1.0],
[1.0, 0.874, 0.874, 1.0],
[1.0, 0.88, 0.88, 1.0],
[1.0, 0.88600000000000001, 0.88600000000000001, 1.0],
[1.0, 0.89700000000000002, 0.89700000000000002, 1.0],
[1.0, 0.90300000000000002, 0.90300000000000002, 1.0],
[1.0, 0.90900000000000003, 0.90900000000000003, 1.0],
[1.0, 0.92000000000000004, 0.92000000000000004, 1.0],
[1.0, 0.92600000000000005, 0.92600000000000005, 1.0],
[1.0, 0.93700000000000006, 0.93700000000000006, 1.0],
[1.0, 0.94299999999999995, 0.94299999999999995, 1.0],
[1.0, 0.94899999999999995, 0.94899999999999995, 1.0],
[1.0, 0.95999999999999996, 0.95999999999999996, 1.0],
[1.0, 0.96599999999999997, 0.96599999999999997, 1.0],
[1.0, 0.97099999999999997, 0.97099999999999997, 1.0],
[1.0, 0.98299999999999998, 0.98299999999999998, 1.0],
[1.0, 0.98899999999999999, 0.98899999999999999, 1.0],
[1.0, 1.0, 1.0, 1.0],
[1.0, 1.0, 1.0, 1.0],
[0.98902199999999996, 0.98899999999999999, 1.0, 1.0],
[1.0, 1.0, 1.0, 1.0],
[0.97105799999999998, 0.97099999999999997, 1.0, 1.0],
[0.96606800000000004, 0.96599999999999997, 1.0, 1.0],
[0.95409199999999994, 0.95399999999999996, 1.0, 1.0],
[0.949102, 0.94899999999999995, 1.0, 1.0],
[0.93712600000000013, 0.93700000000000006, 1.0, 1.0],
[0.93113800000000013, 0.93100000000000005, 1.0, 1.0],
[0.92614800000000008, 0.92600000000000005, 1.0, 1.0],
[0.9141720000000001, 0.91400000000000003, 1.0, 1.0],
[0.90918200000000005, 0.90900000000000003, 1.0, 1.0],
[0.90319400000000005, 0.90300000000000002, 1.0, 1.0],
[0.89121800000000007, 0.89100000000000001, 1.0, 1.0],
[0.88622800000000013, 0.88600000000000001, 1.0, 1.0],
[0.87425200000000003, 0.874, 1.0, 1.0],
[0.86926200000000009, 0.86899999999999999, 1.0, 1.0],
[0.8632740000000001, 0.86299999999999999, 1.0, 1.0],
[0.85129800000000011, 0.85099999999999998, 1.0, 1.0],
[0.84630800000000006, 0.84599999999999997, 1.0, 1.0],
[0.84032000000000007, 0.83999999999999997, 1.0, 1.0],
[0.82934200000000002, 0.82899999999999996, 1.0, 1.0],
[0.82335400000000014, 0.82299999999999995, 1.0, 1.0],
[0.81137800000000004, 0.81099999999999994, 1.0, 1.0],
[0.80638800000000022, 0.80600000000000005, 1.0, 1.0],
[0.80040000000000022, 0.80000000000000004, 1.0, 1.0],
[0.78942200000000018, 0.78900000000000003, 1.0, 1.0],
[0.78343400000000019, 0.78300000000000003, 1.0, 1.0],
[0.77744600000000019, 0.77700000000000002, 1.0, 1.0],
[0.76646800000000015, 0.76600000000000001, 1.0, 1.0],
[0.76048000000000016, 0.76000000000000001, 1.0, 1.0],
[0.74950200000000011, 0.749, 1.0, 1.0],
[0.74351400000000023, 0.74299999999999999, 1.0, 1.0],
[0.73752600000000013, 0.73699999999999999, 1.0, 1.0],
[0.72654800000000019, 0.72599999999999998, 1.0, 1.0],
[0.72056000000000009, 0.71999999999999997, 1.0, 1.0],
[0.71457200000000021, 0.71399999999999997, 1.0, 1.0],
[0.70359400000000027, 0.70300000000000007, 1.0, 1.0],
[0.69760600000000028, 0.69700000000000006, 1.0, 1.0],
[0.68662800000000013, 0.68599999999999994, 1.0, 1.0],
[0.68064000000000013, 0.67999999999999994, 1.0, 1.0],
[0.67465200000000014, 0.67399999999999993, 1.0, 1.0],
[0.66367400000000032, 0.66300000000000003, 1.0, 1.0],
[0.65768600000000021, 0.65700000000000003, 1.0, 1.0],
[0.64670800000000028, 0.64600000000000002, 1.0, 1.0],
[0.64072000000000018, 0.64000000000000001, 1.0, 1.0],
[0.6347320000000003, 0.63400000000000001, 1.0, 1.0],
[0.62375400000000025, 0.623, 1.0, 1.0],
[0.61776600000000026, 0.61699999999999999, 1.0, 1.0],
[0.61177800000000027, 0.61099999999999999, 1.0, 1.0],
[0.60080000000000022, 0.59999999999999998, 1.0, 1.0],
[0.59481200000000023, 0.59399999999999997, 1.0, 1.0],
[0.58383400000000019, 0.58299999999999996, 1.0, 1.0],
[0.5778460000000003, 0.57699999999999996, 1.0, 1.0],
[0.5718580000000002, 0.57099999999999995, 1.0, 1.0],
[0.56088000000000027, 0.56000000000000005, 1.0, 1.0],
[0.55489200000000038, 0.55400000000000005, 1.0, 1.0],
[0.54990200000000022, 0.54899999999999993, 1.0, 1.0],
[0.53792600000000024, 0.53699999999999992, 1.0, 1.0],
[0.53193800000000035, 0.53100000000000003, 1.0, 1.0],
[0.52096000000000031, 0.52000000000000002, 1.0, 1.0],
[0.51497200000000032, 0.51400000000000001, 1.0, 1.0],
[0.50998200000000038, 0.50900000000000001, 1.0, 1.0],
[0.49800600000000028, 0.497, 1.0, 1.0],
[0.49201800000000029, 0.49099999999999999, 1.0, 1.0],
[0.48702800000000035, 0.48599999999999999, 1.0, 1.0],
[0.47505200000000036, 0.47399999999999998, 1.0, 1.0],
[0.47006200000000031, 0.46899999999999997, 1.0, 1.0],
[0.45808600000000033, 0.45699999999999996, 1.0, 1.0],
[0.45209800000000033, 0.45099999999999996, 1.0, 1.0],
[0.44710800000000028, 0.44599999999999995, 1.0, 1.0],
[0.43513200000000041, 0.43400000000000005, 1.0, 1.0],
[0.43014200000000047, 0.42900000000000005, 1.0, 1.0],
[0.42415400000000048, 0.42300000000000004, 1.0, 1.0],
[0.41217800000000038, 0.41100000000000003, 1.0, 1.0],
[0.40718800000000044, 0.40600000000000003, 1.0, 1.0],
[0.39521200000000045, 0.39400000000000002, 1.0, 1.0],
[0.3902220000000004, 0.38900000000000001, 1.0, 1.0],
[0.38423400000000041, 0.38300000000000001, 1.0, 1.0],
[0.37225800000000042, 0.371, 1.0, 1.0],
[0.36726800000000037, 0.36599999999999999, 1.0, 1.0],
[0.36128000000000038, 0.35999999999999999, 1.0, 1.0],
[0.35030200000000045, 0.34899999999999998, 1.0, 1.0],
[0.34431400000000045, 0.34299999999999997, 1.0, 1.0],
[0.33233800000000036, 0.33099999999999996, 1.0, 1.0],
[0.32734800000000042, 0.32599999999999996, 1.0, 1.0],
[0.32136000000000042, 0.31999999999999995, 1.0, 1.0],
[0.31038200000000049, 0.30900000000000005, 1.0, 1.0],
[0.3043940000000005, 0.30300000000000005, 1.0, 1.0],
[0.29241800000000051, 0.29100000000000004, 1.0, 1.0],
[0.28742800000000046, 0.28600000000000003, 1.0, 1.0],
[0.28144000000000047, 0.28000000000000003, 1.0, 1.0],
[0.27046200000000054, 0.26900000000000002, 1.0, 1.0],
[0.26447400000000054, 0.26300000000000001, 1.0, 1.0],
[0.25848600000000055, 0.25700000000000001, 1.0, 1.0],
[0.24750800000000051, 0.246, 1.0, 1.0],
[0.24152000000000051, 0.23999999999999999, 1.0, 1.0],
[0.23054200000000047, 0.22899999999999998, 1.0, 1.0],
[0.22455400000000048, 0.22299999999999998, 1.0, 1.0],
[0.21856600000000048, 0.21699999999999997, 1.0, 1.0],
[0.20758800000000044, 0.20599999999999996, 1.0, 1.0],
[0.20160000000000045, 0.19999999999999996, 1.0, 1.0],
[0.19561200000000045, 0.19399999999999995, 1.0, 1.0],
[0.18463400000000063, 0.18300000000000005, 1.0, 1.0],
[0.17864600000000064, 0.17700000000000005, 1.0, 1.0],
[0.16766800000000059, 0.16600000000000004, 1.0, 1.0],
[0.1616800000000006, 0.16000000000000003, 1.0, 1.0],
[0.15569200000000061, 0.15400000000000003, 1.0, 1.0],
[0.14471400000000056, 0.14300000000000002, 1.0, 1.0],
[0.13872600000000057, 0.13700000000000001, 1.0, 1.0],
[0.13273800000000058, 0.13100000000000001, 1.0, 1.0],
[0.12176000000000053, 0.12, 1.0, 1.0],
[0.11577200000000054, 0.11399999999999999, 1.0, 1.0],
[0.10479400000000061, 0.10299999999999998, 1.0, 1.0],
[0.098806000000000616, 0.096999999999999975, 1.0, 1.0],
[0.092818000000000622, 0.09099999999999997, 1.0, 1.0],
[0.081840000000000579, 0.07999999999999996, 1.0, 1.0],
[0.075852000000000586, 0.073999999999999955, 1.0, 1.0],
[0.070862000000000536, 0.06899999999999995, 1.0, 1.0],
[0.05888600000000066, 0.057000000000000051, 1.0, 1.0],
[0.052898000000000667, 0.051000000000000045, 1.0, 1.0],
[0.041920000000000623, 0.040000000000000036, 1.0, 1.0],
[0.03593200000000063, 0.03400000000000003, 1.0, 1.0],
[0.030942000000000691, 0.029000000000000026, 1.0, 1.0],
[0.018966000000000705, 0.017000000000000015, 1.0, 1.0],
[0.012978000000000711, 0.01100000000000001, 1.0, 1.0],
[0.0020000000000006679, 0.0, 1.0, 1.0],
],
"name": "cmap",
},
run=False,
)
except:
print "WARNING: failed to restore ColorMap named Color Map in network self.macroNetwork"
print_exc()
Color_Map_9 = None
try:
## saving node call method ##
from Vision.StandardNodes import CallMethod
call_method_10 = CallMethod(constrkw={}, name="call method", library=stdlib)
self.macroNetwork.addNode(call_method_10, 179, 501)
apply(
call_method_10.inputPortByName["objects"].configure,
(),
{"datatype": "geom", "cast": True, "shape": "rect", "color": "red"},
)
apply(
call_method_10.inputPortByName["signature"].configure,
(),
{"color": "white", "cast": True, "shape": "oval"},
)
apply(
call_method_10.addInputPort,
(),
{
"name": "materials",
"cast": True,
"datatype": "colorfloat3or4(0)",
"required": False,
"height": 8,
"width": 12,
"shape": "rect",
"color": "orange",
},
)
apply(
call_method_10.addInputPort,
(),
{
"name": "inheritMaterial",
"cast": True,
"datatype": "int",
"required": False,
"height": 12,
"width": 12,
"shape": "circle",
"color": "yellow",
},
)
apply(
call_method_10.outputPortByName["objects"].configure,
(),
{"color": "white", "shape": "diamond"},
)
apply(
call_method_10.outputPortByName["results"].configure,
(),
{"color": "white", "shape": "diamond"},
)
call_method_10.inputPortByName["signature"].widget.set(
"Set materials inheritMaterial", run=False
)
except:
print "WARNING: failed to restore CallMethod named call method in network self.macroNetwork"
print_exc()
call_method_10 = None
try:
## saving node Checkbutton ##
from Vision.StandardNodes import CheckButtonNE
Checkbutton_11 = CheckButtonNE(
constrkw={}, name="Checkbutton", library=stdlib
)
self.macroNetwork.addNode(Checkbutton_11, 346, 478)
apply(
Checkbutton_11.inputPortByName["button"].configure,
(),
{"color": "yellow", "cast": True, "shape": "circle"},
)
apply(
Checkbutton_11.outputPortByName["value"].configure,
(),
{"color": "yellow", "shape": "circle"},
)
except:
print "WARNING: failed to restore CheckButtonNE named Checkbutton in network self.macroNetwork"
print_exc()
Checkbutton_11 = None
try:
## saving node Redraw ##
from DejaVu.VisionInterface.DejaVuNodes import Redraw
Redraw_12 = Redraw(constrkw={}, name="Redraw", library=vizlib)
self.macroNetwork.addNode(Redraw_12, 41, 518)
apply(
Redraw_12.inputPortByName["viewer"].configure,
(),
{"color": "yellow", "cast": True, "shape": "rect"},
)
apply(
Redraw_12.inputPortByName["trigger"].configure,
(),
{"color": "white", "cast": True, "shape": "diamond"},
)
except:
print "WARNING: failed to restore Redraw named Redraw in network self.macroNetwork"
print_exc()
Redraw_12 = None
try:
## saving node neg ##
from Vision.StandardNodes import Operator1
neg_13 = Operator1(constrkw={}, name="neg", library=stdlib)
self.macroNetwork.addNode(neg_13, 288, 321)
apply(
neg_13.inputPortByName["data"].configure,
(),
{"color": "white", "cast": True, "shape": "diamond"},
)
apply(
neg_13.inputPortByName["operation"].configure,
(),
{"color": "white", "cast": True, "shape": "diamond"},
)
apply(
neg_13.inputPortByName["applyToElements"].configure,
(),
{"color": "yellow", "cast": True, "shape": "circle"},
)
apply(
neg_13.outputPortByName["result"].configure,
(),
{"color": "white", "shape": "diamond"},
)
neg_13.inputPortByName["operation"].widget.set("neg", run=False)
apply(neg_13.configure, (), {"expanded": False})
except:
print "WARNING: failed to restore Operator1 named neg in network self.macroNetwork"
print_exc()
neg_13 = None
try:
## saving node Get viewer ##
from Vision.StandardNodes import GetAttr
Get_viewer_14 = GetAttr(constrkw={}, name="Get viewer", library=stdlib)
self.macroNetwork.addNode(Get_viewer_14, 18, 324)
apply(
Get_viewer_14.inputPortByName["objects"].configure,
(),
{"color": "white", "cast": True, "shape": "diamond"},
)
apply(
Get_viewer_14.inputPortByName["attr"].configure,
(),
{"color": "white", "cast": True, "shape": "oval"},
)
apply(
Get_viewer_14.outputPortByName["attrs"].configure,
(),
{"color": "cyan", "shape": "oval"},
)
apply(
Get_viewer_14.inputPortByName["attr"].widget.configure,
(),
{"choices": ("viewer",)},
)
Get_viewer_14.inputPortByName["attr"].widget.set("viewer", run=False)
except:
print "WARNING: failed to restore GetAttr named Get viewer in network self.macroNetwork"
print_exc()
Get_viewer_14 = None
try:
## saving node Slice Data ##
from Vision.StandardNodes import SliceData
Slice_Data_15 = SliceData(constrkw={}, name="Slice Data", library=stdlib)
self.macroNetwork.addNode(Slice_Data_15, 29, 421)
apply(
Slice_Data_15.inputPortByName["data"].configure,
(),
{"datatype": "list", "cast": True, "shape": "oval", "color": "cyan"},
)
apply(
Slice_Data_15.inputPortByName["_slice"].configure,
(),
{"color": "white", "cast": True, "shape": "diamond"},
)
apply(
Slice_Data_15.outputPortByName["data"].configure,
(),
{"color": "white", "shape": "diamond"},
)
Slice_Data_15.inputPortByName["_slice"].widget.set("[0]", run=False)
except:
print "WARNING: failed to restore SliceData named Slice Data in network self.macroNetwork"
print_exc()
Slice_Data_15 = None
try:
## saving node stddev ##
from Vision.StandardNodes import StdDev
stddev_16 = StdDev(constrkw={}, name="stddev", library=stdlib)
self.macroNetwork.addNode(stddev_16, 339, 230)
apply(
stddev_16.inputPortByName["values"].configure,
(),
{"color": "cyan", "cast": True, "shape": "oval"},
)
apply(
stddev_16.outputPortByName["stddev"].configure,
(),
{"color": "green", "shape": "circle"},
)
except:
print "WARNING: failed to restore StdDev named stddev in network self.macroNetwork"
print_exc()
stddev_16 = None
try:
## saving node Dial ##
from Vision.StandardNodes import DialNE
Dial_17 = DialNE(constrkw={}, name="Dial", library=stdlib)
self.macroNetwork.addNode(Dial_17, 412, 152)
apply(
Dial_17.inputPortByName["dial"].configure,
(),
{"color": "green", "cast": True, "shape": "circle"},
)
apply(
Dial_17.inputPortByName["mini"].configure,
(),
{"color": "green", "cast": True, "shape": "circle"},
)
apply(
Dial_17.inputPortByName["maxi"].configure,
(),
{"color": "green", "cast": True, "shape": "circle"},
)
apply(
Dial_17.outputPortByName["value"].configure,
(),
{"color": "green", "shape": "circle"},
)
Dial_17.inputPortByName["dial"].widget.set(5.0, run=False)
except:
print "WARNING: failed to restore DialNE named Dial in network self.macroNetwork"
print_exc()
Dial_17 = None
try:
## saving node mul ##
from Vision.StandardNodes import Operator2
mul_18 = Operator2(constrkw={}, name="mul", library=stdlib)
self.macroNetwork.addNode(mul_18, 369, 347)
apply(
mul_18.inputPortByName["data1"].configure,
(),
{
"datatype": "float",
"cast": True,
"shape": "circle",
"color": "green",
},
)
apply(
mul_18.inputPortByName["data2"].configure,
(),
{
"datatype": "float",
"cast": True,
"shape": "circle",
"color": "green",
},
)
apply(
mul_18.inputPortByName["operation"].configure,
(),
{"color": "white", "cast": True, "shape": "diamond"},
)
apply(
mul_18.inputPortByName["applyToElements"].configure,
(),
{"color": "yellow", "cast": True, "shape": "circle"},
)
apply(
mul_18.outputPortByName["result"].configure,
(),
{"color": "white", "shape": "diamond"},
)
mul_18.inputPortByName["operation"].widget.set("mul", run=False)
apply(mul_18.configure, (), {"expanded": False})
except:
print "WARNING: failed to restore Operator2 named mul in network self.macroNetwork"
print_exc()
mul_18 = None
self.macroNetwork.freeze()
## saving connections for network Map Pot On Geom ##
if Offset_5 is not None and mul_4 is not None:
self.macroNetwork.connectNodes(
Offset_5, mul_4, "value", "data2", blocking=True
)
if getSurfaceVFN_3 is not None and mul_4 is not None:
self.macroNetwork.connectNodes(
getSurfaceVFN_3, mul_4, "normals", "data1", blocking=True
)
if mul_4 is not None and add_6 is not None:
self.macroNetwork.connectNodes(
mul_4, add_6, "result", "data2", blocking=True
)
if getSurfaceVFN_3 is not None and add_6 is not None:
self.macroNetwork.connectNodes(
getSurfaceVFN_3, add_6, "vertices", "data1", blocking=True
)
if add_6 is not None and triInterp_7 is not None:
self.macroNetwork.connectNodes(
add_6, triInterp_7, "result", "points", blocking=True
)
if getSurfaceVFN_3 is not None and call_method_10 is not None:
self.macroNetwork.connectNodes(
getSurfaceVFN_3, call_method_10, "geom", "objects", blocking=True
)
if Checkbutton_11 is not None and call_method_10 is not None:
self.macroNetwork.connectNodes(
Checkbutton_11,
call_method_10,
"value",
"inheritMaterial",
blocking=True,
)
if call_method_10 is not None and Redraw_12 is not None:
self.macroNetwork.connectNodes(
call_method_10, Redraw_12, "objects", "trigger", blocking=True
)
input_Ports_1 = self.macroNetwork.ipNode
if input_Ports_1 is not None and getSurfaceVFN_3 is not None:
self.macroNetwork.connectNodes(
input_Ports_1, getSurfaceVFN_3, "new", "geometry", blocking=True
)
if getSurfaceVFN_3 is not None and Get_viewer_14 is not None:
self.macroNetwork.connectNodes(
getSurfaceVFN_3, Get_viewer_14, "geom", "objects", blocking=True
)
if Get_viewer_14 is not None and Slice_Data_15 is not None:
self.macroNetwork.connectNodes(
Get_viewer_14, Slice_Data_15, "attrs", "data", blocking=True
)
if Slice_Data_15 is not None and Redraw_12 is not None:
self.macroNetwork.connectNodes(
Slice_Data_15, Redraw_12, "data", "viewer", blocking=True
)
if input_Ports_1 is not None and triInterp_7 is not None:
self.macroNetwork.connectNodes(
input_Ports_1, triInterp_7, "new", "grid", blocking=True
)
if triInterp_7 is not None and stddev_16 is not None:
self.macroNetwork.connectNodes(
triInterp_7, stddev_16, "data", "values", blocking=True
)
if neg_13 is not None and Color_Map_9 is not None:
self.macroNetwork.connectNodes(
neg_13, Color_Map_9, "result", "mini", blocking=True
)
if mul_18 is not None and neg_13 is not None:
self.macroNetwork.connectNodes(
mul_18, neg_13, "result", "data", blocking=True
)
if mul_18 is not None and Color_Map_9 is not None:
self.macroNetwork.connectNodes(
mul_18, Color_Map_9, "result", "maxi", blocking=True
)
if Dial_17 is not None and mul_18 is not None:
self.macroNetwork.connectNodes(
Dial_17, mul_18, "value", "data2", blocking=True
)
if stddev_16 is not None and mul_18 is not None:
self.macroNetwork.connectNodes(
stddev_16, mul_18, "stddev", "data1", blocking=True
)
if triInterp_7 is not None and Color_Map_9 is not None:
self.macroNetwork.connectNodes(
triInterp_7, Color_Map_9, "data", "values", blocking=True
)
if Color_Map_9 is not None and call_method_10 is not None:
self.macroNetwork.connectNodes(
Color_Map_9, call_method_10, "mappedColors", "materials", blocking=True
)
output_Ports_2 = self.macroNetwork.opNode
if Color_Map_9 is not None and output_Ports_2 is not None:
self.macroNetwork.connectNodes(
Color_Map_9, output_Ports_2, "legend", "new", blocking=True
)
self.macroNetwork.unfreeze()
Map_Pot_On_Geom_0.shrink()
## reset modifications ##
Map_Pot_On_Geom_0.resetTags()
Map_Pot_On_Geom_0.buildOriginalList()
| 47.06163
| 110
| 0.496409
| 4,465
| 47,344
| 5.187906
| 0.121165
| 0.044725
| 0.03445
| 0.045588
| 0.574858
| 0.485063
| 0.423934
| 0.229753
| 0.179546
| 0.162709
| 0
| 0.346236
| 0.380133
| 47,344
| 1,005
| 111
| 47.108458
| 0.443078
| 0.017045
| 0
| 0.331133
| 1
| 0
| 0.090561
| 0.002939
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.029703
| null | null | 0.038504
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
2bd55d47c87ea8604c3046980ab875ad0fb1e412
| 80
|
py
|
Python
|
routeros/system/note.py
|
hexatester/RouterOS
|
187214e12ef92fbe5c62d3475d32430537a15c68
|
[
"MIT"
] | null | null | null |
routeros/system/note.py
|
hexatester/RouterOS
|
187214e12ef92fbe5c62d3475d32430537a15c68
|
[
"MIT"
] | null | null | null |
routeros/system/note.py
|
hexatester/RouterOS
|
187214e12ef92fbe5c62d3475d32430537a15c68
|
[
"MIT"
] | null | null | null |
import attr
@attr.dataclass
class Note:
note: str
show_at_login: bool
| 10
| 23
| 0.7
| 12
| 80
| 4.5
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.2375
| 80
| 7
| 24
| 11.428571
| 0.885246
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.2
| 0
| 0.8
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
921e3229ce30a04bf833c48374b4a3904dbfdde2
| 69
|
py
|
Python
|
tests/__init__.py
|
fossabot/django-opt-out
|
82b2fda6d55974df19e620e9a55cac56688f74b2
|
[
"MIT"
] | 3
|
2018-11-30T23:02:18.000Z
|
2019-10-04T09:11:11.000Z
|
tests/__init__.py
|
fossabot/django-opt-out
|
82b2fda6d55974df19e620e9a55cac56688f74b2
|
[
"MIT"
] | 5
|
2017-11-24T20:00:22.000Z
|
2020-10-12T04:33:56.000Z
|
tests/__init__.py
|
fossabot/django-opt-out
|
82b2fda6d55974df19e620e9a55cac56688f74b2
|
[
"MIT"
] | 3
|
2018-09-08T03:16:13.000Z
|
2018-12-25T06:09:11.000Z
|
# -*- coding: utf-8 -*-
"""Unit test package for django-opt-out."""
| 17.25
| 43
| 0.57971
| 10
| 69
| 4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.017241
| 0.15942
| 69
| 3
| 44
| 23
| 0.672414
| 0.869565
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
ecff2b45e61b8fc7ecba321aa9e0be1ea28bb23b
| 259
|
py
|
Python
|
src/prosi3d/datahandler.py
|
pzimbrod/prosi-3d
|
6eaa5b9cdb7192f542417429b1775c3e61a9bc60
|
[
"MIT"
] | null | null | null |
src/prosi3d/datahandler.py
|
pzimbrod/prosi-3d
|
6eaa5b9cdb7192f542417429b1775c3e61a9bc60
|
[
"MIT"
] | 3
|
2021-11-11T07:32:01.000Z
|
2021-11-23T15:42:26.000Z
|
src/prosi3d/datahandler.py
|
pzimbrod/prosi-3d
|
6eaa5b9cdb7192f542417429b1775c3e61a9bc60
|
[
"MIT"
] | null | null | null |
import h5py
"""
This is a class that reads the HDF5 Container and extracts the data
"""
class DataHandler:
""" Read the data """
def read_container():
pass
""" Extract the data to RAM """
def extract():
pass
| 16.1875
| 68
| 0.563707
| 32
| 259
| 4.53125
| 0.65625
| 0.144828
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.011696
| 0.339768
| 259
| 15
| 69
| 17.266667
| 0.836257
| 0.050193
| 0
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| true
| 0.333333
| 0.166667
| 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
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
a610392982e1d65fe1a61cf9d31f50395130615a
| 10,835
|
py
|
Python
|
gtfs/migrations/0022_add_translations.py
|
montel-ig/maritime-maas
|
68a3fe30d47745aba40ebf911d599346c070dfa4
|
[
"MIT"
] | null | null | null |
gtfs/migrations/0022_add_translations.py
|
montel-ig/maritime-maas
|
68a3fe30d47745aba40ebf911d599346c070dfa4
|
[
"MIT"
] | 34
|
2021-03-05T15:07:17.000Z
|
2022-02-23T19:05:39.000Z
|
gtfs/migrations/0022_add_translations.py
|
montel-ig/maritime-maas
|
68a3fe30d47745aba40ebf911d599346c070dfa4
|
[
"MIT"
] | 1
|
2022-02-24T13:57:52.000Z
|
2022-02-24T13:57:52.000Z
|
# Generated by Django 3.1.7 on 2021-04-30 04:20
from django.db import migrations, models
import django.db.models.deletion
import parler.fields
import parler.models
class Migration(migrations.Migration):
dependencies = [
("gtfs", "0021_change_times_to_durations"),
]
operations = [
migrations.RemoveField(
model_name="agency",
name="email",
),
migrations.RemoveField(
model_name="agency",
name="fare_url",
),
migrations.RemoveField(
model_name="agency",
name="name",
),
migrations.RemoveField(
model_name="agency",
name="phone",
),
migrations.RemoveField(
model_name="agency",
name="url",
),
migrations.RemoveField(
model_name="route",
name="desc",
),
migrations.RemoveField(
model_name="route",
name="long_name",
),
migrations.RemoveField(
model_name="route",
name="url",
),
migrations.RemoveField(
model_name="stop",
name="desc",
),
migrations.RemoveField(
model_name="stop",
name="name",
),
migrations.RemoveField(
model_name="stop",
name="tts_name",
),
migrations.RemoveField(
model_name="stoptime",
name="stop_headsign",
),
migrations.RemoveField(
model_name="trip",
name="headsign",
),
migrations.RemoveField(
model_name="trip",
name="short_name",
),
migrations.CreateModel(
name="TripTranslation",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"language_code",
models.CharField(
db_index=True, max_length=15, verbose_name="Language"
),
),
(
"headsign",
models.CharField(
blank=True, max_length=255, verbose_name="headsign"
),
),
(
"short_name",
models.CharField(
blank=True, max_length=64, verbose_name="short name"
),
),
(
"master",
parler.fields.TranslationsForeignKey(
editable=False,
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="translations",
to="gtfs.trip",
),
),
],
options={
"verbose_name": "trip Translation",
"db_table": "gtfs_trip_translation",
"db_tablespace": "",
"managed": True,
"default_permissions": (),
"unique_together": {("language_code", "master")},
},
bases=(parler.models.TranslatableModel, models.Model),
),
migrations.CreateModel(
name="StopTranslation",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"language_code",
models.CharField(
db_index=True, max_length=15, verbose_name="Language"
),
),
(
"name",
models.CharField(blank=True, max_length=255, verbose_name="name"),
),
("desc", models.TextField(blank=True, verbose_name="description")),
(
"tts_name",
models.CharField(
blank=True,
help_text="readable version of the name",
max_length=255,
verbose_name="TTS name",
),
),
(
"master",
parler.fields.TranslationsForeignKey(
editable=False,
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="translations",
to="gtfs.stop",
),
),
],
options={
"verbose_name": "stop Translation",
"db_table": "gtfs_stop_translation",
"db_tablespace": "",
"managed": True,
"default_permissions": (),
"unique_together": {("language_code", "master")},
},
bases=(parler.models.TranslatableModel, models.Model),
),
migrations.CreateModel(
name="StopTimeTranslation",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"language_code",
models.CharField(
db_index=True, max_length=15, verbose_name="Language"
),
),
(
"stop_headsign",
models.CharField(
blank=True, max_length=255, verbose_name="stop headsign"
),
),
(
"master",
parler.fields.TranslationsForeignKey(
editable=False,
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="translations",
to="gtfs.stoptime",
),
),
],
options={
"verbose_name": "stop times Translation",
"db_table": "gtfs_stoptime_translation",
"db_tablespace": "",
"managed": True,
"default_permissions": (),
"unique_together": {("language_code", "master")},
},
bases=(parler.models.TranslatableModel, models.Model),
),
migrations.CreateModel(
name="RouteTranslation",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"language_code",
models.CharField(
db_index=True, max_length=15, verbose_name="Language"
),
),
(
"long_name",
models.CharField(
blank=True, max_length=255, verbose_name="long name"
),
),
("desc", models.TextField(blank=True, verbose_name="description")),
("url", models.URLField(blank=True, verbose_name="URL")),
(
"master",
parler.fields.TranslationsForeignKey(
editable=False,
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="translations",
to="gtfs.route",
),
),
],
options={
"verbose_name": "route Translation",
"db_table": "gtfs_route_translation",
"db_tablespace": "",
"managed": True,
"default_permissions": (),
"unique_together": {("language_code", "master")},
},
bases=(parler.models.TranslatableModel, models.Model),
),
migrations.CreateModel(
name="AgencyTranslation",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"language_code",
models.CharField(
db_index=True, max_length=15, verbose_name="Language"
),
),
("name", models.CharField(max_length=64, verbose_name="name")),
("url", models.URLField(verbose_name="URL")),
(
"phone",
models.CharField(blank=True, max_length=64, verbose_name="phone"),
),
("fare_url", models.URLField(blank=True, verbose_name="fare URL")),
(
"email",
models.EmailField(blank=True, max_length=254, verbose_name="email"),
),
(
"master",
parler.fields.TranslationsForeignKey(
editable=False,
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="translations",
to="gtfs.agency",
),
),
],
options={
"verbose_name": "agency Translation",
"db_table": "gtfs_agency_translation",
"db_tablespace": "",
"managed": True,
"default_permissions": (),
"unique_together": {("language_code", "master")},
},
bases=(parler.models.TranslatableModel, models.Model),
),
]
| 33.965517
| 88
| 0.394739
| 697
| 10,835
| 5.939742
| 0.146341
| 0.077053
| 0.087923
| 0.101449
| 0.794928
| 0.767391
| 0.657971
| 0.616908
| 0.616908
| 0.568599
| 0
| 0.00989
| 0.505399
| 10,835
| 318
| 89
| 34.072327
| 0.762642
| 0.004153
| 0
| 0.711538
| 1
| 0
| 0.132369
| 0.013163
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.012821
| 0
| 0.022436
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
a610aa12122d8908499b0823ea165f2f022b0449
| 149
|
py
|
Python
|
flax_id/django/models.py
|
arshsingh/python-flax-id
|
6121394da26c84e9c7ab7785f6487a03c6bb4935
|
[
"MIT"
] | 5
|
2018-04-25T05:57:15.000Z
|
2022-01-30T12:43:13.000Z
|
flax_id/django/models.py
|
arshsingh/python-flax-id
|
6121394da26c84e9c7ab7785f6487a03c6bb4935
|
[
"MIT"
] | null | null | null |
flax_id/django/models.py
|
arshsingh/python-flax-id
|
6121394da26c84e9c7ab7785f6487a03c6bb4935
|
[
"MIT"
] | 2
|
2018-09-19T10:07:14.000Z
|
2018-12-11T23:12:44.000Z
|
from django.db import models
from .fields import FlaxId
class FlaxModel(models.Model):
id = FlaxId()
class Meta:
abstract = True
| 13.545455
| 30
| 0.671141
| 19
| 149
| 5.263158
| 0.736842
| 0.22
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.255034
| 149
| 10
| 31
| 14.9
| 0.900901
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.833333
| 0
| 1
| 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
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
a64502daed30e0ddc64341a3bac9cdacb7c0abc7
| 117
|
py
|
Python
|
TagMeGooey/__main__.py
|
zordsdavini/TagMe-gooey
|
3c59823e0e42ab218c62cd286a78d7e347d28493
|
[
"MIT"
] | null | null | null |
TagMeGooey/__main__.py
|
zordsdavini/TagMe-gooey
|
3c59823e0e42ab218c62cd286a78d7e347d28493
|
[
"MIT"
] | null | null | null |
TagMeGooey/__main__.py
|
zordsdavini/TagMe-gooey
|
3c59823e0e42ab218c62cd286a78d7e347d28493
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
"""executed when tagme directory is called as script."""
from .gooey_ui import main
main()
| 16.714286
| 56
| 0.666667
| 17
| 117
| 4.529412
| 0.941176
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.010309
| 0.17094
| 117
| 6
| 57
| 19.5
| 0.783505
| 0.623932
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
a6566ceec1d4e292b335a13a405522baf8fd741b
| 145
|
py
|
Python
|
Regex/Alternative Matching.py
|
rafaelgreca/hackerrank-solutions
|
2be6c8fdd9b7f2ab3a678e7dcdc27e730edfaef3
|
[
"MIT"
] | null | null | null |
Regex/Alternative Matching.py
|
rafaelgreca/hackerrank-solutions
|
2be6c8fdd9b7f2ab3a678e7dcdc27e730edfaef3
|
[
"MIT"
] | null | null | null |
Regex/Alternative Matching.py
|
rafaelgreca/hackerrank-solutions
|
2be6c8fdd9b7f2ab3a678e7dcdc27e730edfaef3
|
[
"MIT"
] | null | null | null |
Regex_Pattern = r'^(Mr\.|Mrs\.|Dr\.|Er\.)[a-zA-Z]+$' # Do not delete 'r'.
import re
print(str(bool(re.search(Regex_Pattern, input()))).lower())
| 29
| 73
| 0.62069
| 25
| 145
| 3.52
| 0.84
| 0.272727
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.089655
| 145
| 5
| 74
| 29
| 0.666667
| 0.124138
| 0
| 0
| 0
| 0
| 0.261905
| 0.261905
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0.333333
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
a66982dc5cf8441cac56bba65e1be599ac99b854
| 138
|
py
|
Python
|
root/functions/find_in_text/utils.py
|
eric0111/prove_it_finder
|
ce6f34afeb0c22bc79e188c71c0949f98f38258b
|
[
"MIT"
] | 1
|
2021-12-29T22:22:00.000Z
|
2021-12-29T22:22:00.000Z
|
root/functions/find_in_text/utils.py
|
eric0111/prove_it_finder
|
ce6f34afeb0c22bc79e188c71c0949f98f38258b
|
[
"MIT"
] | null | null | null |
root/functions/find_in_text/utils.py
|
eric0111/prove_it_finder
|
ce6f34afeb0c22bc79e188c71c0949f98f38258b
|
[
"MIT"
] | null | null | null |
def get_sec(time_str):
"""Get Seconds from time."""
h, m, s = time_str.split(':')
return int(h) * 3600 + int(m) * 60 + int(s)
| 27.6
| 47
| 0.550725
| 24
| 138
| 3.041667
| 0.625
| 0.191781
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.057143
| 0.23913
| 138
| 4
| 48
| 34.5
| 0.638095
| 0.15942
| 0
| 0
| 0
| 0
| 0.009091
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
a66a4c97a471d14cb263ee5b3dfcf9c2b50a5ee4
| 180
|
py
|
Python
|
naive_bayes/__init__.py
|
dayyass/extended_naive_bayes
|
3178b3a79b4094ec7e0a553e9203ac947a83aadd
|
[
"MIT"
] | 5
|
2021-07-22T19:48:22.000Z
|
2021-09-05T15:03:15.000Z
|
naive_bayes/__init__.py
|
dayyass/naive_bayes
|
3178b3a79b4094ec7e0a553e9203ac947a83aadd
|
[
"MIT"
] | 10
|
2021-05-25T20:28:38.000Z
|
2021-05-30T19:54:59.000Z
|
naive_bayes/__init__.py
|
dayyass/extended-naive-bayes
|
3178b3a79b4094ec7e0a553e9203ac947a83aadd
|
[
"MIT"
] | null | null | null |
from naive_bayes.models import ( # noqa: F401
BernoulliNaiveBayes,
CategoricalNaiveBayes,
ExtendedNaiveBayes,
GaussianNaiveBayes,
SklearnExtendedNaiveBayes,
)
| 22.5
| 46
| 0.755556
| 12
| 180
| 11.25
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.020548
| 0.188889
| 180
| 7
| 47
| 25.714286
| 0.90411
| 0.055556
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.142857
| 0
| 0.142857
| 0
| 1
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
a66c1b3970bbcf63702eb3940ddc0ed48b1d0f42
| 103
|
py
|
Python
|
Beta/Joules to calories.py
|
mwk0408/codewars_solutions
|
9b4f502b5f159e68024d494e19a96a226acad5e5
|
[
"MIT"
] | 6
|
2020-09-03T09:32:25.000Z
|
2020-12-07T04:10:01.000Z
|
Beta/Joules to calories.py
|
mwk0408/codewars_solutions
|
9b4f502b5f159e68024d494e19a96a226acad5e5
|
[
"MIT"
] | 1
|
2021-12-13T15:30:21.000Z
|
2021-12-13T15:30:21.000Z
|
Beta/Joules to calories.py
|
mwk0408/codewars_solutions
|
9b4f502b5f159e68024d494e19a96a226acad5e5
|
[
"MIT"
] | null | null | null |
def calories(string):
res=string.split()
return round(int(res[0])*[1, 1000][res[1]!="J"]/4.184)
| 34.333333
| 58
| 0.61165
| 18
| 103
| 3.5
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.122222
| 0.126214
| 103
| 3
| 58
| 34.333333
| 0.577778
| 0
| 0
| 0
| 0
| 0
| 0.009615
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
a68c59cbe240fc29a4790822ef8199ec04057ecd
| 126
|
py
|
Python
|
Server/Code/database/engine.py
|
HueyPark/Unreal-Knights
|
9a08dd15c65d8853f1322bf6de4b892cd88c571a
|
[
"MIT"
] | null | null | null |
Server/Code/database/engine.py
|
HueyPark/Unreal-Knights
|
9a08dd15c65d8853f1322bf6de4b892cd88c571a
|
[
"MIT"
] | null | null | null |
Server/Code/database/engine.py
|
HueyPark/Unreal-Knights
|
9a08dd15c65d8853f1322bf6de4b892cd88c571a
|
[
"MIT"
] | null | null | null |
from sqlalchemy import create_engine
engine = create_engine('mysql+pymysql://root:@127.0.0.1:3306/unrealknights', echo=True)
| 31.5
| 87
| 0.785714
| 19
| 126
| 5.105263
| 0.789474
| 0.247423
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.08547
| 0.071429
| 126
| 3
| 88
| 42
| 0.74359
| 0
| 0
| 0
| 0
| 0
| 0.396825
| 0.396825
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
a68cec21375dc5b44c798d1b43a90860ff259e5b
| 3,342
|
py
|
Python
|
RecoBTag/PerformanceDB/python/measure/Pool_btagMistagABCD.py
|
ckamtsikis/cmssw
|
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
|
[
"Apache-2.0"
] | 852
|
2015-01-11T21:03:51.000Z
|
2022-03-25T21:14:00.000Z
|
RecoBTag/PerformanceDB/python/measure/Pool_btagMistagABCD.py
|
ckamtsikis/cmssw
|
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
|
[
"Apache-2.0"
] | 30,371
|
2015-01-02T00:14:40.000Z
|
2022-03-31T23:26:05.000Z
|
RecoBTag/PerformanceDB/python/measure/Pool_btagMistagABCD.py
|
ckamtsikis/cmssw
|
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
|
[
"Apache-2.0"
] | 3,240
|
2015-01-02T05:53:18.000Z
|
2022-03-31T17:24:21.000Z
|
import FWCore.ParameterSet.Config as cms
from CondCore.DBCommon.CondDBCommon_cfi import *
PoolDBESSourcebtagMistagABCD = cms.ESSource("PoolDBESSource",
CondDBCommon,
toGet = cms.VPSet(
#
# working points
#
cms.PSet(
record = cms.string('PerformancePayloadRecord'),
tag = cms.string('PerformancePayloadFromBinnedTFormula_MISTAGCSVLABCD_v9_offline'),
label = cms.untracked.string('MISTAGCSVLABCD_T')
),
cms.PSet(
record = cms.string('PerformanceWPRecord'),
tag = cms.string('PerformanceWorkingPoint_MISTAGCSVLABCD_v9_offline'),
label = cms.untracked.string('MISTAGCSVLABCD_WP')
),
cms.PSet(
record = cms.string('PerformancePayloadRecord'),
tag = cms.string('PerformancePayloadFromBinnedTFormula_MISTAGCSVMABCD_v9_offline'),
label = cms.untracked.string('MISTAGCSVMABCD_T')
),
cms.PSet(
record = cms.string('PerformanceWPRecord'),
tag = cms.string('PerformanceWorkingPoint_MISTAGCSVMABCD_v9_offline'),
label = cms.untracked.string('MISTAGCSVMABCD_WP')
),
cms.PSet(
record = cms.string('PerformancePayloadRecord'),
tag = cms.string('PerformancePayloadFromBinnedTFormula_MISTAGCSVTABCD_v9_offline'),
label = cms.untracked.string('MISTAGCSVTABCD_T')
),
cms.PSet(
record = cms.string('PerformanceWPRecord'),
tag = cms.string('PerformanceWorkingPoint_MISTAGCSVTABCD_v9_offline'),
label = cms.untracked.string('MISTAGCSVTABCD_WP')
),
cms.PSet(
record = cms.string('PerformancePayloadRecord'),
tag = cms.string('PerformancePayloadFromBinnedTFormula_MISTAGJPLABCD_v9_offline'),
label = cms.untracked.string('MISTAGJPLABCD_T')
),
cms.PSet(
record = cms.string('PerformanceWPRecord'),
tag = cms.string('PerformanceWorkingPoint_MISTAGJPLABCD_v9_offline'),
label = cms.untracked.string('MISTAGJPLABCD_WP')
),
cms.PSet(
record = cms.string('PerformancePayloadRecord'),
tag = cms.string('PerformancePayloadFromBinnedTFormula_MISTAGJPMABCD_v9_offline'),
label = cms.untracked.string('MISTAGJPMABCD_T')
),
cms.PSet(
record = cms.string('PerformanceWPRecord'),
tag = cms.string('PerformanceWorkingPoint_MISTAGJPMABCD_v9_offline'),
label = cms.untracked.string('MISTAGJPMABCD_WP')
),
cms.PSet(
record = cms.string('PerformancePayloadRecord'),
tag = cms.string('PerformancePayloadFromBinnedTFormula_MISTAGJPTABCD_v9_offline'),
label = cms.untracked.string('MISTAGJPTABCD_T')
),
cms.PSet(
record = cms.string('PerformanceWPRecord'),
tag = cms.string('PerformanceWorkingPoint_MISTAGJPTABCD_v9_offline'),
label = cms.untracked.string('MISTAGJPTABCD_WP')
),
cms.PSet(
record = cms.string('PerformancePayloadRecord'),
tag = cms.string('PerformancePayloadFromBinnedTFormula_MISTAGTCHPTABCD_v9_offline'),
label = cms.untracked.string('MISTAGTCHPTABCD_T')
),
cms.PSet(
record = cms.string('PerformanceWPRecord'),
tag = cms.string('PerformanceWorkingPoint_MISTAGTCHPTABCD_v9_offline'),
label = cms.untracked.string('MISTAGTCHPTABCD_WP')
),
))
PoolDBESSourcebtagMistagABCD.connect = 'frontier://FrontierProd/CMS_COND_PAT_000'
| 38.413793
| 88
| 0.699581
| 296
| 3,342
| 7.695946
| 0.152027
| 0.110623
| 0.079895
| 0.098332
| 0.895961
| 0.895961
| 0.895961
| 0.895961
| 0.530729
| 0.530729
| 0
| 0.006259
| 0.187313
| 3,342
| 86
| 89
| 38.860465
| 0.832474
| 0.004189
| 0
| 0.545455
| 0
| 0
| 0.407641
| 0.295126
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.025974
| 0
| 0.025974
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
a6d73b27b7783bc7a8fa972669a3dee7d104566e
| 15,982
|
py
|
Python
|
data.py
|
sjmoran/CURL
|
919e519717b66e14d92ac6fa404c328ee3f254a5
|
[
"BSD-3-Clause"
] | 125
|
2020-10-16T12:25:59.000Z
|
2022-03-22T06:04:57.000Z
|
data.py
|
sjmoran/deepraw2rgb
|
a76b6cefff95972af86594f34d4182d0fb460ed9
|
[
"BSD-3-Clause"
] | 22
|
2020-10-19T10:40:05.000Z
|
2022-02-14T12:01:46.000Z
|
data.py
|
sjmoran/difar
|
a4e59533685257098eb02a25d0f90e40cf04e0a1
|
[
"BSD-3-Clause"
] | 23
|
2020-11-05T09:23:52.000Z
|
2022-03-24T08:00:50.000Z
|
# -*- coding: utf-8 -*-
'''
This is a PyTorch implementation of CURL: Neural Curve Layers for Global Image Enhancement
https://arxiv.org/pdf/1911.13175.pdf
Please cite paper if you use this code.
Tested with Pytorch 1.7.1, Python 3.7.9
Authors: Sean Moran (sean.j.moran@gmail.com), 2020
'''
import matplotlib
matplotlib.use('agg')
import numpy as np
import sys
import torch
from abc import ABCMeta, abstractmethod
from collections import defaultdict
import logging
import os
import util
import torchvision.transforms.functional as TF
import random
import matplotlib.pyplot as plt
from PIL import Image
np.set_printoptions(threshold=sys.maxsize)
class SamsungDataset(torch.utils.data.Dataset):
def __init__(self, data_dict, transform=None, normaliser=2 ** 8 - 1, is_valid=False):
"""Initialisation for the Dataset object
:param data_dict: dictionary of dictionaries containing images
:param transform: PyTorch image transformations to apply to the images
:returns: N/A
:rtype: N/A
"""
self.transform = transform
self.data_dict = data_dict
self.normaliser = normaliser # normaliser for groundtruth data
self.is_valid = is_valid
def __len__(self):
"""Returns the number of images in the dataset
:returns: number of images in the dataset
:rtype: Integer
"""
return (len(self.data_dict.keys()))
def __getitem__(self, idx):
"""Returns a pair of images with the given identifier. This is lazy loading
of data into memory. Only those image pairs needed for the current batch
are loaded.
:param idx: image pair identifier
:returns: dictionary containing input and output images and their identifier
:rtype: dictionary
"""
while True:
if idx in self.data_dict:
output_img = util.ImageProcessing.load_image(
self.data_dict[idx]['output_img'], normaliser=self.normaliser)
input_img = np.load(self.data_dict[idx]['input_img'])
input_img = input_img / (2**10-1) # change this normalisation
# factor for your data
shape = input_img.shape
input_img = np.clip(input_img, 0, 1)
input_img[np.isnan(input_img)] = 0
seed = random.uniform(0, 10000)
if not self.is_valid:
random.seed(seed) # make a seed with numpy generation
i = random.randint(0, input_img.shape[0]-512) # patch size
# of 512 pixels
j = random.randint(0, input_img.shape[1]-512)
i = i-(i % 2) # ensure on Bayer pattern boundary
j = j-(j % 2)
input_img = input_img[i:(i+512), j:(j+512)]
output_img = output_img[i:(i+512), j:(j+512), :]
return {'input_img': input_img, 'output_img': output_img,
'name': self.data_dict[idx]['input_img'].split("/")[-1]}
class Dataset(torch.utils.data.Dataset):
def __init__(self, data_dict, transform=None, normaliser=2 ** 8 - 1, is_valid=False, is_inference=False):
"""Initialisation for the Dataset object
:param data_dict: dictionary of dictionaries containing images
:param transform: PyTorch image transformations to apply to the images
:returns: N/A
:rtype: N/A
"""
self.transform = transform
self.data_dict = data_dict
self.normaliser = normaliser
self.is_valid = is_valid
self.is_inference = is_inference
def __len__(self):
"""Returns the number of images in the dataset
:returns: number of images in the dataset
:rtype: Integer
"""
return (len(self.data_dict.keys()))
def __getitem__(self, idx):
"""Returns a pair of images with the given identifier. This is lazy loading
of data into memory. Only those image pairs needed for the current batch
are loaded.
:param idx: image pair identifier
:returns: dictionary containing input and output images and their identifier
:rtype: dictionary
"""
while True:
if (self.is_inference) or (self.is_valid):
input_img = util.ImageProcessing.load_image(
self.data_dict[idx]['input_img'], normaliser=self.normaliser)
output_img = util.ImageProcessing.load_image(
self.data_dict[idx]['output_img'], normaliser=self.normaliser)
if self.normaliser==1:
input_img = input_img.astype(np.uint8)
output_img = output_img.astype(np.uint8)
input_img = TF.to_pil_image(input_img)
input_img = TF.to_tensor(input_img)
output_img = TF.to_pil_image(output_img)
output_img = TF.to_tensor(output_img)
if input_img.shape[1]==output_img.shape[2]:
output_img=output_img.permute(0,2,1)
return {'input_img': input_img, 'output_img': output_img,
'name': self.data_dict[idx]['input_img'].split("/")[-1]}
else:
output_img = util.ImageProcessing.load_image(
self.data_dict[idx]['output_img'], normaliser=self.normaliser)
input_img = util.ImageProcessing.load_image(
self.data_dict[idx]['input_img'], normaliser=self.normaliser)
if self.normaliser==1:
input_img = input_img.astype(np.uint8)
output_img = output_img.astype(np.uint8)
input_img = TF.to_pil_image(input_img)
output_img = TF.to_pil_image(output_img)
if not self.is_valid:
# Random horizontal flipping
if random.random() > 0.5:
input_img = TF.hflip(input_img)
output_img = TF.hflip(output_img)
# Random vertical flipping
if random.random() > 0.5:
input_img = TF.vflip(input_img)
output_img = TF.vflip(output_img)
# Random rotation +90
if random.random() > 0.5:
input_img=TF.rotate(input_img,90,expand=True)
output_img=TF.rotate(output_img,90,expand=True)
#input_img.save("./"+self.data_dict[idx]['input_img'].split("/")[-1]+"1.png")
#output_img.save("./"+self.data_dict[idx]['output_img'].split("/")[-1]+"2.png")
# Random rotation -90
if random.random() > 0.5:
input_img=TF.rotate(input_img,-90, expand=True)
output_img=TF.rotate(output_img,-90, expand=True)
# Random rotation -90
if random.random() > 0.5:
input_img=TF.rotate(input_img, 180, expand=True)
output_img=TF.rotate(output_img, 180, expand=True)
#output_img.save("./"+self.data_dict[idx]['output_img'].split("/")[-1]+"2.png")
# Transform to tensor
#print(output_img.shape)
#plt.imsave("./"+self.data_dict[idx]['input_img'].split("/")[-1]+".png", output_img,format='png')
input_img = TF.to_tensor(input_img)
output_img = TF.to_tensor(output_img)
return {'input_img': input_img, 'output_img': output_img,
'name': self.data_dict[idx]['input_img'].split("/")[-1]}
class DataLoader():
def __init__(self, data_dirpath, img_ids_filepath):
"""Initialisation function for the data loader
:param data_dirpath: directory containing the data
:param img_ids_filepath: file containing the ids of the images to load
:returns: N/A
:rtype: N/A
"""
self.data_dirpath = data_dirpath
self.img_ids_filepath = img_ids_filepath
@abstractmethod
def load_data(self):
"""Abstract function for the data loader class
:returns: N/A
:rtype: N/A
"""
pass
@abstractmethod
def perform_inference(self, net, data_dirpath):
"""Abstract function for the data loader class
:returns: N/A
:rtype: N/A
"""
pass
class Adobe5kDataLoader(DataLoader):
def __init__(self, data_dirpath, img_ids_filepath):
"""Initialisation function for the data loader
:param data_dirpath: directory containing the data
:param img_ids_filepath: file containing the ids of the images to load
:returns: N/A
:rtype: N/A
"""
super().__init__(data_dirpath, img_ids_filepath)
self.data_dict = defaultdict(dict)
def load_data(self):
""" Loads the Samsung image data into a Python dictionary
:returns: Python two-level dictionary containing the images
:rtype: Dictionary of dictionaries
"""
logging.info("Loading Adobe5k dataset ...")
with open(self.img_ids_filepath) as f:
'''
Load the image ids into a list data structure
'''
image_ids = f.readlines()
# you may also want to remove whitespace characters like `\n` at the end of each line
image_ids_list = [x.rstrip() for x in image_ids]
idx = 0
idx_tmp = 0
img_id_to_idx_dict = {}
for root, dirs, files in os.walk(self.data_dirpath):
for file in files:
img_id = file.split("-")[0]
is_id_in_list = False
for img_id_test in image_ids_list:
if img_id_test == img_id:
is_id_in_list = True
break
if is_id_in_list: # check that the image is a member of the appropriate training/test/validation split
if not img_id in img_id_to_idx_dict.keys():
img_id_to_idx_dict[img_id] = idx
self.data_dict[idx] = {}
self.data_dict[idx]['input_img'] = None
self.data_dict[idx]['output_img'] = None
idx_tmp = idx
idx += 1
else:
idx_tmp = img_id_to_idx_dict[img_id]
if "input" in root: # change this to the name of your
# input data folder
input_img_filepath = file
self.data_dict[idx_tmp]['input_img'] = root + \
"/" + input_img_filepath
elif ("output" in root): # change this to the name of your
# output data folder
output_img_filepath = file
self.data_dict[idx_tmp]['output_img'] = root + \
"/" + output_img_filepath
else:
logging.debug("Excluding file with id: " + str(img_id))
for idx, imgs in self.data_dict.items():
assert ('input_img' in imgs)
assert ('output_img' in imgs)
return self.data_dict
'''
This data loading class only works for the Samsung S7 dataset. You will need to
edit this class to handle a new dataset.
'''
class SamsungDataLoader(DataLoader):
def __init__(self, data_dirpath, img_ids_filepath):
"""Initialisation function for the data loader
:param data_dirpath: directory containing the data
:param img_ids_filepath: file containing the ids of the images to load
:returns: N/A
:rtype: N/A
"""
super().__init__(data_dirpath, img_ids_filepath)
self.data_dict = defaultdict(dict)
def load_data(self):
""" Loads the Samsung image data into a Python dictionary
:returns: Python two-level dictionary containing the images
:rtype: Dictionary of dictionaries
"""
logging.info("Loading Samsung dataset ...")
with open(self.img_ids_filepath) as f:
'''
Load the image ids into a list data structure
'''
image_ids = f.readlines()
# you may also want to remove whitespace characters like `\n` at the end of each line
image_ids_list = [x.rstrip() for x in image_ids]
idx = 0
idx_tmp = 0
img_id_to_idx_dict = {}
for root, dirs, files in os.walk(self.data_dirpath):
for file in files:
if "medium" in file:
img_id = file.split("-medium")[0]
else:
img_id = file.split("-short")[0]
is_id_in_list = False
for img_id_test in image_ids_list:
if img_id_test == img_id:
is_id_in_list = True
break
if is_id_in_list: # check that the image is a member of the appropriate training/test/validation split
if not img_id in img_id_to_idx_dict.keys():
img_id_to_idx_dict[img_id] = idx
self.data_dict[idx] = {}
self.data_dict[idx]['input_img'] = None
self.data_dict[idx]['output_img'] = None
idx_tmp = idx
idx += 1
else:
idx_tmp = img_id_to_idx_dict[img_id]
if "medium_input" in root: # change medium_input to match
# name of your data input subdirectory
input_img_filepath = file
if file.endswith(".dng"):
if not os.path.isfile(root+"/"+input_img_filepath.split(".")[0]+".npy"):
raw_img = rawpy.imread(
root+"/"+input_img_filepath)
np.save(root+"/"+input_img_filepath.split(".")
[0]+".npy", raw_img.raw_image)
self.data_dict[idx_tmp]['input_img'] = root + \
"/"+input_img_filepath.split(".")[0]+".npy"
elif ("output" in root): # change output to match name of
# your data groundtruth subdirectory
if (file.endswith(".jpg")) and (not file.endswith(".proc.jpg")):
'''
The target images are rgb format.
'''
output_img_filepath = root + "/" + file
if not os.path.isfile(output_img_filepath+".proc.jpg"):
output_img = ImageProcessing.load_image(
output_img_filepath, normaliser=2**8-1)
plt.imsave(output_img_filepath +
".proc.jpg", output_img)
self.data_dict[idx_tmp]['output_img'] = output_img_filepath+".proc.jpg"
else:
logging.debug("Excluding file with id: " + str(img_id))
for idx, imgs in self.data_dict.items():
assert('input_img' in imgs)
assert('output_img' in imgs)
return self.data_dict
| 36.655963
| 120
| 0.535227
| 1,872
| 15,982
| 4.358974
| 0.144231
| 0.063725
| 0.052941
| 0.042279
| 0.770466
| 0.749755
| 0.726961
| 0.709681
| 0.68701
| 0.6625
| 0
| 0.013505
| 0.374546
| 15,982
| 435
| 121
| 36.74023
| 0.802821
| 0.231886
| 0
| 0.624413
| 0
| 0
| 0.043256
| 0
| 0
| 0
| 0
| 0
| 0.018779
| 1
| 0.061033
| false
| 0.00939
| 0.061033
| 0
| 0.178404
| 0.004695
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
472179ed6293f80ea764f1dd8cfda7889a2ac59f
| 84
|
py
|
Python
|
number_parser/__init__.py
|
bsekiewicz/number-parser
|
8367865ed29a9b221809aed0aa40963361709c0d
|
[
"BSD-3-Clause"
] | 44
|
2020-09-03T17:35:21.000Z
|
2022-02-19T20:47:10.000Z
|
number_parser/__init__.py
|
bsekiewicz/number-parser
|
8367865ed29a9b221809aed0aa40963361709c0d
|
[
"BSD-3-Clause"
] | 32
|
2020-06-03T05:17:10.000Z
|
2020-08-26T09:43:49.000Z
|
number_parser/__init__.py
|
bsekiewicz/number-parser
|
8367865ed29a9b221809aed0aa40963361709c0d
|
[
"BSD-3-Clause"
] | 15
|
2020-10-16T16:11:37.000Z
|
2022-01-11T03:18:02.000Z
|
from number_parser.parser import parse, parse_number, parse_ordinal, parse_fraction
| 42
| 83
| 0.869048
| 12
| 84
| 5.75
| 0.583333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.083333
| 84
| 1
| 84
| 84
| 0.896104
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
5b29a6b8c00a0b2bfed3070c4c07a989ef82f96c
| 321
|
py
|
Python
|
utils/utils.py
|
EMBEDDIA/multilingual_entity_linking
|
9042259dd72ae85d94a460a981e9716df4eac203
|
[
"Apache-2.0"
] | null | null | null |
utils/utils.py
|
EMBEDDIA/multilingual_entity_linking
|
9042259dd72ae85d94a460a981e9716df4eac203
|
[
"Apache-2.0"
] | 2
|
2021-04-20T13:30:09.000Z
|
2021-05-03T14:24:06.000Z
|
utils/utils.py
|
EMBEDDIA/multilingual_entity_linking
|
9042259dd72ae85d94a460a981e9716df4eac203
|
[
"Apache-2.0"
] | null | null | null |
def string_starts(s, m):
return s[:len(m)] == m
def split_sentence_in_words(s):
return s.split()
def modify_uppercase_phrase(s):
if s == s.upper():
words = split_sentence_in_words( s.lower() )
res = [ w.capitalize() for w in words ]
return ' '.join( res )
else:
return s
| 22.928571
| 52
| 0.58567
| 48
| 321
| 3.729167
| 0.479167
| 0.117318
| 0.167598
| 0.223464
| 0.234637
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.277259
| 321
| 13
| 53
| 24.692308
| 0.771552
| 0
| 0
| 0
| 0
| 0
| 0.003115
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.272727
| false
| 0
| 0
| 0.181818
| 0.636364
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
5b43642d7a30c2e3281ae526db61aea821cfc38d
| 38
|
py
|
Python
|
foiamachine/local/lib/python2.7/encodings/cp1026.py
|
dwillis/foiamachine
|
26d3b02870227696cdaab639c39d47b2a7a42ae5
|
[
"Unlicense",
"MIT"
] | 3
|
2021-08-07T04:01:55.000Z
|
2021-08-07T05:12:11.000Z
|
foiamachine/local/lib/python2.7/encodings/cp1026.py
|
dwillis/foiamachine
|
26d3b02870227696cdaab639c39d47b2a7a42ae5
|
[
"Unlicense",
"MIT"
] | null | null | null |
foiamachine/local/lib/python2.7/encodings/cp1026.py
|
dwillis/foiamachine
|
26d3b02870227696cdaab639c39d47b2a7a42ae5
|
[
"Unlicense",
"MIT"
] | 1
|
2021-08-05T22:51:14.000Z
|
2021-08-05T22:51:14.000Z
|
/usr/lib/python2.7/encodings/cp1026.py
| 38
| 38
| 0.815789
| 7
| 38
| 4.428571
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.157895
| 0
| 38
| 1
| 38
| 38
| 0.657895
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
5b43c14b4cbbb327435c994eaa330408408dcaeb
| 27,971
|
py
|
Python
|
scrapi/harvesters/mit.py
|
wearpants/scrapi
|
b1619a1212d9fc7e1f2247336fc2e4a3d453a4bb
|
[
"Apache-2.0"
] | 34
|
2015-10-06T20:08:43.000Z
|
2022-03-16T12:46:24.000Z
|
scrapi/harvesters/mit.py
|
jgw4sq/twilio
|
796e97dc6a8fdb8983fd736b328ad907bb1ff73e
|
[
"Apache-2.0"
] | 100
|
2015-09-10T19:57:32.000Z
|
2016-06-22T03:09:51.000Z
|
scrapi/harvesters/mit.py
|
jgw4sq/twilio
|
796e97dc6a8fdb8983fd736b328ad907bb1ff73e
|
[
"Apache-2.0"
] | 32
|
2015-09-09T21:28:54.000Z
|
2019-05-09T03:18:02.000Z
|
"""Harvests MIT DSpace metadata for ingestion into the SHARE service
More information available here:
https://github.com/CenterForOpenScience/SHARE/blob/master/providers/edu.mit.md
Example metadata URL: http://dspace.mit.edu/oai/request?verb=ListRecords&metadataPrefix=oai_dc&from=2014-09-28
"""
from __future__ import unicode_literals
from scrapi.base import OAIHarvester
class MITHarvester(OAIHarvester):
short_name = 'mit'
long_name = 'DSpace@MIT'
url = 'http://dspace.mit.edu/'
base_url = 'http://dspace.mit.edu/oai/request'
property_list = [
'type', 'source', 'format', 'rights', 'identifier',
'relation', 'date', 'description', 'setSpec'
]
@property
def approved_sets(self):
return [
'hdl_1721.1_18193',
'hdl_1721.1_18194',
'hdl_1721.1_18195',
'hdl_1721.1_89012',
'hdl_1721.1_3650',
'hdl_1721.1_67473',
'hdl_1721.1_7630',
'hdl_1721.1_7760',
'hdl_1721.1_7744',
'hdl_1721.1_7768',
'hdl_1721.1_7767',
'hdl_1721.1_7631',
'hdl_1721.1_7766',
'hdl_1721.1_7632',
'hdl_1721.1_50867',
'hdl_1721.1_37333',
'hdl_1721.1_37334',
'hdl_1721.1_5460',
'hdl_1721.1_5461',
'hdl_1721.1_39813',
'hdl_1721.1_7771',
'hdl_1721.1_7634',
'hdl_1721.1_7635',
'hdl_1721.1_7772',
'hdl_1721.1_7633',
'hdl_1721.1_7765',
'hdl_1721.1_79695',
'hdl_1721.1_18236',
'hdl_1721.1_18237',
'hdl_1721.1_18238',
'hdl_1721.1_7626',
'hdl_1721.1_7755',
'hdl_1721.1_7770',
'hdl_1721.1_7627',
'hdl_1721.1_7756',
'hdl_1721.1_7628',
'hdl_1721.1_7629',
'hdl_1721.1_7769',
'hdl_1721.1_7784',
'hdl_1721.1_7636',
'hdl_1721.1_7591',
'hdl_1721.1_7785',
'hdl_1721.1_7592',
'hdl_1721.1_7783',
'hdl_1721.1_7352',
'hdl_1721.1_7780',
'hdl_1721.1_7637',
'hdl_1721.1_7781',
'hdl_1721.1_7638',
'hdl_1721.1_7639',
'hdl_1721.1_7779',
'hdl_1721.1_88072',
'hdl_1721.1_81425',
'hdl_1721.1_5462',
'hdl_1721.1_88531',
'hdl_1721.1_35731',
'hdl_1721.1_7641',
'hdl_1721.1_7789',
'hdl_1721.1_7791',
'hdl_1721.1_7643',
'hdl_1721.1_7642',
'hdl_1721.1_7790',
'hdl_1721.1_7640',
'hdl_1721.1_7788',
'hdl_1721.1_7644',
'hdl_1721.1_7795',
'hdl_1721.1_7645',
'hdl_1721.1_7796',
'hdl_1721.1_7646',
'hdl_1721.1_7794',
'hdl_1721.1_88516',
'hdl_1721.1_7934',
'hdl_1721.1_7648',
'hdl_1721.1_7800',
'hdl_1721.1_7801',
'hdl_1721.1_7649',
'hdl_1721.1_7652',
'hdl_1721.1_7802',
'hdl_1721.1_7653',
'hdl_1721.1_7799',
'hdl_1721.1_18186',
'hdl_1721.1_39096',
'hdl_1721.1_39099',
'hdl_1721.1_39100',
'hdl_1721.1_39097',
'hdl_1721.1_72924',
'hdl_1721.1_72923',
'hdl_1721.1_54823',
'hdl_1721.1_54828',
'hdl_1721.1_35730',
'hdl_1721.1_35732',
'hdl_1721.1_39117',
'hdl_1721.1_39115',
'hdl_1721.1_3651',
'hdl_1721.1_85979',
'hdl_1721.1_88006',
'hdl_1721.1_1779',
'hdl_1721.1_29807',
'hdl_1721.1_29808',
'hdl_1721.1_1778',
'hdl_1721.1_18187',
'hdl_1721.1_55346',
'hdl_1721.1_55382',
'hdl_1721.1_71743',
'hdl_1721.1_55383',
'hdl_1721.1_88179',
'hdl_1721.1_1780',
'hdl_1721.1_3765',
'hdl_1721.1_30597',
'hdl_1721.1_41529',
'hdl_1721.1_7806',
'hdl_1721.1_7655',
'hdl_1721.1_7807',
'hdl_1721.1_7656',
'hdl_1721.1_7654',
'hdl_1721.1_7805',
'hdl_1721.1_7657',
'hdl_1721.1_7811',
'hdl_1721.1_7658',
'hdl_1721.1_7812',
'hdl_1721.1_7810',
'hdl_1721.1_7659',
'hdl_1721.1_83579',
'hdl_1721.1_3766',
'hdl_1721.1_7816',
'hdl_1721.1_7661',
'hdl_1721.1_7818',
'hdl_1721.1_7662',
'hdl_1721.1_7663',
'hdl_1721.1_7817',
'hdl_1721.1_7660',
'hdl_1721.1_7815',
'hdl_1721.1_7886',
'hdl_1721.1_7709',
'hdl_1721.1_7711',
'hdl_1721.1_7887',
'hdl_1721.1_7710',
'hdl_1721.1_7888',
'hdl_1721.1_7885',
'hdl_1721.1_7708',
'hdl_1721.1_67705',
'hdl_1721.1_83560',
'hdl_1721.1_67903',
'hdl_1721.1_1781',
'hdl_1721.1_68162',
'hdl_1721.1_34284',
'hdl_1721.1_34283',
'hdl_1721.1_46718',
'hdl_1721.1_79432',
'hdl_1721.1_7714',
'hdl_1721.1_7892',
'hdl_1721.1_7893',
'hdl_1721.1_7715',
'hdl_1721.1_7891',
'hdl_1721.1_7712',
'hdl_1721.1_61396',
'hdl_1721.1_3652',
'hdl_1721.1_5551',
'hdl_1721.1_6750',
'hdl_1721.1_6751',
'hdl_1721.1_7624',
'hdl_1721.1_33950',
'hdl_1721.1_7666',
'hdl_1721.1_7822',
'hdl_1721.1_7667',
'hdl_1721.1_7823',
'hdl_1721.1_7821',
'hdl_1721.1_7665',
'hdl_1721.1_34286',
'hdl_1721.1_34285',
'hdl_1721.1_3767',
'hdl_1721.1_3768',
'hdl_1721.1_3769',
'hdl_1721.1_3653',
'hdl_1721.1_7671',
'hdl_1721.1_7827',
'hdl_1721.1_7828',
'hdl_1721.1_7672',
'hdl_1721.1_7826',
'hdl_1721.1_7670',
'hdl_1721.1_1782',
'hdl_1721.1_3550',
'hdl_1721.1_7353',
'hdl_1721.1_39119',
'hdl_1721.1_1784',
'hdl_1721.1_29811',
'hdl_1721.1_29812',
'hdl_1721.1_55347',
'hdl_1721.1_1785',
'hdl_1721.1_1786',
'hdl_1721.1_88005',
'hdl_1721.1_60280',
'hdl_1721.1_1783',
'hdl_1721.1_7833',
'hdl_1721.1_7674',
'hdl_1721.1_7834',
'hdl_1721.1_7675',
'hdl_1721.1_7832',
'hdl_1721.1_7673',
'hdl_1721.1_29814',
'hdl_1721.1_7729',
'hdl_1721.1_7918',
'hdl_1721.1_7730',
'hdl_1721.1_7919',
'hdl_1721.1_7917',
'hdl_1721.1_7728',
'hdl_1721.1_35733',
'hdl_1721.1_29796',
'hdl_1721.1_7509',
'hdl_1721.1_7678',
'hdl_1721.1_7838',
'hdl_1721.1_7839',
'hdl_1721.1_7679',
'hdl_1721.1_7840',
'hdl_1721.1_7677',
'hdl_1721.1_7676',
'hdl_1721.1_7837',
'hdl_1721.1_1788',
'hdl_1721.1_7844',
'hdl_1721.1_7681',
'hdl_1721.1_7682',
'hdl_1721.1_7845',
'hdl_1721.1_7680',
'hdl_1721.1_7843',
'hdl_1721.1_37287',
'hdl_1721.1_7849',
'hdl_1721.1_7686',
'hdl_1721.1_7685',
'hdl_1721.1_7851',
'hdl_1721.1_7684',
'hdl_1721.1_7850',
'hdl_1721.1_7848',
'hdl_1721.1_7683',
'hdl_1721.1_7717',
'hdl_1721.1_7899',
'hdl_1721.1_7900',
'hdl_1721.1_7718',
'hdl_1721.1_7716',
'hdl_1721.1_7898',
'hdl_1721.1_81436',
'hdl_1721.1_63243',
'hdl_1721.1_7532',
'hdl_1721.1_18116',
'hdl_1721.1_49433',
'hdl_1721.1_1787',
'hdl_1721.1_5539',
'hdl_1721.1_7295',
'hdl_1721.1_7296',
'hdl_1721.1_3654',
'hdl_1721.1_18239',
'hdl_1721.1_88182',
'hdl_1721.1_88019',
'hdl_1721.1_83516',
'hdl_1721.1_76749',
'hdl_1721.1_67476',
'hdl_1721.1_7855',
'hdl_1721.1_7688',
'hdl_1721.1_7857',
'hdl_1721.1_7690',
'hdl_1721.1_7689',
'hdl_1721.1_7856',
'hdl_1721.1_7687',
'hdl_1721.1_7854',
'hdl_1721.1_67474',
'hdl_1721.1_67477',
'hdl_1721.1_67475',
'hdl_1721.1_7692',
'hdl_1721.1_7861',
'hdl_1721.1_1789',
'hdl_1721.1_7863',
'hdl_1721.1_7694',
'hdl_1721.1_7693',
'hdl_1721.1_7862',
'hdl_1721.1_7691',
'hdl_1721.1_7860',
'hdl_1721.1_7904',
'hdl_1721.1_7721',
'hdl_1721.1_5067',
'hdl_1721.1_7720',
'hdl_1721.1_7905',
'hdl_1721.1_7719',
'hdl_1721.1_7903',
'hdl_1721.1_3774',
'hdl_1721.1_7356',
'hdl_1721.1_7357',
'hdl_1721.1_85978',
'hdl_1721.1_16560',
'hdl_1721.1_16547',
'hdl_1721.1_16556',
'hdl_1721.1_16552',
'hdl_1721.1_16564',
'hdl_1721.1_7696',
'hdl_1721.1_7867',
'hdl_1721.1_7868',
'hdl_1721.1_7697',
'hdl_1721.1_7866',
'hdl_1721.1_7695',
'hdl_1721.1_3770',
'hdl_1721.1_32548',
'hdl_1721.1_7871',
'hdl_1721.1_7700',
'hdl_1721.1_7699',
'hdl_1721.1_7872',
'hdl_1721.1_7870',
'hdl_1721.1_7698',
'hdl_1721.1_89476',
'hdl_1721.1_88073',
'hdl_1721.1_80741',
'hdl_1721.1_16553',
'hdl_1721.1_16548',
'hdl_1721.1_16557',
'hdl_1721.1_16565',
'hdl_1721.1_16561',
'hdl_1721.1_80814',
'hdl_1721.1_88074',
'hdl_1721.1_54831',
'hdl_1721.1_54825',
'hdl_1721.1_39103',
'hdl_1721.1_39111',
'hdl_1721.1_39112',
'hdl_1721.1_39104',
'hdl_1721.1_1790',
'hdl_1721.1_1791',
'hdl_1721.1_5435',
'hdl_1721.1_55385',
'hdl_1721.1_18157',
'hdl_1721.1_86180',
'hdl_1721.1_26678',
'hdl_1721.1_18165',
'hdl_1721.1_30600',
'hdl_1721.1_18163',
'hdl_1721.1_18228',
'hdl_1721.1_26584',
'hdl_1721.1_26672',
'hdl_1721.1_18161',
'hdl_1721.1_18217',
'hdl_1721.1_26399',
'hdl_1721.1_18213',
'hdl_1721.1_26401',
'hdl_1721.1_18155',
'hdl_1721.1_18159',
'hdl_1721.1_18897',
'hdl_1721.1_45562',
'hdl_1721.1_5436',
'hdl_1721.1_5529',
'hdl_1721.1_5530',
'hdl_1721.1_32529',
'hdl_1721.1_18111',
'hdl_1721.1_5531',
'hdl_1721.1_18107',
'hdl_1721.1_18168',
'hdl_1721.1_5444',
'hdl_1721.1_5443',
'hdl_1721.1_18105',
'hdl_1721.1_18109',
'hdl_1721.1_34016',
'hdl_1721.1_62236',
'hdl_1721.1_5437',
'hdl_1721.1_18078',
'hdl_1721.1_18076',
'hdl_1721.1_18169',
'hdl_1721.1_18080',
'hdl_1721.1_18106',
'hdl_1721.1_18108',
'hdl_1721.1_18110',
'hdl_1721.1_18112',
'hdl_1721.1_32530',
'hdl_1721.1_18079',
'hdl_1721.1_18077',
'hdl_1721.1_70033',
'hdl_1721.1_67478',
'hdl_1721.1_16558',
'hdl_1721.1_16554',
'hdl_1721.1_16546',
'hdl_1721.1_16562',
'hdl_1721.1_16550',
'hdl_1721.1_83528',
'hdl_1721.1_88075',
'hdl_1721.1_43714',
'hdl_1721.1_88076',
'hdl_1721.1_83613',
'hdl_1721.1_41896',
'hdl_1721.1_88000',
'hdl_1721.1_18216',
'hdl_1721.1_18212',
'hdl_1721.1_18227',
'hdl_1721.1_26677',
'hdl_1721.1_26583',
'hdl_1721.1_26673',
'hdl_1721.1_18892',
'hdl_1721.1_87999',
'hdl_1721.1_49817',
'hdl_1721.1_49830',
'hdl_1721.1_50644',
'hdl_1721.1_50655',
'hdl_1721.1_50666',
'hdl_1721.1_50676',
'hdl_1721.1_50686',
'hdl_1721.1_50716',
'hdl_1721.1_50726',
'hdl_1721.1_50740',
'hdl_1721.1_50761',
'hdl_1721.1_50763',
'hdl_1721.1_50793',
'hdl_1721.1_50794',
'hdl_1721.1_50823',
'hdl_1721.1_50838',
'hdl_1721.1_50852',
'hdl_1721.1_50869',
'hdl_1721.1_50883',
'hdl_1721.1_50898',
'hdl_1721.1_50913',
'hdl_1721.1_50914',
'hdl_1721.1_50915',
'hdl_1721.1_50916',
'hdl_1721.1_50917',
'hdl_1721.1_51010',
'hdl_1721.1_51011',
'hdl_1721.1_51073',
'hdl_1721.1_51074',
'hdl_1721.1_51075',
'hdl_1721.1_51122',
'hdl_1721.1_51138',
'hdl_1721.1_51139',
'hdl_1721.1_51189',
'hdl_1721.1_51190',
'hdl_1721.1_51236',
'hdl_1721.1_51237',
'hdl_1721.1_51238',
'hdl_1721.1_51239',
'hdl_1721.1_51900',
'hdl_1721.1_51928',
'hdl_1721.1_51952',
'hdl_1721.1_51976',
'hdl_1721.1_52013',
'hdl_1721.1_52041',
'hdl_1721.1_52068',
'hdl_1721.1_52095',
'hdl_1721.1_52117',
'hdl_1721.1_52145',
'hdl_1721.1_52168',
'hdl_1721.1_52189',
'hdl_1721.1_52212',
'hdl_1721.1_52245',
'hdl_1721.1_52274',
'hdl_1721.1_53335',
'hdl_1721.1_53355',
'hdl_1721.1_53386',
'hdl_1721.1_53418',
'hdl_1721.1_53448',
'hdl_1721.1_53474',
'hdl_1721.1_53510',
'hdl_1721.1_53587',
'hdl_1721.1_53612',
'hdl_1721.1_53635',
'hdl_1721.1_53674',
'hdl_1721.1_53751',
'hdl_1721.1_53779',
'hdl_1721.1_53806',
'hdl_1721.1_53845',
'hdl_1721.1_53869',
'hdl_1721.1_53899',
'hdl_1721.1_53923',
'hdl_1721.1_53955',
'hdl_1721.1_53988',
'hdl_1721.1_54016',
'hdl_1721.1_54038',
'hdl_1721.1_55589',
'hdl_1721.1_54105',
'hdl_1721.1_54130',
'hdl_1721.1_54154',
'hdl_1721.1_55434',
'hdl_1721.1_55460',
'hdl_1721.1_55490',
'hdl_1721.1_55512',
'hdl_1721.1_55553',
'hdl_1721.1_55617',
'hdl_1721.1_55651',
'hdl_1721.1_55672',
'hdl_1721.1_55714',
'hdl_1721.1_55747',
'hdl_1721.1_55775',
'hdl_1721.1_55817',
'hdl_1721.1_55852',
'hdl_1721.1_55870',
'hdl_1721.1_56010',
'hdl_1721.1_56030',
'hdl_1721.1_56066',
'hdl_1721.1_56089',
'hdl_1721.1_56109',
'hdl_1721.1_56128',
'hdl_1721.1_56161',
'hdl_1721.1_56182',
'hdl_1721.1_56201',
'hdl_1721.1_56220',
'hdl_1721.1_56265',
'hdl_1721.1_56266',
'hdl_1721.1_56267',
'hdl_1721.1_56345',
'hdl_1721.1_56375',
'hdl_1721.1_56393',
'hdl_1721.1_56412',
'hdl_1721.1_56431',
'hdl_1721.1_56458',
'hdl_1721.1_56479',
'hdl_1721.1_56505',
'hdl_1721.1_56533',
'hdl_1721.1_56582',
'hdl_1721.1_56610',
'hdl_1721.1_56635',
'hdl_1721.1_56676',
'hdl_1721.1_56715',
'hdl_1721.1_56751',
'hdl_1721.1_56746',
'hdl_1721.1_56732',
'hdl_1721.1_56717',
'hdl_1721.1_56716',
'hdl_1721.1_56714',
'hdl_1721.1_56708',
'hdl_1721.1_56692',
'hdl_1721.1_56679',
'hdl_1721.1_56678',
'hdl_1721.1_56675',
'hdl_1721.1_56674',
'hdl_1721.1_56673',
'hdl_1721.1_56672',
'hdl_1721.1_56661',
'hdl_1721.1_56647',
'hdl_1721.1_56644',
'hdl_1721.1_56638',
'hdl_1721.1_56637',
'hdl_1721.1_4059',
'hdl_1721.1_5552',
'hdl_1721.1_7727',
'hdl_1721.1_7726',
'hdl_1721.1_7725',
'hdl_1721.1_7914',
'hdl_1721.1_7915',
'hdl_1721.1_7913',
'hdl_1721.1_46333',
'hdl_1721.1_76637',
'hdl_1721.1_46704',
'hdl_1721.1_85574',
'hdl_1721.1_62800',
'hdl_1721.1_65423',
'hdl_1721.1_40283',
'hdl_1721.1_16551',
'hdl_1721.1_16545',
'hdl_1721.1_16555',
'hdl_1721.1_16559',
'hdl_1721.1_16563',
'hdl_1721.1_70040',
'hdl_1721.1_37288',
'hdl_1721.1_1792',
'hdl_1721.1_18188',
'hdl_1721.1_53733',
'hdl_1721.1_76638',
'hdl_1721.1_88003',
'hdl_1721.1_7923',
'hdl_1721.1_7740',
'hdl_1721.1_7739',
'hdl_1721.1_7924',
'hdl_1721.1_7922',
'hdl_1721.1_7738',
'hdl_1721.1_87998',
'hdl_1721.1_65424',
'hdl_1721.1_76639',
'hdl_1721.1_29797',
'hdl_1721.1_76745',
'hdl_1721.1_1793',
'hdl_1721.1_7743',
'hdl_1721.1_7928',
'hdl_1721.1_7742',
'hdl_1721.1_7929',
'hdl_1721.1_7927',
'hdl_1721.1_7741',
'hdl_1721.1_55584',
'hdl_1721.1_55916',
'hdl_1721.1_42001',
'hdl_1721.1_26585',
'hdl_1721.1_29798',
'hdl_1721.1_18230',
'hdl_1721.1_18899',
'hdl_1721.1_26674',
'hdl_1721.1_18219',
'hdl_1721.1_18215',
'hdl_1721.1_26680',
'hdl_1721.1_80739',
'hdl_1721.1_80746',
'hdl_1721.1_88077',
'hdl_1721.1_18235',
'hdl_1721.1_18225',
'hdl_1721.1_18224',
'hdl_1721.1_55586',
'hdl_1721.1_55719',
'hdl_1721.1_55588',
'hdl_1721.1_78860',
'hdl_1721.1_18226',
'hdl_1721.1_7703',
'hdl_1721.1_7876',
'hdl_1721.1_7877',
'hdl_1721.1_7704',
'hdl_1721.1_7702',
'hdl_1721.1_7875',
'hdl_1721.1_16459',
'hdl_1721.1_18240',
'hdl_1721.1_7358',
'hdl_1721.1_3771',
'hdl_1721.1_33228',
'hdl_1721.1_18229',
'hdl_1721.1_26679',
'hdl_1721.1_80740',
'hdl_1721.1_18898',
'hdl_1721.1_26676',
'hdl_1721.1_18218',
'hdl_1721.1_26586',
'hdl_1721.1_18222',
'hdl_1721.1_88078',
'hdl_1721.1_34010',
'hdl_1721.1_18214',
'hdl_1721.1_81470',
'hdl_1721.1_88079',
'hdl_1721.1_83431',
'hdl_1721.1_52116',
'hdl_1721.1_39118',
'hdl_1721.1_89011',
'hdl_1721.1_50866',
'hdl_1721.1_37332',
'hdl_1721.1_34280',
'hdl_1721.1_5459',
'hdl_1721.1_16538',
'hdl_1721.1_55583',
'hdl_1721.1_87997',
'hdl_1721.1_88181',
'hdl_1721.1_16539',
'hdl_1721.1_7752',
'hdl_1721.1_40282',
'hdl_1721.1_67472',
'hdl_1721.1_88529',
'hdl_1721.1_34009',
'hdl_1721.1_3549',
'hdl_1721.1_55585',
'hdl_1721.1_3764',
'hdl_1721.1_7530',
'hdl_1721.1_18211',
'hdl_1721.1_16165',
'hdl_1721.1_18154',
'hdl_1721.1_26400',
'hdl_1721.1_18203',
'hdl_1721.1_39094',
'hdl_1721.1_54826',
'hdl_1721.1_33227',
'hdl_1721.1_5458',
'hdl_1721.1_16540',
'hdl_1721.1_88071',
'hdl_1721.1_16535',
'hdl_1721.1_29806',
'hdl_1721.1_18118',
'hdl_1721.1_55384',
'hdl_1721.1_18160',
'hdl_1721.1_85573',
'hdl_1721.1_7758',
'hdl_1721.1_7749',
'hdl_1721.1_7761',
'hdl_1721.1_7776',
'hdl_1721.1_7786',
'hdl_1721.1_7792',
'hdl_1721.1_7797',
'hdl_1721.1_7803',
'hdl_1721.1_7808',
'hdl_1721.1_7813',
'hdl_1721.1_7819',
'hdl_1721.1_7824',
'hdl_1721.1_7829',
'hdl_1721.1_7835',
'hdl_1721.1_7841',
'hdl_1721.1_7846',
'hdl_1721.1_7852',
'hdl_1721.1_1774',
'hdl_1721.1_7864',
'hdl_1721.1_5427',
'hdl_1721.1_7873',
'hdl_1721.1_67704',
'hdl_1721.1_7883',
'hdl_1721.1_18204',
'hdl_1721.1_30596',
'hdl_1721.1_46702',
'hdl_1721.1_7507',
'hdl_1721.1_18202',
'hdl_1721.1_67902',
'hdl_1721.1_68161',
'hdl_1721.1_55718',
'hdl_1721.1_55915',
'hdl_1721.1_34282',
'hdl_1721.1_76636',
'hdl_1721.1_7889',
'hdl_1721.1_6749',
'hdl_1721.1_79431',
'hdl_1721.1_61395',
'hdl_1721.1_7932',
'hdl_1721.1_18205',
'hdl_1721.1_46717',
'hdl_1721.1_55587',
'hdl_1721.1_34281',
'hdl_1721.1_18206',
'hdl_1721.1_26398',
'hdl_1721.1_18192',
'hdl_1721.1_1775',
'hdl_1721.1_70032',
'hdl_1721.1_29810',
'hdl_1721.1_80738',
'hdl_1721.1_88180',
'hdl_1721.1_29795',
'hdl_1721.1_18162',
'hdl_1721.1_68160',
'hdl_1721.1_7896',
'hdl_1721.1_18156',
'hdl_1721.1_41894',
'hdl_1721.1_7531',
'hdl_1721.1_7581',
'hdl_1721.1_33971',
'hdl_1721.1_49432',
'hdl_1721.1_33970',
'hdl_1721.1_1776',
'hdl_1721.1_1773',
'hdl_1721.1_7582',
'hdl_1721.1_7294',
'hdl_1721.1_18158',
'hdl_1721.1_30599',
'hdl_1721.1_88018',
'hdl_1721.1_7351',
'hdl_1721.1_70038',
'hdl_1721.1_5066',
'hdl_1721.1_16537',
'hdl_1721.1_7933',
'hdl_1721.1_18167',
'hdl_1721.1_53732',
'hdl_1721.1_41528',
'hdl_1721.1_88004',
'hdl_1721.1_54829',
'hdl_1721.1_39101',
'hdl_1721.1_32547',
'hdl_1721.1_80743',
'hdl_1721.1_29813',
'hdl_1721.1_80745',
'hdl_1721.1_88530',
'hdl_1721.1_18119',
'hdl_1721.1_16536',
'hdl_1721.1_62799',
'hdl_1721.1_18170',
'hdl_1721.1_4058',
'hdl_1721.1_88001',
'hdl_1721.1_49816',
'hdl_1721.1_62234',
'hdl_1721.1_7508',
'hdl_1721.1_33226',
'hdl_1721.1_7911',
'hdl_1721.1_46703',
'hdl_1721.1_18164',
'hdl_1721.1_3649',
'hdl_1721.1_1777',
'hdl_1721.1_16541',
'hdl_1721.1_18117',
'hdl_1721.1_18210',
'hdl_1721.1_45561',
'hdl_1721.1_18201',
'hdl_1721.1_18185',
'hdl_1721.1_7920',
'hdl_1721.1_7925',
'hdl_1721.1_16542',
'hdl_1721.1_55345',
'hdl_1721.1_7759',
'hdl_1721.1_7622',
'hdl_1721.1_7754',
'hdl_1721.1_7782',
'hdl_1721.1_7778',
'hdl_1721.1_7787',
'hdl_1721.1_7793',
'hdl_1721.1_7798',
'hdl_1721.1_39098',
'hdl_1721.1_39095',
'hdl_1721.1_54827',
'hdl_1721.1_54822',
'hdl_1721.1_39116',
'hdl_1721.1_39113',
'hdl_1721.1_7750',
'hdl_1721.1_7621',
'hdl_1721.1_7583',
'hdl_1721.1_7589',
'hdl_1721.1_7593',
'hdl_1721.1_7594',
'hdl_1721.1_7595',
'hdl_1721.1_7596',
'hdl_1721.1_7597',
'hdl_1721.1_7598',
'hdl_1721.1_7599',
'hdl_1721.1_7600',
'hdl_1721.1_7601',
'hdl_1721.1_7602',
'hdl_1721.1_7603',
'hdl_1721.1_7604',
'hdl_1721.1_7605',
'hdl_1721.1_7606',
'hdl_1721.1_7607',
'hdl_1721.1_7608',
'hdl_1721.1_7609',
'hdl_1721.1_7610',
'hdl_1721.1_7804',
'hdl_1721.1_7809',
'hdl_1721.1_7814',
'hdl_1721.1_7884',
'hdl_1721.1_7612',
'hdl_1721.1_7613',
'hdl_1721.1_7890',
'hdl_1721.1_7820',
'hdl_1721.1_7825',
'hdl_1721.1_7830',
'hdl_1721.1_7916',
'hdl_1721.1_7836',
'hdl_1721.1_7842',
'hdl_1721.1_7847',
'hdl_1721.1_7614',
'hdl_1721.1_7897',
'hdl_1721.1_7853',
'hdl_1721.1_7859',
'hdl_1721.1_7902',
'hdl_1721.1_7615',
'hdl_1721.1_7865',
'hdl_1721.1_7869',
'hdl_1721.1_54830',
'hdl_1721.1_54824',
'hdl_1721.1_39110',
'hdl_1721.1_39102',
'hdl_1721.1_7617',
'hdl_1721.1_7912',
'hdl_1721.1_7618',
'hdl_1721.1_7737',
'hdl_1721.1_7921',
'hdl_1721.1_7926',
'hdl_1721.1_7620',
'hdl_1721.1_7874',
'hdl_1721.1_7959',
'hdl_1721.1_65422',
'hdl_1721.1_78859',
'hdl_1721.1_18131',
'hdl_1721.1_89474',
'hdl_1721.1_18209',
'hdl_1721.1_76748',
'hdl_1721.1_46332',
'hdl_1721.1_5432',
'hdl_1721.1_5549',
'hdl_1721.1_18081',
'hdl_1721.1_18082',
'hdl_1721.1_5523',
'hdl_1721.1_34015',
'hdl_1721.1_5524',
'hdl_1721.1_18083',
'hdl_1721.1_18084',
'hdl_1721.1_5442',
'hdl_1721.1_32528',
'hdl_1721.1_5528',
'hdl_1721.1_5431'
]
| 31.357623
| 110
| 0.46777
| 3,541
| 27,971
| 3.205027
| 0.262355
| 0.531677
| 0.607631
| 0.004229
| 0.006785
| 0.005111
| 0.005111
| 0
| 0
| 0
| 0
| 0.496122
| 0.40542
| 27,971
| 891
| 111
| 31.392817
| 0.186279
| 0.010368
| 0
| 0
| 0
| 0
| 0.489449
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.00114
| false
| 0
| 0.002281
| 0.00114
| 0.011403
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
5b6bf6c5b6fc6456914fcb35c83ea3667ae9cba4
| 200
|
py
|
Python
|
aopy/aperture/view.py
|
alexrudy/aopy
|
0242bdc81a10ac1a025e6e4cc447cfe90f16dd33
|
[
"BSD-3-Clause"
] | 3
|
2016-02-05T14:30:21.000Z
|
2020-05-05T11:58:38.000Z
|
aopy/aperture/view.py
|
alexrudy/aopy
|
0242bdc81a10ac1a025e6e4cc447cfe90f16dd33
|
[
"BSD-3-Clause"
] | null | null | null |
aopy/aperture/view.py
|
alexrudy/aopy
|
0242bdc81a10ac1a025e6e4cc447cfe90f16dd33
|
[
"BSD-3-Clause"
] | null | null | null |
# -*- coding: utf-8 -*-
#
# view.py
# aopy
#
# Created by Alexander Rudy on 2014-07-16.
# Copyright 2014 Alexander Rudy. All rights reserved.
#
"""
:mod:`aperture.view`
====================
"""
| 13.333333
| 54
| 0.55
| 24
| 200
| 4.583333
| 0.833333
| 0.236364
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.079755
| 0.185
| 200
| 15
| 55
| 13.333333
| 0.595092
| 0.87
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 1
| 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
| 0
| 0
| 0
| 0
|
0
| 4
|
5b702bf5caa3d556c080cd3e0261f77ab75b396d
| 329
|
py
|
Python
|
mundo3/D109.py
|
KayanOkagawa/Cursoemvideo-Python3-Exercicios
|
10c8386102cc0928f8f090070eb3218deb3d60fe
|
[
"MIT"
] | null | null | null |
mundo3/D109.py
|
KayanOkagawa/Cursoemvideo-Python3-Exercicios
|
10c8386102cc0928f8f090070eb3218deb3d60fe
|
[
"MIT"
] | null | null | null |
mundo3/D109.py
|
KayanOkagawa/Cursoemvideo-Python3-Exercicios
|
10c8386102cc0928f8f090070eb3218deb3d60fe
|
[
"MIT"
] | null | null | null |
from utilidadecv.moeda import moeda
preco = float(input('Digite o Preço: '))
print(f'A Metade de {moeda.metade(preco, show=True)}')
print(f'O Dobro de {moeda.dobro(preco, show=True)}')
print(f'O Aumento de 10%, temos {moeda.aumentar(preco, 10, show=True)}')
print(f'Reduzindo 13%, temos {moeda.diminuir(preco, 13, show=True)}')
| 41.125
| 72
| 0.714286
| 55
| 329
| 4.272727
| 0.454545
| 0.102128
| 0.165957
| 0.178723
| 0.170213
| 0.170213
| 0
| 0
| 0
| 0
| 0
| 0.027211
| 0.106383
| 329
| 7
| 73
| 47
| 0.772109
| 0
| 0
| 0
| 0
| 0
| 0.677812
| 0.133739
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.166667
| 0
| 0.166667
| 0.666667
| 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
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
5b9695289815ebe2c465f83868b09e69d63adc0d
| 84
|
py
|
Python
|
Python180feet/oops/MyNewClass.py
|
parthasarathipandeygcp/gcpade001
|
1c353d48d21d276cc0597e88107f77525518264f
|
[
"Apache-2.0"
] | null | null | null |
Python180feet/oops/MyNewClass.py
|
parthasarathipandeygcp/gcpade001
|
1c353d48d21d276cc0597e88107f77525518264f
|
[
"Apache-2.0"
] | null | null | null |
Python180feet/oops/MyNewClass.py
|
parthasarathipandeygcp/gcpade001
|
1c353d48d21d276cc0597e88107f77525518264f
|
[
"Apache-2.0"
] | null | null | null |
class MyNewClass:
'''This is a docstring. I have created a new class'''
pass
| 28
| 57
| 0.666667
| 13
| 84
| 4.307692
| 0.846154
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.238095
| 84
| 3
| 58
| 28
| 0.875
| 0.559524
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
5b9a91e2bbb7ff14ab9c74d8deab278ea0660f51
| 174
|
py
|
Python
|
vrm/version.py
|
saturday06/VReducer
|
591b40c16ab3ee594637185df9363e2a3c589894
|
[
"MIT"
] | 2
|
2021-10-10T13:27:12.000Z
|
2022-01-04T02:38:54.000Z
|
vrm/version.py
|
saturday06/VReducer
|
591b40c16ab3ee594637185df9363e2a3c589894
|
[
"MIT"
] | null | null | null |
vrm/version.py
|
saturday06/VReducer
|
591b40c16ab3ee594637185df9363e2a3c589894
|
[
"MIT"
] | 1
|
2022-01-04T18:38:10.000Z
|
2022-01-04T18:38:10.000Z
|
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
アプリケーション、バージョン情報
"""
APP_NAME = 'VReducer'
VERSION = '0.2.0'
def app_name():
return '{}-{}'.format(APP_NAME, VERSION)
| 13.384615
| 44
| 0.597701
| 24
| 174
| 4.208333
| 0.75
| 0.207921
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.027211
| 0.155172
| 174
| 12
| 45
| 14.5
| 0.659864
| 0.333333
| 0
| 0
| 0
| 0
| 0.168224
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 0.25
| 0.5
| 0
| 1
| 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
| 1
| 0
| 0
|
0
| 4
|
5bbb688e62bd3f53a6655e0dcc5e772fe55ab1e8
| 100
|
py
|
Python
|
Chapter07/plotly_django_app1/visual_plotly/apps.py
|
allen-zqh/plotly
|
bcaf0930901e77db07245b63bff049eb75893416
|
[
"MIT"
] | null | null | null |
Chapter07/plotly_django_app1/visual_plotly/apps.py
|
allen-zqh/plotly
|
bcaf0930901e77db07245b63bff049eb75893416
|
[
"MIT"
] | null | null | null |
Chapter07/plotly_django_app1/visual_plotly/apps.py
|
allen-zqh/plotly
|
bcaf0930901e77db07245b63bff049eb75893416
|
[
"MIT"
] | 1
|
2021-02-04T06:56:18.000Z
|
2021-02-04T06:56:18.000Z
|
from django.apps import AppConfig
class VisualPlotlyConfig(AppConfig):
name = 'visual_plotly'
| 16.666667
| 36
| 0.78
| 11
| 100
| 7
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.15
| 100
| 5
| 37
| 20
| 0.905882
| 0
| 0
| 0
| 0
| 0
| 0.13
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
5bc95e996cdd1e4d8efa817caaefdff708a14de7
| 2,425
|
py
|
Python
|
device_battery.py
|
dnkorte/linefollower_controller
|
a653f8b7fad6e362037e369ff833d388621811e2
|
[
"MIT"
] | null | null | null |
device_battery.py
|
dnkorte/linefollower_controller
|
a653f8b7fad6e362037e369ff833d388621811e2
|
[
"MIT"
] | null | null | null |
device_battery.py
|
dnkorte/linefollower_controller
|
a653f8b7fad6e362037e369ff833d388621811e2
|
[
"MIT"
] | null | null | null |
"""
# Controller for Line-Following Robot
# This runs on an Adafruit Feather M4, with a MiniTFT board.
# It drives a TB6612 to control 2 DC Motors (in blue servo case)
# and talks over I2C to an ItsyBitsy that interfaces a Pololu
# line following sensor
#
# Author(s): Don Korte
# Module: device_battgery.py reports battery voltages
# This uses the built-in battery-checking connection for the feather
# (as documented at https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51/power-management)
# It also reports voltage on the separate AA cells for motor and line sensor
# For this purpose, Vbatt is connected through a dual 100k resistive divider
# to pin A0 on the feather -- the divider is located in the prototyping area
# on the Feather Doubler board.
#
# Note that for AAA Alkaline batteries, 4.08v is dead, 5.86 is brand new
#
# github: https://github.com/dnkorte/linefollower_controller
#
# MIT License
#
# Copyright (c) 2020 Don Korte
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
"""
import board
from analogio import AnalogIn
class Device_Battery:
def __init__(self):
self.vbat_feather_pin = AnalogIn(board.VOLTAGE_MONITOR)
self.vbat_motor_pin = AnalogIn(board.A0)
def get_vbat_feather(self):
return (self.vbat_feather_pin.value * 3.3) / 65536 * 2
def get_vbat_motor(self):
return (self.vbat_motor_pin.value * 3.3) / 65536 * 2
| 41.101695
| 103
| 0.754639
| 373
| 2,425
| 4.852547
| 0.514745
| 0.048619
| 0.018785
| 0.01989
| 0.01768
| 0.01768
| 0
| 0
| 0
| 0
| 0
| 0.020613
| 0.179794
| 2,425
| 58
| 104
| 41.810345
| 0.889392
| 0.834227
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.3
| false
| 0
| 0.2
| 0.2
| 0.8
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
5be1e836cdcdd3a403d9d7d6bcbfd57d7a283877
| 291
|
py
|
Python
|
artificial_neural_networks/__init__.py
|
kourouklides/artificial_neural_networks
|
c22f80c092481dda4bb219d981e27295d06222b0
|
[
"Apache-2.0"
] | 39
|
2018-08-25T08:04:09.000Z
|
2022-02-23T16:35:42.000Z
|
artificial_neural_networks/__init__.py
|
kourouklides/bayesian_nn
|
c22f80c092481dda4bb219d981e27295d06222b0
|
[
"Apache-2.0"
] | 4
|
2020-04-12T16:07:41.000Z
|
2022-02-10T00:26:37.000Z
|
artificial_neural_networks/__init__.py
|
kourouklides/bayesian_nn
|
c22f80c092481dda4bb219d981e27295d06222b0
|
[
"Apache-2.0"
] | 10
|
2018-08-28T07:04:03.000Z
|
2022-03-28T10:29:01.000Z
|
"""
Author: Ioannis Kourouklides, www.kourouklides.com
License:
https://github.com/kourouklides/artificial_neural_networks/blob/master/LICENSE/
"""
# %%
# IMPORTS
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
| 20.785714
| 87
| 0.766323
| 32
| 291
| 6.46875
| 0.65625
| 0.144928
| 0.231884
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.147766
| 291
| 13
| 88
| 22.384615
| 0.834677
| 0.532646
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0.333333
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
5be7eb785365ccf56fa83513f4a0f4beabee62cf
| 85
|
py
|
Python
|
AI_Web/Astar/apps.py
|
xwy27/ArtificialIntelligenceProjects
|
e2b0154f07d749084e2d670260fa82f8f5ea23ed
|
[
"MIT"
] | 4
|
2018-12-19T14:10:56.000Z
|
2021-07-12T06:05:17.000Z
|
AI_Web/Astar/apps.py
|
xwy27/ArtificialIntelligenceProjects
|
e2b0154f07d749084e2d670260fa82f8f5ea23ed
|
[
"MIT"
] | 1
|
2019-08-06T01:57:41.000Z
|
2019-08-06T01:57:41.000Z
|
AI_Web/Astar/apps.py
|
xwy27/ArtificialIntelligenceProjects
|
e2b0154f07d749084e2d670260fa82f8f5ea23ed
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
class AstarConfig(AppConfig):
name = 'Astar'
| 14.166667
| 33
| 0.741176
| 10
| 85
| 6.3
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.176471
| 85
| 5
| 34
| 17
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0.058824
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
5bebb157eec30c250568b48a5e73c3ecbd0e1a5e
| 216
|
py
|
Python
|
backend/pennclubs/asgi.py
|
pennlabs/penn-clubs
|
6165e56ee5745295adc14fe114c4973173c2cb43
|
[
"MIT"
] | 23
|
2020-01-15T20:11:06.000Z
|
2022-01-01T12:47:50.000Z
|
backend/pennclubs/asgi.py
|
pennlabs/penn-clubs
|
6165e56ee5745295adc14fe114c4973173c2cb43
|
[
"MIT"
] | 397
|
2020-01-17T03:42:30.000Z
|
2022-03-07T23:37:16.000Z
|
backend/pennclubs/asgi.py
|
pennlabs/penn-clubs
|
6165e56ee5745295adc14fe114c4973173c2cb43
|
[
"MIT"
] | 7
|
2020-01-29T05:11:38.000Z
|
2022-01-03T19:41:59.000Z
|
import os
import django
from channels.routing import get_default_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pennclubs.settings.production")
django.setup()
application = get_default_application()
| 21.6
| 80
| 0.837963
| 26
| 216
| 6.730769
| 0.615385
| 0.114286
| 0.24
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.078704
| 216
| 9
| 81
| 24
| 0.879397
| 0
| 0
| 0
| 0
| 0
| 0.236111
| 0.236111
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
750386cbb9a46549ffa9853a246a3d355a67807b
| 263
|
py
|
Python
|
tests/ex21_tests.py
|
gravyboat/python-exercises
|
50162a9e6f3d51fbb2c15ed08fcecba810d61338
|
[
"MIT"
] | null | null | null |
tests/ex21_tests.py
|
gravyboat/python-exercises
|
50162a9e6f3d51fbb2c15ed08fcecba810d61338
|
[
"MIT"
] | null | null | null |
tests/ex21_tests.py
|
gravyboat/python-exercises
|
50162a9e6f3d51fbb2c15ed08fcecba810d61338
|
[
"MIT"
] | null | null | null |
from nose.tools import *
from exercises import ex21
def test_char_freq():
'''
Check to make sure our translation is accurate
'''
test_char_freq_dict = ex21.char_freq('aaaabbbcc')
assert_equal(test_char_freq_dict, {'a': 4, 'b': 3, 'c': 2})
| 20.230769
| 63
| 0.669202
| 40
| 263
| 4.15
| 0.7
| 0.192771
| 0.216867
| 0.192771
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.033493
| 0.205323
| 263
| 12
| 64
| 21.916667
| 0.760766
| 0.174905
| 0
| 0
| 0
| 0
| 0.06
| 0
| 0
| 0
| 0
| 0
| 0.2
| 1
| 0.2
| false
| 0
| 0.4
| 0
| 0.6
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
751480f28e5ee76b1abb4bb840862d9ec96ec708
| 98
|
py
|
Python
|
toki/[Versi Lama] Training Gate TOKI Learning Center/Bab 1. Pengenalan/1B. Percabangan/E.py
|
andraantariksa/code-exercise-answer
|
69b7dbdc081cdb094cb110a72bc0c9242d3d344d
|
[
"MIT"
] | 1
|
2019-11-06T15:17:48.000Z
|
2019-11-06T15:17:48.000Z
|
toki/[Versi Lama] Training Gate TOKI Learning Center/Bab 1. Pengenalan/1B. Percabangan/E.py
|
andraantariksa/code-exercise-answer
|
69b7dbdc081cdb094cb110a72bc0c9242d3d344d
|
[
"MIT"
] | null | null | null |
toki/[Versi Lama] Training Gate TOKI Learning Center/Bab 1. Pengenalan/1B. Percabangan/E.py
|
andraantariksa/code-exercise-answer
|
69b7dbdc081cdb094cb110a72bc0c9242d3d344d
|
[
"MIT"
] | 1
|
2018-11-13T08:43:26.000Z
|
2018-11-13T08:43:26.000Z
|
'''input
-1 -1 1 1
'''
a = list(map(int, input().split()))
print(abs(a[2]-a[0]) + abs(a[3]-a[1]))
| 16.333333
| 38
| 0.5
| 22
| 98
| 2.227273
| 0.545455
| 0.122449
| 0.122449
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.094118
| 0.132653
| 98
| 5
| 39
| 19.6
| 0.482353
| 0.153061
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
751924360f3bf6b0175884f1f2e31e29ba411268
| 815
|
py
|
Python
|
Task/Test-a-function/Python/test-a-function.py
|
LaudateCorpus1/RosettaCodeData
|
9ad63ea473a958506c041077f1d810c0c7c8c18d
|
[
"Info-ZIP"
] | 1
|
2018-11-09T22:08:38.000Z
|
2018-11-09T22:08:38.000Z
|
Task/Test-a-function/Python/test-a-function.py
|
seanwallawalla-forks/RosettaCodeData
|
9ad63ea473a958506c041077f1d810c0c7c8c18d
|
[
"Info-ZIP"
] | null | null | null |
Task/Test-a-function/Python/test-a-function.py
|
seanwallawalla-forks/RosettaCodeData
|
9ad63ea473a958506c041077f1d810c0c7c8c18d
|
[
"Info-ZIP"
] | 1
|
2018-11-09T22:08:40.000Z
|
2018-11-09T22:08:40.000Z
|
def is_palindrome(s):
'''
>>> is_palindrome('')
True
>>> is_palindrome('a')
True
>>> is_palindrome('aa')
True
>>> is_palindrome('baa')
False
>>> is_palindrome('baab')
True
>>> is_palindrome('ba_ab')
True
>>> is_palindrome('ba_ ab')
False
>>> is_palindrome('ba _ ab')
True
>>> is_palindrome('ab'*2)
False
>>> x = 'ab' *2**15
>>> len(x)
65536
>>> xreversed = x[::-1]
>>> is_palindrome(x+xreversed)
True
>>> len(x+xreversed)
131072
>>>
'''
return s == s[::-1]
def _test():
import doctest
doctest.testmod()
#doctest.testmod(verbose=True)
if __name__ == "__main__":
_test()
| 20.375
| 38
| 0.447853
| 80
| 815
| 4.2625
| 0.3625
| 0.387097
| 0.281525
| 0.140762
| 0.211144
| 0.187683
| 0.187683
| 0
| 0
| 0
| 0
| 0.033932
| 0.385276
| 815
| 39
| 39
| 20.897436
| 0.646707
| 0.534969
| 0
| 0
| 0
| 0
| 0.05298
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0.142857
| 0
| 0.571429
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
752fab4197d9c033188ae991469d0508b645d50f
| 3,776
|
py
|
Python
|
DailyProgrammer/DP20150626C.py
|
DayGitH/Python-Challenges
|
bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf
|
[
"MIT"
] | 2
|
2020-12-23T18:59:22.000Z
|
2021-04-14T13:16:09.000Z
|
DailyProgrammer/DP20150626C.py
|
DayGitH/Python-Challenges
|
bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf
|
[
"MIT"
] | null | null | null |
DailyProgrammer/DP20150626C.py
|
DayGitH/Python-Challenges
|
bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf
|
[
"MIT"
] | null | null | null |
"""
[2015-06-26] Challenge #220 [Hard] Substitution Cryptanalysis
https://www.reddit.com/r/dailyprogrammer/comments/3b668g/20150626_challenge_220_hard_substitution/
# [](#HardIcon) _(Hard)_: Substitution Cryptanalysis
A [substitution cipher](https://en.wikipedia.org/?title=Substitution_cipher) is one where each letter in the alphabet
is substituted for another letter. It's like a Caesar shift cipher, but where every letter is ciphered independently.
For example, look at the two rows below.
abcdefghijklmnopqrstuvwxyz
YOJHZKNEALPBRMCQDVGUSITFXW
To encode something, find the letter on the top row, and swap it with the letter on the bottom row - and vice versa.
For example, the plaintext:
hello world
Becomes:
EZBBC TCVBH
Now, how would you go about decrypting something like this? Let's take another example, with a different key.
IAL FTNHPL PDDI DR RDNP WF IUD
You're also given the following hints: `A` is ciphered to `H` and `O` is ciphered to `D`. You know the text was in
English, so you could plausibly use a word list to rule out impossible decrypted texts - for example, in the third
words `PDDI`, there is a double-O in the middle, so the first letter rules out P being the letter Q, as Q is always
followed by a U.
Your challenge is to decrypt a cipher-text into a list of possible original texts using a few letters of the
substitution key, and whichever means you have at your disposal.
# Formal Inputs and Outputs
## Input Description
On the first line of input you will be given the ciphertext. Then, you're given a number **N**. Finally, on the next
**N** lines, you're given pairs of letters, which are pieces of the key. For example, to represent our situation above:
IAL FTNHPL PDDI DR RDNP WF IUD
2
aH
oD
Nothing is case-sensitive. You may assume all plain-texts are in English. Punctuation is preserved, including spaces.
## Output Description
Output a list of possible plain-texts. Sometimes this may only be one, if your input is specific enough. In this case:
the square root of four is two
You don't need to output the entire substitution key. In fact, it may not even be possible to do so, if the original
text isn't a pangram.
# Sample Inputs and Outputs
## Sample 1
### Input
LBH'ER ABG PBBXVAT CBEX PUBC FNAQJVPURF
2
rE
wJ
### Output
you're not cooking pork chop sandwiches
you're nob cooking pork chop sandwiches
Obviously we can guess which output is valid.
## Sample 2
### Input
This case will check your word list validator.
ABCDEF
2
aC
zF
### Output
quartz
## Sample 3
### Input
WRKZ DG ZRDG D AOX'Z VQVX
2
wW
sG
### Output
what is this i don't even
whet is this i can't ulun
(what's a ulun? I need a better word list!)
## Sample 4
### Input
JNOH MALAJJGJ SLNOGQ JSOGX
1
sX
### Output
long parallel ironed lines
# Notes
There's a handy word-list [here](https://gist.githubusercontent.com/Quackmatic/512736d51d84277594f2/raw/words) or you
could check out [this thread](/r/dailyprogrammer/comments/2nluof/) talking about word lists.
You could also *in*validate words, rather than just validating them - check out [this list of impossible two-letter
combinations](http://linguistics.stackexchange.com/questions/4082/impossible-bigrams-in-the-english-language). If
you're using multiple systems, perhaps you could use a weighted scoring system to find the correct decrypted text.
There's an [example solver](http://quipqiup.com/) for this type of challenge, which will try to solve it, but it has a
really weird word-list and ignores punctuation so it may not be awfully useful.
Got any cool challenge ideas? Post them to /r/DailyProgrammer_Ideas!
"""
def main():
pass
if __name__ == "__main__":
main()
| 40.170213
| 119
| 0.746028
| 619
| 3,776
| 4.52504
| 0.486268
| 0.01071
| 0.011424
| 0.019993
| 0.017137
| 0.017137
| 0.017137
| 0
| 0
| 0
| 0
| 0.018561
| 0.186706
| 3,776
| 93
| 120
| 40.602151
| 0.89352
| 0.980932
| 0
| 0
| 0
| 0
| 0.125
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| true
| 0.25
| 0
| 0
| 0.25
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
753070b868b25335db628673e1563e51c017f544
| 20,730
|
py
|
Python
|
sdk/python/pulumi_gcp/compute/instance_group_manager.py
|
dimpu47/pulumi-gcp
|
38355de300a5768e11c49d344a8165ba0735deed
|
[
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
sdk/python/pulumi_gcp/compute/instance_group_manager.py
|
dimpu47/pulumi-gcp
|
38355de300a5768e11c49d344a8165ba0735deed
|
[
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
sdk/python/pulumi_gcp/compute/instance_group_manager.py
|
dimpu47/pulumi-gcp
|
38355de300a5768e11c49d344a8165ba0735deed
|
[
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** 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, Dict, List, Mapping, Optional, Tuple, Union
from .. import _utilities, _tables
from . import outputs
from ._inputs import *
__all__ = ['InstanceGroupManager']
class InstanceGroupManager(pulumi.CustomResource):
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
auto_healing_policies: Optional[pulumi.Input[pulumi.InputType['InstanceGroupManagerAutoHealingPoliciesArgs']]] = None,
base_instance_name: Optional[pulumi.Input[str]] = None,
description: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
named_ports: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['InstanceGroupManagerNamedPortArgs']]]]] = None,
project: Optional[pulumi.Input[str]] = None,
stateful_disks: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['InstanceGroupManagerStatefulDiskArgs']]]]] = None,
target_pools: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None,
target_size: Optional[pulumi.Input[float]] = None,
update_policy: Optional[pulumi.Input[pulumi.InputType['InstanceGroupManagerUpdatePolicyArgs']]] = None,
versions: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['InstanceGroupManagerVersionArgs']]]]] = None,
wait_for_instances: Optional[pulumi.Input[bool]] = None,
zone: Optional[pulumi.Input[str]] = None,
__props__=None,
__name__=None,
__opts__=None):
"""
The Google Compute Engine Instance Group Manager API creates and manages pools
of homogeneous Compute Engine virtual machine instances from a common instance
template. For more information, see [the official documentation](https://cloud.google.com/compute/docs/instance-groups/manager)
and [API](https://cloud.google.com/compute/docs/reference/latest/instanceGroupManagers)
> **Note:** Use [compute.RegionInstanceGroupManager](https://www.terraform.io/docs/providers/google/r/compute_region_instance_group_manager.html) to create a regional (multi-zone) instance group manager.
## Example Usage
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[pulumi.InputType['InstanceGroupManagerAutoHealingPoliciesArgs']] auto_healing_policies: The autohealing policies for this managed instance
group. You can specify only one value. Structure is documented below. For more information, see the [official documentation](https://cloud.google.com/compute/docs/instance-groups/creating-groups-of-managed-instances#monitoring_groups).
:param pulumi.Input[str] base_instance_name: The base instance name to use for
instances in this group. The value must be a valid
[RFC1035](https://www.ietf.org/rfc/rfc1035.txt) name. Supported characters
are lowercase letters, numbers, and hyphens (-). Instances are named by
appending a hyphen and a random four-character string to the base instance
name.
:param pulumi.Input[str] description: An optional textual description of the instance
group manager.
:param pulumi.Input[str] name: - Version name.
:param pulumi.Input[List[pulumi.Input[pulumi.InputType['InstanceGroupManagerNamedPortArgs']]]] named_ports: The named port configuration. See the section below
for details on configuration.
:param pulumi.Input[str] project: The ID of the project in which the resource belongs. If it
is not provided, the provider project is used.
:param pulumi.Input[List[pulumi.Input[pulumi.InputType['InstanceGroupManagerStatefulDiskArgs']]]] stateful_disks: Disks created on the instances that will be preserved on instance delete, update, etc. Structure is documented below. For more information see the [official documentation](https://cloud.google.com/compute/docs/instance-groups/configuring-stateful-disks-in-migs).
:param pulumi.Input[List[pulumi.Input[str]]] target_pools: The full URL of all target pools to which new
instances in the group are added. Updating the target pools attribute does
not affect existing instances.
:param pulumi.Input[float] target_size: - The number of instances calculated as a fixed number or a percentage depending on the settings. Structure is documented below.
:param pulumi.Input[pulumi.InputType['InstanceGroupManagerUpdatePolicyArgs']] update_policy: The update policy for this managed instance group. Structure is documented below. For more information, see the [official documentation](https://cloud.google.com/compute/docs/instance-groups/updating-managed-instance-groups) and [API](https://cloud.google.com/compute/docs/reference/rest/beta/instanceGroupManagers/patch)
:param pulumi.Input[List[pulumi.Input[pulumi.InputType['InstanceGroupManagerVersionArgs']]]] versions: Application versions managed by this instance group. Each
version deals with a specific instance template, allowing canary release scenarios.
Structure is documented below.
:param pulumi.Input[bool] wait_for_instances: Whether to wait for all instances to be created/updated before
returning. Note that if this is set to true and the operation does not succeed, this provider will
continue trying until it times out.
:param pulumi.Input[str] zone: The zone that instances in this group should be created
in.
"""
if __name__ is not None:
warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning)
resource_name = __name__
if __opts__ is not None:
warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning)
opts = __opts__
if opts is None:
opts = pulumi.ResourceOptions()
if not isinstance(opts, pulumi.ResourceOptions):
raise TypeError('Expected resource options to be a ResourceOptions instance')
if opts.version is None:
opts.version = _utilities.get_version()
if opts.id is None:
if __props__ is not None:
raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
__props__ = dict()
__props__['auto_healing_policies'] = auto_healing_policies
if base_instance_name is None:
raise TypeError("Missing required property 'base_instance_name'")
__props__['base_instance_name'] = base_instance_name
__props__['description'] = description
__props__['name'] = name
__props__['named_ports'] = named_ports
__props__['project'] = project
__props__['stateful_disks'] = stateful_disks
__props__['target_pools'] = target_pools
__props__['target_size'] = target_size
__props__['update_policy'] = update_policy
if versions is None:
raise TypeError("Missing required property 'versions'")
__props__['versions'] = versions
__props__['wait_for_instances'] = wait_for_instances
__props__['zone'] = zone
__props__['fingerprint'] = None
__props__['instance_group'] = None
__props__['operation'] = None
__props__['self_link'] = None
super(InstanceGroupManager, __self__).__init__(
'gcp:compute/instanceGroupManager:InstanceGroupManager',
resource_name,
__props__,
opts)
@staticmethod
def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None,
auto_healing_policies: Optional[pulumi.Input[pulumi.InputType['InstanceGroupManagerAutoHealingPoliciesArgs']]] = None,
base_instance_name: Optional[pulumi.Input[str]] = None,
description: Optional[pulumi.Input[str]] = None,
fingerprint: Optional[pulumi.Input[str]] = None,
instance_group: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
named_ports: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['InstanceGroupManagerNamedPortArgs']]]]] = None,
operation: Optional[pulumi.Input[str]] = None,
project: Optional[pulumi.Input[str]] = None,
self_link: Optional[pulumi.Input[str]] = None,
stateful_disks: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['InstanceGroupManagerStatefulDiskArgs']]]]] = None,
target_pools: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None,
target_size: Optional[pulumi.Input[float]] = None,
update_policy: Optional[pulumi.Input[pulumi.InputType['InstanceGroupManagerUpdatePolicyArgs']]] = None,
versions: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['InstanceGroupManagerVersionArgs']]]]] = None,
wait_for_instances: Optional[pulumi.Input[bool]] = None,
zone: Optional[pulumi.Input[str]] = None) -> 'InstanceGroupManager':
"""
Get an existing InstanceGroupManager resource's state with the given name, id, and optional extra
properties used to qualify the lookup.
:param str resource_name: The unique name of the resulting resource.
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[pulumi.InputType['InstanceGroupManagerAutoHealingPoliciesArgs']] auto_healing_policies: The autohealing policies for this managed instance
group. You can specify only one value. Structure is documented below. For more information, see the [official documentation](https://cloud.google.com/compute/docs/instance-groups/creating-groups-of-managed-instances#monitoring_groups).
:param pulumi.Input[str] base_instance_name: The base instance name to use for
instances in this group. The value must be a valid
[RFC1035](https://www.ietf.org/rfc/rfc1035.txt) name. Supported characters
are lowercase letters, numbers, and hyphens (-). Instances are named by
appending a hyphen and a random four-character string to the base instance
name.
:param pulumi.Input[str] description: An optional textual description of the instance
group manager.
:param pulumi.Input[str] fingerprint: The fingerprint of the instance group manager.
:param pulumi.Input[str] instance_group: The full URL of the instance group created by the manager.
:param pulumi.Input[str] name: - Version name.
:param pulumi.Input[List[pulumi.Input[pulumi.InputType['InstanceGroupManagerNamedPortArgs']]]] named_ports: The named port configuration. See the section below
for details on configuration.
:param pulumi.Input[str] project: The ID of the project in which the resource belongs. If it
is not provided, the provider project is used.
:param pulumi.Input[str] self_link: The URL of the created resource.
:param pulumi.Input[List[pulumi.Input[pulumi.InputType['InstanceGroupManagerStatefulDiskArgs']]]] stateful_disks: Disks created on the instances that will be preserved on instance delete, update, etc. Structure is documented below. For more information see the [official documentation](https://cloud.google.com/compute/docs/instance-groups/configuring-stateful-disks-in-migs).
:param pulumi.Input[List[pulumi.Input[str]]] target_pools: The full URL of all target pools to which new
instances in the group are added. Updating the target pools attribute does
not affect existing instances.
:param pulumi.Input[float] target_size: - The number of instances calculated as a fixed number or a percentage depending on the settings. Structure is documented below.
:param pulumi.Input[pulumi.InputType['InstanceGroupManagerUpdatePolicyArgs']] update_policy: The update policy for this managed instance group. Structure is documented below. For more information, see the [official documentation](https://cloud.google.com/compute/docs/instance-groups/updating-managed-instance-groups) and [API](https://cloud.google.com/compute/docs/reference/rest/beta/instanceGroupManagers/patch)
:param pulumi.Input[List[pulumi.Input[pulumi.InputType['InstanceGroupManagerVersionArgs']]]] versions: Application versions managed by this instance group. Each
version deals with a specific instance template, allowing canary release scenarios.
Structure is documented below.
:param pulumi.Input[bool] wait_for_instances: Whether to wait for all instances to be created/updated before
returning. Note that if this is set to true and the operation does not succeed, this provider will
continue trying until it times out.
:param pulumi.Input[str] zone: The zone that instances in this group should be created
in.
"""
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = dict()
__props__["auto_healing_policies"] = auto_healing_policies
__props__["base_instance_name"] = base_instance_name
__props__["description"] = description
__props__["fingerprint"] = fingerprint
__props__["instance_group"] = instance_group
__props__["name"] = name
__props__["named_ports"] = named_ports
__props__["operation"] = operation
__props__["project"] = project
__props__["self_link"] = self_link
__props__["stateful_disks"] = stateful_disks
__props__["target_pools"] = target_pools
__props__["target_size"] = target_size
__props__["update_policy"] = update_policy
__props__["versions"] = versions
__props__["wait_for_instances"] = wait_for_instances
__props__["zone"] = zone
return InstanceGroupManager(resource_name, opts=opts, __props__=__props__)
@property
@pulumi.getter(name="autoHealingPolicies")
def auto_healing_policies(self) -> pulumi.Output[Optional['outputs.InstanceGroupManagerAutoHealingPolicies']]:
"""
The autohealing policies for this managed instance
group. You can specify only one value. Structure is documented below. For more information, see the [official documentation](https://cloud.google.com/compute/docs/instance-groups/creating-groups-of-managed-instances#monitoring_groups).
"""
return pulumi.get(self, "auto_healing_policies")
@property
@pulumi.getter(name="baseInstanceName")
def base_instance_name(self) -> pulumi.Output[str]:
"""
The base instance name to use for
instances in this group. The value must be a valid
[RFC1035](https://www.ietf.org/rfc/rfc1035.txt) name. Supported characters
are lowercase letters, numbers, and hyphens (-). Instances are named by
appending a hyphen and a random four-character string to the base instance
name.
"""
return pulumi.get(self, "base_instance_name")
@property
@pulumi.getter
def description(self) -> pulumi.Output[Optional[str]]:
"""
An optional textual description of the instance
group manager.
"""
return pulumi.get(self, "description")
@property
@pulumi.getter
def fingerprint(self) -> pulumi.Output[str]:
"""
The fingerprint of the instance group manager.
"""
return pulumi.get(self, "fingerprint")
@property
@pulumi.getter(name="instanceGroup")
def instance_group(self) -> pulumi.Output[str]:
"""
The full URL of the instance group created by the manager.
"""
return pulumi.get(self, "instance_group")
@property
@pulumi.getter
def name(self) -> pulumi.Output[str]:
"""
- Version name.
"""
return pulumi.get(self, "name")
@property
@pulumi.getter(name="namedPorts")
def named_ports(self) -> pulumi.Output[Optional[List['outputs.InstanceGroupManagerNamedPort']]]:
"""
The named port configuration. See the section below
for details on configuration.
"""
return pulumi.get(self, "named_ports")
@property
@pulumi.getter
def operation(self) -> pulumi.Output[str]:
return pulumi.get(self, "operation")
@property
@pulumi.getter
def project(self) -> pulumi.Output[str]:
"""
The ID of the project in which the resource belongs. If it
is not provided, the provider project is used.
"""
return pulumi.get(self, "project")
@property
@pulumi.getter(name="selfLink")
def self_link(self) -> pulumi.Output[str]:
"""
The URL of the created resource.
"""
return pulumi.get(self, "self_link")
@property
@pulumi.getter(name="statefulDisks")
def stateful_disks(self) -> pulumi.Output[Optional[List['outputs.InstanceGroupManagerStatefulDisk']]]:
"""
Disks created on the instances that will be preserved on instance delete, update, etc. Structure is documented below. For more information see the [official documentation](https://cloud.google.com/compute/docs/instance-groups/configuring-stateful-disks-in-migs).
"""
return pulumi.get(self, "stateful_disks")
@property
@pulumi.getter(name="targetPools")
def target_pools(self) -> pulumi.Output[Optional[List[str]]]:
"""
The full URL of all target pools to which new
instances in the group are added. Updating the target pools attribute does
not affect existing instances.
"""
return pulumi.get(self, "target_pools")
@property
@pulumi.getter(name="targetSize")
def target_size(self) -> pulumi.Output[float]:
"""
- The number of instances calculated as a fixed number or a percentage depending on the settings. Structure is documented below.
"""
return pulumi.get(self, "target_size")
@property
@pulumi.getter(name="updatePolicy")
def update_policy(self) -> pulumi.Output['outputs.InstanceGroupManagerUpdatePolicy']:
"""
The update policy for this managed instance group. Structure is documented below. For more information, see the [official documentation](https://cloud.google.com/compute/docs/instance-groups/updating-managed-instance-groups) and [API](https://cloud.google.com/compute/docs/reference/rest/beta/instanceGroupManagers/patch)
"""
return pulumi.get(self, "update_policy")
@property
@pulumi.getter
def versions(self) -> pulumi.Output[List['outputs.InstanceGroupManagerVersion']]:
"""
Application versions managed by this instance group. Each
version deals with a specific instance template, allowing canary release scenarios.
Structure is documented below.
"""
return pulumi.get(self, "versions")
@property
@pulumi.getter(name="waitForInstances")
def wait_for_instances(self) -> pulumi.Output[Optional[bool]]:
"""
Whether to wait for all instances to be created/updated before
returning. Note that if this is set to true and the operation does not succeed, this provider will
continue trying until it times out.
"""
return pulumi.get(self, "wait_for_instances")
@property
@pulumi.getter
def zone(self) -> pulumi.Output[str]:
"""
The zone that instances in this group should be created
in.
"""
return pulumi.get(self, "zone")
def translate_output_property(self, prop):
return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop
def translate_input_property(self, prop):
return _tables.SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop
| 57.423823
| 422
| 0.684274
| 2,393
| 20,730
| 5.768491
| 0.120769
| 0.061359
| 0.033469
| 0.03767
| 0.746957
| 0.716966
| 0.704941
| 0.693495
| 0.685816
| 0.657563
| 0
| 0.001556
| 0.22494
| 20,730
| 360
| 423
| 57.583333
| 0.857596
| 0.48466
| 0
| 0.284153
| 1
| 0
| 0.177596
| 0.07039
| 0
| 0
| 0
| 0
| 0
| 1
| 0.114754
| false
| 0.005464
| 0.038251
| 0.016393
| 0.26776
| 0.027322
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
755f62a0d6629657e63584769a8a0fa6c38da7ec
| 161
|
py
|
Python
|
code/installation/THP/tools/scraper.py
|
CreativeInquiry/TeenieHarrisProject
|
c7c2e1730ade29ed086a4bd21d5d21315fcde5e5
|
[
"MIT"
] | null | null | null |
code/installation/THP/tools/scraper.py
|
CreativeInquiry/TeenieHarrisProject
|
c7c2e1730ade29ed086a4bd21d5d21315fcde5e5
|
[
"MIT"
] | 9
|
2019-03-27T18:42:41.000Z
|
2019-03-31T17:04:24.000Z
|
code/installation/THP/tools/scraper.py
|
CreativeInquiry/TeenieHarrisProject
|
c7c2e1730ade29ed086a4bd21d5d21315fcde5e5
|
[
"MIT"
] | null | null | null |
import urllib.request
import re
x = str(urllib.request.urlopen('https://collection.cmoa.org/?q=6977').read())
results = re.findall(r'objects/',x)
print(results)
| 26.833333
| 77
| 0.73913
| 25
| 161
| 4.76
| 0.76
| 0.218487
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.026667
| 0.068323
| 161
| 6
| 78
| 26.833333
| 0.766667
| 0
| 0
| 0
| 0
| 0
| 0.265432
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4
| 0
| 0.4
| 0.2
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
f33bd3ced5032dee21376c05b1076595c7787ac4
| 145
|
py
|
Python
|
examples/animated_plot.py
|
BuildJet/xBOUT
|
523a78c8fa62cc390cfb9e434fc152c51ba9db7c
|
[
"Apache-2.0"
] | 15
|
2018-12-08T15:57:58.000Z
|
2022-03-22T11:40:25.000Z
|
examples/animated_plot.py
|
BuildJet/xBOUT
|
523a78c8fa62cc390cfb9e434fc152c51ba9db7c
|
[
"Apache-2.0"
] | 210
|
2018-12-07T19:12:14.000Z
|
2022-03-28T13:06:05.000Z
|
examples/animated_plot.py
|
BuildJet/xBOUT
|
523a78c8fa62cc390cfb9e434fc152c51ba9db7c
|
[
"Apache-2.0"
] | 13
|
2019-02-12T14:39:19.000Z
|
2021-09-07T18:54:30.000Z
|
from xbout import open_boutdataset
bd = open_boutdataset().squeeze(drop=True)
bd.bout.animate("n", animate_over="t", x="x", y="z", sep_pos=40)
| 24.166667
| 64
| 0.717241
| 25
| 145
| 4
| 0.8
| 0.3
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.015267
| 0.096552
| 145
| 5
| 65
| 29
| 0.748092
| 0
| 0
| 0
| 0
| 0
| 0.027586
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
f38de3a80f985c7768e949a3e90901f008b621f7
| 22
|
py
|
Python
|
src/modules/sample/cohort_selection/__init__.py
|
awkywoo/nb-practice
|
9684da9397a15cef820f667fc9e149e1aadbea1d
|
[
"MIT"
] | null | null | null |
src/modules/sample/cohort_selection/__init__.py
|
awkywoo/nb-practice
|
9684da9397a15cef820f667fc9e149e1aadbea1d
|
[
"MIT"
] | null | null | null |
src/modules/sample/cohort_selection/__init__.py
|
awkywoo/nb-practice
|
9684da9397a15cef820f667fc9e149e1aadbea1d
|
[
"MIT"
] | null | null | null |
'''cohort selection'''
| 22
| 22
| 0.681818
| 2
| 22
| 7.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.045455
| 22
| 1
| 22
| 22
| 0.714286
| 0.727273
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
f3b5f076dfff6724ad100a3328ed878bd2fd72c8
| 31
|
py
|
Python
|
awspds_mosaic/landsat/handlers/__init__.py
|
RichardScottOZ/awspds-mosaic
|
32e53403ad76732b8af25a8f9ade7691b8e13dea
|
[
"BSD-2-Clause"
] | 9
|
2020-02-10T19:11:51.000Z
|
2022-01-27T15:43:33.000Z
|
awspds_mosaic/landsat/handlers/__init__.py
|
RichardScottOZ/awspds-mosaic
|
32e53403ad76732b8af25a8f9ade7691b8e13dea
|
[
"BSD-2-Clause"
] | 9
|
2020-02-10T19:12:11.000Z
|
2020-10-15T14:51:52.000Z
|
awspds_mosaic/landsat/handlers/__init__.py
|
RichardScottOZ/awspds-mosaic
|
32e53403ad76732b8af25a8f9ade7691b8e13dea
|
[
"BSD-2-Clause"
] | 4
|
2020-03-03T04:35:30.000Z
|
2022-01-27T10:02:49.000Z
|
"""landsat_mosaic: handlers"""
| 15.5
| 30
| 0.709677
| 3
| 31
| 7
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.064516
| 31
| 1
| 31
| 31
| 0.724138
| 0.774194
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
f3bf01da8fef7f117b5d66b7b93ff619b95e65fb
| 347
|
py
|
Python
|
misc/monte_carlo_pi/monte_carlo_pi.py
|
jcockbain/daily-coding-problem
|
ddfe07ff599ee07a0c20bdbef16669858b7d5c25
|
[
"MIT"
] | null | null | null |
misc/monte_carlo_pi/monte_carlo_pi.py
|
jcockbain/daily-coding-problem
|
ddfe07ff599ee07a0c20bdbef16669858b7d5c25
|
[
"MIT"
] | 2
|
2020-04-04T14:25:48.000Z
|
2020-04-10T21:46:19.000Z
|
misc/monte_carlo_pi/monte_carlo_pi.py
|
jcockbain/daily-coding-problem
|
ddfe07ff599ee07a0c20bdbef16669858b7d5c25
|
[
"MIT"
] | null | null | null |
from random import uniform
from math import pow
def generate():
return (uniform(-1, 1), uniform(-1, 1))
def is_in_circle(coords):
return coords[0] * coords[0] + coords[1] * coords[1] < 1
def estimate(iterations):
in_circle = len([x for x in range(iterations) if is_in_circle(generate())])
return 4 * (in_circle / iterations)
| 21.6875
| 79
| 0.674352
| 54
| 347
| 4.222222
| 0.425926
| 0.140351
| 0.078947
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.035587
| 0.190202
| 347
| 15
| 80
| 23.133333
| 0.775801
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.222222
| 0.222222
| 0.888889
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
45e9a163688d99d24be1b763402c42e10b8558e4
| 73
|
py
|
Python
|
pypospack/io/aflowlib.py
|
eragasa/pypospack
|
21cdecaf3b05c87acc532d992be2c04d85bfbc22
|
[
"MIT"
] | 4
|
2018-01-18T19:59:56.000Z
|
2020-08-25T11:56:52.000Z
|
mexm/io/aflowlib.py
|
eragasa/mexm-base
|
c8d84057c483e1bd06bb8b2e835274f6a4cd61b9
|
[
"MIT"
] | 1
|
2018-04-22T23:02:13.000Z
|
2018-04-22T23:02:13.000Z
|
mexm/io/aflowlib.py
|
eragasa/mexm-base
|
c8d84057c483e1bd06bb8b2e835274f6a4cd61b9
|
[
"MIT"
] | 1
|
2019-09-14T07:04:42.000Z
|
2019-09-14T07:04:42.000Z
|
# this contains directions on how to integrate aflowlib into pypospack
| 18.25
| 70
| 0.808219
| 10
| 73
| 5.9
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.178082
| 73
| 3
| 71
| 24.333333
| 0.983333
| 0.931507
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
340910f4a4c7d91a17abae35ff047ae7865dad24
| 757
|
py
|
Python
|
config_reader.py
|
isspek/veracity-detection
|
9368309722bead209e49e52c206758e3d173092a
|
[
"MIT"
] | null | null | null |
config_reader.py
|
isspek/veracity-detection
|
9368309722bead209e49e52c206758e3d173092a
|
[
"MIT"
] | null | null | null |
config_reader.py
|
isspek/veracity-detection
|
9368309722bead209e49e52c206758e3d173092a
|
[
"MIT"
] | null | null | null |
from configparser import ConfigParser
from pathlib import Path
def get_project_root() -> Path:
"""Returns project root folder."""
return Path(__file__).parent
root = get_project_root()
config = ConfigParser()
config.read(root/'config.ini')
def get_final_key():
return root/config['RumourEval2019']['final-key']
def get_dataframe_path():
return root/config['RumourEval2019']['dataframes']
def get_badwords():
return root/config['RumourEval2019']['badwords']
def get_negative_smileys():
return root/config['RumourEval2019']['negative_smileys']
def get_positive_smileys():
return root/config['RumourEval2019']['positive_smileys']
def get_word2vec_pretrain():
return root/config['RumourEval2019']['word_embeddings']
| 22.264706
| 60
| 0.742404
| 89
| 757
| 6.067416
| 0.337079
| 0.148148
| 0.177778
| 0.333333
| 0.137037
| 0
| 0
| 0
| 0
| 0
| 0
| 0.037707
| 0.124174
| 757
| 33
| 61
| 22.939394
| 0.776772
| 0.036988
| 0
| 0
| 0
| 0
| 0.232365
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.368421
| false
| 0
| 0.105263
| 0.315789
| 0.842105
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
341380ac4b09b8087c4616f99f52744213971890
| 203
|
py
|
Python
|
tests/test_encoder.py
|
wikimedia/mediawiki-services-similar-users
|
dcae8be6ce57d6eecbdbf4e2e3e8dddcbaf17da9
|
[
"MIT"
] | null | null | null |
tests/test_encoder.py
|
wikimedia/mediawiki-services-similar-users
|
dcae8be6ce57d6eecbdbf4e2e3e8dddcbaf17da9
|
[
"MIT"
] | null | null | null |
tests/test_encoder.py
|
wikimedia/mediawiki-services-similar-users
|
dcae8be6ce57d6eecbdbf4e2e3e8dddcbaf17da9
|
[
"MIT"
] | null | null | null |
from similar_users.factory import BinaryJSONEncoder
import json
def test_binary_jsonencoder():
data = {'key1': b"binary_value", "key2": "value"}
assert json.dumps(data, cls=BinaryJSONEncoder)
| 22.555556
| 53
| 0.748768
| 25
| 203
| 5.92
| 0.76
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.011429
| 0.137931
| 203
| 8
| 54
| 25.375
| 0.834286
| 0
| 0
| 0
| 0
| 0
| 0.123153
| 0
| 0
| 0
| 0
| 0
| 0.2
| 1
| 0.2
| false
| 0
| 0.4
| 0
| 0.6
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
34179bd94a3ff584b7767f823f5ebb2e3a75a8eb
| 141
|
py
|
Python
|
hadar_dashboard/__init__.py
|
hadar-simulator/jupyter-dashboard
|
092dcaf1f823f497c846ca53338bd74b060efa84
|
[
"Apache-2.0"
] | null | null | null |
hadar_dashboard/__init__.py
|
hadar-simulator/jupyter-dashboard
|
092dcaf1f823f497c846ca53338bd74b060efa84
|
[
"Apache-2.0"
] | null | null | null |
hadar_dashboard/__init__.py
|
hadar-simulator/jupyter-dashboard
|
092dcaf1f823f497c846ca53338bd74b060efa84
|
[
"Apache-2.0"
] | null | null | null |
from hadar_dashboard.dashboard import dashboard
import hadar as hd
# Dashboard use the same version than hadar
__version__ = hd.__version__
| 23.5
| 47
| 0.829787
| 20
| 141
| 5.4
| 0.55
| 0.277778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.141844
| 141
| 5
| 48
| 28.2
| 0.892562
| 0.29078
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
342c75611a2c19cb49865baa2b8b53736e49366c
| 83
|
py
|
Python
|
moonshine/beer/apps.py
|
ivelintod/moonshine
|
5e9598fc61bc41a47ef9525f1d62d34fed02664a
|
[
"MIT"
] | null | null | null |
moonshine/beer/apps.py
|
ivelintod/moonshine
|
5e9598fc61bc41a47ef9525f1d62d34fed02664a
|
[
"MIT"
] | 10
|
2020-02-12T00:00:15.000Z
|
2022-03-11T23:44:08.000Z
|
moonshine/beer/apps.py
|
ivelintod/moonshine
|
5e9598fc61bc41a47ef9525f1d62d34fed02664a
|
[
"MIT"
] | 6
|
2019-10-10T13:04:33.000Z
|
2020-09-02T14:11:31.000Z
|
from django.apps import AppConfig
class BeerConfig(AppConfig):
name = 'beer'
| 13.833333
| 33
| 0.73494
| 10
| 83
| 6.1
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.180723
| 83
| 5
| 34
| 16.6
| 0.897059
| 0
| 0
| 0
| 0
| 0
| 0.048193
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
3430127d709831609940e660ce9803e76e7c4aab
| 148
|
py
|
Python
|
20191016/StringSplit.py
|
a8252525/IoTTalk
|
07a84cf4278ea12d830aa3f71728a557f5b81899
|
[
"MIT"
] | null | null | null |
20191016/StringSplit.py
|
a8252525/IoTTalk
|
07a84cf4278ea12d830aa3f71728a557f5b81899
|
[
"MIT"
] | null | null | null |
20191016/StringSplit.py
|
a8252525/IoTTalk
|
07a84cf4278ea12d830aa3f71728a557f5b81899
|
[
"MIT"
] | null | null | null |
if __name__ == '__main__':
Str1 = '14:59~15:20'
StrList = Str1.split('~')
print(StrList)
print(StrList[0])
print(StrList[1])
| 14.8
| 29
| 0.567568
| 19
| 148
| 4
| 0.684211
| 0.473684
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.107143
| 0.243243
| 148
| 9
| 30
| 16.444444
| 0.571429
| 0
| 0
| 0
| 0
| 0
| 0.136986
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.5
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
343bb3adb958bd012389879b6a2f6e52e133fe3c
| 30,519
|
py
|
Python
|
cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_wd_oper.py
|
tkamata-test/ydk-py
|
b637e7853a8edbbd31fbc05afa3aa4110b31c5f9
|
[
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_wd_oper.py
|
tkamata-test/ydk-py
|
b637e7853a8edbbd31fbc05afa3aa4110b31c5f9
|
[
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_wd_oper.py
|
tkamata-test/ydk-py
|
b637e7853a8edbbd31fbc05afa3aa4110b31c5f9
|
[
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
""" Cisco_IOS_XR_wd_oper
This module contains a collection of YANG definitions
for Cisco IOS\-XR wd package operational data.
This module contains definitions
for the following management objects\:
watchdog\: Watchdog information
Copyright (c) 2013\-2016 by Cisco Systems, Inc.
All rights reserved.
"""
import re
import collections
from enum import Enum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk.errors import YPYError, YPYModelError
class MemoryStateEnum(Enum):
"""
MemoryStateEnum
Memory state options
.. data:: unknown = 0
Memory state unknown
.. data:: normal = 1
Memory state normal
.. data:: minor = 2
Memory state minor
.. data:: severe = 3
Memory state severe
.. data:: critical = 4
Memory state critical
"""
unknown = 0
normal = 1
minor = 2
severe = 3
critical = 4
@staticmethod
def _meta_info():
from ydk.models.cisco_ios_xr._meta import _Cisco_IOS_XR_wd_oper as meta
return meta._meta_table['MemoryStateEnum']
class OverloadCtrlNotifEnum(Enum):
"""
OverloadCtrlNotifEnum
Overload control notification
.. data:: disabled = 0
Diabled
.. data:: enabled = 1
Enabled
"""
disabled = 0
enabled = 1
@staticmethod
def _meta_info():
from ydk.models.cisco_ios_xr._meta import _Cisco_IOS_XR_wd_oper as meta
return meta._meta_table['OverloadCtrlNotifEnum']
class Watchdog(object):
"""
Watchdog information
.. attribute:: nodes
List of nodes
**type**\: :py:class:`Nodes <ydk.models.cisco_ios_xr.Cisco_IOS_XR_wd_oper.Watchdog.Nodes>`
"""
_prefix = 'wd-oper'
_revision = '2015-11-09'
def __init__(self):
self.nodes = Watchdog.Nodes()
self.nodes.parent = self
class Nodes(object):
"""
List of nodes
.. attribute:: node
Node ID
**type**\: list of :py:class:`Node <ydk.models.cisco_ios_xr.Cisco_IOS_XR_wd_oper.Watchdog.Nodes.Node>`
"""
_prefix = 'wd-oper'
_revision = '2015-11-09'
def __init__(self):
self.parent = None
self.node = YList()
self.node.parent = self
self.node.name = 'node'
class Node(object):
"""
Node ID
.. attribute:: node_name <key>
Node name
**type**\: str
**pattern:** ([a\-zA\-Z0\-9\_]\*\\d+/){1,2}([a\-zA\-Z0\-9\_]\*\\d+)
.. attribute:: memory_state
Memory state
**type**\: :py:class:`MemoryState <ydk.models.cisco_ios_xr.Cisco_IOS_XR_wd_oper.Watchdog.Nodes.Node.MemoryState>`
.. attribute:: overload_state
Display overload control state
**type**\: :py:class:`OverloadState <ydk.models.cisco_ios_xr.Cisco_IOS_XR_wd_oper.Watchdog.Nodes.Node.OverloadState>`
.. attribute:: threshold_memory
Threshold memory
**type**\: :py:class:`ThresholdMemory <ydk.models.cisco_ios_xr.Cisco_IOS_XR_wd_oper.Watchdog.Nodes.Node.ThresholdMemory>`
"""
_prefix = 'wd-oper'
_revision = '2015-11-09'
def __init__(self):
self.parent = None
self.node_name = None
self.memory_state = Watchdog.Nodes.Node.MemoryState()
self.memory_state.parent = self
self.overload_state = Watchdog.Nodes.Node.OverloadState()
self.overload_state.parent = self
self.threshold_memory = Watchdog.Nodes.Node.ThresholdMemory()
self.threshold_memory.parent = self
class ThresholdMemory(object):
"""
Threshold memory
.. attribute:: configured
Memory configured by user
**type**\: :py:class:`Configured <ydk.models.cisco_ios_xr.Cisco_IOS_XR_wd_oper.Watchdog.Nodes.Node.ThresholdMemory.Configured>`
.. attribute:: default
System default memory
**type**\: :py:class:`Default <ydk.models.cisco_ios_xr.Cisco_IOS_XR_wd_oper.Watchdog.Nodes.Node.ThresholdMemory.Default>`
"""
_prefix = 'wd-oper'
_revision = '2015-11-09'
def __init__(self):
self.parent = None
self.configured = Watchdog.Nodes.Node.ThresholdMemory.Configured()
self.configured.parent = self
self.default = Watchdog.Nodes.Node.ThresholdMemory.Default()
self.default.parent = self
class Default(object):
"""
System default memory
.. attribute:: configured_memory
Configured memory
**type**\: :py:class:`ConfiguredMemory <ydk.models.cisco_ios_xr.Cisco_IOS_XR_wd_oper.Watchdog.Nodes.Node.ThresholdMemory.Default.ConfiguredMemory>`
.. attribute:: memory
Memory Information
**type**\: :py:class:`Memory <ydk.models.cisco_ios_xr.Cisco_IOS_XR_wd_oper.Watchdog.Nodes.Node.ThresholdMemory.Default.Memory>`
"""
_prefix = 'wd-oper'
_revision = '2015-11-09'
def __init__(self):
self.parent = None
self.configured_memory = Watchdog.Nodes.Node.ThresholdMemory.Default.ConfiguredMemory()
self.configured_memory.parent = self
self.memory = Watchdog.Nodes.Node.ThresholdMemory.Default.Memory()
self.memory.parent = self
class ConfiguredMemory(object):
"""
Configured memory
.. attribute:: critical
Critical memory in bytes
**type**\: int
**range:** 0..18446744073709551615
**units**\: byte
.. attribute:: minor
Minor memory threshold in bytes
**type**\: int
**range:** 0..4294967295
**units**\: byte
.. attribute:: severe
Severe memory threshold in bytes
**type**\: int
**range:** 0..4294967295
**units**\: byte
"""
_prefix = 'wd-oper'
_revision = '2015-11-09'
def __init__(self):
self.parent = None
self.critical = None
self.minor = None
self.severe = None
@property
def _common_path(self):
if self.parent is None:
raise YPYModelError('parent is not set . Cannot derive path.')
return self.parent._common_path +'/Cisco-IOS-XR-wd-oper:configured-memory'
def is_config(self):
''' Returns True if this instance represents config data else returns False '''
return False
def _has_data(self):
if not self.is_config():
return False
if self.critical is not None:
return True
if self.minor is not None:
return True
if self.severe is not None:
return True
return False
@staticmethod
def _meta_info():
from ydk.models.cisco_ios_xr._meta import _Cisco_IOS_XR_wd_oper as meta
return meta._meta_table['Watchdog.Nodes.Node.ThresholdMemory.Default.ConfiguredMemory']['meta_info']
class Memory(object):
"""
Memory Information
.. attribute:: free_memory
Free memory in bytes
**type**\: int
**range:** 0..18446744073709551615
**units**\: byte
.. attribute:: memory_state
State of memory
**type**\: :py:class:`MemoryStateEnum <ydk.models.cisco_ios_xr.Cisco_IOS_XR_wd_oper.MemoryStateEnum>`
.. attribute:: physical_memory
Physical memory in bytes
**type**\: int
**range:** 0..4294967295
**units**\: byte
"""
_prefix = 'wd-oper'
_revision = '2015-11-09'
def __init__(self):
self.parent = None
self.free_memory = None
self.memory_state = None
self.physical_memory = None
@property
def _common_path(self):
if self.parent is None:
raise YPYModelError('parent is not set . Cannot derive path.')
return self.parent._common_path +'/Cisco-IOS-XR-wd-oper:memory'
def is_config(self):
''' Returns True if this instance represents config data else returns False '''
return False
def _has_data(self):
if not self.is_config():
return False
if self.free_memory is not None:
return True
if self.memory_state is not None:
return True
if self.physical_memory is not None:
return True
return False
@staticmethod
def _meta_info():
from ydk.models.cisco_ios_xr._meta import _Cisco_IOS_XR_wd_oper as meta
return meta._meta_table['Watchdog.Nodes.Node.ThresholdMemory.Default.Memory']['meta_info']
@property
def _common_path(self):
if self.parent is None:
raise YPYModelError('parent is not set . Cannot derive path.')
return self.parent._common_path +'/Cisco-IOS-XR-wd-oper:default'
def is_config(self):
''' Returns True if this instance represents config data else returns False '''
return False
def _has_data(self):
if not self.is_config():
return False
if self.configured_memory is not None and self.configured_memory._has_data():
return True
if self.memory is not None and self.memory._has_data():
return True
return False
@staticmethod
def _meta_info():
from ydk.models.cisco_ios_xr._meta import _Cisco_IOS_XR_wd_oper as meta
return meta._meta_table['Watchdog.Nodes.Node.ThresholdMemory.Default']['meta_info']
class Configured(object):
"""
Memory configured by user
.. attribute:: critical
Critical memory in bytes
**type**\: int
**range:** 0..18446744073709551615
**units**\: byte
.. attribute:: minor
Minor memory threshold in bytes
**type**\: int
**range:** 0..4294967295
**units**\: byte
.. attribute:: severe
Severe memory threshold in bytes
**type**\: int
**range:** 0..4294967295
**units**\: byte
"""
_prefix = 'wd-oper'
_revision = '2015-11-09'
def __init__(self):
self.parent = None
self.critical = None
self.minor = None
self.severe = None
@property
def _common_path(self):
if self.parent is None:
raise YPYModelError('parent is not set . Cannot derive path.')
return self.parent._common_path +'/Cisco-IOS-XR-wd-oper:configured'
def is_config(self):
''' Returns True if this instance represents config data else returns False '''
return False
def _has_data(self):
if not self.is_config():
return False
if self.critical is not None:
return True
if self.minor is not None:
return True
if self.severe is not None:
return True
return False
@staticmethod
def _meta_info():
from ydk.models.cisco_ios_xr._meta import _Cisco_IOS_XR_wd_oper as meta
return meta._meta_table['Watchdog.Nodes.Node.ThresholdMemory.Configured']['meta_info']
@property
def _common_path(self):
if self.parent is None:
raise YPYModelError('parent is not set . Cannot derive path.')
return self.parent._common_path +'/Cisco-IOS-XR-wd-oper:threshold-memory'
def is_config(self):
''' Returns True if this instance represents config data else returns False '''
return False
def _has_data(self):
if not self.is_config():
return False
if self.configured is not None and self.configured._has_data():
return True
if self.default is not None and self.default._has_data():
return True
return False
@staticmethod
def _meta_info():
from ydk.models.cisco_ios_xr._meta import _Cisco_IOS_XR_wd_oper as meta
return meta._meta_table['Watchdog.Nodes.Node.ThresholdMemory']['meta_info']
class MemoryState(object):
"""
Memory state
.. attribute:: free_memory
Free memory in bytes
**type**\: int
**range:** 0..18446744073709551615
**units**\: byte
.. attribute:: memory_state
State of memory
**type**\: :py:class:`MemoryStateEnum <ydk.models.cisco_ios_xr.Cisco_IOS_XR_wd_oper.MemoryStateEnum>`
.. attribute:: physical_memory
Physical memory in bytes
**type**\: int
**range:** 0..4294967295
**units**\: byte
"""
_prefix = 'wd-oper'
_revision = '2015-11-09'
def __init__(self):
self.parent = None
self.free_memory = None
self.memory_state = None
self.physical_memory = None
@property
def _common_path(self):
if self.parent is None:
raise YPYModelError('parent is not set . Cannot derive path.')
return self.parent._common_path +'/Cisco-IOS-XR-wd-oper:memory-state'
def is_config(self):
''' Returns True if this instance represents config data else returns False '''
return False
def _has_data(self):
if not self.is_config():
return False
if self.free_memory is not None:
return True
if self.memory_state is not None:
return True
if self.physical_memory is not None:
return True
return False
@staticmethod
def _meta_info():
from ydk.models.cisco_ios_xr._meta import _Cisco_IOS_XR_wd_oper as meta
return meta._meta_table['Watchdog.Nodes.Node.MemoryState']['meta_info']
class OverloadState(object):
"""
Display overload control state
.. attribute:: configured_wdsysmon_throttle
Configured resmon throttle
**type**\: int
**range:** 0..4294967295
.. attribute:: current_throttle
Current throttle information
**type**\: :py:class:`CurrentThrottle <ydk.models.cisco_ios_xr.Cisco_IOS_XR_wd_oper.Watchdog.Nodes.Node.OverloadState.CurrentThrottle>`
.. attribute:: default_wdsysmon_throttle
Default resmon throttle
**type**\: int
**range:** 0..4294967295
.. attribute:: last_throttle
Last throttle information
**type**\: list of :py:class:`LastThrottle <ydk.models.cisco_ios_xr.Cisco_IOS_XR_wd_oper.Watchdog.Nodes.Node.OverloadState.LastThrottle>`
.. attribute:: overload_control_notification
State of overload control notification
**type**\: :py:class:`OverloadCtrlNotifEnum <ydk.models.cisco_ios_xr.Cisco_IOS_XR_wd_oper.OverloadCtrlNotifEnum>`
"""
_prefix = 'wd-oper'
_revision = '2015-11-09'
def __init__(self):
self.parent = None
self.configured_wdsysmon_throttle = None
self.current_throttle = Watchdog.Nodes.Node.OverloadState.CurrentThrottle()
self.current_throttle.parent = self
self.default_wdsysmon_throttle = None
self.last_throttle = YList()
self.last_throttle.parent = self
self.last_throttle.name = 'last_throttle'
self.overload_control_notification = None
class CurrentThrottle(object):
"""
Current throttle information
.. attribute:: start_time
Current throttle start time in format \:day\-of\-week month date\-of\-month HH\:MM\:SS year eg\: Thu Feb 1 18\:32\:14 2011
**type**\: str
**length:** 0..25
.. attribute:: throttle_duration
Current throttle duration in seconds
**type**\: int
**range:** 0..4294967295
**units**\: second
"""
_prefix = 'wd-oper'
_revision = '2015-11-09'
def __init__(self):
self.parent = None
self.start_time = None
self.throttle_duration = None
@property
def _common_path(self):
if self.parent is None:
raise YPYModelError('parent is not set . Cannot derive path.')
return self.parent._common_path +'/Cisco-IOS-XR-wd-oper:current-throttle'
def is_config(self):
''' Returns True if this instance represents config data else returns False '''
return False
def _has_data(self):
if not self.is_config():
return False
if self.start_time is not None:
return True
if self.throttle_duration is not None:
return True
return False
@staticmethod
def _meta_info():
from ydk.models.cisco_ios_xr._meta import _Cisco_IOS_XR_wd_oper as meta
return meta._meta_table['Watchdog.Nodes.Node.OverloadState.CurrentThrottle']['meta_info']
class LastThrottle(object):
"""
Last throttle information
.. attribute:: start_time
Last throttle start time in format \:day\-of\-week month date\-of\-month HH\:MM\:SS year eg\: Thu Feb 1 18\:32\:14 2011
**type**\: str
**length:** 0..25
.. attribute:: stop_time
Last throttle stop time in format \:day\-of\-week month date\-of\-month HH\:MM\:SS year eg\: Thu Feb 1 18\:32\:14 2011
**type**\: str
**length:** 0..25
.. attribute:: throttle_duration
Last throttle duration in seconds
**type**\: int
**range:** 0..4294967295
**units**\: second
"""
_prefix = 'wd-oper'
_revision = '2015-11-09'
def __init__(self):
self.parent = None
self.start_time = None
self.stop_time = None
self.throttle_duration = None
@property
def _common_path(self):
if self.parent is None:
raise YPYModelError('parent is not set . Cannot derive path.')
return self.parent._common_path +'/Cisco-IOS-XR-wd-oper:last-throttle'
def is_config(self):
''' Returns True if this instance represents config data else returns False '''
return False
def _has_data(self):
if not self.is_config():
return False
if self.start_time is not None:
return True
if self.stop_time is not None:
return True
if self.throttle_duration is not None:
return True
return False
@staticmethod
def _meta_info():
from ydk.models.cisco_ios_xr._meta import _Cisco_IOS_XR_wd_oper as meta
return meta._meta_table['Watchdog.Nodes.Node.OverloadState.LastThrottle']['meta_info']
@property
def _common_path(self):
if self.parent is None:
raise YPYModelError('parent is not set . Cannot derive path.')
return self.parent._common_path +'/Cisco-IOS-XR-wd-oper:overload-state'
def is_config(self):
''' Returns True if this instance represents config data else returns False '''
return False
def _has_data(self):
if not self.is_config():
return False
if self.configured_wdsysmon_throttle is not None:
return True
if self.current_throttle is not None and self.current_throttle._has_data():
return True
if self.default_wdsysmon_throttle is not None:
return True
if self.last_throttle is not None:
for child_ref in self.last_throttle:
if child_ref._has_data():
return True
if self.overload_control_notification is not None:
return True
return False
@staticmethod
def _meta_info():
from ydk.models.cisco_ios_xr._meta import _Cisco_IOS_XR_wd_oper as meta
return meta._meta_table['Watchdog.Nodes.Node.OverloadState']['meta_info']
@property
def _common_path(self):
if self.node_name is None:
raise YPYModelError('Key property node_name is None')
return '/Cisco-IOS-XR-wd-oper:watchdog/Cisco-IOS-XR-wd-oper:nodes/Cisco-IOS-XR-wd-oper:node[Cisco-IOS-XR-wd-oper:node-name = ' + str(self.node_name) + ']'
def is_config(self):
''' Returns True if this instance represents config data else returns False '''
return False
def _has_data(self):
if not self.is_config():
return False
if self.node_name is not None:
return True
if self.memory_state is not None and self.memory_state._has_data():
return True
if self.overload_state is not None and self.overload_state._has_data():
return True
if self.threshold_memory is not None and self.threshold_memory._has_data():
return True
return False
@staticmethod
def _meta_info():
from ydk.models.cisco_ios_xr._meta import _Cisco_IOS_XR_wd_oper as meta
return meta._meta_table['Watchdog.Nodes.Node']['meta_info']
@property
def _common_path(self):
return '/Cisco-IOS-XR-wd-oper:watchdog/Cisco-IOS-XR-wd-oper:nodes'
def is_config(self):
''' Returns True if this instance represents config data else returns False '''
return False
def _has_data(self):
if not self.is_config():
return False
if self.node is not None:
for child_ref in self.node:
if child_ref._has_data():
return True
return False
@staticmethod
def _meta_info():
from ydk.models.cisco_ios_xr._meta import _Cisco_IOS_XR_wd_oper as meta
return meta._meta_table['Watchdog.Nodes']['meta_info']
@property
def _common_path(self):
return '/Cisco-IOS-XR-wd-oper:watchdog'
def is_config(self):
''' Returns True if this instance represents config data else returns False '''
return False
def _has_data(self):
if not self.is_config():
return False
if self.nodes is not None and self.nodes._has_data():
return True
return False
@staticmethod
def _meta_info():
from ydk.models.cisco_ios_xr._meta import _Cisco_IOS_XR_wd_oper as meta
return meta._meta_table['Watchdog']['meta_info']
| 34.214126
| 170
| 0.445853
| 2,676
| 30,519
| 4.880419
| 0.06577
| 0.045329
| 0.056662
| 0.042266
| 0.776953
| 0.736677
| 0.709495
| 0.696095
| 0.685069
| 0.675804
| 0
| 0.022936
| 0.482847
| 30,519
| 891
| 171
| 34.252525
| 0.804537
| 0.234706
| 0
| 0.727027
| 0
| 0.005405
| 0.090482
| 0.049354
| 0
| 0
| 0
| 0
| 0
| 1
| 0.167568
| false
| 0
| 0.051351
| 0.005405
| 0.535135
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
34556d97a7998017fe9971f706b0421d23048729
| 118
|
py
|
Python
|
graphanalyzer/forms.py
|
sergiopaniego/TwitterGraphAnalyzer
|
c40bc2c8505ecbb7466c9635bc8ae7bd89d90199
|
[
"Apache-2.0"
] | 2
|
2018-11-23T17:17:11.000Z
|
2021-05-08T09:14:23.000Z
|
graphanalyzer/forms.py
|
sergiopaniego/TwitterGraphAnalyzer
|
c40bc2c8505ecbb7466c9635bc8ae7bd89d90199
|
[
"Apache-2.0"
] | null | null | null |
graphanalyzer/forms.py
|
sergiopaniego/TwitterGraphAnalyzer
|
c40bc2c8505ecbb7466c9635bc8ae7bd89d90199
|
[
"Apache-2.0"
] | null | null | null |
from django import forms
class HashtagForm(forms.Form):
hashtag = forms.CharField(label='hashtag', max_length=50)
| 29.5
| 61
| 0.771186
| 16
| 118
| 5.625
| 0.8125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.019231
| 0.118644
| 118
| 4
| 61
| 29.5
| 0.846154
| 0
| 0
| 0
| 0
| 0
| 0.058824
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
3463dbdbca267688eae9b722df651cb5dd42b6f4
| 230
|
py
|
Python
|
tests/test_monitoring.py
|
jagadeesh6jaga/vakyansh-realtime-server
|
a914adb29570ded792f4692c595527492c99b8c6
|
[
"MIT"
] | 4
|
2021-06-18T18:05:09.000Z
|
2022-03-09T20:43:50.000Z
|
tests/test_monitoring.py
|
jagadeesh6jaga/vakyansh-realtime-server
|
a914adb29570ded792f4692c595527492c99b8c6
|
[
"MIT"
] | 2
|
2021-06-21T05:40:50.000Z
|
2022-03-03T10:28:12.000Z
|
tests/test_monitoring.py
|
jagadeesh6jaga/vakyansh-realtime-server
|
a914adb29570ded792f4692c595527492c99b8c6
|
[
"MIT"
] | 5
|
2021-06-09T12:44:07.000Z
|
2022-03-01T05:49:01.000Z
|
from src.monitoring import monitor
@monitor
def tryThis():
tryThisToo()
print('function called try this')
@monitor
def tryThisToo():
print('function called try this too')
if __name__ == '__main__':
tryThis()
| 13.529412
| 41
| 0.682609
| 27
| 230
| 5.518519
| 0.62963
| 0.134228
| 0.308725
| 0.389262
| 0.483221
| 0.483221
| 0
| 0
| 0
| 0
| 0
| 0
| 0.204348
| 230
| 16
| 42
| 14.375
| 0.814208
| 0
| 0
| 0.2
| 0
| 0
| 0.26087
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| true
| 0
| 0.1
| 0
| 0.3
| 0.2
| 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
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
34723e59d6aff9ff8fff724de9122de43bc25fa9
| 274
|
py
|
Python
|
pypal_api/exceptions.py
|
IvanCampos11/Python-Package
|
761a6fc1c5574640936382f676109c92fca17868
|
[
"MIT"
] | 1
|
2021-12-06T17:28:37.000Z
|
2021-12-06T17:28:37.000Z
|
pypal_api/exceptions.py
|
IvanCampos11/Python-Package
|
761a6fc1c5574640936382f676109c92fca17868
|
[
"MIT"
] | 1
|
2021-11-30T20:11:11.000Z
|
2021-11-30T20:11:48.000Z
|
pypal_api/exceptions.py
|
IvanCampos11/Python-Package
|
761a6fc1c5574640936382f676109c92fca17868
|
[
"MIT"
] | null | null | null |
class InvalidInputError(Exception):
"""
This will be raised when one tries to input a type thats not in its
list of types that can be used.
"""
def __init__(self, message):
self.message = message
def __str__(self):
return self.message
| 30.444444
| 71
| 0.653285
| 38
| 274
| 4.5
| 0.789474
| 0.192982
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.273723
| 274
| 9
| 72
| 30.444444
| 0.859296
| 0.361314
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.4
| false
| 0
| 0
| 0.2
| 0.8
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
3482ed9f7d533ec5e99c7c8efe5b1438e534bdd9
| 458
|
py
|
Python
|
previewers/event/EventWaiter.py
|
C3RV1/LaytonEditor
|
51e1a9a372a8acdaa4183ae008235a721dc56cdc
|
[
"Unlicense"
] | 6
|
2019-12-24T00:18:54.000Z
|
2022-02-28T17:09:22.000Z
|
previewers/event/EventWaiter.py
|
C3RV1/LaytonEditor
|
51e1a9a372a8acdaa4183ae008235a721dc56cdc
|
[
"Unlicense"
] | 1
|
2021-08-18T11:10:35.000Z
|
2021-08-18T17:32:21.000Z
|
previewers/event/EventWaiter.py
|
C3RV1/LaytonEditor
|
51e1a9a372a8acdaa4183ae008235a721dc56cdc
|
[
"Unlicense"
] | 2
|
2021-01-17T10:42:48.000Z
|
2021-08-18T11:10:54.000Z
|
from pg_utils.rom.rom_extract import ORIGINAL_FPS
class EventWaiter:
def __init__(self):
self.current_wait_time = 0
def wait(self, wait_frames):
self.current_wait_time = wait_frames / ORIGINAL_FPS
def busy(self):
return self.current_wait_time > 0
def stop(self):
self.current_wait_time = 0
def update_(self, dt: float):
if self.current_wait_time > 0:
self.current_wait_time -= dt
| 22.9
| 59
| 0.661572
| 65
| 458
| 4.307692
| 0.384615
| 0.235714
| 0.321429
| 0.407143
| 0.346429
| 0.275
| 0.192857
| 0
| 0
| 0
| 0
| 0.011799
| 0.259825
| 458
| 19
| 60
| 24.105263
| 0.814159
| 0
| 0
| 0.153846
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.384615
| false
| 0
| 0.076923
| 0.076923
| 0.615385
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
cac503221315a737a6aaf1b08e6c81b1bfe90930
| 149
|
py
|
Python
|
python_programming/basics/internals.py
|
JoshuaTPritchett/30DaysCoding
|
b361a4cf38dea66b43231fabf43252d202440811
|
[
"Unlicense"
] | null | null | null |
python_programming/basics/internals.py
|
JoshuaTPritchett/30DaysCoding
|
b361a4cf38dea66b43231fabf43252d202440811
|
[
"Unlicense"
] | null | null | null |
python_programming/basics/internals.py
|
JoshuaTPritchett/30DaysCoding
|
b361a4cf38dea66b43231fabf43252d202440811
|
[
"Unlicense"
] | null | null | null |
"""
Holy shit python can compile code?
Source code -> byte code -> runs in Virtual Machine PVM
"""
import py_compile
py_compile.compile('basic.py')
| 18.625
| 55
| 0.731544
| 23
| 149
| 4.652174
| 0.695652
| 0.168224
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.154362
| 149
| 7
| 56
| 21.285714
| 0.849206
| 0.604027
| 0
| 0
| 0
| 0
| 0.16
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
caf7f85d2a48093f37a902f97a86b5911b5c76d7
| 157
|
py
|
Python
|
project/api/__init__.py
|
pmoran13800/rhgamestation-manager
|
dd5ca1190ae92455fce10a3475a9a14e684024d8
|
[
"MIT"
] | null | null | null |
project/api/__init__.py
|
pmoran13800/rhgamestation-manager
|
dd5ca1190ae92455fce10a3475a9a14e684024d8
|
[
"MIT"
] | null | null | null |
project/api/__init__.py
|
pmoran13800/rhgamestation-manager
|
dd5ca1190ae92455fce10a3475a9a14e684024d8
|
[
"MIT"
] | null | null | null |
"""
RHGamestation manager API
Well in fact it's not really an API, this is mostly JSON views for some
special jobs like executing some command scripts.
"""
| 26.166667
| 72
| 0.764331
| 26
| 157
| 4.615385
| 0.923077
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.178344
| 157
| 6
| 73
| 26.166667
| 0.930233
| 0.949045
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
1b066cf2132cc0bcf20a27dc35c2dc9bfda22de7
| 314
|
py
|
Python
|
GA/mutation.py
|
raj-1411/Deep-Convolutional-Neural-Networks-improvisation-with-applied-Genetic-Algorithm
|
bebac65cd82f977c68a865f527e33ceba4e6966a
|
[
"MIT"
] | null | null | null |
GA/mutation.py
|
raj-1411/Deep-Convolutional-Neural-Networks-improvisation-with-applied-Genetic-Algorithm
|
bebac65cd82f977c68a865f527e33ceba4e6966a
|
[
"MIT"
] | null | null | null |
GA/mutation.py
|
raj-1411/Deep-Convolutional-Neural-Networks-improvisation-with-applied-Genetic-Algorithm
|
bebac65cd82f977c68a865f527e33ceba4e6966a
|
[
"MIT"
] | null | null | null |
import numpy as np
def mutation(crossed_offsprings, num_mutations):
mutation_id = np.random.randint(low=0, high=crossed_offsprings.shape[1],size=num_mutations)
for n in range(crossed_offsprings.shape[0]):
crossed_offsprings[n,mutation_id] = 1-crossed_offsprings[n,mutation_id]
return crossed_offsprings
| 39.25
| 93
| 0.802548
| 47
| 314
| 5.12766
| 0.510638
| 0.423237
| 0.182573
| 0.215768
| 0.232365
| 0
| 0
| 0
| 0
| 0
| 0
| 0.014134
| 0.098726
| 314
| 8
| 94
| 39.25
| 0.837456
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0.166667
| 0
| 0.5
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
1b0a8d34df0a40cb136d16bd62a636736c817316
| 2,977
|
py
|
Python
|
pupa/tests/importers/test_disclosure_importer.py
|
influence-usa/pupa
|
5105c39a535ad401f7babe4eecb3861bed1f8326
|
[
"BSD-3-Clause"
] | null | null | null |
pupa/tests/importers/test_disclosure_importer.py
|
influence-usa/pupa
|
5105c39a535ad401f7babe4eecb3861bed1f8326
|
[
"BSD-3-Clause"
] | 3
|
2015-06-09T19:22:50.000Z
|
2015-06-09T21:41:22.000Z
|
pupa/tests/importers/test_disclosure_importer.py
|
influence-usa/pupa
|
5105c39a535ad401f7babe4eecb3861bed1f8326
|
[
"BSD-3-Clause"
] | null | null | null |
import pytest
from pupa.scrape import Disclosure as ScrapeDisclosure
from pupa.importers import (DisclosureImporter, OrganizationImporter,
PersonImporter, EventImporter)
from opencivicdata.models import Jurisdiction
def gd():
disclosure = ScrapeDisclosure(
classification="lobbying",
effective_date="2011-01-22T00:00Z",
submitted_date="2011-03-17T00:00Z",
timezone="America/New_York"
)
return disclosure
@pytest.mark.django_db
def test_disclosure():
j = Jurisdiction.objects.create(id='jid', division_id='did')
disclosure = gd()
disclosure.add_source(
url="http://www.example.com/",
note="This is the source"
)
oi = OrganizationImporter('jid')
pi = PersonImporter('jid')
ei = EventImporter('jid', org_importer=oi, person_importer=pi)
result = DisclosureImporter('jid', org_importer=oi, person_importer=pi,
event_importer=ei).import_data(
[disclosure.as_dict()])
assert result['disclosure']['insert'] == 1
result = DisclosureImporter('jid', org_importer=oi, person_importer=pi,
event_importer=ei).import_data([disclosure.as_dict()])
assert result['disclosure']['noop'] == 1
@pytest.mark.django_db
def test_disclosure_no_source():
j = Jurisdiction.objects.create(id='jid', division_id='did')
disclosure = gd()
oi = OrganizationImporter('jid')
pi = PersonImporter('jid')
ei = EventImporter('jid', org_importer=oi, person_importer=pi)
with pytest.raises(KeyError):
result = DisclosureImporter('jid', org_importer=oi, person_importer=pi,
event_importer=ei).import_data([disclosure.as_dict()])
@pytest.mark.django_db
def test_disclosure_source_identified():
j = Jurisdiction.objects.create(id='jid', division_id='did')
disclosure1 = gd()
disclosure2 = gd()
disclosure1.add_source(
url="http://www.example.com/",
note="This is the source"
)
disclosure2.add_source(
url="http://www.ejemplo.com/",
note="This is a different source"
)
oi = OrganizationImporter('jid')
pi = PersonImporter('jid')
ei = EventImporter('jid', org_importer=oi, person_importer=pi)
result = DisclosureImporter('jid', org_importer=oi, person_importer=pi,
event_importer=ei).import_data([disclosure1.as_dict()])
assert result['disclosure']['insert'] == 1
result = DisclosureImporter('jid', org_importer=oi, person_importer=pi,
event_importer=ei).import_data([disclosure1.as_dict()])
assert result['disclosure']['noop'] == 1
result = DisclosureImporter('jid', org_importer=oi, person_importer=pi,
event_importer=ei).import_data([disclosure2.as_dict()])
assert result['disclosure']['insert'] == 1
| 33.449438
| 87
| 0.640242
| 322
| 2,977
| 5.748447
| 0.248447
| 0.029173
| 0.068071
| 0.077796
| 0.74014
| 0.729876
| 0.729876
| 0.649379
| 0.649379
| 0.625608
| 0
| 0.015783
| 0.233792
| 2,977
| 88
| 88
| 33.829545
| 0.795704
| 0
| 0
| 0.545455
| 0
| 0
| 0.110178
| 0
| 0
| 0
| 0
| 0
| 0.075758
| 1
| 0.060606
| false
| 0
| 0.393939
| 0
| 0.469697
| 0
| 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
| 1
| 0
| 0
| 0
|
0
| 4
|
1b0de19b76b00782e00cbfc97eaaa6509f0a2c4b
| 102
|
py
|
Python
|
docs/sklearndb.py
|
crazysal/chemml
|
300ed183c623fc8762ed2343e48c9e2ac5102c0f
|
[
"BSD-3-Clause"
] | 108
|
2018-03-23T20:06:03.000Z
|
2022-01-06T19:32:46.000Z
|
docs/sklearndb.py
|
crazysal/chemml
|
300ed183c623fc8762ed2343e48c9e2ac5102c0f
|
[
"BSD-3-Clause"
] | 18
|
2019-08-09T21:16:14.000Z
|
2022-02-14T21:52:06.000Z
|
docs/sklearndb.py
|
crazysal/chemml
|
300ed183c623fc8762ed2343e48c9e2ac5102c0f
|
[
"BSD-3-Clause"
] | 28
|
2018-04-28T17:07:33.000Z
|
2022-02-28T07:22:56.000Z
|
import numpy as np
from .containers import Input, Output, Parameter, req, regression_types, cv_types
| 25.5
| 81
| 0.803922
| 15
| 102
| 5.333333
| 0.866667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.137255
| 102
| 3
| 82
| 34
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
1b1893a31ff022af7687ec594a198d05644a34bb
| 144
|
py
|
Python
|
Python/2. Basic Data Types/01 - List Comprehensions.py
|
rosiejh/HackerRank
|
bfb07b8add04d3f3b67a61754db483f88a79e5a5
|
[
"Apache-2.0"
] | null | null | null |
Python/2. Basic Data Types/01 - List Comprehensions.py
|
rosiejh/HackerRank
|
bfb07b8add04d3f3b67a61754db483f88a79e5a5
|
[
"Apache-2.0"
] | null | null | null |
Python/2. Basic Data Types/01 - List Comprehensions.py
|
rosiejh/HackerRank
|
bfb07b8add04d3f3b67a61754db483f88a79e5a5
|
[
"Apache-2.0"
] | null | null | null |
x, y, z, n = [int(input()) for _ in range(4)]
print([[i, j, k] for i in range(x+1) for j in range(y+1) for k in range(z+1) if (i + j + k) != n])
| 72
| 98
| 0.534722
| 37
| 144
| 2.054054
| 0.432432
| 0.368421
| 0.078947
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.035714
| 0.222222
| 144
| 2
| 98
| 72
| 0.642857
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0.5
| 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
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
1b1c9eaa7d0345e4f3b35a1f4df5f5646da28e7c
| 182
|
py
|
Python
|
core/dbt/parser/models.py
|
pushpay/dbt
|
8b96de893af692bd77fe9eb9a8104317be7b5413
|
[
"Apache-2.0"
] | 1
|
2022-01-09T19:33:25.000Z
|
2022-01-09T19:33:25.000Z
|
core/dbt/parser/models.py
|
pushpay/dbt
|
8b96de893af692bd77fe9eb9a8104317be7b5413
|
[
"Apache-2.0"
] | 1
|
2019-02-14T20:10:46.000Z
|
2019-02-19T13:06:38.000Z
|
core/dbt/parser/models.py
|
pushpay/dbt
|
8b96de893af692bd77fe9eb9a8104317be7b5413
|
[
"Apache-2.0"
] | 1
|
2019-04-16T10:51:10.000Z
|
2019-04-16T10:51:10.000Z
|
from dbt.parser.base_sql import BaseSqlParser
class ModelParser(BaseSqlParser):
@classmethod
def get_compiled_path(cls, name, relative_path):
return relative_path
| 20.222222
| 52
| 0.763736
| 22
| 182
| 6.090909
| 0.818182
| 0.179104
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.175824
| 182
| 8
| 53
| 22.75
| 0.893333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.2
| 0.2
| 0.8
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
1b391d892fa4d9147a44c3fe3bea515019ee5835
| 215
|
py
|
Python
|
app/data/__init__.py
|
dwreeves/flagging
|
32897f579a2528c51dae04d1ac5311cfd9cf1836
|
[
"MIT"
] | null | null | null |
app/data/__init__.py
|
dwreeves/flagging
|
32897f579a2528c51dae04d1ac5311cfd9cf1836
|
[
"MIT"
] | null | null | null |
app/data/__init__.py
|
dwreeves/flagging
|
32897f579a2528c51dae04d1ac5311cfd9cf1836
|
[
"MIT"
] | null | null | null |
# flake8: noqa
""""
The data module contains exactly what you'd expect: everything related to data
processing, collection, and storage.
"""
from .database import db
# Register to metadata.
from .models import _all
| 21.5
| 78
| 0.75814
| 30
| 215
| 5.4
| 0.866667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005525
| 0.15814
| 215
| 9
| 79
| 23.888889
| 0.889503
| 0.711628
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
1b53b346083c274f7d4ed2f5d4409591a375ca2d
| 56
|
py
|
Python
|
edit/core/__init__.py
|
tpoisonooo/basicVSR_mge
|
53df836a7dcc075083ef7c9ff7cabea69fec3192
|
[
"Apache-2.0"
] | 28
|
2021-03-23T09:00:33.000Z
|
2022-03-10T03:55:00.000Z
|
edit/core/__init__.py
|
tpoisonooo/basicVSR_mge
|
53df836a7dcc075083ef7c9ff7cabea69fec3192
|
[
"Apache-2.0"
] | 2
|
2021-04-17T20:08:55.000Z
|
2022-02-01T17:48:55.000Z
|
edit/core/__init__.py
|
tpoisonooo/basicVSR_mge
|
53df836a7dcc075083ef7c9ff7cabea69fec3192
|
[
"Apache-2.0"
] | 5
|
2021-05-19T07:35:56.000Z
|
2022-01-13T02:11:50.000Z
|
from .optimizer import build_optimizers, MGE_OPTIMIZERS
| 28
| 55
| 0.875
| 7
| 56
| 6.714286
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.089286
| 56
| 1
| 56
| 56
| 0.921569
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
1b5a68e2c0cdcb3414164090689114247fcee571
| 319
|
py
|
Python
|
pytpp/attributes/flow_action_team_owner_approval.py
|
Venafi/pytpp
|
42af655b2403b8c9447c86962abd4aaa0201f646
|
[
"MIT"
] | 4
|
2022-02-04T23:58:55.000Z
|
2022-02-15T18:53:08.000Z
|
pytpp/attributes/flow_action_team_owner_approval.py
|
Venafi/pytpp
|
42af655b2403b8c9447c86962abd4aaa0201f646
|
[
"MIT"
] | null | null | null |
pytpp/attributes/flow_action_team_owner_approval.py
|
Venafi/pytpp
|
42af655b2403b8c9447c86962abd4aaa0201f646
|
[
"MIT"
] | null | null | null |
from pytpp.attributes._helper import IterableMeta
from pytpp.attributes.flow_action_config_read_approvers import FlowActionConfigReadApproversAttributes
class FlowActionTeamOwnerApprovalAttributes(FlowActionConfigReadApproversAttributes, metaclass=IterableMeta):
__config_class__ = "Flow Action Team Owner Approval"
| 45.571429
| 109
| 0.896552
| 28
| 319
| 9.857143
| 0.642857
| 0.065217
| 0.137681
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.065831
| 319
| 6
| 110
| 53.166667
| 0.926175
| 0
| 0
| 0
| 0
| 0
| 0.097179
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
1b61893c070621b4a52707ea8b3bdce381fab3b6
| 10,297
|
py
|
Python
|
tests/test_formatter.py
|
nikitanovosibirsk/valera
|
f2111f5b886fe58f6f8054c20de35102c4518114
|
[
"Apache-2.0"
] | null | null | null |
tests/test_formatter.py
|
nikitanovosibirsk/valera
|
f2111f5b886fe58f6f8054c20de35102c4518114
|
[
"Apache-2.0"
] | 2
|
2021-12-05T11:41:46.000Z
|
2022-02-01T15:13:19.000Z
|
tests/test_formatter.py
|
nikitanovosibirsk/valera
|
f2111f5b886fe58f6f8054c20de35102c4518114
|
[
"Apache-2.0"
] | null | null | null |
import pytest
from baby_steps import given, then, when
from district42 import schema
from th import PathHolder, _
from valera import Formatter
from valera.errors import (
AlphabetValidationError,
ExtraElementValidationError,
ExtraKeyValidationError,
LengthValidationError,
MaxLengthValidationError,
MaxValueValidationError,
MinLengthValidationError,
MinValueValidationError,
MissingElementValidationError,
MissingKeyValidationError,
RegexValidationError,
SchemaMismatchValidationError,
SubstrValidationError,
TypeValidationError,
ValueValidationError,
)
@pytest.fixture()
def formatter() -> Formatter:
return Formatter()
def test_formatter_default_root():
with when:
formatter = Formatter()
with then:
assert formatter.root == "_"
def test_formatter_custom_root():
with when:
formatter = Formatter("#")
with then:
assert formatter.root == "#"
@pytest.mark.parametrize(("path", "formatted"), [
(_, "Value 'banana' must be <class 'int'>, but <class 'str'> given"),
(_["id"], "Value 'banana' at _['id'] must be <class 'int'>, but <class 'str'> given")
])
def test_format_type_error(path: PathHolder, formatted: str, *, formatter: Formatter):
with given:
error = TypeValidationError(path, actual_value="banana", expected_type=int)
with when:
res = error.format(formatter)
with then:
assert res == formatted
@pytest.mark.parametrize(("path", "formatted"), [
(_, "Value <class 'str'> must be equal to 'banana', but 'orange' given"),
(_["id"], "Value <class 'str'> at _['id'] must be equal to 'banana', but 'orange' given")
])
def test_format_value_error(path: PathHolder, formatted: str, *, formatter: Formatter):
with given:
error = ValueValidationError(path, actual_value="orange", expected_value="banana")
with when:
res = error.format(formatter)
with then:
assert res == formatted
@pytest.mark.parametrize(("path", "formatted"), [
(_, "Value <class 'int'> must be greater than or equal to 1, but 0 given"),
(_["id"], "Value <class 'int'> at _['id'] must be greater than or equal to 1, but 0 given")
])
def test_format_min_value_error(path: PathHolder, formatted: str, *, formatter: Formatter):
with given:
error = MinValueValidationError(path, actual_value=0, min_value=1)
with when:
res = error.format(formatter)
with then:
assert res == formatted
@pytest.mark.parametrize(("path", "formatted"), [
(_, "Value <class 'int'> must be less than or equal to 0, but 1 given"),
(_["id"], "Value <class 'int'> at _['id'] must be less than or equal to 0, but 1 given")
])
def test_format_max_value_error(path: PathHolder, formatted: str, *, formatter: Formatter):
with given:
error = MaxValueValidationError(path, actual_value=1, max_value=0)
with when:
res = error.format(formatter)
with then:
assert res == formatted
@pytest.mark.parametrize(("path", "formatted"), [
(_, "Value <class 'str'> must have exactly 1 element, but it has 2 elements"),
(_["id"], "Value <class 'str'> at _['id'] must have exactly 1 element, but it has 2 elements")
])
def test_format_length_one_error(path: PathHolder, formatted: str, *, formatter: Formatter):
with given:
error = LengthValidationError(path, actual_value="ab", length=1)
with when:
res = error.format(formatter)
with then:
assert res == formatted
@pytest.mark.parametrize(("path", "formatted"), [
(_, "Value <class 'str'> must have exactly 2 elements, but it has 1 element"),
(_["id"], "Value <class 'str'> at _['id'] must have exactly 2 elements, but it has 1 element")
])
def test_format_length_many_error(path: PathHolder, formatted: str, *, formatter: Formatter):
with given:
error = LengthValidationError(path, actual_value="a", length=2)
with when:
res = error.format(formatter)
with then:
assert res == formatted
@pytest.mark.parametrize(("path", "formatted"), [
(_, "Value <class 'str'> must have at least 1 element, but it has 0 elements"),
(_["id"], "Value <class 'str'> at _['id'] must have at least 1 element, but it has 0 elements")
])
def test_format_min_length_one_error(path: PathHolder, formatted: str, *, formatter: Formatter):
with given:
error = MinLengthValidationError(path, actual_value="", min_length=1)
with when:
res = error.format(formatter)
with then:
assert res == formatted
@pytest.mark.parametrize(("path", "formatted"), [
(_, "Value <class 'str'> must have at least 3 elements, but it has 1 element"),
(_["id"], "Value <class 'str'> at _['id'] must have at least 3 elements, but it has 1 element")
])
def test_format_min_length_many_error(path: PathHolder, formatted: str, *, formatter: Formatter):
with given:
error = MinLengthValidationError(path, actual_value="a", min_length=3)
with when:
res = error.format(formatter)
with then:
assert res == formatted
@pytest.mark.parametrize(("path", "formatted"), [
(_, "Value <class 'str'> must have at most 1 element, but it has 2 elements"),
(_["id"], "Value <class 'str'> at _['id'] must have at most 1 element, but it has 2 elements")
])
def test_format_max_length_one_error(path: PathHolder, formatted: str, *, formatter: Formatter):
with given:
error = MaxLengthValidationError(path, actual_value="ab", max_length=1)
with when:
res = error.format(formatter)
with then:
assert res == formatted
@pytest.mark.parametrize(("path", "formatted"), [
(_, "Value <class 'str'> must have at most 0 elements, but it has 1 element"),
(_["id"], "Value <class 'str'> at _['id'] must have at most 0 elements, but it has 1 element")
])
def test_format_max_length_many_error(path: PathHolder, formatted: str, *, formatter: Formatter):
with given:
error = MaxLengthValidationError(path, actual_value="a", max_length=0)
with when:
res = error.format(formatter)
with then:
assert res == formatted
@pytest.mark.parametrize(("path", "formatted"), [
(_, "Value <class 'str'> must contain only '0123456789', but 'banana' given"),
(_["id"], "Value <class 'str'> at _['id'] must contain only '0123456789', but 'banana' given")
])
def test_format_alphabet_error(path: PathHolder, formatted: str, *, formatter: Formatter):
with given:
error = AlphabetValidationError(path, actual_value="banana", alphabet="0123456789")
with when:
res = error.format(formatter)
with then:
assert res == formatted
@pytest.mark.parametrize(("path", "formatted"), [
(_, "Value <class 'str'> must contain 'banana', but 'ananab' given"),
(_["id"], "Value <class 'str'> at _['id'] must contain 'banana', but 'ananab' given")
])
def test_format_substr_error(path: PathHolder, formatted: str, *, formatter: Formatter):
with given:
error = SubstrValidationError(path, actual_value="ananab", substr="banana")
with when:
res = error.format(formatter)
with then:
assert res == formatted
@pytest.mark.parametrize(("path", "formatted"), [
(_, "Value <class 'str'> must match pattern '[0-9]+', but 'banana' given"),
(_["id"], "Value <class 'str'> at _['id'] must match pattern '[0-9]+', but 'banana' given")
])
def test_format_regex_error(path: PathHolder, formatted: str, *, formatter: Formatter):
with given:
error = RegexValidationError(path, actual_value="banana", pattern="[0-9]+")
with when:
res = error.format(formatter)
with then:
assert res == formatted
@pytest.mark.parametrize(("path", "formatted"), [
(_, "Element _[1] does not exist"),
(_["id"], "Element _['id'][1] does not exist")
])
def test_format_missing_element_error(path: PathHolder, formatted: str, *, formatter: Formatter):
with given:
error = MissingElementValidationError(path, actual_value=["a"], index=1)
with when:
res = error.format(formatter)
with then:
assert res == formatted
@pytest.mark.parametrize(("path", "formatted"), [
(_, "Value contains extra element at index 1"),
(_["id"], "Value at _['id'] contains extra element at index 1")
])
def test_format_extra_element_error(path: PathHolder, formatted: str, *, formatter: Formatter):
with given:
error = ExtraElementValidationError(path, actual_value=["a", "b"], index=1)
with when:
res = error.format(formatter)
with then:
assert res == formatted
@pytest.mark.parametrize(("path", "formatted"), [
(_, "Key _['missing_key'] does not exist"),
(_["id"], "Key _['id']['missing_key'] does not exist")
])
def test_format_missing_key_error(path: PathHolder, formatted: str, *, formatter: Formatter):
with given:
error = MissingKeyValidationError(path, actual_value={}, missing_key="missing_key")
with when:
res = error.format(formatter)
with then:
assert res == formatted
@pytest.mark.parametrize(("path", "formatted"), [
(_, "Value contains extra key 'extra_key'"),
(_["id"], "Value at _['id'] contains extra key 'extra_key'")
])
def test_format_extra_key_error(path: PathHolder, formatted: str, *, formatter: Formatter):
with given:
value = {"extra_key": "value"}
error = ExtraKeyValidationError(path, actual_value=value, extra_key="extra_key")
with when:
res = error.format(formatter)
with then:
assert res == formatted
@pytest.mark.parametrize(("path", "formatted"), [
(_, "Value <class 'int'> must match any of (schema.str, schema.none), but 42 given"),
(_["id"], "Value <class 'int'> at _['id'] must match any of (schema.str, schema.none), "
"but 42 given"),
])
def test_format_schema_missmatch_error(path: PathHolder, formatted: str, *, formatter: Formatter):
with given:
error = SchemaMismatchValidationError(path, actual_value=42,
expected_schemas=(schema.str, schema.none))
with when:
res = error.format(formatter)
with then:
assert res == formatted
| 32.380503
| 99
| 0.65456
| 1,228
| 10,297
| 5.348534
| 0.089577
| 0.075213
| 0.066991
| 0.070037
| 0.769488
| 0.75746
| 0.730359
| 0.71422
| 0.683465
| 0.665347
| 0
| 0.011265
| 0.206856
| 10,297
| 317
| 100
| 32.48265
| 0.792947
| 0
| 0
| 0.550847
| 0
| 0.063559
| 0.266583
| 0.002137
| 0
| 0
| 0
| 0
| 0.084746
| 1
| 0.088983
| false
| 0
| 0.025424
| 0.004237
| 0.118644
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
1b64295f4ab1100cba4cc2d13e5c144e20437ab4
| 500
|
py
|
Python
|
Python/code/thread_demo.py
|
Ljazz/studyspace
|
b235e7d16fecf93dd64ad785833d4de5bb17db64
|
[
"MIT"
] | null | null | null |
Python/code/thread_demo.py
|
Ljazz/studyspace
|
b235e7d16fecf93dd64ad785833d4de5bb17db64
|
[
"MIT"
] | null | null | null |
Python/code/thread_demo.py
|
Ljazz/studyspace
|
b235e7d16fecf93dd64ad785833d4de5bb17db64
|
[
"MIT"
] | null | null | null |
from threading import Thread, current_thread
def thread_test(name):
print("thread {} is running...".format(current_thread().name))
print("hello ", name)
print("thread {} ended".format(current_thread().name))
if __name__ == '__main__':
print("thread {} is running...".format(current_thread().name))
print("hello world")
t = Thread(target=thread_test, args=("test", ), name="TestThread")
t.start()
t.join()
print("thread {} ended".format(current_thread().name))
| 29.411765
| 70
| 0.658
| 62
| 500
| 5.064516
| 0.370968
| 0.207006
| 0.242038
| 0.292994
| 0.585987
| 0.585987
| 0.585987
| 0.33758
| 0.33758
| 0.33758
| 0
| 0
| 0.156
| 500
| 16
| 71
| 31.25
| 0.744076
| 0
| 0
| 0.333333
| 0
| 0
| 0.23
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.083333
| false
| 0
| 0.083333
| 0
| 0.166667
| 0.5
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
1b6a1a8b020372866e0ae6f6c0491d817248c97a
| 1,982
|
py
|
Python
|
rfim2d/tests/test_residuals.py
|
lxh3/rfim2d
|
5283d0df492ad20ecef30b17803437ca9155f8b3
|
[
"MIT"
] | null | null | null |
rfim2d/tests/test_residuals.py
|
lxh3/rfim2d
|
5283d0df492ad20ecef30b17803437ca9155f8b3
|
[
"MIT"
] | null | null | null |
rfim2d/tests/test_residuals.py
|
lxh3/rfim2d
|
5283d0df492ad20ecef30b17803437ca9155f8b3
|
[
"MIT"
] | null | null | null |
from rfim2d import residuals
r_list = [1., 2., 3.]
Sigma_list = [1., 1., 1.]
eta_list = [1., 1., 1.]
def test_Sigma_residual():
func_type = 'power law'
keys = ['rScale', 'rc', 'sScale', 'sigma']
fixed_dict = dict([('rScale', 1.)])
args = [r_list, Sigma_list, keys, fixed_dict, func_type]
params = [0., 1., 1.]
residual = residuals.Sigma_residual(params, args)
print(residual)
func_type = 'well-behaved'
keys = ['rScale', 'rc', 'sScale', 'df', 'B', 'C']
fixed_dict = dict([('df', 2.), ('C', 0.)])
args = [r_list, Sigma_list, keys, fixed_dict, func_type]
params = [1., 1., 1., 1.]
residual = residuals.Sigma_residual(params, args)
print(residual)
return
def test_eta_residual():
func_type = 'power law'
keys = ['rScale', 'rc', 'etaScale', 'betaDelta']
fixed_dict = dict([('etaScale', 1.)])
args = [r_list, eta_list, keys, fixed_dict, func_type]
params = [1., 1., 1.]
residual = residuals.eta_residual(params, args)
print(residual)
func_type = 'well-behaved'
keys = ['rScale', 'rc', 'etaScale', 'lambdaH', 'B', 'F']
fixed_dict = None
args = [r_list, eta_list, keys, fixed_dict, func_type]
params = [1., 1., 1., 1., 1., 1.]
residual = residuals.eta_residual(params, args)
print(residual)
return
#def test_joint_residual():
#
# func_type = 'power law'
# args = [r_list, Sigma_list, r_list, eta_list, func_type]
# param_dict = dict([('rScale',1.), ('rc', 0.), ('sScale', 1.), ('etaScale', 1.), ('sigma', 1.), ('betaDelta', 1.)])
# residual = residuals.joint_residual(param_dict, args)
# print(residual)
#
# func_type = 'well-behaved'
# args = [r_list, Sigma_list, r_list, eta_list, func_type]
# param_dict = dict([('rScale',1.), ('rc', 0.), ('sScale', 1.), ('etaScale', 1.), ('df', 2.), ('lambdaH', 1.), ('B', 1.), ('C', 1.), ('F', 1.)])
# residual = residuals.joint_residual(param_dict, args)
# print(residual)
#
# return
| 30.96875
| 147
| 0.588295
| 270
| 1,982
| 4.114815
| 0.151852
| 0.027003
| 0.024302
| 0.050405
| 0.783078
| 0.761476
| 0.761476
| 0.744374
| 0.656166
| 0.656166
| 0
| 0.028463
| 0.202321
| 1,982
| 63
| 148
| 31.460317
| 0.674257
| 0.317356
| 0
| 0.5
| 0
| 0
| 0.1092
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.055556
| false
| 0
| 0.027778
| 0
| 0.138889
| 0.111111
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
1b77560b34ed3076ab15f4796f20151b3d948bc5
| 137
|
py
|
Python
|
GPyNotebook/util.py
|
mzwiessele/GPyNotebook
|
668853c975d04f4f8ea9687921706497086e6f5e
|
[
"BSD-2-Clause"
] | 1
|
2016-12-20T13:53:50.000Z
|
2016-12-20T13:53:50.000Z
|
GPyNotebook/util.py
|
mzwiessele/GPyNotebook
|
668853c975d04f4f8ea9687921706497086e6f5e
|
[
"BSD-2-Clause"
] | null | null | null |
GPyNotebook/util.py
|
mzwiessele/GPyNotebook
|
668853c975d04f4f8ea9687921706497086e6f5e
|
[
"BSD-2-Clause"
] | null | null | null |
'''
Created on Mar 27, 2015
@author: maxz
'''
def lim(x, perc=.1):
r = x.max() - x.min()
return x.min()-perc*r, x.max()+perc*r
| 13.7
| 41
| 0.532847
| 26
| 137
| 2.807692
| 0.615385
| 0.054795
| 0.136986
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.065421
| 0.218978
| 137
| 9
| 42
| 15.222222
| 0.616822
| 0.277372
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
1b7d7f85ef752702b6f5880a676a80a5eebf0879
| 80
|
py
|
Python
|
src/lib/_MozillaCookieJar.py
|
timmartin/skulpt
|
2e3a3fbbaccc12baa29094a717ceec491a8a6750
|
[
"MIT"
] | 10
|
2015-11-13T17:02:40.000Z
|
2021-02-09T23:21:05.000Z
|
src/lib/_MozillaCookieJar.py
|
timmartin/skulpt
|
2e3a3fbbaccc12baa29094a717ceec491a8a6750
|
[
"MIT"
] | 43
|
2015-06-03T17:59:23.000Z
|
2021-09-17T10:45:21.000Z
|
src/lib/_MozillaCookieJar.py
|
timmartin/skulpt
|
2e3a3fbbaccc12baa29094a717ceec491a8a6750
|
[
"MIT"
] | 13
|
2017-07-02T03:16:46.000Z
|
2021-07-05T14:53:56.000Z
|
raise NotImplementedError("_MozillaCookieJar is not yet implemented in Skulpt")
| 40
| 79
| 0.85
| 9
| 80
| 7.444444
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.1
| 80
| 1
| 80
| 80
| 0.930556
| 0
| 0
| 0
| 0
| 0
| 0.625
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
1ba679f2a1e713e6dad3121aa14588edc28c0d76
| 181
|
py
|
Python
|
likes/apps.py
|
cxq1/c
|
52507017f676b4ebed561581ced0d4edf15cdc70
|
[
"MIT"
] | 1
|
2019-03-22T05:54:24.000Z
|
2019-03-22T05:54:24.000Z
|
likes/apps.py
|
cxq1/c
|
52507017f676b4ebed561581ced0d4edf15cdc70
|
[
"MIT"
] | 4
|
2021-04-08T18:40:39.000Z
|
2021-06-10T17:40:34.000Z
|
likes/apps.py
|
cxq1/c
|
52507017f676b4ebed561581ced0d4edf15cdc70
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
class LikesConfig(AppConfig):
name = 'likes'
def ready(self):
super(LikesConfig,self).ready()
from .import signals
| 22.625
| 40
| 0.646409
| 20
| 181
| 5.85
| 0.7
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.259669
| 181
| 8
| 41
| 22.625
| 0.873134
| 0
| 0
| 0
| 0
| 0
| 0.028571
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0.333333
| 0
| 0.833333
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
1bc3bceba00626b00593511b0ec9b1fc4de4d1b7
| 90
|
py
|
Python
|
main/classes/__init__.py
|
MHenderson1988/PyLineofsight
|
169a693320fd39ded4c76fd96b4613de2d0de85c
|
[
"MIT"
] | 4
|
2021-07-05T09:19:42.000Z
|
2022-01-22T01:51:02.000Z
|
main/classes/__init__.py
|
MHenderson1988/PyLineofsight
|
169a693320fd39ded4c76fd96b4613de2d0de85c
|
[
"MIT"
] | 3
|
2020-06-20T10:47:44.000Z
|
2022-01-11T19:50:27.000Z
|
main/classes/__init__.py
|
MHenderson1988/PyLineofsight
|
169a693320fd39ded4c76fd96b4613de2d0de85c
|
[
"MIT"
] | 2
|
2020-06-20T10:23:36.000Z
|
2022-01-11T16:14:30.000Z
|
class Location:
pass
class DecimalLocation:
pass
class GridLocation:
pass
| 8.181818
| 22
| 0.688889
| 9
| 90
| 6.888889
| 0.555556
| 0.290323
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.277778
| 90
| 10
| 23
| 9
| 0.953846
| 0
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.