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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d671e43d668464a09b7704aa5ba06a0ebf10176b
| 8,241
|
py
|
Python
|
core/evaluator/interpreter.py
|
kant/kg-goal-oriented-dialog
|
84fe6008036e34032c1c04dbca36c89809003276
|
[
"Apache-2.0"
] | null | null | null |
core/evaluator/interpreter.py
|
kant/kg-goal-oriented-dialog
|
84fe6008036e34032c1c04dbca36c89809003276
|
[
"Apache-2.0"
] | null | null | null |
core/evaluator/interpreter.py
|
kant/kg-goal-oriented-dialog
|
84fe6008036e34032c1c04dbca36c89809003276
|
[
"Apache-2.0"
] | null | null | null |
from __future__ import print_function, division
import numpy as np
import torch
from ..advisor.utils import to_var
class Interpreter(object):
""" Class to interpret models with given datasets.
Args:
batch_size (int, optional): batch size for interpreter (default: 64)
"""
def __init__(self, batch_size=64, use_cuda=True):
self.batch_size = batch_size
self.use_cuda = use_cuda
# def interpret(self, model, data, num_samples=20, out_sampled_dialog='sampled_dialogs.txt'):
# """ Interprete a model on given dataset and return results.
# Args:
# model (models.networks): model to interpret
# data (dataset.dataset.Dataset): dataset to interpret
# Returns:
# """
# # print('Data size: {}'.format(len(data.data)))
# model.eval()
# num_batches = data.num_batches(self.batch_size)
# num_samples_per_batch = max(int(num_samples / num_batches), 1)
# dialog_idx = 0
# with open(out_sampled_dialog, 'w') as f:
# for batch_xs, batch_ys in data.make_batches(self.batch_size):
# ctx, cands, ctx_turns_num, ctx_utter_len, cands_utter_len, db_fields, db_cells, db_rows_num = batch_xs
# ctx = to_var(torch.LongTensor(ctx), self.use_cuda, inference_mode=True)
# ctx_utter_len = to_var(torch.LongTensor(ctx_utter_len), self.use_cuda, inference_mode=True)
# ctx_turns_num = to_var(torch.LongTensor(ctx_turns_num), self.use_cuda, inference_mode=True)
# cands = to_var(torch.LongTensor(cands), self.use_cuda, inference_mode=True)
# cands_utter_len = to_var(torch.LongTensor(cands_utter_len), self.use_cuda, inference_mode=True)
# db_fields = to_var(torch.LongTensor(db_fields), self.use_cuda, inference_mode=True)
# db_cells = to_var(torch.LongTensor(db_cells), self.use_cuda, inference_mode=True)
# db_rows_num = to_var(torch.LongTensor(db_rows_num), self.use_cuda, inference_mode=True)
# targets = to_var(torch.LongTensor(batch_ys), self.use_cuda, inference_mode=True)
# _, all_theta, all_acc = model(ctx, ctx_utter_len, ctx_turns_num, cands, cands_utter_len, db_fields, db_cells, db_rows_num)
# # Interpret
# all_theta = all_theta.cpu() if self.use_cuda else all_theta
# all_acc = all_acc.cpu() if self.use_cuda else all_acc
# all_theta = all_theta.data.numpy()
# all_acc = all_acc.data.numpy()
# sampled_dialog_ids = np.random.choice(ctx.size(0), num_samples_per_batch, replace=False)
# for i in sampled_dialog_ids: # dialog-level
# dialog_idx += 1
# f.write('Sampled dialog {}\n'.format(dialog_idx))
# for j in range(0, int(ctx_turns_num[i]), 2): # turn-level
# utter_1 = 'Advisor: ' + ' '.join([data.vocab.itos[int(x)] for x in ctx[i][j]]) + '\n\n'
# utter_2 = 'Student: ' + ' '.join([data.vocab.itos[int(x)] for x in ctx[i][j + 1]]) + '\n\n'
# f.write(utter_1 + utter_2)
# theta = all_theta[i][int(j / 2)].tolist()
# f.write('recommend: {}\tquery: {}\tinform: {}\tsocial: {}\n\n'.format(theta[0], theta[1], theta[2], theta[3]))
# f.write('acc: ' + str(all_acc[i][int(j / 2)].tolist()) + '\n\n')
# f.write('argmax acc: {}\n\n'.format(' '.join([data.vocab.itos[int(x)] for x in db_fields[i][np.argmax(all_acc[i][int(j / 2)])]])))
# utter_2 = 'Advisor: ' + ' '.join([data.vocab.itos[int(x)] for x in cands[i][int(targets[i])]]) + '\n\n\n\n'
# f.write(utter_2)
def interpret(self, model, data, num_samples=20, out_sampled_dialog='sampled_dialogs.txt'):
""" Interprete a model on given dataset and return results.
Args:
model (models.networks): model to interpret
data (dataset.dataset.Dataset): dataset to interpret
Returns:
"""
# print('Data size: {}'.format(len(data.data)))
model.eval()
dialogs = []
for batch_xs, batch_ys in data.make_batches(self.batch_size):
ctx, cands, ctx_turns_num, ctx_utter_len, cands_utter_len, db_fields, db_cells, db_rows_num = batch_xs
ctx = to_var(torch.LongTensor(ctx), self.use_cuda, inference_mode=True)
ctx_utter_len = to_var(torch.LongTensor(ctx_utter_len), self.use_cuda, inference_mode=True)
ctx_turns_num = to_var(torch.LongTensor(ctx_turns_num), self.use_cuda, inference_mode=True)
cands = to_var(torch.LongTensor(cands), self.use_cuda, inference_mode=True)
cands_utter_len = to_var(torch.LongTensor(cands_utter_len), self.use_cuda, inference_mode=True)
db_fields = to_var(torch.LongTensor(db_fields), self.use_cuda, inference_mode=True)
db_cells = to_var(torch.LongTensor(db_cells), self.use_cuda, inference_mode=True)
db_rows_num = to_var(torch.LongTensor(db_rows_num), self.use_cuda, inference_mode=True)
targets = to_var(torch.LongTensor(batch_ys), self.use_cuda, inference_mode=True)
outputs, all_theta, all_acc, _ = model(ctx, ctx_utter_len, ctx_turns_num, cands, cands_utter_len, db_fields, db_cells, db_rows_num)
# Interpret
outputs = outputs.cpu().data.numpy() if self.use_cuda else outputs.data.numpy()
predictions = np.argsort(-outputs, axis=1) # decreasing order
ranks = []
for i in range(predictions.shape[0]):
ranks.append(np.nonzero(predictions[i] == batch_ys[i])[0][0] + 1)
ranks = np.array(ranks)
all_theta = all_theta.cpu() if self.use_cuda else all_theta
all_acc = all_acc.cpu() if self.use_cuda else all_acc
all_theta = all_theta.data.numpy()
all_acc = all_acc.data.numpy()
for i in range(ctx.size(0)): # dialog-level
if ranks[i] <= 10:
continue
dial_str = ''
for j in range(0, int(ctx_turns_num[i]), 2): # turn-level
dial_str += 'Advisor: ' + ' '.join([data.vocab.itos[int(x)] for x in ctx[i][j]]) + '\n\n'
dial_str += 'Student: ' + ' '.join([data.vocab.itos[int(x)] for x in ctx[i][j + 1]]) + '\n\n'
theta = all_theta[i][int(j / 2)].tolist()
dial_str += 'recommend: {}\tquery: {}\tinform: {}\tsocial: {}\n\n'.format(theta[0], theta[1], theta[2], theta[3])
dial_str += 'acc: {}\n\n'.format(str(all_acc[i][int(j / 2)].tolist()))
dial_str += 'argmax acc: {}\n\n'.format(' '.join([data.vocab.itos[int(x)] for x in db_fields[i][np.argmax(all_acc[i][int(j / 2)])]]))
# ground truth
dial_str += 'Advisor (ground truth): ' + ' '.join([data.vocab.itos[int(x)] for x in cands[i][int(targets[i])]]) + '\n\n'
# prediction
dial_str += 'Advisor (top 1 prediction): ' + ' '.join([data.vocab.itos[int(x)] for x in cands[i][int(predictions[i][0])]]) + '\n\n'
dial_str += 'Advisor (top 2 prediction): ' + ' '.join([data.vocab.itos[int(x)] for x in cands[i][int(predictions[i][1])]]) + '\n\n'
dial_str += 'Advisor (top 3 prediction): ' + ' '.join([data.vocab.itos[int(x)] for x in cands[i][int(predictions[i][2])]]) + '\n\n'
dial_str += 'Advisor (top 4 prediction): ' + ' '.join([data.vocab.itos[int(x)] for x in cands[i][int(predictions[i][3])]]) + '\n\n'
dial_str += 'Advisor (top 5 prediction): ' + ' '.join([data.vocab.itos[int(x)] for x in cands[i][int(predictions[i][4])]]) + '\n\n\n\n'
dialogs.append(dial_str)
with open(out_sampled_dialog, 'w') as f:
np.random.shuffle(dialogs)
for i, dial_str in enumerate(dialogs[:num_samples]):
f.write('Sampled dialog {}\n'.format(i))
f.write(dial_str)
| 60.153285
| 156
| 0.584759
| 1,156
| 8,241
| 3.944637
| 0.118512
| 0.039912
| 0.057895
| 0.078947
| 0.781579
| 0.772588
| 0.744518
| 0.741447
| 0.708991
| 0.708991
| 0
| 0.009292
| 0.268657
| 8,241
| 137
| 157
| 60.153285
| 0.747304
| 0.436719
| 0
| 0
| 0
| 0
| 0.076736
| 0
| 0.142857
| 0
| 0
| 0
| 0
| 1
| 0.035714
| false
| 0
| 0.071429
| 0
| 0.125
| 0.017857
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
d6768072eee96b46aa42f7fdfb26cf802b7fe8b4
| 42,638
|
py
|
Python
|
nlde/query/parsetab.py
|
Lars-H/federated_crop
|
8e936926462aa5df5a9b8e6b42b061a3623fddf4
|
[
"MIT"
] | 3
|
2020-10-30T20:52:31.000Z
|
2021-09-15T07:33:09.000Z
|
nlde/query/parsetab.py
|
Lars-H/crop
|
094af1639df8a3214cbfd9e50cca1841db9ddd9e
|
[
"MIT"
] | null | null | null |
nlde/query/parsetab.py
|
Lars-H/crop
|
094af1639df8a3214cbfd9e50cca1841db9ddd9e
|
[
"MIT"
] | null | null | null |
# parsetab.py
# This file is automatically generated. Do not edit.
# pylint: disable=W,C,R
_tabversion = '3.10'
_lr_method = 'LALR'
_lr_signature = 'ALL AND ASC BOOLEAN BOUND BY BYTE COLON COMA CONSTANT CONTAINS DATATYPE DATETIME DECIMAL DESC DISTINCT DIV DOUBLE EQUALS FILTER FLOAT GREATER GREATEREQ ID INT INTEGER ISBLANK ISIRI ISLITERAL ISURI LANG LANGMATCHES LCASE LESS LESSEQ LIMIT LKEY LONG LPAR MINUS NEG NEGATIVEINT NEQUALS NONNEGINT NONPOSINT NUMBER OFFSET OPTIONAL OR ORDER PLUS POINT POSITIVEINT PREFIX REGEX RKEY RPAR SAMETERM SELECT SHORT STR STRING TIMES UCASE UNION UNSIGNEDBYTE UNSIGNEDINT UNSIGNEDLONG UNSIGNEDSHORT UPPERCASE URI VARIABLE WHERE\n parse_sparql : prefix_list query order_by limit offset\n \n prefix_list : prefix prefix_list\n \n prefix_list : empty\n \n empty :\n \n prefix : PREFIX ID COLON URI\n \n uri : ID COLON ID\n \n uri : ID COLON URI\n \n uri : URI\n \n order_by : ORDER BY var_order_list desc_var\n \n order_by : empty\n \n var_order_list : empty\n \n var_order_list : var_order_list desc_var\n \n desc_var : DESC LPAR VARIABLE RPAR\n \n desc_var : VARIABLE\n \n desc_var : ASC LPAR VARIABLE RPAR\n \n desc_var : unary_func LPAR desc_var RPAR\n \n limit : LIMIT NUMBER\n \n limit : empty\n \n offset : OFFSET NUMBER\n \n offset : empty\n \n query : SELECT distinct var_list WHERE LKEY group_graph_pattern RKEY\n \n query : SELECT distinct ALL WHERE LKEY group_graph_pattern RKEY\n \n distinct : DISTINCT\n \n distinct : empty\n \n group_graph_pattern : union_block\n \n union_block : pjoin_block rest_union_block POINT pjoin_block\n \n union_block : pjoin_block rest_union_block pjoin_block\n \n union_block : pjoin_block rest_union_block\n \n pjoin_block : LKEY join_block RKEY\n \n pjoin_block : join_block\n \n pjoin_block : empty\n \n rest_union_block : empty\n \n rest_union_block : UNION LKEY join_block rest_union_block RKEY rest_union_block\n \n join_block : LKEY union_block RKEY rest_join_block\n \n join_block : bgp rest_join_block\n \n rest_join_block : empty\n \n rest_join_block : POINT bgp rest_join_block\n \n rest_join_block : bgp rest_join_block\n \n bgp : LKEY bgp UNION bgp rest_union_block RKEY\n \n bgp : bgp UNION bgp rest_union_block\n \n bgp : triple\n \n bgp : FILTER LPAR expression RPAR\n \n bgp : FILTER express_rel\n \n bgp : OPTIONAL LKEY group_graph_pattern RKEY\n \n bgp : LKEY join_block RKEY\n \n expression : express_rel LOGOP expression\n \n expression : express_rel\n \n expression : LPAR expression RPAR\n \n express_rel : express_arg RELOP express_rel\n \n express_rel : express_arg\n \n express_rel : LPAR express_rel RPAR\n \n express_rel : NEG LPAR expression RPAR\n \n express_rel : NEG express_rel\n \n express_arg : uri\n \n express_arg : VARIABLE\n \n express_arg : CONSTANT\n \n express_arg : NUMBER\n \n express_arg : NUMBER POINT NUMBER\n \n express_arg : REGEX LPAR express_arg COMA pattern_arg regex_flag\n \n regex_flag : RPAR\n \n regex_flag : COMA pattern_arg RPAR\n \n pattern_arg : CONSTANT\n \n express_arg : binary_func LPAR express_arg COMA express_arg RPAR\n \n express_arg : unary_func LPAR express_arg RPAR\n \n express_arg : UNARYOP express_arg\n \n express_arg : express_arg ARITOP express_arg\n \n express_arg : LPAR express_arg RPAR\n \n express_arg : express_arg RELOP express_arg\n \n ARITOP : PLUS\n \n ARITOP : MINUS\n \n ARITOP : TIMES\n \n ARITOP : DIV\n \n UNARYOP : PLUS\n \n UNARYOP : MINUS\n \n LOGOP : AND\n \n LOGOP : OR\n \n RELOP : EQUALS\n \n RELOP : LESS\n \n RELOP : LESSEQ\n \n RELOP : GREATER\n \n RELOP : GREATEREQ\n \n RELOP : NEQUALS\n \n binary_func : REGEX\n \n binary_func : SAMETERM\n \n binary_func : LANGMATCHES\n \n binary_func : CONSTANT\n \n binary_func : CONTAINS\n \n unary_func : BOUND\n \n unary_func : ISIRI\n \n unary_func : ISURI\n \n unary_func : ISBLANK\n \n unary_func : ISLITERAL\n \n unary_func : LANG\n \n unary_func : DATATYPE\n \n unary_func : STR\n \n unary_func : UPPERCASE\n \n unary_func : DOUBLE\n | INTEGER\n | DECIMAL\n | FLOAT\n | STRING\n | BOOLEAN\n | DATETIME\n | NONPOSINT\n | NEGATIVEINT\n | LONG\n | INT\n | SHORT\n | BYTE\n | NONNEGINT\n | UNSIGNEDLONG\n | UNSIGNEDINT\n | UNSIGNEDSHORT\n | UNSIGNEDBYTE\n | POSITIVEINT\n \n unary_func : ID COLON ID\n \n unary_func : uri\n \n unary_func : UCASE\n \n unary_func : LCASE\n \n var_list : var_list VARIABLE\n \n var_list : VARIABLE\n \n triple : subject predicate object\n \n predicate : ID\n \n predicate : uri\n \n predicate : VARIABLE\n \n subject : uri\n \n subject : VARIABLE\n \n object : uri\n \n object : VARIABLE\n \n object : CONSTANT\n '
_lr_action_items = {'LPAR':([35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,56,57,59,60,61,63,64,65,66,67,68,69,70,71,72,92,95,96,119,120,121,124,125,127,128,129,130,133,134,135,136,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,213,215,224,],[-105,-108,-90,-93,-113,-114,-94,-96,-112,-119,-106,-91,75,-92,-98,-101,-99,-8,-103,-95,-109,-115,77,-110,-118,-117,-107,-97,-100,-88,-89,-102,78,-104,-111,119,-6,-7,161,-86,165,-74,168,-84,-73,-85,181,183,-87,-117,185,161,161,183,208,-78,-77,-70,-81,-79,-69,183,-72,-71,-82,-80,183,183,183,-75,161,-76,208,-6,183,183,]),'SHORT':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,36,-11,-14,-12,36,36,36,36,-74,-73,36,-15,-13,-16,36,36,36,36,-78,-77,-70,-81,-79,-69,36,-72,-71,-82,-80,36,36,36,-75,36,-76,36,36,36,]),'CONSTANT':([52,92,96,99,100,101,102,119,121,124,128,133,160,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,226,239,],[-8,120,-7,141,-124,-125,-123,120,120,-74,-73,120,-6,120,120,120,120,-78,-77,-70,-81,-79,-69,120,-72,-71,-82,-80,120,120,120,-75,120,-76,120,120,120,233,233,]),'LESS':([52,96,120,122,123,126,135,162,184,199,206,207,209,211,212,213,214,216,227,228,232,236,237,238,241,],[-8,-7,-56,-57,-55,170,-54,170,170,-67,-58,170,170,170,170,-6,170,170,170,-64,170,-63,-59,-60,-61,]),'NEG':([92,119,121,161,165,169,170,171,173,174,179,180,200,201,203,208,],[121,121,121,121,121,121,-78,-77,-81,-79,-82,-80,-75,121,-76,121,]),'NEQUALS':([52,96,120,122,123,126,135,162,184,199,206,207,209,211,212,213,214,216,227,228,232,236,237,238,241,],[-8,-7,-56,-57,-55,179,-54,179,179,-67,-58,179,179,179,179,-6,179,179,179,-64,179,-63,-59,-60,-61,]),'NUMBER':([18,26,92,119,121,124,128,133,161,165,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[25,34,122,122,122,-74,-73,122,122,122,206,122,122,-78,-77,-70,-81,-79,-69,122,-72,-71,-82,-80,122,122,122,-75,122,-76,122,122,122,]),'BOUND':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,67,-11,-14,-12,67,67,67,67,-74,-73,67,-15,-13,-16,67,67,67,67,-78,-77,-70,-81,-79,-69,67,-72,-71,-82,-80,67,67,67,-75,67,-76,67,67,67,]),'COMA':([52,96,120,122,123,135,184,199,206,207,211,212,213,227,228,233,234,236,237,238,241,],[-8,-7,-56,-57,-55,-54,-65,-67,-58,224,-66,226,-6,-68,-64,-62,239,-63,-59,-60,-61,]),'PREFIX':([0,3,17,],[1,1,-5,]),'ISURI':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,37,-11,-14,-12,37,37,37,37,-74,-73,37,-15,-13,-16,37,37,37,37,-78,-77,-70,-81,-79,-69,37,-72,-71,-82,-80,37,37,37,-75,37,-76,37,37,37,]),'LIMIT':([8,11,13,55,62,110,137,138,139,140,],[-4,18,-10,-14,-9,-22,-21,-15,-13,-16,]),'DIV':([52,96,120,122,123,126,135,162,184,199,206,207,209,211,212,213,214,216,227,228,232,236,237,238,241,],[-8,-7,-56,-57,-55,177,-54,177,177,-67,-58,177,177,177,177,-6,177,177,177,-64,177,-63,-59,-60,-61,]),'MINUS':([52,92,96,119,120,121,122,123,124,126,128,133,135,161,162,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,184,185,199,200,201,203,206,207,208,209,211,212,213,214,215,216,224,227,228,232,236,237,238,241,],[-8,124,-7,124,-56,124,-57,-55,-74,172,-73,124,-54,124,172,124,124,124,-78,-77,-70,-81,-79,-69,124,-72,-71,-82,-80,124,124,172,124,-67,-75,124,-76,-58,172,124,172,172,172,-6,172,124,172,124,172,-64,172,-63,-59,-60,-61,]),'ISBLANK':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,46,-11,-14,-12,46,46,46,46,-74,-73,46,-15,-13,-16,46,46,46,46,-78,-77,-70,-81,-79,-69,46,-72,-71,-82,-80,46,46,46,-75,46,-76,46,46,46,]),'SELECT':([0,3,4,5,7,17,],[-4,-4,9,-3,-2,-5,]),'LKEY':([31,33,52,73,74,80,82,83,84,86,87,88,96,103,104,105,106,107,108,109,111,112,113,115,116,117,120,122,123,126,132,135,141,142,143,144,145,146,147,149,150,152,153,155,156,157,158,159,160,166,184,186,187,188,189,190,191,193,195,196,197,199,202,204,206,209,210,211,213,217,219,223,227,228,230,231,235,236,237,238,241,],[73,74,-8,88,88,-41,106,-30,109,-4,-31,116,-7,106,106,-36,149,106,-35,88,152,88,-32,-30,158,106,-56,-57,-55,-50,-43,-54,-130,-122,-128,-129,-38,106,106,158,-4,193,88,106,-29,-30,158,106,-6,-53,-65,-37,-45,-30,217,-40,-44,158,-34,-29,-4,-67,-51,-42,-58,-50,-49,-66,-6,193,-40,-52,-68,-64,-4,-39,-33,-63,-59,-60,-61,]),'LANG':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,38,-11,-14,-12,38,38,38,38,-74,-73,38,-15,-13,-16,38,38,38,38,-78,-77,-70,-81,-79,-69,38,-72,-71,-82,-80,38,38,38,-75,38,-76,38,38,38,]),'ASC':([21,29,30,55,62,78,138,139,140,],[-4,47,-11,-14,-12,47,-15,-13,-16,]),'UNSIGNEDBYTE':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,40,-11,-14,-12,40,40,40,40,-74,-73,40,-15,-13,-16,40,40,40,40,-78,-77,-70,-81,-79,-69,40,-72,-71,-82,-80,40,40,40,-75,40,-76,40,40,40,]),'TIMES':([52,96,120,122,123,126,135,162,184,199,206,207,209,211,212,213,214,216,227,228,232,236,237,238,241,],[-8,-7,-56,-57,-55,178,-54,178,178,-67,-58,178,178,178,178,-6,178,178,178,-64,178,-63,-59,-60,-61,]),'POINT':([52,73,74,80,82,83,86,87,88,96,103,105,108,109,112,113,115,116,117,120,122,123,126,132,135,141,142,143,144,145,146,147,149,150,155,156,157,158,160,166,184,186,187,188,190,191,193,195,196,197,199,202,204,206,209,210,211,213,219,223,227,228,230,231,235,236,237,238,241,],[-8,-4,-4,-41,104,-30,-4,-31,-4,-7,104,-36,-35,-4,153,-32,-30,-4,104,-56,167,-55,-50,-43,-54,-130,-122,-128,-129,-38,104,104,-4,-4,104,-29,-30,-4,-6,-53,-65,-37,-45,-30,-40,-44,-4,-34,-29,-4,-67,-51,-42,-58,-50,-49,-66,-6,-40,-52,-68,-64,-4,-39,-33,-63,-59,-60,-61,]),'DISTINCT':([9,],[15,]),'UPPERCASE':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,42,-11,-14,-12,42,42,42,42,-74,-73,42,-15,-13,-16,42,42,42,42,-78,-77,-70,-81,-79,-69,42,-72,-71,-82,-80,42,42,42,-75,42,-76,42,42,42,]),'UNSIGNEDINT':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,43,-11,-14,-12,43,43,43,43,-74,-73,43,-15,-13,-16,43,43,43,43,-78,-77,-70,-81,-79,-69,43,-72,-71,-82,-80,43,43,43,-75,43,-76,43,43,43,]),'SAMETERM':([92,119,121,124,128,133,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[127,127,127,-74,-73,127,127,127,127,127,-78,-77,-70,-81,-79,-69,127,-72,-71,-82,-80,127,127,127,-75,127,-76,127,127,127,]),'LCASE':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,44,-11,-14,-12,44,44,44,44,-74,-73,44,-15,-13,-16,44,44,44,44,-78,-77,-70,-81,-79,-69,44,-72,-71,-82,-80,44,44,44,-75,44,-76,44,44,44,]),'LONG':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,45,-11,-14,-12,45,45,45,45,-74,-73,45,-15,-13,-16,45,45,45,45,-78,-77,-70,-81,-79,-69,45,-72,-71,-82,-80,45,45,45,-75,45,-76,45,45,45,]),'ORDER':([8,110,137,],[12,-22,-21,]),'UNSIGNEDSHORT':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,39,-11,-14,-12,39,39,39,39,-74,-73,39,-15,-13,-16,39,39,39,39,-78,-77,-70,-81,-79,-69,39,-72,-71,-82,-80,39,39,39,-75,39,-76,39,39,39,]),'GREATEREQ':([52,96,120,122,123,126,135,162,184,199,206,207,209,211,212,213,214,216,227,228,232,236,237,238,241,],[-8,-7,-56,-57,-55,173,-54,173,173,-67,-58,173,173,173,173,-6,173,173,173,-64,173,-63,-59,-60,-61,]),'LESSEQ':([52,96,120,122,123,126,135,162,184,199,206,207,209,211,212,213,214,216,227,228,232,236,237,238,241,],[-8,-7,-56,-57,-55,174,-54,174,174,-67,-58,174,174,174,174,-6,174,174,174,-64,174,-63,-59,-60,-61,]),'COLON':([6,58,90,102,131,],[10,76,118,118,182,]),'LANGMATCHES':([92,119,121,124,128,133,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[129,129,129,-74,-73,129,129,129,129,129,-78,-77,-70,-81,-79,-69,129,-72,-71,-82,-80,129,129,129,-75,129,-76,129,129,129,]),'ISLITERAL':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,48,-11,-14,-12,48,48,48,48,-74,-73,48,-15,-13,-16,48,48,48,48,-78,-77,-70,-81,-79,-69,48,-72,-71,-82,-80,48,48,48,-75,48,-76,48,48,48,]),'OPTIONAL':([52,73,74,80,82,83,86,87,88,96,103,104,105,106,107,108,109,112,113,115,116,117,120,122,123,126,132,135,141,142,143,144,145,146,147,149,150,152,153,155,156,157,158,159,160,166,184,186,187,188,189,190,191,193,195,196,197,199,202,204,206,209,210,211,213,217,219,223,227,228,230,231,235,236,237,238,241,],[-8,84,84,-41,84,-30,-4,-31,84,-7,84,84,-36,84,84,-35,84,84,-32,-30,84,84,-56,-57,-55,-50,-43,-54,-130,-122,-128,-129,-38,84,84,84,-4,84,84,84,-29,-30,84,84,-6,-53,-65,-37,-45,-30,84,-40,-44,84,-34,-29,-4,-67,-51,-42,-58,-50,-49,-66,-6,84,-40,-52,-68,-64,-4,-39,-33,-63,-59,-60,-61,]),'$end':([2,8,11,13,19,20,25,27,28,34,55,62,110,137,138,139,140,],[0,-4,-4,-10,-4,-18,-17,-1,-20,-19,-14,-9,-22,-21,-15,-13,-16,]),'PLUS':([52,92,96,119,120,121,122,123,124,126,128,133,135,161,162,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,184,185,199,200,201,203,206,207,208,209,211,212,213,214,215,216,224,227,228,232,236,237,238,241,],[-8,128,-7,128,-56,128,-57,-55,-74,175,-73,128,-54,128,175,128,128,128,-78,-77,-70,-81,-79,-69,128,-72,-71,-82,-80,128,128,175,128,-67,-75,128,-76,-58,175,128,175,175,175,-6,175,128,175,128,175,-64,175,-63,-59,-60,-61,]),'CONTAINS':([92,119,121,124,128,133,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[134,134,134,-74,-73,134,134,134,134,134,-78,-77,-70,-81,-79,-69,134,-72,-71,-82,-80,134,134,134,-75,134,-76,134,134,134,]),'RPAR':([52,55,94,96,97,98,120,122,123,126,135,138,139,140,162,163,164,166,184,198,199,202,205,206,209,210,211,213,214,216,220,221,222,223,225,227,228,232,233,234,236,237,238,240,241,],[-8,-14,138,-7,139,140,-56,-57,-55,-50,-54,-15,-13,-16,199,202,204,-53,-65,220,-67,-51,223,-58,-50,-49,-66,-6,199,228,-48,-47,-46,-52,202,-68,-64,236,-62,238,-63,-59,-60,241,-61,]),'STRING':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,50,-11,-14,-12,50,50,50,50,-74,-73,50,-15,-13,-16,50,50,50,50,-78,-77,-70,-81,-79,-69,50,-72,-71,-82,-80,50,50,50,-75,50,-76,50,50,50,]),'UNION':([52,73,74,80,82,83,86,87,88,96,103,105,108,109,113,115,116,117,120,122,123,126,132,135,141,142,143,144,145,146,147,149,150,155,156,157,158,160,166,184,186,187,188,190,191,192,193,195,196,197,199,202,204,206,209,210,211,213,219,223,227,228,229,230,231,235,236,237,238,241,],[-8,-4,-4,-41,107,-30,111,-31,-4,-7,107,-36,-35,-4,-32,-30,-4,159,-56,-57,-55,-50,-43,-54,-130,-122,-128,-129,-38,107,159,-4,189,-4,-29,-30,-4,-6,-53,-65,-37,-45,-30,-40,-44,111,-4,-34,-29,189,-67,-51,-42,-58,-50,-49,-66,-6,-40,-52,-68,-64,111,111,-39,-33,-63,-59,-60,-61,]),'DECIMAL':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,51,-11,-14,-12,51,51,51,51,-74,-73,51,-15,-13,-16,51,51,51,51,-78,-77,-70,-81,-79,-69,51,-72,-71,-82,-80,51,51,51,-75,51,-76,51,51,51,]),'RKEY':([52,73,74,79,80,82,83,85,86,87,88,93,96,103,105,108,109,112,113,114,115,116,117,120,122,123,126,132,135,141,142,143,144,145,146,147,148,149,150,151,153,154,155,156,157,158,160,166,184,186,187,188,190,191,192,193,194,195,196,197,199,202,204,206,209,210,211,213,218,219,223,227,228,229,230,231,235,236,237,238,241,],[-8,-4,-4,-25,-41,-4,-30,110,-4,-31,-4,137,-7,-4,-36,-35,-4,-4,-32,155,156,-4,-4,-56,-57,-55,-50,-43,-54,-130,-122,-128,-129,-38,-4,-4,187,-4,-4,191,-4,-27,-4,-29,196,-4,-6,-53,-65,-37,-45,187,-40,-44,-4,-4,-26,-34,-29,-4,-67,-51,-42,-58,-50,-49,-66,-6,230,231,-52,-68,-64,187,-4,-39,-33,-63,-59,-60,-61,]),'URI':([10,21,29,30,52,55,62,73,74,76,78,80,81,82,83,86,87,88,89,91,92,96,99,100,101,102,103,104,105,106,107,108,109,112,113,115,116,117,118,119,120,121,122,123,124,126,128,132,133,135,138,139,140,141,142,143,144,145,146,147,149,150,152,153,155,156,157,158,159,160,161,165,166,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,193,195,196,197,199,200,201,202,203,204,206,208,209,210,211,213,215,217,219,223,224,227,228,230,231,235,236,237,238,241,],[17,-4,52,-11,-8,-14,-12,52,52,96,52,-41,52,52,-30,-4,-31,52,-127,-126,52,-7,52,-124,-125,-123,52,52,-36,52,52,-35,52,52,-32,-30,52,52,96,52,-56,52,-57,-55,-74,-50,-73,-43,52,-54,-15,-13,-16,-130,-122,-128,-129,-38,52,52,52,-4,52,52,52,-29,-30,52,52,-6,52,52,-53,52,52,-78,-77,-70,-81,-79,-69,52,-72,-71,-82,-80,52,96,52,-65,52,-37,-45,-30,52,-40,-44,52,-34,-29,-4,-67,-75,52,-51,-76,-42,-58,52,-50,-49,-66,-6,52,52,-40,-52,52,-68,-64,-4,-39,-33,-63,-59,-60,-61,]),'DATETIME':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,53,-11,-14,-12,53,53,53,53,-74,-73,53,-15,-13,-16,53,53,53,53,-78,-77,-70,-81,-79,-69,53,-72,-71,-82,-80,53,53,53,-75,53,-76,53,53,53,]),'EQUALS':([52,96,120,122,123,126,135,162,184,199,206,207,209,211,212,213,214,216,227,228,232,236,237,238,241,],[-8,-7,-56,-57,-55,171,-54,171,171,-67,-58,171,171,171,171,-6,171,171,171,-64,171,-63,-59,-60,-61,]),'REGEX':([92,119,121,124,128,133,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[130,130,130,-74,-73,130,130,130,130,130,-78,-77,-70,-81,-79,-69,130,-72,-71,-82,-80,130,130,130,-75,130,-76,130,130,130,]),'STR':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,54,-11,-14,-12,54,54,54,54,-74,-73,54,-15,-13,-16,54,54,54,54,-78,-77,-70,-81,-79,-69,54,-72,-71,-82,-80,54,54,54,-75,54,-76,54,54,54,]),'OFFSET':([8,11,13,19,20,25,55,62,110,137,138,139,140,],[-4,-4,-10,26,-18,-17,-14,-9,-22,-21,-15,-13,-16,]),'VARIABLE':([9,14,15,16,21,23,24,29,30,32,52,55,62,73,74,75,77,78,80,81,82,83,86,87,88,89,91,92,96,99,100,101,102,103,104,105,106,107,108,109,112,113,115,116,117,119,120,121,122,123,124,126,128,132,133,135,138,139,140,141,142,143,144,145,146,147,149,150,152,153,155,156,157,158,159,160,161,165,166,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,184,185,186,187,188,189,190,191,193,195,196,197,199,200,201,202,203,204,206,208,209,210,211,213,215,217,219,223,224,227,228,230,231,235,236,237,238,241,],[-4,23,-23,-24,-4,-121,32,55,-11,-120,-8,-14,-12,89,89,94,97,55,-41,101,89,-30,-4,-31,89,-127,-126,123,-7,144,-124,-125,-123,89,89,-36,89,89,-35,89,89,-32,-30,89,89,123,-56,123,-57,-55,-74,-50,-73,-43,123,-54,-15,-13,-16,-130,-122,-128,-129,-38,89,89,89,-4,89,89,89,-29,-30,89,89,-6,123,123,-53,123,123,-78,-77,-70,-81,-79,-69,123,-72,-71,-82,-80,123,123,-65,123,-37,-45,-30,89,-40,-44,89,-34,-29,-4,-67,-75,123,-51,-76,-42,-58,123,-50,-49,-66,-6,123,89,-40,-52,123,-68,-64,-4,-39,-33,-63,-59,-60,-61,]),'BYTE':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,56,-11,-14,-12,56,56,56,56,-74,-73,56,-15,-13,-16,56,56,56,56,-78,-77,-70,-81,-79,-69,56,-72,-71,-82,-80,56,56,56,-75,56,-76,56,56,56,]),'POSITIVEINT':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,57,-11,-14,-12,57,57,57,57,-74,-73,57,-15,-13,-16,57,57,57,57,-78,-77,-70,-81,-79,-69,57,-72,-71,-82,-80,57,57,57,-75,57,-76,57,57,57,]),'BY':([12,],[21,]),'ID':([1,21,29,30,52,55,62,73,74,76,78,80,81,82,83,86,87,88,89,91,92,96,99,100,101,102,103,104,105,106,107,108,109,112,113,115,116,117,118,119,120,121,122,123,124,126,128,132,133,135,138,139,140,141,142,143,144,145,146,147,149,150,152,153,155,156,157,158,159,160,161,165,166,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,193,195,196,197,199,200,201,202,203,204,206,208,209,210,211,213,215,217,219,223,224,227,228,230,231,235,236,237,238,241,],[6,-4,58,-11,-8,-14,-12,90,90,95,58,-41,102,90,-30,-4,-31,90,-127,-126,131,-7,90,-124,-125,-123,90,90,-36,90,90,-35,90,90,-32,-30,90,90,160,131,-56,131,-57,-55,-74,-50,-73,-43,131,-54,-15,-13,-16,-130,-122,-128,-129,-38,90,90,90,-4,90,90,90,-29,-30,90,90,-6,131,131,-53,131,131,-78,-77,-70,-81,-79,-69,131,-72,-71,-82,-80,131,213,131,-65,131,-37,-45,-30,90,-40,-44,90,-34,-29,-4,-67,-75,131,-51,-76,-42,-58,131,-50,-49,-66,-6,131,90,-40,-52,131,-68,-64,-4,-39,-33,-63,-59,-60,-61,]),'DESC':([21,29,30,55,62,78,138,139,140,],[-4,59,-11,-14,-12,59,-15,-13,-16,]),'AND':([52,96,120,122,123,126,135,162,163,166,184,199,202,206,209,210,211,213,221,223,227,228,236,237,238,241,],[-8,-7,-56,-57,-55,-50,-54,-50,200,-53,-65,-67,-51,-58,-50,-49,-66,-6,200,-52,-68,-64,-63,-59,-60,-61,]),'OR':([52,96,120,122,123,126,135,162,163,166,184,199,202,206,209,210,211,213,221,223,227,228,236,237,238,241,],[-8,-7,-56,-57,-55,-50,-54,-50,203,-53,-65,-67,-51,-58,-50,-49,-66,-6,203,-52,-68,-64,-63,-59,-60,-61,]),'ALL':([9,14,15,16,],[-4,22,-23,-24,]),'NEGATIVEINT':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,35,-11,-14,-12,35,35,35,35,-74,-73,35,-15,-13,-16,35,35,35,35,-78,-77,-70,-81,-79,-69,35,-72,-71,-82,-80,35,35,35,-75,35,-76,35,35,35,]),'UCASE':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,61,-11,-14,-12,61,61,61,61,-74,-73,61,-15,-13,-16,61,61,61,61,-78,-77,-70,-81,-79,-69,61,-72,-71,-82,-80,61,61,61,-75,61,-76,61,61,61,]),'GREATER':([52,96,120,122,123,126,135,162,184,199,206,207,209,211,212,213,214,216,227,228,232,236,237,238,241,],[-8,-7,-56,-57,-55,180,-54,180,180,-67,-58,180,180,180,180,-6,180,180,180,-64,180,-63,-59,-60,-61,]),'INT':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,64,-11,-14,-12,64,64,64,64,-74,-73,64,-15,-13,-16,64,64,64,64,-78,-77,-70,-81,-79,-69,64,-72,-71,-82,-80,64,64,64,-75,64,-76,64,64,64,]),'INTEGER':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,49,-11,-14,-12,49,49,49,49,-74,-73,49,-15,-13,-16,49,49,49,49,-78,-77,-70,-81,-79,-69,49,-72,-71,-82,-80,49,49,49,-75,49,-76,49,49,49,]),'FLOAT':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,66,-11,-14,-12,66,66,66,66,-74,-73,66,-15,-13,-16,66,66,66,66,-78,-77,-70,-81,-79,-69,66,-72,-71,-82,-80,66,66,66,-75,66,-76,66,66,66,]),'NONNEGINT':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,60,-11,-14,-12,60,60,60,60,-74,-73,60,-15,-13,-16,60,60,60,60,-78,-77,-70,-81,-79,-69,60,-72,-71,-82,-80,60,60,60,-75,60,-76,60,60,60,]),'ISIRI':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,68,-11,-14,-12,68,68,68,68,-74,-73,68,-15,-13,-16,68,68,68,68,-78,-77,-70,-81,-79,-69,68,-72,-71,-82,-80,68,68,68,-75,68,-76,68,68,68,]),'WHERE':([22,23,24,32,],[31,-121,33,-120,]),'DATATYPE':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,41,-11,-14,-12,41,41,41,41,-74,-73,41,-15,-13,-16,41,41,41,41,-78,-77,-70,-81,-79,-69,41,-72,-71,-82,-80,41,41,41,-75,41,-76,41,41,41,]),'BOOLEAN':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,69,-11,-14,-12,69,69,69,69,-74,-73,69,-15,-13,-16,69,69,69,69,-78,-77,-70,-81,-79,-69,69,-72,-71,-82,-80,69,69,69,-75,69,-76,69,69,69,]),'FILTER':([52,73,74,80,82,83,86,87,88,96,103,104,105,106,107,108,109,112,113,115,116,117,120,122,123,126,132,135,141,142,143,144,145,146,147,149,150,152,153,155,156,157,158,159,160,166,184,186,187,188,189,190,191,193,195,196,197,199,202,204,206,209,210,211,213,217,219,223,227,228,230,231,235,236,237,238,241,],[-8,92,92,-41,92,-30,-4,-31,92,-7,92,92,-36,92,92,-35,92,92,-32,-30,92,92,-56,-57,-55,-50,-43,-54,-130,-122,-128,-129,-38,92,92,92,-4,92,92,92,-29,-30,92,92,-6,-53,-65,-37,-45,-30,92,-40,-44,92,-34,-29,-4,-67,-51,-42,-58,-50,-49,-66,-6,92,-40,-52,-68,-64,-4,-39,-33,-63,-59,-60,-61,]),'DOUBLE':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,65,-11,-14,-12,65,65,65,65,-74,-73,65,-15,-13,-16,65,65,65,65,-78,-77,-70,-81,-79,-69,65,-72,-71,-82,-80,65,65,65,-75,65,-76,65,65,65,]),'NONPOSINT':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,71,-11,-14,-12,71,71,71,71,-74,-73,71,-15,-13,-16,71,71,71,71,-78,-77,-70,-81,-79,-69,71,-72,-71,-82,-80,71,71,71,-75,71,-76,71,71,71,]),'UNSIGNEDLONG':([21,29,30,55,62,78,92,119,121,124,128,133,138,139,140,161,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,185,200,201,203,208,215,224,],[-4,72,-11,-14,-12,72,72,72,72,-74,-73,72,-15,-13,-16,72,72,72,72,-78,-77,-70,-81,-79,-69,72,-72,-71,-82,-80,72,72,72,-75,72,-76,72,72,72,]),}
_lr_action = {}
for _k, _v in _lr_action_items.items():
for _x,_y in zip(_v[0],_v[1]):
if not _x in _lr_action: _lr_action[_x] = {}
_lr_action[_x][_k] = _y
del _lr_action_items
_lr_goto_items = {'LOGOP':([163,221,],[201,201,]),'regex_flag':([234,],[237,]),'parse_sparql':([0,],[2,]),'rest_union_block':([86,150,192,197,229,230,],[112,190,218,219,218,235,]),'prefix':([0,3,],[3,3,]),'triple':([73,74,82,88,103,104,106,107,109,112,116,117,146,147,149,152,153,155,158,159,189,193,217,],[80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,]),'union_block':([73,74,88,109,116,149,158,193,],[79,79,114,79,114,114,114,114,]),'query':([4,],[8,]),'var_list':([14,],[24,]),'subject':([73,74,82,88,103,104,106,107,109,112,116,117,146,147,149,152,153,155,158,159,189,193,217,],[81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,]),'binary_func':([92,119,121,133,161,165,168,169,176,181,183,185,201,208,215,224,],[125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,]),'order_by':([8,],[11,]),'distinct':([9,],[14,]),'express_arg':([92,119,121,133,161,165,168,169,176,181,183,185,201,208,215,224,],[126,162,126,184,162,162,207,209,211,212,214,216,126,162,227,232,]),'group_graph_pattern':([73,74,109,],[85,93,151,]),'pjoin_block':([73,74,88,109,112,116,149,153,158,193,],[86,86,86,86,154,86,86,194,86,86,]),'var_order_list':([21,],[29,]),'prefix_list':([0,3,],[4,7,]),'empty':([0,3,8,9,11,19,21,73,74,82,86,88,103,109,112,116,117,146,147,149,150,153,155,158,192,193,197,229,230,],[5,5,13,16,20,28,30,87,87,105,113,87,105,87,87,87,105,105,105,87,113,87,105,87,113,87,113,113,113,]),'ARITOP':([126,162,184,207,209,211,212,214,216,227,232,],[176,176,176,176,176,176,176,176,176,176,176,]),'predicate':([81,],[99,]),'RELOP':([126,162,184,207,209,211,212,214,216,227,232,],[169,169,215,215,169,215,215,215,215,215,215,]),'object':([99,],[142,]),'rest_join_block':([82,103,117,146,147,155,],[108,145,108,186,108,195,]),'pattern_arg':([226,239,],[234,240,]),'offset':([19,],[27,]),'join_block':([73,74,88,106,109,112,116,149,152,153,158,193,217,],[83,83,115,148,83,83,157,188,192,83,157,188,229,]),'express_rel':([92,119,121,161,165,169,201,208,],[132,163,166,163,163,210,221,225,]),'desc_var':([29,78,],[62,98,]),'UNARYOP':([92,119,121,133,161,165,168,169,176,181,183,185,201,208,215,224,],[133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,]),'uri':([29,73,74,78,81,82,88,92,99,103,104,106,107,109,112,116,117,119,121,133,146,147,149,152,153,155,158,159,161,165,168,169,176,181,183,185,189,193,201,208,215,217,224,],[63,91,91,63,100,91,91,135,143,91,91,91,91,91,91,91,91,135,135,135,91,91,91,91,91,91,91,91,135,135,135,135,135,135,135,135,91,91,135,135,135,91,135,]),'bgp':([73,74,82,88,103,104,106,107,109,112,116,117,146,147,149,152,153,155,158,159,189,193,217,],[82,82,103,117,103,146,147,150,82,82,147,103,103,103,147,82,82,103,147,197,150,147,117,]),'limit':([11,],[19,]),'unary_func':([29,78,92,119,121,133,161,165,168,169,176,181,183,185,201,208,215,224,],[70,70,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,]),'expression':([119,161,165,201,],[164,198,205,222,]),}
_lr_goto = {}
for _k, _v in _lr_goto_items.items():
for _x, _y in zip(_v[0], _v[1]):
if not _x in _lr_goto: _lr_goto[_x] = {}
_lr_goto[_x][_k] = _y
del _lr_goto_items
_lr_productions = [
("S' -> parse_sparql","S'",1,None,None,None),
('parse_sparql -> prefix_list query order_by limit offset','parse_sparql',5,'p_parse_sparql','sparql_parser.py',168),
('prefix_list -> prefix prefix_list','prefix_list',2,'p_prefix_list','sparql_parser.py',176),
('prefix_list -> empty','prefix_list',1,'p_empty_prefix_list','sparql_parser.py',184),
('empty -> <empty>','empty',0,'p_empty','sparql_parser.py',192),
('prefix -> PREFIX ID COLON URI','prefix',4,'p_prefix','sparql_parser.py',199),
('uri -> ID COLON ID','uri',3,'p_uri_0','sparql_parser.py',206),
('uri -> ID COLON URI','uri',3,'p_uri_1','sparql_parser.py',219),
('uri -> URI','uri',1,'p_uri_2','sparql_parser.py',226),
('order_by -> ORDER BY var_order_list desc_var','order_by',4,'p_order_by_0','sparql_parser.py',233),
('order_by -> empty','order_by',1,'p_order_by_1','sparql_parser.py',240),
('var_order_list -> empty','var_order_list',1,'p_var_order_list_0','sparql_parser.py',247),
('var_order_list -> var_order_list desc_var','var_order_list',2,'p_var_order_list_1','sparql_parser.py',254),
('desc_var -> DESC LPAR VARIABLE RPAR','desc_var',4,'p_desc_var_0','sparql_parser.py',261),
('desc_var -> VARIABLE','desc_var',1,'p_desc_var_1','sparql_parser.py',268),
('desc_var -> ASC LPAR VARIABLE RPAR','desc_var',4,'p_desc_var_2','sparql_parser.py',275),
('desc_var -> unary_func LPAR desc_var RPAR','desc_var',4,'p_desc_var_3','sparql_parser.py',282),
('limit -> LIMIT NUMBER','limit',2,'p_limit_0','sparql_parser.py',289),
('limit -> empty','limit',1,'p_limit_1','sparql_parser.py',296),
('offset -> OFFSET NUMBER','offset',2,'p_offset_0','sparql_parser.py',303),
('offset -> empty','offset',1,'p_offset_1','sparql_parser.py',310),
('query -> SELECT distinct var_list WHERE LKEY group_graph_pattern RKEY','query',7,'p_query_0','sparql_parser.py',317),
('query -> SELECT distinct ALL WHERE LKEY group_graph_pattern RKEY','query',7,'p_query_1','sparql_parser.py',324),
('distinct -> DISTINCT','distinct',1,'p_distinct_0','sparql_parser.py',331),
('distinct -> empty','distinct',1,'p_distinct_1','sparql_parser.py',338),
('group_graph_pattern -> union_block','group_graph_pattern',1,'p_ggp_0','sparql_parser.py',345),
('union_block -> pjoin_block rest_union_block POINT pjoin_block','union_block',4,'p_union_block_0','sparql_parser.py',352),
('union_block -> pjoin_block rest_union_block pjoin_block','union_block',3,'p_union_block_1','sparql_parser.py',361),
('union_block -> pjoin_block rest_union_block','union_block',2,'p_union_block_2','sparql_parser.py',373),
('pjoin_block -> LKEY join_block RKEY','pjoin_block',3,'p_ppjoin_block_0','sparql_parser.py',380),
('pjoin_block -> join_block','pjoin_block',1,'p_ppjoin_block_1','sparql_parser.py',387),
('pjoin_block -> empty','pjoin_block',1,'p_ppjoin_block_2','sparql_parser.py',394),
('rest_union_block -> empty','rest_union_block',1,'p_rest_union_block_0','sparql_parser.py',401),
('rest_union_block -> UNION LKEY join_block rest_union_block RKEY rest_union_block','rest_union_block',6,'p_rest_union_block_1','sparql_parser.py',408),
('join_block -> LKEY union_block RKEY rest_join_block','join_block',4,'p_join_block_0','sparql_parser.py',415),
('join_block -> bgp rest_join_block','join_block',2,'p_join_block_1','sparql_parser.py',427),
('rest_join_block -> empty','rest_join_block',1,'p_rest_join_block_0','sparql_parser.py',434),
('rest_join_block -> POINT bgp rest_join_block','rest_join_block',3,'p_rest_join_block_1','sparql_parser.py',441),
('rest_join_block -> bgp rest_join_block','rest_join_block',2,'p_rest_join_block_2','sparql_parser.py',448),
('bgp -> LKEY bgp UNION bgp rest_union_block RKEY','bgp',6,'p_bgp_0','sparql_parser.py',455),
('bgp -> bgp UNION bgp rest_union_block','bgp',4,'p_bgp_01','sparql_parser.py',463),
('bgp -> triple','bgp',1,'p_bgp_1','sparql_parser.py',471),
('bgp -> FILTER LPAR expression RPAR','bgp',4,'p_bgp_2','sparql_parser.py',478),
('bgp -> FILTER express_rel','bgp',2,'p_bgp_3','sparql_parser.py',485),
('bgp -> OPTIONAL LKEY group_graph_pattern RKEY','bgp',4,'p_bgp_4','sparql_parser.py',492),
('bgp -> LKEY join_block RKEY','bgp',3,'p_bgp_6','sparql_parser.py',506),
('expression -> express_rel LOGOP expression','expression',3,'p_expression_0','sparql_parser.py',516),
('expression -> express_rel','expression',1,'p_expression_1','sparql_parser.py',523),
('expression -> LPAR expression RPAR','expression',3,'p_expression_2','sparql_parser.py',530),
('express_rel -> express_arg RELOP express_rel','express_rel',3,'p_express_rel_0','sparql_parser.py',537),
('express_rel -> express_arg','express_rel',1,'p_express_rel_1','sparql_parser.py',544),
('express_rel -> LPAR express_rel RPAR','express_rel',3,'p_express_rel_2','sparql_parser.py',551),
('express_rel -> NEG LPAR expression RPAR','express_rel',4,'p_express_rel_3','sparql_parser.py',558),
('express_rel -> NEG express_rel','express_rel',2,'p_express_rel_4','sparql_parser.py',565),
('express_arg -> uri','express_arg',1,'p_express_arg_0','sparql_parser.py',572),
('express_arg -> VARIABLE','express_arg',1,'p_express_arg_1','sparql_parser.py',579),
('express_arg -> CONSTANT','express_arg',1,'p_express_arg_2','sparql_parser.py',586),
('express_arg -> NUMBER','express_arg',1,'p_express_arg_3','sparql_parser.py',593),
('express_arg -> NUMBER POINT NUMBER','express_arg',3,'p_express_arg_03','sparql_parser.py',600),
('express_arg -> REGEX LPAR express_arg COMA pattern_arg regex_flag','express_arg',6,'p_express_arg_4','sparql_parser.py',608),
('regex_flag -> RPAR','regex_flag',1,'p_regex_flags_0','sparql_parser.py',615),
('regex_flag -> COMA pattern_arg RPAR','regex_flag',3,'p_regex_flags_1','sparql_parser.py',622),
('pattern_arg -> CONSTANT','pattern_arg',1,'p_pattern_arg_0','sparql_parser.py',629),
('express_arg -> binary_func LPAR express_arg COMA express_arg RPAR','express_arg',6,'p_express_arg_5','sparql_parser.py',636),
('express_arg -> unary_func LPAR express_arg RPAR','express_arg',4,'p_express_arg_6','sparql_parser.py',643),
('express_arg -> UNARYOP express_arg','express_arg',2,'p_express_arg_7','sparql_parser.py',650),
('express_arg -> express_arg ARITOP express_arg','express_arg',3,'p_express_arg_8','sparql_parser.py',657),
('express_arg -> LPAR express_arg RPAR','express_arg',3,'p_express_arg_9','sparql_parser.py',664),
('express_arg -> express_arg RELOP express_arg','express_arg',3,'p_express_arg_10','sparql_parser.py',671),
('ARITOP -> PLUS','ARITOP',1,'p_arit_op_0','sparql_parser.py',678),
('ARITOP -> MINUS','ARITOP',1,'p_arit_op_1','sparql_parser.py',685),
('ARITOP -> TIMES','ARITOP',1,'p_arit_op_2','sparql_parser.py',692),
('ARITOP -> DIV','ARITOP',1,'p_arit_op_3','sparql_parser.py',699),
('UNARYOP -> PLUS','UNARYOP',1,'p_unaryarit_op_1','sparql_parser.py',706),
('UNARYOP -> MINUS','UNARYOP',1,'p_unaryarit_op_2','sparql_parser.py',713),
('LOGOP -> AND','LOGOP',1,'p_logical_op_0','sparql_parser.py',720),
('LOGOP -> OR','LOGOP',1,'p_logical_op_1','sparql_parser.py',727),
('RELOP -> EQUALS','RELOP',1,'p_relational_op_0','sparql_parser.py',734),
('RELOP -> LESS','RELOP',1,'p_relational_op_1','sparql_parser.py',741),
('RELOP -> LESSEQ','RELOP',1,'p_relational_op_2','sparql_parser.py',748),
('RELOP -> GREATER','RELOP',1,'p_relational_op_3','sparql_parser.py',755),
('RELOP -> GREATEREQ','RELOP',1,'p_relational_op_4','sparql_parser.py',762),
('RELOP -> NEQUALS','RELOP',1,'p_relational_op_5','sparql_parser.py',769),
('binary_func -> REGEX','binary_func',1,'p_binary_0','sparql_parser.py',776),
('binary_func -> SAMETERM','binary_func',1,'p_binary_1','sparql_parser.py',783),
('binary_func -> LANGMATCHES','binary_func',1,'p_binary_2','sparql_parser.py',790),
('binary_func -> CONSTANT','binary_func',1,'p_binary_3','sparql_parser.py',797),
('binary_func -> CONTAINS','binary_func',1,'p_binary_4','sparql_parser.py',804),
('unary_func -> BOUND','unary_func',1,'p_unary_0','sparql_parser.py',811),
('unary_func -> ISIRI','unary_func',1,'p_unary_1','sparql_parser.py',818),
('unary_func -> ISURI','unary_func',1,'p_unary_2','sparql_parser.py',825),
('unary_func -> ISBLANK','unary_func',1,'p_unary_3','sparql_parser.py',832),
('unary_func -> ISLITERAL','unary_func',1,'p_unary_4','sparql_parser.py',839),
('unary_func -> LANG','unary_func',1,'p_unary_5','sparql_parser.py',846),
('unary_func -> DATATYPE','unary_func',1,'p_unary_6','sparql_parser.py',853),
('unary_func -> STR','unary_func',1,'p_unary_7','sparql_parser.py',860),
('unary_func -> UPPERCASE','unary_func',1,'p_unary_8','sparql_parser.py',867),
('unary_func -> DOUBLE','unary_func',1,'p_unary_9','sparql_parser.py',874),
('unary_func -> INTEGER','unary_func',1,'p_unary_9','sparql_parser.py',875),
('unary_func -> DECIMAL','unary_func',1,'p_unary_9','sparql_parser.py',876),
('unary_func -> FLOAT','unary_func',1,'p_unary_9','sparql_parser.py',877),
('unary_func -> STRING','unary_func',1,'p_unary_9','sparql_parser.py',878),
('unary_func -> BOOLEAN','unary_func',1,'p_unary_9','sparql_parser.py',879),
('unary_func -> DATETIME','unary_func',1,'p_unary_9','sparql_parser.py',880),
('unary_func -> NONPOSINT','unary_func',1,'p_unary_9','sparql_parser.py',881),
('unary_func -> NEGATIVEINT','unary_func',1,'p_unary_9','sparql_parser.py',882),
('unary_func -> LONG','unary_func',1,'p_unary_9','sparql_parser.py',883),
('unary_func -> INT','unary_func',1,'p_unary_9','sparql_parser.py',884),
('unary_func -> SHORT','unary_func',1,'p_unary_9','sparql_parser.py',885),
('unary_func -> BYTE','unary_func',1,'p_unary_9','sparql_parser.py',886),
('unary_func -> NONNEGINT','unary_func',1,'p_unary_9','sparql_parser.py',887),
('unary_func -> UNSIGNEDLONG','unary_func',1,'p_unary_9','sparql_parser.py',888),
('unary_func -> UNSIGNEDINT','unary_func',1,'p_unary_9','sparql_parser.py',889),
('unary_func -> UNSIGNEDSHORT','unary_func',1,'p_unary_9','sparql_parser.py',890),
('unary_func -> UNSIGNEDBYTE','unary_func',1,'p_unary_9','sparql_parser.py',891),
('unary_func -> POSITIVEINT','unary_func',1,'p_unary_9','sparql_parser.py',892),
('unary_func -> ID COLON ID','unary_func',3,'p_unary_10','sparql_parser.py',899),
('unary_func -> uri','unary_func',1,'p_unary_11','sparql_parser.py',906),
('unary_func -> UCASE','unary_func',1,'p_unary_12','sparql_parser.py',913),
('unary_func -> LCASE','unary_func',1,'p_unary_13','sparql_parser.py',920),
('var_list -> var_list VARIABLE','var_list',2,'p_var_list','sparql_parser.py',927),
('var_list -> VARIABLE','var_list',1,'p_single_var_list','sparql_parser.py',934),
('triple -> subject predicate object','triple',3,'p_triple_0','sparql_parser.py',941),
('predicate -> ID','predicate',1,'p_predicate_rdftype','sparql_parser.py',948),
('predicate -> uri','predicate',1,'p_predicate_uri','sparql_parser.py',962),
('predicate -> VARIABLE','predicate',1,'p_predicate_var','sparql_parser.py',969),
('subject -> uri','subject',1,'p_subject_uri','sparql_parser.py',976),
('subject -> VARIABLE','subject',1,'p_subject_variable','sparql_parser.py',983),
('object -> uri','object',1,'p_object_uri','sparql_parser.py',991),
('object -> VARIABLE','object',1,'p_object_variable','sparql_parser.py',998),
('object -> CONSTANT','object',1,'p_object_constant','sparql_parser.py',1005),
]
| 264.832298
| 22,379
| 0.657981
| 9,166
| 42,638
| 2.957561
| 0.056295
| 0.057545
| 0.067136
| 0.018592
| 0.562728
| 0.496735
| 0.43587
| 0.409901
| 0.390645
| 0.344867
| 0
| 0.400025
| 0.058586
| 42,638
| 160
| 22,380
| 266.4875
| 0.275336
| 0.00197
| 0
| 0.013333
| 1
| 0.006667
| 0.34029
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
d692ec46ce91d5f7e05948f9679eed68063ca653
| 157
|
py
|
Python
|
python/leap/year.py
|
Coding-Koans/Exercisms
|
5edddebdb3086800c020717d0c2b0b17bc63f62f
|
[
"MIT"
] | null | null | null |
python/leap/year.py
|
Coding-Koans/Exercisms
|
5edddebdb3086800c020717d0c2b0b17bc63f62f
|
[
"MIT"
] | null | null | null |
python/leap/year.py
|
Coding-Koans/Exercisms
|
5edddebdb3086800c020717d0c2b0b17bc63f62f
|
[
"MIT"
] | null | null | null |
def is_leap_year(year):
leap = False
if(year % 4 == 0):
leap = True
if(year % 100 == 0):
leap = False
if(year % 400 == 0):
leap = True
return leap
| 17.444444
| 23
| 0.579618
| 27
| 157
| 3.296296
| 0.444444
| 0.202247
| 0.247191
| 0.337079
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.086207
| 0.261147
| 157
| 9
| 24
| 17.444444
| 0.681034
| 0
| 0
| 0.444444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.111111
| false
| 0
| 0
| 0
| 0.222222
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
d6c7b42184b6d2b828eb7bcba87c7b187dd025fe
| 132
|
py
|
Python
|
contextmonkey/feedlayer/emulators/gennymotion/__init__.py
|
manojrege/contextmonkey
|
9974889a726d7f60c6da0d6ccab97113ce635a14
|
[
"BSD-3-Clause"
] | 4
|
2017-03-17T02:28:12.000Z
|
2019-04-18T11:25:44.000Z
|
contextmonkey/feedlayer/emulators/gennymotion/__init__.py
|
manojrege/contextmonkey
|
9974889a726d7f60c6da0d6ccab97113ce635a14
|
[
"BSD-3-Clause"
] | null | null | null |
contextmonkey/feedlayer/emulators/gennymotion/__init__.py
|
manojrege/contextmonkey
|
9974889a726d7f60c6da0d6ccab97113ce635a14
|
[
"BSD-3-Clause"
] | null | null | null |
"""Module for Genymotion emulator connection."""
import sys
import os
sys.path.append(os.path.dirname(__file__) + '/../../../../')
| 22
| 60
| 0.666667
| 16
| 132
| 5.25
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.098485
| 132
| 5
| 61
| 26.4
| 0.705882
| 0.318182
| 0
| 0
| 0
| 0
| 0.154762
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
d6d1b65834495061e29fb6eb21a5794df3dd7c8e
| 170
|
py
|
Python
|
Hub/ecointeraction/CairnFORM/admin.py
|
maximedaniel/ITAME
|
ca820337911695fa3625b32dcad5d87ff0b192d0
|
[
"MIT"
] | null | null | null |
Hub/ecointeraction/CairnFORM/admin.py
|
maximedaniel/ITAME
|
ca820337911695fa3625b32dcad5d87ff0b192d0
|
[
"MIT"
] | 1
|
2021-06-10T23:19:09.000Z
|
2021-06-10T23:19:09.000Z
|
Hub/ecointeraction/CairnFORM/admin.py
|
maximedaniel/ITAME
|
ca820337911695fa3625b32dcad5d87ff0b192d0
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import EnergyUsage, Event, Laptop
admin.site.register(EnergyUsage)
admin.site.register(Event)
admin.site.register(Laptop)
| 21.25
| 46
| 0.817647
| 23
| 170
| 6.043478
| 0.478261
| 0.194245
| 0.366906
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.088235
| 170
| 8
| 47
| 21.25
| 0.896774
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.4
| 0
| 0.4
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
d6d2b45e9c3ba77937237f0b7ba6edae78343e48
| 134
|
py
|
Python
|
pyvino_utils/tests/input_handler/test_input_feeder.py
|
venky4121994/openvinoface
|
a620138b94f865fb19e6165abde2237c85ca8764
|
[
"MIT"
] | 4
|
2020-08-31T17:19:57.000Z
|
2020-10-03T13:59:10.000Z
|
pyvino_utils/tests/input_handler/test_input_feeder.py
|
B0N0AI/pyvino_utils
|
0d42741eb446b038eae2917b621d9c1ffbc42452
|
[
"MIT"
] | 2
|
2020-09-13T08:04:36.000Z
|
2020-09-13T08:04:58.000Z
|
pyvino_utils/tests/input_handler/test_input_feeder.py
|
mmphego/pyvino_utils
|
0d42741eb446b038eae2917b621d9c1ffbc42452
|
[
"MIT"
] | null | null | null |
import unittest
from pyvino_utils import InputFeeder
class test_input_feeder(unittest.TestCase):
def setUp(self):
pass
| 14.888889
| 43
| 0.753731
| 17
| 134
| 5.764706
| 0.882353
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.19403
| 134
| 8
| 44
| 16.75
| 0.907407
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0.2
| 0.4
| 0
| 0.8
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
|
0
| 5
|
d6de939b6763fe8990f593dabd786515865a9885
| 96
|
py
|
Python
|
venv/lib/python3.8/site-packages/poetry/exceptions.py
|
GiulianaPola/select_repeats
|
17a0d053d4f874e42cf654dd142168c2ec8fbd11
|
[
"MIT"
] | 2
|
2022-03-13T01:58:52.000Z
|
2022-03-31T06:07:54.000Z
|
venv/lib/python3.8/site-packages/poetry/exceptions.py
|
DesmoSearch/Desmobot
|
b70b45df3485351f471080deb5c785c4bc5c4beb
|
[
"MIT"
] | 19
|
2021-11-20T04:09:18.000Z
|
2022-03-23T15:05:55.000Z
|
venv/lib/python3.8/site-packages/poetry/exceptions.py
|
DesmoSearch/Desmobot
|
b70b45df3485351f471080deb5c785c4bc5c4beb
|
[
"MIT"
] | null | null | null |
/home/runner/.cache/pip/pool/ac/29/3d/802ae278ce380d903c7f3ff4a5da11e80505f905ece7eeeb06e30a89c8
| 96
| 96
| 0.895833
| 9
| 96
| 9.555556
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.385417
| 0
| 96
| 1
| 96
| 96
| 0.510417
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
d6fb51859d45e0fea440b55765532e911350ae1e
| 192
|
py
|
Python
|
1. Primitive Types/03escapeSequences.py
|
ahmadsohail404/helloPython
|
7fa0c1c4ae7badecc6adc6e9ce35cce14e86766f
|
[
"MIT"
] | null | null | null |
1. Primitive Types/03escapeSequences.py
|
ahmadsohail404/helloPython
|
7fa0c1c4ae7badecc6adc6e9ce35cce14e86766f
|
[
"MIT"
] | null | null | null |
1. Primitive Types/03escapeSequences.py
|
ahmadsohail404/helloPython
|
7fa0c1c4ae7badecc6adc6e9ce35cce14e86766f
|
[
"MIT"
] | null | null | null |
course = 'Python "Programming"'
print(course)
course = "Python \"Programming\"" # use this to be maintain consistency
course = "Python \\Programming\"" # Python \Programming"
print(course)
| 27.428571
| 72
| 0.71875
| 21
| 192
| 6.571429
| 0.47619
| 0.492754
| 0.5
| 0.405797
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.140625
| 192
| 6
| 73
| 32
| 0.836364
| 0.291667
| 0
| 0.4
| 0
| 0
| 0.368421
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.4
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
ba80d4909320b4c57f776f9c6494da3d30273a43
| 44
|
py
|
Python
|
pyphlow/app/__init__.py
|
failipp/pyphlow
|
82875ca593a971a8683ab052c005ca90df2404f3
|
[
"MIT"
] | null | null | null |
pyphlow/app/__init__.py
|
failipp/pyphlow
|
82875ca593a971a8683ab052c005ca90df2404f3
|
[
"MIT"
] | null | null | null |
pyphlow/app/__init__.py
|
failipp/pyphlow
|
82875ca593a971a8683ab052c005ca90df2404f3
|
[
"MIT"
] | null | null | null |
from pyphlow.app.app import main as run_app
| 22
| 43
| 0.818182
| 9
| 44
| 3.888889
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.136364
| 44
| 1
| 44
| 44
| 0.921053
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
ba8430c0e58ec2335ca7bbd823a6aa65ff00546f
| 47,117
|
py
|
Python
|
dnacentersdk/api/v2_2_1/wireless.py
|
oboehmer/dnacentersdk
|
25c4e99900640deee91a56aa886874d9cb0ca960
|
[
"MIT"
] | 32
|
2019-09-05T05:16:56.000Z
|
2022-03-22T09:50:38.000Z
|
dnacentersdk/api/v2_2_1/wireless.py
|
oboehmer/dnacentersdk
|
25c4e99900640deee91a56aa886874d9cb0ca960
|
[
"MIT"
] | 35
|
2019-09-07T18:58:54.000Z
|
2022-03-24T19:29:36.000Z
|
dnacentersdk/api/v2_2_1/wireless.py
|
oboehmer/dnacentersdk
|
25c4e99900640deee91a56aa886874d9cb0ca960
|
[
"MIT"
] | 18
|
2019-09-09T11:07:21.000Z
|
2022-03-25T08:49:59.000Z
|
# -*- coding: utf-8 -*-
"""Cisco DNA Center Wireless API wrapper.
Copyright (c) 2019-2021 Cisco Systems.
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.
"""
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals,
)
from builtins import *
from past.builtins import basestring
from ...restsession import RestSession
from ...utils import (
check_type,
dict_from_items_with_values,
apply_path_params,
dict_of_str,
)
class Wireless(object):
"""Cisco DNA Center Wireless API (version: 2.2.1).
Wraps the DNA Center Wireless
API and exposes the API as native Python
methods that return native Python objects.
"""
def __init__(self, session, object_factory, request_validator):
"""Initialize a new Wireless
object with the provided RestSession.
Args:
session(RestSession): The RESTful session object to be used for
API calls to the DNA Center service.
Raises:
TypeError: If the parameter types are incorrect.
"""
check_type(session, RestSession)
super(Wireless, self).__init__()
self._session = session
self._object_factory = object_factory
self._request_validator = request_validator
def retrieve_rf_profiles(self,
rf_profile_name=None,
headers=None,
**request_parameters):
"""Retrieve all RF profiles.
Args:
rf_profile_name(basestring): rf-profile-name query parameter.
headers(dict): Dictionary of HTTP Headers to send with the Request
.
**request_parameters: Additional request parameters (provides
support for parameters that may be added in the future).
Returns:
MyDict: JSON response. Access the object's properties by using
the dot notation or the bracket notation.
Raises:
TypeError: If the parameter types are incorrect.
MalformedRequest: If the request body created is invalid.
ApiError: If the DNA Center cloud returns an error.
"""
check_type(headers, dict)
check_type(rf_profile_name, basestring)
if headers is not None:
if 'X-Auth-Token' in headers:
check_type(headers.get('X-Auth-Token'),
basestring, may_be_none=False)
_params = {
'rf-profile-name':
rf_profile_name,
}
_params.update(request_parameters)
_params = dict_from_items_with_values(_params)
path_params = {
}
with_custom_headers = False
_headers = self._session.headers or {}
if headers:
_headers.update(dict_of_str(headers))
with_custom_headers = True
e_url = ('/dna/intent/api/v1/wireless/rf-profile')
endpoint_full_url = apply_path_params(e_url, path_params)
if with_custom_headers:
json_data = self._session.get(endpoint_full_url, params=_params,
headers=_headers)
else:
json_data = self._session.get(endpoint_full_url, params=_params)
return self._object_factory('bpm_ac37d6798c0b593088952123df03bb1b_v2_2_1', json_data)
def create_or_update_rf_profile(self,
channelWidth=None,
defaultRfProfile=None,
enableBrownField=None,
enableCustom=None,
enableRadioTypeA=None,
enableRadioTypeB=None,
name=None,
radioTypeAProperties=None,
radioTypeBProperties=None,
headers=None,
payload=None,
active_validation=True,
**request_parameters):
"""Create or Update RF profile.
Args:
channelWidth(string): Wireless's channelWidth.
defaultRfProfile(boolean): Wireless's defaultRfProfile.
enableBrownField(boolean): Wireless's enableBrownField.
enableCustom(boolean): Wireless's enableCustom.
enableRadioTypeA(boolean): Wireless's enableRadioTypeA.
enableRadioTypeB(boolean): Wireless's enableRadioTypeB.
name(string): Wireless's name.
radioTypeAProperties(object): Wireless's radioTypeAProperties.
radioTypeBProperties(object): Wireless's radioTypeBProperties.
headers(dict): Dictionary of HTTP Headers to send with the Request
.
payload(dict): A JSON serializable Python object to send in the
body of the Request.
active_validation(bool): Enable/Disable payload validation.
Defaults to True.
**request_parameters: Additional request parameters (provides
support for parameters that may be added in the future).
Returns:
MyDict: JSON response. Access the object's properties by using
the dot notation or the bracket notation.
Raises:
TypeError: If the parameter types are incorrect.
MalformedRequest: If the request body created is invalid.
ApiError: If the DNA Center cloud returns an error.
"""
check_type(headers, dict)
check_type(payload, dict)
if headers is not None:
if 'X-Auth-Token' in headers:
check_type(headers.get('X-Auth-Token'),
basestring, may_be_none=False)
_params = {
}
_params.update(request_parameters)
_params = dict_from_items_with_values(_params)
path_params = {
}
_payload = {
'name':
name,
'defaultRfProfile':
defaultRfProfile,
'enableRadioTypeA':
enableRadioTypeA,
'enableRadioTypeB':
enableRadioTypeB,
'channelWidth':
channelWidth,
'enableCustom':
enableCustom,
'enableBrownField':
enableBrownField,
'radioTypeAProperties':
radioTypeAProperties,
'radioTypeBProperties':
radioTypeBProperties,
}
_payload.update(payload or {})
_payload = dict_from_items_with_values(_payload)
if active_validation:
self._request_validator('jsd_f24f6c07641580ba6ed710e92c2da16_v2_2_1')\
.validate(_payload)
with_custom_headers = False
_headers = self._session.headers or {}
if headers:
_headers.update(dict_of_str(headers))
with_custom_headers = True
e_url = ('/dna/intent/api/v1/wireless/rf-profile')
endpoint_full_url = apply_path_params(e_url, path_params)
if with_custom_headers:
json_data = self._session.post(endpoint_full_url, params=_params,
json=_payload,
headers=_headers)
else:
json_data = self._session.post(endpoint_full_url, params=_params,
json=_payload)
return self._object_factory('bpm_f24f6c07641580ba6ed710e92c2da16_v2_2_1', json_data)
def create_and_provision_ssid(self,
enableFabric=None,
flexConnect=None,
managedAPLocations=None,
ssidDetails=None,
ssidType=None,
headers=None,
payload=None,
active_validation=True,
**request_parameters):
"""Creates SSID, updates the SSID to the corresponding site profiles and provision it to the devices matching the
given sites.
Args:
enableFabric(boolean): Wireless's enableFabric.
flexConnect(object): Wireless's flexConnect.
managedAPLocations(list): Wireless's managedAPLocations (list of strings).
ssidDetails(object): Wireless's ssidDetails.
ssidType(string): Wireless's ssidType. Available values are 'Guest' and 'Enterprise'.
headers(dict): Dictionary of HTTP Headers to send with the Request
.
payload(dict): A JSON serializable Python object to send in the
body of the Request.
active_validation(bool): Enable/Disable payload validation.
Defaults to True.
**request_parameters: Additional request parameters (provides
support for parameters that may be added in the future).
Returns:
MyDict: JSON response. Access the object's properties by using
the dot notation or the bracket notation.
Raises:
TypeError: If the parameter types are incorrect.
MalformedRequest: If the request body created is invalid.
ApiError: If the DNA Center cloud returns an error.
"""
check_type(headers, dict)
check_type(payload, dict)
if headers is not None:
if '__persistbapioutput' in headers:
check_type(headers.get('__persistbapioutput'),
bool, may_be_none=False)
if 'X-Auth-Token' in headers:
check_type(headers.get('X-Auth-Token'),
basestring, may_be_none=False)
_params = {
}
_params.update(request_parameters)
_params = dict_from_items_with_values(_params)
path_params = {
}
_payload = {
'managedAPLocations':
managedAPLocations,
'ssidDetails':
ssidDetails,
'ssidType':
ssidType,
'enableFabric':
enableFabric,
'flexConnect':
flexConnect,
}
_payload.update(payload or {})
_payload = dict_from_items_with_values(_payload)
if active_validation:
self._request_validator('jsd_d825ae9a117f5b6bb65b7d78fd42513c_v2_2_1')\
.validate(_payload)
with_custom_headers = False
_headers = self._session.headers or {}
if headers:
_headers.update(dict_of_str(headers))
with_custom_headers = True
e_url = ('/dna/intent/api/v1/business/ssid')
endpoint_full_url = apply_path_params(e_url, path_params)
if with_custom_headers:
json_data = self._session.post(endpoint_full_url, params=_params,
json=_payload,
headers=_headers)
else:
json_data = self._session.post(endpoint_full_url, params=_params,
json=_payload)
return self._object_factory('bpm_d825ae9a117f5b6bb65b7d78fd42513c_v2_2_1', json_data)
def delete_rf_profiles(self,
rf_profile_name,
headers=None,
**request_parameters):
"""Delete RF profile(s).
Args:
rf_profile_name(basestring): rf-profile-name path parameter.
headers(dict): Dictionary of HTTP Headers to send with the Request
.
**request_parameters: Additional request parameters (provides
support for parameters that may be added in the future).
Returns:
MyDict: JSON response. Access the object's properties by using
the dot notation or the bracket notation.
Raises:
TypeError: If the parameter types are incorrect.
MalformedRequest: If the request body created is invalid.
ApiError: If the DNA Center cloud returns an error.
"""
check_type(headers, dict)
check_type(rf_profile_name, basestring,
may_be_none=False)
if headers is not None:
if 'X-Auth-Token' in headers:
check_type(headers.get('X-Auth-Token'),
basestring, may_be_none=False)
_params = {
}
_params.update(request_parameters)
_params = dict_from_items_with_values(_params)
path_params = {
'rf-profile-name': rf_profile_name,
}
with_custom_headers = False
_headers = self._session.headers or {}
if headers:
_headers.update(dict_of_str(headers))
with_custom_headers = True
e_url = ('/dna/intent/api/v1/wireless/rf-profile/{rf-profile-name}')
endpoint_full_url = apply_path_params(e_url, path_params)
if with_custom_headers:
json_data = self._session.delete(endpoint_full_url, params=_params,
headers=_headers)
else:
json_data = self._session.delete(endpoint_full_url, params=_params)
return self._object_factory('bpm_aa1e5957ac977603b5cef72f9f_v2_2_1', json_data)
def get_enterprise_ssid(self,
ssid_name=None,
headers=None,
**request_parameters):
"""Gets either one or all the enterprise SSID.
Args:
ssid_name(basestring): ssidName query parameter. Enter the enterprise SSID name that needs to be
retrieved. If not entered, all the enterprise SSIDs will be retrieved.
headers(dict): Dictionary of HTTP Headers to send with the Request
.
**request_parameters: Additional request parameters (provides
support for parameters that may be added in the future).
Returns:
list: JSON response. A list of MyDict objects.
Access the object's properties by using the dot notation
or the bracket notation.
Raises:
TypeError: If the parameter types are incorrect.
MalformedRequest: If the request body created is invalid.
ApiError: If the DNA Center cloud returns an error.
"""
check_type(headers, dict)
check_type(ssid_name, basestring)
if headers is not None:
if 'X-Auth-Token' in headers:
check_type(headers.get('X-Auth-Token'),
basestring, may_be_none=False)
_params = {
'ssidName':
ssid_name,
}
_params.update(request_parameters)
_params = dict_from_items_with_values(_params)
path_params = {
}
with_custom_headers = False
_headers = self._session.headers or {}
if headers:
_headers.update(dict_of_str(headers))
with_custom_headers = True
e_url = ('/dna/intent/api/v1/enterprise-ssid')
endpoint_full_url = apply_path_params(e_url, path_params)
if with_custom_headers:
json_data = self._session.get(endpoint_full_url, params=_params,
headers=_headers)
else:
json_data = self._session.get(endpoint_full_url, params=_params)
return self._object_factory('bpm_fb757e8fce4b51ffa0ba1a8e5ae4d8c0_v2_2_1', json_data)
def create_enterprise_ssid(self,
enableBroadcastSSID=None,
enableFastLane=None,
enableMACFiltering=None,
fastTransition=None,
name=None,
passphrase=None,
radioPolicy=None,
securityLevel=None,
trafficType=None,
headers=None,
payload=None,
active_validation=True,
**request_parameters):
"""Creates enterprise SSID.
Args:
enableBroadcastSSID(boolean): Wireless's enableBroadcastSSID.
enableFastLane(boolean): Wireless's enableFastLane.
enableMACFiltering(boolean): Wireless's enableMACFiltering.
fastTransition(string): Wireless's fastTransition. Available values are 'Adaptive', 'Enable' and
'Disable'.
name(string): Wireless's name.
passphrase(string): Wireless's passphrase.
radioPolicy(string): Wireless's radioPolicy. Available values are 'Dual band operation (2.4GHz and
5GHz)', 'Dual band operation with band select', '5GHz only' and '2.4GHz only'.
securityLevel(string): Wireless's securityLevel. Available values are 'WPA2_ENTERPRISE', 'WPA2_PERSONAL'
and 'OPEN'.
trafficType(string): Wireless's trafficType. Available values are 'voicedata' and 'data'.
headers(dict): Dictionary of HTTP Headers to send with the Request
.
payload(dict): A JSON serializable Python object to send in the
body of the Request.
active_validation(bool): Enable/Disable payload validation.
Defaults to True.
**request_parameters: Additional request parameters (provides
support for parameters that may be added in the future).
Returns:
MyDict: JSON response. Access the object's properties by using
the dot notation or the bracket notation.
Raises:
TypeError: If the parameter types are incorrect.
MalformedRequest: If the request body created is invalid.
ApiError: If the DNA Center cloud returns an error.
"""
check_type(headers, dict)
check_type(payload, dict)
if headers is not None:
if 'X-Auth-Token' in headers:
check_type(headers.get('X-Auth-Token'),
basestring, may_be_none=False)
_params = {
}
_params.update(request_parameters)
_params = dict_from_items_with_values(_params)
path_params = {
}
_payload = {
'name':
name,
'securityLevel':
securityLevel,
'passphrase':
passphrase,
'enableFastLane':
enableFastLane,
'enableMACFiltering':
enableMACFiltering,
'trafficType':
trafficType,
'radioPolicy':
radioPolicy,
'enableBroadcastSSID':
enableBroadcastSSID,
'fastTransition':
fastTransition,
}
_payload.update(payload or {})
_payload = dict_from_items_with_values(_payload)
if active_validation:
self._request_validator('jsd_bc33daf690ec5399a507829abfc4fe64_v2_2_1')\
.validate(_payload)
with_custom_headers = False
_headers = self._session.headers or {}
if headers:
_headers.update(dict_of_str(headers))
with_custom_headers = True
e_url = ('/dna/intent/api/v1/enterprise-ssid')
endpoint_full_url = apply_path_params(e_url, path_params)
if with_custom_headers:
json_data = self._session.post(endpoint_full_url, params=_params,
json=_payload,
headers=_headers)
else:
json_data = self._session.post(endpoint_full_url, params=_params,
json=_payload)
return self._object_factory('bpm_bc33daf690ec5399a507829abfc4fe64_v2_2_1', json_data)
def get_wireless_profile(self,
profile_name=None,
headers=None,
**request_parameters):
"""Gets either one or all the wireless network profiles if no name is provided for network-profile.
Args:
profile_name(basestring): profileName query parameter.
headers(dict): Dictionary of HTTP Headers to send with the Request
.
**request_parameters: Additional request parameters (provides
support for parameters that may be added in the future).
Returns:
list: JSON response. A list of MyDict objects.
Access the object's properties by using the dot notation
or the bracket notation.
Raises:
TypeError: If the parameter types are incorrect.
MalformedRequest: If the request body created is invalid.
ApiError: If the DNA Center cloud returns an error.
"""
check_type(headers, dict)
check_type(profile_name, basestring)
if headers is not None:
if 'X-Auth-Token' in headers:
check_type(headers.get('X-Auth-Token'),
basestring, may_be_none=False)
_params = {
'profileName':
profile_name,
}
_params.update(request_parameters)
_params = dict_from_items_with_values(_params)
path_params = {
}
with_custom_headers = False
_headers = self._session.headers or {}
if headers:
_headers.update(dict_of_str(headers))
with_custom_headers = True
e_url = ('/dna/intent/api/v1/wireless/profile')
endpoint_full_url = apply_path_params(e_url, path_params)
if with_custom_headers:
json_data = self._session.get(endpoint_full_url, params=_params,
headers=_headers)
else:
json_data = self._session.get(endpoint_full_url, params=_params)
return self._object_factory('bpm_bbc1866a50505c0695ae243718d51936_v2_2_1', json_data)
def update_wireless_profile(self,
profileDetails=None,
headers=None,
payload=None,
active_validation=True,
**request_parameters):
"""Updates the wireless Network Profile with updated details provided. All sites to be present in the network
profile should be provided.
Args:
profileDetails(object): Wireless's profileDetails.
headers(dict): Dictionary of HTTP Headers to send with the Request
.
payload(dict): A JSON serializable Python object to send in the
body of the Request.
active_validation(bool): Enable/Disable payload validation.
Defaults to True.
**request_parameters: Additional request parameters (provides
support for parameters that may be added in the future).
Returns:
MyDict: JSON response. Access the object's properties by using
the dot notation or the bracket notation.
Raises:
TypeError: If the parameter types are incorrect.
MalformedRequest: If the request body created is invalid.
ApiError: If the DNA Center cloud returns an error.
"""
check_type(headers, dict)
check_type(payload, dict)
if headers is not None:
if 'X-Auth-Token' in headers:
check_type(headers.get('X-Auth-Token'),
basestring, may_be_none=False)
_params = {
}
_params.update(request_parameters)
_params = dict_from_items_with_values(_params)
path_params = {
}
_payload = {
'profileDetails':
profileDetails,
}
_payload.update(payload or {})
_payload = dict_from_items_with_values(_payload)
if active_validation:
self._request_validator('jsd_bbf7ce025bc2a291b90c37a6b898_v2_2_1')\
.validate(_payload)
with_custom_headers = False
_headers = self._session.headers or {}
if headers:
_headers.update(dict_of_str(headers))
with_custom_headers = True
e_url = ('/dna/intent/api/v1/wireless/profile')
endpoint_full_url = apply_path_params(e_url, path_params)
if with_custom_headers:
json_data = self._session.put(endpoint_full_url, params=_params,
json=_payload,
headers=_headers)
else:
json_data = self._session.put(endpoint_full_url, params=_params,
json=_payload)
return self._object_factory('bpm_bbf7ce025bc2a291b90c37a6b898_v2_2_1', json_data)
def create_wireless_profile(self,
profileDetails=None,
headers=None,
payload=None,
active_validation=True,
**request_parameters):
"""Creates Wireless Network Profile on DNAC and associates sites and SSIDs to it.
Args:
profileDetails(object): Wireless's profileDetails.
headers(dict): Dictionary of HTTP Headers to send with the Request
.
payload(dict): A JSON serializable Python object to send in the
body of the Request.
active_validation(bool): Enable/Disable payload validation.
Defaults to True.
**request_parameters: Additional request parameters (provides
support for parameters that may be added in the future).
Returns:
MyDict: JSON response. Access the object's properties by using
the dot notation or the bracket notation.
Raises:
TypeError: If the parameter types are incorrect.
MalformedRequest: If the request body created is invalid.
ApiError: If the DNA Center cloud returns an error.
"""
check_type(headers, dict)
check_type(payload, dict)
if headers is not None:
if 'X-Auth-Token' in headers:
check_type(headers.get('X-Auth-Token'),
basestring, may_be_none=False)
_params = {
}
_params.update(request_parameters)
_params = dict_from_items_with_values(_params)
path_params = {
}
_payload = {
'profileDetails':
profileDetails,
}
_payload.update(payload or {})
_payload = dict_from_items_with_values(_payload)
if active_validation:
self._request_validator('jsd_b95201b6a6905a10b463e036bf591166_v2_2_1')\
.validate(_payload)
with_custom_headers = False
_headers = self._session.headers or {}
if headers:
_headers.update(dict_of_str(headers))
with_custom_headers = True
e_url = ('/dna/intent/api/v1/wireless/profile')
endpoint_full_url = apply_path_params(e_url, path_params)
if with_custom_headers:
json_data = self._session.post(endpoint_full_url, params=_params,
json=_payload,
headers=_headers)
else:
json_data = self._session.post(endpoint_full_url, params=_params,
json=_payload)
return self._object_factory('bpm_b95201b6a6905a10b463e036bf591166_v2_2_1', json_data)
def provision_update(self,
headers=None,
payload=None,
active_validation=True,
**request_parameters):
"""Updates wireless provisioning.
Args:
headers(dict): Dictionary of HTTP Headers to send with the Request
.
payload(list): A JSON serializable Python object to send in the
body of the Request.
active_validation(bool): Enable/Disable payload validation.
Defaults to True.
**request_parameters: Additional request parameters (provides
support for parameters that may be added in the future).
Returns:
MyDict: JSON response. Access the object's properties by using
the dot notation or the bracket notation.
Raises:
TypeError: If the parameter types are incorrect.
MalformedRequest: If the request body created is invalid.
ApiError: If the DNA Center cloud returns an error.
"""
check_type(headers, dict)
check_type(payload, list)
if headers is not None:
if '__persistbapioutput' in headers:
check_type(headers.get('__persistbapioutput'),
bool, may_be_none=False)
if 'X-Auth-Token' in headers:
check_type(headers.get('X-Auth-Token'),
basestring, may_be_none=False)
_params = {
}
_params.update(request_parameters)
_params = dict_from_items_with_values(_params)
path_params = {
}
_payload = payload or []
if active_validation:
self._request_validator('jsd_d0aab00569b258b481afedc35e6db392_v2_2_1')\
.validate(_payload)
with_custom_headers = False
_headers = self._session.headers or {}
if headers:
_headers.update(dict_of_str(headers))
with_custom_headers = True
e_url = ('/dna/intent/api/v1/wireless/provision')
endpoint_full_url = apply_path_params(e_url, path_params)
if with_custom_headers:
json_data = self._session.put(endpoint_full_url, params=_params,
json=_payload,
headers=_headers)
else:
json_data = self._session.put(endpoint_full_url, params=_params,
json=_payload)
return self._object_factory('bpm_d0aab00569b258b481afedc35e6db392_v2_2_1', json_data)
def provision(self,
headers=None,
payload=None,
active_validation=True,
**request_parameters):
"""Provision wireless devices.
Args:
headers(dict): Dictionary of HTTP Headers to send with the Request
.
payload(list): A JSON serializable Python object to send in the
body of the Request.
active_validation(bool): Enable/Disable payload validation.
Defaults to True.
**request_parameters: Additional request parameters (provides
support for parameters that may be added in the future).
Returns:
MyDict: JSON response. Access the object's properties by using
the dot notation or the bracket notation.
Raises:
TypeError: If the parameter types are incorrect.
MalformedRequest: If the request body created is invalid.
ApiError: If the DNA Center cloud returns an error.
"""
check_type(headers, dict)
check_type(payload, list)
if headers is not None:
if '__persistbapioutput' in headers:
check_type(headers.get('__persistbapioutput'),
bool, may_be_none=False)
if 'X-Auth-Token' in headers:
check_type(headers.get('X-Auth-Token'),
basestring, may_be_none=False)
_params = {
}
_params.update(request_parameters)
_params = dict_from_items_with_values(_params)
path_params = {
}
_payload = payload or []
if active_validation:
self._request_validator('jsd_e31c795964b3bdf85da1b5a2a5_v2_2_1')\
.validate(_payload)
with_custom_headers = False
_headers = self._session.headers or {}
if headers:
_headers.update(dict_of_str(headers))
with_custom_headers = True
e_url = ('/dna/intent/api/v1/wireless/provision')
endpoint_full_url = apply_path_params(e_url, path_params)
if with_custom_headers:
json_data = self._session.post(endpoint_full_url, params=_params,
json=_payload,
headers=_headers)
else:
json_data = self._session.post(endpoint_full_url, params=_params,
json=_payload)
return self._object_factory('bpm_e31c795964b3bdf85da1b5a2a5_v2_2_1', json_data)
def sensor_test_results(self,
end_time=None,
site_id=None,
start_time=None,
test_failure_by=None,
headers=None,
**request_parameters):
"""Intent API to get SENSOR test result summary.
Args:
site_id(basestring): siteId query parameter. Assurance site UUID.
start_time(int): startTime query parameter. The epoch time in milliseconds.
end_time(int): endTime query parameter. The epoch time in milliseconds.
test_failure_by(basestring): testFailureBy query parameter. Obtain failure statistics group by "area",
"building", or "floor".
headers(dict): Dictionary of HTTP Headers to send with the Request
.
**request_parameters: Additional request parameters (provides
support for parameters that may be added in the future).
Returns:
MyDict: JSON response. Access the object's properties by using
the dot notation or the bracket notation.
Raises:
TypeError: If the parameter types are incorrect.
MalformedRequest: If the request body created is invalid.
ApiError: If the DNA Center cloud returns an error.
"""
check_type(headers, dict)
check_type(site_id, basestring)
check_type(start_time, int)
check_type(end_time, int)
check_type(test_failure_by, basestring)
if headers is not None:
if 'X-Auth-Token' in headers:
check_type(headers.get('X-Auth-Token'),
basestring, may_be_none=False)
_params = {
'siteId':
site_id,
'startTime':
start_time,
'endTime':
end_time,
'testFailureBy':
test_failure_by,
}
_params.update(request_parameters)
_params = dict_from_items_with_values(_params)
path_params = {
}
with_custom_headers = False
_headers = self._session.headers or {}
if headers:
_headers.update(dict_of_str(headers))
with_custom_headers = True
e_url = ('/dna/intent/api/v1/AssuranceGetSensorTestResults')
endpoint_full_url = apply_path_params(e_url, path_params)
if with_custom_headers:
json_data = self._session.get(endpoint_full_url, params=_params,
headers=_headers)
else:
json_data = self._session.get(endpoint_full_url, params=_params)
return self._object_factory('bpm_dde2b077d6d052dcae5a76f4aac09c1d_v2_2_1', json_data)
def delete_enterprise_ssid(self,
ssid_name,
headers=None,
**request_parameters):
"""Deletes given enterprise SSID.
Args:
ssid_name(basestring): ssidName path parameter. Enter the SSID name to be deleted.
headers(dict): Dictionary of HTTP Headers to send with the Request
.
**request_parameters: Additional request parameters (provides
support for parameters that may be added in the future).
Returns:
MyDict: JSON response. Access the object's properties by using
the dot notation or the bracket notation.
Raises:
TypeError: If the parameter types are incorrect.
MalformedRequest: If the request body created is invalid.
ApiError: If the DNA Center cloud returns an error.
"""
check_type(headers, dict)
check_type(ssid_name, basestring,
may_be_none=False)
if headers is not None:
if 'X-Auth-Token' in headers:
check_type(headers.get('X-Auth-Token'),
basestring, may_be_none=False)
_params = {
}
_params.update(request_parameters)
_params = dict_from_items_with_values(_params)
path_params = {
'ssidName': ssid_name,
}
with_custom_headers = False
_headers = self._session.headers or {}
if headers:
_headers.update(dict_of_str(headers))
with_custom_headers = True
e_url = ('/dna/intent/api/v1/enterprise-ssid/{ssidName}')
endpoint_full_url = apply_path_params(e_url, path_params)
if with_custom_headers:
json_data = self._session.delete(endpoint_full_url, params=_params,
headers=_headers)
else:
json_data = self._session.delete(endpoint_full_url, params=_params)
return self._object_factory('bpm_a43afa4d91a5043996c682a7a7a2d62_v2_2_1', json_data)
def delete_wireless_profile(self,
wireless_profile_name,
headers=None,
**request_parameters):
"""Delete the Wireless Profile from DNAC whose name is provided.
Args:
wireless_profile_name(basestring): wirelessProfileName path parameter.
headers(dict): Dictionary of HTTP Headers to send with the Request
.
**request_parameters: Additional request parameters (provides
support for parameters that may be added in the future).
Returns:
MyDict: JSON response. Access the object's properties by using
the dot notation or the bracket notation.
Raises:
TypeError: If the parameter types are incorrect.
MalformedRequest: If the request body created is invalid.
ApiError: If the DNA Center cloud returns an error.
"""
check_type(headers, dict)
check_type(wireless_profile_name, basestring,
may_be_none=False)
if headers is not None:
if 'X-Auth-Token' in headers:
check_type(headers.get('X-Auth-Token'),
basestring, may_be_none=False)
_params = {
}
_params.update(request_parameters)
_params = dict_from_items_with_values(_params)
path_params = {
'wirelessProfileName': wireless_profile_name,
}
with_custom_headers = False
_headers = self._session.headers or {}
if headers:
_headers.update(dict_of_str(headers))
with_custom_headers = True
e_url = ('/dna/intent/api/v1/wireless-'
+ 'profile/{wirelessProfileName}')
endpoint_full_url = apply_path_params(e_url, path_params)
if with_custom_headers:
json_data = self._session.delete(endpoint_full_url, params=_params,
headers=_headers)
else:
json_data = self._session.delete(endpoint_full_url, params=_params)
return self._object_factory('bpm_a850fb6c5451a7ad20ba76f4ff43_v2_2_1', json_data)
def ap_provision(self,
headers=None,
payload=None,
active_validation=True,
**request_parameters):
"""Provision wireless Access points.
Args:
headers(dict): Dictionary of HTTP Headers to send with the Request
.
payload(list): A JSON serializable Python object to send in the
body of the Request.
active_validation(bool): Enable/Disable payload validation.
Defaults to True.
**request_parameters: Additional request parameters (provides
support for parameters that may be added in the future).
Returns:
MyDict: JSON response. Access the object's properties by using
the dot notation or the bracket notation.
Raises:
TypeError: If the parameter types are incorrect.
MalformedRequest: If the request body created is invalid.
ApiError: If the DNA Center cloud returns an error.
"""
check_type(headers, dict)
check_type(payload, list)
if headers is not None:
if '__persistbapioutput' in headers:
check_type(headers.get('__persistbapioutput'),
bool)
if 'X-Auth-Token' in headers:
check_type(headers.get('X-Auth-Token'),
basestring, may_be_none=False)
_params = {
}
_params.update(request_parameters)
_params = dict_from_items_with_values(_params)
path_params = {
}
_payload = payload or []
if active_validation:
self._request_validator('jsd_f790a930d452708353c374f5c0f90f_v2_2_1')\
.validate(_payload)
with_custom_headers = False
_headers = self._session.headers or {}
if headers:
_headers.update(dict_of_str(headers))
with_custom_headers = True
e_url = ('/dna/intent/api/v1/wireless/ap-provision')
endpoint_full_url = apply_path_params(e_url, path_params)
if with_custom_headers:
json_data = self._session.post(endpoint_full_url, params=_params,
json=_payload,
headers=_headers)
else:
json_data = self._session.post(endpoint_full_url, params=_params,
json=_payload)
return self._object_factory('bpm_f790a930d452708353c374f5c0f90f_v2_2_1', json_data)
def delete_ssid_and_provision_it_to_devices(self,
managed_aplocations,
ssid_name,
headers=None,
**request_parameters):
"""Removes SSID or WLAN from the network profile, reprovision the device(s) and deletes the SSID or WLAN from DNA
Center.
Args:
ssid_name(basestring): ssidName path parameter.
managed_aplocations(basestring): managedAPLocations path parameter.
headers(dict): Dictionary of HTTP Headers to send with the Request
.
**request_parameters: Additional request parameters (provides
support for parameters that may be added in the future).
Returns:
MyDict: JSON response. Access the object's properties by using
the dot notation or the bracket notation.
Raises:
TypeError: If the parameter types are incorrect.
MalformedRequest: If the request body created is invalid.
ApiError: If the DNA Center cloud returns an error.
"""
check_type(headers, dict)
check_type(ssid_name, basestring,
may_be_none=False)
check_type(managed_aplocations, basestring,
may_be_none=False)
if headers is not None:
if '__persistbapioutput' in headers:
check_type(headers.get('__persistbapioutput'),
bool, may_be_none=False)
if 'X-Auth-Token' in headers:
check_type(headers.get('X-Auth-Token'),
basestring, may_be_none=False)
_params = {
}
_params.update(request_parameters)
_params = dict_from_items_with_values(_params)
path_params = {
'ssidName': ssid_name,
'managedAPLocations': managed_aplocations,
}
with_custom_headers = False
_headers = self._session.headers or {}
if headers:
_headers.update(dict_of_str(headers))
with_custom_headers = True
e_url = ('/dna/intent/api/v1/business/ssid/{ssidName}/{managedAPLo'
+ 'cations}')
endpoint_full_url = apply_path_params(e_url, path_params)
if with_custom_headers:
json_data = self._session.delete(endpoint_full_url, params=_params,
headers=_headers)
else:
json_data = self._session.delete(endpoint_full_url, params=_params)
return self._object_factory('bpm_e56eb2c294159d891b7dbe493ddc434_v2_2_1', json_data)
| 39.929661
| 121
| 0.57631
| 4,764
| 47,117
| 5.45445
| 0.075357
| 0.04187
| 0.031403
| 0.023398
| 0.766173
| 0.756821
| 0.751087
| 0.726573
| 0.721724
| 0.721724
| 0
| 0.018468
| 0.35987
| 47,117
| 1,179
| 122
| 39.963528
| 0.843075
| 0.321179
| 0
| 0.697504
| 0
| 0.001468
| 0.091664
| 0.055968
| 0
| 0
| 0
| 0
| 0
| 1
| 0.024963
| false
| 0.004405
| 0.008811
| 0
| 0.058737
| 0.001468
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
badbf4f3c67e7f8d21e8a1b5ee4d5f3b1ec1aaf7
| 214
|
py
|
Python
|
attributes/translation.py
|
pmaigutyak/mp-shop
|
14ea67f71fd91a282d2070414924708214fc6464
|
[
"0BSD"
] | 2
|
2018-03-14T11:32:36.000Z
|
2021-09-25T14:31:36.000Z
|
attributes/translation.py
|
pmaigutyak/mp-attributes
|
03aefcbc644beac605ab4c467997215dd550a5b2
|
[
"0BSD"
] | 1
|
2018-08-10T08:30:47.000Z
|
2019-05-14T17:21:21.000Z
|
attributes/translation.py
|
pmaigutyak/mp-shop-attrs
|
4912de8d07e1083f86d468e3c869a46460c41915
|
[
"0BSD"
] | null | null | null |
from modeltranslation.translator import translator
from attributes.models import Attribute, AttributeOption
translator.register(Attribute, fields=['name'])
translator.register(AttributeOption, fields=['name'])
| 23.777778
| 56
| 0.82243
| 21
| 214
| 8.380952
| 0.52381
| 0.204545
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.079439
| 214
| 8
| 57
| 26.75
| 0.893401
| 0
| 0
| 0
| 0
| 0
| 0.037559
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
242f4b4a5cad2e4e01aa5e34d53fd037cca8f666
| 32
|
py
|
Python
|
team/stats/__init__.py
|
ReubenJ/ulti_stats
|
cba7ab6a0e708bf809cfca8e18b48a44e4f9e54c
|
[
"MIT"
] | null | null | null |
team/stats/__init__.py
|
ReubenJ/ulti_stats
|
cba7ab6a0e708bf809cfca8e18b48a44e4f9e54c
|
[
"MIT"
] | 6
|
2019-07-09T16:11:52.000Z
|
2019-07-12T17:16:48.000Z
|
team/stats/__init__.py
|
ReubenJ/ulti_stats
|
cba7ab6a0e708bf809cfca8e18b48a44e4f9e54c
|
[
"MIT"
] | 2
|
2019-07-12T17:31:48.000Z
|
2019-07-12T22:33:22.000Z
|
from .ind_stats import IndStats
| 16
| 31
| 0.84375
| 5
| 32
| 5.2
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 32
| 1
| 32
| 32
| 0.928571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
246343f6bf2ef70e591d3e81be825b949300574c
| 55
|
py
|
Python
|
rest_typed/serializers/__init__.py
|
rsinger86/drf-typed
|
9eafb052786d64e386c9191998b8a8dd59cb1f27
|
[
"MIT"
] | 26
|
2021-10-18T08:02:16.000Z
|
2022-03-28T06:12:09.000Z
|
rest_typed/serializers/__init__.py
|
rsinger86/drf-typed
|
9eafb052786d64e386c9191998b8a8dd59cb1f27
|
[
"MIT"
] | 1
|
2021-12-20T21:51:46.000Z
|
2022-01-13T18:51:30.000Z
|
rest_typed/serializers/__init__.py
|
rsinger86/drf-typed
|
9eafb052786d64e386c9191998b8a8dd59cb1f27
|
[
"MIT"
] | 3
|
2021-10-30T11:42:05.000Z
|
2022-01-26T15:22:18.000Z
|
from .serializers import TModelSerializer, TSerializer
| 27.5
| 54
| 0.872727
| 5
| 55
| 9.6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.090909
| 55
| 1
| 55
| 55
| 0.96
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
03413bef372ec2904763e898ae8ab5b195dd764e
| 226
|
py
|
Python
|
ircbot/ircbotfactory.py
|
cyberworm/ircbot
|
898b26bd44754fb1a97edd8afcb388b7849d08d2
|
[
"MIT"
] | null | null | null |
ircbot/ircbotfactory.py
|
cyberworm/ircbot
|
898b26bd44754fb1a97edd8afcb388b7849d08d2
|
[
"MIT"
] | null | null | null |
ircbot/ircbotfactory.py
|
cyberworm/ircbot
|
898b26bd44754fb1a97edd8afcb388b7849d08d2
|
[
"MIT"
] | null | null | null |
import socket
from ircbot import IrcBot
from irccommands import IrcCommands
from ircsocket import IrcSocket
class IrcBotFactory(object):
def create(self):
return IrcBot(IrcSocket(socket.socket()), IrcCommands())
| 22.6
| 64
| 0.774336
| 26
| 226
| 6.730769
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.154867
| 226
| 9
| 65
| 25.111111
| 0.91623
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.142857
| false
| 0
| 0.571429
| 0.142857
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 5
|
302f042e339b9c039d352534741411b7aebcaf0c
| 86
|
py
|
Python
|
exceptions.py
|
magnuswenzer/mini_inventory
|
823a34673995375d2eee06774ab16b6b6aa01a1c
|
[
"MIT"
] | null | null | null |
exceptions.py
|
magnuswenzer/mini_inventory
|
823a34673995375d2eee06774ab16b6b6aa01a1c
|
[
"MIT"
] | null | null | null |
exceptions.py
|
magnuswenzer/mini_inventory
|
823a34673995375d2eee06774ab16b6b6aa01a1c
|
[
"MIT"
] | null | null | null |
class AlreadyInDatabase(Exception):
pass
class MissingUnit(Exception):
pass
| 12.285714
| 35
| 0.744186
| 8
| 86
| 8
| 0.625
| 0.40625
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.186047
| 86
| 7
| 36
| 12.285714
| 0.914286
| 0
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
30407ea42de84f62b82a62d8e827b644a76cdff2
| 101
|
py
|
Python
|
examples/reminder_bot/database.py
|
chrisdewa/disbots
|
b4e2f31513665f2f66e2efc5fd6c9221e3eb5e21
|
[
"MIT"
] | 12
|
2021-06-09T16:37:59.000Z
|
2022-03-14T01:41:24.000Z
|
examples/reminder_bot/database.py
|
chrisdewa/disbots
|
b4e2f31513665f2f66e2efc5fd6c9221e3eb5e21
|
[
"MIT"
] | null | null | null |
examples/reminder_bot/database.py
|
chrisdewa/disbots
|
b4e2f31513665f2f66e2efc5fd6c9221e3eb5e21
|
[
"MIT"
] | 6
|
2021-10-04T23:23:26.000Z
|
2022-03-23T11:12:03.000Z
|
import motor.motor_asyncio
client = motor.motor_asyncio.AsyncIOMotorClient()
db = client.reminders
| 16.833333
| 49
| 0.821782
| 12
| 101
| 6.75
| 0.583333
| 0.246914
| 0.419753
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.09901
| 101
| 5
| 50
| 20.2
| 0.89011
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
06390e6be91a19412e2814a904b89f469e710932
| 4,195
|
py
|
Python
|
bertsumm/evaluate.py
|
monkeyhjy/aspect_summarization
|
3018815cd0aeccb752e9f51a4d49453c4f441650
|
[
"MIT"
] | null | null | null |
bertsumm/evaluate.py
|
monkeyhjy/aspect_summarization
|
3018815cd0aeccb752e9f51a4d49453c4f441650
|
[
"MIT"
] | null | null | null |
bertsumm/evaluate.py
|
monkeyhjy/aspect_summarization
|
3018815cd0aeccb752e9f51a4d49453c4f441650
|
[
"MIT"
] | null | null | null |
# coding:utf8
from rouge import Rouge
tool_names = [
'Jenkins'
]
aspect_names = [
'compatibility', 'documentation', 'functional', 'performance', 'reliability', 'usability', 'other'
]
rouge_methods = [
"rouge-1",
"rouge-2",
"rouge-l"
]
def mean(arr):
sum = 0
for i in arr:
sum += i
return sum/len(arr)
def read_result(model, tool, aspect):
positive = []
negative = []
ns=""
ps=""
curr = True
path = "data/result/"+model+"/test/"+tool+"."+aspect+".txt"
f = open(path, "r", encoding="utf-8")
for line in f:
line = line.strip()
if line == "negative:":
curr = False
if len(line) != 0:
if curr:
ns += line+"\n"
else:
ps += line+"\n"
positive.append(ps.lower())
negative.append(ns.lower())
return positive, negative
def read_label(num, tool, aspect):
positive = []
negative = []
ns = ""
ps = ""
curr = True
path = "data/test/" + tool + "/gold" + num + "/" + aspect + ".txt"
f = open(path, "r", encoding="utf-8")
for line in f:
line = line.strip()
if line == "Positive:":
curr = False
if len(line) != 0:
if curr:
ns += line + "\n"
else:
ps += line + "\n"
positive.append(ps.lower())
negative.append(ns.lower())
return positive, negative
rouge_score1 = {
"bert": {
"rouge-1": [],
"rouge-2": [],
"rouge-l": [],
},
"bert_ori": {
"rouge-1": [],
"rouge-2": [],
"rouge-l": [],
}
}
rouge_score2 = {
"bert": {
"rouge-1": [],
"rouge-2": [],
"rouge-l": [],
},
"bert_ori": {
"rouge-1": [],
"rouge-2": [],
"rouge-l": [],
}
}
rouge = Rouge()
for t in tool_names:
for a in aspect_names:
# label1
label1_positive, label1_negative = read_label("1", t, a)
# label2
label2_positive, label2_negative = read_label("2", t, a)
# bert origin
bert_ori_positive, bert_ori_negative = read_result("bert_ori", t, a)
rouge_score1_p = rouge.get_scores(label1_positive, bert_ori_positive)
rouge_score2_p = rouge.get_scores(label2_positive, bert_ori_positive)
for r in rouge_methods:
rouge_score1["bert_ori"][r].append(rouge_score1_p[0][r]['r'])
rouge_score2["bert_ori"][r].append(rouge_score2_p[0][r]['r'])
rouge_score1_n = rouge.get_scores(label1_negative, bert_ori_negative)
rouge_score2_n = rouge.get_scores(label2_negative, bert_ori_negative)
for r in rouge_methods:
rouge_score1["bert_ori"][r].append(rouge_score1_n[0][r]['r'])
rouge_score2["bert_ori"][r].append(rouge_score2_n[0][r]['r'])
# bert
bert_positive, bert_negative = read_result("bert", t, a)
rouge_score1_p = rouge.get_scores(label1_positive, bert_positive)
rouge_score2_p = rouge.get_scores(label2_positive, bert_positive)
for r in rouge_methods:
rouge_score1["bert"][r].append(rouge_score1_p[0][r]['r'])
rouge_score2["bert"][r].append(rouge_score2_p[0][r]['r'])
rouge_score1_n = rouge.get_scores(label1_negative, bert_ori_negative)
rouge_score2_n = rouge.get_scores(label2_negative, bert_ori_negative)
for r in rouge_methods:
rouge_score1["bert"][r].append(rouge_score1_n[0][r]['r'])
rouge_score2["bert"][r].append(rouge_score2_n[0][r]['r'])
fout = open('../output/eval-ES.txt', 'w', encoding='utf-8')
for r in rouge_methods:
fout.write("***bert***\n")
fout.write(r+":\n")
fout.write("1: "+str(mean(rouge_score1["bert"][r]))+"\n")
fout.write("2: " + str(mean(rouge_score2["bert"][r]))+"\n")
fout.write("***bert_ori***\n")
fout.write(r + ":\n")
fout.write("1: " + str(mean(rouge_score1["bert_ori"][r]))+"\n")
fout.write("2: " + str(mean(rouge_score2["bert_ori"][r]))+"\n")
| 29.335664
| 103
| 0.533492
| 529
| 4,195
| 4.018904
| 0.149338
| 0.059266
| 0.052681
| 0.022578
| 0.730009
| 0.713076
| 0.70461
| 0.70461
| 0.700847
| 0.693321
| 0
| 0.025372
| 0.295352
| 4,195
| 143
| 104
| 29.335664
| 0.693843
| 0.010012
| 0
| 0.516949
| 0
| 0
| 0.115826
| 0.005242
| 0
| 0
| 0
| 0
| 0
| 1
| 0.025424
| false
| 0
| 0.008475
| 0
| 0.059322
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
06675ae6611b8201063a4b19dc6fc660b9cfbce0
| 39,646
|
py
|
Python
|
opencdms/models/djangodemo/migrations/0001_initial.py
|
faysal-ishtiaq/pyopencdms
|
9872a9058af440f0e043c79ef75026a711877ac7
|
[
"MIT"
] | 3
|
2021-08-03T16:34:03.000Z
|
2021-09-09T21:38:58.000Z
|
opencdms/models/djangodemo/migrations/0001_initial.py
|
faysal-ishtiaq/pyopencdms
|
9872a9058af440f0e043c79ef75026a711877ac7
|
[
"MIT"
] | 41
|
2020-10-22T07:59:41.000Z
|
2022-03-22T16:54:44.000Z
|
opencdms/models/djangodemo/migrations/0001_initial.py
|
faysal-ishtiaq/pyopencdms
|
9872a9058af440f0e043c79ef75026a711877ac7
|
[
"MIT"
] | 5
|
2020-10-30T10:55:10.000Z
|
2022-01-16T11:16:47.000Z
|
# Generated by Django 3.2.7 on 2021-09-09 00:36
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Obselement',
fields=[
('elementid', models.BigIntegerField(db_column='elementId', primary_key=True, serialize=False)),
('abbreviation', models.CharField(blank=True, max_length=255, null=True)),
('elementname', models.CharField(blank=True, db_column='elementName', max_length=255, null=True)),
('description', models.CharField(blank=True, max_length=255, null=True)),
('elementscale', models.DecimalField(blank=True, db_column='elementScale', decimal_places=2, max_digits=8, null=True)),
('upperlimit', models.CharField(blank=True, db_column='upperLimit', max_length=255, null=True)),
('lowerlimit', models.CharField(blank=True, db_column='lowerLimit', max_length=255, null=True)),
('units', models.CharField(blank=True, max_length=255, null=True)),
('elementtype', models.CharField(blank=True, max_length=50, null=True)),
('qctotalrequired', models.IntegerField(blank=True, db_column='qcTotalRequired', null=True)),
('selected', models.IntegerField()),
],
options={
'db_table': 'obselement',
'managed': True,
},
),
migrations.CreateModel(
name='Station',
fields=[
('stationid', models.CharField(db_column='stationId', max_length=255, primary_key=True, serialize=False)),
('stationname', models.CharField(blank=True, db_column='stationName', max_length=255, null=True)),
('wmoid', models.CharField(blank=True, max_length=20, null=True)),
('icaoid', models.CharField(blank=True, max_length=20, null=True)),
('latitude', models.FloatField(blank=True, null=True)),
('qualifier', models.CharField(blank=True, max_length=20, null=True)),
('longitude', models.FloatField(blank=True, null=True)),
('elevation', models.CharField(blank=True, max_length=255, null=True)),
('geolocationmethod', models.CharField(blank=True, db_column='geoLocationMethod', max_length=255, null=True)),
('geolocationaccuracy', models.FloatField(blank=True, db_column='geoLocationAccuracy', null=True)),
('openingdatetime', models.CharField(blank=True, db_column='openingDatetime', max_length=50, null=True)),
('closingdatetime', models.CharField(blank=True, db_column='closingDatetime', max_length=50, null=True)),
('country', models.CharField(blank=True, max_length=50, null=True)),
('authority', models.CharField(blank=True, max_length=255, null=True)),
('adminregion', models.CharField(blank=True, db_column='adminRegion', max_length=255, null=True)),
('drainagebasin', models.CharField(blank=True, db_column='drainageBasin', max_length=255, null=True)),
('wacaselection', models.IntegerField(blank=True, db_column='wacaSelection', null=True)),
('cptselection', models.IntegerField(blank=True, db_column='cptSelection', null=True)),
('stationoperational', models.IntegerField(blank=True, db_column='stationOperational', null=True)),
],
options={
'db_table': 'station',
'managed': True,
},
),
migrations.CreateModel(
name='FormSynoptic2Ra1',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('stationid', models.CharField(db_column='stationId', max_length=255)),
('yyyy', models.IntegerField()),
('mm', models.IntegerField()),
('dd', models.IntegerField()),
('hh', models.IntegerField()),
('val_elem106', models.CharField(blank=True, db_column='Val_Elem106', max_length=6, null=True)),
('val_elem107', models.CharField(blank=True, db_column='Val_Elem107', max_length=6, null=True)),
('val_elem400', models.CharField(blank=True, db_column='Val_Elem400', max_length=6, null=True)),
('val_elem814', models.CharField(blank=True, db_column='Val_Elem814', max_length=6, null=True)),
('val_elem399', models.CharField(blank=True, db_column='Val_Elem399', max_length=6, null=True)),
('val_elem301', models.CharField(blank=True, db_column='Val_Elem301', max_length=6, null=True)),
('val_elem185', models.CharField(blank=True, db_column='Val_Elem185', max_length=6, null=True)),
('val_elem101', models.CharField(blank=True, db_column='Val_Elem101', max_length=6, null=True)),
('val_elem102', models.CharField(blank=True, db_column='Val_Elem102', max_length=6, null=True)),
('val_elem103', models.CharField(blank=True, db_column='Val_Elem103', max_length=6, null=True)),
('val_elem105', models.CharField(blank=True, db_column='Val_Elem105', max_length=6, null=True)),
('val_elem192', models.CharField(blank=True, db_column='Val_Elem192', max_length=6, null=True)),
('val_elem110', models.CharField(blank=True, db_column='Val_Elem110', max_length=6, null=True)),
('val_elem114', models.CharField(blank=True, db_column='Val_Elem114', max_length=6, null=True)),
('val_elem112', models.CharField(blank=True, db_column='Val_Elem112', max_length=6, null=True)),
('val_elem111', models.CharField(blank=True, db_column='Val_Elem111', max_length=6, null=True)),
('val_elem167', models.CharField(blank=True, db_column='Val_Elem167', max_length=6, null=True)),
('val_elem197', models.CharField(blank=True, db_column='Val_Elem197', max_length=6, null=True)),
('val_elem193', models.CharField(blank=True, db_column='Val_Elem193', max_length=6, null=True)),
('val_elem115', models.CharField(blank=True, db_column='Val_Elem115', max_length=6, null=True)),
('val_elem168', models.CharField(blank=True, db_column='Val_Elem168', max_length=6, null=True)),
('val_elem169', models.CharField(blank=True, db_column='Val_Elem169', max_length=6, null=True)),
('val_elem170', models.CharField(blank=True, db_column='Val_Elem170', max_length=6, null=True)),
('val_elem171', models.CharField(blank=True, db_column='Val_Elem171', max_length=6, null=True)),
('val_elem119', models.CharField(blank=True, db_column='Val_Elem119', max_length=6, null=True)),
('val_elem116', models.CharField(blank=True, db_column='Val_Elem116', max_length=6, null=True)),
('val_elem117', models.CharField(blank=True, db_column='Val_Elem117', max_length=6, null=True)),
('val_elem118', models.CharField(blank=True, db_column='Val_Elem118', max_length=6, null=True)),
('val_elem123', models.CharField(blank=True, db_column='Val_Elem123', max_length=6, null=True)),
('val_elem120', models.CharField(blank=True, db_column='Val_Elem120', max_length=6, null=True)),
('val_elem121', models.CharField(blank=True, db_column='Val_Elem121', max_length=6, null=True)),
('val_elem122', models.CharField(blank=True, db_column='Val_Elem122', max_length=6, null=True)),
('val_elem127', models.CharField(blank=True, db_column='Val_Elem127', max_length=6, null=True)),
('val_elem124', models.CharField(blank=True, db_column='Val_Elem124', max_length=6, null=True)),
('val_elem125', models.CharField(blank=True, db_column='Val_Elem125', max_length=6, null=True)),
('val_elem126', models.CharField(blank=True, db_column='Val_Elem126', max_length=6, null=True)),
('val_elem131', models.CharField(blank=True, db_column='Val_Elem131', max_length=6, null=True)),
('val_elem128', models.CharField(blank=True, db_column='Val_Elem128', max_length=6, null=True)),
('val_elem129', models.CharField(blank=True, db_column='Val_Elem129', max_length=6, null=True)),
('val_elem130', models.CharField(blank=True, db_column='Val_Elem130', max_length=6, null=True)),
('val_elem002', models.CharField(blank=True, db_column='Val_Elem002', max_length=6, null=True)),
('val_elem003', models.CharField(blank=True, db_column='Val_Elem003', max_length=6, null=True)),
('val_elem099', models.CharField(blank=True, db_column='Val_Elem099', max_length=6, null=True)),
('val_elem018', models.CharField(blank=True, db_column='Val_Elem018', max_length=6, null=True)),
('val_elem084', models.CharField(blank=True, db_column='Val_Elem084', max_length=6, null=True)),
('val_elem132', models.CharField(blank=True, db_column='Val_Elem132', max_length=6, null=True)),
('val_elem005', models.CharField(blank=True, db_column='Val_Elem005', max_length=6, null=True)),
('val_elem174', models.CharField(blank=True, db_column='Val_Elem174', max_length=6, null=True)),
('val_elem046', models.CharField(blank=True, db_column='Val_Elem046', max_length=6, null=True)),
('flag106', models.CharField(blank=True, db_column='Flag106', max_length=1, null=True)),
('flag107', models.CharField(blank=True, db_column='Flag107', max_length=1, null=True)),
('flag400', models.CharField(blank=True, db_column='Flag400', max_length=1, null=True)),
('flag814', models.CharField(blank=True, db_column='Flag814', max_length=1, null=True)),
('flag399', models.CharField(blank=True, db_column='Flag399', max_length=1, null=True)),
('flag301', models.CharField(blank=True, db_column='Flag301', max_length=1, null=True)),
('flag185', models.CharField(blank=True, db_column='Flag185', max_length=1, null=True)),
('flag101', models.CharField(blank=True, db_column='Flag101', max_length=1, null=True)),
('flag102', models.CharField(blank=True, db_column='Flag102', max_length=1, null=True)),
('flag103', models.CharField(blank=True, db_column='Flag103', max_length=1, null=True)),
('flag105', models.CharField(blank=True, db_column='Flag105', max_length=1, null=True)),
('flag192', models.CharField(blank=True, db_column='Flag192', max_length=1, null=True)),
('flag110', models.CharField(blank=True, db_column='Flag110', max_length=1, null=True)),
('flag114', models.CharField(blank=True, db_column='Flag114', max_length=1, null=True)),
('flag112', models.CharField(blank=True, db_column='Flag112', max_length=1, null=True)),
('flag111', models.CharField(blank=True, db_column='Flag111', max_length=1, null=True)),
('flag167', models.CharField(blank=True, db_column='Flag167', max_length=1, null=True)),
('flag197', models.CharField(blank=True, db_column='Flag197', max_length=1, null=True)),
('flag193', models.CharField(blank=True, db_column='Flag193', max_length=1, null=True)),
('flag115', models.CharField(blank=True, db_column='Flag115', max_length=1, null=True)),
('flag168', models.CharField(blank=True, db_column='Flag168', max_length=1, null=True)),
('flag169', models.CharField(blank=True, db_column='Flag169', max_length=1, null=True)),
('flag170', models.CharField(blank=True, db_column='Flag170', max_length=1, null=True)),
('flag171', models.CharField(blank=True, db_column='Flag171', max_length=1, null=True)),
('flag119', models.CharField(blank=True, db_column='Flag119', max_length=1, null=True)),
('flag116', models.CharField(blank=True, db_column='Flag116', max_length=1, null=True)),
('flag117', models.CharField(blank=True, db_column='Flag117', max_length=1, null=True)),
('flag118', models.CharField(blank=True, db_column='Flag118', max_length=1, null=True)),
('flag123', models.CharField(blank=True, db_column='Flag123', max_length=1, null=True)),
('flag120', models.CharField(blank=True, db_column='Flag120', max_length=1, null=True)),
('flag121', models.CharField(blank=True, db_column='Flag121', max_length=1, null=True)),
('flag122', models.CharField(blank=True, db_column='Flag122', max_length=1, null=True)),
('flag127', models.CharField(blank=True, db_column='Flag127', max_length=1, null=True)),
('flag124', models.CharField(blank=True, db_column='Flag124', max_length=1, null=True)),
('flag125', models.CharField(blank=True, db_column='Flag125', max_length=1, null=True)),
('flag126', models.CharField(blank=True, db_column='Flag126', max_length=1, null=True)),
('flag131', models.CharField(blank=True, db_column='Flag131', max_length=1, null=True)),
('flag128', models.CharField(blank=True, db_column='Flag128', max_length=1, null=True)),
('flag129', models.CharField(blank=True, db_column='Flag129', max_length=1, null=True)),
('flag130', models.CharField(blank=True, db_column='Flag130', max_length=1, null=True)),
('flag002', models.CharField(blank=True, db_column='Flag002', max_length=1, null=True)),
('flag003', models.CharField(blank=True, db_column='Flag003', max_length=1, null=True)),
('flag099', models.CharField(blank=True, db_column='Flag099', max_length=1, null=True)),
('flag018', models.CharField(blank=True, db_column='Flag018', max_length=1, null=True)),
('flag084', models.CharField(blank=True, db_column='Flag084', max_length=1, null=True)),
('flag132', models.CharField(blank=True, db_column='Flag132', max_length=1, null=True)),
('flag005', models.CharField(blank=True, db_column='Flag005', max_length=1, null=True)),
('flag174', models.CharField(blank=True, db_column='Flag174', max_length=1, null=True)),
('flag046', models.CharField(blank=True, db_column='Flag046', max_length=1, null=True)),
('signature', models.CharField(blank=True, max_length=45, null=True)),
('entrydatetime', models.DateTimeField(blank=True, db_column='entryDatetime', null=True)),
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
],
options={
'db_table': 'form_synoptic_2_ra1',
'managed': True,
'unique_together': {('stationid', 'yyyy', 'mm', 'dd', 'hh')},
},
),
migrations.CreateModel(
name='FormMonthly',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('stationid', models.CharField(db_column='stationId', max_length=255)),
('elementid', models.IntegerField(db_column='elementId')),
('yyyy', models.IntegerField()),
('mm_01', models.CharField(blank=True, max_length=255, null=True)),
('mm_02', models.CharField(blank=True, max_length=255, null=True)),
('mm_03', models.CharField(blank=True, max_length=255, null=True)),
('mm_04', models.CharField(blank=True, max_length=255, null=True)),
('mm_05', models.CharField(blank=True, max_length=255, null=True)),
('mm_06', models.CharField(blank=True, max_length=255, null=True)),
('mm_07', models.CharField(blank=True, max_length=255, null=True)),
('mm_08', models.CharField(blank=True, max_length=255, null=True)),
('mm_09', models.CharField(blank=True, max_length=255, null=True)),
('mm_10', models.CharField(blank=True, max_length=255, null=True)),
('mm_11', models.CharField(blank=True, max_length=255, null=True)),
('mm_12', models.CharField(blank=True, max_length=255, null=True)),
('flag01', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=255, null=True)),
('flag02', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=255, null=True)),
('flag03', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=255, null=True)),
('flag04', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=255, null=True)),
('flag05', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=255, null=True)),
('flag06', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=255, null=True)),
('flag07', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=255, null=True)),
('flag08', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=255, null=True)),
('flag09', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=255, null=True)),
('flag10', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=255, null=True)),
('flag11', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=255, null=True)),
('flag12', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=255, null=True)),
('period01', models.CharField(blank=True, max_length=255, null=True)),
('period02', models.CharField(blank=True, max_length=255, null=True)),
('period03', models.CharField(blank=True, max_length=255, null=True)),
('period04', models.CharField(blank=True, max_length=255, null=True)),
('period05', models.CharField(blank=True, max_length=255, null=True)),
('period06', models.CharField(blank=True, max_length=255, null=True)),
('period07', models.CharField(blank=True, max_length=255, null=True)),
('period08', models.CharField(blank=True, max_length=255, null=True)),
('period09', models.CharField(blank=True, max_length=255, null=True)),
('period10', models.CharField(blank=True, max_length=255, null=True)),
('period11', models.CharField(blank=True, max_length=255, null=True)),
('period12', models.CharField(blank=True, max_length=255, null=True)),
('signature', models.CharField(blank=True, max_length=50, null=True)),
('entrydatetime', models.DateTimeField(blank=True, db_column='entryDatetime', null=True)),
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
],
options={
'db_table': 'form_monthly',
'managed': True,
'unique_together': {('stationid', 'elementid', 'yyyy')},
},
),
migrations.CreateModel(
name='FormHourly',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('stationid', models.CharField(db_column='stationId', max_length=50)),
('elementid', models.IntegerField(db_column='elementId')),
('yyyy', models.IntegerField()),
('mm', models.IntegerField()),
('dd', models.IntegerField()),
('hh_00', models.CharField(blank=True, max_length=50, null=True)),
('hh_01', models.CharField(blank=True, max_length=50, null=True)),
('hh_02', models.CharField(blank=True, max_length=50, null=True)),
('hh_03', models.CharField(blank=True, max_length=50, null=True)),
('hh_04', models.CharField(blank=True, max_length=50, null=True)),
('hh_05', models.CharField(blank=True, max_length=50, null=True)),
('hh_06', models.CharField(blank=True, max_length=50, null=True)),
('hh_07', models.CharField(blank=True, max_length=50, null=True)),
('hh_08', models.CharField(blank=True, max_length=50, null=True)),
('hh_09', models.CharField(blank=True, max_length=50, null=True)),
('hh_10', models.CharField(blank=True, max_length=50, null=True)),
('hh_11', models.CharField(blank=True, max_length=50, null=True)),
('hh_12', models.CharField(blank=True, max_length=50, null=True)),
('hh_13', models.CharField(blank=True, max_length=50, null=True)),
('hh_14', models.CharField(blank=True, max_length=50, null=True)),
('hh_15', models.CharField(blank=True, max_length=50, null=True)),
('hh_16', models.CharField(blank=True, max_length=50, null=True)),
('hh_17', models.CharField(blank=True, max_length=50, null=True)),
('hh_18', models.CharField(blank=True, max_length=50, null=True)),
('hh_19', models.CharField(blank=True, max_length=50, null=True)),
('hh_20', models.CharField(blank=True, max_length=50, null=True)),
('hh_21', models.CharField(blank=True, max_length=50, null=True)),
('hh_22', models.CharField(blank=True, max_length=50, null=True)),
('hh_23', models.CharField(blank=True, max_length=50, null=True)),
('flag00', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=50, null=True)),
('flag01', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=50, null=True)),
('flag02', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=50, null=True)),
('flag03', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=50, null=True)),
('flag04', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=50, null=True)),
('flag05', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=50, null=True)),
('flag06', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=50, null=True)),
('flag07', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=50, null=True)),
('flag08', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=50, null=True)),
('flag09', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=50, null=True)),
('flag10', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=50, null=True)),
('flag11', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=50, null=True)),
('flag12', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=50, null=True)),
('flag13', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=50, null=True)),
('flag14', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=50, null=True)),
('flag15', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=50, null=True)),
('flag16', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=50, null=True)),
('flag17', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=50, null=True)),
('flag18', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=50, null=True)),
('flag19', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=50, null=True)),
('flag20', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=50, null=True)),
('flag21', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=50, null=True)),
('flag22', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=50, null=True)),
('flag23', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=50, null=True)),
('total', models.CharField(blank=True, max_length=50, null=True)),
('signature', models.CharField(blank=True, max_length=50, null=True)),
('entrydatetime', models.DateTimeField(blank=True, db_column='entryDatetime', null=True)),
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
],
options={
'db_table': 'form_hourly',
'managed': True,
'unique_together': {('stationid', 'elementid', 'yyyy', 'mm', 'dd')},
},
),
migrations.CreateModel(
name='FormDaily2',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('stationid', models.CharField(db_column='stationId', max_length=50)),
('elementid', models.IntegerField(db_column='elementId')),
('yyyy', models.IntegerField()),
('mm', models.IntegerField()),
('hh', models.IntegerField()),
('day01', models.CharField(blank=True, max_length=45, null=True)),
('day02', models.CharField(blank=True, max_length=45, null=True)),
('day03', models.CharField(blank=True, max_length=45, null=True)),
('day04', models.CharField(blank=True, max_length=45, null=True)),
('day05', models.CharField(blank=True, max_length=45, null=True)),
('day06', models.CharField(blank=True, max_length=45, null=True)),
('day07', models.CharField(blank=True, max_length=45, null=True)),
('day08', models.CharField(blank=True, max_length=45, null=True)),
('day09', models.CharField(blank=True, max_length=45, null=True)),
('day10', models.CharField(blank=True, max_length=45, null=True)),
('day11', models.CharField(blank=True, max_length=45, null=True)),
('day12', models.CharField(blank=True, max_length=45, null=True)),
('day13', models.CharField(blank=True, max_length=45, null=True)),
('day14', models.CharField(blank=True, max_length=45, null=True)),
('day15', models.CharField(blank=True, max_length=45, null=True)),
('day16', models.CharField(blank=True, max_length=45, null=True)),
('day17', models.CharField(blank=True, max_length=45, null=True)),
('day18', models.CharField(blank=True, max_length=45, null=True)),
('day19', models.CharField(blank=True, max_length=45, null=True)),
('day20', models.CharField(blank=True, max_length=45, null=True)),
('day21', models.CharField(blank=True, max_length=45, null=True)),
('day22', models.CharField(blank=True, max_length=45, null=True)),
('day23', models.CharField(blank=True, max_length=45, null=True)),
('day24', models.CharField(blank=True, max_length=45, null=True)),
('day25', models.CharField(blank=True, max_length=45, null=True)),
('day26', models.CharField(blank=True, max_length=45, null=True)),
('day27', models.CharField(blank=True, max_length=45, null=True)),
('day28', models.CharField(blank=True, max_length=45, null=True)),
('day29', models.CharField(blank=True, max_length=45, null=True)),
('day30', models.CharField(blank=True, max_length=45, null=True)),
('day31', models.CharField(blank=True, max_length=45, null=True)),
('flag01', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag02', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag03', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag04', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag05', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag06', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag07', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag08', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag09', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag10', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag11', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag12', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag13', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag14', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag15', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag16', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag17', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag18', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag19', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag20', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag21', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag22', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag23', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag24', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag25', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag26', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag27', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag28', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag29', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag30', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('flag31', models.CharField(blank=True, choices=[('', ''), ('M', 'M'), ('T', 'T'), ('E', 'E'), ('G', 'G'), ('D', 'D')], max_length=1, null=True)),
('period01', models.CharField(blank=True, max_length=45, null=True)),
('period02', models.CharField(blank=True, max_length=45, null=True)),
('period03', models.CharField(blank=True, max_length=45, null=True)),
('period04', models.CharField(blank=True, max_length=45, null=True)),
('period05', models.CharField(blank=True, max_length=45, null=True)),
('period06', models.CharField(blank=True, max_length=45, null=True)),
('period07', models.CharField(blank=True, max_length=45, null=True)),
('period08', models.CharField(blank=True, max_length=45, null=True)),
('period09', models.CharField(blank=True, max_length=45, null=True)),
('period10', models.CharField(blank=True, max_length=45, null=True)),
('period11', models.CharField(blank=True, max_length=45, null=True)),
('period12', models.CharField(blank=True, max_length=45, null=True)),
('period13', models.CharField(blank=True, max_length=45, null=True)),
('period14', models.CharField(blank=True, max_length=45, null=True)),
('period15', models.CharField(blank=True, max_length=45, null=True)),
('period16', models.CharField(blank=True, max_length=45, null=True)),
('period17', models.CharField(blank=True, max_length=45, null=True)),
('period18', models.CharField(blank=True, max_length=45, null=True)),
('period19', models.CharField(blank=True, max_length=45, null=True)),
('period20', models.CharField(blank=True, max_length=45, null=True)),
('period21', models.CharField(blank=True, max_length=45, null=True)),
('period22', models.CharField(blank=True, max_length=45, null=True)),
('period23', models.CharField(blank=True, max_length=45, null=True)),
('period24', models.CharField(blank=True, max_length=45, null=True)),
('period25', models.CharField(blank=True, max_length=45, null=True)),
('period26', models.CharField(blank=True, max_length=45, null=True)),
('period27', models.CharField(blank=True, max_length=45, null=True)),
('period28', models.CharField(blank=True, max_length=45, null=True)),
('period29', models.CharField(blank=True, max_length=45, null=True)),
('period30', models.CharField(blank=True, max_length=45, null=True)),
('period31', models.CharField(blank=True, max_length=45, null=True)),
('total', models.CharField(blank=True, max_length=45, null=True)),
('signature', models.CharField(blank=True, max_length=45, null=True)),
('entrydatetime', models.DateTimeField(blank=True, db_column='entryDatetime', null=True)),
('temperatureunits', models.CharField(blank=True, choices=[('Deg C', 'Deg C'), ('Deg F', 'Deg F')], db_column='temperatureUnits', default='Deg C', max_length=45, null=True)),
('precipunits', models.CharField(blank=True, choices=[('mm', 'mm'), ('inches', 'inches')], db_column='precipUnits', default='mm', max_length=45, null=True)),
('cloudheightunits', models.CharField(blank=True, choices=[('feet', 'feet'), ('metres', 'metres')], db_column='cloudHeightUnits', default='feet', max_length=45, null=True)),
('visunits', models.CharField(blank=True, choices=[('metres', 'metres'), ('yards', 'yards')], db_column='visUnits', default='metres', max_length=45, null=True)),
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
],
options={
'db_table': 'form_daily2',
'managed': True,
'unique_together': {('stationid', 'elementid', 'yyyy', 'mm', 'hh')},
},
),
]
| 94.171021
| 190
| 0.553473
| 4,765
| 39,646
| 4.475761
| 0.073452
| 0.13504
| 0.285085
| 0.342102
| 0.848267
| 0.779716
| 0.635767
| 0.550898
| 0.546303
| 0.35795
| 0
| 0.048592
| 0.218786
| 39,646
| 420
| 191
| 94.395238
| 0.639997
| 0.001135
| 0
| 0.169492
| 1
| 0
| 0.125458
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.007264
| 0
| 0.016949
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
0691cf277d9827e4f324ab7ebed86ddc7b211261
| 75
|
py
|
Python
|
NHLArenaAdjuster/__init__.py
|
delara38/NHLArenaAdjuster
|
ed823c61c1004ccae077d5913705e235708f7a17
|
[
"MIT"
] | 1
|
2021-09-09T23:25:20.000Z
|
2021-09-09T23:25:20.000Z
|
NHLArenaAdjuster/__init__.py
|
delara38/NHLArenaAdjuster
|
ed823c61c1004ccae077d5913705e235708f7a17
|
[
"MIT"
] | null | null | null |
NHLArenaAdjuster/__init__.py
|
delara38/NHLArenaAdjuster
|
ed823c61c1004ccae077d5913705e235708f7a17
|
[
"MIT"
] | null | null | null |
from CoordinateAdjuster import CoordinateAdjuster
from Venue import Venue
| 18.75
| 49
| 0.88
| 8
| 75
| 8.25
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.12
| 75
| 3
| 50
| 25
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
06a8086a98fd831a0b92463b569729c8f0cddb24
| 102
|
py
|
Python
|
Robot101/0400_XML_RPC/xRpcFaker.py
|
Python3-Training/Robot-Framework
|
788b250029c822c2fdce768e110660b12e2b8b36
|
[
"MIT"
] | null | null | null |
Robot101/0400_XML_RPC/xRpcFaker.py
|
Python3-Training/Robot-Framework
|
788b250029c822c2fdce768e110660b12e2b8b36
|
[
"MIT"
] | null | null | null |
Robot101/0400_XML_RPC/xRpcFaker.py
|
Python3-Training/Robot-Framework
|
788b250029c822c2fdce768e110660b12e2b8b36
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
# File: xRpcFaker.py
def SayHello(token):
return f"Hello {token}!"
| 14.571429
| 29
| 0.627451
| 14
| 102
| 4.571429
| 0.928571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.0125
| 0.215686
| 102
| 6
| 30
| 17
| 0.7875
| 0.392157
| 0
| 0
| 0
| 0
| 0.264151
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0
| 0.5
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
ebec4739f31346abf0fbfb388e9089eb8ee606db
| 117
|
py
|
Python
|
modules/sleep24h.py
|
ElijahBeach/C2-Server-Project
|
89e6d418790493aa222cca5b6ea7f3f519e4e478
|
[
"MIT"
] | 3
|
2022-01-14T01:55:25.000Z
|
2022-03-30T01:08:16.000Z
|
modules/sleep24h.py
|
ElijahBeach/C2-Server-Project
|
89e6d418790493aa222cca5b6ea7f3f519e4e478
|
[
"MIT"
] | null | null | null |
modules/sleep24h.py
|
ElijahBeach/C2-Server-Project
|
89e6d418790493aa222cca5b6ea7f3f519e4e478
|
[
"MIT"
] | 2
|
2022-01-15T14:30:55.000Z
|
2022-01-15T16:04:15.000Z
|
import time
import random
def run(**args):
print('[!] Sleep for a day')
time.sleep(random.randint(86000,86800))
| 16.714286
| 41
| 0.692308
| 18
| 117
| 4.5
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.1
| 0.145299
| 117
| 6
| 42
| 19.5
| 0.71
| 0
| 0
| 0
| 0
| 0
| 0.162393
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| true
| 0
| 0.4
| 0
| 0.6
| 0.2
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
231ca053abaab7cac982bdbfaf3e436d30c9ed7f
| 81
|
py
|
Python
|
decomon/backward_layers/__init__.py
|
airbus/decomon
|
f3668fbd8edd0def4e23aa0634eebfec58349c35
|
[
"MIT"
] | 11
|
2021-11-03T12:09:50.000Z
|
2022-02-20T21:42:13.000Z
|
decomon/backward_layers/__init__.py
|
airbus/decomon
|
f3668fbd8edd0def4e23aa0634eebfec58349c35
|
[
"MIT"
] | 1
|
2022-02-18T13:40:46.000Z
|
2022-02-18T13:40:46.000Z
|
decomon/backward_layers/__init__.py
|
airbus/decomon
|
f3668fbd8edd0def4e23aa0634eebfec58349c35
|
[
"MIT"
] | null | null | null |
from __future__ import absolute_import
from .backward_layers import get_backward
| 27
| 41
| 0.888889
| 11
| 81
| 5.909091
| 0.636364
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.098765
| 81
| 2
| 42
| 40.5
| 0.890411
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
2372d4f3a61fa6fc827dcbf21da9c854bb7b92ac
| 507
|
py
|
Python
|
utils/test_images_generator/generator_utils.py
|
pgolab/mosaic-maker-opencv-python
|
348597747dba7133abe3836d79cf062be6d34646
|
[
"MIT"
] | 2
|
2021-03-23T16:14:03.000Z
|
2021-04-03T19:21:26.000Z
|
utils/test_images_generator/generator_utils.py
|
pgolab/mosaic-maker-opencv-python
|
348597747dba7133abe3836d79cf062be6d34646
|
[
"MIT"
] | null | null | null |
utils/test_images_generator/generator_utils.py
|
pgolab/mosaic-maker-opencv-python
|
348597747dba7133abe3836d79cf062be6d34646
|
[
"MIT"
] | 4
|
2018-04-10T12:30:51.000Z
|
2021-04-13T12:48:43.000Z
|
import numpy as np
from utils.test_images_generator.generator_config import AVAILABLE_COLORS_DICT
def generate_random_color():
# ToDo choose random color from AVAILABLE_COLORS_DICT
# https://numpy.org/doc/1.18/reference/random/generated/numpy.random.choice.html
return (0, 0, 0)
def generate_random_image_points(image, count):
widths = np.random.randint(0, image.shape[1], size=count)
heights = np.random.randint(0, image.shape[0], size=count)
return list(zip(widths, heights))
| 31.6875
| 84
| 0.755424
| 76
| 507
| 4.881579
| 0.526316
| 0.080863
| 0.102426
| 0.086253
| 0.140162
| 0.140162
| 0
| 0
| 0
| 0
| 0
| 0.022779
| 0.134122
| 507
| 15
| 85
| 33.8
| 0.822323
| 0.25641
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0.066667
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0.125
| 0.75
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
88c7be3de844c4dbb73f16b6395507f2599cd6c9
| 183
|
py
|
Python
|
rules_default/castervoice/lib/control.py
|
MLH-Fellowship/LarynxCode
|
840fee18c689a357052825607c27fc8e3e56571c
|
[
"MIT"
] | 1
|
2021-09-17T06:11:02.000Z
|
2021-09-17T06:11:02.000Z
|
rules_default/castervoice/lib/control.py
|
soma2000-lang/LarynxCode
|
840fee18c689a357052825607c27fc8e3e56571c
|
[
"MIT"
] | 5
|
2021-02-03T05:29:41.000Z
|
2021-02-08T01:14:11.000Z
|
rules_default/castervoice/lib/control.py
|
soma2000-lang/LarynxCode
|
840fee18c689a357052825607c27fc8e3e56571c
|
[
"MIT"
] | 4
|
2021-02-03T05:05:00.000Z
|
2021-07-14T06:21:10.000Z
|
_NEXUS = None
def init_nexus(content_loader):
global _NEXUS
from castervoice.lib.ctrl.nexus import Nexus
_NEXUS = Nexus(content_loader)
def nexus():
return _NEXUS
| 15.25
| 48
| 0.721311
| 24
| 183
| 5.208333
| 0.541667
| 0.192
| 0.288
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.20765
| 183
| 11
| 49
| 16.636364
| 0.862069
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0.142857
| 0.142857
| 0.571429
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
88d18a55f52233bd60f29d6bd3acd4c9453c69dd
| 367
|
py
|
Python
|
querido_diario_toolbox/etl/text_extractor.py
|
campagnucci/querido-diario-toolbox
|
3ec99564ae92f1b5456f351f34e7745b4385c79e
|
[
"MIT"
] | 20
|
2020-10-30T19:52:12.000Z
|
2021-11-12T12:51:58.000Z
|
querido_diario_toolbox/etl/text_extractor.py
|
campagnucci/querido-diario-toolbox
|
3ec99564ae92f1b5456f351f34e7745b4385c79e
|
[
"MIT"
] | 26
|
2020-10-30T19:58:44.000Z
|
2022-03-31T01:41:55.000Z
|
querido_diario_toolbox/etl/text_extractor.py
|
campagnucci/querido-diario-toolbox
|
3ec99564ae92f1b5456f351f34e7745b4385c79e
|
[
"MIT"
] | 9
|
2020-10-30T20:15:33.000Z
|
2022-02-18T16:44:15.000Z
|
from querido_diario_toolbox.etl.apache_tika_text_extractor import ApacheTikaExtractor
from querido_diario_toolbox.etl.text_extractor_interface import TextExtractor
def create_text_extractor(config) -> TextExtractor:
"""
Instantiates a text extractor object based on the given configuration.
"""
return ApacheTikaExtractor(config["apache_tika_jar"])
| 36.7
| 85
| 0.820163
| 43
| 367
| 6.697674
| 0.604651
| 0.180556
| 0.118056
| 0.166667
| 0.1875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.119891
| 367
| 9
| 86
| 40.777778
| 0.891641
| 0.190736
| 0
| 0
| 0
| 0
| 0.053381
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.5
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
88ea594db33a7ccd66b5bcf0dd79f26ef76e4bb8
| 118
|
py
|
Python
|
examples/daw/drivers/drivers.py
|
Breq16/vibrance_ctrl
|
93247f686b4e5e42d5f36b9d592fe9cd8322069e
|
[
"MIT"
] | null | null | null |
examples/daw/drivers/drivers.py
|
Breq16/vibrance_ctrl
|
93247f686b4e5e42d5f36b9d592fe9cd8322069e
|
[
"MIT"
] | null | null | null |
examples/daw/drivers/drivers.py
|
Breq16/vibrance_ctrl
|
93247f686b4e5e42d5f36b9d592fe9cd8322069e
|
[
"MIT"
] | null | null | null |
import vibrance.driver.midi
drivers = []
drivers.append(vibrance.driver.midi.MidiDriver("Ableton MIDI", "vibrance"))
| 23.6
| 75
| 0.771186
| 14
| 118
| 6.5
| 0.571429
| 0.307692
| 0.395604
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.076271
| 118
| 4
| 76
| 29.5
| 0.834862
| 0
| 0
| 0
| 0
| 0
| 0.169492
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
88efe8574b9f901784ecc69d847136ea787dbca0
| 70
|
py
|
Python
|
_main_decision/_plotting/__init__.py
|
oxquantum/CVAE
|
0352ddc51fbfd8d57b155e6de66b4c34e010beac
|
[
"MIT"
] | null | null | null |
_main_decision/_plotting/__init__.py
|
oxquantum/CVAE
|
0352ddc51fbfd8d57b155e6de66b4c34e010beac
|
[
"MIT"
] | null | null | null |
_main_decision/_plotting/__init__.py
|
oxquantum/CVAE
|
0352ddc51fbfd8d57b155e6de66b4c34e010beac
|
[
"MIT"
] | null | null | null |
from .plotting import plot_100_recon, plot_with_mask, plot_every_step
| 35
| 69
| 0.871429
| 12
| 70
| 4.583333
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.046875
| 0.085714
| 70
| 1
| 70
| 70
| 0.8125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
00112fe329813106776d055f56a9afea56e9b449
| 292
|
py
|
Python
|
python/test/__init__.py
|
mtreinish/tweedledum
|
f9c3b9edcb0958c49a341a4d59eceef09faa3fea
|
[
"MIT"
] | null | null | null |
python/test/__init__.py
|
mtreinish/tweedledum
|
f9c3b9edcb0958c49a341a4d59eceef09faa3fea
|
[
"MIT"
] | null | null | null |
python/test/__init__.py
|
mtreinish/tweedledum
|
f9c3b9edcb0958c49a341a4d59eceef09faa3fea
|
[
"MIT"
] | null | null | null |
#-------------------------------------------------------------------------------
# Part of tweedledum. This file is distributed under the MIT License.
# See accompanying file /LICENSE for details.
#-------------------------------------------------------------------------------
"""Tests."""
| 48.666667
| 80
| 0.328767
| 18
| 292
| 5.333333
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.078767
| 292
| 5
| 81
| 58.4
| 0.356877
| 0.952055
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
00439fdc8b5de68a86add3b67056f48239d9e0c5
| 12
|
py
|
Python
|
hello.py
|
kzlknight/test001
|
ce47b390540c7ca0e85825a638e8cbeb68c69057
|
[
"MIT"
] | null | null | null |
hello.py
|
kzlknight/test001
|
ce47b390540c7ca0e85825a638e8cbeb68c69057
|
[
"MIT"
] | 5
|
2020-09-26T00:47:08.000Z
|
2022-02-10T00:41:35.000Z
|
src/test.py
|
khi265/SynchronizeFacialExpressionPython
|
7e77ee6fe97145e72cfc2153c78a8d7da2f1d1b8
|
[
"MIT"
] | null | null | null |
print('aaa')
| 12
| 12
| 0.666667
| 2
| 12
| 4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 12
| 1
| 12
| 12
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0.230769
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
cc4e23fbb0adb7f99525103d8a0870d59e9f8b83
| 197
|
py
|
Python
|
test_template.py
|
qbicsoftware/template_qbicportlet
|
9efc7443c8dcef8c86e2c2c741825de69ccea06f
|
[
"MIT"
] | 1
|
2017-05-24T18:49:09.000Z
|
2017-05-24T18:49:09.000Z
|
test_template.py
|
qbicsoftware/template_qbicportlet
|
9efc7443c8dcef8c86e2c2c741825de69ccea06f
|
[
"MIT"
] | 22
|
2017-05-23T13:26:08.000Z
|
2018-04-25T17:30:12.000Z
|
test_template.py
|
qbicsoftware/template_qbicportlet
|
9efc7443c8dcef8c86e2c2c741825de69ccea06f
|
[
"MIT"
] | 1
|
2017-09-07T16:03:42.000Z
|
2017-09-07T16:03:42.000Z
|
import os
FOLDER_NAME = 'template-test'
def test_portlet_folder_was_created():
assert(os.path.exists(FOLDER_NAME))
def test_portlet_folder_is_folder():
assert(os.path.isdir(FOLDER_NAME))
| 21.888889
| 39
| 0.781726
| 30
| 197
| 4.766667
| 0.5
| 0.20979
| 0.195804
| 0.27972
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.106599
| 197
| 9
| 40
| 21.888889
| 0.8125
| 0
| 0
| 0
| 0
| 0
| 0.065657
| 0
| 0
| 0
| 0
| 0
| 0.333333
| 1
| 0.333333
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
cc8bcd9597344d45aa75e0b945912ab0d9740b3a
| 9,234
|
py
|
Python
|
qcodes_contrib_drivers/tests/QDevil/test_sim_qdac2_sine.py
|
janekfleper/Qcodes_contrib_drivers
|
d8eab2c9c90da272d3f0cdcb3ed0bcc08052f342
|
[
"MIT"
] | null | null | null |
qcodes_contrib_drivers/tests/QDevil/test_sim_qdac2_sine.py
|
janekfleper/Qcodes_contrib_drivers
|
d8eab2c9c90da272d3f0cdcb3ed0bcc08052f342
|
[
"MIT"
] | null | null | null |
qcodes_contrib_drivers/tests/QDevil/test_sim_qdac2_sine.py
|
janekfleper/Qcodes_contrib_drivers
|
d8eab2c9c90da272d3f0cdcb3ed0bcc08052f342
|
[
"MIT"
] | null | null | null |
import pytest
from .sim_qdac2_fixtures import qdac # noqa
from qcodes_contrib_drivers.drivers.QDevil.QDAC2 import ExternalInput
def test_sine_ambiguous(qdac): # noqa
# -----------------------------------------------------------------------
with pytest.raises(ValueError) as error:
qdac.ch01.sine_wave(period_s=1, frequency_Hz=10)
# -----------------------------------------------------------------------
assert 'frequency_Hz or period_s can be specified' in repr(error)
def test_sine_default_vaules(qdac): # noqa
# -----------------------------------------------------------------------
qdac.ch01.sine_wave()
# -----------------------------------------------------------------------
assert qdac.get_recorded_scpi_commands() == [
'sour1:sin:trig:sour hold',
'sour1:sin:freq 1000',
'sour1:sin:pol norm',
'sour1:sin:span 0.2',
'sour1:sin:offs 0.0',
'sour1:sin:slew inf',
'sour1:sin:coun -1',
'sour1:sin:trig:sour bus',
'sour1:sin:init:cont on',
'sour1:sin:init',
]
def test_sine_period(qdac): # noqa
# -----------------------------------------------------------------------
qdac.ch01.sine_wave(
period_s=11,
inverted=True,
span_V=1,
offset_V=-0.1,
slew_V_s=1,
repetitions=10
)
# -----------------------------------------------------------------------
assert qdac.get_recorded_scpi_commands() == [
'sour1:sin:trig:sour hold',
'sour1:sin:per 11',
'sour1:sin:pol inv',
'sour1:sin:span 1',
'sour1:sin:offs -0.1',
'sour1:sin:slew 1',
'sour1:sin:coun 10',
'sour1:sin:trig:sour bus',
'sour1:sin:init:cont on',
'sour1:sin:init',
]
def test_sine_frequency(qdac): # noqa
# -----------------------------------------------------------------------
qdac.ch01.sine_wave(frequency_Hz=1e5)
# -----------------------------------------------------------------------
assert qdac.get_recorded_scpi_commands() == [
'sour1:sin:trig:sour hold',
'sour1:sin:freq 100000.0',
'sour1:sin:pol norm',
'sour1:sin:span 0.2',
'sour1:sin:offs 0.0',
'sour1:sin:slew inf',
'sour1:sin:coun -1',
'sour1:sin:trig:sour bus',
'sour1:sin:init:cont on',
'sour1:sin:init',
]
def test_sine_start_without_explicit_trigger(qdac): # noqa
sine = qdac.ch24.sine_wave()
qdac.start_recording_scpi()
# -----------------------------------------------------------------------
sine.start()
# -----------------------------------------------------------------------
assert qdac.get_recorded_scpi_commands() == [
'sour24:sin:init:cont off',
'sour24:sin:trig:sour imm',
'sour24:sin:init'
]
def test_sine_abort(qdac): # noqa
sine = qdac.ch01.sine_wave()
qdac.start_recording_scpi()
# -----------------------------------------------------------------------
sine.abort()
# -----------------------------------------------------------------------
assert qdac.get_recorded_scpi_commands() == ['sour1:sin:abor']
def test_sine_remaining(qdac): # noqa
sine = qdac.ch01.sine_wave(repetitions=10)
qdac.start_recording_scpi()
# -----------------------------------------------------------------------
sine.cycles_remaining()
# -----------------------------------------------------------------------
# Cannot sim test: assert remaining == 1
assert qdac.get_recorded_scpi_commands() == ['sour1:sin:ncl?']
def test_sine_end_marker_alloc(qdac): # noqa
qdac._set_up_internal_triggers()
sine = qdac.ch01.sine_wave(frequency_Hz=1000)
qdac.start_recording_scpi()
# -----------------------------------------------------------------------
trigger = sine.end_marker()
# -----------------------------------------------------------------------
assert qdac.get_recorded_scpi_commands() == [
f'sour1:sin:mark:end {trigger.value}'
]
def test_sine_end_marker_reuse(qdac): # noqa
qdac._set_up_internal_triggers()
sine = qdac.ch01.sine_wave(frequency_Hz=1000)
trigger = sine.end_marker()
qdac.start_recording_scpi()
# -----------------------------------------------------------------------
trigger2 = sine.end_marker()
# -----------------------------------------------------------------------
assert trigger2 == trigger
assert qdac.get_recorded_scpi_commands() == [
f'sour1:sin:mark:end {trigger.value}'
]
def test_sine_start_marker_alloc(qdac): # noqa
qdac._set_up_internal_triggers()
sine = qdac.ch01.sine_wave(frequency_Hz=1000)
qdac.start_recording_scpi()
# -----------------------------------------------------------------------
trigger = sine.start_marker()
# -----------------------------------------------------------------------
assert qdac.get_recorded_scpi_commands() == [
f'sour1:sin:mark:star {trigger.value}'
]
def test_sine_start_marker_reuse(qdac): # noqa
qdac._set_up_internal_triggers()
sine = qdac.ch01.sine_wave(frequency_Hz=1000)
trigger = sine.start_marker()
qdac.start_recording_scpi()
# -----------------------------------------------------------------------
trigger2 = sine.start_marker()
# -----------------------------------------------------------------------
assert trigger2 == trigger
assert qdac.get_recorded_scpi_commands() == [
f'sour1:sin:mark:star {trigger.value}'
]
def test_sine_start_trigger_fires(qdac): # noqa
qdac._set_up_internal_triggers()
sine = qdac.ch01.sine_wave(frequency_Hz=1000)
trigger = qdac.allocate_trigger()
sine.start_on(trigger)
qdac.start_recording_scpi()
# -----------------------------------------------------------------------
sine.start()
# -----------------------------------------------------------------------
assert qdac.get_recorded_scpi_commands() == [
'sour1:sin:init:cont on',
'sour1:sin:init',
f'tint {trigger.value}'
]
def test_sine_period_end_trigger_alloc(qdac): # noqa
qdac._set_up_internal_triggers()
sine = qdac.ch01.sine_wave(frequency_Hz=1000)
qdac.start_recording_scpi()
# -----------------------------------------------------------------------
trigger = sine.period_end_marker()
# -----------------------------------------------------------------------
assert qdac.get_recorded_scpi_commands() == [
f'sour1:sin:mark:pend {trigger.value}'
]
def test_sine_period_end_trigger_reuse(qdac): # noqa
qdac._set_up_internal_triggers()
sine = qdac.ch01.sine_wave(frequency_Hz=1000)
trigger = sine.period_end_marker()
qdac.start_recording_scpi()
# -----------------------------------------------------------------------
trigger2 = sine.period_end_marker()
# -----------------------------------------------------------------------
assert trigger2 == trigger
assert qdac.get_recorded_scpi_commands() == [
f'sour1:sin:mark:pend {trigger.value}'
]
def test_sine_period_start_trigger_alloc(qdac): # noqa
qdac._set_up_internal_triggers()
sine = qdac.ch01.sine_wave(frequency_Hz=1000)
qdac.start_recording_scpi()
# -----------------------------------------------------------------------
trigger = sine.period_start_marker()
# -----------------------------------------------------------------------
assert qdac.get_recorded_scpi_commands() == [
f'sour1:sin:mark:psta {trigger.value}'
]
def test_sine_period_start_trigger_reuse(qdac): # noqa
qdac._set_up_internal_triggers()
sine = qdac.ch01.sine_wave(frequency_Hz=1000)
trigger = sine.period_start_marker()
qdac.start_recording_scpi()
# -----------------------------------------------------------------------
trigger2 = sine.period_start_marker()
# -----------------------------------------------------------------------
assert trigger2 == trigger
assert qdac.get_recorded_scpi_commands() == [
f'sour1:sin:mark:psta {trigger.value}'
]
def test_sine_trigger_on_internal(qdac): # noqa
sine = qdac.ch01.sine_wave(frequency_Hz=1000)
trigger = qdac.allocate_trigger()
qdac.start_recording_scpi()
# -----------------------------------------------------------------------
sine.start_on(trigger)
# -----------------------------------------------------------------------
assert qdac.get_recorded_scpi_commands() == [
f'sour1:sin:trig:sour int{trigger.value}',
f'sour1:sin:init:cont on',
'sour1:sin:init'
]
def test_sine_trigger_on_external(qdac): # noqa
sine = qdac.ch01.sine_wave(frequency_Hz=1000)
trigger = ExternalInput(1)
qdac.start_recording_scpi()
# -----------------------------------------------------------------------
sine.start_on_external(trigger)
# -----------------------------------------------------------------------
assert qdac.get_recorded_scpi_commands() == [
f'sour1:sin:trig:sour ext{trigger}',
f'sour1:sin:init:cont on',
'sour1:sin:init'
]
| 36.498024
| 77
| 0.464696
| 882
| 9,234
| 4.582766
| 0.123583
| 0.095002
| 0.048986
| 0.067293
| 0.830282
| 0.810737
| 0.782781
| 0.741217
| 0.654379
| 0.646462
| 0
| 0.024762
| 0.169049
| 9,234
| 252
| 78
| 36.642857
| 0.50202
| 0.295105
| 0
| 0.575419
| 0
| 0
| 0.182579
| 0
| 0
| 0
| 0
| 0
| 0.122905
| 1
| 0.100559
| false
| 0
| 0.01676
| 0
| 0.117318
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
aef24633ee8ee9b2a64203f7a8f9bd17e909a9b8
| 69
|
py
|
Python
|
python/testData/copyPaste/WholeIndentedLineSelectedWithIndentAndReplacedWithWord.dst.py
|
jnthn/intellij-community
|
8fa7c8a3ace62400c838e0d5926a7be106aa8557
|
[
"Apache-2.0"
] | 2
|
2019-04-28T07:48:50.000Z
|
2020-12-11T14:18:08.000Z
|
python/testData/copyPaste/WholeIndentedLineSelectedWithIndentAndReplacedWithWord.dst.py
|
jnthn/intellij-community
|
8fa7c8a3ace62400c838e0d5926a7be106aa8557
|
[
"Apache-2.0"
] | 173
|
2018-07-05T13:59:39.000Z
|
2018-08-09T01:12:03.000Z
|
python/testData/copyPaste/WholeIndentedLineSelectedWithIndentAndReplacedWithWord.dst.py
|
jnthn/intellij-community
|
8fa7c8a3ace62400c838e0d5926a7be106aa8557
|
[
"Apache-2.0"
] | 2
|
2020-03-15T08:57:37.000Z
|
2020-04-07T04:48:14.000Z
|
if True:
if True:
pass
<selection> foo = 2</selection>
| 17.25
| 34
| 0.550725
| 9
| 69
| 4.222222
| 0.666667
| 0.315789
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.021739
| 0.333333
| 69
| 4
| 34
| 17.25
| 0.804348
| 0
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0.25
| 0
| null | null | 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
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
aefabb37aeabcb8bf0dce5f86c7170c8f2b98734
| 41
|
py
|
Python
|
run.py
|
MePsyDuck/amfr
|
691d9270dece8846a5bbb64ba4f2bdea95ee05e5
|
[
"MIT"
] | null | null | null |
run.py
|
MePsyDuck/amfr
|
691d9270dece8846a5bbb64ba4f2bdea95ee05e5
|
[
"MIT"
] | null | null | null |
run.py
|
MePsyDuck/amfr
|
691d9270dece8846a5bbb64ba4f2bdea95ee05e5
|
[
"MIT"
] | null | null | null |
from app_ui import root
root.mainloop()
| 10.25
| 23
| 0.780488
| 7
| 41
| 4.428571
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.146341
| 41
| 3
| 24
| 13.666667
| 0.885714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
aeff7c07fce8051f7098ca15947beb1edd8a6f1f
| 36
|
py
|
Python
|
laticore/task/__init__.py
|
danehrlich1/laticore
|
71567f4a188211638fdacdd8ea0acefd9c212c88
|
[
"Apache-2.0"
] | null | null | null |
laticore/task/__init__.py
|
danehrlich1/laticore
|
71567f4a188211638fdacdd8ea0acefd9c212c88
|
[
"Apache-2.0"
] | 1
|
2022-02-10T03:47:51.000Z
|
2022-02-10T03:47:51.000Z
|
laticore/task/__init__.py
|
danehrlich1/laticore
|
71567f4a188211638fdacdd8ea0acefd9c212c88
|
[
"Apache-2.0"
] | null | null | null |
from laticore.task.task import Task
| 18
| 35
| 0.833333
| 6
| 36
| 5
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111111
| 36
| 1
| 36
| 36
| 0.9375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
4e24782ef1e17435f2e92ca4647db801e44ab80c
| 194
|
py
|
Python
|
ddf_utils/factory/__init__.py
|
semio/ddf_utils
|
e10c4cb6dc7722415a5863579a552cc7b7e3668d
|
[
"MIT"
] | 2
|
2016-11-23T12:28:15.000Z
|
2019-03-04T16:06:25.000Z
|
ddf_utils/factory/__init__.py
|
semio/ddf_utils
|
e10c4cb6dc7722415a5863579a552cc7b7e3668d
|
[
"MIT"
] | 124
|
2016-07-14T13:39:41.000Z
|
2021-12-24T01:45:23.000Z
|
ddf_utils/factory/__init__.py
|
semio/ddf_utils
|
e10c4cb6dc7722415a5863579a552cc7b7e3668d
|
[
"MIT"
] | 1
|
2016-11-30T23:42:56.000Z
|
2016-11-30T23:42:56.000Z
|
# -*- coding: utf-8 -*-
from . clio_infra import ClioInfraLoader
from . ihme import IHMELoader
from . ilo import ILOLoader
from . oecd import OECDLoader
from . worldbank import WorldBankLoader
| 24.25
| 40
| 0.768041
| 24
| 194
| 6.166667
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006135
| 0.159794
| 194
| 7
| 41
| 27.714286
| 0.90184
| 0.108247
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
9d750a09225872db892fb359be4bf2b53c7b8dfd
| 19,041
|
py
|
Python
|
Graded/G2/tests/test_eskf.py
|
chrstrom/TTK4250
|
f453c3a59597d3fe6cff7d35b790689919798b94
|
[
"Unlicense"
] | null | null | null |
Graded/G2/tests/test_eskf.py
|
chrstrom/TTK4250
|
f453c3a59597d3fe6cff7d35b790689919798b94
|
[
"Unlicense"
] | null | null | null |
Graded/G2/tests/test_eskf.py
|
chrstrom/TTK4250
|
f453c3a59597d3fe6cff7d35b790689919798b94
|
[
"Unlicense"
] | null | null | null |
import pickle
from numpy.core.numeric import isscalar
import pytest
from copy import deepcopy
import sys
from pathlib import Path
import numpy as np
import os
from dataclasses import is_dataclass, astuple
from collections.abc import Iterable
assignment_name = "eskf"
this_file = Path(__file__)
tests_folder = this_file.parent
test_data_file = tests_folder.joinpath("test_data.pickle")
project_folder = tests_folder.parent
code_folder = project_folder.joinpath(assignment_name)
sys.path.insert(0, str(code_folder))
import solution # nopep8
import cross_matrix, eskf, nis_nees, quaternion # nopep8
@pytest.fixture
def test_data():
with open(test_data_file, "rb") as file:
test_data = pickle.load(file)
return test_data
def compare(a, b):
if isinstance(b, np.ndarray) or np.isscalar(b):
return np.allclose(a, b, atol=1e-6)
elif is_dataclass(b):
if type(a).__name__ != type(b).__name__:
return False
a_tup, b_tup = astuple(a), astuple(b)
return all([compare(i, j) for i, j in zip(a_tup, b_tup)])
elif isinstance(b, Iterable):
return all([compare(i, j) for i, j in zip(a, b)])
else:
return a == b
class Test_ESKF_correct_z_imu:
def test_output(self, test_data):
"""Tests if the function is correct by comparing the output
with the output of the solution
As python always use pass by reference, not by copy, it also checks if the
input is changed (or not) in the same way as the in solution
"""
for finput in test_data["eskf.ESKF.correct_z_imu"]:
params = tuple(finput.values())
self_1, x_nom_prev_1, z_imu_1 = deepcopy(params)
self_2, x_nom_prev_2, z_imu_2 = deepcopy(params)
z_corr_1 = eskf.ESKF.correct_z_imu(self_1, x_nom_prev_1, z_imu_1)
z_corr_2 = solution.eskf.ESKF.correct_z_imu(self_2, x_nom_prev_2, z_imu_2)
assert compare(z_corr_1, z_corr_2)
assert compare(self_1, self_2)
assert compare(x_nom_prev_1, x_nom_prev_2)
assert compare(z_imu_1, z_imu_2)
def test_solution_usage(self, test_data):
"""Tests if the solution is used in the function"""
for finput in test_data["eskf.ESKF.correct_z_imu"][:1]:
params = finput
solution.used["eskf.ESKF.correct_z_imu"] = False
eskf.ESKF.correct_z_imu(**params)
assert not solution.used["eskf.ESKF.correct_z_imu"], "The function uses the solution"
class Test_ESKF_predict_nominal:
def test_output(self, test_data):
"""Tests if the function is correct by comparing the output
with the output of the solution
As python always use pass by reference, not by copy, it also checks if the
input is changed (or not) in the same way as the in solution
"""
for finput in test_data["eskf.ESKF.predict_nominal"]:
params = tuple(finput.values())
self_1, x_nom_prev_1, z_corr_1 = deepcopy(params)
self_2, x_nom_prev_2, z_corr_2 = deepcopy(params)
x_nom_pred_1 = eskf.ESKF.predict_nominal(self_1, x_nom_prev_1, z_corr_1)
x_nom_pred_2 = solution.eskf.ESKF.predict_nominal(self_2, x_nom_prev_2, z_corr_2)
assert compare(x_nom_pred_1, x_nom_pred_2)
assert compare(self_1, self_2)
assert compare(x_nom_prev_1, x_nom_prev_2)
assert compare(z_corr_1, z_corr_2)
def test_solution_usage(self, test_data):
"""Tests if the solution is used in the function"""
for finput in test_data["eskf.ESKF.predict_nominal"][:1]:
params = finput
solution.used["eskf.ESKF.predict_nominal"] = False
eskf.ESKF.predict_nominal(**params)
assert not solution.used["eskf.ESKF.predict_nominal"], "The function uses the solution"
class Test_ESKF_get_error_A_continous:
def test_output(self, test_data):
"""Tests if the function is correct by comparing the output
with the output of the solution
As python always use pass by reference, not by copy, it also checks if the
input is changed (or not) in the same way as the in solution
"""
for finput in test_data["eskf.ESKF.get_error_A_continous"]:
params = tuple(finput.values())
self_1, x_nom_prev_1, z_corr_1 = deepcopy(params)
self_2, x_nom_prev_2, z_corr_2 = deepcopy(params)
A_1 = eskf.ESKF.get_error_A_continous(self_1, x_nom_prev_1, z_corr_1)
A_2 = solution.eskf.ESKF.get_error_A_continous(self_2, x_nom_prev_2, z_corr_2)
assert compare(A_1, A_2)
assert compare(self_1, self_2)
assert compare(x_nom_prev_1, x_nom_prev_2)
assert compare(z_corr_1, z_corr_2)
def test_solution_usage(self, test_data):
"""Tests if the solution is used in the function"""
for finput in test_data["eskf.ESKF.get_error_A_continous"][:1]:
params = finput
solution.used["eskf.ESKF.get_error_A_continous"] = False
eskf.ESKF.get_error_A_continous(**params)
assert not solution.used["eskf.ESKF.get_error_A_continous"], "The function uses the solution"
class Test_ESKF_get_error_GQGT_continous:
def test_output(self, test_data):
"""Tests if the function is correct by comparing the output
with the output of the solution
As python always use pass by reference, not by copy, it also checks if the
input is changed (or not) in the same way as the in solution
"""
for finput in test_data["eskf.ESKF.get_error_GQGT_continous"]:
params = tuple(finput.values())
self_1, x_nom_prev_1 = deepcopy(params)
self_2, x_nom_prev_2 = deepcopy(params)
GQGT_1 = eskf.ESKF.get_error_GQGT_continous(self_1, x_nom_prev_1)
GQGT_2 = solution.eskf.ESKF.get_error_GQGT_continous(self_2, x_nom_prev_2)
assert compare(GQGT_1, GQGT_2)
assert compare(self_1, self_2)
assert compare(x_nom_prev_1, x_nom_prev_2)
def test_solution_usage(self, test_data):
"""Tests if the solution is used in the function"""
for finput in test_data["eskf.ESKF.get_error_GQGT_continous"][:1]:
params = finput
solution.used["eskf.ESKF.get_error_GQGT_continous"] = False
eskf.ESKF.get_error_GQGT_continous(**params)
assert not solution.used["eskf.ESKF.get_error_GQGT_continous"], "The function uses the solution"
class Test_ESKF_get_discrete_error_diff:
def test_output(self, test_data):
"""Tests if the function is correct by comparing the output
with the output of the solution
As python always use pass by reference, not by copy, it also checks if the
input is changed (or not) in the same way as the in solution
"""
for finput in test_data["eskf.ESKF.get_discrete_error_diff"]:
params = tuple(finput.values())
self_1, x_nom_prev_1, z_corr_1 = deepcopy(params)
self_2, x_nom_prev_2, z_corr_2 = deepcopy(params)
Ad_1, GQGTd_1 = eskf.ESKF.get_discrete_error_diff(self_1, x_nom_prev_1, z_corr_1)
Ad_2, GQGTd_2 = solution.eskf.ESKF.get_discrete_error_diff(self_2, x_nom_prev_2, z_corr_2)
assert compare(Ad_1, Ad_2)
assert compare(GQGTd_1, GQGTd_2)
assert compare(self_1, self_2)
assert compare(x_nom_prev_1, x_nom_prev_2)
assert compare(z_corr_1, z_corr_2)
def test_solution_usage(self, test_data):
"""Tests if the solution is used in the function"""
for finput in test_data["eskf.ESKF.get_discrete_error_diff"][:1]:
params = finput
solution.used["eskf.ESKF.get_discrete_error_diff"] = False
eskf.ESKF.get_discrete_error_diff(**params)
assert not solution.used["eskf.ESKF.get_discrete_error_diff"], "The function uses the solution"
class Test_ESKF_predict_x_err:
def test_output(self, test_data):
"""Tests if the function is correct by comparing the output
with the output of the solution
As python always use pass by reference, not by copy, it also checks if the
input is changed (or not) in the same way as the in solution
"""
for finput in test_data["eskf.ESKF.predict_x_err"]:
params = tuple(finput.values())
self_1, x_nom_prev_1, x_err_prev_gauss_1, z_corr_1 = deepcopy(params)
self_2, x_nom_prev_2, x_err_prev_gauss_2, z_corr_2 = deepcopy(params)
x_err_pred_1 = eskf.ESKF.predict_x_err(self_1, x_nom_prev_1, x_err_prev_gauss_1, z_corr_1)
x_err_pred_2 = solution.eskf.ESKF.predict_x_err(self_2, x_nom_prev_2, x_err_prev_gauss_2, z_corr_2)
assert compare(x_err_pred_1, x_err_pred_2)
assert compare(self_1, self_2)
assert compare(x_nom_prev_1, x_nom_prev_2)
assert compare(x_err_prev_gauss_1, x_err_prev_gauss_2)
assert compare(z_corr_1, z_corr_2)
def test_solution_usage(self, test_data):
"""Tests if the solution is used in the function"""
for finput in test_data["eskf.ESKF.predict_x_err"][:1]:
params = finput
solution.used["eskf.ESKF.predict_x_err"] = False
eskf.ESKF.predict_x_err(**params)
assert not solution.used["eskf.ESKF.predict_x_err"], "The function uses the solution"
class Test_ESKF_predict_from_imu:
def test_output(self, test_data):
"""Tests if the function is correct by comparing the output
with the output of the solution
As python always use pass by reference, not by copy, it also checks if the
input is changed (or not) in the same way as the in solution
"""
for finput in test_data["eskf.ESKF.predict_from_imu"]:
params = tuple(finput.values())
self_1, x_nom_prev_1, x_err_gauss_1, z_imu_1 = deepcopy(params)
self_2, x_nom_prev_2, x_err_gauss_2, z_imu_2 = deepcopy(params)
x_nom_pred_1, x_err_pred_1 = eskf.ESKF.predict_from_imu(self_1, x_nom_prev_1, x_err_gauss_1, z_imu_1)
x_nom_pred_2, x_err_pred_2 = solution.eskf.ESKF.predict_from_imu(self_2, x_nom_prev_2, x_err_gauss_2, z_imu_2)
assert compare(x_nom_pred_1, x_nom_pred_2)
assert compare(x_err_pred_1, x_err_pred_2)
assert compare(self_1, self_2)
assert compare(x_nom_prev_1, x_nom_prev_2)
assert compare(x_err_gauss_1, x_err_gauss_2)
assert compare(z_imu_1, z_imu_2)
def test_solution_usage(self, test_data):
"""Tests if the solution is used in the function"""
for finput in test_data["eskf.ESKF.predict_from_imu"][:1]:
params = finput
solution.used["eskf.ESKF.predict_from_imu"] = False
eskf.ESKF.predict_from_imu(**params)
assert not solution.used["eskf.ESKF.predict_from_imu"], "The function uses the solution"
class Test_ESKF_get_gnss_measurment_jac:
def test_output(self, test_data):
"""Tests if the function is correct by comparing the output
with the output of the solution
As python always use pass by reference, not by copy, it also checks if the
input is changed (or not) in the same way as the in solution
"""
for finput in test_data["eskf.ESKF.get_gnss_measurment_jac"]:
params = tuple(finput.values())
self_1, x_nom_1 = deepcopy(params)
self_2, x_nom_2 = deepcopy(params)
H_1 = eskf.ESKF.get_gnss_measurment_jac(self_1, x_nom_1)
H_2 = solution.eskf.ESKF.get_gnss_measurment_jac(self_2, x_nom_2)
assert compare(H_1, H_2)
assert compare(self_1, self_2)
assert compare(x_nom_1, x_nom_2)
def test_solution_usage(self, test_data):
"""Tests if the solution is used in the function"""
for finput in test_data["eskf.ESKF.get_gnss_measurment_jac"][:1]:
params = finput
solution.used["eskf.ESKF.get_gnss_measurment_jac"] = False
eskf.ESKF.get_gnss_measurment_jac(**params)
assert not solution.used["eskf.ESKF.get_gnss_measurment_jac"], "The function uses the solution"
class Test_ESKF_predict_gnss_measurement:
def test_output(self, test_data):
"""Tests if the function is correct by comparing the output
with the output of the solution
As python always use pass by reference, not by copy, it also checks if the
input is changed (or not) in the same way as the in solution
"""
for finput in test_data["eskf.ESKF.predict_gnss_measurement"]:
params = tuple(finput.values())
self_1, x_nom_1, x_err_1, z_gnss_1 = deepcopy(params)
self_2, x_nom_2, x_err_2, z_gnss_2 = deepcopy(params)
z_gnss_pred_gauss_1 = eskf.ESKF.predict_gnss_measurement(self_1, x_nom_1, x_err_1, z_gnss_1)
z_gnss_pred_gauss_2 = solution.eskf.ESKF.predict_gnss_measurement(self_2, x_nom_2, x_err_2, z_gnss_2)
assert compare(z_gnss_pred_gauss_1, z_gnss_pred_gauss_2)
assert compare(self_1, self_2)
assert compare(x_nom_1, x_nom_2)
assert compare(x_err_1, x_err_2)
assert compare(z_gnss_1, z_gnss_2)
def test_solution_usage(self, test_data):
"""Tests if the solution is used in the function"""
for finput in test_data["eskf.ESKF.predict_gnss_measurement"][:1]:
params = finput
solution.used["eskf.ESKF.predict_gnss_measurement"] = False
eskf.ESKF.predict_gnss_measurement(**params)
assert not solution.used["eskf.ESKF.predict_gnss_measurement"], "The function uses the solution"
class Test_ESKF_get_x_err_upd:
def test_output(self, test_data):
"""Tests if the function is correct by comparing the output
with the output of the solution
As python always use pass by reference, not by copy, it also checks if the
input is changed (or not) in the same way as the in solution
"""
for finput in test_data["eskf.ESKF.get_x_err_upd"]:
params = tuple(finput.values())
self_1, x_nom_1, x_err_1, z_gnss_pred_gauss_1, z_gnss_1 = deepcopy(params)
self_2, x_nom_2, x_err_2, z_gnss_pred_gauss_2, z_gnss_2 = deepcopy(params)
x_err_upd_gauss_1 = eskf.ESKF.get_x_err_upd(self_1, x_nom_1, x_err_1, z_gnss_pred_gauss_1, z_gnss_1)
x_err_upd_gauss_2 = solution.eskf.ESKF.get_x_err_upd(self_2, x_nom_2, x_err_2, z_gnss_pred_gauss_2, z_gnss_2)
assert compare(x_err_upd_gauss_1, x_err_upd_gauss_2)
assert compare(self_1, self_2)
assert compare(x_nom_1, x_nom_2)
assert compare(x_err_1, x_err_2)
assert compare(z_gnss_pred_gauss_1, z_gnss_pred_gauss_2)
assert compare(z_gnss_1, z_gnss_2)
def test_solution_usage(self, test_data):
"""Tests if the solution is used in the function"""
for finput in test_data["eskf.ESKF.get_x_err_upd"][:1]:
params = finput
solution.used["eskf.ESKF.get_x_err_upd"] = False
eskf.ESKF.get_x_err_upd(**params)
assert not solution.used["eskf.ESKF.get_x_err_upd"], "The function uses the solution"
class Test_ESKF_inject:
def test_output(self, test_data):
"""Tests if the function is correct by comparing the output
with the output of the solution
As python always use pass by reference, not by copy, it also checks if the
input is changed (or not) in the same way as the in solution
"""
for finput in test_data["eskf.ESKF.inject"]:
params = tuple(finput.values())
self_1, x_nom_prev_1, x_err_upd_1 = deepcopy(params)
self_2, x_nom_prev_2, x_err_upd_2 = deepcopy(params)
x_nom_inj_1, x_err_inj_1 = eskf.ESKF.inject(self_1, x_nom_prev_1, x_err_upd_1)
x_nom_inj_2, x_err_inj_2 = solution.eskf.ESKF.inject(self_2, x_nom_prev_2, x_err_upd_2)
assert compare(x_nom_inj_1, x_nom_inj_2)
assert compare(x_err_inj_1, x_err_inj_2)
assert compare(self_1, self_2)
assert compare(x_nom_prev_1, x_nom_prev_2)
assert compare(x_err_upd_1, x_err_upd_2)
def test_solution_usage(self, test_data):
"""Tests if the solution is used in the function"""
for finput in test_data["eskf.ESKF.inject"][:1]:
params = finput
solution.used["eskf.ESKF.inject"] = False
eskf.ESKF.inject(**params)
assert not solution.used["eskf.ESKF.inject"], "The function uses the solution"
class Test_ESKF_update_from_gnss:
def test_output(self, test_data):
"""Tests if the function is correct by comparing the output
with the output of the solution
As python always use pass by reference, not by copy, it also checks if the
input is changed (or not) in the same way as the in solution
"""
for finput in test_data["eskf.ESKF.update_from_gnss"]:
params = tuple(finput.values())
self_1, x_nom_prev_1, x_err_prev_1, z_gnss_1 = deepcopy(params)
self_2, x_nom_prev_2, x_err_prev_2, z_gnss_2 = deepcopy(params)
x_nom_inj_1, x_err_inj_1, z_gnss_pred_gauss_1 = eskf.ESKF.update_from_gnss(self_1, x_nom_prev_1, x_err_prev_1, z_gnss_1)
x_nom_inj_2, x_err_inj_2, z_gnss_pred_gauss_2 = solution.eskf.ESKF.update_from_gnss(self_2, x_nom_prev_2, x_err_prev_2, z_gnss_2)
assert compare(x_nom_inj_1, x_nom_inj_2)
assert compare(x_err_inj_1, x_err_inj_2)
assert compare(z_gnss_pred_gauss_1, z_gnss_pred_gauss_2)
assert compare(self_1, self_2)
assert compare(x_nom_prev_1, x_nom_prev_2)
assert compare(x_err_prev_1, x_err_prev_2)
assert compare(z_gnss_1, z_gnss_2)
def test_solution_usage(self, test_data):
"""Tests if the solution is used in the function"""
for finput in test_data["eskf.ESKF.update_from_gnss"][:1]:
params = finput
solution.used["eskf.ESKF.update_from_gnss"] = False
eskf.ESKF.update_from_gnss(**params)
assert not solution.used["eskf.ESKF.update_from_gnss"], "The function uses the solution"
if __name__ == "__main__":
os.environ["_PYTEST_RAISE"] = "1"
pytest.main()
| 37.630435
| 141
| 0.656531
| 3,013
| 19,041
| 3.803518
| 0.045802
| 0.030716
| 0.069634
| 0.021204
| 0.904101
| 0.882024
| 0.85
| 0.778621
| 0.69363
| 0.649389
| 0
| 0.023271
| 0.264272
| 19,041
| 505
| 142
| 37.704951
| 0.794775
| 0.172155
| 0
| 0.382576
| 0
| 0
| 0.112299
| 0.081601
| 0
| 0
| 0
| 0
| 0.261364
| 1
| 0.098485
| false
| 0
| 0.045455
| 0
| 0.212121
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
9ddfd98f29c83cea7348ff1488253dcfec84cd52
| 11,052
|
py
|
Python
|
tests/configuration/configuration/test_configuration_build_commands_map.py
|
EddLabs/eddington-static
|
cdd1d9514c4eea1bd06c24894b3922e6cc3fb1f5
|
[
"Apache-2.0"
] | null | null | null |
tests/configuration/configuration/test_configuration_build_commands_map.py
|
EddLabs/eddington-static
|
cdd1d9514c4eea1bd06c24894b3922e6cc3fb1f5
|
[
"Apache-2.0"
] | null | null | null |
tests/configuration/configuration/test_configuration_build_commands_map.py
|
EddLabs/eddington-static
|
cdd1d9514c4eea1bd06c24894b3922e6cc3fb1f5
|
[
"Apache-2.0"
] | null | null | null |
from pathlib import Path
from unittest.mock import Mock, call
import mock
import pytest
from statue.commands_filter import CommandsFilter
from statue.commands_map import CommandsMap
from statue.config.configuration import Configuration
from statue.context import Context
from tests.constants import (
COMMAND1,
COMMAND2,
COMMAND3,
CONTEXT1,
CONTEXT2,
CONTEXT_HELP_STRING1,
CONTEXT_HELP_STRING2,
SOURCE1,
SOURCE2,
)
from tests.util import assert_calls
def assert_commands_count(commands_map, count):
assert (
commands_map.total_commands_count == count
), "Commands count is different than expected"
def assert_sources(commands_map, sources):
assert (
list(commands_map.keys()) == sources
), "Commands map doesn't include all sources"
def assert_commands(commands_map, source, commands):
assert (
commands_map[source] == commands
), f"Commands of {source} are different than expected"
@pytest.fixture
def mock_build_commands(mocker):
return mocker.patch.object(Configuration, "build_commands")
def test_get_commands_map_source_from_config(mock_build_commands):
command = Mock()
context = Context(name=CONTEXT1, help=CONTEXT_HELP_STRING1)
configuration = Configuration(cache=mock.Mock())
configuration.contexts_repository.add_contexts(context)
configuration.sources_repository[Path(SOURCE1)] = CommandsFilter(
allowed_commands=[COMMAND1], contexts=[context]
)
mock_build_commands.return_value = [command]
commands_map = configuration.build_commands_map(
sources=[Path(SOURCE1)], commands_filter=CommandsFilter()
)
assert_commands_count(commands_map, 1)
assert_sources(commands_map, [Path(SOURCE1)])
assert_commands(commands_map, Path(SOURCE1), [command])
assert_calls(
mock_build_commands,
[
call(
CommandsFilter(
allowed_commands=[COMMAND1],
contexts=[context],
)
)
],
)
def test_get_commands_map_source_not_from_config(mock_build_commands):
command = Mock()
context = Context(name=CONTEXT1, help=CONTEXT_HELP_STRING1)
configuration = Configuration(cache=mock.Mock())
configuration.contexts_repository.add_contexts(context)
configuration.sources_repository[Path(SOURCE1)] = CommandsFilter(
denied_commands=[COMMAND3], contexts=[context]
)
mock_build_commands.return_value = [command]
commands_map = configuration.build_commands_map(
sources=[Path(SOURCE2)], commands_filter=CommandsFilter()
)
assert_commands_count(commands_map, 1)
assert_sources(commands_map, [Path(SOURCE2)])
assert_commands(commands_map, Path(SOURCE2), [command])
assert_calls(
mock_build_commands,
[call(CommandsFilter())],
)
def test_get_commands_map_with_no_commands(mock_build_commands):
context = Context(name=CONTEXT1, help=CONTEXT_HELP_STRING1)
configuration = Configuration(cache=mock.Mock())
configuration.contexts_repository.add_contexts(context)
configuration.sources_repository[Path(SOURCE1)] = CommandsFilter()
configuration.sources_repository[Path(SOURCE2)] = CommandsFilter()
commands_filter = CommandsFilter(denied_commands=COMMAND3, contexts=[context])
mock_build_commands.side_effect = lambda _: []
commands_map = configuration.build_commands_map(
sources=[Path(SOURCE1), Path(SOURCE2)], commands_filter=commands_filter
)
assert commands_map == CommandsMap()
assert_calls(mock_build_commands, [call(commands_filter), call(commands_filter)])
def test_get_commands_map_with_commands_without_directives(mock_build_commands):
command1, command2, command3 = Mock(), Mock(), Mock()
configuration = Configuration(cache=mock.Mock())
configuration.sources_repository[Path(SOURCE1)] = CommandsFilter()
configuration.sources_repository[Path(SOURCE2)] = CommandsFilter()
mock_build_commands.side_effect = [[command1], [command2, command3]]
commands_map = configuration.build_commands_map(
sources=[Path(SOURCE1), Path(SOURCE2)], commands_filter=CommandsFilter()
)
assert_commands_count(commands_map, 3)
assert_sources(commands_map, [Path(SOURCE1), Path(SOURCE2)])
assert_commands(commands_map, Path(SOURCE1), [command1])
assert_commands(commands_map, Path(SOURCE2), [command2, command3])
assert_calls(
mock_build_commands,
[call(CommandsFilter()), call(CommandsFilter())],
)
def test_get_commands_map_with_commands_and_directives(mock_build_commands):
command1, command2, command3 = Mock(), Mock(), Mock()
context = Context(name=CONTEXT1, help=CONTEXT_HELP_STRING1)
configuration = Configuration(cache=mock.Mock())
configuration.contexts_repository.add_contexts(context)
configuration.sources_repository[Path(SOURCE1)] = CommandsFilter()
configuration.sources_repository[Path(SOURCE2)] = CommandsFilter()
commands_filter = CommandsFilter(allowed_commands=[COMMAND1], contexts=[context])
mock_build_commands.side_effect = [[command1], [command2, command3]]
commands_map = configuration.build_commands_map(
sources=[Path(SOURCE1), Path(SOURCE2)], commands_filter=commands_filter
)
assert_commands_count(commands_map, 3)
assert_sources(commands_map, [Path(SOURCE1), Path(SOURCE2)])
assert_commands(commands_map, Path(SOURCE1), [command1])
assert_commands(commands_map, Path(SOURCE2), [command2, command3])
assert_calls(mock_build_commands, [call(commands_filter), call(commands_filter)])
def test_get_commands_map_with_source_context(mock_build_commands):
command1, command2, command3 = Mock(), Mock(), Mock()
context1, context2 = Context(name=CONTEXT1, help=CONTEXT_HELP_STRING1), Context(
name=CONTEXT2, help=CONTEXT_HELP_STRING2
)
configuration = Configuration(cache=mock.Mock())
configuration.contexts_repository.add_contexts(context1, context2)
configuration.sources_repository[Path(SOURCE1)] = CommandsFilter(
contexts=[context1]
)
configuration.sources_repository[Path(SOURCE2)] = CommandsFilter()
mock_build_commands.side_effect = [[command1, command2], [command3]]
commands_map = configuration.build_commands_map(
sources=[Path(SOURCE1), Path(SOURCE2)],
commands_filter=CommandsFilter(denied_commands=[COMMAND3], contexts=[context2]),
)
assert_commands_count(commands_map, 3)
assert_sources(commands_map, [Path(SOURCE1), Path(SOURCE2)])
assert_commands(commands_map, Path(SOURCE1), [command1, command2])
assert_commands(commands_map, Path(SOURCE2), [command3])
assert_calls(
mock_build_commands,
[
call(
CommandsFilter(
denied_commands=[COMMAND3],
contexts=[context2, context1],
)
),
call(
CommandsFilter(
denied_commands=[COMMAND3],
contexts=[context2],
)
),
],
)
def test_get_commands_map_with_source_allow_list(mock_build_commands):
command1, command2 = Mock(), Mock()
mock_build_commands.side_effect = [[command1], [command2]]
configuration = Configuration(cache=mock.Mock())
configuration.contexts_repository.add_contexts(
Context(name=CONTEXT1, help=CONTEXT_HELP_STRING1)
)
configuration.sources_repository[Path(SOURCE1)] = CommandsFilter()
configuration.sources_repository[Path(SOURCE2)] = CommandsFilter(
allowed_commands=[COMMAND2]
)
commands_map = configuration.build_commands_map(
sources=[Path(SOURCE1), Path(SOURCE2)],
commands_filter=CommandsFilter(
allowed_commands=[COMMAND1, COMMAND2], contexts=[CONTEXT1]
),
)
assert_commands_count(commands_map, 2)
assert_sources(commands_map, [Path(SOURCE1), Path(SOURCE2)])
assert_commands(commands_map, Path(SOURCE1), [command1])
assert_commands(commands_map, Path(SOURCE2), [command2])
assert_calls(
mock_build_commands,
[
call(
CommandsFilter(
allowed_commands=[COMMAND1, COMMAND2], contexts=[CONTEXT1]
)
),
call(CommandsFilter(allowed_commands=[COMMAND2], contexts=[CONTEXT1])),
],
)
def test_get_commands_map_with_source_deny_list(mock_build_commands):
command1, command2, command3, command4 = (
Mock(),
Mock(),
Mock(),
Mock(),
)
mock_build_commands.side_effect = [[command1, command2], [command3, command4]]
context = Context(name=CONTEXT1, help=CONTEXT_HELP_STRING1)
configuration = Configuration(cache=mock.Mock())
configuration.contexts_repository.add_contexts(context)
configuration.sources_repository[Path(SOURCE1)] = CommandsFilter()
configuration.sources_repository[Path(SOURCE2)] = CommandsFilter(
denied_commands=[COMMAND2]
)
commands_map = configuration.build_commands_map(
sources=[Path(SOURCE1), Path(SOURCE2)],
commands_filter=CommandsFilter(denied_commands=[COMMAND3], contexts=[context]),
)
assert_commands_count(commands_map, 4)
assert_sources(commands_map, [Path(SOURCE1), Path(SOURCE2)])
assert_commands(commands_map, Path(SOURCE1), [command1, command2])
assert_commands(commands_map, Path(SOURCE2), [command3, command4])
assert_calls(
mock_build_commands,
[
call(CommandsFilter(denied_commands=[COMMAND3], contexts=[context])),
call(
CommandsFilter(denied_commands=[COMMAND3, COMMAND2], contexts=[context])
),
],
)
def test_get_commands_map_from_relative_path(mock_build_commands):
command1, command2 = (Mock(), Mock())
context1, context2 = Context(name=CONTEXT1, help=CONTEXT_HELP_STRING1), Context(
name=CONTEXT2, help=CONTEXT_HELP_STRING2
)
configuration = Configuration(cache=mock.Mock())
configuration.contexts_repository.add_contexts(context1, context2)
configuration.sources_repository[Path(SOURCE1)] = CommandsFilter(
contexts=[context1]
)
configuration.sources_repository[Path(SOURCE2)] = CommandsFilter(
contexts=[context2]
)
mock_build_commands.side_effect = [[command1, command2]]
relative_source = Path(SOURCE2) / "i" / "am" / "relative"
commands_map = configuration.build_commands_map(
sources=[relative_source], commands_filter=CommandsFilter()
)
assert_sources(commands_map, [relative_source])
assert_commands(commands_map, relative_source, [command1, command2])
assert_commands_count(commands_map, 2)
assert_calls(
mock_build_commands,
[
call(
CommandsFilter(
contexts=[context2], allowed_commands=None, denied_commands=None
)
)
],
)
| 38.110345
| 88
| 0.704397
| 1,124
| 11,052
| 6.624555
| 0.077402
| 0.096025
| 0.063927
| 0.073059
| 0.836959
| 0.823529
| 0.79855
| 0.717835
| 0.692184
| 0.653102
| 0
| 0.020312
| 0.193721
| 11,052
| 289
| 89
| 38.242215
| 0.815284
| 0
| 0
| 0.513514
| 0
| 0
| 0.013934
| 0
| 0
| 0
| 0
| 0
| 0.177606
| 1
| 0.050193
| false
| 0
| 0.03861
| 0.003861
| 0.092664
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
d1a663027a0c932acc4c679366149fa51c589f34
| 94
|
py
|
Python
|
tests/admin_scripts/complex_app/admin/foo.py
|
Yoann-Vie/esgi-hearthstone
|
115d03426c7e8e80d89883b78ac72114c29bed12
|
[
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null |
tests/admin_scripts/complex_app/admin/foo.py
|
Yoann-Vie/esgi-hearthstone
|
115d03426c7e8e80d89883b78ac72114c29bed12
|
[
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null |
tests/admin_scripts/complex_app/admin/foo.py
|
Yoann-Vie/esgi-hearthstone
|
115d03426c7e8e80d89883b78ac72114c29bed12
|
[
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null |
from django.contrib import admin
from ..models.foo import Foo
admin.site.register(Foo)
| 15.666667
| 33
| 0.744681
| 14
| 94
| 5
| 0.642857
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.170213
| 94
| 5
| 34
| 18.8
| 0.897436
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
d1afd052a63ce53baf8ceb561b35ec3538c1bab9
| 137
|
py
|
Python
|
reinvent_chemistry/library_design/reaction_definitions/leaving_groups_dto.py
|
MolecularAI/reinvent-chemistry
|
bf0235bc2b1168b1db54c1e04bdba04b166ab7bf
|
[
"MIT"
] | null | null | null |
reinvent_chemistry/library_design/reaction_definitions/leaving_groups_dto.py
|
MolecularAI/reinvent-chemistry
|
bf0235bc2b1168b1db54c1e04bdba04b166ab7bf
|
[
"MIT"
] | null | null | null |
reinvent_chemistry/library_design/reaction_definitions/leaving_groups_dto.py
|
MolecularAI/reinvent-chemistry
|
bf0235bc2b1168b1db54c1e04bdba04b166ab7bf
|
[
"MIT"
] | 1
|
2022-03-22T15:24:13.000Z
|
2022-03-22T15:24:13.000Z
|
from dataclasses import dataclass
@dataclass
class LeavingGroupsDTO:
leaving_group_scaffold: str
leaving_group_decoration: str
| 17.125
| 33
| 0.817518
| 15
| 137
| 7.2
| 0.733333
| 0.222222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.153285
| 137
| 7
| 34
| 19.571429
| 0.931034
| 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 | 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
| 1
| 0
|
0
| 5
|
d1b4794249828a55394a9ceaa026477144c0b648
| 4,201
|
py
|
Python
|
scripts/1_get_osm_data.py
|
JohnnyRyan1/parks-and-golf
|
3f9f5d73e6ea6226a6214d72c18d39d4452f9c28
|
[
"MIT"
] | null | null | null |
scripts/1_get_osm_data.py
|
JohnnyRyan1/parks-and-golf
|
3f9f5d73e6ea6226a6214d72c18d39d4452f9c28
|
[
"MIT"
] | null | null | null |
scripts/1_get_osm_data.py
|
JohnnyRyan1/parks-and-golf
|
3f9f5d73e6ea6226a6214d72c18d39d4452f9c28
|
[
"MIT"
] | 1
|
2022-02-03T00:18:44.000Z
|
2022-02-03T00:18:44.000Z
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Get parks and golf courses for each state from OSM.
"""
# Import modules
import osmnx as ox
import geopandas as gpd
import os
# Define filepath
path = '/home/johnny/Documents/Teaching/490_Geospatial_Data_Science_Applications/Applications/OSM_Parks_and_Golf/data/'
# Import state boundary data
states = gpd.read_file(path + 'states/tl_2020_us_state.shp')
# Define tags
park_tags = {'leisure':['park', 'nature_reserve', 'dog_park', 'playground'],
'landuse':['recreation_ground'], 'boundary':['protected_area']}
""" might be other categories e.g. greenways? grassland? """
golf_tags = {'leisure':'golf_course'}
for i in states['NAME'].values:
# Define state name for osmnx
place_name = i + ', USA'
if os.path.exists(path + 'parks_and_golf/' + i.replace(' ', '_') + '_golf_courses.shp'):
print('Skipping... %s' %(i))
else:
print('Downloading... %s' %(i))
# Get areas labelled as parks or green spaces
parks = ox.geometries_from_place(place_name, park_tags)
# Get areas labeled as golf course
golf_courses = ox.geometries_from_place(place_name, golf_tags)
# Get just polygons
golf_courses = golf_courses[(golf_courses['geometry'].geom_type == 'Polygon') | (golf_courses['geometry'].geom_type == 'MultiPolygon')]
parks = parks[(parks['geometry'].geom_type == 'Polygon') | (parks['geometry'].geom_type == 'MultiPolygon')]
# Export to file
golf_gdf = gpd.GeoDataFrame(geometry=list(golf_courses['geometry']), crs=4326)
golf_gdf.to_file(path + 'parks_and_golf/' + i.replace(' ', '_') + '_golf_courses.shp')
park_gdf = gpd.GeoDataFrame(geometry=list(parks['geometry']), crs=4326)
park_gdf.to_file(path + 'parks_and_golf/' + i.replace(' ', '_') + '_parks.shp')
###############################################################################
# Download Washington State separately
###############################################################################
i = 'Washington'
# Define state name for osmnx
place_name = i + ', USA'
# Get areas labeled as parks and green spaces
parks = ox.geometries_from_place(place_name, park_tags, which_result=2)
# Get areas labeled as golf course
tags = {'leisure':'golf_course'}
golf_courses = ox.geometries_from_place(place_name, golf_tags, which_result=2)
# Get just polygons
golf_courses = golf_courses[(golf_courses['geometry'].geom_type == 'Polygon') | (golf_courses['geometry'].geom_type == 'MultiPolygon')]
parks = parks[(parks['geometry'].geom_type == 'Polygon') | (parks['geometry'].geom_type == 'MultiPolygon')]
# Export to file
golf_gdf = gpd.GeoDataFrame(geometry=list(golf_courses['geometry']), crs=4326)
golf_gdf.to_file(path + 'parks_and_golf/' + i.replace(' ', '_') + '_golf_courses.shp')
park_gdf = gpd.GeoDataFrame(geometry=list(parks['geometry']), crs=4326)
park_gdf.to_file(path + 'parks_and_golf/' + i.replace(' ', '_') + '_parks.shp')
###############################################################################
# Download New York State separately
###############################################################################
i = 'New York'
# Define state name for osmnx
place_name = i + ', USA'
# Get areas labeled as parks and green spaces
parks = ox.geometries_from_place(place_name, park_tags, which_result=2)
# Get areas labeled as golf course
tags = {'leisure':'golf_course'}
golf_courses = ox.geometries_from_place(place_name, golf_tags, which_result=2)
# Get just polygons
golf_courses = golf_courses[(golf_courses['geometry'].geom_type == 'Polygon') | (golf_courses['geometry'].geom_type == 'MultiPolygon')]
parks = parks[(parks['geometry'].geom_type == 'Polygon') | (parks['geometry'].geom_type == 'MultiPolygon')]
# Export to file
golf_gdf = gpd.GeoDataFrame(geometry=list(golf_courses['geometry']), crs=4326)
golf_gdf.to_file(path + 'parks_and_golf/' + i.replace(' ', '_') + '_golf_courses.shp')
park_gdf = gpd.GeoDataFrame(geometry=list(parks['geometry']), crs=4326)
park_gdf.to_file(path + 'parks_and_golf/' + i.replace(' ', '_') + '_parks.shp')
| 36.530435
| 143
| 0.634849
| 520
| 4,201
| 4.876923
| 0.209615
| 0.099763
| 0.07571
| 0.044164
| 0.749606
| 0.749606
| 0.742902
| 0.742902
| 0.742902
| 0.713722
| 0
| 0.010338
| 0.14806
| 4,201
| 114
| 144
| 36.850877
| 0.69824
| 0.156867
| 0
| 0.613636
| 0
| 0
| 0.26336
| 0.04384
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.068182
| 0
| 0.068182
| 0.045455
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
d1eee506feaad0b8a17c2693404f85665b50cc08
| 1,404
|
py
|
Python
|
inlineplz/parsers/__init__.py
|
kyleburton/inline-plz
|
701b13e17ea0c3849b96c4746d7c0d2672fc78e4
|
[
"ISC"
] | null | null | null |
inlineplz/parsers/__init__.py
|
kyleburton/inline-plz
|
701b13e17ea0c3849b96c4746d7c0d2672fc78e4
|
[
"ISC"
] | null | null | null |
inlineplz/parsers/__init__.py
|
kyleburton/inline-plz
|
701b13e17ea0c3849b96c4746d7c0d2672fc78e4
|
[
"ISC"
] | null | null | null |
# -*- coding: utf-8 -*-
# flake8: noqa
from __future__ import absolute_import
from __future__ import unicode_literals
from inlineplz.parsers.ansiblelint import AnsibleLintParser
from inlineplz.parsers.bandit import BanditParser
from inlineplz.parsers.codenarc import CodenarcParser
from inlineplz.parsers.detectsecrets import DetectSecretsParser
from inlineplz.parsers.dockerfilelint import DockerfileLintParser
from inlineplz.parsers.eclint import ECLintParser
from inlineplz.parsers.eslint import ESLintParser
from inlineplz.parsers.gherkinlint import GherkinLintParser
from inlineplz.parsers.gometalinter import GometalinterParser
from inlineplz.parsers.jscs import JSCSParser
from inlineplz.parsers.jshint import JSHintParser
from inlineplz.parsers.jsonlint import JSONLintParser
from inlineplz.parsers.markdownlint import MarkdownLintParser
from inlineplz.parsers.megacheck import MegacheckParser
from inlineplz.parsers.pmd import PMDParser
from inlineplz.parsers.proselint import ProselintParser
from inlineplz.parsers.prospector import ProspectorParser
from inlineplz.parsers.rstlint import RSTLintParser
from inlineplz.parsers.rflint import RobotFrameworkLintParser
from inlineplz.parsers.shellcheck import ShellcheckParser
from inlineplz.parsers.spotbugsmaven import SpotbugsMavenParser
from inlineplz.parsers.stylint import StylintParser
from inlineplz.parsers.yamllint import YAMLLintParser
| 46.8
| 65
| 0.881054
| 153
| 1,404
| 8.019608
| 0.385621
| 0.243684
| 0.374898
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.001546
| 0.078348
| 1,404
| 29
| 66
| 48.413793
| 0.946677
| 0.024217
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 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
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
ae27876329b6fc4d22c863c5584ad4eccf820e7c
| 12,960
|
py
|
Python
|
machlearn/kNN/_kNN.py
|
daniel-yj-yang/pyml
|
2328ae1d73eab39f2774331fcfaa10e8fa2fc0de
|
[
"BSD-3-Clause"
] | 2
|
2020-11-18T13:25:25.000Z
|
2020-11-18T13:25:27.000Z
|
machlearn/kNN/_kNN.py
|
daniel-yj-yang/pyml
|
2328ae1d73eab39f2774331fcfaa10e8fa2fc0de
|
[
"BSD-3-Clause"
] | null | null | null |
machlearn/kNN/_kNN.py
|
daniel-yj-yang/pyml
|
2328ae1d73eab39f2774331fcfaa10e8fa2fc0de
|
[
"BSD-3-Clause"
] | 2
|
2020-11-18T04:46:07.000Z
|
2020-11-25T16:19:39.000Z
|
# -*- coding: utf-8 -*-
# Author: Daniel Yang <daniel.yj.yang@gmail.com>
#
# License: BSD 3 clause
from sklearn.neighbors import KNeighborsClassifier
from ..math_and_stats import distance
import numpy as np
import pandas as pd
from ..DSA import the_most_frequent_item_in_a_list
from ..base import classifier
from collections import Counter
class kNN_classifier_from_scratch(classifier):
def __init__(self, n_neighbors=5, distance_func=distance(p=2).Minkowski):
super().__init__()
self.X_train = None
self.y_train = None
self.n_neighbors = n_neighbors
self.distance_func = distance_func
def fit(self, X_train, y_train):
if type(X_train) in [pd.DataFrame, pd.Series]:
X_train = X_train.to_numpy()
if type(y_train) in [pd.DataFrame, pd.Series]:
y_train = y_train.to_numpy()
self.X_train = X_train
self.y_train = y_train
self.classes_ = np.unique(self.y_train)
return self
def predict(self, X_test):
if type(X_test) in [pd.DataFrame, pd.Series]:
X_test = X_test.to_numpy()
y_pred = []
for this_x_test_sample in X_test:
# calculate the distance from this_x_test_sample to all training samples, while tagging along the y_train label
train_list = [[self.distance_func(self.X_train[train_index], this_x_test_sample), self.y_train[train_index]] for train_index in range(self.X_train.shape[0])]
# sorted by the first element, the distance from low to high
train_list.sort()
# keep the closet k neighbors and retain their y_train labels
y_pred_candidates = [data[1] for data in train_list[:self.n_neighbors]]
# find the mode of the y_train labels, which will be the y_pred
y_pred_mode = the_most_frequent_item_in_a_list(y_pred_candidates).pythonic_naive_appraoch()
# and then repeat this procedure for the next x_test_sample
y_pred.append(y_pred_mode)
return y_pred
def predict_proba(self, X_test):
if type(X_test) in [pd.DataFrame, pd.Series]:
X_test = X_test.to_numpy()
y_pred_score = np.zeros(shape=(X_test.shape[0], self.classes_.shape[0]))
for index_x, this_x_test_sample in enumerate(X_test):
# calculate the distance from this_x_test_sample to all training samples, while tagging along the y_train label
train_list = [[self.distance_func(self.X_train[train_index], this_x_test_sample), self.y_train[train_index]] for train_index in range(self.X_train.shape[0])]
# sorted by the first element, the distance from low to high
train_list.sort()
# keep the closet k neighbors and retain their y_train labels
y_pred_candidates = [data[1] for data in train_list[:self.n_neighbors]]
# count for each of the y_classes
y_pred_counts = Counter(y_pred_candidates)
for index_y, y_class in enumerate(self.classes_):
y_pred_score[index_x, index_y] = y_pred_counts[y_class]/self.n_neighbors
return y_pred_score
def kNN_classifier_from_sklearn(*args, **kwargs):
"""
"""
return KNeighborsClassifier(*args, **kwargs)
kNN_classifier = kNN_classifier_from_sklearn
def _kNN_demo_Social_Network_Ads():
from ..datasets import public_dataset
data = public_dataset(name='Social_Network_Ads')
X = data[['Age', 'EstimatedSalary']].to_numpy()
y = data['Purchased'].to_numpy()
y_classes = ['not_purchased (y=0)', 'purchased (y=1)']
from sklearn.model_selection import train_test_split, GridSearchCV
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.25, random_state=123)
from sklearn.preprocessing import StandardScaler
# scaler = StandardScaler() # removing the mean and scaling to unit variance
#X_train = scaler.fit_transform(X_train)
#X_test = scaler.transform(X_test)
# create pipeline
from sklearn.pipeline import Pipeline
pipeline = Pipeline(steps=[('scaler',
StandardScaler(with_mean=True, with_std=True)),
('classifier',
kNN_classifier(n_neighbors=5, weights='uniform', p=2, metric='minkowski')),
])
# pipeline parameters to tune
hyperparameters = {
'scaler__with_mean': [True],
'scaler__with_std': [True],
'classifier__n_neighbors': range(1, 20),
'classifier__weights': ['uniform', 'distance'],
'classifier__p': [2**0, 2**0.25, 2**0.5, 2**0.75, 2**1, 2**1.25, 2**1.5, 2**1.75, 2**2, 2**2.25, 2**2.5, 2**2.75, 2**3],
'classifier__metric': ['minkowski'],
}
grid = GridSearchCV(
pipeline,
hyperparameters, # parameters to tune via cross validation
refit=True, # fit using all data, on the best detected classifier
n_jobs=-1,
scoring='accuracy',
cv=5,
)
classifier_grid = grid.fit(X_train, y_train)
k = classifier_grid.best_params_['classifier__n_neighbors']
print(
f"Using a grid search and a kNN classifier, the best hyperparameters were found as following:\n"
f"Step1: scaler: StandardScaler(with_mean={repr(classifier_grid.best_params_['scaler__with_mean'])}, with_std={repr(classifier_grid.best_params_['scaler__with_std'])});\n"
f"Step2: classifier: kNN_classifier(n_neighbors={repr(k)}, weights={repr(classifier_grid.best_params_['classifier__weights'])}, p={classifier_grid.best_params_['classifier__p']:.2f}, metric={repr(classifier_grid.best_params_['classifier__metric'])}).\n")
y_pred = classifier_grid.predict(X_test)
y_pred_score = classifier_grid.predict_proba(X_test)
from ..model_evaluation import plot_confusion_matrix, plot_ROC_and_PR_curves, visualize_classifier_decision_boundary_with_two_features
plot_confusion_matrix(y_true=y_test, y_pred=y_pred, y_classes=y_classes, model_name=f"kNN (k={k})")
plot_ROC_and_PR_curves(fitted_model=classifier_grid, X=X_test, y_true=y_test, y_pred_score=y_pred_score[:, 1], y_pos_label=1, model_name=f"kNN (k={k})")
visualize_classifier_decision_boundary_with_two_features(classifier_grid, X_train, y_train, y_classes, title=f"k-Nearest Neighbors (k={k}) / training set", X1_lab='Age', X2_lab='Estimated Salary')
visualize_classifier_decision_boundary_with_two_features(classifier_grid, X_test, y_test, y_classes, title=f"k-Nearest Neighbors (k={k}) / testing set", X1_lab='Age', X2_lab='Estimated Salary')
def _kNN_demo_iris():
from ..datasets import public_dataset
data = public_dataset(name='iris')
y_classes = ['setosa', 'versicolor', 'virginica']
X = data[['sepal length (cm)', 'sepal width (cm)', 'petal length (cm)', 'petal width (cm)']]
y = data['target']
print(
f"---------------------------------------------------------------------------------------------------------------------\n"
f"This demo uses a public dataset of Fisher's Iris, which has a total of {len(data)} samples from three species of Iris ('setosa', 'versicolor', 'virginica').\n"
f"The goal is to use 'the length and the width of the sepals and petals, in centimeters', to predict which species of Iris the sample belongs to.\n")
from sklearn.model_selection import train_test_split, GridSearchCV
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.25, random_state=123)
from sklearn.preprocessing import StandardScaler
# scaler = StandardScaler() # removing the mean and scaling to unit variance
#X_train = scaler.fit_transform(X_train)
#X_test = scaler.transform(X_test)
# create pipeline
from sklearn.pipeline import Pipeline
pipeline = Pipeline(steps=[('scaler',
StandardScaler(with_mean=True, with_std=True)),
('classifier',
kNN_classifier(n_neighbors=5, weights='uniform', p=2, metric='minkowski')),
])
# pipeline parameters to tune
hyperparameters = {
'scaler__with_mean': [True, False],
'scaler__with_std': [True, False],
'classifier__n_neighbors': range(1, 20),
'classifier__weights': ['uniform', 'distance'],
'classifier__p': [2**0, 2**0.25, 2**0.5, 2**0.75, 2**1, 2**1.25, 2**1.5, 2**1.75, 2**2, 2**2.25, 2**2.5, 2**2.75, 2**3],
'classifier__metric': ['minkowski'],
}
grid = GridSearchCV(
pipeline,
hyperparameters, # parameters to tune via cross validation
refit=True, # fit using all data, on the best detected classifier
n_jobs=-1,
scoring='accuracy',
cv=5,
)
classifier_grid = grid.fit(X_train, y_train)
k = classifier_grid.best_params_['classifier__n_neighbors']
print(
f"Using a grid search and a kNN classifier, the best hyperparameters were found as following:\n"
f"Step1: scaler: StandardScaler(with_mean={repr(classifier_grid.best_params_['scaler__with_mean'])}, with_std={repr(classifier_grid.best_params_['scaler__with_std'])});\n"
f"Step2: classifier: kNN_classifier(n_neighbors={repr(k)}, weights={repr(classifier_grid.best_params_['classifier__weights'])}, p={classifier_grid.best_params_['classifier__p']:.2f}, metric={repr(classifier_grid.best_params_['classifier__metric'])}).\n")
y_pred = classifier_grid.predict(X_test)
y_pred_score = classifier_grid.predict_proba(X_test)
from ..model_evaluation import plot_confusion_matrix, plot_ROC_and_PR_curves, visualize_classifier_decision_boundary_with_two_features
plot_confusion_matrix(y_true=y_test, y_pred=y_pred, y_classes=y_classes, figsize=(7,7), model_name=f"kNN (k={k})")
def _kNN_demo_iris_from_scratch():
from ..datasets import public_dataset
data = public_dataset(name='iris')
y_classes = ['setosa', 'versicolor', 'virginica']
X = data[['sepal length (cm)', 'sepal width (cm)', 'petal length (cm)', 'petal width (cm)']]
y = data['target']
n_neighbors = 12
print(
f"---------------------------------------------------------------------------------------------------------------------\n"
f"This demo uses a public dataset of Fisher's Iris, which has a total of {len(data)} samples from three species of Iris ('setosa', 'versicolor', 'virginica').\n"
f"The goal is to use 'the length and the width of the sepals and petals, in centimeters', to predict which species of Iris the sample belongs to.\n")
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.25, random_state=123)
from sklearn.preprocessing import StandardScaler
scaler = StandardScaler()
X_train = scaler.fit_transform(X_train)
X_test = scaler.transform(X_test)
model_from_scratch = kNN_classifier_from_scratch(n_neighbors=n_neighbors)
model_sklearn = kNN_classifier_from_sklearn(n_neighbors=n_neighbors)
model_from_scratch.fit(X_train, y_train)
model_sklearn.fit(X_train, y_train)
y_pred_via_from_scratch = model_from_scratch.predict(X_test)
y_pred_via_sklearn = model_sklearn.predict(X_test)
assert (y_pred_via_from_scratch - y_pred_via_sklearn < 1e-9).all(), "*** Warning *** difference pred between from_scratch and sklearn"
for i in range(len(y_pred_via_from_scratch)):
if y_pred_via_from_scratch[i] != y_pred_via_sklearn[i]:
print(f"difference between from_scratch and sklearn: {i}-th item")
y_pred_score_via_from_scratch = model_from_scratch.predict_proba(X_test)
y_pred_score_via_sklearn = model_sklearn.predict_proba(X_test)
assert (y_pred_score_via_from_scratch - y_pred_score_via_sklearn < 1e-9).all(), "*** Warning *** difference pred_score between from_scratch and sklearn"
from ..model_evaluation import plot_confusion_matrix
plot_confusion_matrix(y_true=y_test, y_pred=y_pred_via_from_scratch, y_classes=y_classes, figsize=(7,7), model_name=f"kNN (k={n_neighbors})")
def demo(dataset="Social_Network_Ads"):
"""
This function provides a demo of selected functions in this module.
Required arguments:
dataset: A string. Possible values: "Social_Network_Ads", "iris"
"""
if dataset == "Social_Network_Ads":
_kNN_demo_Social_Network_Ads()
elif dataset == "iris":
_kNN_demo_iris()
else:
raise TypeError(f"dataset [{dataset}] is not defined")
def demo_from_scratch(dataset="iris"):
"""
This function provides a demo of selected functions in this module.
Required arguments:
dataset: A string. Possible values: "iris"
"""
if dataset == "iris":
_kNN_demo_iris_from_scratch()
else:
raise TypeError(f"dataset [{dataset}] is not defined")
| 47.822878
| 262
| 0.673534
| 1,828
| 12,960
| 4.464989
| 0.144967
| 0.023279
| 0.026464
| 0.035285
| 0.801029
| 0.736217
| 0.715756
| 0.700319
| 0.678265
| 0.652781
| 0
| 0.014297
| 0.201235
| 12,960
| 270
| 263
| 48
| 0.77415
| 0.120833
| 0
| 0.521978
| 0
| 0.043956
| 0.266513
| 0.096383
| 0
| 0
| 0
| 0
| 0.010989
| 1
| 0.054945
| false
| 0
| 0.115385
| 0
| 0.197802
| 0.027473
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
ae2ec3dc9d9e28438fb5fc79ae0e7c82ceb3c25c
| 118
|
py
|
Python
|
geostream/__init__.py
|
karimbahgat/GeoStream
|
ca067c3b2ba12983089a5562869a7732a3d7aa6b
|
[
"MIT"
] | null | null | null |
geostream/__init__.py
|
karimbahgat/GeoStream
|
ca067c3b2ba12983089a5562869a7732a3d7aa6b
|
[
"MIT"
] | null | null | null |
geostream/__init__.py
|
karimbahgat/GeoStream
|
ca067c3b2ba12983089a5562869a7732a3d7aa6b
|
[
"MIT"
] | null | null | null |
from . import *
from . import vector
from . import raster
from .workspace import Workspace
from .table import Table
| 14.75
| 32
| 0.762712
| 16
| 118
| 5.625
| 0.375
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.186441
| 118
| 7
| 33
| 16.857143
| 0.9375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
ae397d994fa003f39a7f51462e08436a1a9d2c6e
| 363
|
py
|
Python
|
tests/common.py
|
EricDalrymple91/basic-pytest-framework
|
d65bacdb8c33a798e0edc52e900d990ff5e1adb5
|
[
"MIT"
] | null | null | null |
tests/common.py
|
EricDalrymple91/basic-pytest-framework
|
d65bacdb8c33a798e0edc52e900d990ff5e1adb5
|
[
"MIT"
] | null | null | null |
tests/common.py
|
EricDalrymple91/basic-pytest-framework
|
d65bacdb8c33a798e0edc52e900d990ff5e1adb5
|
[
"MIT"
] | null | null | null |
"""
"""
import pytest
class TestCommon(object):
storage = {}
@pytest.fixture()
def number(self, pytestconfig):
return int(pytestconfig.getoption('n'))
@pytest.fixture()
def text(self, pytestconfig):
return pytestconfig.getoption('t')
@pytest.fixture()
def number_doubled(self, number):
return number * 2
| 16.5
| 47
| 0.62259
| 37
| 363
| 6.081081
| 0.513514
| 0.173333
| 0.213333
| 0.195556
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.003636
| 0.242424
| 363
| 21
| 48
| 17.285714
| 0.814545
| 0
| 0
| 0.25
| 0
| 0
| 0.005634
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.083333
| 0.25
| 0.75
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
ae41000111d1096337fe0b3b97a89b7b955514b5
| 203
|
py
|
Python
|
compiler/exceptions.py
|
hanks/another-super-tiny-compiler
|
46907beb6de96e8c09c1ec433a9469cb5b74ba78
|
[
"MIT"
] | 1
|
2021-10-13T10:09:01.000Z
|
2021-10-13T10:09:01.000Z
|
compiler/exceptions.py
|
hanks/another-super-tiny-compiler
|
46907beb6de96e8c09c1ec433a9469cb5b74ba78
|
[
"MIT"
] | null | null | null |
compiler/exceptions.py
|
hanks/another-super-tiny-compiler
|
46907beb6de96e8c09c1ec433a9469cb5b74ba78
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class InvalidTokenTypeError(Exception):
pass
class InvalidNodeTypeError(Exception):
pass
class InvalidTargetNodeTypeError(Exception):
pass
| 13.533333
| 44
| 0.719212
| 19
| 203
| 7.684211
| 0.684211
| 0.267123
| 0.246575
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005917
| 0.167488
| 203
| 14
| 45
| 14.5
| 0.857988
| 0.206897
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
ae5db44f07b2507186df047ec62c23f3362e4e3a
| 278
|
py
|
Python
|
Traidoo/warmup.py
|
stanwood/traidoo-api
|
83e8599f2eb54352988bac27e2d4acd30734816d
|
[
"MIT"
] | 3
|
2020-05-05T12:12:09.000Z
|
2020-05-08T08:48:16.000Z
|
Traidoo/warmup.py
|
stanwood/traidoo-api
|
83e8599f2eb54352988bac27e2d4acd30734816d
|
[
"MIT"
] | 160
|
2020-05-19T13:03:43.000Z
|
2022-03-12T00:35:28.000Z
|
Traidoo/warmup.py
|
stanwood/traidoo-api
|
83e8599f2eb54352988bac27e2d4acd30734816d
|
[
"MIT"
] | null | null | null |
from rest_framework.decorators import api_view, permission_classes
from rest_framework.permissions import AllowAny
from rest_framework.response import Response
@api_view(["GET"])
@permission_classes((AllowAny,))
def warmup(request):
return Response({"message": "Ready!"})
| 27.8
| 66
| 0.798561
| 34
| 278
| 6.323529
| 0.558824
| 0.111628
| 0.237209
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.093525
| 278
| 9
| 67
| 30.888889
| 0.853175
| 0
| 0
| 0
| 0
| 0
| 0.057554
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.142857
| false
| 0
| 0.428571
| 0.142857
| 0.714286
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 5
|
ae7d14e62f899e6aeb25827b997931203b2b734c
| 175
|
py
|
Python
|
apps/users/tasks.py
|
Jaylen0829/tornado-RESTfulAPI
|
f1d216e400dcbcd5d62d31ff83cdbd180eebf1a3
|
[
"MIT"
] | null | null | null |
apps/users/tasks.py
|
Jaylen0829/tornado-RESTfulAPI
|
f1d216e400dcbcd5d62d31ff83cdbd180eebf1a3
|
[
"MIT"
] | null | null | null |
apps/users/tasks.py
|
Jaylen0829/tornado-RESTfulAPI
|
f1d216e400dcbcd5d62d31ff83cdbd180eebf1a3
|
[
"MIT"
] | 1
|
2022-03-29T02:54:33.000Z
|
2022-03-29T02:54:33.000Z
|
from __future__ import absolute_import, unicode_literals
from celery_app.celery import app
import time
@app.task
def user_handle():
time.sleep(2)
return True
| 19.444444
| 57
| 0.748571
| 25
| 175
| 4.92
| 0.68
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.007092
| 0.194286
| 175
| 9
| 58
| 19.444444
| 0.865248
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.142857
| true
| 0
| 0.428571
| 0
| 0.714286
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
887a3b68d260664bd8dd73dc021beadc434e1b28
| 759
|
py
|
Python
|
zk.py
|
AndrewCopeland/zk-ui
|
a6bc1c0b7ed48bea0d6cce8dc404c13ad728da2f
|
[
"Apache-2.0"
] | 1
|
2021-04-25T15:17:05.000Z
|
2021-04-25T15:17:05.000Z
|
zk.py
|
AndrewCopeland/zk-ui
|
a6bc1c0b7ed48bea0d6cce8dc404c13ad728da2f
|
[
"Apache-2.0"
] | null | null | null |
zk.py
|
AndrewCopeland/zk-ui
|
a6bc1c0b7ed48bea0d6cce8dc404c13ad728da2f
|
[
"Apache-2.0"
] | null | null | null |
import subprocess
def _subprocess(command):
return subprocess.check_output(command).decode('utf-8')
def _str_to_list(input):
return input.split("\n")[:-1]
def list():
return _str_to_list(_subprocess(['zk', 'list']))
def cat(title):
return _subprocess(['zk', 'cat', title])
def open_browser(title):
return _subprocess(['zk', 'open-browser', title])
def open_code(title):
return _subprocess(['zk', 'open-code', title])
def search(search):
return _str_to_list(_subprocess(['zk', 'search', search]))
def new_code(title):
return _subprocess(['zk', 'new-code', title])
def remove(title):
return _subprocess(['zk', 'remove', title])
def link(title, link_title):
return _subprocess(['zk', 'link', title, link_title])
| 23.71875
| 62
| 0.675889
| 101
| 759
| 4.841584
| 0.267327
| 0.196319
| 0.257669
| 0.282209
| 0.284254
| 0.110429
| 0
| 0
| 0
| 0
| 0
| 0.003077
| 0.14361
| 759
| 31
| 63
| 24.483871
| 0.749231
| 0
| 0
| 0
| 0
| 0
| 0.098814
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.47619
| false
| 0
| 0.047619
| 0.47619
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
88b34b92edbdeae5fe79171744cfcc3903aa4bcd
| 18
|
py
|
Python
|
tests/minimal.suite.py
|
GillesArcas/cws
|
8a060529f9baa29b979089fe15b2199f65ef2ded
|
[
"MIT"
] | 13
|
2018-10-27T23:59:50.000Z
|
2020-10-07T04:48:17.000Z
|
tests/minimal.suite.py
|
GillesArcas/cws
|
8a060529f9baa29b979089fe15b2199f65ef2ded
|
[
"MIT"
] | null | null | null |
tests/minimal.suite.py
|
GillesArcas/cws
|
8a060529f9baa29b979089fe15b2199f65ef2ded
|
[
"MIT"
] | 2
|
2018-03-20T22:57:10.000Z
|
2018-10-28T17:00:08.000Z
|
# pass
pass
# ---
| 4.5
| 6
| 0.444444
| 2
| 18
| 4
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.277778
| 18
| 3
| 7
| 6
| 0.615385
| 0.444444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 1
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
88b631f0911a242bc25e207c3ce77113ba16232d
| 74
|
py
|
Python
|
appannie/store/__init__.py
|
Julian-O/appannie
|
b5e053c43a9fbabda2d84a8992c2efb2e76c8aef
|
[
"MIT"
] | null | null | null |
appannie/store/__init__.py
|
Julian-O/appannie
|
b5e053c43a9fbabda2d84a8992c2efb2e76c8aef
|
[
"MIT"
] | null | null | null |
appannie/store/__init__.py
|
Julian-O/appannie
|
b5e053c43a9fbabda2d84a8992c2efb2e76c8aef
|
[
"MIT"
] | null | null | null |
from .app import App
from .keyword import Keyword
from .store import Store
| 24.666667
| 28
| 0.810811
| 12
| 74
| 5
| 0.416667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.148649
| 74
| 3
| 29
| 24.666667
| 0.952381
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
31f714d39d6559be8864d06c73014e8d277dfb57
| 10,043
|
py
|
Python
|
test/test-tool/openmldb-case-gen/auto_gen_case/hybridsql_case.py
|
jasleon/OpenMLDB
|
2f85d12cd8dadd3a1ec822e1f591632341f3b23f
|
[
"Apache-2.0"
] | 2,659
|
2021-06-07T12:59:15.000Z
|
2022-03-30T15:29:37.000Z
|
test/test-tool/openmldb-case-gen/auto_gen_case/hybridsql_case.py
|
jasleon/OpenMLDB
|
2f85d12cd8dadd3a1ec822e1f591632341f3b23f
|
[
"Apache-2.0"
] | 1,396
|
2021-05-28T09:50:13.000Z
|
2022-03-31T16:37:49.000Z
|
test/test-tool/openmldb-case-gen/auto_gen_case/hybridsql_case.py
|
jasleon/OpenMLDB
|
2f85d12cd8dadd3a1ec822e1f591632341f3b23f
|
[
"Apache-2.0"
] | 499
|
2021-05-31T07:36:48.000Z
|
2022-03-31T15:10:12.000Z
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2021 4Paradigm
#
# 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.
from hybridsql_sql import sample_window_project
from hybridsql_table import ColumnsPool
from hybridsql_window import sample_window_def
from gen_sample_data import gen_simple_data
from hybridsql_param import sample_integer_config
from hybridsql_sql import sample_window_union_project
from hybridsql_sql import sample_last_join_project, sample_subselect_project
from gen_sample_data import gen_pk_groups
import random
def gen_single_window_test(test_name, udf_pool, args):
# collect input columns required by window project
input_columns = ColumnsPool(args)
input_columns.set_unique_id("id", "int64")
input_columns.name = "{0}"
# sample window def
window_defs = []
window_num = sample_integer_config(args.window_num);
for i in range(window_num):
window_def = sample_window_def("w"+str(i), args)
window_defs.append(window_def)
window_query = sample_window_project(
mainTable=input_columns,
window_defs=window_defs, udf_defs=udf_pool,
args=args, downward=True, keep_index=True)
sql_string = window_query.text.strip() + ";"
all_columns = input_columns.get_all_columns()
data = gen_simple_data(all_columns, args, window_defs,
index_column=input_columns.id_column,
partition_columns=input_columns.partition_columns,
order_columns=input_columns.order_columns)
# 组装 yml
input_table = {
"columns": ["%s %s" % (c.name, c.dtype) for c in all_columns],
"indexs": ["index1:%s:%s" % (
index.partition_column,
index.order_column) for index in input_columns.indexs],
"rows": data
}
sql_case = {
"id": 0,
"desc": "single_window_test_" + test_name,
"sql": sql_string,
"expect": {"success": True, "order": "id"},
"inputs": [input_table]
}
yaml_obj = {
"db": "test_db",
"cases": [sql_case]
}
return yaml_obj
def gen_window_union_test(test_name, udf_pool, args):
# collect input columns required by window project
table_num = sample_integer_config(args.table_num)
tables = []
for i in range(table_num):
table = ColumnsPool(args)
table.set_unique_id("id", "int64")
table.name = "{%d}" % i
tables.append(table)
# sample window def
window_defs = []
window_num = sample_integer_config(args.window_num)
for i in range(window_num):
window_def = sample_window_def("w"+str(i), args)
if table_num <=1:
window_def.window_type = 0
else:
window_def.window_type = sample_integer_config(args.window_type)
if window_def.window_type == 1:
for i in range(1, table_num):
window_def.tables.add(tables[i].name)
window_defs.append(window_def)
window_query = sample_window_union_project(
tables, window_defs=window_defs, udf_defs=udf_pool,
args=args, downward=True, keep_index=True)
sql_string = window_query.text.strip() + ";"
# 组装 yml
input_tables = []
for table in tables:
all_columns = table.get_all_columns()
data = gen_simple_data(all_columns, args, window_defs,
index_column=table.id_column,
partition_columns=table.partition_columns,
order_columns=table.order_columns)
input_table = {
"columns": ["%s %s" % (c.name, c.dtype) for c in all_columns],
"indexs": ["index1:%s:%s" % (
index.partition_column,
index.order_column) for index in table.indexs],
"rows": data
}
input_tables.append(input_table)
sql_case = {
"id": 0,
"desc": "single_window_test_" + test_name,
"sql": sql_string,
"expect": {"success": True, "order": "id"},
"inputs": input_tables
}
yaml_obj = {
"db": "test_db",
"cases": [sql_case]
}
return yaml_obj
def gen_window_lastjoin_test(test_name, udf_pool, args):
# collect input columns required by window project
table_num = sample_integer_config(args.table_num)
if table_num <= 1:
table_num=2
tables = []
for i in range(table_num):
table = ColumnsPool(args)
table.set_unique_id("id", "int64")
table.name = "{%d}" % i
tables.append(table)
# sample window def
window_defs = []
window_num = sample_integer_config(args.window_num)
for i in range(window_num):
window_def = sample_window_def("w"+str(i), args)
# window_def.window_type = sample_integer_config(args.window_type)
# if window_def.window_type == 1:
# for i in range(1, table_num):
# window_def.tables.add(tables[i].name)
window_defs.append(window_def)
window_query = sample_last_join_project(
tables, window_defs=window_defs, udf_defs=udf_pool,
args=args, downward=True, keep_index=True)
sql_string = window_query.text.strip() + ";"
# 组装 yml
input_tables = []
pk_groups = gen_pk_groups(args, tables[0].partition_columns)
for table in tables:
all_columns = table.get_all_columns()
data = gen_simple_data(all_columns, args, window_defs,
index_column=table.id_column,
partition_columns=table.partition_columns,
order_columns=table.order_columns,
pk_groups=pk_groups)
input_table = {
"columns": ["%s %s" % (c.name, c.dtype) for c in all_columns],
"indexs": ["index%d:%s:%s" % (
i,
index.partition_column,
index.order_column) for i,index in enumerate(table.indexs)],
"rows": data
}
input_tables.append(input_table)
sql_case = {
"id": 0,
"desc": "single_window_test_" + test_name,
"sql": sql_string,
"expect": {"success": True, "order": "id"},
"inputs": input_tables
}
yaml_obj = {
"db": "test_db",
"cases": [sql_case]
}
return yaml_obj
def gen_window_subselect_test(test_name, udf_pool, args):
# collect input columns required by window project
table_num = sample_integer_config(args.table_num)
# table_num = 2
tables = []
for i in range(table_num):
table = ColumnsPool(args)
table.set_unique_id("id", "int64")
table.name = "{%d}" % i
# table_pk_num = sample_integer_config(args.table_pk_num)
# for j in range(table_pk_num):
# pk_column = table.sample_partition_column(
# downward=True, nullable=args.index_nullable)
# table.partition_columns.append(pk_column)
# table_ts_num = sample_integer_config(args.table_ts_num)
# for j in range(table_ts_num):
# order_column = table.sample_order_column(
# downward=True, nullable=args.index_nullable)
# table.order_columns.append(order_column)
# table_normal_num = sample_integer_config(args.table_normal_num)
# for j in range(table_normal_num):
# expect_dtype = random.choice(PRIMITIVE_TYPES)
# normal_column = table.sample_column(
# downward=True, dtype=expect_dtype,
# nullable=None, allow_const=True)
# table.normal_columns.append(normal_column)
tables.append(table)
# sample window def
window_defs = []
window_num = sample_integer_config(args.window_num)
for i in range(window_num):
window_def = sample_window_def("w"+str(i), args)
# window_def.window_type = sample_integer_config(args.window_type)
# if window_def.window_type == 1:
# for i in range(1, table_num):
# window_def.tables.add(tables[i].name)
window_defs.append(window_def)
window_query = sample_subselect_project(
tables, window_defs=window_defs, udf_defs=udf_pool,
args=args, downward=True, keep_index=True)
sql_string = window_query.text.strip() + ";"
# 组装 yml
input_tables = []
pk_groups = gen_pk_groups(args, tables[0].partition_columns)
for table in tables:
# if len(table.partition_columns) ==0:
# continue
all_columns = table.get_all_columns()
data = gen_simple_data(all_columns, args, window_defs,
index_column=table.id_column,
partition_columns=table.partition_columns,
order_columns=table.order_columns,
pk_groups=pk_groups)
input_table = {
"columns": ["%s %s" % (c.name, c.dtype) for c in all_columns],
"indexs": ["index%d:%s:%s" % (
i,
index.partition_column,
index.order_column) for i,index in enumerate(table.indexs)],
"rows": data
}
input_tables.append(input_table)
sql_case = {
"id": 0,
"desc": "single_window_test_" + test_name,
"sql": sql_string,
"expect": {"success": True, "order": "id"},
"inputs": input_tables
}
yaml_obj = {
"db": "test_db",
"cases": [sql_case]
}
return yaml_obj
| 38.041667
| 77
| 0.617047
| 1,264
| 10,043
| 4.60443
| 0.130538
| 0.041753
| 0.03866
| 0.051375
| 0.765464
| 0.755498
| 0.709107
| 0.709107
| 0.692612
| 0.684364
| 0
| 0.005534
| 0.280295
| 10,043
| 263
| 78
| 38.186312
| 0.799668
| 0.207508
| 0
| 0.742268
| 0
| 0
| 0.05834
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.020619
| false
| 0
| 0.046392
| 0
| 0.087629
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 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
| 5
|
31fdf50a42e930f75ad1b12a10594898c81a53a7
| 458
|
py
|
Python
|
src/Role/InterfaceAdapters/IRoleRepository.py
|
DigiChanges/python-experience
|
3332d2c4d922a5eb302fa151582a4f63c668a570
|
[
"MIT"
] | null | null | null |
src/Role/InterfaceAdapters/IRoleRepository.py
|
DigiChanges/python-experience
|
3332d2c4d922a5eb302fa151582a4f63c668a570
|
[
"MIT"
] | null | null | null |
src/Role/InterfaceAdapters/IRoleRepository.py
|
DigiChanges/python-experience
|
3332d2c4d922a5eb302fa151582a4f63c668a570
|
[
"MIT"
] | null | null | null |
from abc import ABC, abstractmethod
from src.Role.Domain.Entities.Role import Role
from src.Shared.InterfaceAdapters.ICriteria import ICriteria
class IRoleRepository(ABC):
@abstractmethod
def save(self, element) -> Role:
pass
@abstractmethod
def getOne(self, id: str) -> Role:
pass
@abstractmethod
def list(self, criteria: ICriteria):
pass
@abstractmethod
def delete(self, id: str):
pass
| 19.913043
| 60
| 0.672489
| 52
| 458
| 5.923077
| 0.461538
| 0.220779
| 0.204545
| 0.162338
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.244541
| 458
| 22
| 61
| 20.818182
| 0.890173
| 0
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0.25
| 0.1875
| 0
| 0.5
| 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
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
ee3cf3178d0cc09beb1d5bc8c9c32f919b014134
| 225
|
py
|
Python
|
Chapter17/read_csv_dataframe.py
|
add54/ADMIN_SYS_PYTHON
|
5a6d9705537c8663c8f7b0f45d29ccc87b6096e7
|
[
"MIT"
] | 116
|
2018-12-21T01:05:47.000Z
|
2022-03-23T21:41:41.000Z
|
Chapter17/read_csv_dataframe.py
|
add54/ADMIN_SYS_PYTHON
|
5a6d9705537c8663c8f7b0f45d29ccc87b6096e7
|
[
"MIT"
] | 2
|
2021-03-31T19:36:19.000Z
|
2021-06-10T22:29:26.000Z
|
Chapter17/read_csv_dataframe.py
|
add54/ADMIN_SYS_PYTHON
|
5a6d9705537c8663c8f7b0f45d29ccc87b6096e7
|
[
"MIT"
] | 147
|
2018-12-19T14:10:32.000Z
|
2022-03-20T11:03:20.000Z
|
import pandas as pd
file_name = 'employee.csv'
df = pd.read_csv(file_name)
print(df)
print('-----------------------------------------')
print(df.head(3))
print('-----------------------------------------')
print(df.tail(1))
| 20.454545
| 50
| 0.435556
| 26
| 225
| 3.653846
| 0.576923
| 0.221053
| 0.252632
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.009615
| 0.075556
| 225
| 10
| 51
| 22.5
| 0.447115
| 0
| 0
| 0.25
| 0
| 0
| 0.417778
| 0.364444
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.125
| 0
| 0.125
| 0.625
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
ee6670035e48dcef8176b38aa2fbfbc7f48a3f3d
| 26
|
py
|
Python
|
slayer/io/__init__.py
|
ajduberstein/slayer
|
e4f2b6e0277ac38fe71ec99eaf3ee4769057b0ea
|
[
"MIT"
] | 2
|
2019-02-26T23:55:06.000Z
|
2019-02-26T23:56:09.000Z
|
slayer/io/__init__.py
|
ajduberstein/slayer
|
e4f2b6e0277ac38fe71ec99eaf3ee4769057b0ea
|
[
"MIT"
] | 1
|
2019-02-10T07:00:39.000Z
|
2019-02-10T07:00:39.000Z
|
slayer/io/__init__.py
|
ajduberstein/slayer
|
e4f2b6e0277ac38fe71ec99eaf3ee4769057b0ea
|
[
"MIT"
] | null | null | null |
from .io import * # noqa
| 13
| 25
| 0.615385
| 4
| 26
| 4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.269231
| 26
| 1
| 26
| 26
| 0.842105
| 0.153846
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
ee762b94df4666adedc668fedab318330a2ae4f9
| 277
|
py
|
Python
|
Hello_Python/practice 3-4.py
|
JaydenYL/Projects
|
b51c0476f7be80f0b0d6aa84592966ecb4343d76
|
[
"MIT"
] | 5
|
2021-09-06T04:27:56.000Z
|
2021-12-14T14:50:27.000Z
|
Hello_Python/practice 3-4.py
|
JaydenYL/Projects
|
b51c0476f7be80f0b0d6aa84592966ecb4343d76
|
[
"MIT"
] | null | null | null |
Hello_Python/practice 3-4.py
|
JaydenYL/Projects
|
b51c0476f7be80f0b0d6aa84592966ecb4343d76
|
[
"MIT"
] | null | null | null |
honored_guest = ['YULIU', 'Jim', 'Shi']
print(honored_guest[0] + ' and ' + honored_guest[1] + ' and ' + honored_guest[2] + ' ' + "eat dinner")
print("Shi cannot come here to eat dinner")
honored_guest.sort()
print(honored_guest)
honored_guest.remove('Shi')
print(honored_guest)
| 39.571429
| 102
| 0.700361
| 40
| 277
| 4.65
| 0.45
| 0.516129
| 0.274194
| 0.215054
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.012346
| 0.122744
| 277
| 7
| 103
| 39.571429
| 0.753086
| 0
| 0
| 0.285714
| 0
| 0
| 0.248201
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.571429
| 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
| 1
|
0
| 5
|
ee88db3fbd566a251d942c86db27dd0da28e16c0
| 214
|
py
|
Python
|
src/cv_datalib/export.py
|
kubic71/cv-datalib
|
a598d4a3e617640a41fb0fac446ac9af5b2b014b
|
[
"MIT"
] | null | null | null |
src/cv_datalib/export.py
|
kubic71/cv-datalib
|
a598d4a3e617640a41fb0fac446ac9af5b2b014b
|
[
"MIT"
] | null | null | null |
src/cv_datalib/export.py
|
kubic71/cv-datalib
|
a598d4a3e617640a41fb0fac446ac9af5b2b014b
|
[
"MIT"
] | null | null | null |
from .dataset import Dataset
class Exporter:
def __init__(self) -> None:
pass
def export(self, dataset: Dataset) -> None:
print(f"Exporting {dataset}")
print("Not implemented yet")
| 23.777778
| 47
| 0.630841
| 25
| 214
| 5.24
| 0.68
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.257009
| 214
| 9
| 48
| 23.777778
| 0.823899
| 0
| 0
| 0
| 0
| 0
| 0.176744
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0.142857
| 0.142857
| 0
| 0.571429
| 0.285714
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 5
|
c9c99451b5404ba62f48528191a8cb997fb83242
| 265
|
py
|
Python
|
fThrowLastError.py
|
SkyLined/mWindowsAPI
|
d64d57bbf87d2a7b33cf7de89263553793484a84
|
[
"CC-BY-4.0"
] | 7
|
2017-10-09T14:32:22.000Z
|
2021-01-30T07:25:50.000Z
|
fThrowLastError.py
|
SkyLined/mWindowsAPI
|
d64d57bbf87d2a7b33cf7de89263553793484a84
|
[
"CC-BY-4.0"
] | 2
|
2017-12-12T02:53:18.000Z
|
2019-02-19T09:23:18.000Z
|
fThrowLastError.py
|
SkyLined/mWindowsAPI
|
d64d57bbf87d2a7b33cf7de89263553793484a84
|
[
"CC-BY-4.0"
] | 1
|
2017-12-12T02:42:18.000Z
|
2017-12-12T02:42:18.000Z
|
from mWindowsSDK import *;
from .fThrowWin32Error import fThrowWin32Error;
def fThrowLastError(sFailedOperation):
oKernel32 = foLoadKernel32DLL();
odwLastError = oKernel32.GetLastError();
return fThrowWin32Error(sFailedOperation, odwLastError.fuGetValue());
| 33.125
| 71
| 0.815094
| 20
| 265
| 10.8
| 0.65
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.050209
| 0.098113
| 265
| 7
| 72
| 37.857143
| 0.853556
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
a00dc3a4ffa03cc85e22569490e6ba82a0457eb7
| 46
|
py
|
Python
|
simopt/test/__init__.py
|
simopt-admin/simopt
|
5119c605305699dce9e0c44e0b8b68e23e77c02f
|
[
"MIT"
] | 24
|
2020-01-06T17:21:10.000Z
|
2022-03-08T16:36:29.000Z
|
simopt/test/__init__.py
|
simopt-admin/simopt
|
5119c605305699dce9e0c44e0b8b68e23e77c02f
|
[
"MIT"
] | 4
|
2020-02-20T18:59:41.000Z
|
2020-10-18T22:28:29.000Z
|
simopt/test/__init__.py
|
simopt-admin/simopt
|
5119c605305699dce9e0c44e0b8b68e23e77c02f
|
[
"MIT"
] | 8
|
2020-02-13T18:37:48.000Z
|
2021-12-15T08:27:33.000Z
|
# from . import test_matmodops, test_mrg32k3a
| 23
| 45
| 0.804348
| 6
| 46
| 5.833333
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.075
| 0.130435
| 46
| 1
| 46
| 46
| 0.8
| 0.934783
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
a015c06baa00919e4d9222d4750ce36fd9eaeab0
| 27
|
py
|
Python
|
JDjango/frames/sqliteFrame/__init__.py
|
JIYANG-PLUS/JDjango
|
57cbb13b2b4c07f34d546c0c637c22f60c1e692a
|
[
"MIT"
] | 3
|
2020-12-28T05:09:02.000Z
|
2021-06-23T10:02:03.000Z
|
JDjango/frames/sqliteFrame/__init__.py
|
JIYANG-PLUS/JDjango
|
57cbb13b2b4c07f34d546c0c637c22f60c1e692a
|
[
"MIT"
] | null | null | null |
JDjango/frames/sqliteFrame/__init__.py
|
JIYANG-PLUS/JDjango
|
57cbb13b2b4c07f34d546c0c637c22f60c1e692a
|
[
"MIT"
] | null | null | null |
from .sqliteFrame import *
| 13.5
| 26
| 0.777778
| 3
| 27
| 7
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.148148
| 27
| 1
| 27
| 27
| 0.913043
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
a0204b300ecf9aae30bccdf6ffc012340facda5c
| 30
|
py
|
Python
|
checker/sloc/__init__.py
|
fausecteam/faustctf-2019-sloc
|
184201db8fbc8959dd2069fc4fbdacf144ac3826
|
[
"0BSD"
] | null | null | null |
checker/sloc/__init__.py
|
fausecteam/faustctf-2019-sloc
|
184201db8fbc8959dd2069fc4fbdacf144ac3826
|
[
"0BSD"
] | null | null | null |
checker/sloc/__init__.py
|
fausecteam/faustctf-2019-sloc
|
184201db8fbc8959dd2069fc4fbdacf144ac3826
|
[
"0BSD"
] | null | null | null |
from .sloc import SlocChecker
| 15
| 29
| 0.833333
| 4
| 30
| 6.25
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.133333
| 30
| 1
| 30
| 30
| 0.961538
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
4e4ec812ebc198748739698e309e0b76ccb22091
| 4,227
|
py
|
Python
|
utils/tests/test_builder.py
|
LaudateCorpus1/redis-benchmarks-specification
|
71a7e28cd130499f02dacc00bdeca2eadfa62619
|
[
"Apache-2.0"
] | 4
|
2022-01-24T10:15:55.000Z
|
2022-03-15T09:40:16.000Z
|
utils/tests/test_builder.py
|
LaudateCorpus1/redis-benchmarks-specification
|
71a7e28cd130499f02dacc00bdeca2eadfa62619
|
[
"Apache-2.0"
] | 27
|
2021-08-13T14:20:36.000Z
|
2021-09-21T16:49:40.000Z
|
utils/tests/test_builder.py
|
LaudateCorpus1/redis-benchmarks-specification
|
71a7e28cd130499f02dacc00bdeca2eadfa62619
|
[
"Apache-2.0"
] | 1
|
2022-02-02T14:07:55.000Z
|
2022-02-02T14:07:55.000Z
|
# Apache License Version 2.0
#
# Copyright (c) 2021., Redis Labs
# All rights reserved.
#
import os
from redis_benchmarks_specification.__common__.builder_schema import (
commit_schema_to_stream,
)
import redis
from redis_benchmarks_specification.__builder__.builder import (
builder_consumer_group_create,
builder_process_stream,
build_spec_image_prefetch,
)
from redis_benchmarks_specification.__common__.env import (
STREAM_KEYNAME_GH_EVENTS_COMMIT,
STREAM_KEYNAME_NEW_BUILD_EVENTS,
)
def test_build_spec_image_prefetch():
builders_folder = "./redis_benchmarks_specification/setups/builders"
different_build_specs = ["gcc:8.5.0-amd64-debian-buster-default.yml"]
prefetched_images, total_fetched = build_spec_image_prefetch(
builders_folder, different_build_specs
)
assert total_fetched == 0 or total_fetched == 1
assert "gcc:8.5.0-buster" in prefetched_images
for x in range(0, 100):
prefetched_images, total_fetched = build_spec_image_prefetch(
builders_folder, different_build_specs
)
assert total_fetched == 0
def test_commit_schema_to_stream_then_build():
try:
run_builder = True
TST_BUILDER_X = os.getenv("TST_BUILDER_X", "1")
if TST_BUILDER_X == "0":
run_builder = False
if run_builder:
conn = redis.StrictRedis(port=16379)
conn.ping()
conn.flushall()
builder_consumer_group_create(conn, "0")
assert conn.xlen(STREAM_KEYNAME_GH_EVENTS_COMMIT) == 0
result, reply_fields, error_msg = commit_schema_to_stream(
{
"git_hash": "0cf2df84d4b27af4bffd2bf3543838f09e10f874",
"git_branch": "unstable",
},
conn,
"redis",
"redis",
)
assert result == True
assert error_msg == None
assert STREAM_KEYNAME_GH_EVENTS_COMMIT.encode() in conn.keys()
assert conn.xlen(STREAM_KEYNAME_GH_EVENTS_COMMIT) == 1
assert "id" in reply_fields
builders_folder = "./redis_benchmarks_specification/setups/builders"
different_build_specs = ["gcc:8.5.0-amd64-debian-buster-default.yml"]
previous_id = ">"
previous_id, new_builds_count = builder_process_stream(
builders_folder, conn, different_build_specs, previous_id
)
assert new_builds_count == 1
assert conn.exists(STREAM_KEYNAME_NEW_BUILD_EVENTS)
conn.save()
except redis.exceptions.ConnectionError:
pass
def test_commit_schema_to_stream_then_build_historical_redis():
try:
run_builder = True
TST_BUILDER_X = os.getenv("TST_BUILDER_X", "1")
if TST_BUILDER_X == "0":
run_builder = False
if run_builder:
conn = redis.StrictRedis(port=16379)
conn.ping()
conn.flushall()
builder_consumer_group_create(conn, "0")
assert conn.xlen(STREAM_KEYNAME_GH_EVENTS_COMMIT) == 0
result, reply_fields, error_msg = commit_schema_to_stream(
{
"git_hash": "021af7629590c638ae0d4867d4b397f6e0c38ec8",
"git_version": "5.0.13",
},
conn,
"redis",
"redis",
)
assert result == True
assert error_msg == None
assert STREAM_KEYNAME_GH_EVENTS_COMMIT.encode() in conn.keys()
assert conn.xlen(STREAM_KEYNAME_GH_EVENTS_COMMIT) == 1
assert "id" in reply_fields
builders_folder = "./redis_benchmarks_specification/setups/builders"
different_build_specs = ["gcc:8.5.0-amd64-debian-buster-default.yml"]
previous_id = ">"
previous_id, new_builds_count = builder_process_stream(
builders_folder, conn, different_build_specs, previous_id
)
assert new_builds_count == 1
assert conn.exists(STREAM_KEYNAME_NEW_BUILD_EVENTS)
except redis.exceptions.ConnectionError:
pass
| 35.822034
| 81
| 0.627632
| 468
| 4,227
| 5.264957
| 0.224359
| 0.05276
| 0.042614
| 0.059659
| 0.814935
| 0.729708
| 0.720779
| 0.720779
| 0.691558
| 0.691558
| 0
| 0.035834
| 0.293589
| 4,227
| 117
| 82
| 36.128205
| 0.78935
| 0.019163
| 0
| 0.64
| 0
| 0
| 0.114037
| 0.083837
| 0
| 0
| 0
| 0
| 0.19
| 1
| 0.03
| false
| 0.02
| 0.05
| 0
| 0.08
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
4e67025d7089003fd1b678524b17393b4641bc25
| 217
|
py
|
Python
|
datasets/hscic/__init__.py
|
nhsengland/publish-o-matic
|
dc8f16cb83a2360989afa44d887e63b5cde6af29
|
[
"MIT"
] | null | null | null |
datasets/hscic/__init__.py
|
nhsengland/publish-o-matic
|
dc8f16cb83a2360989afa44d887e63b5cde6af29
|
[
"MIT"
] | 11
|
2015-03-02T16:30:20.000Z
|
2016-11-29T12:16:15.000Z
|
datasets/hscic/__init__.py
|
nhsengland/publish-o-matic
|
dc8f16cb83a2360989afa44d887e63b5cde6af29
|
[
"MIT"
] | 2
|
2020-12-25T20:38:31.000Z
|
2021-04-11T07:35:01.000Z
|
from load import load
from transform import transform
from scrape import main as main_scrape
def entrypoints():
return {
'scrape': main_scrape,
'transform': transform,
'load': load
}
| 18.083333
| 38
| 0.654378
| 25
| 217
| 5.6
| 0.4
| 0.142857
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.271889
| 217
| 12
| 39
| 18.083333
| 0.886076
| 0
| 0
| 0
| 0
| 0
| 0.087963
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.111111
| true
| 0
| 0.333333
| 0.111111
| 0.555556
| 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
| 1
| 1
| 0
|
0
| 5
|
4e67b0d937ef3baa4dbf5ff770068bc0d6f669e8
| 62
|
py
|
Python
|
kipoi/data_utils.py
|
bfclarke/kipoi
|
992b41eee8e35b39ae61262d988db974d8583759
|
[
"MIT"
] | 213
|
2018-03-13T17:25:32.000Z
|
2022-03-07T15:29:29.000Z
|
kipoi/data_utils.py
|
bfclarke/kipoi
|
992b41eee8e35b39ae61262d988db974d8583759
|
[
"MIT"
] | 317
|
2018-03-14T11:03:57.000Z
|
2022-03-31T17:48:54.000Z
|
kipoi/data_utils.py
|
bfclarke/kipoi
|
992b41eee8e35b39ae61262d988db974d8583759
|
[
"MIT"
] | 44
|
2018-03-13T17:44:34.000Z
|
2022-01-10T08:14:49.000Z
|
from kipoi_utils.data_utils import * # backward compatibility
| 62
| 62
| 0.83871
| 8
| 62
| 6.25
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.112903
| 62
| 1
| 62
| 62
| 0.909091
| 0.354839
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
4e9f7230f39a7d870b44ea0e4f5ad2c8b7369bbe
| 155
|
py
|
Python
|
events/admin.py
|
ayushganguli1769/DevelopmentRobotix
|
1692c104a6f220aa1238840b791aa857a6cc7765
|
[
"Apache-2.0"
] | null | null | null |
events/admin.py
|
ayushganguli1769/DevelopmentRobotix
|
1692c104a6f220aa1238840b791aa857a6cc7765
|
[
"Apache-2.0"
] | 7
|
2020-02-12T02:54:35.000Z
|
2022-03-12T00:06:26.000Z
|
events/admin.py
|
ayushganguli1769/DevelopmentRobotix
|
1692c104a6f220aa1238840b791aa857a6cc7765
|
[
"Apache-2.0"
] | 6
|
2020-02-10T16:37:38.000Z
|
2021-01-28T13:39:46.000Z
|
from django.contrib import admin
from . models import Event,Workshop
# Register your models here.
admin.site.register(Event)
admin.site.register(Workshop)
| 25.833333
| 35
| 0.812903
| 22
| 155
| 5.727273
| 0.545455
| 0.142857
| 0.269841
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.103226
| 155
| 5
| 36
| 31
| 0.906475
| 0.167742
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
4ebad0591fbf97ef366b7e30c3366b3d961fc5cf
| 374
|
py
|
Python
|
test/helpers/test_Logger.py
|
anoburn/mspypeline
|
b815ea7ebe4c99696a5867f6fad7ae189fcca20d
|
[
"MIT"
] | 3
|
2021-07-17T21:54:22.000Z
|
2021-11-07T09:56:19.000Z
|
test/helpers/test_Logger.py
|
anoburn/mspypeline
|
b815ea7ebe4c99696a5867f6fad7ae189fcca20d
|
[
"MIT"
] | 7
|
2020-06-05T14:50:09.000Z
|
2021-08-19T08:54:40.000Z
|
test/helpers/test_Logger.py
|
anoburn/mspypeline
|
b815ea7ebe4c99696a5867f6fad7ae189fcca20d
|
[
"MIT"
] | 6
|
2020-08-13T14:22:43.000Z
|
2022-02-11T10:34:03.000Z
|
def test_logger():
import pytest
from mspypeline.helpers import get_logger
from logging import Logger
assert isinstance(get_logger("test", "warning"), Logger)
assert isinstance(get_logger(loglevel=10), Logger)
with pytest.warns(RuntimeWarning) as record:
assert isinstance(get_logger(loglevel="asd"), Logger)
assert len(record) == 1
| 34
| 61
| 0.713904
| 46
| 374
| 5.695652
| 0.5
| 0.137405
| 0.217557
| 0.28626
| 0.39313
| 0
| 0
| 0
| 0
| 0
| 0
| 0.009901
| 0.18984
| 374
| 10
| 62
| 37.4
| 0.854785
| 0
| 0
| 0
| 0
| 0
| 0.037433
| 0
| 0
| 0
| 0
| 0
| 0.444444
| 1
| 0.111111
| true
| 0
| 0.333333
| 0
| 0.444444
| 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
| 1
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
4ecff7689835b27f683088c0e5329c2f94f778fa
| 122
|
py
|
Python
|
iktomi/forms/__init__.py
|
boltnev/iktomi
|
bc92006c026f9b42e56f1af5ced2fe577673a486
|
[
"MIT"
] | 14
|
2015-02-15T05:24:22.000Z
|
2020-03-19T10:07:28.000Z
|
iktomi/forms/__init__.py
|
boltnev/iktomi
|
bc92006c026f9b42e56f1af5ced2fe577673a486
|
[
"MIT"
] | 10
|
2015-04-04T10:10:41.000Z
|
2016-06-01T13:17:58.000Z
|
iktomi/forms/__init__.py
|
boltnev/iktomi
|
bc92006c026f9b42e56f1af5ced2fe577673a486
|
[
"MIT"
] | 5
|
2015-02-20T11:18:58.000Z
|
2016-10-18T15:30:13.000Z
|
from . import convs, widgets
from .fields import Field, FieldSet, FieldList, FileField, FieldBlock
from .form import Form
| 30.5
| 69
| 0.795082
| 16
| 122
| 6.0625
| 0.6875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.139344
| 122
| 3
| 70
| 40.666667
| 0.92381
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
14e4070263f0b2e9bb55faf43274b357da871584
| 144
|
py
|
Python
|
test/jobs/cancel/cancel.py
|
dsi-icl/eae-compute
|
78ffa23b59ec77fb249f5deb465a6f735b4e5a4b
|
[
"MIT"
] | 1
|
2017-09-06T15:32:53.000Z
|
2017-09-06T15:32:53.000Z
|
packages/eae-compute/test/jobs/cancel/cancel.py
|
dsi-icl/eae
|
fdc69b8ef0238f2d5275833a8d09cc89f396f2e4
|
[
"MIT"
] | 170
|
2019-05-09T07:53:15.000Z
|
2021-09-03T08:30:45.000Z
|
test/jobs/cancel/cancel.py
|
dsi-icl/eae-compute
|
78ffa23b59ec77fb249f5deb465a6f735b4e5a4b
|
[
"MIT"
] | 5
|
2017-11-14T14:53:22.000Z
|
2019-03-12T16:22:55.000Z
|
#!python
import time
print('Sleeping for 60 seconds')
time.sleep(60)
print('Timeout, this job should have been cancelled within 60 seconds !')
| 20.571429
| 73
| 0.756944
| 22
| 144
| 4.954545
| 0.772727
| 0.165138
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.048387
| 0.138889
| 144
| 6
| 74
| 24
| 0.830645
| 0.048611
| 0
| 0
| 0
| 0
| 0.639706
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.25
| 0
| 0.25
| 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
091685a22e2a6e66aaf796fa89eeded278fc96fc
| 125
|
py
|
Python
|
den/parser/den_ast/node.py
|
MonliH/Den
|
9c2e69744dcf26ae01154eac32aa4ea8ff2adee3
|
[
"MIT"
] | null | null | null |
den/parser/den_ast/node.py
|
MonliH/Den
|
9c2e69744dcf26ae01154eac32aa4ea8ff2adee3
|
[
"MIT"
] | null | null | null |
den/parser/den_ast/node.py
|
MonliH/Den
|
9c2e69744dcf26ae01154eac32aa4ea8ff2adee3
|
[
"MIT"
] | null | null | null |
# Base node class
class Node:
"""Master node class."""
def __str__(self):
return f"{type(self).__name__}"
| 13.888889
| 39
| 0.592
| 16
| 125
| 4.125
| 0.6875
| 0.272727
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.256
| 125
| 8
| 40
| 15.625
| 0.709677
| 0.28
| 0
| 0
| 0
| 0
| 0.25
| 0.25
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0.333333
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 5
|
09330a67f2bed7c5d937bc72b5d3dcd422870df4
| 18,426
|
py
|
Python
|
load.py
|
ZTiKnl/IDA-BGS
|
f1fdd73601b6ff1159d9b5f9d7cf3f7e916ab4fe
|
[
"MIT"
] | 1
|
2020-02-06T05:15:03.000Z
|
2020-02-06T05:15:03.000Z
|
load.py
|
ZTiKnl/IDA-BGS
|
f1fdd73601b6ff1159d9b5f9d7cf3f7e916ab4fe
|
[
"MIT"
] | null | null | null |
load.py
|
ZTiKnl/IDA-BGS
|
f1fdd73601b6ff1159d9b5f9d7cf3f7e916ab4fe
|
[
"MIT"
] | 1
|
2020-06-27T20:36:53.000Z
|
2020-06-27T20:36:53.000Z
|
import sys
import json
import requests
import threading
try:
import Tkinter as tk # this is for python2
except:
import tkinter as tk # this is for python3
from ttkHyperlinkLabel import HyperlinkLabel
import myNotebook as nb
from config import config
this = sys.modules[__name__]
def plugin_start3(plugin_dir):
return plugin_start(plugin_dir)
def plugin_start(plugin_dir):
"""
Load this plugin into EDMC
"""
print("IDA-BGS loaded! My plugin folder is " + format(plugin_dir))
return "IDA-BGS"
def plugin_stop():
"""
EDMC is closing
"""
print("Closing down")
def plugin_prefs(parent, cmdr, is_beta):
"""
Return a TK Frame for adding to the EDMC settings dialog.
"""
this.apikey = tk.StringVar(value=config.get("APIkey"))
this.approvedatatransfer = tk.IntVar(value=config.getint("ADT"))
frame = nb.Frame(parent)
plugin_label = nb.Label(frame, text="IDA-BGS EDMC plugin v0.66")
plugin_label.grid(padx=10, row=0, column=0, sticky=tk.W)
HyperlinkLabel(frame, text='Visit website', background=nb.Label().cget('background'), url='https://github.com/ZTiKnl/IDA-BGS', underline=True).grid(padx=10, row=0, column=1, sticky=tk.W)
empty_label = nb.Label(frame, text="")
empty_label.grid(padx=10, row=1, column=0, columnspan=2, sticky=tk.W)
apikey_label = nb.Label(frame, text="Enter your API key to authorize data transfers")
apikey_label.grid(padx=10, row=2, column=0, sticky=tk.W)
apikey_entry = nb.Entry(frame, textvariable=this.apikey)
apikey_entry.grid(padx=10, row=2, column=1, sticky=tk.EW)
data_label = nb.Label(frame, text="Each data package is between 1KB - 5KB, only 1 data package is sent per FSD jump")
data_label.grid(padx=20, row=3, column=0, columnspan=2, sticky=tk.W)
data_label = nb.Label(frame, text="The only data sent is BGS faction data along with basic system details and a timestamp")
data_label.grid(padx=20, row=4, column=0, columnspan=2, sticky=tk.W)
data_label = nb.Label(frame, text="It also sends data about systems where IDA does NOT have a presence, but this data is ignored by the API")
data_label.grid(padx=20, row=5, column=0, columnspan=2, sticky=tk.W)
empty_label = nb.Label(frame, text="")
empty_label.grid(padx=10, row=6, column=0, columnspan=2, sticky=tk.W)
optin_entry = nb.Checkbutton(frame, text=_('Send additional data'), variable=this.approvedatatransfer)
optin_entry.grid(padx=10, row=7, column=0, columnspan=2, sticky=tk.EW)
data_label = nb.Label(frame, text="Each data package is between 2KB - 10KB, 1 data package is sent per event")
data_label.grid(padx=20, row=8, column=0, columnspan=2, sticky=tk.W)
events_label = nb.Label(frame, text="Events that are processed:")
events_label.grid(padx=20, row=9, column=0, columnspan=2, sticky=tk.W)
events_label = nb.Label(frame, text="Mission Completed")
events_label.grid(padx=30, row=10, column=0, columnspan=2, sticky=tk.W)
events_label = nb.Label(frame, text="Sell Exploration Data")
events_label.grid(padx=30, row=11, column=0, columnspan=2, sticky=tk.W)
events_label = nb.Label(frame, text="Cash in Bounty Voucher")
events_label.grid(padx=30, row=12, column=0, columnspan=2, sticky=tk.W)
events_label = nb.Label(frame, text="Sell Cargo on Market")
events_label.grid(padx=30, row=13, column=0, columnspan=2, sticky=tk.W)
empty_label = nb.Label(frame, text="")
empty_label.grid(padx=10, row=14, column=0, columnspan=2, sticky=tk.W)
thirdparty_label = nb.Label(frame, text="No data will be sold to third parties, and there are no tracking mechanisms trying to follow you")
thirdparty_label.grid(padx=10, row=15, column=0, columnspan=2, sticky=tk.W)
return frame
def prefs_changed(cmdr, is_beta):
"""
Save settings.
"""
config.set('APIkey', this.apikey.get())
config.set('ADT', this.approvedatatransfer.get())
def plugin_app(parent):
"""
Create a pair of TK widgets for the EDMC main window
"""
label = tk.Label(parent, text="IDA BGS:")
this.status = tk.Label(parent, text="Idle", anchor="w")
return (label, this.status)
def journal_entry(cmdr, is_beta, system, station, entry, state):
"""
Evaluate data and transfer to https://ida-bgs.ztik.nl/api/input
"""
if entry['event'] == 'FSDJump':
# We arrived at a new system!
sys.stderr.write("Arrived at {}, sending data to server\n".format(entry['StarSystem']))
this.apikey = tk.StringVar(value=config.get("APIkey"))
entry['key'] = this.apikey.get()
entry['JumpDist'] = ''
entry['FuelLevel'] = ''
entry['BodyID'] = ''
entry['Body'] = ''
entry['BodyType'] = ''
entry['FuelUsed'] = ''
this.status['text'] = "Sending BGS data..."
url = "https://ida-bgs.ztik.nl/api/input"
r = requests.post(url, json=entry)
if r.status_code == 200:
sys.stderr.write("Status: 200\n")
this.status['text'] = "Success: BGS data sent"
t = threading.Timer(5.0, clearstatus)
else:
if r.status_code == 201:
sys.stderr.write("Status: 201\n")
this.status['text'] = "Success: BGS data n/a"
t = threading.Timer(5.0, clearstatus)
else:
if r.status_code == 202:
sys.stderr.write("Status: 202\n")
this.status['text'] = "Success: API not ready"
t = threading.Timer(5.0, clearstatus)
else:
data = json.loads(r.text)
sys.stderr.write("Status BGS: " + str(r.status_code) + ": " + str(data['message']) + "\n")
sys.stderr.write("Error BGS: " + str(data['error']) + "\n")
this.status['text'] = "Fail: " + str(r.status_code) + ": " + str(data['message'])
t = threading.Timer(10.0, clearstatus)
t.start()
if entry['event'] == 'Docked':
# We arrived at a new system!
sys.stderr.write("Arrived at {}, sending data to server\n".format(entry['StarSystem']))
this.apikey = tk.StringVar(value=config.get("APIkey"))
entry['key'] = this.apikey.get()
this.status['text'] = "Sending BGS data..."
url = "https://ida-bgs.ztik.nl/api/input"
r = requests.post(url, json=entry)
if r.status_code == 200:
sys.stderr.write("Status: 200\n")
this.status['text'] = "Success: BGS data sent"
t = threading.Timer(5.0, clearstatus)
else:
if r.status_code == 201:
sys.stderr.write("Status: 201\n")
this.status['text'] = "Success: BGS data n/a"
t = threading.Timer(5.0, clearstatus)
else:
if r.status_code == 202:
sys.stderr.write("Status: 202\n")
this.status['text'] = "Success: API not ready"
t = threading.Timer(5.0, clearstatus)
else:
data = json.loads(r.text)
sys.stderr.write("Status BGS: " + str(r.status_code) + ": " + str(data['message']) + "\n")
sys.stderr.write("Error BGS: " + str(data['error']) + "\n")
this.status['text'] = "Fail: " + str(r.status_code) + ": " + str(data['message'])
t = threading.Timer(10.0, clearstatus)
t.start()
elif entry['event'] == 'MissionCompleted':
this.approvedatatransfer = tk.IntVar(value=config.getint("ADT"))
if this.approvedatatransfer.get() == 1:
# We completed a mission!
this.apikey = tk.StringVar(value=config.get("APIkey"))
entry['key'] = this.apikey.get()
entry['Commodity'] = ''
entry['Count'] = ''
entry['Reward'] = ''
entry['Donation'] = ''
entry['Donated'] = ''
entry['PermitsAwarded'] = ''
entry['CommodityReward'] = ''
entry['MaterialsReward'] = ''
this.status['text'] = "Sending MSSN data..."
url = "https://ida-bgs.ztik.nl/api/input"
r = requests.post(url, json=entry)
if r.status_code == 200:
sys.stderr.write("Status: 200\n")
this.status['text'] = "Success: MSSN data sent"
t = threading.Timer(5.0, clearstatus)
else:
if r.status_code == 201:
sys.stderr.write("Status: 201\n")
this.status['text'] = "Success: MSSN data n/a"
t = threading.Timer(5.0, clearstatus)
else:
if r.status_code == 202:
sys.stderr.write("Status: 202\n")
this.status['text'] = "Success: API not ready"
t = threading.Timer(5.0, clearstatus)
else:
data = json.loads(r.text)
sys.stderr.write("Status MSSN: " + str(r.status_code) + ": " + str(data['message']) + "\n")
sys.stderr.write("Error MSSN: " + str(data['error']) + "\n")
this.status['text'] = "Fail: " + str(r.status_code) + ": " + str(data['message'])
t = threading.Timer(10.0, clearstatus)
t.start()
elif entry['event'] == 'MultiSellExplorationData':
this.approvedatatransfer = tk.IntVar(value=config.getint("ADT"))
if this.approvedatatransfer.get() == 1:
# We sold a page of exploration data!
this.apikey = tk.StringVar(value=config.get("APIkey"))
entry['key'] = this.apikey.get()
entry['system'] = system
entry['station'] = station
this.status['text'] = "Sending EXPL data..."
url = "https://ida-bgs.ztik.nl/api/input"
r = requests.post(url, json=entry)
if r.status_code == 200:
sys.stderr.write("Status: 200\n")
this.status['text'] = "Success: EXPL data sent"
t = threading.Timer(5.0, clearstatus)
else:
if r.status_code == 201:
sys.stderr.write("Status: 201\n")
this.status['text'] = "Success: EXPL data n/a"
t = threading.Timer(5.0, clearstatus)
else:
if r.status_code == 202:
sys.stderr.write("Status: 202\n")
this.status['text'] = "Success: API not ready"
t = threading.Timer(5.0, clearstatus)
else:
data = json.loads(r.text)
sys.stderr.write("Status EXPL: " + str(r.status_code) + ": " + str(data['message']) + "\n")
sys.stderr.write("Error EXPL: " + str(data['error']) + "\n")
this.status['text'] = "Fail: " + str(r.status_code) + ": " + str(data['message'])
t = threading.Timer(10.0, clearstatus)
t.start()
elif entry['event'] == 'SellExplorationData':
this.approvedatatransfer = tk.IntVar(value=config.getint("ADT"))
if this.approvedatatransfer.get() == 1:
# We sold exploration data!
this.apikey = tk.StringVar(value=config.get("APIkey"))
entry['key'] = this.apikey.get()
entry['system'] = system
entry['station'] = station
this.status['text'] = "Sending EXPL data..."
url = "https://ida-bgs.ztik.nl/api/input"
r = requests.post(url, json=entry)
if r.status_code == 200:
sys.stderr.write("Status: 200\n")
this.status['text'] = "Success: EXPL data sent"
t = threading.Timer(5.0, clearstatus)
else:
if r.status_code == 201:
sys.stderr.write("Status: 201\n")
this.status['text'] = "Success: EXPL data n/a"
t = threading.Timer(5.0, clearstatus)
else:
if r.status_code == 202:
sys.stderr.write("Status: 202\n")
this.status['text'] = "Success: API not ready"
t = threading.Timer(5.0, clearstatus)
else:
data = json.loads(r.text)
sys.stderr.write("Status EXPL: " + str(r.status_code) + ": " + str(data['message']) + "\n")
sys.stderr.write("Error EXPL: " + str(data['error']) + "\n")
this.status['text'] = "Fail: " + str(r.status_code) + ": " + str(data['message'])
t = threading.Timer(10.0, clearstatus)
t.start()
elif entry['event'] == 'RedeemVoucher':
this.approvedatatransfer = tk.IntVar(value=config.getint("ADT"))
if this.approvedatatransfer.get() == 1:
# We redeemed bond/bounty voucher!
this.apikey = tk.StringVar(value=config.get("APIkey"))
entry['key'] = this.apikey.get()
entry['system'] = system
entry['station'] = station
if entry['Type'] == 'CombatBond':
statustext = 'BOND';
elif entry['Type'] == 'bounty':
statustext = 'BNTY'
else:
statustext = 'VCHR'
this.status['text'] = "Sending " + statustext +" data..."
url = "https://ida-bgs.ztik.nl/api/input"
r = requests.post(url, json=entry)
if r.status_code == 200:
sys.stderr.write("Status: 200\n")
this.status['text'] = "Success: " + statustext + " data sent"
t = threading.Timer(5.0, clearstatus)
else:
if r.status_code == 201:
sys.stderr.write("Status: 201\n")
this.status['text'] = "Success: " + statustext + " data n/a"
t = threading.Timer(5.0, clearstatus)
else:
if r.status_code == 202:
sys.stderr.write("Status: 202\n")
this.status['text'] = "Success: API not ready"
t = threading.Timer(5.0, clearstatus)
else:
data = json.loads(r.text)
sys.stderr.write("Status " + statustext + ": " + str(r.status_code) + ": " + str(data['message']) + "\n")
sys.stderr.write("Error " + statustext + ": " + str(data['error']) + "\n")
this.status['text'] = "Fail: " + str(r.status_code) + ": " + str(data['message'])
t = threading.Timer(10.0, clearstatus)
t.start()
elif entry['event'] == 'MarketSell':
this.approvedatatransfer = tk.IntVar(value=config.getint("ADT"))
if this.approvedatatransfer.get() == 1:
# We sold commodities!
this.apikey = tk.StringVar(value=config.get("APIkey"))
entry['key'] = this.apikey.get()
entry['system'] = system
entry['station'] = station
this.status['text'] = "Sending CRG data..."
url = "https://ida-bgs.ztik.nl/api/input"
r = requests.post(url, json=entry)
if r.status_code == 200:
sys.stderr.write("Status: 200\n")
this.status['text'] = "Success: CRG data sent"
t = threading.Timer(5.0, clearstatus)
else:
if r.status_code == 201:
sys.stderr.write("Status: 201\n")
this.status['text'] = "Success: CRG data n/a"
t = threading.Timer(5.0, clearstatus)
else:
if r.status_code == 202:
sys.stderr.write("Status: 202\n")
this.status['text'] = "Success: API not ready"
t = threading.Timer(5.0, clearstatus)
else:
data = json.loads(r.text)
sys.stderr.write("Status CRG: " + str(r.status_code) + ": " + str(data['message']) + "\n")
sys.stderr.write("Error CRG: " + str(data['error']) + "\n")
this.status['text'] = "Fail: " + str(r.status_code) + ": " + str(data['message'])
t = threading.Timer(10.0, clearstatus)
t.start()
elif entry['event'] == 'MarketBuy':
this.approvedatatransfer = tk.IntVar(value=config.getint("ADT"))
if this.approvedatatransfer.get() == 1:
# We bought commodities!
this.apikey = tk.StringVar(value=config.get("APIkey"))
entry['key'] = this.apikey.get()
entry['system'] = system
entry['station'] = station
this.status['text'] = "Sending CRG data..."
url = "https://ida-bgs.ztik.nl/api/input"
r = requests.post(url, json=entry)
if r.status_code == 200:
sys.stderr.write("Status: 200\n")
this.status['text'] = "Success: CRG data sent"
t = threading.Timer(5.0, clearstatus)
else:
if r.status_code == 201:
sys.stderr.write("Status: 201\n")
this.status['text'] = "Success: CRG data n/a"
t = threading.Timer(5.0, clearstatus)
else:
if r.status_code == 202:
sys.stderr.write("Status: 202\n")
this.status['text'] = "Success: API not ready"
t = threading.Timer(5.0, clearstatus)
else:
data = json.loads(r.text)
sys.stderr.write("Status CRG: " + str(r.status_code) + ": " + str(data['message']) + "\n")
sys.stderr.write("Error CRG: " + str(data['error']) + "\n")
this.status['text'] = "Fail: " + str(r.status_code) + ": " + str(data['message'])
t = threading.Timer(10.0, clearstatus)
t.start()
def clearstatus():
this.status['text'] = "Idle"
| 44.723301
| 190
| 0.52757
| 2,182
| 18,426
| 4.412007
| 0.12099
| 0.044666
| 0.061078
| 0.06648
| 0.783318
| 0.767529
| 0.733873
| 0.711748
| 0.702192
| 0.702192
| 0
| 0.02625
| 0.323944
| 18,426
| 412
| 191
| 44.723301
| 0.746568
| 0.026701
| 0
| 0.693009
| 0
| 0.00304
| 0.179254
| 0.001346
| 0
| 0
| 0
| 0
| 0
| 1
| 0.024316
| false
| 0
| 0.027356
| 0.00304
| 0.06383
| 0.006079
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
09479a79f91378a20e09ef428d9e5f7ed89cff27
| 60,646
|
py
|
Python
|
fusion_tcv/references.py
|
mkuiper/deepmind-research
|
1642ae3499c8d1135ec6fe620a68911091dd25ef
|
[
"Apache-2.0"
] | 2
|
2022-03-14T18:36:23.000Z
|
2022-03-14T22:35:20.000Z
|
fusion_tcv/references.py
|
sunjinhao123/deepmind-research
|
1642ae3499c8d1135ec6fe620a68911091dd25ef
|
[
"Apache-2.0"
] | null | null | null |
fusion_tcv/references.py
|
sunjinhao123/deepmind-research
|
1642ae3499c8d1135ec6fe620a68911091dd25ef
|
[
"Apache-2.0"
] | null | null | null |
# Copyright 2021 DeepMind Technologies Limited.
#
# 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.
"""References used in the experiments."""
from fusion_tcv import ref_gen
from fusion_tcv import shape
from fusion_tcv import shapes_known
from fusion_tcv import tcv_common
# pylint: disable=bad-whitespace
# Used in TCV#70915
def fundamental_capability() -> ref_gen.AbstractReferenceGenerator:
return ref_gen.ShapeFromShot([
# Start at the handover state and hold for ~50ms.
shape.ReferenceTimeSlice(
time=0.0872,
hold=0.15,
shape=shape.Shape(
ip=-110000,
params=shapes_known.SHAPE_70166_0872.params,
points=shapes_known.SHAPE_70166_0872.points,
limit_point=shapes_known.SHAPE_70166_0872.limit_point,
diverted=shape.Diverted.LIMITED,
),
),
# Ramp the Ip over 50ms then hold for 50ms.
shape.ReferenceTimeSlice(
time=0.2,
hold=0.25,
shape=shape.Shape(
ip=-150000,
params=shape.ParametrizedShape(
r0=0.8796,
z0=0.2339,
kappa=1.2441,
delta=0.2567,
radius=0.2390,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 20 points
shape.Point( 0.6299, 0.1413),
shape.Point( 0.6481, 0.0577),
shape.Point( 0.6804, -0.0087),
shape.Point( 0.7286, -0.0513),
shape.Point( 0.7931, -0.0660),
shape.Point( 0.8709, -0.0513),
shape.Point( 0.9543, -0.0087),
shape.Point( 1.0304, 0.0577),
shape.Point( 1.0844, 0.1413),
shape.Point( 1.1040, 0.2340),
shape.Point( 1.0844, 0.3267),
shape.Point( 1.0304, 0.4103),
shape.Point( 0.9543, 0.4767),
shape.Point( 0.8709, 0.5193),
shape.Point( 0.7931, 0.5340),
shape.Point( 0.7286, 0.5193),
shape.Point( 0.6804, 0.4767),
shape.Point( 0.6481, 0.4103),
shape.Point( 0.6299, 0.3267),
shape.Point( 0.6240, 0.2340),
],
limit_point=shape.Point( 0.6240, 0.2340),
diverted=shape.Diverted.LIMITED,
),
),
# Transform the shape to the DM handover shape and hold for 50ms.
shape.ReferenceTimeSlice(
time=0.3,
hold=0.35,
shape=shape.Shape(
ip=-150000,
params=shape.ParametrizedShape(
r0=0.8822,
z0=0.2340,
kappa=1.4396,
delta=0.2760,
radius=0.2388,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 20 points
shape.Point( 0.6299, 0.1265),
shape.Point( 0.6481, 0.0295),
shape.Point( 0.6804, -0.0475),
shape.Point( 0.7286, -0.0970),
shape.Point( 0.7931, -0.1140),
shape.Point( 0.8709, -0.0970),
shape.Point( 0.9543, -0.0475),
shape.Point( 1.0304, 0.0295),
shape.Point( 1.0844, 0.1265),
shape.Point( 1.1040, 0.2340),
shape.Point( 1.0844, 0.3415),
shape.Point( 1.0304, 0.4385),
shape.Point( 0.9543, 0.5155),
shape.Point( 0.8709, 0.5650),
shape.Point( 0.7931, 0.5820),
shape.Point( 0.7286, 0.5650),
shape.Point( 0.6804, 0.5155),
shape.Point( 0.6481, 0.4385),
shape.Point( 0.6299, 0.3415),
shape.Point( 0.6240, 0.2340),
],
limit_point=shape.Point( 0.6240, 0.2340),
diverted=shape.Diverted.LIMITED,
),
),
# Shift down by 20cm and hold for 50ms.
shape.ReferenceTimeSlice(
time=0.4,
hold=0.45,
shape=shape.Shape(
ip=-150000,
params=shape.ParametrizedShape(
r0=0.8822,
z0=0.0340,
kappa=1.4396,
delta=0.2760,
radius=0.2388,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 20 points
shape.Point( 0.6299, -0.0735),
shape.Point( 0.6481, -0.1705),
shape.Point( 0.6804, -0.2475),
shape.Point( 0.7286, -0.2970),
shape.Point( 0.7931, -0.3140),
shape.Point( 0.8709, -0.2970),
shape.Point( 0.9543, -0.2475),
shape.Point( 1.0304, -0.1705),
shape.Point( 1.0844, -0.0735),
shape.Point( 1.1040, 0.0340),
shape.Point( 1.0844, 0.1415),
shape.Point( 1.0304, 0.2385),
shape.Point( 0.9543, 0.3155),
shape.Point( 0.8709, 0.3650),
shape.Point( 0.7931, 0.3820),
shape.Point( 0.7286, 0.3650),
shape.Point( 0.6804, 0.3155),
shape.Point( 0.6481, 0.2385),
shape.Point( 0.6299, 0.1415),
shape.Point( 0.6240, 0.0340),
],
limit_point=shape.Point( 0.6240, 0.0340),
diverted=shape.Diverted.LIMITED,
),
),
# Add an X-point and allow to be ANY.
shape.ReferenceTimeSlice(
time=0.451,
shape=shape.Shape(
ip=-150000,
params=shape.ParametrizedShape(
r0=0.8822,
z0=0.0340,
kappa=1.4396,
delta=0.2760,
radius=0.2388,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 20 points
shape.Point( 0.6299, -0.0735),
shape.Point( 0.6481, -0.1705),
shape.Point( 0.6804, -0.2475),
shape.Point( 0.7286, -0.2970),
shape.Point( 0.7931, -0.3140),
shape.Point( 0.8709, -0.2970),
shape.Point( 0.9543, -0.2475),
shape.Point( 1.0304, -0.1705),
shape.Point( 1.0844, -0.0735),
shape.Point( 1.1040, 0.0340),
shape.Point( 1.0844, 0.1415),
shape.Point( 1.0304, 0.2385),
shape.Point( 0.9543, 0.3155),
shape.Point( 0.8709, 0.3650),
shape.Point( 0.7931, 0.3820),
shape.Point( 0.7286, 0.3650),
shape.Point( 0.6804, 0.3155),
shape.Point( 0.6481, 0.2385),
shape.Point( 0.6299, 0.1415),
shape.Point( 0.6240, 0.0340),
],
x_points=[shape.Point( 0.6240, -0.7)],
diverted=shape.Diverted.ANY,
),
),
# Make diverted and hold for 350ms.
shape.ReferenceTimeSlice(
time=0.50,
hold=0.85,
shape=shape.Shape( # based on 70519 @ 0.840
ip=-150000,
params=shape.ParametrizedShape(
r0=0.8618,
z0=0.0130,
kappa=1.5585,
delta=0.3175,
radius=0.232,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[
shape.Point(0.8286, -0.3612),
shape.Point(0.7722, -0.3807),
shape.Point(0.7512, -0.3375),
shape.Point(0.7246, -0.2900),
shape.Point(0.6995, -0.2425),
shape.Point(0.6783, -0.1950),
shape.Point(0.6627, -0.1475),
shape.Point(0.6531, -0.1000),
shape.Point(0.6469, -0.0288),
shape.Point(0.6461, 0.0425),
shape.Point(0.6509, 0.1137),
shape.Point(0.6594, 0.1612),
shape.Point(0.6738, 0.2087),
shape.Point(0.6970, 0.2562),
shape.Point(0.7327, 0.2991),
shape.Point(0.7722, 0.3243),
shape.Point(0.8117, 0.3348),
shape.Point(0.8709, 0.3290),
shape.Point(0.9104, 0.3143),
shape.Point(0.9499, 0.2912),
shape.Point(0.9893, 0.2597),
shape.Point(1.0164, 0.2325),
shape.Point(1.0486, 0.1932),
shape.Point(1.0696, 0.1612),
shape.Point(1.0938, 0.1137),
shape.Point(1.1084, 0.0662),
shape.Point(1.1078, -0.0050),
shape.Point(1.0937, -0.0525),
shape.Point(1.0721, -0.1000),
shape.Point(1.0486, -0.1416),
shape.Point(1.0288, -0.1720),
shape.Point(0.9935, -0.2187),
shape.Point(0.9696, -0.2464),
shape.Point(0.9301, -0.2856),
shape.Point(0.8961, -0.3137),
shape.Point(0.8641, -0.3375),
],
x_points=[shape.Point(0.7722, -0.3807)],
limit_point=shape.Point(0.7722, -0.3807),
diverted=shape.Diverted.DIVERTED,
),
),
# Remove the X-point and let be ANY.
shape.ReferenceTimeSlice( # based on 70519 @ 0.840
time=0.851,
shape=shape.Shape(
ip=-150000,
params=shape.ParametrizedShape(
r0=0.8618,
z0=0.0130,
kappa=1.5585,
delta=0.3175,
radius=0.232,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[
shape.Point(0.8286, -0.3612),
shape.Point(0.7722, -0.3807),
shape.Point(0.7512, -0.3375),
shape.Point(0.7246, -0.2900),
shape.Point(0.6995, -0.2425),
shape.Point(0.6783, -0.1950),
shape.Point(0.6627, -0.1475),
shape.Point(0.6531, -0.1000),
shape.Point(0.6469, -0.0288),
shape.Point(0.6461, 0.0425),
shape.Point(0.6509, 0.1137),
shape.Point(0.6594, 0.1612),
shape.Point(0.6738, 0.2087),
shape.Point(0.6970, 0.2562),
shape.Point(0.7327, 0.2991),
shape.Point(0.7722, 0.3243),
shape.Point(0.8117, 0.3348),
shape.Point(0.8709, 0.3290),
shape.Point(0.9104, 0.3143),
shape.Point(0.9499, 0.2912),
shape.Point(0.9893, 0.2597),
shape.Point(1.0164, 0.2325),
shape.Point(1.0486, 0.1932),
shape.Point(1.0696, 0.1612),
shape.Point(1.0938, 0.1137),
shape.Point(1.1084, 0.0662),
shape.Point(1.1078, -0.0050),
shape.Point(1.0937, -0.0525),
shape.Point(1.0721, -0.1000),
shape.Point(1.0486, -0.1416),
shape.Point(1.0288, -0.1720),
shape.Point(0.9935, -0.2187),
shape.Point(0.9696, -0.2464),
shape.Point(0.9301, -0.2856),
shape.Point(0.8961, -0.3137),
shape.Point(0.8641, -0.3375),
],
diverted=shape.Diverted.ANY,
),
),
# Shift back to round shape.
shape.ReferenceTimeSlice(
time=0.90,
shape=shape.Shape(
ip=-150000,
params=shapes_known.SHAPE_70166_0872.params,
points=shapes_known.SHAPE_70166_0872.points,
limit_point=shapes_known.SHAPE_70166_0872.limit_point,
diverted=shape.Diverted.LIMITED,
),
),
# Ramp the Ip down.
shape.ReferenceTimeSlice(
time=1.00,
shape=shape.Shape(
ip=-70000,
params=shapes_known.SHAPE_70166_0872.params,
points=shapes_known.SHAPE_70166_0872.points,
limit_point=shapes_known.SHAPE_70166_0872.limit_point,
diverted=shape.Diverted.LIMITED,
),
),
])
# Used in TCV#70920
def elongation() -> ref_gen.AbstractReferenceGenerator:
return ref_gen.ShapeFromShot([
shape.ReferenceTimeSlice(
time=0.45,
hold=0.475,
shape=shape.Shape(
params=shapes_known.SHAPE_70166_0450.params,
diverted=shapes_known.SHAPE_70166_0450.diverted,
limit_point=shape.Point(tcv_common.INNER_LIMITER_R, 0.25),
ip=shapes_known.SHAPE_70166_0450.ip)
),
shape.ReferenceTimeSlice(
time=0.55,
shape=shape.Shape(
params=shape.ParametrizedShape(
r0=0.875, z0=0.2, kappa=1.9, delta=0.3, radius=0.235,
lambda_=0, side=shape.ShapeSide.LEFT),
ip=-190000,
limit_point=shape.Point(tcv_common.INNER_LIMITER_R, 0.2),
diverted=shape.Diverted.LIMITED)
),
])
# Used in TCV#70457
def negative_triangularity() -> ref_gen.AbstractReferenceGenerator:
return ref_gen.ShapeFromShot([
shape.ReferenceTimeSlice(
time=0.45,
shape=shape.Shape(
ip=-120000,
params=shape.ParametrizedShape(
r0=0.89, z0=0.15, kappa=1.4, delta=-0.8, radius=0.25,
lambda_=0, side=shape.ShapeSide.LEFT),
x_points=[
shape.Point(tcv_common.OUTER_LIMITER_R - 0.03, 0.50),
shape.Point(tcv_common.OUTER_LIMITER_R - 0.03, -0.2),
],
diverted=shape.Diverted.DIVERTED,
),
),
])
# Used in TCV#70755
def snowflake() -> ref_gen.AbstractReferenceGenerator:
return ref_gen.ShapeFromShot([
shape.ReferenceTimeSlice(
time=0.0872,
shape=shape.Shape(
ip=-110000,
params=shapes_known.SHAPE_70166_0872.params,
points=shapes_known.SHAPE_70166_0872.points,
limit_point=shapes_known.SHAPE_70166_0872.limit_point,
diverted=shape.Diverted.LIMITED,
),
),
shape.ReferenceTimeSlice(
time=0.15, # 0.2680,
shape=shape.Shape(
ip=-120000,
params=shape.ParametrizedShape(
r0=0.8713,
z0=0.0662,
kappa=1.6059,
delta=0.3814,
radius=0.2378,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 13 points
shape.Point( 0.6270, 0.0660),
shape.Point( 0.6290, -0.0840),
shape.Point( 0.6530, -0.2170),
shape.Point( 0.7500, -0.3114),
shape.Point( 0.9260, -0.2270),
shape.Point( 1.0530, -0.0930),
shape.Point( 1.1020, 0.0660),
shape.Point( 1.0530, 0.2250),
shape.Point( 0.9460, 0.3590),
shape.Point( 0.8100, 0.4340),
shape.Point( 0.7000, 0.4240),
shape.Point( 0.6500, 0.3490),
shape.Point( 0.6290, 0.2160),
],
x_points=[
shape.Point( 0.7000, -0.4700),
],
diverted=shape.Diverted.ANY,
),
),
shape.ReferenceTimeSlice(
time=0.2, # 0.4280,
shape=shape.Shape(
ip=-120000,
params=shape.ParametrizedShape(
r0=0.8884,
z0=0.0319,
kappa=1.6229,
delta=0.3875,
radius=0.2261,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 13 points
shape.Point( 0.6550, 0.0080),
shape.Point( 0.6650, -0.1260),
shape.Point( 0.6840, -0.2600),
shape.Point( 0.7600, -0.3750),
shape.Point( 0.9400, -0.2790),
shape.Point( 1.0500, -0.1450),
shape.Point( 1.1060, 0.0080),
shape.Point( 1.0760, 0.1620),
shape.Point( 0.9780, 0.2960),
shape.Point( 0.8410, 0.3530),
shape.Point( 0.7300, 0.3380),
shape.Point( 0.6750, 0.2670),
shape.Point( 0.6550, 0.1430),
],
x_points=[
shape.Point( 0.7600, -0.3750),
],
limit_point=shape.Point( 0.7600, -0.3750),
diverted=shape.Diverted.DIVERTED,
),
),
shape.ReferenceTimeSlice(
time=0.25, # 0.5000,
shape=shape.Shape(
ip=-120000,
params=shape.ParametrizedShape(
r0=0.8886,
z0=0.0044,
kappa=1.5419,
delta=0.2430,
radius=0.2137,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 14 points
shape.Point( 0.6780, -0.1200),
shape.Point( 0.7200, -0.2360),
shape.Point( 0.7840, -0.3754),
shape.Point( 0.9090, -0.3040),
shape.Point( 1.0040, -0.2110),
shape.Point( 1.0660, -0.1110),
shape.Point( 1.0950, -0.0030),
shape.Point( 1.0800, 0.1070),
shape.Point( 1.0210, 0.2070),
shape.Point( 0.9250, 0.2740),
shape.Point( 0.8090, 0.2730),
shape.Point( 0.7170, 0.2040),
shape.Point( 0.6660, 0.1010),
shape.Point( 0.6570, -0.0100),
],
x_points=[
shape.Point( 0.7840, -0.3754),
shape.Point( 0.8600, -0.7500),
],
legs=[
shape.Point( 0.8220, -0.5627),
],
limit_point=shape.Point( 0.7840, -0.3754),
diverted=shape.Diverted.DIVERTED,
),
),
shape.ReferenceTimeSlice(
time=0.4, # 0.6000,
hold=0.8,
shape=shape.Shape(
ip=-120000,
params=shape.ParametrizedShape(
r0=0.8886,
z0=0.0044,
kappa=1.5419,
delta=0.2430,
radius=0.2137,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 14 points
shape.Point( 0.6780, -0.1200),
shape.Point( 0.7200, -0.2360),
shape.Point( 0.7840, -0.3754),
shape.Point( 0.9090, -0.3040),
shape.Point( 1.0040, -0.2110),
shape.Point( 1.0660, -0.1110),
shape.Point( 1.0950, -0.0030),
shape.Point( 1.0800, 0.1070),
shape.Point( 1.0210, 0.2070),
shape.Point( 0.9250, 0.2740),
shape.Point( 0.8090, 0.2730),
shape.Point( 0.7170, 0.2040),
shape.Point( 0.6660, 0.1010),
shape.Point( 0.6570, -0.0100),
],
x_points=[
shape.Point( 0.7840, -0.3754),
shape.Point( 0.8028, -0.4153),
],
legs=[
shape.Point( 0.7934, -0.3953),
],
limit_point=shape.Point( 0.7840, -0.3754),
diverted=shape.Diverted.DIVERTED,
),
),
shape.ReferenceTimeSlice(
time=0.9, # 0.5000,
shape=shape.Shape(
ip=-120000,
params=shape.ParametrizedShape(
r0=0.8886,
z0=0.0044,
kappa=1.5419,
delta=0.2430,
radius=0.2137,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 14 points
shape.Point( 0.6780, -0.1200),
shape.Point( 0.7200, -0.2360),
shape.Point( 0.7840, -0.3754),
shape.Point( 0.9090, -0.3040),
shape.Point( 1.0040, -0.2110),
shape.Point( 1.0660, -0.1110),
shape.Point( 1.0950, -0.0030),
shape.Point( 1.0800, 0.1070),
shape.Point( 1.0210, 0.2070),
shape.Point( 0.9250, 0.2740),
shape.Point( 0.8090, 0.2730),
shape.Point( 0.7170, 0.2040),
shape.Point( 0.6660, 0.1010),
shape.Point( 0.6570, -0.0100),
],
x_points=[
shape.Point( 0.7840, -0.3754),
shape.Point( 0.8600, -0.7500),
],
legs=[
shape.Point( 0.8220, -0.5627),
],
limit_point=shape.Point( 0.7840, -0.3754),
diverted=shape.Diverted.DIVERTED,
),
),
shape.ReferenceTimeSlice(
time=0.95, # 0.4280,
shape=shape.Shape(
ip=-120000,
params=shape.ParametrizedShape(
r0=0.8884,
z0=0.0319,
kappa=1.6229,
delta=0.3875,
radius=0.2261,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 13 points
shape.Point( 0.6550, 0.0080),
shape.Point( 0.6650, -0.1260),
shape.Point( 0.6840, -0.2600),
shape.Point( 0.7600, -0.3750),
shape.Point( 0.9400, -0.2790),
shape.Point( 1.0500, -0.1450),
shape.Point( 1.1060, 0.0080),
shape.Point( 1.0760, 0.1620),
shape.Point( 0.9780, 0.2960),
shape.Point( 0.8410, 0.3530),
shape.Point( 0.7300, 0.3380),
shape.Point( 0.6750, 0.2670),
shape.Point( 0.6550, 0.1430),
],
x_points=[
shape.Point( 0.7600, -0.3750),
],
diverted=shape.Diverted.ANY,
),
),
shape.ReferenceTimeSlice(
time=1.0, # 0.2680,
shape=shape.Shape(
ip=-120000,
params=shape.ParametrizedShape(
r0=0.8713,
z0=0.0662,
kappa=1.6059,
delta=0.3814,
radius=0.2378,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 13 points
shape.Point( 0.6270, 0.0660),
shape.Point( 0.6290, -0.0840),
shape.Point( 0.6530, -0.2170),
shape.Point( 0.7500, -0.3114),
shape.Point( 0.9260, -0.2270),
shape.Point( 1.0530, -0.0930),
shape.Point( 1.1020, 0.0660),
shape.Point( 1.0530, 0.2250),
shape.Point( 0.9460, 0.3590),
shape.Point( 0.8100, 0.4340),
shape.Point( 0.7000, 0.4240),
shape.Point( 0.6500, 0.3490),
shape.Point( 0.6290, 0.2160),
],
x_points=[
shape.Point( 0.7000, -0.4700),
],
limit_point=shape.Point( 0.6240, 0.0660),
diverted=shape.Diverted.LIMITED,
),
),
shape.ReferenceTimeSlice(
time=1.05, # 0.0872,
shape=shape.Shape(
ip=-70000,
params=shape.ParametrizedShape(
r0=0.8703,
z0=0.0547,
kappa=1.2459,
delta=0.2431,
radius=0.2395,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 20 points
shape.Point( 0.6299, -0.0377),
shape.Point( 0.6481, -0.1213),
shape.Point( 0.6804, -0.1877),
shape.Point( 0.7286, -0.2303),
shape.Point( 0.7931, -0.2450),
shape.Point( 0.8709, -0.2303),
shape.Point( 0.9543, -0.1877),
shape.Point( 1.0304, -0.1213),
shape.Point( 1.0844, -0.0377),
shape.Point( 1.1040, 0.0550),
shape.Point( 1.0844, 0.1477),
shape.Point( 1.0304, 0.2313),
shape.Point( 0.9543, 0.2977),
shape.Point( 0.8709, 0.3403),
shape.Point( 0.7931, 0.3550),
shape.Point( 0.7286, 0.3403),
shape.Point( 0.6804, 0.2977),
shape.Point( 0.6481, 0.2313),
shape.Point( 0.6299, 0.1477),
shape.Point( 0.6240, 0.0550),
],
limit_point=shape.Point( 0.6240, 0.0550),
diverted=shape.Diverted.LIMITED,
),
),
])
# Used in TCV#70600
def iter() -> ref_gen.AbstractReferenceGenerator: # pylint: disable=redefined-builtin
return ref_gen.ShapeFromShot([
# Taken from TCV#70392.
shape.ReferenceTimeSlice(
time=0.0872,
shape=shape.Shape(
ip=-135000,
params=shape.ParametrizedShape(
r0=0.8831,
z0=0.0501,
kappa=1.2500,
delta=0.1083,
radius=0.2400,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 20 points
shape.Point( 0.6330, -0.0427),
shape.Point( 0.6596, -0.1263),
shape.Point( 0.7033, -0.1927),
shape.Point( 0.7623, -0.2353),
shape.Point( 0.8329, -0.2500),
shape.Point( 0.9094, -0.2353),
shape.Point( 0.9839, -0.1927),
shape.Point( 1.0468, -0.1263),
shape.Point( 1.0891, -0.0427),
shape.Point( 1.1040, 0.0500),
shape.Point( 1.0891, 0.1427),
shape.Point( 1.0468, 0.2263),
shape.Point( 0.9839, 0.2927),
shape.Point( 0.9094, 0.3353),
shape.Point( 0.8329, 0.3500),
shape.Point( 0.7623, 0.3353),
shape.Point( 0.7033, 0.2927),
shape.Point( 0.6596, 0.2263),
shape.Point( 0.6330, 0.1427),
shape.Point( 0.6240, 0.0500),
],
limit_point=shape.Point( 0.6240, 0.0500),
diverted=shape.Diverted.LIMITED,
),
),
shape.ReferenceTimeSlice(
time=0.1328,
shape=shape.Shape(
ip=-140000,
params=shape.ParametrizedShape(
r0=0.8885,
z0=0.0503,
kappa=1.4887,
delta=0.2421,
radius=0.2448,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 20 points
shape.Point( 0.6305, -0.0636),
shape.Point( 0.6505, -0.1660),
shape.Point( 0.6855, -0.2473),
shape.Point( 0.7366, -0.2995),
shape.Point( 0.8037, -0.3175),
shape.Point( 0.8830, -0.2995),
shape.Point( 0.9666, -0.2473),
shape.Point( 1.0420, -0.1660),
shape.Point( 1.0949, -0.0636),
shape.Point( 1.1140, 0.0500),
shape.Point( 1.0949, 0.1636),
shape.Point( 1.0420, 0.2660),
shape.Point( 0.9666, 0.3473),
shape.Point( 0.8830, 0.3995),
shape.Point( 0.8037, 0.4175),
shape.Point( 0.7366, 0.3995),
shape.Point( 0.6855, 0.3473),
shape.Point( 0.6505, 0.2660),
shape.Point( 0.6305, 0.1636),
shape.Point( 0.6240, 0.0500),
],
limit_point=shape.Point( 0.6240, 0.0500),
diverted=shape.Diverted.LIMITED,
),
),
shape.ReferenceTimeSlice(
time=0.1880,
shape=shape.Shape(
ip=-140000,
params=shape.ParametrizedShape(
r0=0.8858,
z0=0.0502,
kappa=1.4899,
delta=0.3813,
radius=0.2443,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 20 points
shape.Point( 0.6284, -0.0636),
shape.Point( 0.6427, -0.1660),
shape.Point( 0.6694, -0.2473),
shape.Point( 0.7122, -0.2995),
shape.Point( 0.7736, -0.3175),
shape.Point( 0.8528, -0.2995),
shape.Point( 0.9425, -0.2473),
shape.Point( 1.0282, -0.1660),
shape.Point( 1.0909, -0.0636),
shape.Point( 1.1140, 0.0500),
shape.Point( 1.0909, 0.1636),
shape.Point( 1.0282, 0.2660),
shape.Point( 0.9425, 0.3473),
shape.Point( 0.8528, 0.3995),
shape.Point( 0.7736, 0.4175),
shape.Point( 0.7122, 0.3995),
shape.Point( 0.6694, 0.3473),
shape.Point( 0.6427, 0.2660),
shape.Point( 0.6284, 0.1636),
shape.Point( 0.6240, 0.0500),
],
limit_point=shape.Point( 0.6240, 0.0500),
diverted=shape.Diverted.LIMITED,
),
),
shape.ReferenceTimeSlice(
time=0.2280,
shape=shape.Shape(
ip=-140000,
params=shape.ParametrizedShape(
r0=0.8820,
z0=0.0501,
kappa=1.4817,
delta=0.4028,
radius=0.2386,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 14 points
shape.Point( 0.6317, -0.1062),
shape.Point( 0.6589, -0.2315),
shape.Point( 0.7163, -0.3010),
shape.Point( 0.8130, -0.3010),
shape.Point( 0.9398, -0.2315),
shape.Point( 1.0559, -0.1062),
shape.Point( 1.1040, 0.0500),
shape.Point( 1.0559, 0.2062),
shape.Point( 0.9398, 0.3315),
shape.Point( 0.8130, 0.4010),
shape.Point( 0.7163, 0.4010),
shape.Point( 0.6589, 0.3315),
shape.Point( 0.6317, 0.2062),
shape.Point( 0.6240, 0.0500),
],
limit_point=shape.Point( 0.6240, 0.0500),
diverted=shape.Diverted.LIMITED,
),
),
shape.ReferenceTimeSlice(
time=0.2680,
shape=shape.Shape(
ip=-140000,
params=shape.ParametrizedShape(
r0=0.8780,
z0=0.0664,
kappa=1.6140,
delta=0.3943,
radius=0.2376,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 13 points
shape.Point( 0.6270, 0.0660),
shape.Point( 0.6290, -0.0840),
shape.Point( 0.6530, -0.2170),
shape.Point( 0.7500, -0.3114),
shape.Point( 0.9260, -0.2270),
shape.Point( 1.0530, -0.0930),
shape.Point( 1.1020, 0.0660),
shape.Point( 1.0530, 0.2250),
shape.Point( 0.9460, 0.3590),
shape.Point( 0.8100, 0.4340),
shape.Point( 0.7000, 0.4240),
shape.Point( 0.6500, 0.3490),
shape.Point( 0.6290, 0.2160),
],
x_points=[
shape.Point( 0.7000, -0.4700),
],
limit_point=shape.Point( 0.6240, 0.0660),
diverted=shape.Diverted.LIMITED,
),
),
shape.ReferenceTimeSlice(
time=0.3080,
shape=shape.Shape(
ip=-140000,
params=shape.ParametrizedShape(
r0=0.8670,
z0=0.0394,
kappa=1.5594,
delta=0.2588,
radius=0.2252,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 13 points
shape.Point( 0.6250, 0.0404),
shape.Point( 0.6250, -0.0868),
shape.Point( 0.6550, -0.2151),
shape.Point( 0.7500, -0.3244),
shape.Point( 0.9290, -0.2331),
shape.Point( 1.0460, -0.1058),
shape.Point( 1.0760, 0.0404),
shape.Point( 1.0460, 0.1867),
shape.Point( 0.9480, 0.3141),
shape.Point( 0.8110, 0.3777),
shape.Point( 0.7000, 0.3692),
shape.Point( 0.6450, 0.2960),
shape.Point( 0.6250, 0.1677),
],
x_points=[
shape.Point( 0.7200, -0.4355),
],
limit_point=shape.Point( 0.6240, 0.0404),
diverted=shape.Diverted.LIMITED,
),
),
shape.ReferenceTimeSlice(
time=0.3480,
shape=shape.Shape(
ip=-140000,
params=shape.ParametrizedShape(
r0=0.8771,
z0=0.0286,
kappa=1.6824,
delta=0.4348,
radius=0.2310,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 13 points
shape.Point( 0.6350, 0.0263),
shape.Point( 0.6350, -0.1045),
shape.Point( 0.6550, -0.2344),
shape.Point( 0.7400, -0.3462),
shape.Point( 0.9390, -0.2528),
shape.Point( 1.0560, -0.1229),
shape.Point( 1.0860, 0.0263),
shape.Point( 1.0560, 0.1745),
shape.Point( 0.9580, 0.3054),
shape.Point( 0.8210, 0.3703),
shape.Point( 0.7100, 0.3606),
shape.Point( 0.6550, 0.2860),
shape.Point( 0.6350, 0.1561),
],
x_points=[
shape.Point( 0.7300, -0.3943),
],
limit_point=shape.Point( 0.6240, 0.0260),
diverted=shape.Diverted.LIMITED,
),
),
shape.ReferenceTimeSlice(
time=0.3880,
shape=shape.Shape(
ip=-140000,
params=shape.ParametrizedShape(
r0=0.8878,
z0=0.0130,
kappa=1.6511,
delta=0.4385,
radius=0.2291,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 13 points
shape.Point( 0.6450, 0.0060),
shape.Point( 0.6500, -0.1230),
shape.Point( 0.6650, -0.2540),
shape.Point( 0.7500, -0.3660),
shape.Point( 0.9490, -0.2730),
shape.Point( 1.0660, -0.1420),
shape.Point( 1.0960, 0.0060),
shape.Point( 1.0660, 0.1560),
shape.Point( 0.9680, 0.2860),
shape.Point( 0.8310, 0.3510),
shape.Point( 0.7200, 0.3430),
shape.Point( 0.6650, 0.2680),
shape.Point( 0.6450, 0.1370),
],
x_points=[
shape.Point( 0.7400, -0.3960),
],
diverted=shape.Diverted.ANY,
),
),
shape.ReferenceTimeSlice(
time=0.5000,
shape=shape.Shape(
ip=-175000,
params=shape.ParametrizedShape(
r0=0.9069,
z0=0.0099,
kappa=1.6399,
delta=0.4400,
radius=0.2255,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 13 points
shape.Point( 0.6690, -0.1340),
shape.Point( 0.6880, -0.2690),
shape.Point( 0.7377, -0.3840),
shape.Point( 0.8150, -0.3650),
shape.Point( 0.9600, -0.2880),
shape.Point( 1.0760, -0.1540),
shape.Point( 1.1060, 0.0000),
shape.Point( 1.0760, 0.1540),
shape.Point( 0.9790, 0.2880),
shape.Point( 0.8440, 0.3550),
shape.Point( 0.6890, 0.2690),
shape.Point( 0.6600, 0.1340),
shape.Point( 0.6600, 0.0000),
],
x_points=[
shape.Point( 0.7377, -0.3840),
],
legs=[
shape.Point( 0.7930, -0.5700),
],
limit_point=shape.Point( 0.7377, -0.3840),
diverted=shape.Diverted.DIVERTED,
),
),
shape.ReferenceTimeSlice(
time=0.6200,
shape=shape.Shape(
ip=-200000,
params=shape.ParametrizedShape(
r0=0.9044,
z0=0.0142,
kappa=1.7484,
delta=0.4440,
radius=0.2257,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 13 points
shape.Point( 0.6690, -0.1490),
shape.Point( 0.7080, -0.2840), # concave: 181.6 degrees
shape.Point( 0.7377, -0.3990),
shape.Point( 0.8150, -0.3800),
shape.Point( 0.9600, -0.3030),
shape.Point( 1.0760, -0.1690),
shape.Point( 1.1060, -0.0066),
shape.Point( 1.0760, 0.1659),
shape.Point( 0.9790, 0.3160),
shape.Point( 0.8440, 0.3910),
shape.Point( 0.6890, 0.2947),
shape.Point( 0.6600, 0.1435),
shape.Point( 0.6600, -0.0066),
],
x_points=[
shape.Point( 0.7377, -0.3990),
],
legs=[
shape.Point( 0.7930, -0.5850),
],
limit_point=shape.Point( 0.7377, -0.3990),
diverted=shape.Diverted.DIVERTED,
),
),
shape.ReferenceTimeSlice(
time=0.9000,
shape=shape.Shape(
ip=-240000,
params=shape.ParametrizedShape(
r0=0.9010,
z0=0.0152,
kappa=1.7482,
delta=0.4427,
radius=0.2257,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 13 points
shape.Point( 0.6690, -0.1490),
shape.Point( 0.7080, -0.2840), # concave: 181.6 degrees
shape.Point( 0.7377, -0.3990),
shape.Point( 0.8150, -0.3800),
shape.Point( 0.9600, -0.3030),
shape.Point( 1.0760, -0.1690),
shape.Point( 1.1060, -0.0066),
shape.Point( 1.0760, 0.1659),
shape.Point( 0.9790, 0.3160),
shape.Point( 0.8440, 0.3910),
shape.Point( 0.6890, 0.2947),
shape.Point( 0.6600, 0.1435),
shape.Point( 0.6600, -0.0066),
],
x_points=[
shape.Point( 0.7377, -0.3990),
],
legs=[
shape.Point( 0.7930, -0.5850),
],
limit_point=shape.Point( 0.7377, -0.3990),
diverted=shape.Diverted.DIVERTED,
),
),
shape.ReferenceTimeSlice(
time=0.9500,
shape=shape.Shape(
ip=-245000,
params=shape.ParametrizedShape(
r0=0.8985,
z0=0.0173,
kappa=1.7213,
delta=0.4905,
radius=0.2261,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 14 points
shape.Point( 0.6690, -0.1490),
shape.Point( 0.7200, -0.2840),
shape.Point( 0.7600, -0.3890),
shape.Point( 0.8500, -0.3700),
shape.Point( 0.9600, -0.2850),
shape.Point( 1.0760, -0.1590),
shape.Point( 1.1060, 0.0030),
shape.Point( 1.0660, 0.1760),
shape.Point( 1.0000, 0.2650),
shape.Point( 0.9200, 0.3360),
shape.Point( 0.7500, 0.3850),
shape.Point( 0.6650, 0.2850),
shape.Point( 0.6600, 0.1430),
shape.Point( 0.6600, -0.0070),
],
x_points=[
shape.Point( 0.7600, -0.3890),
],
legs=[
shape.Point( 0.8430, -0.5850),
],
limit_point=shape.Point( 0.7600, -0.3890),
diverted=shape.Diverted.DIVERTED,
),
),
shape.ReferenceTimeSlice(
time=1.1500,
shape=shape.Shape(
ip=-260000,
params=shape.ParametrizedShape(
r0=0.8970,
z0=0.0180,
kappa=1.7142,
delta=0.4877,
radius=0.2262,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 14 points
shape.Point( 0.6690, -0.1490),
shape.Point( 0.7200, -0.2840),
shape.Point( 0.7600, -0.3890),
shape.Point( 0.8500, -0.3700),
shape.Point( 0.9600, -0.2850),
shape.Point( 1.0760, -0.1590),
shape.Point( 1.1060, 0.0030),
shape.Point( 1.0660, 0.1760),
shape.Point( 1.0000, 0.2650),
shape.Point( 0.9200, 0.3360),
shape.Point( 0.7500, 0.3850),
shape.Point( 0.6650, 0.2850),
shape.Point( 0.6600, 0.1430),
shape.Point( 0.6600, -0.0070),
],
x_points=[
shape.Point( 0.7600, -0.3890),
],
legs=[
shape.Point( 0.8430, -0.5850),
],
limit_point=shape.Point( 0.7600, -0.3890),
diverted=shape.Diverted.DIVERTED,
),
),
shape.ReferenceTimeSlice(
time=1.4500,
shape=shape.Shape(
ip=-280000,
params=shape.ParametrizedShape(
r0=0.8955,
z0=0.0186,
kappa=1.7143,
delta=0.4841,
radius=0.2262,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 14 points
shape.Point( 0.6690, -0.1490),
shape.Point( 0.7200, -0.2840),
shape.Point( 0.7600, -0.3890),
shape.Point( 0.8500, -0.3700),
shape.Point( 0.9600, -0.2850),
shape.Point( 1.0760, -0.1590),
shape.Point( 1.1060, 0.0030),
shape.Point( 1.0660, 0.1760),
shape.Point( 1.0000, 0.2650),
shape.Point( 0.9200, 0.3360),
shape.Point( 0.7500, 0.3850),
shape.Point( 0.6650, 0.2850),
shape.Point( 0.6600, 0.1430),
shape.Point( 0.6600, -0.0070),
],
x_points=[
shape.Point( 0.7600, -0.3890),
],
legs=[
shape.Point( 0.8430, -0.5850),
],
limit_point=shape.Point( 0.7600, -0.3890),
diverted=shape.Diverted.DIVERTED,
),
),
shape.ReferenceTimeSlice(
time=1.7000,
shape=shape.Shape(
ip=-280000,
params=shape.ParametrizedShape(
r0=0.8955,
z0=0.0186,
kappa=1.7143,
delta=0.4841,
radius=0.2262,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 14 points
shape.Point( 0.6690, -0.1490),
shape.Point( 0.7200, -0.2840),
shape.Point( 0.7600, -0.3890),
shape.Point( 0.8500, -0.3700),
shape.Point( 0.9600, -0.2850),
shape.Point( 1.0760, -0.1590),
shape.Point( 1.1060, 0.0030),
shape.Point( 1.0660, 0.1760),
shape.Point( 1.0000, 0.2650),
shape.Point( 0.9200, 0.3360),
shape.Point( 0.7500, 0.3850),
shape.Point( 0.6650, 0.2850),
shape.Point( 0.6600, 0.1430),
shape.Point( 0.6600, -0.0070),
],
x_points=[
shape.Point( 0.7600, -0.3890),
],
legs=[
shape.Point( 0.8430, -0.5850),
],
limit_point=shape.Point( 0.7600, -0.3890),
diverted=shape.Diverted.DIVERTED,
),
),
shape.ReferenceTimeSlice(
time=1.7600,
shape=shape.Shape(
ip=-140000,
params=shape.ParametrizedShape(
r0=0.8873,
z0=0.0281,
kappa=1.6534,
delta=0.4388,
radius=0.2288,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 13 points
shape.Point( 0.6450, 0.0210),
shape.Point( 0.6500, -0.1080),
shape.Point( 0.6650, -0.2390),
shape.Point( 0.7500, -0.3510),
shape.Point( 0.9490, -0.2580),
shape.Point( 1.0660, -0.1270),
shape.Point( 1.0960, 0.0210),
shape.Point( 1.0660, 0.1710),
shape.Point( 0.9680, 0.3010),
shape.Point( 0.8310, 0.3660),
shape.Point( 0.7200, 0.3580),
shape.Point( 0.6650, 0.2830),
shape.Point( 0.6450, 0.1520),
],
x_points=[
shape.Point( 0.7400, -0.3810),
],
diverted=shape.Diverted.ANY,
),
),
shape.ReferenceTimeSlice(
time=1.7800,
shape=shape.Shape(
ip=-140000,
params=shape.ParametrizedShape(
r0=0.8770,
z0=0.0436,
kappa=1.6840,
delta=0.4370,
radius=0.2306,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 13 points
shape.Point( 0.6350, 0.0413),
shape.Point( 0.6350, -0.0895),
shape.Point( 0.6550, -0.2194),
shape.Point( 0.7400, -0.3312),
shape.Point( 0.9390, -0.2378),
shape.Point( 1.0560, -0.1079),
shape.Point( 1.0860, 0.0413),
shape.Point( 1.0560, 0.1895),
shape.Point( 0.9580, 0.3204),
shape.Point( 0.8210, 0.3853),
shape.Point( 0.7100, 0.3756),
shape.Point( 0.6550, 0.3010),
shape.Point( 0.6350, 0.1711),
],
x_points=[
shape.Point( 0.7300, -0.3793),
],
limit_point=shape.Point( 0.6240, 0.0410),
diverted=shape.Diverted.LIMITED,
),
),
shape.ReferenceTimeSlice(
time=1.8000,
shape=shape.Shape(
ip=-140000,
params=shape.ParametrizedShape(
r0=0.8784,
z0=0.0865,
kappa=1.6166,
delta=0.3958,
radius=0.2378,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 13 points
shape.Point( 0.6270, 0.0860),
shape.Point( 0.6290, -0.0640),
shape.Point( 0.6530, -0.1970),
shape.Point( 0.7500, -0.2914),
shape.Point( 0.9260, -0.2070),
shape.Point( 1.0530, -0.0730),
shape.Point( 1.1020, 0.0860),
shape.Point( 1.0530, 0.2450),
shape.Point( 0.9460, 0.3790),
shape.Point( 0.8100, 0.4540),
shape.Point( 0.7000, 0.4440),
shape.Point( 0.6500, 0.3690),
shape.Point( 0.6290, 0.2360),
],
x_points=[
shape.Point( 0.7000, -0.4500),
],
limit_point=shape.Point( 0.6240, 0.0860),
diverted=shape.Diverted.LIMITED,
),
),
shape.ReferenceTimeSlice(
time=1.8100,
shape=shape.Shape(
ip=-120000,
params=shape.ParametrizedShape(
r0=0.8865,
z0=0.0501,
kappa=1.3991,
delta=0.1188,
radius=0.2402,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 20 points
shape.Point( 0.6330, -0.0538),
shape.Point( 0.6596, -0.1475),
shape.Point( 0.7033, -0.2218),
shape.Point( 0.7623, -0.2696),
shape.Point( 0.8329, -0.2860),
shape.Point( 0.9094, -0.2696),
shape.Point( 0.9839, -0.2218),
shape.Point( 1.0468, -0.1475),
shape.Point( 1.0891, -0.0538),
shape.Point( 1.1040, 0.0500),
shape.Point( 1.0891, 0.1538),
shape.Point( 1.0468, 0.2475),
shape.Point( 0.9839, 0.3218),
shape.Point( 0.9094, 0.3696),
shape.Point( 0.8329, 0.3860),
shape.Point( 0.7623, 0.3696),
shape.Point( 0.7033, 0.3218),
shape.Point( 0.6596, 0.2475),
shape.Point( 0.6330, 0.1538),
shape.Point( 0.6240, 0.0500),
],
limit_point=shape.Point( 0.6240, 0.0500),
diverted=shape.Diverted.LIMITED,
),
),
shape.ReferenceTimeSlice(
time=1.8200,
shape=shape.Shape(
ip=-94000,
params=shape.ParametrizedShape(
r0=0.8523,
z0=0.0500,
kappa=1.0904,
delta=0.0128,
radius=0.2106,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 20 points
shape.Point( 0.6339, -0.0207),
shape.Point( 0.6627, -0.0845),
shape.Point( 0.7078, -0.1352),
shape.Point( 0.7653, -0.1677),
shape.Point( 0.8298, -0.1789),
shape.Point( 0.8951, -0.1677),
shape.Point( 0.9547, -0.1352),
shape.Point( 1.0024, -0.0845),
shape.Point( 1.0333, -0.0207),
shape.Point( 1.0440, 0.0500),
shape.Point( 1.0333, 0.1207),
shape.Point( 1.0024, 0.1845),
shape.Point( 0.9547, 0.2352),
shape.Point( 0.8951, 0.2677),
shape.Point( 0.8298, 0.2789),
shape.Point( 0.7653, 0.2677),
shape.Point( 0.7078, 0.2352),
shape.Point( 0.6627, 0.1845),
shape.Point( 0.6339, 0.1207),
shape.Point( 0.6240, 0.0500),
],
limit_point=shape.Point( 0.6240, 0.0500),
diverted=shape.Diverted.LIMITED,
),
),
shape.ReferenceTimeSlice(
time=1.8300,
shape=shape.Shape(
ip=-53000,
params=shape.ParametrizedShape(
r0=0.8048,
z0=0.0501,
kappa=1.0631,
delta=0.0036,
radius=0.1680,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 20 points
shape.Point( 0.6322, -0.0050),
shape.Point( 0.6559, -0.0545),
shape.Point( 0.6928, -0.0939),
shape.Point( 0.7394, -0.1192),
shape.Point( 0.7910, -0.1279),
shape.Point( 0.8426, -0.1192),
shape.Point( 0.8892, -0.0939),
shape.Point( 0.9261, -0.0545),
shape.Point( 0.9498, -0.0050),
shape.Point( 0.9580, 0.0500),
shape.Point( 0.9498, 0.1050),
shape.Point( 0.9261, 0.1545),
shape.Point( 0.8892, 0.1939),
shape.Point( 0.8426, 0.2192),
shape.Point( 0.7910, 0.2279),
shape.Point( 0.7394, 0.2192),
shape.Point( 0.6928, 0.1939),
shape.Point( 0.6559, 0.1545),
shape.Point( 0.6322, 0.1050),
shape.Point( 0.6240, 0.0500),
],
limit_point=shape.Point( 0.6240, 0.0500),
diverted=shape.Diverted.LIMITED,
),
),
shape.ReferenceTimeSlice(
time=1.8400,
shape=shape.Shape(
ip=-22000,
params=shape.ParametrizedShape(
r0=0.7484,
z0=0.0489,
kappa=1.0666,
delta=0.0258,
radius=0.1176,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 20 points
shape.Point( 0.6297, 0.0109),
shape.Point( 0.6462, -0.0243),
shape.Point( 0.6718, -0.0523),
shape.Point( 0.7042, -0.0703),
shape.Point( 0.7400, -0.0764),
shape.Point( 0.7758, -0.0703),
shape.Point( 0.8082, -0.0523),
shape.Point( 0.8338, -0.0243),
shape.Point( 0.8503, 0.0109),
shape.Point( 0.8560, 0.0500),
shape.Point( 0.8503, 0.0891),
shape.Point( 0.8338, 0.1243),
shape.Point( 0.8082, 0.1523),
shape.Point( 0.7758, 0.1703),
shape.Point( 0.7400, 0.1764),
shape.Point( 0.7042, 0.1703),
shape.Point( 0.6718, 0.1523),
shape.Point( 0.6462, 0.1243),
shape.Point( 0.6297, 0.0891),
shape.Point( 0.6240, 0.0500),
],
limit_point=shape.Point( 0.6240, 0.0500),
diverted=shape.Diverted.LIMITED,
),
),
shape.ReferenceTimeSlice(
time=1.8500,
shape=shape.Shape(
ip=-12000,
params=shape.ParametrizedShape(
r0=0.7149,
z0=0.0494,
kappa=1.0830,
delta=0.0382,
radius=0.0871,
lambda_=0,
side=shape.ShapeSide.NOSHIFT,
),
points=[ # 20 points
shape.Point( 0.6282, 0.0198),
shape.Point( 0.6402, -0.0075),
shape.Point( 0.6590, -0.0291),
shape.Point( 0.6827, -0.0430),
shape.Point( 0.7090, -0.0477),
shape.Point( 0.7353, -0.0430),
shape.Point( 0.7590, -0.0291),
shape.Point( 0.7778, -0.0075),
shape.Point( 0.7898, 0.0198),
shape.Point( 0.7940, 0.0500),
shape.Point( 0.7898, 0.0802),
shape.Point( 0.7778, 0.1075),
shape.Point( 0.7590, 0.1291),
shape.Point( 0.7353, 0.1430),
shape.Point( 0.7090, 0.1478),
shape.Point( 0.6827, 0.1430),
shape.Point( 0.6590, 0.1291),
shape.Point( 0.6402, 0.1075),
shape.Point( 0.6282, 0.0802),
shape.Point( 0.6240, 0.0500),
],
limit_point=shape.Point( 0.6240, 0.0500),
diverted=shape.Diverted.LIMITED,
),
),
])
# Used in TCV#69545
def droplet() -> ref_gen.AbstractReferenceGenerator:
"""Hold the droplet at handover for TCV#69198 then ramp the Ip."""
init = ref_gen.RZIpTarget(r=0.875, z=0.55, ip=-72500)
final = ref_gen.RZIpTarget(r=0.875, z=0.47, ip=-110000)
return ref_gen.FixedReferenceGenerator([
ref_gen.LinearTransition(
transition_steps=0,
steady_steps=350, # Intentionally short. Mostly want to ramp.
reference=ref_gen.make_symmetric_multidomain_rzip_reference(init)),
ref_gen.LinearTransition(
transition_steps=400,
steady_steps=100000, # Hold forever.
reference=ref_gen.make_symmetric_multidomain_rzip_reference(final)),
])
_REFERENCES = [
fundamental_capability,
elongation,
iter,
negative_triangularity,
snowflake,
droplet,
]
REFERENCES = {f.__name__: f for f in _REFERENCES}
| 38.142138
| 86
| 0.421545
| 6,521
| 60,646
| 3.888514
| 0.128815
| 0.274875
| 0.237291
| 0.040226
| 0.854044
| 0.626296
| 0.615254
| 0.594826
| 0.560516
| 0.554758
| 0
| 0.265138
| 0.45073
| 60,646
| 1,589
| 87
| 38.166142
| 0.496082
| 0.028988
| 0
| 0.66061
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.003894
| false
| 0
| 0.002596
| 0.003245
| 0.010383
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 1
| 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
| 5
|
0953a0e4c5dcf1e63656bff574508a715d768c3d
| 106
|
py
|
Python
|
tests/test_autoDiff.py
|
cs207-group33/cs207-FinalProject
|
6e0fbe7ef2aa126782b5e354e1ee13c464297e27
|
[
"MIT"
] | null | null | null |
tests/test_autoDiff.py
|
cs207-group33/cs207-FinalProject
|
6e0fbe7ef2aa126782b5e354e1ee13c464297e27
|
[
"MIT"
] | 2
|
2019-11-20T03:18:12.000Z
|
2019-11-20T03:29:26.000Z
|
tests/test_autoDiff.py
|
cs207-group33/cs207-FinalProject
|
6e0fbe7ef2aa126782b5e354e1ee13c464297e27
|
[
"MIT"
] | 1
|
2019-11-20T23:21:49.000Z
|
2019-11-20T23:21:49.000Z
|
import numpy as np
import sys
sys.path.append('..')
from autoDiff.autoDiff import *
# ELEMENTARY FUNCTIONS
| 21.2
| 31
| 0.773585
| 15
| 106
| 5.466667
| 0.733333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.122642
| 106
| 5
| 32
| 21.2
| 0.88172
| 0.188679
| 0
| 0
| 0
| 0
| 0.023529
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.75
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
0956ba3d1fbf72fa577f4c2c48a3fe82c97d021f
| 169
|
py
|
Python
|
src/service_framework/__init__.py
|
ZacharyATanenbaum/service_framework
|
b5dde4407998350d1b7ad09284110b986fd4e12a
|
[
"MIT"
] | 1
|
2020-03-20T21:33:56.000Z
|
2020-03-20T21:33:56.000Z
|
src/service_framework/__init__.py
|
ZacharyATanenbaum/service_framework
|
b5dde4407998350d1b7ad09284110b986fd4e12a
|
[
"MIT"
] | 1
|
2020-03-22T03:48:45.000Z
|
2020-03-22T03:48:45.000Z
|
src/service_framework/__init__.py
|
ZacharyATanenbaum/service_framework
|
b5dde4407998350d1b7ad09284110b986fd4e12a
|
[
"MIT"
] | null | null | null |
""" Init file to make this doc discoverable... """
from .service import Service
from .inline_services import InlineServices
from .utils.logging_utils import get_logger
| 28.166667
| 50
| 0.792899
| 23
| 169
| 5.695652
| 0.73913
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.130178
| 169
| 5
| 51
| 33.8
| 0.891156
| 0.248521
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
0957282ac84a1f85985c422303b795647f11e37e
| 136
|
py
|
Python
|
data/__init__.py
|
noahcao/icebeem
|
202b0cae8d98d45428c1a08d14c07a67184e3ca6
|
[
"MIT"
] | null | null | null |
data/__init__.py
|
noahcao/icebeem
|
202b0cae8d98d45428c1a08d14c07a67184e3ca6
|
[
"MIT"
] | null | null | null |
data/__init__.py
|
noahcao/icebeem
|
202b0cae8d98d45428c1a08d14c07a67184e3ca6
|
[
"MIT"
] | null | null | null |
from .imca import generate_synthetic_data
from .utils import to_one_hot
from .dataset import return_dataset
__all__ = ["imca", "utils"]
| 27.2
| 41
| 0.801471
| 20
| 136
| 5
| 0.65
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.117647
| 136
| 5
| 42
| 27.2
| 0.833333
| 0
| 0
| 0
| 1
| 0
| 0.065693
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.75
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
0958f47555989811ff537687493eb519445028ea
| 734
|
py
|
Python
|
mainpage/views.py
|
yhk24356/Open_Source_Programming
|
d63b6d0393e6615b1d070dbcc49fe542052aa89f
|
[
"Unlicense",
"MIT"
] | null | null | null |
mainpage/views.py
|
yhk24356/Open_Source_Programming
|
d63b6d0393e6615b1d070dbcc49fe542052aa89f
|
[
"Unlicense",
"MIT"
] | null | null | null |
mainpage/views.py
|
yhk24356/Open_Source_Programming
|
d63b6d0393e6615b1d070dbcc49fe542052aa89f
|
[
"Unlicense",
"MIT"
] | null | null | null |
from django.shortcuts import render
from django.http import HttpResponse
def main(request):
return render(request, 'main.html')
def cold_medicine(request):
return render(request, 'cold_medicine.html')
def back_pain_medicine(request):
return render(request, 'back_pain_medicine.html')
def headache_medicine(request):
return render(request, 'headache_medicine.html')
def muscle_pain_medicine(request):
return render(request, 'muscle_pain_medicine.html')
def stomachache_medicine(request):
return render(request, 'stomachache_medicine.html')
def toothache_medicine(request):
return render(request, 'toothache_medicine.html')
def toothache_medicine(request):
return render(request, '콜드원에스시럽.html')
| 27.185185
| 55
| 0.779292
| 91
| 734
| 6.098901
| 0.230769
| 0.187387
| 0.273874
| 0.374775
| 0.52973
| 0.345946
| 0.209009
| 0.209009
| 0.209009
| 0
| 0
| 0
| 0.119891
| 734
| 26
| 56
| 28.230769
| 0.859133
| 0
| 0
| 0.111111
| 0
| 0
| 0.213896
| 0.160763
| 0
| 0
| 0
| 0
| 0
| 1
| 0.444444
| false
| 0
| 0.111111
| 0.444444
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
11a5b4598aa0df5666b10a534a25b7228849d20e
| 478
|
py
|
Python
|
test.py
|
Gadgetoid/wipy-WS2812
|
4288b4b782040053fcfec86fa7644dbec3ceab76
|
[
"MIT"
] | null | null | null |
test.py
|
Gadgetoid/wipy-WS2812
|
4288b4b782040053fcfec86fa7644dbec3ceab76
|
[
"MIT"
] | 1
|
2021-10-02T08:14:53.000Z
|
2021-10-02T08:14:53.000Z
|
test.py
|
Gadgetoid/wipy-WS2812
|
4288b4b782040053fcfec86fa7644dbec3ceab76
|
[
"MIT"
] | 2
|
2017-10-24T15:06:38.000Z
|
2017-12-29T14:58:57.000Z
|
from ws2812 import WS2812
from utime import sleep_ms
chain = WS2812( ledNumber=16, brightness=100, dataPin='P22' ) # dataPin is for LoPy board only
data = [(255, 102, 0), (127, 21, 0), (63, 10, 0), (31, 5, 0),
(15, 2, 0), (7, 1, 0), (0, 0, 0), (0,0,0),
(0, 0, 0), (0, 0, 0), (0, 0, 0), (0,0,0),
(0, 0, 0), (0, 0, 0), (0, 0, 0), (0,0,0)
]
chain.show( data )
while True:
data = data[1:] + data[0:1]
chain.show( data )
sleep_ms( 150 )
| 28.117647
| 94
| 0.5
| 89
| 478
| 2.662921
| 0.404494
| 0.253165
| 0.367089
| 0.472574
| 0.130802
| 0.130802
| 0.130802
| 0.130802
| 0.130802
| 0.130802
| 0
| 0.240688
| 0.269874
| 478
| 16
| 95
| 29.875
| 0.438395
| 0.062762
| 0
| 0.153846
| 0
| 0
| 0.006726
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.153846
| 0
| 0.153846
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 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
| 5
|
11ac65b61b99703d7974f2b042a857ebbefe5338
| 41
|
py
|
Python
|
scripts/neareast-neighbor-distance/__init__.py
|
fang-ren/segmentation_CoFeZr
|
072b5fdde332ba0211189723494d172c36999e93
|
[
"BSD-3-Clause-LBNL"
] | null | null | null |
scripts/neareast-neighbor-distance/__init__.py
|
fang-ren/segmentation_CoFeZr
|
072b5fdde332ba0211189723494d172c36999e93
|
[
"BSD-3-Clause-LBNL"
] | null | null | null |
scripts/neareast-neighbor-distance/__init__.py
|
fang-ren/segmentation_CoFeZr
|
072b5fdde332ba0211189723494d172c36999e93
|
[
"BSD-3-Clause-LBNL"
] | null | null | null |
"""
author: Fang Ren (SSRL)
5/1/2017
"""
| 8.2
| 23
| 0.560976
| 7
| 41
| 3.285714
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.176471
| 0.170732
| 41
| 5
| 24
| 8.2
| 0.5
| 0.804878
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
11c396daf05b1d6b609871677b0301cdb0442250
| 12,181
|
py
|
Python
|
tests/components/cloud/test_cloud_api.py
|
mikehorton77/SmartHome-485
|
1afdde61e88080d3b6b9df0d54fb0ecf00141db6
|
[
"Apache-2.0"
] | null | null | null |
tests/components/cloud/test_cloud_api.py
|
mikehorton77/SmartHome-485
|
1afdde61e88080d3b6b9df0d54fb0ecf00141db6
|
[
"Apache-2.0"
] | null | null | null |
tests/components/cloud/test_cloud_api.py
|
mikehorton77/SmartHome-485
|
1afdde61e88080d3b6b9df0d54fb0ecf00141db6
|
[
"Apache-2.0"
] | null | null | null |
"""Tests for the tools to communicate with the cloud."""
import asyncio
from datetime import timedelta
from unittest.mock import patch
from urllib.parse import urljoin
import aiohttp
import pytest
from homeassistant.components.cloud import DOMAIN, cloud_api, const
import homeassistant.util.dt as dt_util
from tests.common import mock_coro
MOCK_AUTH = {
"access_token": "jvCHxpTu2nfORLBRgQY78bIAoK4RPa",
"expires_at": "2017-08-29T05:33:28.266048+00:00",
"expires_in": 86400,
"refresh_token": "C4wR1mgb03cs69EeiFgGOBC8mMQC5Q",
"scope": "",
"token_type": "Bearer"
}
def url(path):
"""Create a url."""
return urljoin(const.SERVERS['development']['host'], path)
@pytest.fixture
def cloud_hass(hass):
"""Fixture to return a hass instance with cloud mode set."""
hass.data[DOMAIN] = {'mode': 'development'}
return hass
@pytest.fixture
def mock_write():
"""Mock reading authentication."""
with patch.object(cloud_api, '_write_auth') as mock:
yield mock
@pytest.fixture
def mock_read():
"""Mock writing authentication."""
with patch.object(cloud_api, '_read_auth') as mock:
yield mock
@asyncio.coroutine
def test_async_login_invalid_auth(cloud_hass, aioclient_mock, mock_write):
"""Test trying to login with invalid credentials."""
aioclient_mock.post(url('o/token/'), status=401)
with pytest.raises(cloud_api.Unauthenticated):
yield from cloud_api.async_login(cloud_hass, 'user', 'pass')
assert len(mock_write.mock_calls) == 0
@asyncio.coroutine
def test_async_login_cloud_error(cloud_hass, aioclient_mock, mock_write):
"""Test exception in cloud while logging in."""
aioclient_mock.post(url('o/token/'), status=500)
with pytest.raises(cloud_api.UnknownError):
yield from cloud_api.async_login(cloud_hass, 'user', 'pass')
assert len(mock_write.mock_calls) == 0
@asyncio.coroutine
def test_async_login_client_error(cloud_hass, aioclient_mock, mock_write):
"""Test client error while logging in."""
aioclient_mock.post(url('o/token/'), exc=aiohttp.ClientError)
with pytest.raises(cloud_api.UnknownError):
yield from cloud_api.async_login(cloud_hass, 'user', 'pass')
assert len(mock_write.mock_calls) == 0
@asyncio.coroutine
def test_async_login(cloud_hass, aioclient_mock, mock_write):
"""Test logging in."""
aioclient_mock.post(url('o/token/'), json={
'expires_in': 10
})
now = dt_util.utcnow()
with patch('homeassistant.components.cloud.cloud_api.utcnow',
return_value=now):
yield from cloud_api.async_login(cloud_hass, 'user', 'pass')
assert len(mock_write.mock_calls) == 1
result_hass, result_data = mock_write.mock_calls[0][1]
assert result_hass is cloud_hass
assert result_data == {
'expires_in': 10,
'expires_at': (now + timedelta(seconds=10)).isoformat()
}
@asyncio.coroutine
def test_load_auth_with_no_stored_auth(cloud_hass, mock_read):
"""Test loading authentication with no stored auth."""
mock_read.return_value = None
result = yield from cloud_api.async_load_auth(cloud_hass)
assert result is None
@asyncio.coroutine
def test_load_auth_timeout_during_verification(cloud_hass, mock_read):
"""Test loading authentication with timeout during verification."""
mock_read.return_value = MOCK_AUTH
with patch.object(cloud_api.Cloud, 'async_refresh_account_info',
side_effect=asyncio.TimeoutError):
result = yield from cloud_api.async_load_auth(cloud_hass)
assert result is None
@asyncio.coroutine
def test_load_auth_verification_failed_500(cloud_hass, mock_read,
aioclient_mock):
"""Test loading authentication with verify request getting 500."""
mock_read.return_value = MOCK_AUTH
aioclient_mock.get(url('account.json'), status=500)
result = yield from cloud_api.async_load_auth(cloud_hass)
assert result is None
@asyncio.coroutine
def test_load_auth_token_refresh_needed_401(cloud_hass, mock_read,
aioclient_mock):
"""Test loading authentication with refresh needed which gets 401."""
mock_read.return_value = MOCK_AUTH
aioclient_mock.get(url('account.json'), status=403)
aioclient_mock.post(url('o/token/'), status=401)
result = yield from cloud_api.async_load_auth(cloud_hass)
assert result is None
@asyncio.coroutine
def test_load_auth_token_refresh_needed_500(cloud_hass, mock_read,
aioclient_mock):
"""Test loading authentication with refresh needed which gets 500."""
mock_read.return_value = MOCK_AUTH
aioclient_mock.get(url('account.json'), status=403)
aioclient_mock.post(url('o/token/'), status=500)
result = yield from cloud_api.async_load_auth(cloud_hass)
assert result is None
@asyncio.coroutine
def test_load_auth_token_refresh_needed_timeout(cloud_hass, mock_read,
aioclient_mock):
"""Test loading authentication with refresh timing out."""
mock_read.return_value = MOCK_AUTH
aioclient_mock.get(url('account.json'), status=403)
aioclient_mock.post(url('o/token/'), exc=asyncio.TimeoutError)
result = yield from cloud_api.async_load_auth(cloud_hass)
assert result is None
@asyncio.coroutine
def test_load_auth_token_refresh_needed_succeeds(cloud_hass, mock_read,
aioclient_mock):
"""Test loading authentication with refresh timing out."""
mock_read.return_value = MOCK_AUTH
aioclient_mock.get(url('account.json'), status=403)
with patch.object(cloud_api.Cloud, 'async_refresh_access_token',
return_value=mock_coro(True)) as mock_refresh:
result = yield from cloud_api.async_load_auth(cloud_hass)
assert result is None
assert len(mock_refresh.mock_calls) == 1
@asyncio.coroutine
def test_load_auth_token(cloud_hass, mock_read, aioclient_mock):
"""Test loading authentication with refresh timing out."""
mock_read.return_value = MOCK_AUTH
aioclient_mock.get(url('account.json'), json={
'first_name': 'Paulus',
'last_name': 'Schoutsen'
})
result = yield from cloud_api.async_load_auth(cloud_hass)
assert result is not None
assert result.account == {
'first_name': 'Paulus',
'last_name': 'Schoutsen'
}
assert result.auth == MOCK_AUTH
def test_cloud_properties():
"""Test Cloud class properties."""
cloud = cloud_api.Cloud(None, MOCK_AUTH)
assert cloud.access_token == MOCK_AUTH['access_token']
assert cloud.refresh_token == MOCK_AUTH['refresh_token']
@asyncio.coroutine
def test_cloud_refresh_account_info(cloud_hass, aioclient_mock):
"""Test refreshing account info."""
aioclient_mock.get(url('account.json'), json={
'first_name': 'Paulus',
'last_name': 'Schoutsen'
})
cloud = cloud_api.Cloud(cloud_hass, MOCK_AUTH)
assert cloud.account is None
result = yield from cloud.async_refresh_account_info()
assert result
assert cloud.account == {
'first_name': 'Paulus',
'last_name': 'Schoutsen'
}
@asyncio.coroutine
def test_cloud_refresh_account_info_500(cloud_hass, aioclient_mock):
"""Test refreshing account info and getting 500."""
aioclient_mock.get(url('account.json'), status=500)
cloud = cloud_api.Cloud(cloud_hass, MOCK_AUTH)
assert cloud.account is None
result = yield from cloud.async_refresh_account_info()
assert not result
assert cloud.account is None
@asyncio.coroutine
def test_cloud_refresh_token(cloud_hass, aioclient_mock, mock_write):
"""Test refreshing access token."""
aioclient_mock.post(url('o/token/'), json={
'access_token': 'refreshed',
'expires_in': 10
})
now = dt_util.utcnow()
cloud = cloud_api.Cloud(cloud_hass, MOCK_AUTH)
with patch('homeassistant.components.cloud.cloud_api.utcnow',
return_value=now):
result = yield from cloud.async_refresh_access_token()
assert result
assert cloud.auth == {
'access_token': 'refreshed',
'expires_in': 10,
'expires_at': (now + timedelta(seconds=10)).isoformat()
}
assert len(mock_write.mock_calls) == 1
write_hass, write_data = mock_write.mock_calls[0][1]
assert write_hass is cloud_hass
assert write_data == cloud.auth
@asyncio.coroutine
def test_cloud_refresh_token_unknown_error(cloud_hass, aioclient_mock,
mock_write):
"""Test refreshing access token."""
aioclient_mock.post(url('o/token/'), status=500)
cloud = cloud_api.Cloud(cloud_hass, MOCK_AUTH)
result = yield from cloud.async_refresh_access_token()
assert not result
assert cloud.auth == MOCK_AUTH
assert len(mock_write.mock_calls) == 0
@asyncio.coroutine
def test_cloud_revoke_token(cloud_hass, aioclient_mock, mock_write):
"""Test revoking access token."""
aioclient_mock.post(url('o/revoke_token/'))
cloud = cloud_api.Cloud(cloud_hass, MOCK_AUTH)
yield from cloud.async_revoke_access_token()
assert cloud.auth is None
assert len(mock_write.mock_calls) == 1
write_hass, write_data = mock_write.mock_calls[0][1]
assert write_hass is cloud_hass
assert write_data is None
@asyncio.coroutine
def test_cloud_revoke_token_invalid_client_creds(cloud_hass, aioclient_mock,
mock_write):
"""Test revoking access token with invalid client credentials."""
aioclient_mock.post(url('o/revoke_token/'), status=401)
cloud = cloud_api.Cloud(cloud_hass, MOCK_AUTH)
with pytest.raises(cloud_api.UnknownError):
yield from cloud.async_revoke_access_token()
assert cloud.auth is not None
assert len(mock_write.mock_calls) == 0
@asyncio.coroutine
def test_cloud_revoke_token_request_error(cloud_hass, aioclient_mock,
mock_write):
"""Test revoking access token with invalid client credentials."""
aioclient_mock.post(url('o/revoke_token/'), exc=aiohttp.ClientError)
cloud = cloud_api.Cloud(cloud_hass, MOCK_AUTH)
with pytest.raises(cloud_api.UnknownError):
yield from cloud.async_revoke_access_token()
assert cloud.auth is not None
assert len(mock_write.mock_calls) == 0
@asyncio.coroutine
def test_cloud_request(cloud_hass, aioclient_mock):
"""Test making request to the cloud."""
aioclient_mock.post(url('some_endpoint'), json={'hello': 'world'})
cloud = cloud_api.Cloud(cloud_hass, MOCK_AUTH)
request = yield from cloud.async_request('post', 'some_endpoint')
assert request.status == 200
data = yield from request.json()
assert data == {'hello': 'world'}
@asyncio.coroutine
def test_cloud_request_requiring_refresh_fail(cloud_hass, aioclient_mock):
"""Test making request to the cloud."""
aioclient_mock.post(url('some_endpoint'), status=403)
cloud = cloud_api.Cloud(cloud_hass, MOCK_AUTH)
with patch.object(cloud_api.Cloud, 'async_refresh_access_token',
return_value=mock_coro(False)) as mock_refresh:
request = yield from cloud.async_request('post', 'some_endpoint')
assert request.status == 403
assert len(mock_refresh.mock_calls) == 1
@asyncio.coroutine
def test_cloud_request_requiring_refresh_success(cloud_hass, aioclient_mock):
"""Test making request to the cloud."""
aioclient_mock.post(url('some_endpoint'), status=403)
cloud = cloud_api.Cloud(cloud_hass, MOCK_AUTH)
with patch.object(cloud_api.Cloud, 'async_refresh_access_token',
return_value=mock_coro(True)) as mock_refresh, \
patch.object(cloud_api.Cloud, 'async_refresh_account_info',
return_value=mock_coro()) as mock_account_info:
request = yield from cloud.async_request('post', 'some_endpoint')
assert request.status == 403
assert len(mock_refresh.mock_calls) == 1
assert len(mock_account_info.mock_calls) == 1
| 34.507082
| 77
| 0.701995
| 1,609
| 12,181
| 5.034183
| 0.101305
| 0.053333
| 0.051605
| 0.062469
| 0.815556
| 0.799012
| 0.772469
| 0.724938
| 0.642963
| 0.613827
| 0
| 0.014977
| 0.194237
| 12,181
| 352
| 78
| 34.605114
| 0.81029
| 0.097939
| 0
| 0.644898
| 0
| 0
| 0.096893
| 0.029132
| 0
| 0
| 0
| 0
| 0.195918
| 1
| 0.110204
| false
| 0.016327
| 0.036735
| 0
| 0.155102
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
11dfd6c4e563696537656f87b6ff9a4ace4bd8fc
| 74
|
py
|
Python
|
multitaper/__init__.py
|
gaprieto/multitaper
|
5e621ac51eaeb50615d37f28e66812930ac35775
|
[
"MIT"
] | 26
|
2022-02-09T06:33:11.000Z
|
2022-03-31T17:17:10.000Z
|
multitaper/__init__.py
|
gaprieto/multitaper
|
5e621ac51eaeb50615d37f28e66812930ac35775
|
[
"MIT"
] | 1
|
2022-03-01T14:40:50.000Z
|
2022-03-01T14:40:50.000Z
|
multitaper/__init__.py
|
gaprieto/multitaper
|
5e621ac51eaeb50615d37f28e66812930ac35775
|
[
"MIT"
] | 2
|
2022-02-28T19:10:58.000Z
|
2022-03-31T13:50:53.000Z
|
from .mtspec import MTSpec, MTSine
from .mtcross import MTCross, SineCross
| 37
| 39
| 0.824324
| 10
| 74
| 6.1
| 0.6
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.121622
| 74
| 2
| 39
| 37
| 0.938462
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
11eff17c7dbaf1a6f1772e0dad83d8eb3f1e7e03
| 94
|
wsgi
|
Python
|
src/rpki-read.wsgi
|
smlng/lbv
|
b8a584eac413ac85bd363154c69036cddc328477
|
[
"MIT"
] | 1
|
2016-03-09T14:40:40.000Z
|
2016-03-09T14:40:40.000Z
|
src/rpki-read.wsgi
|
smlng/lbv
|
b8a584eac413ac85bd363154c69036cddc328477
|
[
"MIT"
] | 2
|
2016-03-23T07:46:03.000Z
|
2016-04-19T15:05:55.000Z
|
src/rpki-read.wsgi
|
smlng/lbv
|
b8a584eac413ac85bd363154c69036cddc328477
|
[
"MIT"
] | null | null | null |
import sys
sys.path.insert(0, "</path/to/rpki-read>/src")
from app import app as application
| 18.8
| 46
| 0.734043
| 17
| 94
| 4.058824
| 0.764706
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.012048
| 0.117021
| 94
| 4
| 47
| 23.5
| 0.819277
| 0
| 0
| 0
| 0
| 0
| 0.255319
| 0.255319
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
eea020d6087f09f1adb6173d0585f609c01368a2
| 88
|
py
|
Python
|
tests/test.py
|
jeff-hykin/pip-inport
|
7fcfe6cda24f1806a94a5dd5a7678f697cc976b2
|
[
"MIT"
] | null | null | null |
tests/test.py
|
jeff-hykin/pip-inport
|
7fcfe6cda24f1806a94a5dd5a7678f697cc976b2
|
[
"MIT"
] | null | null | null |
tests/test.py
|
jeff-hykin/pip-inport
|
7fcfe6cda24f1806a94a5dd5a7678f697cc976b2
|
[
"MIT"
] | null | null | null |
import python_include
python_include.file("./nested/include_me.py", globals())
hello()
| 17.6
| 56
| 0.772727
| 12
| 88
| 5.416667
| 0.75
| 0.4
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.068182
| 88
| 5
| 57
| 17.6
| 0.792683
| 0
| 0
| 0
| 0
| 0
| 0.247191
| 0.247191
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
eeb3fe9c450dc6fa2e31de1ecda745fe27bd8bcd
| 115
|
py
|
Python
|
xxpystuff/pyside6/__init__.py
|
xavierxeon/PythonPackage
|
c4216dc3a1019d18216d0d2f9645b4b96f699ecc
|
[
"MIT"
] | null | null | null |
xxpystuff/pyside6/__init__.py
|
xavierxeon/PythonPackage
|
c4216dc3a1019d18216d0d2f9645b4b96f699ecc
|
[
"MIT"
] | null | null | null |
xxpystuff/pyside6/__init__.py
|
xavierxeon/PythonPackage
|
c4216dc3a1019d18216d0d2f9645b4b96f699ecc
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
from .logwidget import LogWidget
from .resource import Resource
from .uifile import UiFile
| 19.166667
| 32
| 0.8
| 16
| 115
| 5.75
| 0.5625
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.01
| 0.130435
| 115
| 5
| 33
| 23
| 0.91
| 0.182609
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
eeebc835aead98a83b50a0a1363f543eb167fc9b
| 170
|
py
|
Python
|
voteapp/admin.py
|
dmm34/voteapp
|
cfa4ba31ff491bffbdf119746a7aa6a7e6a575f0
|
[
"MIT"
] | null | null | null |
voteapp/admin.py
|
dmm34/voteapp
|
cfa4ba31ff491bffbdf119746a7aa6a7e6a575f0
|
[
"MIT"
] | null | null | null |
voteapp/admin.py
|
dmm34/voteapp
|
cfa4ba31ff491bffbdf119746a7aa6a7e6a575f0
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import *
# Register your models here.
admin.site.register(Election)
admin.site.register(Ballot)
admin.site.register(Option)
| 24.285714
| 32
| 0.805882
| 24
| 170
| 5.708333
| 0.541667
| 0.19708
| 0.372263
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.094118
| 170
| 6
| 33
| 28.333333
| 0.88961
| 0.152941
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.4
| 0
| 0.4
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
e1153fd07b49d6ca0dddfa16ffdfc99bfff85c18
| 175
|
py
|
Python
|
MyApp/MyPlugins/plugin1.py
|
muayyad-alsadi/uPyApp
|
e81fb9d336a843d068ae93c866cf503989ef6a60
|
[
"Apache-2.0"
] | null | null | null |
MyApp/MyPlugins/plugin1.py
|
muayyad-alsadi/uPyApp
|
e81fb9d336a843d068ae93c866cf503989ef6a60
|
[
"Apache-2.0"
] | null | null | null |
MyApp/MyPlugins/plugin1.py
|
muayyad-alsadi/uPyApp
|
e81fb9d336a843d068ae93c866cf503989ef6a60
|
[
"Apache-2.0"
] | 1
|
2020-03-18T07:27:27.000Z
|
2020-03-18T07:27:27.000Z
|
class Plugin(object):
def __init__(self, myarg):
self.myarg = myarg
def do_it(self):
print("doing it with myarg={} inside plugin1".format(self.myarg))
| 29.166667
| 73
| 0.64
| 24
| 175
| 4.458333
| 0.625
| 0.252336
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.007407
| 0.228571
| 175
| 5
| 74
| 35
| 0.785185
| 0
| 0
| 0
| 0
| 0
| 0.211429
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.4
| false
| 0
| 0
| 0
| 0.6
| 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
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
0115df594bde8e07bd8ff31371121948b8ede960
| 92
|
py
|
Python
|
BlogCart/shop/admin.py
|
xxEasterGrymm/Ecommerce-Website
|
712715851fec3b8b9b8a0e6e8cc31b1afc7309b7
|
[
"MIT"
] | 1
|
2021-08-29T14:01:45.000Z
|
2021-08-29T14:01:45.000Z
|
BlogCart/shop/admin.py
|
xxEasterGrymm/Ecommerce-Website
|
712715851fec3b8b9b8a0e6e8cc31b1afc7309b7
|
[
"MIT"
] | null | null | null |
BlogCart/shop/admin.py
|
xxEasterGrymm/Ecommerce-Website
|
712715851fec3b8b9b8a0e6e8cc31b1afc7309b7
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from . models import Product
admin.site.register(Product)
| 18.4
| 32
| 0.815217
| 13
| 92
| 5.769231
| 0.692308
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.119565
| 92
| 5
| 33
| 18.4
| 0.925926
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
0154806b496fd2348f27a2a4e1d7eb0446b19072
| 19
|
py
|
Python
|
example_project/some_modules/third_modules/a2.py
|
Yuriy-Leonov/cython_imports_limit_issue
|
2f9e7c02798fb52185dabfe6ce3811c439ca2839
|
[
"MIT"
] | null | null | null |
example_project/some_modules/third_modules/a2.py
|
Yuriy-Leonov/cython_imports_limit_issue
|
2f9e7c02798fb52185dabfe6ce3811c439ca2839
|
[
"MIT"
] | null | null | null |
example_project/some_modules/third_modules/a2.py
|
Yuriy-Leonov/cython_imports_limit_issue
|
2f9e7c02798fb52185dabfe6ce3811c439ca2839
|
[
"MIT"
] | null | null | null |
class A2:
pass
| 6.333333
| 9
| 0.578947
| 3
| 19
| 3.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.083333
| 0.368421
| 19
| 2
| 10
| 9.5
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
018dec78d611f3b24dabf34c6a8c3ecf825a7581
| 204
|
py
|
Python
|
src/yellowdog_client/object_store/upload/abstracts/__init__.py
|
yellowdog/yellowdog-sdk-python-public
|
da69a7d6e45c92933e34fefcaef8b5d98dcd6036
|
[
"Apache-2.0"
] | null | null | null |
src/yellowdog_client/object_store/upload/abstracts/__init__.py
|
yellowdog/yellowdog-sdk-python-public
|
da69a7d6e45c92933e34fefcaef8b5d98dcd6036
|
[
"Apache-2.0"
] | null | null | null |
src/yellowdog_client/object_store/upload/abstracts/__init__.py
|
yellowdog/yellowdog-sdk-python-public
|
da69a7d6e45c92933e34fefcaef8b5d98dcd6036
|
[
"Apache-2.0"
] | null | null | null |
from .abstract_upload_batch_builder import AbstractUploadBatchBuilder
from .abstract_upload_engine import AbstractUploadEngine
__all__ = [
"AbstractUploadBatchBuilder",
"AbstractUploadEngine"
]
| 22.666667
| 69
| 0.833333
| 16
| 204
| 10.0625
| 0.625
| 0.149068
| 0.223602
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.117647
| 204
| 8
| 70
| 25.5
| 0.894444
| 0
| 0
| 0
| 0
| 0
| 0.22549
| 0.127451
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 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
| 5
|
6da6edd5e4c25b644cf34b53e5bd55376b087ac9
| 2,539
|
py
|
Python
|
tests/constants.py
|
ankitchiplunkar/tbtc.py
|
76be1c6439aaf61fb83dab1a6a237bea72625d53
|
[
"MIT"
] | null | null | null |
tests/constants.py
|
ankitchiplunkar/tbtc.py
|
76be1c6439aaf61fb83dab1a6a237bea72625d53
|
[
"MIT"
] | null | null | null |
tests/constants.py
|
ankitchiplunkar/tbtc.py
|
76be1c6439aaf61fb83dab1a6a237bea72625d53
|
[
"MIT"
] | null | null | null |
txhash = "0xb538eabb6cea1fc3af58f1474c2b8f1adbf36a209ec8dc5534618b1f2d860c8e"
version = "1.1.0"
network = "ropsten"
address = 'bc1qzse3hm25w3nx70e8nlss6nlfusj7wd4q3m8gax'
transaction_data = {
'txid': '6cc808a28150482f783fdff7c99a6245a59437f55bb85575aa31c99ab2b0898b',
'hash': '6cc808a28150482f783fdff7c99a6245a59437f55bb85575aa31c99ab2b0898b',
'version': 2,
'size': 222,
'vsize': 222,
'weight': 888,
'locktime': 1865235,
'vin': [{
'txid': '3c1324004cf55aff8d4153bda4b6059a82f6fdc4aa43b5b2d26fa3a97eed0e4f',
'vout': 0,
'scriptSig': {
'asm': '3044022052d0875f4412e26e2db1470126f5ccc537e8998bcb5b203e6346ca9b1bf847d2022039182a20dd4c2a30b4155d4b72426aaa6c6cf97c02928c7c06fd4cff89251043[ALL] 0299b7faf388c5d8e6ba1654476083098e896bd2ec384aba20484b8a82d01496b6',
'hex': '473044022052d0875f4412e26e2db1470126f5ccc537e8998bcb5b203e6346ca9b1bf847d2022039182a20dd4c2a30b4155d4b72426aaa6c6cf97c02928c7c06fd4cff8925104301210299b7faf388c5d8e6ba1654476083098e896bd2ec384aba20484b8a82d01496b6'
},
'sequence': 4294967293
}],
'vout': [{
'value': 0.01,
'n': 0,
'scriptPubKey': {
'asm': '0 89c82f97d743d939d5c9f4068e3a53dfd09ec5fc',
'hex': '001489c82f97d743d939d5c9f4068e3a53dfd09ec5fc',
'reqSigs': 1,
'type': 'witness_v0_keyhash',
'addresses': ['tb1q38yzl97hg0vnn4wf7srguwjnmlgfa30uq3nrwt']}
}, {
'value': 1.989997,
'n': 1,
'scriptPubKey': {
'asm': 'OP_DUP OP_HASH160 4c8bda34fa519008db22b421711ee6b9fb52b559 OP_EQUALVERIFY OP_CHECKSIG',
'hex': '76a9144c8bda34fa519008db22b421711ee6b9fb52b55988ac',
'reqSigs': 1,
'type': 'pubkeyhash',
'addresses': ['mnVhBkEWwvP4MMeTBZoZa3GGTVsNm135eG']}
}],
'hex': '02000000014f0eed7ea9a36fd2b2b543aac4fdf6829a05b6a4bd53418dff5af54c0024133c000000006a473044022052d0875f4412e26e2db1470126f5ccc537e8998bcb5b203e6346ca9b1bf847d2022039182a20dd4c2a30b4155d4b72426aaa6c6cf97c02928c7c06fd4cff8925104301210299b7faf388c5d8e6ba1654476083098e896bd2ec384aba20484b8a82d01496b6fdffffff0240420f000000000016001489c82f97d743d939d5c9f4068e3a53dfd09ec5fc947edc0b000000001976a9144c8bda34fa519008db22b421711ee6b9fb52b55988ac13761c00',
'blockhash': '0000000005629b78403c6b58bf094b1987dd9e62a9349f71ff4882c05f0ad517',
'confirmations': 24854,
'time': 1603872469,
'blocktime': 1603872469
}
| 50.78
| 459
| 0.736904
| 94
| 2,539
| 19.829787
| 0.691489
| 0.016094
| 0.012876
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.483173
| 0.18078
| 2,539
| 49
| 460
| 51.816327
| 0.412981
| 0
| 0
| 0.130435
| 0
| 0
| 0.697794
| 0.58353
| 0
| 0
| 0.026005
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
6da755e83a5b8024a88b07d1e018e393bc1cff0f
| 68
|
py
|
Python
|
scanpy_recipes/versions.py
|
TheJacksonLaboratory/scanpy_recipes
|
09715f66fca0ca8101757fbcd9d3244603e4dd3a
|
[
"BSD-3-Clause"
] | 5
|
2018-12-18T18:46:57.000Z
|
2022-03-22T09:42:25.000Z
|
scanpy_recipes/versions.py
|
TheJacksonLaboratory/scanpy_recipes
|
09715f66fca0ca8101757fbcd9d3244603e4dd3a
|
[
"BSD-3-Clause"
] | 42
|
2018-12-19T20:38:26.000Z
|
2020-02-24T14:32:34.000Z
|
scanpy_recipes/versions.py
|
TheJacksonLaboratory/scanpy_recipes
|
09715f66fca0ca8101757fbcd9d3244603e4dd3a
|
[
"BSD-3-Clause"
] | null | null | null |
ANALYSIS_PIPELINE_VERSION = "0.9.0"
REPORT_SCHEMA_VERSION = "0.9.0"
| 22.666667
| 35
| 0.764706
| 12
| 68
| 4
| 0.583333
| 0.333333
| 0.375
| 0.416667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.096774
| 0.088235
| 68
| 2
| 36
| 34
| 0.677419
| 0
| 0
| 0
| 0
| 0
| 0.147059
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
6db1db1c98b17e0c8bdad7e041122de5239ecffc
| 148
|
py
|
Python
|
classifier/classes/data/groupers/CognitiveAbilitiesGroupingPolicy.py
|
canary-for-cognition/multimodal-dl-framework
|
54ebd3c6dcdfc48ed619316321d9f0e7a5f0fc9c
|
[
"MIT"
] | 2
|
2021-08-31T08:58:30.000Z
|
2021-09-02T14:32:30.000Z
|
classifier/classes/data/groupers/CognitiveAbilitiesGroupingPolicy.py
|
canary-for-cognition/multimodal-nn-framework
|
7733376b05840e2b3dead438dd3981db9694b6ae
|
[
"MIT"
] | 5
|
2020-09-22T04:29:25.000Z
|
2020-12-20T16:16:47.000Z
|
classifier/classes/data/groupers/CognitiveAbilitiesGroupingPolicy.py
|
canary-for-cognition/multimodal-nn-framework
|
7733376b05840e2b3dead438dd3981db9694b6ae
|
[
"MIT"
] | 1
|
2021-02-09T18:40:55.000Z
|
2021-02-09T18:40:55.000Z
|
class CognitiveAbilitiesGroupingPolicy:
@staticmethod
def group(filename: str) -> str:
return filename.split(".")[0].split("-")[0]
| 24.666667
| 51
| 0.655405
| 14
| 148
| 6.928571
| 0.714286
| 0.123711
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.016529
| 0.182432
| 148
| 5
| 52
| 29.6
| 0.785124
| 0
| 0
| 0
| 0
| 0
| 0.013514
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 0.25
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
096dcd2b9604a1328646dbe45091dd4828794c6d
| 67
|
py
|
Python
|
src/spyd/utils/groupby_utils.py
|
DanSeraf/spyd
|
af893b7f9c67785613b25754eb2cf150523a9fe4
|
[
"Zlib"
] | 1
|
2020-03-23T20:28:06.000Z
|
2020-03-23T20:28:06.000Z
|
src/spyd/utils/groupby_utils.py
|
DanSeraf/spyd
|
af893b7f9c67785613b25754eb2cf150523a9fe4
|
[
"Zlib"
] | 1
|
2022-02-05T16:59:53.000Z
|
2022-02-08T17:30:55.000Z
|
src/spyd/utils/groupby_utils.py
|
DanSeraf/spyd
|
af893b7f9c67785613b25754eb2cf150523a9fe4
|
[
"Zlib"
] | null | null | null |
def unroll_group(kv):
by, group = kv
return by, list(group)
| 22.333333
| 26
| 0.641791
| 11
| 67
| 3.818182
| 0.636364
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.238806
| 67
| 3
| 26
| 22.333333
| 0.823529
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
096de39240a3379ca4a20f0bc4cf54e4bda33d57
| 216
|
py
|
Python
|
blog_app/admin.py
|
Rxavio/django-blog
|
573ff668537465112d355490f19fa8bb8864fde8
|
[
"MIT"
] | null | null | null |
blog_app/admin.py
|
Rxavio/django-blog
|
573ff668537465112d355490f19fa8bb8864fde8
|
[
"MIT"
] | null | null | null |
blog_app/admin.py
|
Rxavio/django-blog
|
573ff668537465112d355490f19fa8bb8864fde8
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import *
from embed_video.admin import AdminVideoMixin
admin.site.register(Post)
admin.site.register(Comment)
admin.site.register(Video)
admin.site.register(FileAdmin)
| 21.6
| 45
| 0.824074
| 30
| 216
| 5.9
| 0.466667
| 0.20339
| 0.384181
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.083333
| 216
| 9
| 46
| 24
| 0.893939
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.428571
| 0
| 0.428571
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
0976ead2c6d98e1dbfb5768d8bef8c3b6618366d
| 34
|
py
|
Python
|
Restoration/ellipsoid_kernel.py
|
Joevaen/Scikit-image_On_CT
|
e3bf0eeadc50691041b4b7c44a19d07546a85001
|
[
"Apache-2.0"
] | null | null | null |
Restoration/ellipsoid_kernel.py
|
Joevaen/Scikit-image_On_CT
|
e3bf0eeadc50691041b4b7c44a19d07546a85001
|
[
"Apache-2.0"
] | null | null | null |
Restoration/ellipsoid_kernel.py
|
Joevaen/Scikit-image_On_CT
|
e3bf0eeadc50691041b4b7c44a19d07546a85001
|
[
"Apache-2.0"
] | null | null | null |
# 为recovery.rolling_ball创建一个椭圆形内核。
| 34
| 34
| 0.882353
| 3
| 34
| 9.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.029412
| 34
| 1
| 34
| 34
| 0.878788
| 0.941176
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
0996f7ffe724f99c3031b3e1837aeaa668818902
| 197
|
py
|
Python
|
pyvo/vomas/xml_interpreter/exceptions.py
|
lmichel/pyvo
|
8296bee2e799843909805fb6ae528a9b23776e8d
|
[
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null |
pyvo/vomas/xml_interpreter/exceptions.py
|
lmichel/pyvo
|
8296bee2e799843909805fb6ae528a9b23776e8d
|
[
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null |
pyvo/vomas/xml_interpreter/exceptions.py
|
lmichel/pyvo
|
8296bee2e799843909805fb6ae528a9b23776e8d
|
[
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null |
'''
Created on 11 Dec 2021
@author: laurentmichel
'''
class MappingException(Exception):
pass
class ParsingException(Exception):
pass
class NotImplementedException(Exception):
pass
| 13.133333
| 41
| 0.741117
| 19
| 197
| 7.684211
| 0.684211
| 0.267123
| 0.246575
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.03681
| 0.172589
| 197
| 14
| 42
| 14.071429
| 0.858896
| 0.233503
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
099c94398e4c876e35030a7ccb2e067e299da6b5
| 177
|
py
|
Python
|
configs/dla_lane/dla34up_lane_12e.py
|
XDong18/mmsegmentation
|
9a14288a654b66babfdfe4f6fa77edc4cd127d41
|
[
"Apache-2.0"
] | null | null | null |
configs/dla_lane/dla34up_lane_12e.py
|
XDong18/mmsegmentation
|
9a14288a654b66babfdfe4f6fa77edc4cd127d41
|
[
"Apache-2.0"
] | null | null | null |
configs/dla_lane/dla34up_lane_12e.py
|
XDong18/mmsegmentation
|
9a14288a654b66babfdfe4f6fa77edc4cd127d41
|
[
"Apache-2.0"
] | null | null | null |
_base_ = [
'../_base_/models/dla34up_lane.py',
'../_base_/datasets/bdd100k_lane.py',
'../_base_/schedules/bdd100k_lane_12e.py',
'../_base_/default_runtime.py'
]
| 25.285714
| 46
| 0.655367
| 21
| 177
| 4.809524
| 0.52381
| 0.178218
| 0.19802
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.065359
| 0.135593
| 177
| 6
| 47
| 29.5
| 0.594771
| 0
| 0
| 0
| 0
| 0
| 0.751412
| 0.751412
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
09be992ba5e582316fddf7bcb1972183bfeb517e
| 31
|
py
|
Python
|
tests/highlevel/add-compiled-language.py
|
sjdv1982/seamless
|
1b814341e74a56333c163f10e6f6ceab508b7df9
|
[
"MIT"
] | 15
|
2017-06-07T12:49:12.000Z
|
2020-07-25T18:06:04.000Z
|
tests/highlevel/add-compiled-language.py
|
sjdv1982/seamless
|
1b814341e74a56333c163f10e6f6ceab508b7df9
|
[
"MIT"
] | 110
|
2016-06-21T23:20:44.000Z
|
2022-02-24T16:15:22.000Z
|
tests/highlevel/add-compiled-language.py
|
sjdv1982/seamless
|
1b814341e74a56333c163f10e6f6ceab508b7df9
|
[
"MIT"
] | 6
|
2016-06-21T11:19:22.000Z
|
2019-01-21T13:45:39.000Z
|
#g++ -x c++ blah.cfront -o blah
| 31
| 31
| 0.580645
| 7
| 31
| 2.571429
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.16129
| 31
| 1
| 31
| 31
| 0.692308
| 0.967742
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
09d275a5fddb4a24580878c80a68376497ba9220
| 152
|
py
|
Python
|
src/0412_fizzbuzz.py
|
soamsy/leetcode
|
091f3b33e44613fac130ff1018c8b63493798f09
|
[
"MIT"
] | null | null | null |
src/0412_fizzbuzz.py
|
soamsy/leetcode
|
091f3b33e44613fac130ff1018c8b63493798f09
|
[
"MIT"
] | null | null | null |
src/0412_fizzbuzz.py
|
soamsy/leetcode
|
091f3b33e44613fac130ff1018c8b63493798f09
|
[
"MIT"
] | null | null | null |
def fizzBuzz(self, n: int) -> list[str]:
return [f"{'Fizz' if i % 3 == 0 else ''}{'Buzz' if i % 5 == 0 else ''}" or str(i) for i in range(1, n + 1)]
| 76
| 111
| 0.519737
| 31
| 152
| 2.548387
| 0.709677
| 0.075949
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.051724
| 0.236842
| 152
| 2
| 111
| 76
| 0.62931
| 0
| 0
| 0
| 0
| 0.5
| 0.392157
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0
| 0.5
| 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
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
09d8043c1ab08a693cc010a7c044b2a2bec689a8
| 136
|
py
|
Python
|
moto/cognitoidp/__init__.py
|
symroe/moto
|
4e106995af6f2820273528fca8a4e9ee288690a5
|
[
"Apache-2.0"
] | null | null | null |
moto/cognitoidp/__init__.py
|
symroe/moto
|
4e106995af6f2820273528fca8a4e9ee288690a5
|
[
"Apache-2.0"
] | 1
|
2022-02-19T02:10:45.000Z
|
2022-02-19T02:15:52.000Z
|
moto/cognitoidp/__init__.py
|
symroe/moto
|
4e106995af6f2820273528fca8a4e9ee288690a5
|
[
"Apache-2.0"
] | null | null | null |
from .models import cognitoidp_backends
from ..core.models import base_decorator
mock_cognitoidp = base_decorator(cognitoidp_backends)
| 27.2
| 53
| 0.860294
| 17
| 136
| 6.588235
| 0.529412
| 0.214286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.088235
| 136
| 4
| 54
| 34
| 0.903226
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
09e172d6d5464372b7e547d8726a40a170d01bba
| 44
|
py
|
Python
|
djangocms_relations/__init__.py
|
philippze/djangocms-relations
|
e4ff406700598fe20592ad46cde025de51fc0368
|
[
"MIT"
] | null | null | null |
djangocms_relations/__init__.py
|
philippze/djangocms-relations
|
e4ff406700598fe20592ad46cde025de51fc0368
|
[
"MIT"
] | null | null | null |
djangocms_relations/__init__.py
|
philippze/djangocms-relations
|
e4ff406700598fe20592ad46cde025de51fc0368
|
[
"MIT"
] | 1
|
2019-07-23T02:11:07.000Z
|
2019-07-23T02:11:07.000Z
|
#from .mixins import AutocopyRelationsMixin
| 22
| 43
| 0.863636
| 4
| 44
| 9.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.090909
| 44
| 1
| 44
| 44
| 0.95
| 0.954545
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
09e1b612bebede48bfc39d460e9e2db38b8ff751
| 132
|
py
|
Python
|
mastermind.py
|
gap892003/mastermind
|
c59437d1b50d54149ea56e099b65721d1969e606
|
[
"MIT"
] | 389
|
2016-01-26T10:26:08.000Z
|
2022-03-24T12:18:15.000Z
|
mastermind.py
|
rasata/mastermind
|
dc6166666e0321bdf3f528eb7bb601c6aa4fd4f1
|
[
"MIT"
] | 46
|
2016-01-18T10:13:04.000Z
|
2018-02-08T12:42:28.000Z
|
mastermind.py
|
rasata/mastermind
|
dc6166666e0321bdf3f528eb7bb601c6aa4fd4f1
|
[
"MIT"
] | 64
|
2016-02-19T05:10:19.000Z
|
2022-02-17T02:06:41.000Z
|
#!/usr/bin/env python
from __future__ import (absolute_import, print_function, division)
from mastermind import main
main.main()
| 16.5
| 66
| 0.787879
| 18
| 132
| 5.444444
| 0.722222
| 0.163265
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.121212
| 132
| 7
| 67
| 18.857143
| 0.844828
| 0.151515
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0.333333
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
09e4cfaba36950f2598585e7dbb3e91b003e2c6e
| 77
|
py
|
Python
|
tests/__init__.py
|
ka3bhy/wexpect
|
14a4279579a740ce15743db44228f3b0cf4ee8f4
|
[
"MIT"
] | 52
|
2019-04-24T14:38:43.000Z
|
2022-03-08T22:03:11.000Z
|
tests/__init__.py
|
ka3bhy/wexpect
|
14a4279579a740ce15743db44228f3b0cf4ee8f4
|
[
"MIT"
] | 51
|
2019-05-13T12:15:09.000Z
|
2021-12-15T14:00:15.000Z
|
tests/__init__.py
|
ka3bhy/wexpect
|
14a4279579a740ce15743db44228f3b0cf4ee8f4
|
[
"MIT"
] | 20
|
2019-07-15T15:48:31.000Z
|
2022-03-27T08:55:17.000Z
|
# __init__.py
# The mere presence of this file makes the dir a package.
pass
| 19.25
| 57
| 0.753247
| 14
| 77
| 3.857143
| 0.928571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.194805
| 77
| 3
| 58
| 25.666667
| 0.870968
| 0.87013
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 1
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.