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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3834a1c892c6add4c60a560b94fbde6a1d618040 | 251 | py | Python | acpki/models/Contract.py | sigurd120/acpki | 5994fe50f97adaddece4f961fe4e888dd7d014f4 | [
"BSD-Source-Code"
] | null | null | null | acpki/models/Contract.py | sigurd120/acpki | 5994fe50f97adaddece4f961fe4e888dd7d014f4 | [
"BSD-Source-Code"
] | null | null | null | acpki/models/Contract.py | sigurd120/acpki | 5994fe50f97adaddece4f961fe4e888dd7d014f4 | [
"BSD-Source-Code"
] | null | null | null | class Contract:
"""
Model class representing a Cisco ACI Contract
"""
def __init__(self, uid, name, dn):
self.uid = uid
self.name = name
self.dn = dn
def equals(self, con):
return self.dn == con.dn
| 20.916667 | 49 | 0.553785 | 33 | 251 | 4.090909 | 0.484848 | 0.103704 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.338645 | 251 | 11 | 50 | 22.818182 | 0.813253 | 0.179283 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0 | 0.142857 | 0.571429 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
3836b50753707e664310c41fdfbe621c72c591ad | 86 | py | Python | recommendations/kujikatsu/249/c.py | takelifetime/competitive-programming | e7cf8ef923ccefad39a1727ca94c610d650fcb76 | [
"BSD-2-Clause"
] | null | null | null | recommendations/kujikatsu/249/c.py | takelifetime/competitive-programming | e7cf8ef923ccefad39a1727ca94c610d650fcb76 | [
"BSD-2-Clause"
] | 1 | 2021-01-02T06:36:51.000Z | 2021-01-02T06:36:51.000Z | recommendations/kujikatsu/249/c.py | takelifetime/competitive-programming | e7cf8ef923ccefad39a1727ca94c610d650fcb76 | [
"BSD-2-Clause"
] | null | null | null | a, b, n = map(int, input().split())
x = min(b - 1, n)
print(a * x // b - a * (x // b)) | 28.666667 | 35 | 0.430233 | 19 | 86 | 1.947368 | 0.578947 | 0.108108 | 0.162162 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015625 | 0.255814 | 86 | 3 | 36 | 28.666667 | 0.5625 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.333333 | 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 | 0 | 0 | 0 | 0 | 0 | 3 |
69990cfc9621ec7083d9cf51ca5e92ac2a42610b | 5,567 | py | Python | opp/baseline_lrrf_upper.py | heeryoncho/sensors2018cnnhar | 2c0ae84b83a95bd5b5ab13df0fb3f5e8529df91f | [
"MIT"
] | 10 | 2018-09-25T07:55:30.000Z | 2020-05-08T15:01:56.000Z | opp/baseline_lrrf_upper.py | heeryoncho/sensors2018cnnhar | 2c0ae84b83a95bd5b5ab13df0fb3f5e8529df91f | [
"MIT"
] | null | null | null | opp/baseline_lrrf_upper.py | heeryoncho/sensors2018cnnhar | 2c0ae84b83a95bd5b5ab13df0fb3f5e8529df91f | [
"MIT"
] | 5 | 2018-12-12T16:40:26.000Z | 2020-10-29T01:24:07.000Z | from sklearn.metrics import accuracy_score
from sklearn.metrics import confusion_matrix
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import RandomForestClassifier
import select_data as sd
'''
See paper: Sensors 2018, 18(4), 1055; https://doi.org/10.3390/s18041055
"Divide and Conquer-Based 1D CNN Human Activity Recognition Using Test Data Sharpening"
by Heeryon Cho & Sang Min Yoon
This code outputs the UPPER body sensors data HAR performance using
other baseline machine learning techniques, such as
logistic regression and random forest,
given in the bar graph of Figure 15 (blue bars indicating Upper Body Sensors).
(Sensors 2018, 18(4), 1055, page 17 of 24)
'''
print "========================================================="
print " Outputs performance of other ML techniques, namely,"
print " Logistic Regression & Random Forest"
print " Using UPPER body sensors data."
print "========================================================="
print "\n==========================="
print " [UPPER] 4-Class"
print "===========================\n"
X_train, y_train, X_valid, y_valid, X_test, y_test = sd.load_data("upper", "end2end")
clf_lr = LogisticRegression(random_state=2018)
clf_lr.fit(X_train, y_train)
pred_lr = clf_lr.predict(X_test)
print "--- Logistic Regression ---"
print "Test Acc: ", accuracy_score(y_test, pred_lr)
print confusion_matrix(y_test, pred_lr), '\n'
clf_dt = RandomForestClassifier(random_state=2018, max_depth=5, n_estimators=10, max_features=1)
clf_dt.fit(X_train, y_train)
pred_dt = clf_dt.predict(X_test)
print "\n------ Random Forest ------"
print "Test Acc: ", accuracy_score(y_test, pred_dt)
print confusion_matrix(y_test, pred_dt)
#---------------------------------------------
print "\n==========================="
print " [UPPER] Abstract Class"
print "===========================\n"
X_train, y_train, X_valid, y_valid, X_test, y_test = sd.load_data("upper", "abst")
clf_lr = LogisticRegression(random_state=2018)
clf_lr.fit(X_train, y_train)
pred_lr = clf_lr.predict(X_test)
print "--- Logistic Regression ---"
print "Test ACC: ", accuracy_score(y_test, pred_lr)
print confusion_matrix(y_test, pred_lr), '\n'
clf_dt = RandomForestClassifier(random_state=2018, max_depth=5, n_estimators=10, max_features=1)
clf_dt.fit(X_train, y_train)
pred_dt = clf_dt.predict(X_test)
print "------ Random Forest ------"
print "Test Acc: ", accuracy_score(y_test, pred_dt)
print confusion_matrix(y_test, pred_dt)
#---------------------------------------------
print "\n==========================="
print " [UPPER] UP Class"
print "===========================\n"
X_train, y_train, X_valid, y_valid, X_test, y_test = sd.load_data("upper", "up")
clf_lr = LogisticRegression(random_state=2018)
clf_lr.fit(X_train, y_train)
pred_lr = clf_lr.predict(X_test)
print "--- Logistic Regression ---"
print "Test Acc: ", accuracy_score(y_test, pred_lr)
print confusion_matrix(y_test, pred_lr), '\n'
clf_dt = RandomForestClassifier(random_state=2018, max_depth=5, n_estimators=10, max_features=1)
clf_dt.fit(X_train, y_train)
pred_dt = clf_dt.predict(X_test)
print "------ Random Forest ------"
print "Test Acc: ", accuracy_score(y_test, pred_dt)
print confusion_matrix(y_test, pred_dt)
#---------------------------------------------
print "\n==========================="
print " [UPPER] DOWN Class"
print "===========================\n"
X_train, y_train, X_valid, y_valid, X_test, y_test = sd.load_data("upper", "down")
clf_lr = LogisticRegression(random_state=2018)
clf_lr.fit(X_train, y_train)
pred_lr = clf_lr.predict(X_test)
print "--- Logistic Regression ---"
print "Test Acc: ", accuracy_score(y_test, pred_lr)
print confusion_matrix(y_test, pred_lr), '\n'
clf_dt = RandomForestClassifier(random_state=2018, max_depth=5, n_estimators=10, max_features=1)
clf_dt.fit(X_train, y_train)
pred_dt = clf_dt.predict(X_test)
print "------ Random Forest ------"
print "Test Acc: ", accuracy_score(y_test, pred_dt)
print confusion_matrix(y_test, pred_dt)
print "\n--- End Output ---"
'''
/usr/bin/python2.7 /home/hcilab/Documents/OSS/sensors2018cnnhar/opp/baseline_lrrf_upper.py
=========================================================
Outputs performance of other ML techniques, namely,
Logistic Regression & Random Forest
Using UPPER body sensors data.
=========================================================
===========================
[UPPER] 4-Class
===========================
--- Logistic Regression ---
Test Acc: 0.833184789067
[[4860 333 133 0]
[1379 2497 9 0]
[ 316 76 3068 0]
[ 0 0 0 793]]
------ Random Forest ------
Test Acc: 0.80830362448
[[4959 218 149 0]
[1620 2199 66 0]
[ 32 12 3416 0]
[ 9 0 475 309]]
===========================
[UPPER] Abstract Class
===========================
--- Logistic Regression ---
Test ACC: 0.973336304219
[[9131 80]
[ 279 3974]]
------ Random Forest ------
Test Acc: 0.982174688057
[[9176 35]
[ 205 4048]]
===========================
[UPPER] UP Class
===========================
--- Logistic Regression ---
Test Acc: 0.812289653675
[[4875 451]
[1278 2607]]
------ Random Forest ------
Test Acc: 0.809358375855
[[5064 262]
[1494 2391]]
===========================
[UPPER] DOWN Class
===========================
--- Logistic Regression ---
Test Acc: 1.0
[[3460 0]
[ 0 793]]
------ Random Forest ------
Test Acc: 0.981189748413
[[3460 0]
[ 80 713]]
--- End Output ---
Process finished with exit code 0
''' | 29.146597 | 96 | 0.60679 | 738 | 5,567 | 4.363144 | 0.234417 | 0.031056 | 0.044721 | 0.044721 | 0.676708 | 0.628261 | 0.599379 | 0.572671 | 0.557143 | 0.557143 | 0 | 0.071354 | 0.134004 | 5,567 | 191 | 97 | 29.146597 | 0.596557 | 0.02425 | 0 | 0.746667 | 0 | 0 | 0.267634 | 0.100435 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.066667 | null | null | 0.56 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
69a520f1866db12311093e17ff6200b4515c5bbf | 33,413 | py | Python | zss_debug_pb2.py | StopPointTeam/APF-RRT | 2c68432d888b0886138c169e9fdcdfe0e41ca974 | [
"MIT"
] | null | null | null | zss_debug_pb2.py | StopPointTeam/APF-RRT | 2c68432d888b0886138c169e9fdcdfe0e41ca974 | [
"MIT"
] | null | null | null | zss_debug_pb2.py | StopPointTeam/APF-RRT | 2c68432d888b0886138c169e9fdcdfe0e41ca974 | [
"MIT"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: zss_debug.proto
from google.protobuf import descriptor_pb2
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import reflection as _reflection
from google.protobuf import message as _message
from google.protobuf import descriptor as _descriptor
import sys
_b = sys.version_info[0] < 3 and (
lambda x: x) or (lambda x: x.encode('latin1'))
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='zss_debug.proto',
package='ZSS.Protocol',
syntax='proto2',
serialized_pb=_b('\n\x0fzss_debug.proto\x12\x0cZSS.Protocol\"\x1d\n\x05Point\x12\t\n\x01x\x18\x01 \x02(\x02\x12\t\n\x01y\x18\x02 \x02(\x02\"U\n\tRectangle\x12#\n\x06point1\x18\x01 \x02(\x0b\x32\x13.ZSS.Protocol.Point\x12#\n\x06point2\x18\x02 \x02(\x0b\x32\x13.ZSS.Protocol.Point\"<\n\x0b\x44\x65\x62ug_Robot\x12 \n\x03pos\x18\x01 \x02(\x0b\x32\x13.ZSS.Protocol.Point\x12\x0b\n\x03\x64ir\x18\x02 \x02(\x02\"q\n\nDebug_Line\x12\"\n\x05start\x18\x01 \x02(\x0b\x32\x13.ZSS.Protocol.Point\x12 \n\x03\x65nd\x18\x02 \x02(\x0b\x32\x13.ZSS.Protocol.Point\x12\x0f\n\x07\x46ORWARD\x18\x03 \x02(\x08\x12\x0c\n\x04\x42\x41\x43K\x18\x04 \x02(\x08\"a\n\tDebug_Arc\x12*\n\trectangle\x18\x01 \x02(\x0b\x32\x17.ZSS.Protocol.Rectangle\x12\r\n\x05start\x18\x02 \x02(\x02\x12\x0b\n\x03\x65nd\x18\x03 \x02(\x02\x12\x0c\n\x04\x46ILL\x18\x04 \x02(\x08\"B\n\rDebug_Polygon\x12#\n\x06vertex\x18\x01 \x03(\x0b\x32\x13.ZSS.Protocol.Point\x12\x0c\n\x04\x46ILL\x18\x02 \x02(\x08\"<\n\nDebug_Text\x12 \n\x03pos\x18\x01 \x02(\x0b\x32\x13.ZSS.Protocol.Point\x12\x0c\n\x04text\x18\x02 \x02(\t\"?\n\x0c\x44\x65\x62ug_Curve_\x12\x0b\n\x03num\x18\x01 \x02(\x02\x12\x10\n\x08maxLimit\x18\x02 \x02(\x02\x12\x10\n\x08minLimit\x18\x03 \x02(\x02\"\x95\x01\n\x0b\x44\x65\x62ug_Curve\x12\"\n\x05start\x18\x01 \x02(\x0b\x32\x13.ZSS.Protocol.Point\x12\x1f\n\x02p1\x18\x02 \x02(\x0b\x32\x13.ZSS.Protocol.Point\x12\x1f\n\x02p2\x18\x03 \x02(\x0b\x32\x13.ZSS.Protocol.Point\x12 \n\x03\x65nd\x18\x04 \x02(\x0b\x32\x13.ZSS.Protocol.Point\"2\n\x0c\x44\x65\x62ug_Points\x12\"\n\x05point\x18\x01 \x03(\x0b\x32\x13.ZSS.Protocol.Point\"\xdf\x04\n\tDebug_Msg\x12\x30\n\x04type\x18\x01 \x02(\x0e\x32\".ZSS.Protocol.Debug_Msg.Debug_Type\x12,\n\x05\x63olor\x18\x02 \x02(\x0e\x32\x1d.ZSS.Protocol.Debug_Msg.Color\x12$\n\x03\x61rc\x18\x03 \x01(\x0b\x32\x17.ZSS.Protocol.Debug_Arc\x12&\n\x04line\x18\x04 \x01(\x0b\x32\x18.ZSS.Protocol.Debug_Line\x12&\n\x04text\x18\x05 \x01(\x0b\x32\x18.ZSS.Protocol.Debug_Text\x12(\n\x05robot\x18\x06 \x01(\x0b\x32\x19.ZSS.Protocol.Debug_Robot\x12)\n\x05\x63urve\x18\x07 \x01(\x0b\x32\x1a.ZSS.Protocol.Debug_Curve_\x12,\n\x07polygon\x18\x08 \x01(\x0b\x32\x1b.ZSS.Protocol.Debug_Polygon\x12*\n\x06points\x18\t \x01(\x0b\x32\x1a.ZSS.Protocol.Debug_Points\"X\n\nDebug_Type\x12\x07\n\x03\x41RC\x10\x00\x12\x08\n\x04LINE\x10\x01\x12\x08\n\x04TEXT\x10\x02\x12\t\n\x05ROBOT\x10\x03\x12\t\n\x05\x43URVE\x10\x04\x12\x0b\n\x07POLYGON\x10\x05\x12\n\n\x06Points\x10\x06\"s\n\x05\x43olor\x12\t\n\x05WHITE\x10\x00\x12\x07\n\x03RED\x10\x01\x12\n\n\x06ORANGE\x10\x02\x12\n\n\x06YELLOW\x10\x03\x12\t\n\x05GREEN\x10\x04\x12\x08\n\x04\x43YAN\x10\x05\x12\x08\n\x04\x42LUE\x10\x06\x12\n\n\x06PURPLE\x10\x07\x12\x08\n\x04GRAY\x10\x08\x12\t\n\x05\x42LACK\x10\t\"3\n\nDebug_Msgs\x12%\n\x04msgs\x18\x01 \x03(\x0b\x32\x17.ZSS.Protocol.Debug_Msg\"<\n\x0b\x44\x65\x62ug_Score\x12\r\n\x05\x63olor\x18\x01 \x02(\x05\x12\x1e\n\x01p\x18\x02 \x03(\x0b\x32\x13.ZSS.Protocol.Point\"9\n\x0c\x44\x65\x62ug_Scores\x12)\n\x06scores\x18\x01 \x03(\x0b\x32\x19.ZSS.Protocol.Debug_Score')
)
_DEBUG_MSG_DEBUG_TYPE = _descriptor.EnumDescriptor(
name='Debug_Type',
full_name='ZSS.Protocol.Debug_Msg.Debug_Type',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='ARC', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='LINE', index=1, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='TEXT', index=2, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='ROBOT', index=3, number=3,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='CURVE', index=4, number=4,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='POLYGON', index=5, number=5,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='Points', index=6, number=6,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=1229,
serialized_end=1317,
)
_sym_db.RegisterEnumDescriptor(_DEBUG_MSG_DEBUG_TYPE)
_DEBUG_MSG_COLOR = _descriptor.EnumDescriptor(
name='Color',
full_name='ZSS.Protocol.Debug_Msg.Color',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='WHITE', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='RED', index=1, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='ORANGE', index=2, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='YELLOW', index=3, number=3,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='GREEN', index=4, number=4,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='CYAN', index=5, number=5,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='BLUE', index=6, number=6,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='PURPLE', index=7, number=7,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='GRAY', index=8, number=8,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='BLACK', index=9, number=9,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=1319,
serialized_end=1434,
)
_sym_db.RegisterEnumDescriptor(_DEBUG_MSG_COLOR)
_POINT = _descriptor.Descriptor(
name='Point',
full_name='ZSS.Protocol.Point',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='x', full_name='ZSS.Protocol.Point.x', index=0,
number=1, type=2, cpp_type=6, label=2,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='y', full_name='ZSS.Protocol.Point.y', index=1,
number=2, type=2, cpp_type=6, label=2,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=33,
serialized_end=62,
)
_RECTANGLE = _descriptor.Descriptor(
name='Rectangle',
full_name='ZSS.Protocol.Rectangle',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='point1', full_name='ZSS.Protocol.Rectangle.point1', index=0,
number=1, type=11, cpp_type=10, label=2,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='point2', full_name='ZSS.Protocol.Rectangle.point2', index=1,
number=2, type=11, cpp_type=10, label=2,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=64,
serialized_end=149,
)
_DEBUG_ROBOT = _descriptor.Descriptor(
name='Debug_Robot',
full_name='ZSS.Protocol.Debug_Robot',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='pos', full_name='ZSS.Protocol.Debug_Robot.pos', index=0,
number=1, type=11, cpp_type=10, label=2,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='dir', full_name='ZSS.Protocol.Debug_Robot.dir', index=1,
number=2, type=2, cpp_type=6, label=2,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=151,
serialized_end=211,
)
_DEBUG_LINE = _descriptor.Descriptor(
name='Debug_Line',
full_name='ZSS.Protocol.Debug_Line',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='start', full_name='ZSS.Protocol.Debug_Line.start', index=0,
number=1, type=11, cpp_type=10, label=2,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='end', full_name='ZSS.Protocol.Debug_Line.end', index=1,
number=2, type=11, cpp_type=10, label=2,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='FORWARD', full_name='ZSS.Protocol.Debug_Line.FORWARD', index=2,
number=3, type=8, cpp_type=7, label=2,
has_default_value=False, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='BACK', full_name='ZSS.Protocol.Debug_Line.BACK', index=3,
number=4, type=8, cpp_type=7, label=2,
has_default_value=False, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=213,
serialized_end=326,
)
_DEBUG_ARC = _descriptor.Descriptor(
name='Debug_Arc',
full_name='ZSS.Protocol.Debug_Arc',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='rectangle', full_name='ZSS.Protocol.Debug_Arc.rectangle', index=0,
number=1, type=11, cpp_type=10, label=2,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='start', full_name='ZSS.Protocol.Debug_Arc.start', index=1,
number=2, type=2, cpp_type=6, label=2,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='end', full_name='ZSS.Protocol.Debug_Arc.end', index=2,
number=3, type=2, cpp_type=6, label=2,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='FILL', full_name='ZSS.Protocol.Debug_Arc.FILL', index=3,
number=4, type=8, cpp_type=7, label=2,
has_default_value=False, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=328,
serialized_end=425,
)
_DEBUG_POLYGON = _descriptor.Descriptor(
name='Debug_Polygon',
full_name='ZSS.Protocol.Debug_Polygon',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='vertex', full_name='ZSS.Protocol.Debug_Polygon.vertex', index=0,
number=1, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='FILL', full_name='ZSS.Protocol.Debug_Polygon.FILL', index=1,
number=2, type=8, cpp_type=7, label=2,
has_default_value=False, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=427,
serialized_end=493,
)
_DEBUG_TEXT = _descriptor.Descriptor(
name='Debug_Text',
full_name='ZSS.Protocol.Debug_Text',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='pos', full_name='ZSS.Protocol.Debug_Text.pos', index=0,
number=1, type=11, cpp_type=10, label=2,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='text', full_name='ZSS.Protocol.Debug_Text.text', index=1,
number=2, type=9, cpp_type=9, label=2,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=495,
serialized_end=555,
)
_DEBUG_CURVE_ = _descriptor.Descriptor(
name='Debug_Curve_',
full_name='ZSS.Protocol.Debug_Curve_',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='num', full_name='ZSS.Protocol.Debug_Curve_.num', index=0,
number=1, type=2, cpp_type=6, label=2,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='maxLimit', full_name='ZSS.Protocol.Debug_Curve_.maxLimit', index=1,
number=2, type=2, cpp_type=6, label=2,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='minLimit', full_name='ZSS.Protocol.Debug_Curve_.minLimit', index=2,
number=3, type=2, cpp_type=6, label=2,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=557,
serialized_end=620,
)
_DEBUG_CURVE = _descriptor.Descriptor(
name='Debug_Curve',
full_name='ZSS.Protocol.Debug_Curve',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='start', full_name='ZSS.Protocol.Debug_Curve.start', index=0,
number=1, type=11, cpp_type=10, label=2,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='p1', full_name='ZSS.Protocol.Debug_Curve.p1', index=1,
number=2, type=11, cpp_type=10, label=2,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='p2', full_name='ZSS.Protocol.Debug_Curve.p2', index=2,
number=3, type=11, cpp_type=10, label=2,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='end', full_name='ZSS.Protocol.Debug_Curve.end', index=3,
number=4, type=11, cpp_type=10, label=2,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=623,
serialized_end=772,
)
_DEBUG_POINTS = _descriptor.Descriptor(
name='Debug_Points',
full_name='ZSS.Protocol.Debug_Points',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='point', full_name='ZSS.Protocol.Debug_Points.point', index=0,
number=1, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=774,
serialized_end=824,
)
_DEBUG_MSG = _descriptor.Descriptor(
name='Debug_Msg',
full_name='ZSS.Protocol.Debug_Msg',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='type', full_name='ZSS.Protocol.Debug_Msg.type', index=0,
number=1, type=14, cpp_type=8, label=2,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='color', full_name='ZSS.Protocol.Debug_Msg.color', index=1,
number=2, type=14, cpp_type=8, label=2,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='arc', full_name='ZSS.Protocol.Debug_Msg.arc', index=2,
number=3, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='line', full_name='ZSS.Protocol.Debug_Msg.line', index=3,
number=4, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='text', full_name='ZSS.Protocol.Debug_Msg.text', index=4,
number=5, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='robot', full_name='ZSS.Protocol.Debug_Msg.robot', index=5,
number=6, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='curve', full_name='ZSS.Protocol.Debug_Msg.curve', index=6,
number=7, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='polygon', full_name='ZSS.Protocol.Debug_Msg.polygon', index=7,
number=8, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='points', full_name='ZSS.Protocol.Debug_Msg.points', index=8,
number=9, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
_DEBUG_MSG_DEBUG_TYPE,
_DEBUG_MSG_COLOR,
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=827,
serialized_end=1434,
)
_DEBUG_MSGS = _descriptor.Descriptor(
name='Debug_Msgs',
full_name='ZSS.Protocol.Debug_Msgs',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='msgs', full_name='ZSS.Protocol.Debug_Msgs.msgs', index=0,
number=1, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=1436,
serialized_end=1487,
)
_DEBUG_SCORE = _descriptor.Descriptor(
name='Debug_Score',
full_name='ZSS.Protocol.Debug_Score',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='color', full_name='ZSS.Protocol.Debug_Score.color', index=0,
number=1, type=5, cpp_type=1, label=2,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='p', full_name='ZSS.Protocol.Debug_Score.p', index=1,
number=2, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=1489,
serialized_end=1549,
)
_DEBUG_SCORES = _descriptor.Descriptor(
name='Debug_Scores',
full_name='ZSS.Protocol.Debug_Scores',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='scores', full_name='ZSS.Protocol.Debug_Scores.scores', index=0,
number=1, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=1551,
serialized_end=1608,
)
_RECTANGLE.fields_by_name['point1'].message_type = _POINT
_RECTANGLE.fields_by_name['point2'].message_type = _POINT
_DEBUG_ROBOT.fields_by_name['pos'].message_type = _POINT
_DEBUG_LINE.fields_by_name['start'].message_type = _POINT
_DEBUG_LINE.fields_by_name['end'].message_type = _POINT
_DEBUG_ARC.fields_by_name['rectangle'].message_type = _RECTANGLE
_DEBUG_POLYGON.fields_by_name['vertex'].message_type = _POINT
_DEBUG_TEXT.fields_by_name['pos'].message_type = _POINT
_DEBUG_CURVE.fields_by_name['start'].message_type = _POINT
_DEBUG_CURVE.fields_by_name['p1'].message_type = _POINT
_DEBUG_CURVE.fields_by_name['p2'].message_type = _POINT
_DEBUG_CURVE.fields_by_name['end'].message_type = _POINT
_DEBUG_POINTS.fields_by_name['point'].message_type = _POINT
_DEBUG_MSG.fields_by_name['type'].enum_type = _DEBUG_MSG_DEBUG_TYPE
_DEBUG_MSG.fields_by_name['color'].enum_type = _DEBUG_MSG_COLOR
_DEBUG_MSG.fields_by_name['arc'].message_type = _DEBUG_ARC
_DEBUG_MSG.fields_by_name['line'].message_type = _DEBUG_LINE
_DEBUG_MSG.fields_by_name['text'].message_type = _DEBUG_TEXT
_DEBUG_MSG.fields_by_name['robot'].message_type = _DEBUG_ROBOT
_DEBUG_MSG.fields_by_name['curve'].message_type = _DEBUG_CURVE_
_DEBUG_MSG.fields_by_name['polygon'].message_type = _DEBUG_POLYGON
_DEBUG_MSG.fields_by_name['points'].message_type = _DEBUG_POINTS
_DEBUG_MSG_DEBUG_TYPE.containing_type = _DEBUG_MSG
_DEBUG_MSG_COLOR.containing_type = _DEBUG_MSG
_DEBUG_MSGS.fields_by_name['msgs'].message_type = _DEBUG_MSG
_DEBUG_SCORE.fields_by_name['p'].message_type = _POINT
_DEBUG_SCORES.fields_by_name['scores'].message_type = _DEBUG_SCORE
DESCRIPTOR.message_types_by_name['Point'] = _POINT
DESCRIPTOR.message_types_by_name['Rectangle'] = _RECTANGLE
DESCRIPTOR.message_types_by_name['Debug_Robot'] = _DEBUG_ROBOT
DESCRIPTOR.message_types_by_name['Debug_Line'] = _DEBUG_LINE
DESCRIPTOR.message_types_by_name['Debug_Arc'] = _DEBUG_ARC
DESCRIPTOR.message_types_by_name['Debug_Polygon'] = _DEBUG_POLYGON
DESCRIPTOR.message_types_by_name['Debug_Text'] = _DEBUG_TEXT
DESCRIPTOR.message_types_by_name['Debug_Curve_'] = _DEBUG_CURVE_
DESCRIPTOR.message_types_by_name['Debug_Curve'] = _DEBUG_CURVE
DESCRIPTOR.message_types_by_name['Debug_Points'] = _DEBUG_POINTS
DESCRIPTOR.message_types_by_name['Debug_Msg'] = _DEBUG_MSG
DESCRIPTOR.message_types_by_name['Debug_Msgs'] = _DEBUG_MSGS
DESCRIPTOR.message_types_by_name['Debug_Score'] = _DEBUG_SCORE
DESCRIPTOR.message_types_by_name['Debug_Scores'] = _DEBUG_SCORES
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
Point = _reflection.GeneratedProtocolMessageType('Point', (_message.Message,), dict(
DESCRIPTOR=_POINT,
__module__='zss_debug_pb2'
# @@protoc_insertion_point(class_scope:ZSS.Protocol.Point)
))
_sym_db.RegisterMessage(Point)
Rectangle = _reflection.GeneratedProtocolMessageType('Rectangle', (_message.Message,), dict(
DESCRIPTOR=_RECTANGLE,
__module__='zss_debug_pb2'
# @@protoc_insertion_point(class_scope:ZSS.Protocol.Rectangle)
))
_sym_db.RegisterMessage(Rectangle)
Debug_Robot = _reflection.GeneratedProtocolMessageType('Debug_Robot', (_message.Message,), dict(
DESCRIPTOR=_DEBUG_ROBOT,
__module__='zss_debug_pb2'
# @@protoc_insertion_point(class_scope:ZSS.Protocol.Debug_Robot)
))
_sym_db.RegisterMessage(Debug_Robot)
Debug_Line = _reflection.GeneratedProtocolMessageType('Debug_Line', (_message.Message,), dict(
DESCRIPTOR=_DEBUG_LINE,
__module__='zss_debug_pb2'
# @@protoc_insertion_point(class_scope:ZSS.Protocol.Debug_Line)
))
_sym_db.RegisterMessage(Debug_Line)
Debug_Arc = _reflection.GeneratedProtocolMessageType('Debug_Arc', (_message.Message,), dict(
DESCRIPTOR=_DEBUG_ARC,
__module__='zss_debug_pb2'
# @@protoc_insertion_point(class_scope:ZSS.Protocol.Debug_Arc)
))
_sym_db.RegisterMessage(Debug_Arc)
Debug_Polygon = _reflection.GeneratedProtocolMessageType('Debug_Polygon', (_message.Message,), dict(
DESCRIPTOR=_DEBUG_POLYGON,
__module__='zss_debug_pb2'
# @@protoc_insertion_point(class_scope:ZSS.Protocol.Debug_Polygon)
))
_sym_db.RegisterMessage(Debug_Polygon)
Debug_Text = _reflection.GeneratedProtocolMessageType('Debug_Text', (_message.Message,), dict(
DESCRIPTOR=_DEBUG_TEXT,
__module__='zss_debug_pb2'
# @@protoc_insertion_point(class_scope:ZSS.Protocol.Debug_Text)
))
_sym_db.RegisterMessage(Debug_Text)
Debug_Curve_ = _reflection.GeneratedProtocolMessageType('Debug_Curve_', (_message.Message,), dict(
DESCRIPTOR=_DEBUG_CURVE_,
__module__='zss_debug_pb2'
# @@protoc_insertion_point(class_scope:ZSS.Protocol.Debug_Curve_)
))
_sym_db.RegisterMessage(Debug_Curve_)
Debug_Curve = _reflection.GeneratedProtocolMessageType('Debug_Curve', (_message.Message,), dict(
DESCRIPTOR=_DEBUG_CURVE,
__module__='zss_debug_pb2'
# @@protoc_insertion_point(class_scope:ZSS.Protocol.Debug_Curve)
))
_sym_db.RegisterMessage(Debug_Curve)
Debug_Points = _reflection.GeneratedProtocolMessageType('Debug_Points', (_message.Message,), dict(
DESCRIPTOR=_DEBUG_POINTS,
__module__='zss_debug_pb2'
# @@protoc_insertion_point(class_scope:ZSS.Protocol.Debug_Points)
))
_sym_db.RegisterMessage(Debug_Points)
Debug_Msg = _reflection.GeneratedProtocolMessageType('Debug_Msg', (_message.Message,), dict(
DESCRIPTOR=_DEBUG_MSG,
__module__='zss_debug_pb2'
# @@protoc_insertion_point(class_scope:ZSS.Protocol.Debug_Msg)
))
_sym_db.RegisterMessage(Debug_Msg)
Debug_Msgs = _reflection.GeneratedProtocolMessageType('Debug_Msgs', (_message.Message,), dict(
DESCRIPTOR=_DEBUG_MSGS,
__module__='zss_debug_pb2'
# @@protoc_insertion_point(class_scope:ZSS.Protocol.Debug_Msgs)
))
_sym_db.RegisterMessage(Debug_Msgs)
Debug_Score = _reflection.GeneratedProtocolMessageType('Debug_Score', (_message.Message,), dict(
DESCRIPTOR=_DEBUG_SCORE,
__module__='zss_debug_pb2'
# @@protoc_insertion_point(class_scope:ZSS.Protocol.Debug_Score)
))
_sym_db.RegisterMessage(Debug_Score)
Debug_Scores = _reflection.GeneratedProtocolMessageType('Debug_Scores', (_message.Message,), dict(
DESCRIPTOR=_DEBUG_SCORES,
__module__='zss_debug_pb2'
# @@protoc_insertion_point(class_scope:ZSS.Protocol.Debug_Scores)
))
_sym_db.RegisterMessage(Debug_Scores)
# @@protoc_insertion_point(module_scope)
| 38.186286 | 3,019 | 0.671864 | 4,184 | 33,413 | 5.060707 | 0.062141 | 0.056673 | 0.054406 | 0.049353 | 0.769576 | 0.713753 | 0.649901 | 0.618022 | 0.593133 | 0.581373 | 0 | 0.046577 | 0.203873 | 33,413 | 874 | 3,020 | 38.229977 | 0.749408 | 0.030677 | 0 | 0.665423 | 1 | 0.001244 | 0.173376 | 0.133276 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.007463 | 0 | 0.007463 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
69aa3b2782a1e4f6d886bd6026cd8fd3d7967980 | 403 | py | Python | inferlo/testing/experiment_runner_test.py | InferLO/inferlo | a65efce721d7f99d2f274dd94a1aaf7ca159e944 | [
"Apache-2.0"
] | 1 | 2022-01-27T18:44:07.000Z | 2022-01-27T18:44:07.000Z | inferlo/testing/experiment_runner_test.py | InferLO/inferlo | a65efce721d7f99d2f274dd94a1aaf7ca159e944 | [
"Apache-2.0"
] | 3 | 2022-01-23T18:02:30.000Z | 2022-01-27T23:10:51.000Z | inferlo/testing/experiment_runner_test.py | InferLO/inferlo | a65efce721d7f99d2f274dd94a1aaf7ca159e944 | [
"Apache-2.0"
] | 1 | 2021-09-03T06:12:57.000Z | 2021-09-03T06:12:57.000Z | # Copyright (c) The InferLO authors. All rights reserved.
# Licensed under the Apache License, Version 2.0 - see LICENSE.
from inferlo.testing import ExperimentRunner
def test_run_experiment():
def my_experiment(x=0):
return {"square": x * x, "cube": x * x * x}
runner = ExperimentRunner()
result = runner.run_experiment(my_experiment, {'x': 2})
assert result['square'] == 4
| 28.785714 | 63 | 0.682382 | 54 | 403 | 5 | 0.611111 | 0.022222 | 0.096296 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015432 | 0.19603 | 403 | 13 | 64 | 31 | 0.817901 | 0.290323 | 0 | 0 | 0 | 0 | 0.060071 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 1 | 0.285714 | false | 0 | 0.142857 | 0.142857 | 0.571429 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
69f1e9cbbe7a9063f003afdafb274eaf79f6665a | 2,204 | py | Python | code/mts_agent_python/config/mts_import.py | mtsquant/MTS | ab7ecab0f88c844289b5c81e5627326fe36e682f | [
"Apache-2.0"
] | 8 | 2019-03-28T04:15:59.000Z | 2021-03-23T14:29:43.000Z | code/mts_agent_python/config/mts_import.py | mtsquant/MTS | ab7ecab0f88c844289b5c81e5627326fe36e682f | [
"Apache-2.0"
] | null | null | null | code/mts_agent_python/config/mts_import.py | mtsquant/MTS | ab7ecab0f88c844289b5c81e5627326fe36e682f | [
"Apache-2.0"
] | 5 | 2019-11-06T12:39:21.000Z | 2021-01-28T19:14:14.000Z | #!/usr/bin/env python
# encoding: utf-8
import signal
import sys
#import pandas as pd
#import numpy as np
def setGlobals(g):
#print globals()
globals().update(g)
#print globals()
def exit():
mtsExit(0)
def quit(signum):
sys.exit(signum)
def quitNow(signum,frame):
quit(signum)
def initialize(params,p2=None):
signal.signal(signal.SIGINT, quitNow)
signal.signal(signal.SIGTERM, quitNow)
if (p2==None):
return mtsInitialize(params)
else:
return mtsInitialize(params,p2)
def execute():
mtsExecute()
def info(*tp):
return mtsInfo(tp)
def log(*tp):
return mtsLog(tp)
def warn(*tp):
return mtsWarn(tp)
def error(*tp):
return mtsError(tp)
def file(*tp):
return mtsFile(tp)
def genMtsStratgyClass():
class Strategy(StrategyBase):
def __init__(self,name, strategyId):
super(Strategy, self).__init__(name,strategyId)
def newDirectOrder(self,symbol,price,volume,direction,offsetFlag):
return self.newOrder({"type":1,"symbol":symbol,"price":price,"volume":volume,"direction":direction,"offsetFlag":offsetFlag})
def newNetOrder(self,symbol,price,volume):
return self.newOrder({"type":2,"symbol":symbol,"price":price,"volume":volume})
def newBoxOrder(self,symbol,price,volume):
return self.newOrder({"type":3,"symbol":symbol,"price":price,"volume":volume})
# def history(self,symbol,count):
# pf = pd.DataFrame(self.getHistory(symbol, count),
# columns=['date', 'open', 'high', 'low', 'close', 'volume', 'vwap'])
# pf['date'] = pd.to_datetime(pf['date'],format='%Y%m%d %H%M%S')
# return pf.set_index('date').astype(np.float64)
#
# def dailyHistory(self, symbol, count):
# pf = pd.DataFrame(self.getDailyHistory(symbol, count),
# columns=['date', 'open', 'high', 'low', 'close', 'volume', 'vwap'])
# pf['date'] = pd.to_datetime(pf['date'], format='%Y%m%d %H%M%S')
# return pf.set_index('date').astype(np.float64)
return Strategy | 29.386667 | 136 | 0.596642 | 263 | 2,204 | 4.954373 | 0.376426 | 0.050652 | 0.034536 | 0.04835 | 0.38066 | 0.38066 | 0.354566 | 0.248657 | 0.182655 | 0.182655 | 0 | 0.007186 | 0.242287 | 2,204 | 75 | 137 | 29.386667 | 0.773054 | 0.319419 | 0 | 0 | 0 | 0 | 0.055256 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0 | 0.05 | 0.2 | 0.75 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
69fa2fbc965cdaf80ea59da7e32e4769409474b2 | 146 | py | Python | web/apps.py | jakubhyza/kelvin | b06c0ed0594a3fb48df1e50ff30cee010ddeea5a | [
"MIT"
] | 8 | 2020-01-11T15:25:25.000Z | 2022-02-20T17:32:58.000Z | web/apps.py | jakubhyza/kelvin | b06c0ed0594a3fb48df1e50ff30cee010ddeea5a | [
"MIT"
] | 72 | 2020-01-13T21:07:26.000Z | 2022-03-28T10:17:50.000Z | web/apps.py | jakubhyza/kelvin | b06c0ed0594a3fb48df1e50ff30cee010ddeea5a | [
"MIT"
] | 6 | 2020-01-11T16:50:04.000Z | 2022-02-19T10:12:19.000Z | import logging
from django.apps import AppConfig
class WebConfig(AppConfig):
name = 'web'
def ready(self):
import web.signals
| 13.272727 | 33 | 0.684932 | 18 | 146 | 5.555556 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.239726 | 146 | 10 | 34 | 14.6 | 0.900901 | 0 | 0 | 0 | 0 | 0 | 0.02069 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.5 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
69fc9eb460e76e55a0c0964c725759eeda16183f | 4,291 | py | Python | src/genie/libs/parser/iosxr/tests/ShowIsisSpfLogDetail/cli/equal/golden_output_1_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 204 | 2018-06-27T00:55:27.000Z | 2022-03-06T21:12:18.000Z | src/genie/libs/parser/iosxr/tests/ShowIsisSpfLogDetail/cli/equal/golden_output_1_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 468 | 2018-06-19T00:33:18.000Z | 2022-03-31T23:23:35.000Z | src/genie/libs/parser/iosxr/tests/ShowIsisSpfLogDetail/cli/equal/golden_output_1_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 309 | 2019-01-16T20:21:07.000Z | 2022-03-30T12:56:41.000Z |
expected_output = {
'instance': {
'isp': {
'address_family': {
'IPv4 Unicast': {
'spf_log': {
1: {
'type': 'FSPF',
'time_ms': 1,
'level': 1,
'total_nodes': 1,
'trigger_count': 1,
'first_trigger_lsp': '12a5.00-00',
'triggers': 'NEWLSP0',
'start_timestamp': 'Mon Aug 16 2004 19:25:35.140',
'delay': {
'since_first_trigger_ms': 51,
},
'spt_calculation': {
'cpu_time_ms': 0,
'real_time_ms': 0,
},
'prefix_update': {
'cpu_time_ms': 1,
'real_time_ms': 1,
},
'new_lsp_arrivals': 0,
'next_wait_interval_ms': 200,
'results': {
'nodes': {
'reach': 1,
'unreach': 0,
'total': 1,
},
'prefixes': {
'items': {
'critical_priority': {
'reach': 0,
'unreach': 0,
'total': 0,
},
'high_priority': {
'reach': 0,
'unreach': 0,
'total': 0,
},
'medium_priority': {
'reach': 0,
'unreach': 0,
'total': 0,
},
'low_priority': {
'reach': 0,
'unreach': 0,
'total': 0,
},
'all_priority': {
'reach': 0,
'unreach': 0,
'total': 0,
},
},
'routes': {
'critical_priority': {
'reach': 0,
'total': 0,
},
'high_priority': {
'reach': 0,
'total': 0,
},
'medium_priority': {
'reach': 0,
'total': 0,
},
'low_priority': {
'reach': 0,
'total': 0,
},
'all_priority': {
'reach': 0,
'total': 0,
},
},
},
},
},
},
},
},
},
},
}
| 44.697917 | 78 | 0.158471 | 158 | 4,291 | 4.06962 | 0.405063 | 0.102644 | 0.217729 | 0.163297 | 0.423017 | 0.393468 | 0.393468 | 0 | 0 | 0 | 0 | 0.066337 | 0.764624 | 4,291 | 95 | 79 | 45.168421 | 0.570297 | 0 | 0 | 0.387097 | 0 | 0 | 0.147354 | 0.010026 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
0e1611a439cc500182af60fc5b7313268d89e061 | 50 | py | Python | Python/Uti1016_Distancia.py | bragabriel/Beecrowd | a71dd9926b422b5e82ae84bb5ccd76cf3ebd292b | [
"MIT"
] | null | null | null | Python/Uti1016_Distancia.py | bragabriel/Beecrowd | a71dd9926b422b5e82ae84bb5ccd76cf3ebd292b | [
"MIT"
] | null | null | null | Python/Uti1016_Distancia.py | bragabriel/Beecrowd | a71dd9926b422b5e82ae84bb5ccd76cf3ebd292b | [
"MIT"
] | null | null | null | km = int(input())
print('{} minutos'.format(km*2)) | 25 | 32 | 0.62 | 8 | 50 | 3.875 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.021739 | 0.08 | 50 | 2 | 32 | 25 | 0.652174 | 0 | 0 | 0 | 0 | 0 | 0.196078 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
3875c54506abd3c3f854187b77048a2fc7f1b45c | 245 | py | Python | validators.py | mk-rn/django_cash_register | f317d94dd50817160e883e2f452f7b8e824f4a1c | [
"MIT"
] | null | null | null | validators.py | mk-rn/django_cash_register | f317d94dd50817160e883e2f452f7b8e824f4a1c | [
"MIT"
] | null | null | null | validators.py | mk-rn/django_cash_register | f317d94dd50817160e883e2f452f7b8e824f4a1c | [
"MIT"
] | null | null | null | from django.core.exceptions import ValidationError
def positive_number(value):
"""Checking the value. Must be greater than 0."""
if value <= 0.0:
raise ValidationError('Count must be greater than 0', params={'value': value},)
| 27.222222 | 87 | 0.693878 | 33 | 245 | 5.121212 | 0.636364 | 0.071006 | 0.153846 | 0.201183 | 0.213018 | 0 | 0 | 0 | 0 | 0 | 0 | 0.020101 | 0.187755 | 245 | 8 | 88 | 30.625 | 0.829146 | 0.17551 | 0 | 0 | 0 | 0 | 0.168367 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.5 | 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 | 0 | 0 | 0 | 0 | 0 | 3 |
388501d208ae63f4dc2d1e7114cc8996d14643dd | 2,576 | py | Python | tests/binary/run.py | learnflexswitch/pyangbind | 7b39fec6806b516c442f920a8396d2e1fa9c36b1 | [
"Apache-2.0"
] | 1 | 2021-07-15T18:12:28.000Z | 2021-07-15T18:12:28.000Z | tests/binary/run.py | ktbyers/pyangbind | 39f9f8d842c66dde784c45369ea7b280f375401a | [
"Apache-2.0"
] | null | null | null | tests/binary/run.py | ktbyers/pyangbind | 39f9f8d842c66dde784c45369ea7b280f375401a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os, sys, getopt
TESTNAME="binary"
# generate bindings in this folder
def main():
try:
opts, args = getopt.getopt(sys.argv[1:], "k", ["keepfiles"])
except getopt.GetoptError as e:
print str(e)
sys.exit(127)
k = False
for o, a in opts:
if o in ["-k", "--keepfiles"]:
k = True
pyangpath = os.environ.get('PYANGPATH') if os.environ.get('PYANGPATH') is not None else False
pyangbindpath = os.environ.get('PYANGBINDPATH') if os.environ.get('PYANGBINDPATH') is not None else False
assert not pyangpath == False, "could not find path to pyang"
assert not pyangbindpath == False, "could not resolve pyangbind directory"
this_dir = os.path.dirname(os.path.realpath(__file__))
os.system("%s --plugindir %s -f pybind -o %s/bindings.py %s/%s.yang" % (pyangpath, pyangbindpath, this_dir, this_dir, TESTNAME))
from bindings import binary as b
from bitarray import bitarray
t = b()
for i in ["b1", "b2", "b3"]:
assert hasattr(t.container, i), "element did not exist in container (%s)" \
% i
for value in [("01110", True, [False, True, True, True, False],), \
({"42": 42}, True, [True]), \
]:
passed = True
try:
t.container.b1 = value[0]
except:
passed = False
assert passed == value[1], "could incorrectly set b1 to %s" % value[0]
assert t.container.b2._default == bitarray("0100"), \
"Default for leaf b2 was not set correctly (%s != %s)" \
% (t.container.b2._default, bitarray("0100"))
assert t.container.b2 == bitarray(), \
"Value of bitarray was not null when checking b2 (%s != %s)" \
% (t.container.b2, bitarray())
assert t.container.b2._changed() == False, \
"Unset bitarray specified changed when was default (%s != False)" \
% (t.container.b2._changed())
t.container.b2 = bitarray("010")
assert t.container.b2 == bitarray('010'), \
"Bitarray not successfuly set (%s != %s)" % (t.container.b2, bitarray('010'))
assert t.container.b2._changed() == True, \
"Bitarray value not flagged as changed (%s != %s)" % (t.container.b2._changed(), True)
for v in [("0", True), ("01", True), ("010", False)]:
try:
t.container.b3 = v[0]
passed = True
except ValueError:
passed = False
assert passed == v[1], "limited length binary incorrectly set to %s (%s != %s)" \
% (v[0], v[1], passed)
if not k:
os.system("/bin/rm %s/bindings.py" % this_dir)
os.system("/bin/rm %s/bindings.pyc" % this_dir)
if __name__ == '__main__':
main()
| 33.454545 | 130 | 0.615295 | 366 | 2,576 | 4.26776 | 0.297814 | 0.089629 | 0.084507 | 0.057618 | 0.222791 | 0.135723 | 0.052497 | 0.052497 | 0.052497 | 0 | 0 | 0.03083 | 0.219332 | 2,576 | 76 | 131 | 33.894737 | 0.745898 | 0.020575 | 0 | 0.116667 | 1 | 0.016667 | 0.264181 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 0 | null | null | 0.116667 | 0.05 | null | null | 0.016667 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
38abddcaea188dde02e036dee74516a15526f072 | 678 | py | Python | project/user/models/user.py | fv316/flask-template-project | 026459b299c7aa4d82c2b59b98e3c929b4786a78 | [
"MIT"
] | 9 | 2017-02-08T21:42:15.000Z | 2021-12-15T05:18:18.000Z | project/user/models/user.py | fv316/flask-template-project | 026459b299c7aa4d82c2b59b98e3c929b4786a78 | [
"MIT"
] | 10 | 2016-07-25T11:00:08.000Z | 2019-09-25T14:56:40.000Z | project/user/models/user.py | fv316/flask-template-project | 026459b299c7aa4d82c2b59b98e3c929b4786a78 | [
"MIT"
] | 7 | 2016-11-01T20:11:03.000Z | 2020-02-04T14:25:49.000Z | # !/usr/bin/python
# -*- coding: utf-8 -*-
from project.database import Base
from sqlalchemy.orm import relationship
from sqlalchemy import Column, Integer, String
from flask_login import UserMixin
from project.user.models.rbac_user_mixin import UserMixin as RBACUserMixin
class User(RBACUserMixin, UserMixin, Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
username = Column(String(64), unique=True)
email = Column(String(128), unique=True)
password = Column(String(128))
api_key = Column(String(128))
roles = relationship('Role', secondary='user_roles')
def __repr__(self):
return '<User %r>' % self.username
| 29.478261 | 74 | 0.721239 | 86 | 678 | 5.523256 | 0.55814 | 0.101053 | 0.094737 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.021201 | 0.165192 | 678 | 22 | 75 | 30.818182 | 0.818021 | 0.056047 | 0 | 0 | 0 | 0 | 0.043956 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.066667 | false | 0.066667 | 0.333333 | 0.066667 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 3 |
38aff846c9fd73e215fb8964d1e02ff8c3aed61f | 775 | py | Python | scitbx/examples/principal_axes_of_inertia.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | scitbx/examples/principal_axes_of_inertia.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | scitbx/examples/principal_axes_of_inertia.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | from __future__ import division
from scitbx.math import principal_axes_of_inertia
from scitbx.array_family import flex
def run():
points = flex.vec3_double([
( 8.292, 1.817, 6.147),
( 9.159, 2.144, 7.299),
(10.603, 2.331, 6.885),
(11.041, 1.811, 5.855),
( 9.061, 1.065, 8.369),
( 7.665, 0.929, 8.902),
( 6.771, 0.021, 8.327),
( 7.210, 1.756, 9.920),
( 5.480, -0.094, 8.796),
( 5.904, 1.649, 10.416),
( 5.047, 0.729, 9.831),
( 3.766, 0.589, 10.291),
(11.358, 2.999, 7.612)])
pai = principal_axes_of_inertia(points=points)
print pai.center_of_mass()
print pai.inertia_tensor()
es = pai.eigensystem()
print list(es.values())
print list(es.vectors())
if (__name__ == "__main__"):
run()
| 26.724138 | 49 | 0.579355 | 133 | 775 | 3.203008 | 0.609023 | 0.046948 | 0.070423 | 0.103286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.271357 | 0.229677 | 775 | 28 | 50 | 27.678571 | 0.442211 | 0 | 0 | 0 | 0 | 0 | 0.010323 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.115385 | null | null | 0.153846 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
38cb1f29849026e4492f8972be47ed86aeea596c | 118 | py | Python | apps/enterprice/apps.py | jimforit/lagou | 165593a15597012092b5e0ba34158fbc1d1c213d | [
"MIT"
] | 2 | 2019-03-11T03:58:19.000Z | 2020-03-06T06:45:28.000Z | apps/enterprice/apps.py | jimforit/lagou | 165593a15597012092b5e0ba34158fbc1d1c213d | [
"MIT"
] | 5 | 2020-06-05T20:04:20.000Z | 2021-09-08T00:53:52.000Z | apps/enterprice/apps.py | jimforit/lagou | 165593a15597012092b5e0ba34158fbc1d1c213d | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class EnterpriceConfig(AppConfig):
name = 'enterprice'
verbose_name = '企业' | 19.666667 | 34 | 0.737288 | 13 | 118 | 6.615385 | 0.846154 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.177966 | 118 | 6 | 35 | 19.666667 | 0.886598 | 0 | 0 | 0 | 0 | 0 | 0.10084 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
2a145ab11f78cc5615c8d4ed402ea232a50a31a2 | 297 | py | Python | exercises/ja/solution_01_03_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/ja/solution_01_03_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/ja/solution_01_03_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | # spaCyをインポートし、日本語のnlpオブジェクトを作成
import spacy
nlp = spacy.blank("ja")
# テキストを処理
doc = nlp("私はツリーカンガルーとイッカクが好きです。")
# 「ツリーカンガルー」のスライスを選択
tree_kangaroos = doc[2:4]
print(tree_kangaroos.text)
# 「ツリーカンガルーとイッカク」のスライスを選択
tree_kangaroos_and_narwhals = doc[2:6]
print(tree_kangaroos_and_narwhals.text)
| 18.5625 | 39 | 0.787879 | 38 | 297 | 5.947368 | 0.578947 | 0.230089 | 0.185841 | 0.212389 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.01487 | 0.094276 | 297 | 15 | 40 | 19.8 | 0.825279 | 0.26936 | 0 | 0 | 0 | 0 | 0.108491 | 0.099057 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.142857 | 0 | 0.142857 | 0.285714 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
2a2c9906dc961361309d725a8c8106f33e523ad9 | 5,624 | py | Python | stateflow/stateclass.py | frolenkov-nikita/django-stateflow | 0a5d75e42606b662c7d510b5d5ef7cb996cf185b | [
"BSD-3-Clause"
] | null | null | null | stateflow/stateclass.py | frolenkov-nikita/django-stateflow | 0a5d75e42606b662c7d510b5d5ef7cb996cf185b | [
"BSD-3-Clause"
] | null | null | null | stateflow/stateclass.py | frolenkov-nikita/django-stateflow | 0a5d75e42606b662c7d510b5d5ef7cb996cf185b | [
"BSD-3-Clause"
] | null | null | null | """
Workflow based on Python classes
"""
class StateMetaclass(type):
def __init__(cls, name, bases, dict):
super(StateMetaclass, cls).__init__(name, bases, dict)
abstract = dict.pop('abstract', False)
if not abstract:
cls.forward_transitions = []
cls.backward_transitions = []
# TODO: This method don't belong to 'general' part
# But it's here because of metaclass conflict.
# Something should be done about it
def __str__(cls):
return cls.get_title()
def __repr__(cls):
return "<State: '%s'>" % cls.get_title()
class TransitionMetaclass(type):
def __init__(cls, name, bases, dict):
super(TransitionMetaclass, cls).__init__(name, bases, dict)
abstract = dict.pop('abstract', False)
if not abstract:
for klass in dict['income']:
forward_transitions = getattr(klass, 'forward_transitions')
forward_transitions.append(cls)
getattr(klass, 'backward_transitions').append(cls)
def __str__(cls):
return cls.get_title()
def __repr__(cls):
return "<Transition: '%s'>" % cls.get_title()
class FlowMetaclass(type):
def __init__(cls, name, bases, attrs):
super(FlowMetaclass, cls).__init__(name, bases, attrs)
for state in cls.states:
state.flow = cls
for transition in cls.transitions:
transition.flow = cls
def __str__(cls):
return ".".join([cls.__module__, cls.__name__])
class State(object):
__metaclass__ = StateMetaclass
abstract = True
class Transition(object):
__metaclass__ = TransitionMetaclass
abstract = True
@classmethod
def apply(cls, obj, *args, **kwargs):
raise NotImplementedError(
"Apply method should be defined in subclasses")
class Flow(object):
__metaclass__ = FlowMetaclass
states = []
transitions = []
initial_state = None
@classmethod
def get_state(cls, value=None):
if value is None or value == '':
return cls.initial_state
for item in cls.states:
if item.get_value() == value:
return item
raise ValueError('Cannot find state %r' % value)
@classmethod
def state_choices(cls):
return [state.as_tuple() for state in cls.states]
class DjangoItem(object):
"""Stores common methods of DjanoState and DjangoTransition"""
@classmethod
def get_name(cls):
return cls.__name__
@classmethod
def get_value(cls):
try:
return getattr(cls, 'value')
except AttributeError:
return cls.get_name().upper()
@classmethod
def get_title(cls):
title = getattr(cls, 'title', None)
return title or cls.get_name()
@classmethod
def as_tuple(cls):
return cls.get_value(), cls.get_title()
@classmethod
def as_sql(cls):
return '%s', (cls.get_value(),)
class DjangoState(State, DjangoItem):
def __str__(self):
# We need to keep this instance method in order to solve a specific
# problem with Django templates.
# When django template variable resolver encounters a callable it
# always tries to call it. And since class is a callable (and call to
# it returns a new instance), we end up having instances, not classes
# rendered in the template
return str(self.__class__)
@classmethod
def forward_allowed_transitions(cls, roles):
return [trans for trans in cls.forward_transitions
if set(trans.permissions) & set(roles)]
@classmethod
def forward_states(cls):
return [trans.outcome for trans in cls.forward_transitions
if trans.forward]
@classmethod
def all_forward_states(cls):
#TODO: Capture possible recursion in case of wrong 'forward' value
def get_states(state, lst):
lst.add(state)
[get_states(st, lst) for st in state.forward_states()]
result = set([])
get_states(cls, result)
return list(result)
class IncorrectStateError(ValueError):
pass
class TransitionFailedError(Exception):
pass
class AdminAction(object):
def __init__(self, transition):
self.transition = transition
self.short_description = '%s selected' % transition
self.__name__ = str(transition)
def __call__(self, modeladmin, request, queryset):
for obj in queryset:
self.transition.apply(obj)
class DjangoTransition(Transition, DjangoItem):
abstract = True # This transition is not the part of workflow
# By default transitions are considered 'forward', i.e.
# workflow doesn't return to previous state
forward = True
def __str__(self):
# We need to keep this instance method in order to solve a specific
# problem with Django templates.
# When django template variable resolver encounters a callable it
# always tries to call it. And since class is a callable (and call to
# it returns a new instance), we end up having instances, not classes
# rendered in the template
return str(self.__class__)
@classmethod
def all(cls):
import warnings
warnings.warn("transition.all is deprecated, "
"use flow.transitions instead",
DeprecationWarning)
return cls.flow.transitions
@classmethod
def admin_actions(cls):
return [AdminAction(trans) for trans in cls.all()]
| 27.038462 | 77 | 0.634068 | 657 | 5,624 | 5.222222 | 0.270928 | 0.053046 | 0.01603 | 0.012241 | 0.314486 | 0.280676 | 0.273973 | 0.254736 | 0.236083 | 0.236083 | 0 | 0 | 0.27845 | 5,624 | 207 | 78 | 27.169082 | 0.84549 | 0.189723 | 0 | 0.28 | 0 | 0 | 0.052585 | 0 | 0 | 0 | 0 | 0.004831 | 0 | 1 | 0.208 | false | 0.016 | 0.008 | 0.112 | 0.56 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
2a3b07acb290992d78e2cb48fb5c7452dc6ca1c9 | 551 | py | Python | helper/policy.py | icesiv/webstaurantstore | 79b5f32625a6be38e42d525c74537d01fde82e26 | [
"MIT"
] | null | null | null | helper/policy.py | icesiv/webstaurantstore | 79b5f32625a6be38e42d525c74537d01fde82e26 | [
"MIT"
] | null | null | null | helper/policy.py | icesiv/webstaurantstore | 79b5f32625a6be38e42d525c74537d01fde82e26 | [
"MIT"
] | null | null | null | from rotating_proxies.policy import BanDetectionPolicy
class MyPolicy(BanDetectionPolicy):
def response_is_ban(self, request, response):
# use default rules, but also consider HTTP 200 responses
# a ban if there is 'captcha' word in response body.
ban = super(MyPolicy, self).response_is_ban(request, response)
ban = ban or b'captcha' in response.body
return ban
def exception_is_ban(self, request, exception):
# override method completely: don't take exceptions in account
return None | 42.384615 | 70 | 0.709619 | 72 | 551 | 5.333333 | 0.611111 | 0.039063 | 0.067708 | 0.083333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007042 | 0.22686 | 551 | 13 | 71 | 42.384615 | 0.894366 | 0.303085 | 0 | 0 | 0 | 0 | 0.018373 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.125 | 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 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
2a4394188059b503b596278b8e6a7e6db8a33d8a | 240 | py | Python | src/classes/demo.py | daninarvaezr/SeleniumInmofianza | 51d488043188b87199dbf28b9f7ef6d43f5163d9 | [
"MIT"
] | 1 | 2021-12-17T05:18:47.000Z | 2021-12-17T05:18:47.000Z | src/classes/demo.py | daninarvaezr/SeleniumInmofianza | 51d488043188b87199dbf28b9f7ef6d43f5163d9 | [
"MIT"
] | null | null | null | src/classes/demo.py | daninarvaezr/SeleniumInmofianza | 51d488043188b87199dbf28b9f7ef6d43f5163d9 | [
"MIT"
] | null | null | null | import os
file=open("C:/Users/michael.duran\OneDrive - Thomas Greg/Documents/Audisoft/Thomas/Inmofianza/TeamQA/SeleniumInmofianza/src/classes/datos.txt","w")
file.write("Primera línea" + os.linesep)
file.write("Segunda línea")
file.close() | 48 | 148 | 0.783333 | 34 | 240 | 5.529412 | 0.794118 | 0.095745 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.054167 | 240 | 5 | 149 | 48 | 0.828194 | 0 | 0 | 0 | 0 | 0.2 | 0.651452 | 0.497925 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 0.2 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
2a43cb149706d93e473e58a6de1f4b209d11723a | 1,962 | py | Python | src/egyptian_data_generator/finance.py | mahmoudahmedd/Egyptian-Data-Generator | d7bea688a7c7f8604908f302917267d795aa40a2 | [
"MIT"
] | 9 | 2020-11-25T10:45:32.000Z | 2020-11-29T12:42:09.000Z | src/egyptian_data_generator/finance.py | mahmoudahmedd/Egyptian-Data-Generator | d7bea688a7c7f8604908f302917267d795aa40a2 | [
"MIT"
] | null | null | null | src/egyptian_data_generator/finance.py | mahmoudahmedd/Egyptian-Data-Generator | d7bea688a7c7f8604908f302917267d795aa40a2 | [
"MIT"
] | null | null | null | from egyptian_data_generator.helpers import Helpers
class Finance:
def americanexpressCreditCardNumber(self):
return self.generateCreditCardNumber("americanexpress")
def discoverCreditCardNumber(self):
return self.generate("discover")
def mastercardCreditCardNumber(self):
return self.generateCreditCardNumber("mastercard")
def visa16CreditCardNumber(self):
return self.generateCreditCardNumber("visa16")
def visa13CreditCardNumber(self):
return self.generateCreditCardNumber("visa13")
def generateCreditCardNumber(self, _type):
card_types = ["americanexpress", "visa13", "visa16", "mastercard", "discover"]
def prefill(t):
def_length = 16
if t == card_types[0]:
return [3, Helpers.intBetween(4,7)], 13
elif t == card_types[1] or t == card_types[2]:
if t.endswith("16"):
return [4], def_length - 1
else:
return [4], 12
elif t == card_types[3]:
return [5, Helpers.intBetween(1,5)], def_length - 2
elif t == card_types[4]:
return [6, 0, 1, 1], def_length - 4
else:
return [], def_length
def finalize(nums):
check_sum = 0
check_offset = (len(nums) + 1) % 2
for i, n in enumerate(nums):
if (i + check_offset) % 2 == 0:
n_ = n*2
check_sum += n_ -9 if n_ > 9 else n_
else:
check_sum += n
return nums + [10 - (check_sum % 10) ]
initial, rem = prefill(_type.lower())
so_far = initial + [Helpers.intBetween(1,9) for x in range(rem - 1)]
return "".join(map(str,finalize(so_far)))
| 33.827586 | 87 | 0.514271 | 198 | 1,962 | 4.959596 | 0.348485 | 0.05499 | 0.071283 | 0.154786 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04553 | 0.384302 | 1,962 | 57 | 88 | 34.421053 | 0.767384 | 0 | 0 | 0.071429 | 1 | 0 | 0.048345 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.190476 | false | 0 | 0.02381 | 0.119048 | 0.547619 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
2a5b794eee3881243d82a5403699324690ff176a | 115 | py | Python | stere/__init__.py | thomasmost/stere | f10ae1a40269c1642b9da49df06936fafb9b4a5b | [
"MIT"
] | 17 | 2017-12-11T15:49:10.000Z | 2021-06-16T19:29:45.000Z | stere/__init__.py | thomasmost/stere | f10ae1a40269c1642b9da49df06936fafb9b4a5b | [
"MIT"
] | 328 | 2018-02-06T02:29:21.000Z | 2022-03-30T10:47:33.000Z | stere/__init__.py | thomasmost/stere | f10ae1a40269c1642b9da49df06936fafb9b4a5b | [
"MIT"
] | 3 | 2019-04-05T19:40:55.000Z | 2021-11-04T06:50:32.000Z | from .browserenabled import BrowserEnabled as Stere
from .page import Page
__all__ = [
"Stere",
"Page",
]
| 14.375 | 51 | 0.686957 | 13 | 115 | 5.769231 | 0.538462 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.217391 | 115 | 7 | 52 | 16.428571 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0.078261 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
2a6e1a8bb73dc390e5d24fbf0db6bcb3ee7ba1cf | 266 | py | Python | run_tests.py | Knitschi/CPFBuildscripts | ee20e4b08b3e063535750d019c6e730e55426cce | [
"MIT"
] | 1 | 2018-02-12T14:30:39.000Z | 2018-02-12T14:30:39.000Z | run_tests.py | Knitschi/CPFBuildscripts | ee20e4b08b3e063535750d019c6e730e55426cce | [
"MIT"
] | 8 | 2018-04-18T12:40:13.000Z | 2019-05-19T17:00:56.000Z | run_tests.py | Knitschi/CPFBuildscripts | ee20e4b08b3e063535750d019c6e730e55426cce | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import unittest
import sys
import os
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
from python.buildautomat_unit_tests import *
from python.filesystemaccess_unit_tests import *
if __name__ == '__main__':
unittest.main()
| 19 | 60 | 0.766917 | 36 | 266 | 5.222222 | 0.583333 | 0.06383 | 0.159574 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004292 | 0.12406 | 266 | 14 | 61 | 19 | 0.802575 | 0.06391 | 0 | 0 | 0 | 0 | 0.032129 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.625 | 0 | 0.625 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
2a8616811d43ccd05d2af0c119eb8d355bf9f7bd | 7,740 | py | Python | tests/lightning/utils/helpers.py | jexio/fulmo | daa4bd4f1cf3b8bd785a9024a413db9a0238f10c | [
"MIT"
] | null | null | null | tests/lightning/utils/helpers.py | jexio/fulmo | daa4bd4f1cf3b8bd785a9024a413db9a0238f10c | [
"MIT"
] | 80 | 2021-07-13T12:58:25.000Z | 2022-03-24T03:17:08.000Z | tests/lightning/utils/helpers.py | jexio/fulmo | daa4bd4f1cf3b8bd785a9024a413db9a0238f10c | [
"MIT"
] | null | null | null | # flake8: noqa
# Copyright The PyTorch Lightning team.
#
# 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 typing import Any, Dict, Optional, Tuple
import numpy as np
import torch
from pytorch_lightning import LightningDataModule, LightningModule
from torch.utils.data import DataLoader, Dataset, IterableDataset, Subset
from fulmo.readers import IReader
class RandomDictDataset(Dataset):
def __init__(self, size: int, length: int):
self.len = length
self.data = torch.randn(length, size)
def __getitem__(self, index):
a = self.data[index]
b = a + 2
return {"a": a, "b": b}
def __len__(self):
return self.len
class RandomDataset(Dataset):
def __init__(self, size: int, length: int):
self.len = length
self.data = torch.randn(length, size)
def __getitem__(self, index):
return self.data[index]
def __len__(self):
return self.len
class RandomIterableDataset(IterableDataset):
def __init__(self, size: int, count: int):
self.count = count
self.size = size
def __iter__(self):
for _ in range(self.count):
yield torch.randn(self.size)
class RandomIterableDatasetWithLen(IterableDataset):
def __init__(self, size: int, count: int):
self.count = count
self.size = size
def __iter__(self):
for _ in range(len(self)):
yield torch.randn(self.size)
def __len__(self):
return self.count
class NpyGenerator(IReader):
"""Npy array readers abstraction. Reads arrays from a ``csv`` datasets."""
def __init__(
self,
input_key: Optional[str] = None,
output_key: Optional[str] = None,
shape: Tuple[int, int, int] = (256, 256, 3),
) -> None:
"""Create a new instance of NpyReader.
Args:
input_key: key to use from annotation dict
output_key: key to use to store the result
"""
super().__init__(input_key, output_key or input_key)
self.shape = shape
def __call__(self, element: Dict[str, Any]) -> Dict[str, np.ndarray]:
"""Generate random array and transfer it.
Args:
element: elem in your datasets
Returns:
Dict[`output_key`, np.ndarray]
"""
array = np.random.rand(*self.shape)
output = {self.output_key: array}
return output
class TestModel(torch.nn.Module):
def __init__(self):
super().__init__()
self.backbone = torch.nn.Sequential(
torch.nn.Linear(32, 32),
torch.nn.ReLU(),
torch.nn.Dropout(),
)
self.head = torch.nn.Sequential(
torch.nn.Linear(32, 16),
torch.nn.Dropout(0.5),
torch.nn.ReLU(),
torch.nn.Linear(16, 8),
torch.nn.Dropout(0.5),
torch.nn.ReLU(),
torch.nn.Linear(8, 2),
)
def forward(self, x):
return self.head(self.backbone(x))
class BoringModel(LightningModule):
def __init__(self):
"""
Testing PL Module
Use as follows:
- subclass
- modify the behavior for what you want
class TestModel(BaseTestModel):
def training_step(...):
# do your own thing
or:
model = BaseTestModel()
model.training_epoch_end = None
"""
super().__init__()
self.model = TestModel()
self._train_data = DataLoader(RandomDataset(32, 64))
self._val_data = DataLoader(RandomDataset(32, 64))
self._test_data = DataLoader(RandomDataset(32, 64))
self._predict_data = DataLoader(RandomDataset(32, 64))
def set_train_data(self, value) -> None:
self._train_data = value
def set_val_data(self, value) -> None:
self._val_data = value
def set_test_data(self, value) -> None:
self._test_data = value
def set_predict_data(self, value) -> None:
self._predict_data = value
def forward(self, x):
return self.model(x)
def loss(self, batch, prediction):
# An arbitrary loss to have a loss that updates the model weights during `Trainer.fit` calls
return torch.nn.functional.mse_loss(prediction, torch.ones_like(prediction))
def step(self, x):
x = self(x)
out = torch.nn.functional.mse_loss(x, torch.ones_like(x))
return out
def training_step(self, batch, batch_idx):
output = self(batch)
loss = self.loss(batch, output)
return {"loss": loss}
def training_step_end(self, training_step_outputs):
return training_step_outputs
def training_epoch_end(self, outputs) -> None:
torch.stack([x["loss"] for x in outputs]).mean()
def validation_step(self, batch, batch_idx):
output = self(batch)
loss = self.loss(batch, output)
return {"x": loss}
def validation_epoch_end(self, outputs) -> None:
torch.stack([x["x"] for x in outputs]).mean()
def test_step(self, batch, batch_idx):
output = self(batch)
loss = self.loss(batch, output)
return {"y": loss}
def test_epoch_end(self, outputs) -> None:
torch.stack([x["y"] for x in outputs]).mean()
def configure_optimizers(self):
optimizer = torch.optim.SGD(self.model.parameters(), lr=0.1)
lr_scheduler = torch.optim.lr_scheduler.StepLR(optimizer, step_size=1)
return [optimizer], [lr_scheduler]
def train_dataloader(self):
return self._train_data
def val_dataloader(self):
return self._val_data
def test_dataloader(self):
return self._test_data
def predict_dataloader(self):
return self._predict_data
class BoringDataModule(LightningDataModule):
def __init__(self, data_dir: str = "./"):
super().__init__()
self.data_dir = data_dir
self.non_picklable = None
self.checkpoint_state: Optional[str] = None
def prepare_data(self):
self.random_full = RandomDataset(32, 64 * 4)
def setup(self, stage: Optional[str] = None):
if stage == "fit" or stage is None:
self.random_train = Subset(self.random_full, indices=range(64))
self.dims = self.random_train[0].shape
if stage in ("fit", "validate") or stage is None:
self.random_val = Subset(self.random_full, indices=range(64, 64 * 2))
if stage == "test" or stage is None:
self.random_test = Subset(self.random_full, indices=range(64 * 2, 64 * 3))
self.dims = getattr(self, "dims", self.random_test[0].shape)
if stage == "predict" or stage is None:
self.random_predict = Subset(self.random_full, indices=range(64 * 3, 64 * 4))
self.dims = getattr(self, "dims", self.random_predict[0].shape)
def train_dataloader(self):
return DataLoader(self.random_train)
def val_dataloader(self):
return DataLoader(self.random_val)
def test_dataloader(self):
return DataLoader(self.random_test)
def predict_dataloader(self):
return DataLoader(self.random_predict)
__all__ = ["BoringModel", "NpyGenerator"]
| 30 | 100 | 0.62584 | 987 | 7,740 | 4.717325 | 0.235056 | 0.034364 | 0.0189 | 0.012887 | 0.412156 | 0.328608 | 0.228308 | 0.159149 | 0.137242 | 0.137242 | 0 | 0.013373 | 0.265762 | 7,740 | 257 | 101 | 30.116732 | 0.805912 | 0.158786 | 0 | 0.312102 | 0 | 0 | 0.011407 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.267516 | false | 0 | 0.038217 | 0.101911 | 0.503185 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
aa517365a385efd5eb9f84b7a97466471cc557a7 | 19,978 | py | Python | tests/http_wrappers/test_response.py | pabarros/asgard-api | 3c10d5f99f584df5e8011558cf42e8b201d567e9 | [
"MIT"
] | 3 | 2020-01-10T02:16:09.000Z | 2020-02-19T18:42:37.000Z | tests/http_wrappers/test_response.py | pabarros/asgard-api | 3c10d5f99f584df5e8011558cf42e8b201d567e9 | [
"MIT"
] | 13 | 2020-01-15T18:22:35.000Z | 2021-03-31T19:21:54.000Z | tests/http_wrappers/test_response.py | rockerbacon/asgard-api | 1c1eb19225ace4bbecb06b65b1b9c4ab131eb24a | [
"MIT"
] | 6 | 2020-03-07T09:49:19.000Z | 2021-07-25T03:14:10.000Z | import json
import unittest
from copy import deepcopy
from http import HTTPStatus
from unittest.mock import call, patch
from flask import Response as FlaskResponse
from marathon import MarathonApp
from marathon.models.group import MarathonGroup
from marathon.models.task import MarathonTask
from asgard.models.account import AccountDB as Account
from hollowman.app import application
from hollowman.http_wrappers import Response
from hollowman.marathon.group import AsgardAppGroup
from hollowman.marathonapp import AsgardApp
from hollowman.models import User
from tests.utils import with_json_fixture
class ResponseTest(unittest.TestCase):
def test_remove_namespace_if_exists(self):
response = Response(None, None)
self.assertEqual("", response._remove_namespace_if_exists("dev", ""))
self.assertEqual("/", response._remove_namespace_if_exists("dev", "/"))
self.assertEqual(
"/", response._remove_namespace_if_exists("dev", "/dev/")
)
self.assertEqual(
"", response._remove_namespace_if_exists("dev", "/dev")
)
self.assertEqual(
"/foo", response._remove_namespace_if_exists("dev", "/dev/foo")
)
self.assertEqual(
"/foo/dev",
response._remove_namespace_if_exists("dev", "/dev/foo/dev"),
)
self.assertEqual(
"/dev", response._remove_namespace_if_exists("dev", "/dev/dev")
)
self.assertEqual(
None, response._remove_namespace_if_exists("dev", None)
)
class SplitTests(unittest.TestCase):
def setUp(self):
self.empty_ok_response = FlaskResponse(
response=b"{}", status=HTTPStatus.OK, headers={}
)
self.user = User(tx_name="User One", tx_email="user@host.com")
self.user.current_account = Account(
name="Dev", namespace="dev", owner="company"
)
@with_json_fixture("single_full_app.json")
def test_a_single_app_response_returns_a_single_marathonapp(self, fixture):
with application.test_request_context(
"/v2/apps//foo", method="GET", data=b""
) as ctx:
flask_response = FlaskResponse(
response=json.dumps({"app": fixture}),
status=HTTPStatus.OK,
headers={},
)
response = Response(ctx.request, flask_response)
with patch.object(response, "marathon_client") as client:
client.get_app.return_value = AsgardApp.from_json(fixture)
apps = list(response.split())
self.assertEqual([call("/foo")], client.get_app.call_args_list)
self.assertEqual(
apps,
[(AsgardApp.from_json(fixture), client.get_app.return_value)],
)
@with_json_fixture("single_full_app.json")
def test_multiapp_response_returns_multiple_marathonapp_instances(
self, fixture
):
modified_app = fixture.copy()
modified_app["id"] = "/xablau"
apps = [fixture, modified_app]
with application.test_request_context(
"/v2/apps/", method="GET", data=b""
) as ctx:
response = FlaskResponse(
response=json.dumps({"apps": apps}),
status=HTTPStatus.OK,
headers={},
)
response = Response(ctx.request, response)
with patch.object(response, "marathon_client") as client:
original_apps = [MarathonApp.from_json(app) for app in apps]
client.get_app.side_effect = original_apps
apps = list(response.split())
self.assertEqual(
apps,
[
(AsgardApp.from_json(fixture), original_apps[0]),
(AsgardApp.from_json(modified_app), original_apps[1]),
],
)
@with_json_fixture("single_full_app.json")
def test_a_response_for_restart_operation_with_appid_in_url_path_does_not_split_response(
self, fixture
):
"""
Quando o response retorna um Deployment, não fazemos split.
"""
with application.test_request_context(
"/v2/apps/xablau/restart", method="PUT", data=b'{"force": true}'
) as ctx:
response = FlaskResponse(
response=b"{}", status=HTTPStatus.OK, headers={}
)
response = Response(ctx.request, response)
apps = list(response.split())
self.assertEqual(0, len(apps))
@with_json_fixture("../fixtures/group_dev_namespace_with_apps.json")
def test_split_groups_read_on_root_group(self, group_dev_namespace_fixture):
with application.test_request_context(
"/v2/groups/", method="GET"
) as ctx:
response = FlaskResponse(
response=json.dumps(group_dev_namespace_fixture),
status=HTTPStatus.OK,
headers={},
)
ctx.request.user = self.user
response = Response(ctx.request, response)
groups_tuple = list(response.split())
self.assertEqual(5, len(groups_tuple))
expected_groups = [
AsgardAppGroup(g)
for g in AsgardAppGroup(
MarathonGroup.from_json(group_dev_namespace_fixture)
).iterate_groups()
]
# Compara com os groups originais
self.assertEqual(expected_groups, [g[1] for g in groups_tuple])
@with_json_fixture("../fixtures/group_dev_namespace_with_apps.json")
def test_split_group_nonroot_empty_group(self, group_dev_namespace_fixture):
with application.test_request_context(
"/v2/groups/group-c", method="GET"
) as ctx:
response = FlaskResponse(
response=json.dumps(group_dev_namespace_fixture["groups"][2]),
status=HTTPStatus.OK,
headers={},
)
ctx.request.user = self.user
response = Response(ctx.request, response)
groups_tuple = list(response.split())
self.assertEqual(1, len(groups_tuple))
expected_groups = [
AsgardAppGroup(g)
for g in AsgardAppGroup(
MarathonGroup.from_json(
group_dev_namespace_fixture["groups"][2]
)
).iterate_groups()
]
# Compara com os groups originais
self.assertEqual(expected_groups, [g[1] for g in groups_tuple])
@unittest.skip("A ser implementado")
def test_split_groups_write_PUT_on_group(self):
self.fail()
@with_json_fixture("../fixtures/group_dev_namespace_with_apps.json")
def test_split_groups_read_on_specific_group(
self, group_dev_namespace_fixture
):
with application.test_request_context(
"/v2/groups/group-b", method="GET"
) as ctx:
response = FlaskResponse(
response=json.dumps(group_dev_namespace_fixture["groups"][1]),
status=HTTPStatus.OK,
headers={},
)
ctx.request.user = self.user
response = Response(ctx.request, response)
groups_tuple = list(response.split())
self.assertEqual(2, len(groups_tuple))
expected_groups = [
AsgardAppGroup(g)
for g in AsgardAppGroup(
MarathonGroup.from_json(
group_dev_namespace_fixture["groups"][1]
)
).iterate_groups()
]
# Compara com os groups originais
self.assertEqual(expected_groups, [g[1] for g in groups_tuple])
@with_json_fixture("../fixtures/tasks/get.json")
def test_split_tasks_GET(self, tasks_get_fixture):
"""
No cado de um GET, o retorno sempre é uma lista de apps.
"""
with application.test_request_context(
"/v2/tasks/", method="GET"
) as ctx:
response = FlaskResponse(
response=json.dumps(tasks_get_fixture), status=HTTPStatus.OK
)
ctx.request.user = self.user
response = Response(ctx.request, response)
tasks_tuple = list(response.split())
self.assertEqual(
[
MarathonTask.from_json(task)
for task in tasks_get_fixture["tasks"]
],
[task[0] for task in tasks_tuple],
)
@with_json_fixture("../fixtures/tasks/get.json")
def test_split_staks_POST_scale_false(self, tasks_get_fixture):
"""
No caso do POST com `?scale=false` o retorno é:
- Lista de apps que foram killed
Por isso usamos a fixture de tasks/get.json aqui
"""
with application.test_request_context(
"/v2/tasks/delete?scale=false", method="POST"
) as ctx:
response = FlaskResponse(
response=json.dumps(tasks_get_fixture), status=HTTPStatus.OK
)
ctx.request.user = self.user
response = Response(ctx.request, response)
tasks_tuple = list(response.split())
self.assertEqual(
[
MarathonTask.from_json(task)
for task in tasks_get_fixture["tasks"]
],
[task[0] for task in tasks_tuple],
)
@with_json_fixture("../fixtures/tasks/post?scale=true.json")
def test_split_staks_POST_scale_true(self, tasks_post_fixture):
"""
No caso do POST com `?scale=true` o retorno é:
- Deployment Id
Isso significa que não faremos split do response
"""
with application.test_request_context(
"/v2/tasks/delete?scale=true", method="POST"
) as ctx:
response = FlaskResponse(
response=json.dumps(tasks_post_fixture), status=HTTPStatus.OK
)
ctx.request.user = self.user
response = Response(ctx.request, response)
tasks_tuple = list(response.split())
self.assertEqual(0, len(tasks_tuple))
@with_json_fixture("../fixtures/queue/get.json")
def test_split_queue_GET(self, queue_get_fixture):
with application.test_request_context("/v2/queue", method="GET") as ctx:
response = FlaskResponse(
response=json.dumps(queue_get_fixture), status=HTTPStatus.OK
)
ctx.request.user = self.user
response = Response(ctx.request, response)
queue_tuples = list(response.split())
self.assertEqual(2, len(queue_tuples))
class JoinTests(unittest.TestCase):
def setUp(self):
self.user = User(tx_name="User One", tx_email="user@host.com")
self.user.current_account = Account(
name="Dev", namespace="dev", owner="company"
)
def test_join_a_uknown_response(self):
"""
Como o repsonse roda para qualquer requiest que retornou 200 no upstream,
muitas vezes pode passar por ele um request que ele "não trata", ou seja,
que ele não tem nada o que fazer.
Esse teste certifica que o join() não quebra em casos como esse
"""
with application.test_request_context(
"/v2/apps/myapp/restart", method="POST"
) as ctx:
response = FlaskResponse(
response=json.dumps({"deploymentId": "myId"}),
status=HTTPStatus.OK,
)
ctx.request.user = self.user
response = Response(ctx.request, response)
joined_response = response.join([])
joined_response_data = json.loads(joined_response.data)
self.assertEqual("myId", joined_response_data["deploymentId"])
@with_json_fixture("single_full_app.json")
def test_it_recreates_a_get_response_for_a_single_app(self, fixture):
with application.test_request_context(
"/v2/apps//foo", method="GET", data=b""
) as ctx:
response = FlaskResponse(
response=json.dumps({"app": fixture}),
status=HTTPStatus.OK,
headers={},
)
response = Response(ctx.request, response)
with patch.object(response, "marathon_client") as client:
client.get_app.return_value = AsgardApp.from_json(deepcopy(fixture))
apps = list(response.split())
joined_response = response.join(apps)
self.assertIsInstance(joined_response, FlaskResponse)
self.assertDictEqual(
json.loads(joined_response.data), {"app": fixture}
)
@with_json_fixture("single_full_app.json")
def test_it_recreates_a_get_response_for_multiple_apps(self, fixture):
modified_app = deepcopy(fixture)
modified_app["id"] = "/xablau"
fixtures = [fixture, modified_app]
expected_response = deepcopy(fixtures)
with application.test_request_context(
"/v2/apps/", method="GET", data=b""
) as ctx:
response = FlaskResponse(
response=json.dumps({"apps": fixtures}),
status=HTTPStatus.OK,
headers={},
)
response = Response(ctx.request, response)
with patch.object(response, "marathon_client") as client:
original_apps = [AsgardApp.from_json(app) for app in fixtures]
client.get_app.side_effect = original_apps
apps = list(response.split())
joined_response = response.join(apps)
self.assertIsInstance(joined_response, FlaskResponse)
self.assertDictEqual(
json.loads(joined_response.data), {"apps": expected_response}
)
@with_json_fixture("single_full_app.json")
def test_should_join_an_empty_list_into_an_empty_response_single_app(
self, single_full_app_fixture
):
with application.test_request_context(
"/v2/apps//foo", method="GET", data=b""
) as ctx:
response = FlaskResponse(
response=json.dumps({"app": single_full_app_fixture}),
status=HTTPStatus.OK,
headers={},
)
response = Response(ctx.request, response)
joined_response = response.join([])
self.assertIsInstance(joined_response, FlaskResponse)
self.assertDictEqual(json.loads(joined_response.data), {"app": {}})
@with_json_fixture("single_full_app.json")
def test_should_join_an_empty_list_into_an_empty_response_multi_app(
self, single_full_app_fixture
):
modified_app = deepcopy(single_full_app_fixture)
modified_app["id"] = "/other-app"
fixtures = [single_full_app_fixture, modified_app]
expected_response = deepcopy(fixtures)
with application.test_request_context(
"/v2/apps/", method="GET", data=b""
) as ctx:
response = FlaskResponse(
response=json.dumps({"apps": fixtures}),
status=HTTPStatus.OK,
headers={},
)
response = Response(ctx.request, response)
joined_response = response.join([])
self.assertIsInstance(joined_response, FlaskResponse)
self.assertDictEqual(json.loads(joined_response.data), {"apps": []})
@with_json_fixture("../fixtures/group_dev_namespace_with_one_full_app.json")
def test_join_groups(self, group_dev_namespace_fixture):
with application.test_request_context(
"/v2/groups/", method="GET"
) as ctx:
response = FlaskResponse(
response=json.dumps(group_dev_namespace_fixture),
status=HTTPStatus.OK,
headers={},
)
ctx.request.user = self.user
response = Response(ctx.request, response)
groups_tuple = list(response.split())
joined_response = response.join(groups_tuple)
joined_response_data = json.loads(joined_response.data)
self.assertEqual("/dev", joined_response_data["id"])
self.assertEqual(
"/dev/group-b", joined_response_data["groups"][0]["id"]
)
self.assertEqual(
[], joined_response_data["dependencies"]
) # Groups should be reendered in full
self.assertEqual(1, len(joined_response_data["groups"][0]["apps"]))
self.assertEqual(
[], joined_response_data["groups"][0]["apps"][0]["constraints"]
) # Apps should also be renderen in full
@with_json_fixture("../fixtures/tasks/get_single_namespace.json")
def test_join_tasks_GET(self, tasks_single_namespace_fixture):
with application.test_request_context(
"/v2/tasks/", method="GET"
) as ctx:
response = FlaskResponse(
response=json.dumps(tasks_single_namespace_fixture),
status=HTTPStatus.OK,
)
ctx.request.user = self.user
response = Response(ctx.request, response)
tasks_tuple = list(response.split())
joined_response = response.join(tasks_tuple)
joined_response_data = json.loads(joined_response.data)
self.assertEqual(3, len(joined_response_data["tasks"]))
def test_join_tasks_empty_list_GET(self):
"""
Se o request for GET e a lista de tasks for vazia, significa que todas as tasks
foram removidas do response, isso significa que temos que retornar um response vazio.
"""
with application.test_request_context(
"/v2/tasks/", method="GET"
) as ctx:
response = FlaskResponse(
response=json.dumps({"tasks": [{"id": "some-filtered-task"}]}),
status=HTTPStatus.OK,
)
ctx.request.user = self.user
response = Response(ctx.request, response)
joined_response = response.join([])
joined_response_data = json.loads(joined_response.data)
self.assertEqual(0, len(joined_response_data["tasks"]))
@with_json_fixture("../fixtures/tasks/post?scale=true.json")
def test_join_tasks_POST_scale_true(self, tasks_post_fixture):
with application.test_request_context(
"/v2/tasks/delete?scale=true", method="POST"
) as ctx:
response = FlaskResponse(
response=json.dumps(tasks_post_fixture), status=HTTPStatus.OK
)
ctx.request.user = self.user
response = Response(ctx.request, response)
tasks_tuple = list(response.split())
joined_response = response.join(tasks_tuple)
joined_response_data = json.loads(joined_response.data)
self.assertEqual(
"5ed4c0c5-9ff8-4a6f-a0cd-f57f59a34b43",
joined_response_data["deploymentId"],
)
@with_json_fixture("../fixtures/tasks/get.json")
def test_join_tasks_POST_scale_false(self, tasks_get_fixture):
with application.test_request_context(
"/v2/tasks/delete?scale=false", method="POST"
) as ctx:
response = FlaskResponse(
response=json.dumps(tasks_get_fixture), status=HTTPStatus.OK
)
ctx.request.user = self.user
response = Response(ctx.request, response)
tasks_tuple = list(response.split())
joined_response = response.join(tasks_tuple)
joined_response_data = json.loads(joined_response.data)
self.assertEqual(3, len(joined_response_data["tasks"]))
| 38.642166 | 93 | 0.598659 | 2,129 | 19,978 | 5.378581 | 0.108502 | 0.048904 | 0.04087 | 0.045411 | 0.793555 | 0.773644 | 0.738713 | 0.696009 | 0.669985 | 0.644398 | 0 | 0.004644 | 0.299379 | 19,978 | 516 | 94 | 38.717054 | 0.81346 | 0.047402 | 0 | 0.622328 | 0 | 0 | 0.078357 | 0.032193 | 0 | 0 | 0 | 0 | 0.095012 | 1 | 0.057007 | false | 0 | 0.038005 | 0 | 0.102138 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
aa678b1085b17ea09b4872f0d8cdbfe36718c786 | 1,181 | py | Python | mainapp/migrations/0006_auto_20200308_1745.py | Raistlin11123/inquiry-soso | 380d27219a5855f9e25da90db47f85e46e5e8b5d | [
"MIT"
] | null | null | null | mainapp/migrations/0006_auto_20200308_1745.py | Raistlin11123/inquiry-soso | 380d27219a5855f9e25da90db47f85e46e5e8b5d | [
"MIT"
] | null | null | null | mainapp/migrations/0006_auto_20200308_1745.py | Raistlin11123/inquiry-soso | 380d27219a5855f9e25da90db47f85e46e5e8b5d | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2020-03-08 16:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mainapp', '0005_auto_20200308_1735'),
]
operations = [
migrations.AlterField(
model_name='clue',
name='paragraph1',
field=models.TextField(blank=True, null=True, verbose_name='paragraph1'),
),
migrations.AlterField(
model_name='clue',
name='paragraph2',
field=models.TextField(blank=True, null=True, verbose_name='paragraph2'),
),
migrations.AlterField(
model_name='clue',
name='paragraph3',
field=models.TextField(blank=True, null=True, verbose_name='paragraph3'),
),
migrations.AlterField(
model_name='clue',
name='paragraph4',
field=models.TextField(blank=True, null=True, verbose_name='paragraph4'),
),
migrations.AlterField(
model_name='clue',
name='paragraph5',
field=models.TextField(blank=True, null=True, verbose_name='paragraph5'),
),
]
| 30.282051 | 85 | 0.58171 | 113 | 1,181 | 5.964602 | 0.345133 | 0.148368 | 0.18546 | 0.215134 | 0.630564 | 0.630564 | 0.356083 | 0.356083 | 0.356083 | 0 | 0 | 0.048077 | 0.295512 | 1,181 | 38 | 86 | 31.078947 | 0.762019 | 0.03641 | 0 | 0.46875 | 1 | 0 | 0.132042 | 0.020246 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.03125 | 0 | 0.125 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
aa718898352cee72928a11efe02c9cc6a37ed12e | 2,454 | py | Python | dots_testsuite.py | nguyent2/Practice-with-Modules | a075447ceb00b2e2b6812775b2b8c069511c53e2 | [
"MIT"
] | null | null | null | dots_testsuite.py | nguyent2/Practice-with-Modules | a075447ceb00b2e2b6812775b2b8c069511c53e2 | [
"MIT"
] | null | null | null | dots_testsuite.py | nguyent2/Practice-with-Modules | a075447ceb00b2e2b6812775b2b8c069511c53e2 | [
"MIT"
] | null | null | null | /Learn more or give us feedback
######################################################################
# Author: Thy H. Nguyen
# TODO: Change this to your names
# Username: nguyent2
# TODO: Change this to your usernames
#
# Assignment: A06: It's in your Genes
#
# Purpose: A test suite for testing the a06_genes.py program
#
######################################################################
# Acknowledgements:
# Original Author: Dr. Jan Pearce
#
# Idea from: http://www.cs.uni.edu/~schafer/1140/assignments/pa9/index.htm
#
# licensed under a Creative Commons
# Attribution-Noncommercial-Share Alike 3.0 United States License.
####################################################################################
import sys
from t12_dots import *
# You may get red squiggly lines from PyCharm; it'll be okay though.
# To remove them, right click the folder where this file is located, and select
# "Mark directory as" and then "Sources Root"
def testit(did_pass):
"""
Print the result of a unit test.
:param did_pass: a boolean representing the test
:return: None
"""
# This function works correctly--it is verbatim from the text
linenum = sys._getframe(1).f_lineno # Get the caller's line number.
if did_pass:
msg = "Test at line {0} ok.".format(linenum)
else:
msg = ("Test at line {0} FAILED.".format(linenum))
print(msg)
def dots_test_suite():
"""
The dots_test_suite() is designed to test the following:
calculate_size(num_dots)
is_valid_size(dot_width, dot_height, distance, screen_width, screen_height)
:return: None
"""
# The following tests test the calculate_size() function
print("\nTesting calculate_size")
testit(calculate_size(25) == (5,5))
testit(calculate_size(36) == (6,6))
testit(calculate_size(49) == (7,7))
testit(calculate_size(64)==(8,8))
#testit(calculate_size("hat") == "Error")
# The following tests test the is_valid_size() function
print("\n is_valid_size")
testit(is_valid_size(45,100,20,1100,650)== False)
testit(is_valid_size(5, 7, 20, 1100, 650) == True)
testit(is_valid_size(3, 3, 20, 1100, 650) == True)
testit(is_valid_size(3,3,44,1100,650)==True)
dots_test_suite()
# Notice the lack of a main? This is because this is a test suite; it's not intended to be run as a main() program.
# However, to run the test suite, you run this file. It should just work.
| 32.72 | 115 | 0.624287 | 349 | 2,454 | 4.275072 | 0.495702 | 0.069705 | 0.051609 | 0.045576 | 0.120643 | 0.042895 | 0.042895 | 0.042895 | 0.042895 | 0.042895 | 0 | 0.0399 | 0.182967 | 2,454 | 74 | 116 | 33.162162 | 0.704239 | 0.42502 | 0 | 0 | 0 | 0 | 0.100239 | 0 | 0 | 0 | 0 | 0.013514 | 0 | 0 | null | null | 0.090909 | 0.090909 | null | null | 0.136364 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
aa8c0c3cea083104acd36512910c56a34a5f2037 | 850 | py | Python | src/test/chirc/tests/fixtures.py | Schrotty/sIRC | c2edf179651794ddc75ea26a69429933ab04809d | [
"MIT"
] | 2 | 2019-03-26T06:22:50.000Z | 2019-03-26T11:16:25.000Z | test/tests/chirc/tests/fixtures.py | MU001999/npcp | af0f8c33ef518d01580a95dcaea3951b1fa7087c | [
"MIT"
] | 1 | 2016-05-02T19:52:25.000Z | 2016-05-03T20:37:16.000Z | test/tests/chirc/tests/fixtures.py | MU001999/npcp | af0f8c33ef518d01580a95dcaea3951b1fa7087c | [
"MIT"
] | null | null | null | channels1 = { "#test1": ("@user1", "user2", "user3"),
"#test2": ("@user4", "user5", "user6"),
"#test3": ("@user7", "user8", "user9")
}
channels2 = { "#test1": ("@user1", "user2", "user3"),
"#test2": ("@user4", "user5", "user6"),
"#test3": ("@user7", "user8", "user9"),
None: ("user10" , "user11")
}
channels3 = { "#test1": ("@user1", "user2", "user3"),
"#test2": ("@user2",),
"#test3": ("@user3", "@user4", "user5", "user6"),
"#test4": ("@user7", "+user8", "+user9", "user1", "user2"),
"#test5": ("@user1", "@user5"),
None: ("user10" , "user11")
}
channels4 = { None: ("user1", "user2", "user3", "user4", "user5") } | 42.5 | 73 | 0.372941 | 60 | 850 | 5.283333 | 0.35 | 0.157729 | 0.189274 | 0.189274 | 0.457413 | 0.378549 | 0.378549 | 0.378549 | 0.378549 | 0.378549 | 0 | 0.112546 | 0.362353 | 850 | 20 | 74 | 42.5 | 0.472325 | 0 | 0 | 0.235294 | 0 | 0 | 0.346651 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 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 | 0 | 0 | 3 |
aab5358c186091fffe57d4f1b00d5fec32b9e7f8 | 139 | py | Python | python/component/base/utils.py | ModerateFish/component | 13e778648e7ff3132e30543b0aa9a436ee286f99 | [
"Apache-2.0"
] | null | null | null | python/component/base/utils.py | ModerateFish/component | 13e778648e7ff3132e30543b0aa9a436ee286f99 | [
"Apache-2.0"
] | null | null | null | python/component/base/utils.py | ModerateFish/component | 13e778648e7ff3132e30543b0aa9a436ee286f99 | [
"Apache-2.0"
] | null | null | null | import os
def check_path(path):
if not path or not path.strip() or os.path.exists(path):
return
os.makedirs(path)
pass | 19.857143 | 60 | 0.647482 | 23 | 139 | 3.869565 | 0.565217 | 0.157303 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.251799 | 139 | 7 | 61 | 19.857143 | 0.855769 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0.166667 | 0.166667 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
aab8ee0d00657fec39263780f21c6f66db24843f | 275 | py | Python | pure_sklearn/feature_extraction/__init__.py | ashetty1-m/pure-predict | 05a0f105fb43532af1a0713dc34b26574d51b563 | [
"Apache-2.0"
] | 62 | 2020-02-14T15:54:12.000Z | 2021-11-23T14:12:32.000Z | pure_sklearn/feature_extraction/__init__.py | ashetty1-m/pure-predict | 05a0f105fb43532af1a0713dc34b26574d51b563 | [
"Apache-2.0"
] | 9 | 2020-04-05T16:19:33.000Z | 2022-02-08T14:54:56.000Z | pure_sklearn/feature_extraction/__init__.py | ashetty1-m/pure-predict | 05a0f105fb43532af1a0713dc34b26574d51b563 | [
"Apache-2.0"
] | 5 | 2021-02-26T14:04:17.000Z | 2022-02-10T23:06:16.000Z | """
The :mod:`pure_sklearn.feature_extraction` module deals with feature extraction
from raw data. It currently includes methods to extract features from text.
"""
from ._dict_vectorizer import DictVectorizerPure
from . import text
__all__ = ["DictVectorizerPure", "text"]
| 27.5 | 79 | 0.789091 | 34 | 275 | 6.147059 | 0.735294 | 0.162679 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.127273 | 275 | 9 | 80 | 30.555556 | 0.870833 | 0.563636 | 0 | 0 | 0 | 0 | 0.196429 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
aabc8bf96be40a3c1147bd07e49acc07038b9620 | 220 | py | Python | podcast/tests/urls.py | richardcornish/django-applepodcast | 50732acfbe1ca258e5afb44c117a6ac5fa0c1219 | [
"BSD-3-Clause"
] | 7 | 2017-11-18T13:02:13.000Z | 2021-07-31T21:55:24.000Z | podcast/tests/urls.py | dmitriydef/django-applepodcast | 50732acfbe1ca258e5afb44c117a6ac5fa0c1219 | [
"BSD-3-Clause"
] | 24 | 2017-07-17T21:53:58.000Z | 2018-02-16T07:13:39.000Z | podcast/tests/urls.py | dmitriydef/django-applepodcast | 50732acfbe1ca258e5afb44c117a6ac5fa0c1219 | [
"BSD-3-Clause"
] | 4 | 2017-09-21T12:43:54.000Z | 2020-07-19T21:56:30.000Z | try:
from django.urls import include, re_path
except ImportError:
from django.conf.urls import include, url as re_path
urlpatterns = [
re_path(r'^podcast/', include('podcast.urls', namespace='podcast')),
]
| 22 | 72 | 0.713636 | 30 | 220 | 5.133333 | 0.566667 | 0.116883 | 0.220779 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.163636 | 220 | 9 | 73 | 24.444444 | 0.836957 | 0 | 0 | 0 | 0 | 0 | 0.127273 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.428571 | 0 | 0.428571 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
aace2561c26b084c7dd7639860b3d85239529375 | 222 | py | Python | graphiql_strawberry_debug_toolbar/serializers.py | przemub/django-graphiql-strawberry-debug-toolbar | 14882b215a63a5b73a26fd9e641ac8fe98f65eaa | [
"MIT"
] | 67 | 2018-03-18T13:06:59.000Z | 2021-12-21T19:07:13.000Z | graphiql_strawberry_debug_toolbar/serializers.py | przemub/django-graphiql-strawberry-debug-toolbar | 14882b215a63a5b73a26fd9e641ac8fe98f65eaa | [
"MIT"
] | 15 | 2018-03-15T13:12:33.000Z | 2022-02-10T14:46:33.000Z | graphiql_strawberry_debug_toolbar/serializers.py | przemub/django-graphiql-strawberry-debug-toolbar | 14882b215a63a5b73a26fd9e641ac8fe98f65eaa | [
"MIT"
] | 15 | 2019-06-19T12:04:53.000Z | 2022-03-16T16:55:09.000Z | from django.core.serializers.json import DjangoJSONEncoder
class CallableJSONEncoder(DjangoJSONEncoder):
def default(self, obj):
if callable(obj):
return obj()
return super().default(obj)
| 24.666667 | 58 | 0.689189 | 23 | 222 | 6.652174 | 0.73913 | 0.117647 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.220721 | 222 | 8 | 59 | 27.75 | 0.884393 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.166667 | 0 | 0.833333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
aad8819b95f363cf2961e65958f9749138888b61 | 133 | py | Python | Primeiros Passos/1-DAY ONE/Sabendo se o nome da cidade tem santo.py | pedroluceena/TreinosPI | c11a76a1361f61a71e16edb2127eb08c12c090e1 | [
"MIT"
] | null | null | null | Primeiros Passos/1-DAY ONE/Sabendo se o nome da cidade tem santo.py | pedroluceena/TreinosPI | c11a76a1361f61a71e16edb2127eb08c12c090e1 | [
"MIT"
] | null | null | null | Primeiros Passos/1-DAY ONE/Sabendo se o nome da cidade tem santo.py | pedroluceena/TreinosPI | c11a76a1361f61a71e16edb2127eb08c12c090e1 | [
"MIT"
] | null | null | null | cidade = str(input('Qual é o Nome da sua Cidade ?: ')).strip()
print('Sua cidade possui o nome Santo?',cidade[:5].upper() == 'SANTO') | 66.5 | 70 | 0.654135 | 22 | 133 | 3.954545 | 0.681818 | 0.114943 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008696 | 0.135338 | 133 | 2 | 70 | 66.5 | 0.747826 | 0 | 0 | 0 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
2a9af691df37378dbd6bf5930ef45f2b0d815dc1 | 81 | py | Python | python/943.find-the-shortest-superstring.py | stavanmehta/leetcode | 1224e43ce29430c840e65daae3b343182e24709c | [
"Apache-2.0"
] | null | null | null | python/943.find-the-shortest-superstring.py | stavanmehta/leetcode | 1224e43ce29430c840e65daae3b343182e24709c | [
"Apache-2.0"
] | null | null | null | python/943.find-the-shortest-superstring.py | stavanmehta/leetcode | 1224e43ce29430c840e65daae3b343182e24709c | [
"Apache-2.0"
] | null | null | null | class Solution:
def shortestSuperstring(self, A: List[str]) -> str:
| 20.25 | 55 | 0.617284 | 9 | 81 | 5.555556 | 0.888889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.259259 | 81 | 3 | 56 | 27 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
2a9cd0d36db26dfa7b130266260e262e2636a4e0 | 197 | py | Python | CollegeBuddy_backend/framework/api/API_Exception.py | tejan-singh/CollegeBuddy | b067345dff6dbf60a54bd48bedb7fab1f463d22d | [
"MIT"
] | 2 | 2020-12-06T15:49:16.000Z | 2020-12-10T15:20:50.000Z | CollegeBuddy_backend/framework/api/API_Exception.py | tejan-singh/CollegeBuddy | b067345dff6dbf60a54bd48bedb7fab1f463d22d | [
"MIT"
] | 5 | 2020-11-30T17:26:12.000Z | 2021-01-01T15:40:22.000Z | CollegeBuddy_backend/framework/api/API_Exception.py | tejan-singh/CollegeBuddy | b067345dff6dbf60a54bd48bedb7fab1f463d22d | [
"MIT"
] | 4 | 2020-12-05T18:30:16.000Z | 2021-01-02T13:17:54.000Z | class APIException(Exception):
def __init__(self, message, code=None):
self.context = {}
if code:
self.context['errorCode'] = code
super().__init__(message)
| 28.142857 | 44 | 0.593909 | 20 | 197 | 5.45 | 0.65 | 0.201835 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.279188 | 197 | 6 | 45 | 32.833333 | 0.767606 | 0 | 0 | 0 | 0 | 0 | 0.045685 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
2aacd69a9be78b0b125c9417b7a8c0c44c82bb18 | 116 | py | Python | coffea/nanoevents/methods/systematics/__init__.py | Junaid-muhamad/coffea | b644bcf2b48e272e6c78e4b1ddee3c233a67022d | [
"BSD-3-Clause"
] | null | null | null | coffea/nanoevents/methods/systematics/__init__.py | Junaid-muhamad/coffea | b644bcf2b48e272e6c78e4b1ddee3c233a67022d | [
"BSD-3-Clause"
] | null | null | null | coffea/nanoevents/methods/systematics/__init__.py | Junaid-muhamad/coffea | b644bcf2b48e272e6c78e4b1ddee3c233a67022d | [
"BSD-3-Clause"
] | null | null | null | from coffea.nanoevents.methods.systematics.UpDownSystematic import UpDownSystematic
__all__ = ["UpDownSystematic"]
| 29 | 83 | 0.853448 | 10 | 116 | 9.5 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.068966 | 116 | 3 | 84 | 38.666667 | 0.87963 | 0 | 0 | 0 | 0 | 0 | 0.137931 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
2aacece114f8bb2a0a9d49c428291bf6cbab0533 | 7,121 | py | Python | etl/parsers/etw/Microsoft_Windows_SecurityMitigationsBroker.py | IMULMUL/etl-parser | 76b7c046866ce0469cd129ee3f7bb3799b34e271 | [
"Apache-2.0"
] | 104 | 2020-03-04T14:31:31.000Z | 2022-03-28T02:59:36.000Z | etl/parsers/etw/Microsoft_Windows_SecurityMitigationsBroker.py | IMULMUL/etl-parser | 76b7c046866ce0469cd129ee3f7bb3799b34e271 | [
"Apache-2.0"
] | 7 | 2020-04-20T09:18:39.000Z | 2022-03-19T17:06:19.000Z | etl/parsers/etw/Microsoft_Windows_SecurityMitigationsBroker.py | IMULMUL/etl-parser | 76b7c046866ce0469cd129ee3f7bb3799b34e271 | [
"Apache-2.0"
] | 16 | 2020-03-05T18:55:59.000Z | 2022-03-01T10:19:28.000Z | # -*- coding: utf-8 -*-
"""
Microsoft-Windows-SecurityMitigationsBroker
GUID : ea8cd8a5-78ff-4418-b292-aadc6a7181df
"""
from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct
from etl.utils import WString, CString, SystemTime, Guid
from etl.dtyp import Sid
from etl.parsers.etw.core import Etw, declare, guid
@declare(guid=guid("ea8cd8a5-78ff-4418-b292-aadc6a7181df"), event_id=1003, version=0)
class Microsoft_Windows_SecurityMitigationsBroker_1003_0(Etw):
pattern = Struct(
"DriverId" / Int64ul,
"ErrorCode" / Int32ul
)
@declare(guid=guid("ea8cd8a5-78ff-4418-b292-aadc6a7181df"), event_id=1004, version=0)
class Microsoft_Windows_SecurityMitigationsBroker_1004_0(Etw):
pattern = Struct(
"DriverId" / Int64ul,
"ErrorCode" / Int32ul
)
@declare(guid=guid("ea8cd8a5-78ff-4418-b292-aadc6a7181df"), event_id=1005, version=0)
class Microsoft_Windows_SecurityMitigationsBroker_1005_0(Etw):
pattern = Struct(
"DriverId" / Int64ul,
"ErrorCode" / Int32ul
)
@declare(guid=guid("ea8cd8a5-78ff-4418-b292-aadc6a7181df"), event_id=1006, version=0)
class Microsoft_Windows_SecurityMitigationsBroker_1006_0(Etw):
pattern = Struct(
"DriverId" / Int64ul,
"ACGState" / Int32ul
)
@declare(guid=guid("ea8cd8a5-78ff-4418-b292-aadc6a7181df"), event_id=1007, version=0)
class Microsoft_Windows_SecurityMitigationsBroker_1007_0(Etw):
pattern = Struct(
"DriverId" / Int64ul,
"ProcessId" / Int32ul,
"ErrorCode" / Int32ul
)
@declare(guid=guid("ea8cd8a5-78ff-4418-b292-aadc6a7181df"), event_id=1008, version=0)
class Microsoft_Windows_SecurityMitigationsBroker_1008_0(Etw):
pattern = Struct(
"DriverId" / Int64ul,
"ProcessId" / Int32ul,
"ErrorCode" / Int32ul
)
@declare(guid=guid("ea8cd8a5-78ff-4418-b292-aadc6a7181df"), event_id=1009, version=0)
class Microsoft_Windows_SecurityMitigationsBroker_1009_0(Etw):
pattern = Struct(
"DriverId" / Int64ul,
"ProcessId" / Int32ul,
"ACGState" / Int32ul
)
@declare(guid=guid("ea8cd8a5-78ff-4418-b292-aadc6a7181df"), event_id=1010, version=0)
class Microsoft_Windows_SecurityMitigationsBroker_1010_0(Etw):
pattern = Struct(
"DriverId" / Int64ul,
"ProcessId" / Int32ul
)
@declare(guid=guid("ea8cd8a5-78ff-4418-b292-aadc6a7181df"), event_id=1011, version=0)
class Microsoft_Windows_SecurityMitigationsBroker_1011_0(Etw):
pattern = Struct(
"DriverId" / Int64ul,
"ProcessId" / Int32ul
)
@declare(guid=guid("ea8cd8a5-78ff-4418-b292-aadc6a7181df"), event_id=1012, version=0)
class Microsoft_Windows_SecurityMitigationsBroker_1012_0(Etw):
pattern = Struct(
"DriverId" / Int64ul,
"ProcessId" / Int32ul,
"ErrorCode" / Int32ul
)
@declare(guid=guid("ea8cd8a5-78ff-4418-b292-aadc6a7181df"), event_id=1013, version=0)
class Microsoft_Windows_SecurityMitigationsBroker_1013_0(Etw):
pattern = Struct(
"DriverId" / Int64ul,
"ProcessId" / Int32ul
)
@declare(guid=guid("ea8cd8a5-78ff-4418-b292-aadc6a7181df"), event_id=1014, version=0)
class Microsoft_Windows_SecurityMitigationsBroker_1014_0(Etw):
pattern = Struct(
"DriverId" / Int64ul,
"ProcessId" / Int32ul
)
@declare(guid=guid("ea8cd8a5-78ff-4418-b292-aadc6a7181df"), event_id=1015, version=0)
class Microsoft_Windows_SecurityMitigationsBroker_1015_0(Etw):
pattern = Struct(
"DriverId" / Int64ul,
"ProcessId" / Int32ul
)
@declare(guid=guid("ea8cd8a5-78ff-4418-b292-aadc6a7181df"), event_id=1016, version=0)
class Microsoft_Windows_SecurityMitigationsBroker_1016_0(Etw):
pattern = Struct(
"DriverId" / Int64ul,
"ProcessId" / Int32ul,
"ErrorCode" / Int32ul
)
@declare(guid=guid("ea8cd8a5-78ff-4418-b292-aadc6a7181df"), event_id=1017, version=0)
class Microsoft_Windows_SecurityMitigationsBroker_1017_0(Etw):
pattern = Struct(
"DriverId" / Int64ul,
"ProcessId" / Int32ul,
"ErrorCode" / Int32ul
)
@declare(guid=guid("ea8cd8a5-78ff-4418-b292-aadc6a7181df"), event_id=1018, version=0)
class Microsoft_Windows_SecurityMitigationsBroker_1018_0(Etw):
pattern = Struct(
"DriverId" / Int64ul,
"ProcessId" / Int32ul,
"ErrorCode" / Int32ul
)
@declare(guid=guid("ea8cd8a5-78ff-4418-b292-aadc6a7181df"), event_id=1019, version=0)
class Microsoft_Windows_SecurityMitigationsBroker_1019_0(Etw):
pattern = Struct(
"DriverId1" / Int64ul,
"DriverId2" / Int64ul,
"ProcessId" / Int32ul
)
@declare(guid=guid("ea8cd8a5-78ff-4418-b292-aadc6a7181df"), event_id=1020, version=0)
class Microsoft_Windows_SecurityMitigationsBroker_1020_0(Etw):
pattern = Struct(
"DriverId" / Int64ul,
"ProcessId" / Int32ul
)
@declare(guid=guid("ea8cd8a5-78ff-4418-b292-aadc6a7181df"), event_id=1021, version=0)
class Microsoft_Windows_SecurityMitigationsBroker_1021_0(Etw):
pattern = Struct(
"DriverId" / Int64ul,
"ProcessId" / Int32ul,
"ErrorCode" / Int32ul
)
@declare(guid=guid("ea8cd8a5-78ff-4418-b292-aadc6a7181df"), event_id=1022, version=0)
class Microsoft_Windows_SecurityMitigationsBroker_1022_0(Etw):
pattern = Struct(
"Description" / WString,
"VendorId" / Int32ul,
"DeviceId" / Int32ul,
"DriverId" / Int64ul,
"ProcessId" / Int32ul
)
@declare(guid=guid("ea8cd8a5-78ff-4418-b292-aadc6a7181df"), event_id=1023, version=0)
class Microsoft_Windows_SecurityMitigationsBroker_1023_0(Etw):
pattern = Struct(
"Description" / WString,
"VendorId" / Int32ul,
"DeviceId" / Int32ul,
"DriverId" / Int64ul,
"ProcessId" / Int32ul
)
@declare(guid=guid("ea8cd8a5-78ff-4418-b292-aadc6a7181df"), event_id=1024, version=0)
class Microsoft_Windows_SecurityMitigationsBroker_1024_0(Etw):
pattern = Struct(
"DriverId" / Int64ul,
"ProcessId" / Int32ul
)
@declare(guid=guid("ea8cd8a5-78ff-4418-b292-aadc6a7181df"), event_id=1025, version=0)
class Microsoft_Windows_SecurityMitigationsBroker_1025_0(Etw):
pattern = Struct(
"DriverId" / Int64ul,
"ProcessId" / Int32ul
)
@declare(guid=guid("ea8cd8a5-78ff-4418-b292-aadc6a7181df"), event_id=1026, version=0)
class Microsoft_Windows_SecurityMitigationsBroker_1026_0(Etw):
pattern = Struct(
"Description" / WString,
"VendorId" / Int32ul,
"DeviceId" / Int32ul,
"DriverId" / Int64ul,
"ProcessId" / Int32ul
)
@declare(guid=guid("ea8cd8a5-78ff-4418-b292-aadc6a7181df"), event_id=1027, version=0)
class Microsoft_Windows_SecurityMitigationsBroker_1027_0(Etw):
pattern = Struct(
"DriverId" / Int64ul,
"ProcessId" / Int32ul
)
@declare(guid=guid("ea8cd8a5-78ff-4418-b292-aadc6a7181df"), event_id=1030, version=0)
class Microsoft_Windows_SecurityMitigationsBroker_1030_0(Etw):
pattern = Struct(
"ModuleName" / WString
)
| 30.173729 | 123 | 0.696391 | 759 | 7,121 | 6.362319 | 0.105402 | 0.08946 | 0.22924 | 0.111824 | 0.888176 | 0.888176 | 0.583351 | 0.583351 | 0.573411 | 0.573411 | 0 | 0.149038 | 0.182137 | 7,121 | 235 | 124 | 30.302128 | 0.680117 | 0.015447 | 0 | 0.519774 | 0 | 0 | 0.218795 | 0.133676 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.022599 | 0 | 0.316384 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
2ab9fbffdfdf51006d95c7a23e622d34842779dc | 1,337 | py | Python | Pages/checkout_overview_page.py | gykudo/sauce_demo | 313b4bd956cad4807d225b0a7ed98ca0be9f3371 | [
"MIT"
] | null | null | null | Pages/checkout_overview_page.py | gykudo/sauce_demo | 313b4bd956cad4807d225b0a7ed98ca0be9f3371 | [
"MIT"
] | null | null | null | Pages/checkout_overview_page.py | gykudo/sauce_demo | 313b4bd956cad4807d225b0a7ed98ca0be9f3371 | [
"MIT"
] | null | null | null | from Locators.checkout_overview_locator import CheckoutOverviewLocator
from Objects.product import Product
from Pages.base_page_object import BasePage
from Utils.utility import Utils
class CheckoutOverViewPage(BasePage):
def __init__(self, driver):
super().__init__(driver)
def get_product_overview_info(self, index):
name = self.get_text(CheckoutOverviewLocator.PRODUCT_NAME_LABEL(index))
desc = self.get_text(CheckoutOverviewLocator.PRODUCT_DESC_LABEL(index))
price = self.get_text(CheckoutOverviewLocator.PRODUCT_PRICE_LABEL(index))
qty = self.get_text(CheckoutOverviewLocator.PRODUCT_QTY_LABEL(index))
return Product(name, desc, price, qty)
def get_product_price(self):
price_lbl = self.get_text(CheckoutOverviewLocator.TOTAL_ITEM_PRICE_LABEL)
price = Utils.convert_string_to_float(self, price_lbl)
return float(price)
def get_tax(self):
tax_lbl = self.get_text(CheckoutOverviewLocator.TAX_LABEL)
tax = Utils.convert_string_to_float(self, tax_lbl)
return float(tax)
def get_total_price(self):
total_price_lbl = self.get_text(CheckoutOverviewLocator.TOTAL_PRICE_LABEL)
total_price = Utils.convert_string_to_float(self, total_price_lbl)
return float(total_price)
def click_finish_button(self):
return self.click(CheckoutOverviewLocator.FINISH_BUTTON)
| 37.138889 | 78 | 0.799551 | 175 | 1,337 | 5.748571 | 0.251429 | 0.048708 | 0.076541 | 0.236581 | 0.389662 | 0.189861 | 0.161034 | 0 | 0 | 0 | 0 | 0 | 0.121915 | 1,337 | 35 | 79 | 38.2 | 0.856899 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.148148 | 0.037037 | 0.592593 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
2ae6eff3bd8be08beceb2b936760471cfdb63209 | 414 | py | Python | astropy/config/__init__.py | xiaomi1122/astropy | 8876e902f5efa02a3fc27d82fe15c16001d4df5e | [
"BSD-3-Clause"
] | null | null | null | astropy/config/__init__.py | xiaomi1122/astropy | 8876e902f5efa02a3fc27d82fe15c16001d4df5e | [
"BSD-3-Clause"
] | null | null | null | astropy/config/__init__.py | xiaomi1122/astropy | 8876e902f5efa02a3fc27d82fe15c16001d4df5e | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains configuration and setup utilities for the
`astropy` project. This includes all functionality related to the
affiliated package index.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from .paths import *
from .configuration import *
from .affiliated import *
| 29.571429 | 66 | 0.748792 | 51 | 414 | 5.941176 | 0.764706 | 0.066007 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002985 | 0.190821 | 414 | 13 | 67 | 31.846154 | 0.901493 | 0.524155 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.8 | 0 | 0.8 | 0.2 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
2aed7fe6b7fb1f101fb3fe39a4efc26c3e607f45 | 629 | py | Python | src/wattbike_importer.py | sdresearch/what-watt1 | d8765007bf36a1770d8ca390f8bdcf790dc0f9d5 | [
"MIT"
] | null | null | null | src/wattbike_importer.py | sdresearch/what-watt1 | d8765007bf36a1770d8ca390f8bdcf790dc0f9d5 | [
"MIT"
] | null | null | null | src/wattbike_importer.py | sdresearch/what-watt1 | d8765007bf36a1770d8ca390f8bdcf790dc0f9d5 | [
"MIT"
] | null | null | null | import requests
HUB_LOCATION = 'http://hub.wattbike.com/ranking/getSessionRows?sessionId='
class HubClient:
def __init__(self, location=None):
self.location = location if location else HUB_LOCATION
def _validate_session_id(self, session_id):
# TODO: add regex validation of session_id
return HUB_LOCATION + session_id
def get_session(self, session_id):
session_url = self._validate_session_id(session_id)
resp = requests.get(session_url)
if resp.status_code != 200:
raise requests.HTTPError('Response status code != 200')
return resp.json()
| 27.347826 | 74 | 0.693164 | 79 | 629 | 5.240506 | 0.468354 | 0.152174 | 0.082126 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.01227 | 0.222576 | 629 | 22 | 75 | 28.590909 | 0.834356 | 0.063593 | 0 | 0 | 0 | 0 | 0.143101 | 0 | 0 | 0 | 0 | 0.045455 | 0 | 1 | 0.230769 | false | 0 | 0.076923 | 0.076923 | 0.538462 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
6301f8566c81a5574264ed3398aba56307ac1ece | 213 | py | Python | Ex.27-Numpy.py | aguinaldolorandi/100-exercicios-Numpy | 276c721bd8b161153223b353168a1c15936edbd1 | [
"MIT"
] | null | null | null | Ex.27-Numpy.py | aguinaldolorandi/100-exercicios-Numpy | 276c721bd8b161153223b353168a1c15936edbd1 | [
"MIT"
] | null | null | null | Ex.27-Numpy.py | aguinaldolorandi/100-exercicios-Numpy | 276c721bd8b161153223b353168a1c15936edbd1 | [
"MIT"
] | null | null | null | # Exercícios Numpy-27
# *******************
import numpy as np
Z=np.arange((10),dtype=int)
print(Z**Z)
print(Z)
print(2<<Z>>2)
print()
print(Z <- Z)
print()
print(1j*Z)
print()
print(Z/1/1)
print()
#print(Z<Z>Z) | 12.529412 | 27 | 0.577465 | 40 | 213 | 3.075 | 0.375 | 0.243902 | 0.170732 | 0.195122 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.047619 | 0.112676 | 213 | 17 | 28 | 12.529412 | 0.603175 | 0.239437 | 0 | 0.333333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.083333 | 0 | 0.083333 | 0.833333 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
63188b300be0d3bc46d1755aa736cffb77943a19 | 199 | py | Python | content/Coverage Criteria/code-snippets-2-fytd/test_impl_with_properties.py | rvprasad/software-testing-course | 3803851dcf9f7bbd0f0b89fca6c9c5e3a48f22e0 | [
"CC-BY-4.0"
] | 11 | 2018-02-08T05:23:28.000Z | 2021-05-24T13:23:56.000Z | content/Coverage Criteria/code-snippets-2-fytd/test_impl_with_properties.py | rvprasad/software-testing-course | 3803851dcf9f7bbd0f0b89fca6c9c5e3a48f22e0 | [
"CC-BY-4.0"
] | null | null | null | content/Coverage Criteria/code-snippets-2-fytd/test_impl_with_properties.py | rvprasad/software-testing-course | 3803851dcf9f7bbd0f0b89fca6c9c5e3a48f22e0 | [
"CC-BY-4.0"
] | 2 | 2020-09-15T08:51:22.000Z | 2021-01-26T12:07:18.000Z | #py.test --cov-report=term --cov=. --cov-config=coverage.rc --cov-fail-under=100
from impl import PhysicalInfo
import pytest
import hypothesis.strategies as st
from hypothesis import given, assume
| 24.875 | 80 | 0.778894 | 30 | 199 | 5.166667 | 0.733333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.016949 | 0.110553 | 199 | 7 | 81 | 28.428571 | 0.858757 | 0.396985 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
631e5480b8873184d63c0836ee3dfc256b04bd00 | 157 | py | Python | cap8/ex2.py | felipesch92/livroPython | 061b1c095c3ec2d25fb1d5fdfbf9e9dbe10b3307 | [
"MIT"
] | null | null | null | cap8/ex2.py | felipesch92/livroPython | 061b1c095c3ec2d25fb1d5fdfbf9e9dbe10b3307 | [
"MIT"
] | null | null | null | cap8/ex2.py | felipesch92/livroPython | 061b1c095c3ec2d25fb1d5fdfbf9e9dbe10b3307 | [
"MIT"
] | null | null | null | def multiplo(a, b):
if a % b == 0:
return True
else:
return False
print(multiplo(2, 1))
print(multiplo(9, 5))
print(multiplo(81, 9))
| 17.444444 | 22 | 0.566879 | 25 | 157 | 3.56 | 0.64 | 0.438202 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.070796 | 0.280255 | 157 | 8 | 23 | 19.625 | 0.716814 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0 | 0 | 0.375 | 0.375 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
2d51dd7e74d06bcb018f0868e88b1e186fc49ead | 1,451 | py | Python | src/invoices/tests/test_models.py | brianl9995/payinv | 7fc2160c2c9bbb9568a659ff3edf2526142d33fc | [
"MIT"
] | 2 | 2019-09-21T23:36:49.000Z | 2019-10-02T23:31:21.000Z | src/invoices/tests/test_models.py | brianl9995/payinv | 7fc2160c2c9bbb9568a659ff3edf2526142d33fc | [
"MIT"
] | 2 | 2019-10-04T13:51:43.000Z | 2021-06-10T21:57:55.000Z | src/invoices/tests/test_models.py | brianl9995/payinv | 7fc2160c2c9bbb9568a659ff3edf2526142d33fc | [
"MIT"
] | 2 | 2019-10-02T23:31:22.000Z | 2020-06-07T14:57:55.000Z | from django.test import TestCase
from core.tests.factories import SaleFactory, InvoiceFactory
from invoices.models import Invoice
class InvoiceModelTestCase(TestCase):
def test_sales_pending_without_invoice(self):
""" Should return this sale if not have Invoice to cover"""
sale = SaleFactory(total_value=100)
self.assertCountEqual(Invoice.sales_pending().all(), [sale])
def test_sales_pending_with_invoice_not_all_value(self):
""" Should return this sale if has invoices for not all total_value"""
sale = SaleFactory(total_value=1000)
InvoiceFactory(sale=sale, total_value=50)
InvoiceFactory(sale=sale, total_value=50)
self.assertCountEqual(Invoice.sales_pending().all(), [sale])
def test_sales_pending_with_invoice_for_all_value(self):
""" Should return not sale if has invoices for all total_value"""
sale = SaleFactory(total_value=1000)
InvoiceFactory(sale=sale, total_value=500)
InvoiceFactory(sale=sale, total_value=500)
self.assertEqual(Invoice.sales_pending().count(), 0)
def test_sales_pending_with_invoice_for_most_all_value(self):
""" Should return not sale if has invoices for all total_value"""
sale = SaleFactory(total_value=1000)
InvoiceFactory(sale=sale, total_value=1500)
InvoiceFactory(sale=sale, total_value=500)
self.assertEqual(Invoice.sales_pending().count(), 0)
| 43.969697 | 78 | 0.724328 | 186 | 1,451 | 5.419355 | 0.241935 | 0.128968 | 0.130952 | 0.160714 | 0.760913 | 0.739087 | 0.64881 | 0.613095 | 0.613095 | 0.613095 | 0 | 0.028692 | 0.183322 | 1,451 | 32 | 79 | 45.34375 | 0.821941 | 0.161268 | 0 | 0.545455 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.181818 | 1 | 0.181818 | false | 0 | 0.136364 | 0 | 0.363636 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
2d641c2640b0ffe80cc97c24622ffeee1f154b10 | 84 | py | Python | tools/Sikuli/DoReplace.sikuli/DoReplace.py | marmyshev/vanessa-automation | 9f87bd6df58b4c205104d3ae8e3643752d67eef7 | [
"BSD-3-Clause"
] | 296 | 2018-05-27T08:03:14.000Z | 2022-03-19T08:36:11.000Z | tools/Sikuli/DoReplace.sikuli/DoReplace.py | marmyshev/vanessa-automation | 9f87bd6df58b4c205104d3ae8e3643752d67eef7 | [
"BSD-3-Clause"
] | 1,562 | 2018-05-27T18:36:25.000Z | 2022-03-31T07:35:11.000Z | tools/Sikuli/DoReplace.sikuli/DoReplace.py | marmyshev/vanessa-automation | 9f87bd6df58b4c205104d3ae8e3643752d67eef7 | [
"BSD-3-Clause"
] | 299 | 2018-06-18T20:00:56.000Z | 2022-03-29T12:29:55.000Z | click(Pattern("Bameumbrace.png").similar(0.80))
sleep(1)
click("3abnb.png")
exit(0)
| 16.8 | 47 | 0.714286 | 14 | 84 | 4.285714 | 0.785714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.075 | 0.047619 | 84 | 4 | 48 | 21 | 0.675 | 0 | 0 | 0 | 0 | 0 | 0.285714 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
2d6f721c6dc031148182f002703abf47c155dce1 | 359 | py | Python | tests/doubles/producers.py | ess-dmsc/JustBinIt | dc8242ed44f03e92f60618c96596025ec8cbc40e | [
"BSD-2-Clause"
] | null | null | null | tests/doubles/producers.py | ess-dmsc/JustBinIt | dc8242ed44f03e92f60618c96596025ec8cbc40e | [
"BSD-2-Clause"
] | 23 | 2018-12-04T11:50:37.000Z | 2022-03-17T11:30:39.000Z | tests/doubles/producers.py | ess-dmsc/JustBinIt | dc8242ed44f03e92f60618c96596025ec8cbc40e | [
"BSD-2-Clause"
] | 2 | 2019-07-24T11:13:41.000Z | 2020-08-04T18:33:22.000Z | from just_bin_it.exceptions import KafkaException
class SpyProducer:
def __init__(self, brokers=None):
self.messages = []
def publish_message(self, topic, message):
self.messages.append((topic, message))
class StubProducerThatThrows:
def publish_message(self, topic, message):
raise KafkaException("Some Kafka error")
| 23.933333 | 49 | 0.715877 | 40 | 359 | 6.225 | 0.6 | 0.13253 | 0.136546 | 0.168675 | 0.26506 | 0.26506 | 0 | 0 | 0 | 0 | 0 | 0 | 0.192201 | 359 | 14 | 50 | 25.642857 | 0.858621 | 0 | 0 | 0.222222 | 0 | 0 | 0.044568 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.111111 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
2d7a3e516a3dc6332a0d0d4fc1a519e619d09c80 | 95 | py | Python | back/treatments/apps.py | EDario333/idia | 21cab7057f924c58ec098c27effcee1a8f0dc94e | [
"BSD-3-Clause"
] | null | null | null | back/treatments/apps.py | EDario333/idia | 21cab7057f924c58ec098c27effcee1a8f0dc94e | [
"BSD-3-Clause"
] | 5 | 2021-03-11T05:33:41.000Z | 2022-02-27T10:21:50.000Z | back/treatments/apps.py | EDario333/idia | 21cab7057f924c58ec098c27effcee1a8f0dc94e | [
"BSD-3-Clause"
] | null | null | null | from django.apps import AppConfig
class TreatmentsConfig(AppConfig):
name = 'treatments'
| 15.833333 | 34 | 0.768421 | 10 | 95 | 7.3 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.157895 | 95 | 5 | 35 | 19 | 0.9125 | 0 | 0 | 0 | 0 | 0 | 0.105263 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
2d987782f603dc9882b5729a821433527afffdcc | 1,475 | py | Python | polls/views.py | alejandro-medici/django_docker | 6fe847837c244f506bd35809f2444f182bfc6500 | [
"MIT"
] | 1 | 2021-12-02T22:44:24.000Z | 2021-12-02T22:44:24.000Z | polls/views.py | alejandro-medici/django_docker | 6fe847837c244f506bd35809f2444f182bfc6500 | [
"MIT"
] | null | null | null | polls/views.py | alejandro-medici/django_docker | 6fe847837c244f506bd35809f2444f182bfc6500 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponse
from django.template.loader import get_template
from .models import Poll
from time import timezone
from datetime import date
# Create your views here.
def index(request):
myTemplate = get_template('./index.html')
print(myTemplate)
return render(request, myTemplate)
def detail(request, poll_id):
return HttpResponse("You're looking at poll %s." % poll_id)
def results(request, poll_id):
return HttpResponse("You're looking at the results of poll %s." % poll_id)
# CRUD
def create(request):
newPoll = Poll(question="What's up?", pub_date= date.today())
newPoll.save()
return HttpResponse("You're creating a new poll with id %s." % newPoll.id)
def update(request, id):
response = HttpResponse("You must send data using POST")
if request.method == 'POST':
response = HttpResponse("You're updating poll %s." % id)
myPoll = Poll.objects.get(id=id)
myPoll.question = request.POST['question']
myPoll.save()
return response
def delete(request, id):
myPoll = Poll.objects.get(id=id)
myPoll.delete()
return HttpResponse("You're deleting poll %s." % id)
def read(request, id):
myPoll = Poll.objects.get(id=id)
return HttpResponse("You're reading a poll. %s " % myPoll)
#### SECURITY PENDING TOPICS
# Toda conexion con el back deberia tener un token.
# Todo API/CRUD tiene que tener un limite de queries... | 30.102041 | 79 | 0.699661 | 209 | 1,475 | 4.904306 | 0.401914 | 0.102439 | 0.099512 | 0.112195 | 0.211707 | 0.189268 | 0.189268 | 0.189268 | 0.087805 | 0 | 0 | 0 | 0.187797 | 1,475 | 49 | 80 | 30.102041 | 0.855593 | 0.105763 | 0 | 0.090909 | 0 | 0 | 0.184592 | 0 | 0 | 0 | 0 | 0.020408 | 0 | 1 | 0.212121 | false | 0 | 0.181818 | 0.060606 | 0.606061 | 0.030303 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
2da1a492db1b897c4bb9696be1e2b24cd6f6083c | 280 | py | Python | love_release/utils.py | toxinu/pylove-release | 92d879cbaa7cd6e5adfe21151617377bde7ba358 | [
"Zlib"
] | 1 | 2017-02-26T10:50:03.000Z | 2017-02-26T10:50:03.000Z | love_release/utils.py | toxinu/pylove-release | 92d879cbaa7cd6e5adfe21151617377bde7ba358 | [
"Zlib"
] | 1 | 2020-12-09T08:15:16.000Z | 2020-12-09T08:15:16.000Z | love_release/utils.py | toxinu/pylove-release | 92d879cbaa7cd6e5adfe21151617377bde7ba358 | [
"Zlib"
] | null | null | null | from subprocess import PIPE
from subprocess import Popen
def run(command):
assert (isinstance(command, list)), "Command must be a list"
p = Popen(command, stdout=PIPE, stderr=PIPE)
s, e = p.communicate()
return s.decode('utf-8'), e.decode('utf-8'), p.returncode
| 28 | 64 | 0.689286 | 42 | 280 | 4.595238 | 0.595238 | 0.145078 | 0.207254 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008658 | 0.175 | 280 | 9 | 65 | 31.111111 | 0.82684 | 0 | 0 | 0 | 0 | 0 | 0.114286 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 1 | 0.142857 | false | 0 | 0.285714 | 0 | 0.571429 | 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 | 0 | 0 | 1 | 0 | 0 | 3 |
2dbea13bd2722e39d52ed915d89d5e1fea406ab7 | 458 | py | Python | Forms/InstagramLoginForm.py | CT83/PyMultiPoster | 2ecd96764f21a88486f87cc55099ddff8d106e4f | [
"Apache-2.0"
] | null | null | null | Forms/InstagramLoginForm.py | CT83/PyMultiPoster | 2ecd96764f21a88486f87cc55099ddff8d106e4f | [
"Apache-2.0"
] | null | null | null | Forms/InstagramLoginForm.py | CT83/PyMultiPoster | 2ecd96764f21a88486f87cc55099ddff8d106e4f | [
"Apache-2.0"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import PasswordField, SubmitField, StringField
from wtforms.validators import DataRequired, Length
class InstagramLoginForm(FlaskForm):
username = StringField('Instagram Username', validators=[DataRequired(),
Length(min=6, max=20)])
password = PasswordField('Instagram Password', validators=[DataRequired()])
submit = SubmitField('Save')
| 41.636364 | 84 | 0.679039 | 40 | 458 | 7.75 | 0.575 | 0.070968 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008547 | 0.233624 | 458 | 10 | 85 | 45.8 | 0.874644 | 0 | 0 | 0 | 0 | 0 | 0.087336 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.25 | 0.375 | 0 | 0.875 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 3 |
2dd802a334b7dcb54120950c7e4f4e6a2c7dc01e | 437 | py | Python | rl_sandbox/priors/uniform.py | chanb/rl_sandbox_public | e55f954a29880f83a5b0c3358badda4d900f1564 | [
"MIT"
] | 14 | 2020-11-09T22:05:37.000Z | 2022-02-11T12:41:33.000Z | rl_sandbox/priors/uniform.py | chanb/rl_sandbox_public | e55f954a29880f83a5b0c3358badda4d900f1564 | [
"MIT"
] | null | null | null | rl_sandbox/priors/uniform.py | chanb/rl_sandbox_public | e55f954a29880f83a5b0c3358badda4d900f1564 | [
"MIT"
] | null | null | null | import torch
from torch.distributions import Uniform
from rl_sandbox.constants import CPU
class UniformPrior:
def __init__(self, low, high, device=torch.device(CPU)):
self.device = device
self.dist = Uniform(low=low, high=high)
def sample(self, num_samples):
return self.dist.rsample(sample_shape=num_samples).to(self.device)
def lprob(self, samples):
return self.dist.log_prob(samples)
| 24.277778 | 74 | 0.709382 | 60 | 437 | 5.016667 | 0.466667 | 0.079734 | 0.112957 | 0.139535 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.19222 | 437 | 17 | 75 | 25.705882 | 0.852691 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.272727 | false | 0 | 0.272727 | 0.181818 | 0.818182 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
2deca87ea9f9f2cd6faccaa2e1e2be6b9753edc0 | 54,161 | py | Python | pysnmp/PRIVATE-SW0657840-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/PRIVATE-SW0657840-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/PRIVATE-SW0657840-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module PRIVATE-SW0657840-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/PRIVATE-SW0657840-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:33:18 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsUnion, ValueRangeConstraint, SingleValueConstraint, ConstraintsIntersection, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsIntersection", "ValueSizeConstraint")
ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex")
NotificationGroup, ModuleCompliance, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance", "ObjectGroup")
Integer32, Counter64, Counter32, MibIdentifier, iso, Gauge32, enterprises, TimeTicks, MibScalar, MibTable, MibTableRow, MibTableColumn, ModuleIdentity, ObjectIdentity, Unsigned32, IpAddress, Bits, NotificationType = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "Counter64", "Counter32", "MibIdentifier", "iso", "Gauge32", "enterprises", "TimeTicks", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ModuleIdentity", "ObjectIdentity", "Unsigned32", "IpAddress", "Bits", "NotificationType")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
privatetech = ModuleIdentity((1, 3, 6, 1, 4, 1, 5205))
if mibBuilder.loadTexts: privatetech.setLastUpdated('200607030000Z')
if mibBuilder.loadTexts: privatetech.setOrganization('xxx Tech Corp.')
switch = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2))
sw0657840ProductID = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9))
sw0657840Produces = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1))
sw0657840System = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1))
sw0657840CommonSys = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1))
sw0657840Reboot = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ValueRangeConstraint(2, 2), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840Reboot.setStatus('current')
sw0657840BiosVsersion = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840BiosVsersion.setStatus('current')
sw0657840FirmwareVersion = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 3), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840FirmwareVersion.setStatus('current')
sw0657840HardwareVersion = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 4), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840HardwareVersion.setStatus('current')
sw0657840MechanicalVersion = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 5), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840MechanicalVersion.setStatus('current')
sw0657840SerialNumber = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 6), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840SerialNumber.setStatus('current')
sw0657840HostMacAddress = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 7), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840HostMacAddress.setStatus('current')
sw0657840DevicePort = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 8), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840DevicePort.setStatus('current')
sw0657840RamSize = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 9), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840RamSize.setStatus('current')
sw0657840FlashSize = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 10), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840FlashSize.setStatus('current')
sw0657840IP = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 2))
sw0657840DhcpSetting = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 2, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840DhcpSetting.setStatus('current')
sw0657840IPAddress = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 2, 2), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840IPAddress.setStatus('current')
sw0657840NetMask = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 2, 3), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840NetMask.setStatus('current')
sw0657840DefaultGateway = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 2, 4), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840DefaultGateway.setStatus('current')
sw0657840DnsSetting = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 2, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840DnsSetting.setStatus('current')
sw0657840DnsServer = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 2, 6), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840DnsServer.setStatus('current')
sw0657840Time = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 3))
sw0657840SystemCurrentTime = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 3, 1), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840SystemCurrentTime.setStatus('current')
sw0657840ManualTimeSetting = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 3, 2), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840ManualTimeSetting.setStatus('current')
sw0657840NTPServer = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 3, 3), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840NTPServer.setStatus('current')
sw0657840NTPTimeZone = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 3, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-12, 13))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840NTPTimeZone.setStatus('current')
sw0657840NTPTimeSync = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 3, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840NTPTimeSync.setStatus('current')
sw0657840DaylightSavingTime = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 3, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-5, 5))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840DaylightSavingTime.setStatus('current')
sw0657840DaylightStartTime = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 3, 7), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840DaylightStartTime.setStatus('current')
sw0657840DaylightEndTime = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 3, 8), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840DaylightEndTime.setStatus('current')
sw0657840Account = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4))
sw0657840AccountNumber = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 5))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840AccountNumber.setStatus('current')
sw0657840AccountTable = MibTable((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 2), )
if mibBuilder.loadTexts: sw0657840AccountTable.setStatus('current')
sw0657840AccountEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 2, 1), ).setIndexNames((0, "PRIVATE-SW0657840-MIB", "sw0657840AccountIndex"))
if mibBuilder.loadTexts: sw0657840AccountEntry.setStatus('current')
sw0657840AccountIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 5))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840AccountIndex.setStatus('current')
sw0657840AccountAuthorization = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 2, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840AccountAuthorization.setStatus('current')
sw0657840AccountName = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 2, 1, 3), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840AccountName.setStatus('current')
sw0657840AccountPassword = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 2, 1, 4), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840AccountPassword.setStatus('current')
sw0657840AccountAddName = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 3), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840AccountAddName.setStatus('current')
sw0657840AccountAddPassword = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 4), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840AccountAddPassword.setStatus('current')
sw0657840DoAccountAdd = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840DoAccountAdd.setStatus('current')
sw0657840AccountDel = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(2, 5))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840AccountDel.setStatus('current')
sw0657840Snmp = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2))
sw0657840GetCommunity = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2, 1), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840GetCommunity.setStatus('current')
sw0657840SetCommunity = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2, 2), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840SetCommunity.setStatus('current')
sw0657840TrapHostNumber = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 6))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840TrapHostNumber.setStatus('current')
sw0657840TrapHostTable = MibTable((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2, 4), )
if mibBuilder.loadTexts: sw0657840TrapHostTable.setStatus('current')
sw0657840TrapHostEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2, 4, 1), ).setIndexNames((0, "PRIVATE-SW0657840-MIB", "sw0657840TrapHostIndex"))
if mibBuilder.loadTexts: sw0657840TrapHostEntry.setStatus('current')
sw0657840TrapHostIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 6))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840TrapHostIndex.setStatus('current')
sw0657840TrapHostIP = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2, 4, 1, 2), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840TrapHostIP.setStatus('current')
sw0657840TrapHostPort = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2, 4, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840TrapHostPort.setStatus('current')
sw0657840TrapHostCommunity = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2, 4, 1, 4), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840TrapHostCommunity.setStatus('current')
sw0657840Alarm = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3))
sw0657840Event = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 1))
sw0657840EventNumber = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840EventNumber.setStatus('current')
sw0657840EventTable = MibTable((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 1, 2), )
if mibBuilder.loadTexts: sw0657840EventTable.setStatus('current')
sw0657840EventEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 1, 2, 1), ).setIndexNames((0, "PRIVATE-SW0657840-MIB", "sw0657840EventIndex"))
if mibBuilder.loadTexts: sw0657840EventEntry.setStatus('current')
sw0657840EventIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840EventIndex.setStatus('current')
sw0657840EventName = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 1, 2, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840EventName.setStatus('current')
sw0657840EventSendEmail = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840EventSendEmail.setStatus('current')
sw0657840EventSendSMS = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 1, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840EventSendSMS.setStatus('current')
sw0657840EventSendTrap = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 1, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840EventSendTrap.setStatus('current')
sw0657840Email = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 2))
sw0657840EmailServer = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 2, 1), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840EmailServer.setStatus('current')
sw0657840EmailUsername = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 2, 2), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840EmailUsername.setStatus('current')
sw0657840EmailPassword = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 2, 3), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840EmailPassword.setStatus('current')
sw0657840EmailUserNumber = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 2, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 6))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840EmailUserNumber.setStatus('current')
sw0657840EmailUserTable = MibTable((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 2, 5), )
if mibBuilder.loadTexts: sw0657840EmailUserTable.setStatus('current')
sw0657840EmailUserEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 2, 5, 1), ).setIndexNames((0, "PRIVATE-SW0657840-MIB", "sw0657840EmailUserIndex"))
if mibBuilder.loadTexts: sw0657840EmailUserEntry.setStatus('current')
sw0657840EmailUserIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 2, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 6))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840EmailUserIndex.setStatus('current')
sw0657840EmailUserAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 2, 5, 1, 2), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840EmailUserAddress.setStatus('current')
sw0657840SMS = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 3))
sw0657840SMSServer = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 3, 1), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840SMSServer.setStatus('current')
sw0657840SMSUsername = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 3, 2), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840SMSUsername.setStatus('current')
sw0657840SMSPassword = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 3, 3), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840SMSPassword.setStatus('current')
sw0657840SMSUserNumber = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 3, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 6))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840SMSUserNumber.setStatus('current')
sw0657840SMSUserTable = MibTable((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 3, 5), )
if mibBuilder.loadTexts: sw0657840SMSUserTable.setStatus('current')
sw0657840SMSUserEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 3, 5, 1), ).setIndexNames((0, "PRIVATE-SW0657840-MIB", "sw0657840SMSUserIndex"))
if mibBuilder.loadTexts: sw0657840SMSUserEntry.setStatus('current')
sw0657840SMSUserIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 3, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 6))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840SMSUserIndex.setStatus('current')
sw0657840SMSUserMobilePhone = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 3, 5, 1, 2), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840SMSUserMobilePhone.setStatus('current')
sw0657840Tftp = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 4))
sw0657840TftpServer = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 4, 1), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840TftpServer.setStatus('current')
sw0657840Configuration = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5))
sw0657840SaveRestore = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 1))
sw0657840SaveStart = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840SaveStart.setStatus('current')
sw0657840SaveUser = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840SaveUser.setStatus('current')
sw0657840RestoreDefault = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ValueRangeConstraint(2, 2), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840RestoreDefault.setStatus('current')
sw0657840RestoreUser = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840RestoreUser.setStatus('current')
sw0657840ConfigFile = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 2))
sw0657840ExportConfigName = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 2, 1), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840ExportConfigName.setStatus('current')
sw0657840DoExportConfig = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 2, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(1, 1), ValueRangeConstraint(2, 2), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840DoExportConfig.setStatus('current')
sw0657840ImportConfigName = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 2, 3), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840ImportConfigName.setStatus('current')
sw0657840DoImportConfig = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 2, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(1, 1), ValueRangeConstraint(2, 2), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840DoImportConfig.setStatus('current')
sw0657840Diagnostic = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 6))
sw0657840EEPROMTest = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 6, 1), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840EEPROMTest.setStatus('current')
sw0657840UartTest = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 6, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840UartTest.setStatus('current')
sw0657840DramTest = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 6, 3), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840DramTest.setStatus('current')
sw0657840FlashTest = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 6, 4), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840FlashTest.setStatus('current')
sw0657840InternalLoopbackTest = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 6, 5), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840InternalLoopbackTest.setStatus('current')
sw0657840ExternalLoopbackTest = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 6, 6), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840ExternalLoopbackTest.setStatus('current')
sw0657840PingTest = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 6, 7), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840PingTest.setStatus('current')
sw0657840Log = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 7))
sw0657840ClearLog = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 7, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840ClearLog.setStatus('current')
sw0657840UploadLog = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 7, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840UploadLog.setStatus('current')
sw0657840AutoUploadLogState = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 7, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840AutoUploadLogState.setStatus('current')
sw0657840LogNumber = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 7, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 120))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840LogNumber.setStatus('current')
sw0657840LogTable = MibTable((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 7, 5), )
if mibBuilder.loadTexts: sw0657840LogTable.setStatus('current')
sw0657840LogEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 7, 5, 1), ).setIndexNames((0, "PRIVATE-SW0657840-MIB", "sw0657840LogIndex"))
if mibBuilder.loadTexts: sw0657840LogEntry.setStatus('current')
sw0657840LogIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 7, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 120))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840LogIndex.setStatus('current')
sw0657840LogEvent = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 7, 5, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840LogEvent.setStatus('current')
sw0657840Firmware = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 8))
sw0657840FirmwareFileName = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 8, 1), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840FirmwareFileName.setStatus('current')
sw0657840DoFirmwareUpgrade = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 8, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840DoFirmwareUpgrade.setStatus('current')
sw0657840Port = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9))
sw0657840PortStatus = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1))
sw0657840PortStatusNumber = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840PortStatusNumber.setStatus('current')
sw0657840PortStatusTable = MibTable((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2), )
if mibBuilder.loadTexts: sw0657840PortStatusTable.setStatus('current')
sw0657840PortStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2, 1), ).setIndexNames((0, "PRIVATE-SW0657840-MIB", "sw0657840PortStatusIndex"))
if mibBuilder.loadTexts: sw0657840PortStatusEntry.setStatus('current')
sw0657840PortStatusIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840PortStatusIndex.setStatus('current')
sw0657840PortStatusMedia = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840PortStatusMedia.setStatus('current')
sw0657840PortStatusLink = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2, 1, 3), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840PortStatusLink.setStatus('current')
sw0657840PortStatusPortState = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2, 1, 4), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840PortStatusPortState.setStatus('current')
sw0657840PortStatusAutoNego = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2, 1, 5), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840PortStatusAutoNego.setStatus('current')
sw0657840PortStatusSpdDpx = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2, 1, 6), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840PortStatusSpdDpx.setStatus('current')
sw0657840PortStatusFlwCtrl = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2, 1, 7), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840PortStatusFlwCtrl.setStatus('current')
sw0657840PortStatuDescription = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2, 1, 8), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840PortStatuDescription.setStatus('current')
sw0657840PortConf = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 2))
sw0657840PortConfNumber = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 2, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840PortConfNumber.setStatus('current')
sw0657840PortConfTable = MibTable((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 2, 2), )
if mibBuilder.loadTexts: sw0657840PortConfTable.setStatus('current')
sw0657840PortConfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 2, 2, 1), ).setIndexNames((0, "PRIVATE-SW0657840-MIB", "sw0657840PortConfIndex"))
if mibBuilder.loadTexts: sw0657840PortConfEntry.setStatus('current')
sw0657840PortConfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 2, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840PortConfIndex.setStatus('current')
sw0657840PortConfPortState = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 2, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840PortConfPortState.setStatus('current')
sw0657840PortConfSpdDpx = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 2, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 5))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840PortConfSpdDpx.setStatus('current')
sw0657840PortConfFlwCtrl = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 2, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840PortConfFlwCtrl.setStatus('current')
sw0657840PortConfDescription = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 2, 2, 1, 5), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840PortConfDescription.setStatus('current')
sw0657840Mirror = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 10))
sw0657840MirrorMode = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 10, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840MirrorMode.setStatus('current')
sw0657840MirroringPort = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 10, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840MirroringPort.setStatus('current')
sw0657840MirroredPorts = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 10, 3), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840MirroredPorts.setStatus('current')
sw0657840MaxPktLen = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 11))
sw0657840MaxPktLen1 = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 11, 1))
sw0657840MaxPktLenPortNumber = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 11, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840MaxPktLenPortNumber.setStatus('current')
sw0657840MaxPktLenConfTable = MibTable((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 11, 1, 2), )
if mibBuilder.loadTexts: sw0657840MaxPktLenConfTable.setStatus('current')
sw0657840MaxPktLenConfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 11, 1, 2, 1), ).setIndexNames((0, "PRIVATE-SW0657840-MIB", "sw0657840MaxPktLenConfIndex"))
if mibBuilder.loadTexts: sw0657840MaxPktLenConfEntry.setStatus('current')
sw0657840MaxPktLenConfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 11, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840MaxPktLenConfIndex.setStatus('current')
sw0657840MaxPktLenConfSetting = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 11, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(1518, 1518), ValueRangeConstraint(1532, 1532), ValueRangeConstraint(9216, 9216), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840MaxPktLenConfSetting.setStatus('current')
sw0657840Bandwidth = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12))
sw0657840Bandwidth1 = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1))
sw0657840BandwidthPortNumber = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840BandwidthPortNumber.setStatus('current')
sw0657840BandwidthConfTable = MibTable((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 2), )
if mibBuilder.loadTexts: sw0657840BandwidthConfTable.setStatus('current')
sw0657840BandwidthConfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 2, 1), ).setIndexNames((0, "PRIVATE-SW0657840-MIB", "sw0657840BandwidthConfIndex"))
if mibBuilder.loadTexts: sw0657840BandwidthConfEntry.setStatus('current')
sw0657840BandwidthConfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840BandwidthConfIndex.setStatus('current')
sw0657840BandwidthConfIngressState = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840BandwidthConfIngressState.setStatus('current')
sw0657840BandwidthConfIngressBW = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1000))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840BandwidthConfIngressBW.setStatus('current')
sw0657840BandwidthConfStormState = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840BandwidthConfStormState.setStatus('current')
sw0657840BandwidthConfStormBW = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 2, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1000))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840BandwidthConfStormBW.setStatus('current')
sw0657840BandwidthConfEgressState = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840BandwidthConfEgressState.setStatus('current')
sw0657840BandwidthConfEgressBW = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 2, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1000))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840BandwidthConfEgressBW.setStatus('current')
sw0657840LoopDetectedConf = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 13))
sw0657840LoopDetectedNumber = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 13, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840LoopDetectedNumber.setStatus('current')
sw0657840LoopDetectedTable = MibTable((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 13, 2), )
if mibBuilder.loadTexts: sw0657840LoopDetectedTable.setStatus('current')
sw0657840LoopDetectedEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 13, 2, 1), ).setIndexNames((0, "PRIVATE-SW0657840-MIB", "sw0657840LoopDetectedfIndex"))
if mibBuilder.loadTexts: sw0657840LoopDetectedEntry.setStatus('current')
sw0657840LoopDetectedfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 13, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840LoopDetectedfIndex.setStatus('current')
sw0657840LoopDetectedStateEbl = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 13, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840LoopDetectedStateEbl.setStatus('current')
sw0657840LoopDetectedCurrentStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 13, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840LoopDetectedCurrentStatus.setStatus('current')
sw0657840LoopDetectedResumed = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 13, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840LoopDetectedResumed.setStatus('current')
sw0657840LoopDetectedAction = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 13, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sw0657840LoopDetectedAction.setStatus('current')
sw0657840SFPInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14))
sw0657840SFPInfoNumber = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840SFPInfoNumber.setStatus('current')
sw0657840SFPInfoTable = MibTable((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2), )
if mibBuilder.loadTexts: sw0657840SFPInfoTable.setStatus('current')
sw0657840SFPInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1), ).setIndexNames((0, "PRIVATE-SW0657840-MIB", "sw0657840SFPInfoIndex"))
if mibBuilder.loadTexts: sw0657840SFPInfoEntry.setStatus('current')
sw0657840SFPInfoIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840SFPInfoIndex.setStatus('current')
sw0657840SFPConnectorType = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840SFPConnectorType.setStatus('current')
sw0657840SFPFiberType = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 3), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840SFPFiberType.setStatus('current')
sw0657840SFPWavelength = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 4), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840SFPWavelength.setStatus('current')
sw0657840SFPBaudRate = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 5), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840SFPBaudRate.setStatus('current')
sw0657840SFPVendorOUI = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 6), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840SFPVendorOUI.setStatus('current')
sw0657840SFPVendorName = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 7), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840SFPVendorName.setStatus('current')
sw0657840SFPVendorPN = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 8), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840SFPVendorPN.setStatus('current')
sw0657840SFPVendorRev = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 9), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840SFPVendorRev.setStatus('current')
sw0657840SFPVendorSN = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 10), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840SFPVendorSN.setStatus('current')
sw0657840SFPDateCode = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 11), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840SFPDateCode.setStatus('current')
sw0657840SFPTemperature = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 12), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840SFPTemperature.setStatus('current')
sw0657840SFPVcc = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 13), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840SFPVcc.setStatus('current')
sw0657840SFPTxBias = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 14), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840SFPTxBias.setStatus('current')
sw0657840SFPTxPWR = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 15), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840SFPTxPWR.setStatus('current')
sw0657840SFPRxPWR = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 16), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sw0657840SFPRxPWR.setStatus('current')
sw0657840TrapEntry = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20))
sw0657840ModuleInserted = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 1)).setObjects(("IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: sw0657840ModuleInserted.setStatus('current')
sw0657840ModuleRemoved = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 2)).setObjects(("IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: sw0657840ModuleRemoved.setStatus('current')
sw0657840DualMediaSwapped = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 3)).setObjects(("IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: sw0657840DualMediaSwapped.setStatus('current')
sw0657840LoopDetected = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 5)).setObjects(("IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: sw0657840LoopDetected.setStatus('current')
sw0657840StpStateDisabled = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 100))
if mibBuilder.loadTexts: sw0657840StpStateDisabled.setStatus('current')
sw0657840StpStateEnabled = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 101))
if mibBuilder.loadTexts: sw0657840StpStateEnabled.setStatus('current')
sw0657840StpTopologyChanged = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 102)).setObjects(("IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: sw0657840StpTopologyChanged.setStatus('current')
sw0657840LacpStateDisabled = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 120)).setObjects(("IF-MIB", "ifIndex"), ("PRIVATE-SW0657840-MIB", "groupId"))
if mibBuilder.loadTexts: sw0657840LacpStateDisabled.setStatus('current')
sw0657840LacpStateEnabled = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 121)).setObjects(("IF-MIB", "ifIndex"), ("PRIVATE-SW0657840-MIB", "groupId"))
if mibBuilder.loadTexts: sw0657840LacpStateEnabled.setStatus('current')
sw0657840LacpPortAdded = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 123)).setObjects(("IF-MIB", "ifIndex"), ("PRIVATE-SW0657840-MIB", "actorkey"), ("PRIVATE-SW0657840-MIB", "partnerkey"))
if mibBuilder.loadTexts: sw0657840LacpPortAdded.setStatus('current')
sw0657840LacpPortTrunkFailure = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 124)).setObjects(("IF-MIB", "ifIndex"), ("PRIVATE-SW0657840-MIB", "actorkey"), ("PRIVATE-SW0657840-MIB", "partnerkey"))
if mibBuilder.loadTexts: sw0657840LacpPortTrunkFailure.setStatus('current')
sw0657840GvrpStateDisabled = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 140))
if mibBuilder.loadTexts: sw0657840GvrpStateDisabled.setStatus('current')
sw0657840GvrpStateEnabled = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 141))
if mibBuilder.loadTexts: sw0657840GvrpStateEnabled.setStatus('current')
sw0657840VlanStateDisabled = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 150))
if mibBuilder.loadTexts: sw0657840VlanStateDisabled.setStatus('current')
sw0657840VlanPortBaseEnabled = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 151))
if mibBuilder.loadTexts: sw0657840VlanPortBaseEnabled.setStatus('current')
sw0657840VlanTagBaseEnabled = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 152))
if mibBuilder.loadTexts: sw0657840VlanTagBaseEnabled.setStatus('current')
sw0657840VlanMetroModeEnabled = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 153)).setObjects(("PRIVATE-SW0657840-MIB", "uplink"))
if mibBuilder.loadTexts: sw0657840VlanMetroModeEnabled.setStatus('current')
sw0657840VlanDoubleTagEnabled = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 154))
if mibBuilder.loadTexts: sw0657840VlanDoubleTagEnabled.setStatus('current')
sw0657840UserLogin = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 200)).setObjects(("PRIVATE-SW0657840-MIB", "username"))
if mibBuilder.loadTexts: sw0657840UserLogin.setStatus('current')
sw0657840UserLogout = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 201)).setObjects(("PRIVATE-SW0657840-MIB", "username"))
if mibBuilder.loadTexts: sw0657840UserLogout.setStatus('current')
sw0657840TrapVariable = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 21))
username = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 21, 1), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: username.setStatus('current')
groupId = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 21, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readonly")
if mibBuilder.loadTexts: groupId.setStatus('current')
actorkey = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 21, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: actorkey.setStatus('current')
partnerkey = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 21, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: partnerkey.setStatus('current')
uplink = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 21, 5), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: uplink.setStatus('current')
mibBuilder.exportSymbols("PRIVATE-SW0657840-MIB", sw0657840Diagnostic=sw0657840Diagnostic, sw0657840SMSUserTable=sw0657840SMSUserTable, sw0657840PortConfFlwCtrl=sw0657840PortConfFlwCtrl, sw0657840SerialNumber=sw0657840SerialNumber, sw0657840DevicePort=sw0657840DevicePort, sw0657840SFPTxPWR=sw0657840SFPTxPWR, username=username, sw0657840PortConfTable=sw0657840PortConfTable, sw0657840PingTest=sw0657840PingTest, sw0657840Time=sw0657840Time, sw0657840PortStatusTable=sw0657840PortStatusTable, sw0657840SFPVendorRev=sw0657840SFPVendorRev, sw0657840ModuleInserted=sw0657840ModuleInserted, sw0657840AccountNumber=sw0657840AccountNumber, sw0657840ModuleRemoved=sw0657840ModuleRemoved, sw0657840SFPWavelength=sw0657840SFPWavelength, sw0657840PortStatusLink=sw0657840PortStatusLink, sw0657840BandwidthConfStormBW=sw0657840BandwidthConfStormBW, sw0657840UploadLog=sw0657840UploadLog, sw0657840EventSendSMS=sw0657840EventSendSMS, sw0657840PortConf=sw0657840PortConf, sw0657840DoImportConfig=sw0657840DoImportConfig, sw0657840PortConfSpdDpx=sw0657840PortConfSpdDpx, sw0657840Alarm=sw0657840Alarm, switch=switch, sw0657840EEPROMTest=sw0657840EEPROMTest, sw0657840LoopDetectedConf=sw0657840LoopDetectedConf, sw0657840LacpStateDisabled=sw0657840LacpStateDisabled, sw0657840BandwidthConfIngressBW=sw0657840BandwidthConfIngressBW, sw0657840TrapHostIndex=sw0657840TrapHostIndex, actorkey=actorkey, sw0657840ExternalLoopbackTest=sw0657840ExternalLoopbackTest, sw0657840MirroringPort=sw0657840MirroringPort, sw0657840RestoreDefault=sw0657840RestoreDefault, sw0657840SFPVendorOUI=sw0657840SFPVendorOUI, sw0657840AccountIndex=sw0657840AccountIndex, sw0657840MirroredPorts=sw0657840MirroredPorts, sw0657840AutoUploadLogState=sw0657840AutoUploadLogState, sw0657840DoAccountAdd=sw0657840DoAccountAdd, sw0657840BandwidthPortNumber=sw0657840BandwidthPortNumber, sw0657840RamSize=sw0657840RamSize, sw0657840EventIndex=sw0657840EventIndex, sw0657840Produces=sw0657840Produces, sw0657840FlashSize=sw0657840FlashSize, sw0657840EmailPassword=sw0657840EmailPassword, sw0657840SMSUsername=sw0657840SMSUsername, sw0657840Mirror=sw0657840Mirror, sw0657840Configuration=sw0657840Configuration, sw0657840BandwidthConfStormState=sw0657840BandwidthConfStormState, sw0657840NTPTimeSync=sw0657840NTPTimeSync, sw0657840LoopDetectedfIndex=sw0657840LoopDetectedfIndex, sw0657840TrapEntry=sw0657840TrapEntry, sw0657840SMSServer=sw0657840SMSServer, sw0657840MirrorMode=sw0657840MirrorMode, sw0657840SFPTemperature=sw0657840SFPTemperature, sw0657840UartTest=sw0657840UartTest, sw0657840GvrpStateEnabled=sw0657840GvrpStateEnabled, sw0657840TrapVariable=sw0657840TrapVariable, sw0657840SaveRestore=sw0657840SaveRestore, sw0657840PortConfNumber=sw0657840PortConfNumber, sw0657840PortStatusIndex=sw0657840PortStatusIndex, sw0657840AccountPassword=sw0657840AccountPassword, sw0657840PortStatusMedia=sw0657840PortStatusMedia, sw0657840SMSUserEntry=sw0657840SMSUserEntry, sw0657840DoExportConfig=sw0657840DoExportConfig, sw0657840Bandwidth=sw0657840Bandwidth, sw0657840TrapHostTable=sw0657840TrapHostTable, sw0657840SystemCurrentTime=sw0657840SystemCurrentTime, sw0657840EventEntry=sw0657840EventEntry, sw0657840EventSendTrap=sw0657840EventSendTrap, sw0657840LoopDetectedEntry=sw0657840LoopDetectedEntry, sw0657840SFPRxPWR=sw0657840SFPRxPWR, sw0657840MaxPktLenConfTable=sw0657840MaxPktLenConfTable, sw0657840LoopDetectedAction=sw0657840LoopDetectedAction, sw0657840ProductID=sw0657840ProductID, sw0657840VlanPortBaseEnabled=sw0657840VlanPortBaseEnabled, sw0657840LogIndex=sw0657840LogIndex, sw0657840UserLogin=sw0657840UserLogin, sw0657840SFPBaudRate=sw0657840SFPBaudRate, sw0657840Account=sw0657840Account, sw0657840TrapHostCommunity=sw0657840TrapHostCommunity, sw0657840LacpPortTrunkFailure=sw0657840LacpPortTrunkFailure, sw0657840EventTable=sw0657840EventTable, sw0657840LoopDetectedCurrentStatus=sw0657840LoopDetectedCurrentStatus, sw0657840FirmwareVersion=sw0657840FirmwareVersion, sw0657840ImportConfigName=sw0657840ImportConfigName, sw0657840PortStatusAutoNego=sw0657840PortStatusAutoNego, sw0657840MaxPktLen=sw0657840MaxPktLen, sw0657840DhcpSetting=sw0657840DhcpSetting, sw0657840Reboot=sw0657840Reboot, sw0657840SaveUser=sw0657840SaveUser, sw0657840PortStatusPortState=sw0657840PortStatusPortState, sw0657840BandwidthConfIngressState=sw0657840BandwidthConfIngressState, sw0657840SetCommunity=sw0657840SetCommunity, sw0657840VlanDoubleTagEnabled=sw0657840VlanDoubleTagEnabled, sw0657840Log=sw0657840Log, sw0657840DoFirmwareUpgrade=sw0657840DoFirmwareUpgrade, sw0657840HostMacAddress=sw0657840HostMacAddress, sw0657840FirmwareFileName=sw0657840FirmwareFileName, sw0657840LoopDetectedTable=sw0657840LoopDetectedTable, sw0657840ManualTimeSetting=sw0657840ManualTimeSetting, sw0657840LogEvent=sw0657840LogEvent, sw0657840ClearLog=sw0657840ClearLog, sw0657840EventName=sw0657840EventName, sw0657840PortStatuDescription=sw0657840PortStatuDescription, sw0657840NTPTimeZone=sw0657840NTPTimeZone, sw0657840LacpStateEnabled=sw0657840LacpStateEnabled, sw0657840SMSUserMobilePhone=sw0657840SMSUserMobilePhone, sw0657840StpStateEnabled=sw0657840StpStateEnabled, sw0657840VlanTagBaseEnabled=sw0657840VlanTagBaseEnabled, sw0657840DnsServer=sw0657840DnsServer, sw0657840LogTable=sw0657840LogTable, sw0657840MaxPktLen1=sw0657840MaxPktLen1, sw0657840EmailUserIndex=sw0657840EmailUserIndex, sw0657840ConfigFile=sw0657840ConfigFile, sw0657840LoopDetected=sw0657840LoopDetected, sw0657840EmailUserTable=sw0657840EmailUserTable, sw0657840DaylightEndTime=sw0657840DaylightEndTime, sw0657840SaveStart=sw0657840SaveStart, sw0657840SMS=sw0657840SMS, sw0657840DnsSetting=sw0657840DnsSetting, sw0657840Snmp=sw0657840Snmp, sw0657840IPAddress=sw0657840IPAddress, sw0657840DefaultGateway=sw0657840DefaultGateway, sw0657840AccountDel=sw0657840AccountDel, sw0657840EmailUserNumber=sw0657840EmailUserNumber, sw0657840AccountAddPassword=sw0657840AccountAddPassword, sw0657840SFPVendorSN=sw0657840SFPVendorSN, sw0657840EmailUserAddress=sw0657840EmailUserAddress, sw0657840NTPServer=sw0657840NTPServer, sw0657840EventNumber=sw0657840EventNumber, sw0657840BandwidthConfEntry=sw0657840BandwidthConfEntry, sw0657840LoopDetectedStateEbl=sw0657840LoopDetectedStateEbl, sw0657840GvrpStateDisabled=sw0657840GvrpStateDisabled, sw0657840AccountName=sw0657840AccountName, sw0657840EmailUsername=sw0657840EmailUsername, sw0657840DramTest=sw0657840DramTest, sw0657840FlashTest=sw0657840FlashTest, sw0657840Tftp=sw0657840Tftp, sw0657840RestoreUser=sw0657840RestoreUser, sw0657840EmailUserEntry=sw0657840EmailUserEntry, sw0657840VlanMetroModeEnabled=sw0657840VlanMetroModeEnabled, sw0657840SFPInfoIndex=sw0657840SFPInfoIndex, sw0657840PortStatusFlwCtrl=sw0657840PortStatusFlwCtrl, partnerkey=partnerkey, sw0657840DualMediaSwapped=sw0657840DualMediaSwapped, sw0657840SFPInfoNumber=sw0657840SFPInfoNumber, sw0657840Email=sw0657840Email, sw0657840MaxPktLenPortNumber=sw0657840MaxPktLenPortNumber, sw0657840LoopDetectedNumber=sw0657840LoopDetectedNumber, groupId=groupId, sw0657840SFPInfo=sw0657840SFPInfo, sw0657840PortStatus=sw0657840PortStatus, sw0657840TrapHostIP=sw0657840TrapHostIP, sw0657840TftpServer=sw0657840TftpServer, sw0657840Event=sw0657840Event, sw0657840BandwidthConfEgressBW=sw0657840BandwidthConfEgressBW, sw0657840SFPFiberType=sw0657840SFPFiberType, sw0657840BiosVsersion=sw0657840BiosVsersion, sw0657840Bandwidth1=sw0657840Bandwidth1, sw0657840ExportConfigName=sw0657840ExportConfigName, sw0657840SFPInfoEntry=sw0657840SFPInfoEntry, sw0657840SFPInfoTable=sw0657840SFPInfoTable, sw0657840AccountAddName=sw0657840AccountAddName, sw0657840TrapHostPort=sw0657840TrapHostPort, sw0657840TrapHostEntry=sw0657840TrapHostEntry, sw0657840CommonSys=sw0657840CommonSys, privatetech=privatetech, sw0657840VlanStateDisabled=sw0657840VlanStateDisabled, sw0657840DaylightSavingTime=sw0657840DaylightSavingTime, sw0657840AccountTable=sw0657840AccountTable, sw0657840BandwidthConfTable=sw0657840BandwidthConfTable, sw0657840LoopDetectedResumed=sw0657840LoopDetectedResumed, sw0657840SMSUserIndex=sw0657840SMSUserIndex, sw0657840StpStateDisabled=sw0657840StpStateDisabled, sw0657840PortStatusEntry=sw0657840PortStatusEntry, sw0657840SMSUserNumber=sw0657840SMSUserNumber, sw0657840BandwidthConfEgressState=sw0657840BandwidthConfEgressState, sw0657840LogEntry=sw0657840LogEntry, sw0657840MechanicalVersion=sw0657840MechanicalVersion, sw0657840NetMask=sw0657840NetMask, sw0657840GetCommunity=sw0657840GetCommunity, sw0657840SFPConnectorType=sw0657840SFPConnectorType, sw0657840TrapHostNumber=sw0657840TrapHostNumber, sw0657840SFPVcc=sw0657840SFPVcc, sw0657840LogNumber=sw0657840LogNumber, sw0657840LacpPortAdded=sw0657840LacpPortAdded, sw0657840SFPVendorPN=sw0657840SFPVendorPN, sw0657840UserLogout=sw0657840UserLogout, sw0657840EmailServer=sw0657840EmailServer, sw0657840EventSendEmail=sw0657840EventSendEmail, sw0657840Port=sw0657840Port, sw0657840IP=sw0657840IP, sw0657840HardwareVersion=sw0657840HardwareVersion, sw0657840MaxPktLenConfEntry=sw0657840MaxPktLenConfEntry, sw0657840DaylightStartTime=sw0657840DaylightStartTime, sw0657840SFPVendorName=sw0657840SFPVendorName, sw0657840PortConfIndex=sw0657840PortConfIndex, sw0657840PortConfDescription=sw0657840PortConfDescription, sw0657840BandwidthConfIndex=sw0657840BandwidthConfIndex, sw0657840PortStatusNumber=sw0657840PortStatusNumber, sw0657840AccountEntry=sw0657840AccountEntry, sw0657840StpTopologyChanged=sw0657840StpTopologyChanged, sw0657840InternalLoopbackTest=sw0657840InternalLoopbackTest, sw0657840MaxPktLenConfSetting=sw0657840MaxPktLenConfSetting, sw0657840SFPTxBias=sw0657840SFPTxBias, sw0657840PortConfEntry=sw0657840PortConfEntry, sw0657840MaxPktLenConfIndex=sw0657840MaxPktLenConfIndex, uplink=uplink, sw0657840PortStatusSpdDpx=sw0657840PortStatusSpdDpx, sw0657840PortConfPortState=sw0657840PortConfPortState, sw0657840System=sw0657840System, sw0657840Firmware=sw0657840Firmware, PYSNMP_MODULE_ID=privatetech, sw0657840SMSPassword=sw0657840SMSPassword, sw0657840SFPDateCode=sw0657840SFPDateCode, sw0657840AccountAuthorization=sw0657840AccountAuthorization)
| 129.882494 | 10,027 | 0.773342 | 5,954 | 54,161 | 7.034431 | 0.060296 | 0.012559 | 0.015615 | 0.020629 | 0.450971 | 0.435356 | 0.410525 | 0.372944 | 0.331471 | 0.308311 | 0 | 0.202642 | 0.08303 | 54,161 | 416 | 10,028 | 130.194712 | 0.640685 | 0.006204 | 0 | 0 | 0 | 0 | 0.07219 | 0.013769 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.022005 | 0.02934 | 0 | 0.02934 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
2df6c6319b7d1906f84dc0b600c9446955b1aa9f | 320 | py | Python | adabru_talon/code/deep_sleep.py | adabru/speech | 74a4398693186f5b90ac5b3252aa7bd2764fa695 | [
"WTFPL"
] | null | null | null | adabru_talon/code/deep_sleep.py | adabru/speech | 74a4398693186f5b90ac5b3252aa7bd2764fa695 | [
"WTFPL"
] | null | null | null | adabru_talon/code/deep_sleep.py | adabru/speech | 74a4398693186f5b90ac5b3252aa7bd2764fa695 | [
"WTFPL"
] | null | null | null | from talon import (
Module,
Context,
)
mod = Module()
mod.tag("deep_sleep", desc="Enable deep sleep")
ctx = Context()
@mod.action_class
class Actions:
def enable_deep_sleep():
"""???"""
ctx.tags = ["user.deep_sleep"]
def disable_deep_sleep():
"""???"""
ctx.tags = []
| 15.238095 | 47 | 0.55625 | 37 | 320 | 4.621622 | 0.513514 | 0.263158 | 0.210526 | 0.210526 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.265625 | 320 | 20 | 48 | 16 | 0.72766 | 0.021875 | 0 | 0 | 0 | 0 | 0.139073 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.153846 | false | 0 | 0.076923 | 0 | 0.307692 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
93067822138f982e5bd62fcfd10cc9b4ae612b62 | 3,757 | py | Python | .setup/bin/input_forum_data.py | zeez2030/Submitty | 7118944ff4adc6f15d76984eb10a1e862926d724 | [
"BSD-3-Clause"
] | 411 | 2016-06-14T20:52:25.000Z | 2022-03-31T21:20:25.000Z | .setup/bin/input_forum_data.py | KaelanWillauer/Submitty | cf9b6ceda15ec0a661e2ca81ea7864790094c64a | [
"BSD-3-Clause"
] | 5,730 | 2016-05-23T21:04:32.000Z | 2022-03-31T10:08:06.000Z | .setup/bin/input_forum_data.py | KaelanWillauer/Submitty | cf9b6ceda15ec0a661e2ca81ea7864790094c64a | [
"BSD-3-Clause"
] | 423 | 2016-09-22T21:11:30.000Z | 2022-03-29T18:55:28.000Z | #!/usr/bin/env python3
import os
import sys
import json
from datetime import datetime
from submitty_utils import dateutils
def generatePossibleDatabases():
current = dateutils.get_current_semester()
pre = 'submitty_' + current + '_'
path = "/var/local/submitty/courses/" + current
return [pre + name for name in sorted(os.listdir(path)) if os.path.isdir(path + "/" + name)]
if(__name__ == "__main__"):
num_args = len(sys.argv)
possible_databases = generatePossibleDatabases()
database = possible_databases[0]
if(num_args > 2):
print('Too many arguments. Use --help for help.')
sys.exit()
elif(num_args == 2):
if(sys.argv[1] == '--help' or sys.argv[1] == '-h'):
print('This tool can be used to test forum scalability -- pg_dump after execution to save the test data which can be sourced later.')
print('This tool takes in an optional argument: database, so an example usage is: `python3 input_forum_data.py submitty_f18_blank`')
print('Note this will delete forum data in the database you specify. The database will default to `submitty_f18_blank` if not specified.')
sys.exit()
elif(sys.argv[1] not in possible_databases):
print('Unknown argument: {:s}, use --help or -h for help.'.format(sys.argv[1]))
sys.exit()
database = sys.argv[1]
threads = abs(int(input("Enter number of threads (i.e. 1000): ").strip()))
posts = abs(int(input("Enter number of posts per thread (i.e. 20): ").strip()))
usr_path = "/usr/local/submitty"
settings = json.load(open(os.path.join(usr_path, ".setup", "submitty_conf.json")))
print("WARNING: This tool is going to delete data from the following tables:\n\tthreads\n\tposts\n\tforum_posts_history\n\tstudent_favorites\n\tviewed_responses\n\tthread_categories\n\tcategories_list")
answer = input("Do you agree for this data to be removed from {:s}? [yes/no]: ".format(database)).strip()
if(answer.lower() != "yes"):
print("Exiting...")
sys.exit()
variables = (settings['database_password'], settings['database_host'], settings['database_user'], database)
os.system("""PGPASSWORD='{}' psql --host={} --username={} --dbname={} -c \"TRUNCATE TABLE threads RESTART IDENTITY CASCADE\" > /dev/null""".format(*variables))
os.system("""PGPASSWORD='{}' psql --host={} --username={} --dbname={} -c \"DELETE FROM thread_categories\" > /dev/null""".format(*variables))
os.system("""PGPASSWORD='{}' psql --host={} --username={} --dbname={} -c \"TRUNCATE TABLE categories_list RESTART IDENTITY CASCADE\" > /dev/null""".format(*variables))
os.system("""PGPASSWORD='{}' psql --host={} --username={} --dbname={} -c \"INSERT INTO categories_list (category_desc) VALUES ('TESTDATA')\" > /dev/null""".format(*variables))
print()
for i in range(threads):
if((i+1) % 10 == 0):
print("Completed: {:d}/{:d}".format(i+1, threads))
os.system("""PGPASSWORD='{}' psql --host={} --username={} --dbname={} -c \"INSERT INTO threads (title, created_by, pinned, deleted, merged_thread_id, merged_post_id, is_visible) VALUES (\'{:s}\', \'{:s}\', false, false, -1, -1, true)\" > /dev/null""".format(*variables, "Thread{:d}".format(i+1), "aphacker"))
os.system("""PGPASSWORD='{}' psql --host={} --username={} --dbname={} -c \"INSERT INTO thread_categories (thread_id, category_id) VALUES ({:d}, 1)\" > /dev/null""".format(*variables, i+1))
for pid in range(posts):
os.system("""PGPASSWORD='{}' psql --host={} --username={} --dbname={} -c \"INSERT INTO posts (thread_id, parent_id, author_user_id, content, timestamp, anonymous, deleted, type, has_attachment) VALUES ({}, {}, {}, {}, \'{}\', false, false, 0, false)\" > /dev/null""".format(*variables, i+1, -1 if pid == 0 else i*posts + pid, "'aphacker'", "'Post{:d}'".format(i*posts + pid+1), datetime.now()))
| 51.465753 | 398 | 0.672345 | 525 | 3,757 | 4.704762 | 0.36 | 0.022672 | 0.051012 | 0.062348 | 0.226316 | 0.226316 | 0.187449 | 0.187449 | 0.187449 | 0.187449 | 0 | 0.0107 | 0.129359 | 3,757 | 72 | 399 | 52.180556 | 0.744421 | 0.00559 | 0 | 0.081633 | 1 | 0.22449 | 0.574069 | 0.042593 | 0 | 0 | 0 | 0 | 0 | 1 | 0.020408 | false | 0.163265 | 0.102041 | 0 | 0.142857 | 0.183673 | 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 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
930a3159a270d17b3e016e6419675cf9059057cd | 506 | py | Python | examples/providers/factory_aggregate/prototype.py | kinow/python-dependency-injector | ebd98bebe9a8fc0b57e68cfc12c4979833baa6a5 | [
"BSD-3-Clause"
] | null | null | null | examples/providers/factory_aggregate/prototype.py | kinow/python-dependency-injector | ebd98bebe9a8fc0b57e68cfc12c4979833baa6a5 | [
"BSD-3-Clause"
] | null | null | null | examples/providers/factory_aggregate/prototype.py | kinow/python-dependency-injector | ebd98bebe9a8fc0b57e68cfc12c4979833baa6a5 | [
"BSD-3-Clause"
] | null | null | null | """FactoryAggregate provider prototype."""
class FactoryAggregate:
"""FactoryAggregate provider prototype."""
def __init__(self, **factories):
"""Initialize instance."""
self.factories = factories
def __call__(self, factory_name, *args, **kwargs):
"""Create object."""
return self.factories[factory_name](*args, **kwargs)
def __getattr__(self, factory_name):
"""Return factory with specified name."""
return self.factories[factory_name]
| 28.111111 | 60 | 0.656126 | 48 | 506 | 6.583333 | 0.4375 | 0.164557 | 0.208861 | 0.132911 | 0.189873 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.20751 | 506 | 17 | 61 | 29.764706 | 0.78803 | 0.286561 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.428571 | false | 0 | 0 | 0 | 0.857143 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
93131be5c2c31240f968a45b8920858ae167fb1c | 381 | py | Python | address/admin.py | City-of-Helsinki/geo-search | d200e06223938e456d13ae9ab94e9dad149216d0 | [
"MIT"
] | null | null | null | address/admin.py | City-of-Helsinki/geo-search | d200e06223938e456d13ae9ab94e9dad149216d0 | [
"MIT"
] | 11 | 2021-09-13T11:46:17.000Z | 2022-03-11T08:40:02.000Z | address/admin.py | City-of-Helsinki/geo-search | d200e06223938e456d13ae9ab94e9dad149216d0 | [
"MIT"
] | 1 | 2021-10-04T09:15:44.000Z | 2021-10-04T09:15:44.000Z | from django.contrib import admin
from parler.admin import TranslatableAdmin
from .models import Address, Municipality, Street
@admin.register(Municipality)
class MunicipalityAdmin(TranslatableAdmin):
pass
@admin.register(Street)
class StreetAdmin(TranslatableAdmin):
pass
@admin.register(Address)
class AddressAdmin(admin.ModelAdmin):
raw_id_fields = ["street"]
| 19.05 | 49 | 0.792651 | 41 | 381 | 7.317073 | 0.512195 | 0.13 | 0.173333 | 0.226667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.12336 | 381 | 19 | 50 | 20.052632 | 0.898204 | 0 | 0 | 0.166667 | 0 | 0 | 0.015748 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.166667 | 0.25 | 0 | 0.583333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
9358a1bd65251378efa84d7f25d1fc162739f57e | 102 | py | Python | 3429.py | ssd352/quera-solutions | 7c7b572a26c3c1648f23528bcc661dec18b44943 | [
"MIT"
] | 1 | 2020-03-16T21:13:14.000Z | 2020-03-16T21:13:14.000Z | 3429.py | ssd352/quera-solutions | 7c7b572a26c3c1648f23528bcc661dec18b44943 | [
"MIT"
] | null | null | null | 3429.py | ssd352/quera-solutions | 7c7b572a26c3c1648f23528bcc661dec18b44943 | [
"MIT"
] | 2 | 2020-03-27T18:40:40.000Z | 2020-07-30T14:59:55.000Z | T = int(input())
if T > 100:
print('Steam')
elif T < 0:
print('Ice')
else:
print('Water')
| 12.75 | 18 | 0.519608 | 16 | 102 | 3.3125 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.053333 | 0.264706 | 102 | 7 | 19 | 14.571429 | 0.653333 | 0 | 0 | 0 | 0 | 0 | 0.127451 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.428571 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
9358d7fabdaa2250dc44f570309b7f9d32d9b186 | 159 | py | Python | settings_template.py | WHOIGit/wip-comms-ifcb-imagedb | fa0fd9743e74d483e89cbd249519c8f70a1859d9 | [
"MIT"
] | null | null | null | settings_template.py | WHOIGit/wip-comms-ifcb-imagedb | fa0fd9743e74d483e89cbd249519c8f70a1859d9 | [
"MIT"
] | 1 | 2018-11-01T20:16:28.000Z | 2018-11-01T20:21:29.000Z | settings_template.py | WHOIGit/wip-comms-ifcb-imagedb | fa0fd9743e74d483e89cbd249519c8f70a1859d9 | [
"MIT"
] | null | null | null | PSQL_CONNECTION_PARAMS = {
'dbname': 'ifcb',
'user': '******',
'password': '******',
'host': '/var/run/postgresql/'
}
DATA_DIR = '/mnt/ifcb'
| 17.666667 | 34 | 0.496855 | 15 | 159 | 5.066667 | 0.933333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.207547 | 159 | 8 | 35 | 19.875 | 0.603175 | 0 | 0 | 0 | 0 | 0 | 0.421384 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.142857 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
935e4e7c33e3cd032008f714cbcd252ea376fad9 | 99 | py | Python | game/entities/ship.py | alucardzom/pyxeltron | 314e5e4801c412c9a68cc49fa3c8977bf8f6366d | [
"MIT"
] | 1 | 2021-11-11T03:04:07.000Z | 2021-11-11T03:04:07.000Z | game/entities/ship.py | truizsanchez/pyxeltron | a219b7ef250517fee15ab39ac63b82f2752e875e | [
"MIT"
] | null | null | null | game/entities/ship.py | truizsanchez/pyxeltron | a219b7ef250517fee15ab39ac63b82f2752e875e | [
"MIT"
] | 1 | 2021-08-15T17:47:54.000Z | 2021-08-15T17:47:54.000Z | from engine.entities.base import BaseEntity
class Ship(BaseEntity):
WIDTH = 8
HEIGHT = 8
| 14.142857 | 43 | 0.707071 | 13 | 99 | 5.384615 | 0.846154 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025974 | 0.222222 | 99 | 6 | 44 | 16.5 | 0.883117 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
936c5a70ec50a4830edce31139219ee55e7967af | 198 | py | Python | musicdb/__init__.py | ieuan-jones/musicdb | e894614cb70881eca810d97f7362a68398c3c3b0 | [
"BSD-3-Clause"
] | null | null | null | musicdb/__init__.py | ieuan-jones/musicdb | e894614cb70881eca810d97f7362a68398c3c3b0 | [
"BSD-3-Clause"
] | null | null | null | musicdb/__init__.py | ieuan-jones/musicdb | e894614cb70881eca810d97f7362a68398c3c3b0 | [
"BSD-3-Clause"
] | null | null | null | import os
from flask import Flask
def create_app():
app = Flask(__name__, instance_relative_config=True)
from . import catalogue
app.register_blueprint(catalogue.bp)
return app
| 16.5 | 56 | 0.732323 | 26 | 198 | 5.269231 | 0.653846 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.20202 | 198 | 11 | 57 | 18 | 0.867089 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.428571 | 0 | 0.714286 | 0.142857 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
93753504d8f288b3efbdb0fba48e17b67530926a | 1,071 | py | Python | examples/experimental/gmsh_api_test.py | Karl-Eriksson/calfem-python | e9a88a85d3a73877ec99f7fbd1a296a44c3c9b22 | [
"MIT"
] | 54 | 2016-04-11T19:12:13.000Z | 2022-02-22T07:15:39.000Z | examples/experimental/gmsh_api_test.py | Karl-Eriksson/calfem-python | e9a88a85d3a73877ec99f7fbd1a296a44c3c9b22 | [
"MIT"
] | 13 | 2019-07-01T19:48:38.000Z | 2022-02-11T12:50:02.000Z | examples/experimental/gmsh_api_test.py | Karl-Eriksson/calfem-python | e9a88a85d3a73877ec99f7fbd1a296a44c3c9b22 | [
"MIT"
] | 273 | 2017-08-01T10:29:09.000Z | 2022-02-16T14:02:36.000Z | import gmsh
import sys
import numpy as np
import calfem.mesh as cfm
import calfem.vis_mpl as cfv
if __name__ == "__main__":
gmsh.initialize(sys.argv)
gmsh.model.add("t1")
gmsh.model.geo.add_point(0.0, 0.0, 0.0)
gmsh.model.geo.add_point(1.0, 0.0, 0.0)
gmsh.model.geo.add_point(1.0, 1.0, 0.0)
gmsh.model.geo.add_point(0.0, 1.0, 0.0)
gmsh.model.geo.add_line(1, 2)
gmsh.model.geo.add_line(2, 3)
gmsh.model.geo.add_line(3, 4)
gmsh.model.geo.add_line(4, 1)
gmsh.model.geo.add_curve_loop([1, 2, 3, 4], 1)
gmsh.model.geo.add_plane_surface([1], 1)
#gmsh.model.geo.add_surface_loop([1, 2, 3, 4])
gmsh.model.geo.synchronize()
#gmsh.option.setNumber("Mesh.ElementOrder", 5)
# gmsh.option.setNumber("Mesh.HighOrderOptimize", 2)
gmsh.option.setNumber("Mesh.RecombineAll", 1)
#gmsh.option.setNumber('Mesh.MeshSizeMin', 0.025)
#gmsh.option.setNumber('Mesh.MeshSizeMax', 0.025)
gmsh.model.mesh.generate(2)
print_entities()
#gmsh.write("t1.msh")
gmsh.fltk.run()
gmsh.finalize()
| 23.282609 | 56 | 0.660131 | 183 | 1,071 | 3.73224 | 0.273224 | 0.18448 | 0.210835 | 0.241581 | 0.379209 | 0.224012 | 0.174231 | 0.142021 | 0.1347 | 0.077599 | 0 | 0.064045 | 0.169001 | 1,071 | 45 | 57 | 23.8 | 0.703371 | 0.239963 | 0 | 0 | 0 | 0 | 0.033457 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.208333 | 0 | 0.208333 | 0.041667 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
937c9982a5f43646604b5753ad9ccca9aeb1f6d9 | 1,191 | py | Python | semana_02/desafios/python-6/main.py | alexaldr/AceleraDev-Python | f655b31f5d672f617c43282dc91a19f761845f84 | [
"MIT"
] | null | null | null | semana_02/desafios/python-6/main.py | alexaldr/AceleraDev-Python | f655b31f5d672f617c43282dc91a19f761845f84 | [
"MIT"
] | 23 | 2021-03-19T04:59:51.000Z | 2022-02-10T15:15:12.000Z | semana_02/desafios/python-6/main.py | alexaldr/AceleraDev-Python | f655b31f5d672f617c43282dc91a19f761845f84 | [
"MIT"
] | null | null | null | from abc import ABCMeta, abstractmethod
class Department:
def __init__(self, name, code):
self.name = name
self.code = code
class Employee(metaclass=ABCMeta):
def __init__(self, code, name, salary, department):
self.code = code
self.name = name
self.salary = salary
self._department = department # _ = protected, __ = private
@abstractmethod
def calc_bonus(self):
pass
def get_hours(self):
return 8
def get_departament(self):
return self._department.name
def set_departament(self, name):
self._department.name = name
class Manager(Employee):
def __init__(self, code, name, salary):
super().__init__(code, name, salary, Department('managers', 1))
def calc_bonus(self):
return self.salary * 0.15
class Seller(Employee):
def __init__(self, code, name, salary):
super().__init__(code, name, salary, Department('sellers', 2))
self._sales = 0
def calc_bonus(self):
return self._sales * 0.15
def get_sales(self):
return self._sales
def put_sales(self, value):
self._sales += value
| 22.903846 | 71 | 0.622166 | 142 | 1,191 | 4.922535 | 0.267606 | 0.057225 | 0.100143 | 0.064378 | 0.356223 | 0.298999 | 0.188841 | 0.188841 | 0.188841 | 0.188841 | 0 | 0.011587 | 0.275399 | 1,191 | 51 | 72 | 23.352941 | 0.798378 | 0.02267 | 0 | 0.257143 | 0 | 0 | 0.012909 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.342857 | false | 0.028571 | 0.028571 | 0.142857 | 0.628571 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
fa7f8a320c3494838594cfc8dddc16eae8654412 | 1,114 | py | Python | api/pub/sensor/sensor.py | rtaft/pi-sensor-dashboard | e7f711e8ecd9e4c32976583c32dbc716b165d56a | [
"MIT"
] | null | null | null | api/pub/sensor/sensor.py | rtaft/pi-sensor-dashboard | e7f711e8ecd9e4c32976583c32dbc716b165d56a | [
"MIT"
] | null | null | null | api/pub/sensor/sensor.py | rtaft/pi-sensor-dashboard | e7f711e8ecd9e4c32976583c32dbc716b165d56a | [
"MIT"
] | null | null | null | import flask
from flask import request
import flask_restful as restful
from marshmallow import Schema, fields, validate
from api.helpers import success, created
from api.exceptions import NotFound
#from api.restful import API
#@API.route('/sensors', methods=['GET'], resource_class_kwargs={'test': 'foo'})
class SensorsConfig (restful.Resource):
def __init__(self, *args, **kwargs):
self.sensor_service = kwargs['sensor_service']
# def get(self):
# return success(self.sensor_service.get_sensor_ids())
def get(self):
return success(self.sensor_service.get_config())
def post(self):
data = request.get_json(force=True)
# TODO validator?
sensor_id = self.sensor_service.set_config(None, data)
return success(sensor_id)
def put(self, sensor_id):
data = request.get_json(force=True)
# TODO validator?
sensor_id = self.sensor_service.set_config(sensor_id, data)
return success(sensor_id)
def delete(self, sensor_id):
self.sensor_service.remove_sensor(sensor_id)
return success() | 30.944444 | 79 | 0.692101 | 144 | 1,114 | 5.145833 | 0.333333 | 0.107962 | 0.137652 | 0.072874 | 0.425101 | 0.391363 | 0.315789 | 0.315789 | 0.315789 | 0.19973 | 0 | 0 | 0.204668 | 1,114 | 36 | 80 | 30.944444 | 0.836343 | 0.18851 | 0 | 0.181818 | 0 | 0 | 0.015573 | 0 | 0 | 0 | 0 | 0.027778 | 0 | 1 | 0.227273 | false | 0 | 0.272727 | 0.045455 | 0.727273 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
fa827fe0d4e36def59dcda41a7b889abf5ecab35 | 392 | py | Python | pdm/pep517/_vendor/toml/ordered.py | linw1995/pdm-pep517 | 6b8030225ec374acf04ee70c685e55a495f24482 | [
"MIT"
] | 4 | 2021-04-14T16:18:08.000Z | 2022-01-13T13:03:47.000Z | pdm/pep517/_vendor/toml/ordered.py | linw1995/pdm-pep517 | 6b8030225ec374acf04ee70c685e55a495f24482 | [
"MIT"
] | 29 | 2021-03-23T15:40:56.000Z | 2022-03-10T11:55:38.000Z | pdm/pep517/_vendor/toml/ordered.py | frostming/pdm-pep517 | 99b6aab5f3cb2dac657f3a750d8eb4ad001dd095 | [
"MIT"
] | 6 | 2021-03-21T17:42:25.000Z | 2022-01-25T21:28:35.000Z | from collections import OrderedDict
from pdm.pep517._vendor.toml import TomlEncoder
from pdm.pep517._vendor.toml import TomlDecoder
class TomlOrderedDecoder(TomlDecoder):
def __init__(self):
super(self.__class__, self).__init__(_dict=OrderedDict)
class TomlOrderedEncoder(TomlEncoder):
def __init__(self):
super(self.__class__, self).__init__(_dict=OrderedDict)
| 24.5 | 63 | 0.77551 | 44 | 392 | 6.272727 | 0.409091 | 0.050725 | 0.094203 | 0.137681 | 0.557971 | 0.557971 | 0.347826 | 0.347826 | 0.347826 | 0.347826 | 0 | 0.017751 | 0.137755 | 392 | 15 | 64 | 26.133333 | 0.798817 | 0 | 0 | 0.444444 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.333333 | 0 | 0.777778 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
fa86af3e536c67102ea203913013e7cc1a7477ca | 96 | py | Python | ingredient_parser/__init__.py | johnwmillr/RecipesAPI | 3c7422b838fef4f25c59b5c410e2a82e64ba2dc4 | [
"MIT"
] | null | null | null | ingredient_parser/__init__.py | johnwmillr/RecipesAPI | 3c7422b838fef4f25c59b5c410e2a82e64ba2dc4 | [
"MIT"
] | null | null | null | ingredient_parser/__init__.py | johnwmillr/RecipesAPI | 3c7422b838fef4f25c59b5c410e2a82e64ba2dc4 | [
"MIT"
] | null | null | null | __author__ = 'sheraz'
__all__ = ['parse','normalize']
from ingredient_parser.en import parse
| 13.714286 | 38 | 0.739583 | 11 | 96 | 5.636364 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.135417 | 96 | 6 | 39 | 16 | 0.746988 | 0 | 0 | 0 | 0 | 0 | 0.212766 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
fa9db8ff1e82424dabac6f76a1d2b7bc1e4f6ce5 | 327 | py | Python | selection_sort.py | Wajktor13/Sorting_algorithms | e7de2dff189f899b467b1b24f7352bb236c5c651 | [
"MIT"
] | null | null | null | selection_sort.py | Wajktor13/Sorting_algorithms | e7de2dff189f899b467b1b24f7352bb236c5c651 | [
"MIT"
] | null | null | null | selection_sort.py | Wajktor13/Sorting_algorithms | e7de2dff189f899b467b1b24f7352bb236c5c651 | [
"MIT"
] | null | null | null | def selection_sort(input_list):
for i in range(len(input_list)):
min_index = i
for k in range(i, len(input_list)):
if input_list[k] < input_list[min_index]:
min_index = k
input_list[i], input_list[min_index] = input_list[min_index], input_list[i]
return input_list
| 29.727273 | 83 | 0.623853 | 51 | 327 | 3.686275 | 0.294118 | 0.478723 | 0.255319 | 0.361702 | 0.228723 | 0.228723 | 0 | 0 | 0 | 0 | 0 | 0 | 0.275229 | 327 | 10 | 84 | 32.7 | 0.793249 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0 | 0 | 0.25 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
fa9ea7ecedd54d91de0696590347b0edb53b720e | 163 | py | Python | prefs.py | synap5e/pandora-station-to-spotify | d0c0caace016a35b56c4eae6593a47dad2a53205 | [
"MIT"
] | 1 | 2019-03-24T07:01:55.000Z | 2019-03-24T07:01:55.000Z | prefs.py | synap5e/pandora-station-to-spotify | d0c0caace016a35b56c4eae6593a47dad2a53205 | [
"MIT"
] | null | null | null | prefs.py | synap5e/pandora-station-to-spotify | d0c0caace016a35b56c4eae6593a47dad2a53205 | [
"MIT"
] | null | null | null | username = 'user@example.com'
password = 'hunter2'
# larger = less change of delays if you skip a lot
# smaller = more responsive to ups/downs
queue_size = 2 | 27.166667 | 51 | 0.711656 | 25 | 163 | 4.6 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015385 | 0.202454 | 163 | 6 | 52 | 27.166667 | 0.869231 | 0.533742 | 0 | 0 | 0 | 0 | 0.333333 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.333333 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
faae62e74233d85e1942ad4875600b68b5c29875 | 99 | py | Python | trade_remedies_api/config/settings/bdd.py | uktrade/trade-remedies-api | fbe2d142ef099c7244788a0f72dd1003eaa7edce | [
"MIT"
] | 1 | 2020-08-13T10:37:15.000Z | 2020-08-13T10:37:15.000Z | trade_remedies_api/config/settings/bdd.py | uktrade/trade-remedies-api | fbe2d142ef099c7244788a0f72dd1003eaa7edce | [
"MIT"
] | 4 | 2020-09-10T13:41:52.000Z | 2020-12-16T09:00:21.000Z | trade_remedies_api/config/settings/bdd.py | uktrade/trade-remedies-api | fbe2d142ef099c7244788a0f72dd1003eaa7edce | [
"MIT"
] | null | null | null | from .base import * # noqa
INSTALLED_APPS += [
"api_test",
]
ROOT_URLCONF = "api_test.urls"
| 12.375 | 30 | 0.646465 | 13 | 99 | 4.615385 | 0.846154 | 0.233333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.212121 | 99 | 7 | 31 | 14.142857 | 0.769231 | 0.040404 | 0 | 0 | 0 | 0 | 0.225806 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 0.2 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
fab2d81b0d580f8beb6589e4107725b0beb05fc3 | 721 | py | Python | zang/domain/fraud_control_rule_element.py | vlastikczech/zang-python | 980f5243071404d6838554500a6955ff7bc2a0c7 | [
"MIT"
] | 1 | 2019-02-18T21:51:58.000Z | 2019-02-18T21:51:58.000Z | zang/domain/fraud_control_rule_element.py | vlastikczech/zang-python | 980f5243071404d6838554500a6955ff7bc2a0c7 | [
"MIT"
] | 6 | 2019-06-26T13:56:22.000Z | 2022-02-17T16:40:48.000Z | zang/domain/fraud_control_rule_element.py | vlastikczech/zang-python | 980f5243071404d6838554500a6955ff7bc2a0c7 | [
"MIT"
] | 6 | 2017-10-17T12:44:32.000Z | 2020-02-07T20:45:00.000Z | # -*- coding: utf-8 -*-
"""
zang.domain.fraud_control_rule_whitelisted
~~~~~~~~~~~~~~~~~~~
`FraudControlRuleElement` model
"""
from zang.domain.base_resource import BaseResource
from zang.domain.fraud_control_rule import FraudControlRule
class FraudControlRuleElement(BaseResource):
_map = {
'blocked': FraudControlRule,
'authorized': FraudControlRule,
'whitelisted': FraudControlRule,
}
def __init__(self):
super(FraudControlRuleElement, self).__init__()
@property
def blocked(self):
return self._blocked
@property
def authorized(self):
return self._authorized
@property
def whitelisted(self):
return self._whitelisted
| 20.6 | 59 | 0.674064 | 64 | 721 | 7.3125 | 0.421875 | 0.064103 | 0.089744 | 0.094017 | 0.111111 | 0 | 0 | 0 | 0 | 0 | 0 | 0.001754 | 0.209431 | 721 | 34 | 60 | 21.205882 | 0.819298 | 0.162275 | 0 | 0.157895 | 0 | 0 | 0.04698 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.210526 | false | 0 | 0.105263 | 0.157895 | 0.578947 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
fabc996394a50d0044d4c07929a9f64d42ea2f3d | 86 | py | Python | awards/signals.py | fgmacedo/django-awards | a5307a96f8d39abdd466eb854049dd0f7b13eaee | [
"MIT"
] | null | null | null | awards/signals.py | fgmacedo/django-awards | a5307a96f8d39abdd466eb854049dd0f7b13eaee | [
"MIT"
] | 305 | 2017-05-16T17:45:58.000Z | 2022-03-18T07:20:22.000Z | awards/signals.py | fgmacedo/django-awards | a5307a96f8d39abdd466eb854049dd0f7b13eaee | [
"MIT"
] | null | null | null | from django.dispatch import Signal
badge_awarded = Signal(providing_args=["badge"])
| 17.2 | 48 | 0.790698 | 11 | 86 | 6 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.104651 | 86 | 4 | 49 | 21.5 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0.05814 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
fad48c005d43403bbab5e6857a996949ef7c14d5 | 1,202 | py | Python | hostel_project/hostel_webapp/views.py | harsh-ux/hostel-app | 89c341d55116913de81a3c7bd8a08d77729c39cb | [
"MIT"
] | null | null | null | hostel_project/hostel_webapp/views.py | harsh-ux/hostel-app | 89c341d55116913de81a3c7bd8a08d77729c39cb | [
"MIT"
] | null | null | null | hostel_project/hostel_webapp/views.py | harsh-ux/hostel-app | 89c341d55116913de81a3c7bd8a08d77729c39cb | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.views import generic
from django.shortcuts import redirect
from django.utils import timezone
from .models import Complaint
from .forms import ComplaintForm
class ComplaintList(generic.ListView):
queryset = Complaint.objects.order_by('date')
template_name = 'complaintlist.html'
def as_view(request):
return render(request, 'complaintlist.html', {})
hostels = [
'B1',
'B2',
'B5'
]
# Create your views here.
def index(request):
return render(request, 'index.html', {})
def about(request):
return render(request, 'about.html', {})
def login(request):
return render(request, 'login.html', {})
def complaint(request):
if request.method == "POST":
form = ComplaintForm()
if form.is_valid():
complaint = form.save(commit=False)
complaint.author = request.user
complaint.date = timezone.now()
complaint.save()
return redirect('complaint_detail', pk=complaint.pk)
else:
form = ComplaintForm()
return render(request, 'complaint.html', {'form': form})
def g4(request):
return render(request, 'g4.html', {})
| 25.041667 | 64 | 0.655574 | 136 | 1,202 | 5.757353 | 0.411765 | 0.091954 | 0.145594 | 0.166028 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005336 | 0.220466 | 1,202 | 47 | 65 | 25.574468 | 0.83031 | 0.019135 | 0 | 0.055556 | 0 | 0 | 0.102891 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.166667 | 0.138889 | 0.611111 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
fae0583fbc853b8b77719ed67cdd0c3a13ee094a | 156 | py | Python | projects/course_intro/raw_input.py | ProgressBG-Python-Course/ProgressBG-VC-Python | 37f8be60fb73d558ebd9e3c2700c88dcb64e7f4f | [
"MIT"
] | null | null | null | projects/course_intro/raw_input.py | ProgressBG-Python-Course/ProgressBG-VC-Python | 37f8be60fb73d558ebd9e3c2700c88dcb64e7f4f | [
"MIT"
] | null | null | null | projects/course_intro/raw_input.py | ProgressBG-Python-Course/ProgressBG-VC-Python | 37f8be60fb73d558ebd9e3c2700c88dcb64e7f4f | [
"MIT"
] | null | null | null | machine_number = 43
user_number = int( raw_input("enter a number: ") )
print( type(user_number) )
if user_number == machine_number:
print("Bravo!!!")
| 15.6 | 50 | 0.692308 | 22 | 156 | 4.636364 | 0.590909 | 0.294118 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015267 | 0.160256 | 156 | 9 | 51 | 17.333333 | 0.763359 | 0 | 0 | 0 | 0 | 0 | 0.153846 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.4 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
fae78fe389b664367fb4e390660faee2c1fa36ea | 159 | py | Python | shows/Text.py | fenceFoil/canopto | 2692d19282c8c7090d7e4201716627789d38a821 | [
"BSD-3-Clause"
] | null | null | null | shows/Text.py | fenceFoil/canopto | 2692d19282c8c7090d7e4201716627789d38a821 | [
"BSD-3-Clause"
] | null | null | null | shows/Text.py | fenceFoil/canopto | 2692d19282c8c7090d7e4201716627789d38a821 | [
"BSD-3-Clause"
] | null | null | null | #!/bin/python3
import Canopto
import pygame
from pygame.locals import *
import time
import random
import colorsys
c = Canopto(2, 8, previewEnabled = True)
| 12.230769 | 40 | 0.761006 | 22 | 159 | 5.5 | 0.681818 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.022556 | 0.163522 | 159 | 12 | 41 | 13.25 | 0.887218 | 0.081761 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.857143 | 0 | 0.857143 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
fafa474f05d327bb0527aea85277fe69e94fc722 | 105 | py | Python | axiom/__init__.py | schehata/axiom-py | a2e34ec54606359a1c06b5ec12b0a4898ade66ee | [
"MIT"
] | 4 | 2021-03-27T12:24:04.000Z | 2021-10-21T07:04:21.000Z | axiom/__init__.py | schehata/axiom-py | a2e34ec54606359a1c06b5ec12b0a4898ade66ee | [
"MIT"
] | 3 | 2021-04-01T21:19:34.000Z | 2022-01-10T13:58:01.000Z | axiom/__init__.py | schehata/axiom-py | a2e34ec54606359a1c06b5ec12b0a4898ade66ee | [
"MIT"
] | 4 | 2021-07-30T12:27:39.000Z | 2022-01-28T23:38:17.000Z | """
Axiom Python Client
"""
__version__ = "0.1.0-beta.2"
from .client import *
from .datasets import *
| 11.666667 | 28 | 0.666667 | 15 | 105 | 4.4 | 0.733333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.045977 | 0.171429 | 105 | 8 | 29 | 13.125 | 0.712644 | 0.180952 | 0 | 0 | 0 | 0 | 0.153846 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
4f0410491333c2d185cc0abeb6504f625457135d | 204 | py | Python | python-stuff/performance_timing.py | mnky9800n/python-data-analysis-tools | 298dc6d9271c72f61285c19ff0112d755fb0c83c | [
"MIT"
] | 2 | 2020-09-11T12:50:15.000Z | 2021-05-12T07:10:04.000Z | python-stuff/performance_timing.py | mnky9800n/python-data-analysis-tools | 298dc6d9271c72f61285c19ff0112d755fb0c83c | [
"MIT"
] | null | null | null | python-stuff/performance_timing.py | mnky9800n/python-data-analysis-tools | 298dc6d9271c72f61285c19ff0112d755fb0c83c | [
"MIT"
] | 3 | 2020-03-06T15:35:46.000Z | 2021-12-11T07:36:08.000Z | import timeit
# bro, probably could just use %timeit if
# you are on ipython. :-P
starttime = timeit.default_timer()
"""
your code here
"""
endtime = timeit.default_timer()
print(endtime - starttime)
| 14.571429 | 41 | 0.715686 | 28 | 204 | 5.142857 | 0.75 | 0.180556 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 204 | 13 | 42 | 15.692308 | 0.847059 | 0.308824 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.076923 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0.25 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4f0673060aa2a1a406e83c4abf1c5a23f61d0412 | 226 | py | Python | scripts/instagramy.py | lathropd/instanewsroom | 2e78a490f7c37b34d7f3020a6fab2cfcf4ebd46a | [
"Artistic-2.0"
] | null | null | null | scripts/instagramy.py | lathropd/instanewsroom | 2e78a490f7c37b34d7f3020a6fab2cfcf4ebd46a | [
"Artistic-2.0"
] | null | null | null | scripts/instagramy.py | lathropd/instanewsroom | 2e78a490f7c37b34d7f3020a6fab2cfcf4ebd46a | [
"Artistic-2.0"
] | null | null | null | from instagram.client import InstagramAPI
from pprint import pprint
test_access_token = "1890268.7c3f1ab.e1c64ca8df38410099d98bff8a868bb6"
api = InstagramAPI(access_token=test_access_token)
pprint( api.user_recent_media())
| 25.111111 | 70 | 0.849558 | 27 | 226 | 6.851852 | 0.592593 | 0.178378 | 0.162162 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.140097 | 0.084071 | 226 | 8 | 71 | 28.25 | 0.753623 | 0 | 0 | 0 | 0 | 0 | 0.212389 | 0.212389 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0.4 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
877c8d0d7d7e4e7123818535f0c941d6e42050fa | 328 | py | Python | prefect/token_test.py | kvnkho/demos | c8c33993e00baf6a25d0ffdc44db924b327cbffa | [
"MIT"
] | 13 | 2021-05-13T23:07:17.000Z | 2022-03-19T00:00:41.000Z | prefect/token_test.py | kvnkho/demos | c8c33993e00baf6a25d0ffdc44db924b327cbffa | [
"MIT"
] | null | null | null | prefect/token_test.py | kvnkho/demos | c8c33993e00baf6a25d0ffdc44db924b327cbffa | [
"MIT"
] | 7 | 2021-06-16T18:16:55.000Z | 2022-03-21T03:34:43.000Z | from prefect import task, Flow, Parameter
from prefect.tasks.prefect import StartFlowRun
from prefect.storage import GitHub
with Flow("token-test") as flow:
StartFlowRun(project_name="testing", flow_name="flow_must_fail")()
flow.storage = GitHub(repo="kvnkho/demos", path="/prefect/token_test.py")
flow.register("testing") | 36.444444 | 73 | 0.780488 | 46 | 328 | 5.456522 | 0.543478 | 0.131474 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.091463 | 328 | 9 | 74 | 36.444444 | 0.842282 | 0 | 0 | 0 | 0 | 0 | 0.218845 | 0.066869 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.428571 | 0 | 0.428571 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
87829589d5f65d2ab2ae28e5f39a9cb66fefb9e4 | 629 | py | Python | PythonExercicios/ex039.py | lordvinick/Python | c03fd08d4c204104bf0196b0bd129427fd2067ae | [
"MIT"
] | null | null | null | PythonExercicios/ex039.py | lordvinick/Python | c03fd08d4c204104bf0196b0bd129427fd2067ae | [
"MIT"
] | null | null | null | PythonExercicios/ex039.py | lordvinick/Python | c03fd08d4c204104bf0196b0bd129427fd2067ae | [
"MIT"
] | null | null | null | print('\033[36m='*12, '\033[32mAlistamento Militar', '\033[36m='*12)
from datetime import date
ano = int(input('Em que ano você nasceu? '))
atual = date.today().year
idade = atual - ano
print(f'Você tem \033[32m{idade} \033[36manos em \033[32m{atual}.')
if idade == 18:
print('\033[36mTa na hora de se alistar.')
elif idade < 18:
print(f'\033[36mAinda falta(m) \033[32m{18 - idade} \033[36mano(s) para se alistar \nSeu alistamento será em \033[32m{ano+18}.')
elif idade > 18:
print(f'\033[31mVocê deveria ter se alistado há \033[32m{idade - 18} \033[31manos atrás.\n\033[36mSeu alistamento foi em \033[32m{ano+18}.')
| 48.384615 | 144 | 0.682035 | 109 | 629 | 3.93578 | 0.486239 | 0.083916 | 0.055944 | 0.074592 | 0.153846 | 0.09324 | 0 | 0 | 0 | 0 | 0 | 0.181481 | 0.141494 | 629 | 12 | 145 | 52.416667 | 0.612963 | 0 | 0 | 0 | 0 | 0.25 | 0.647059 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.083333 | 0 | 0.083333 | 0.416667 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
8784b5c8526896e5048632a3a82e5b228aabb640 | 31,270 | gyp | Python | build/pomdog.gyp | bis83/pomdog | 133a9262958d539ae6d93664e6cb2207b5b6c7ff | [
"MIT"
] | null | null | null | build/pomdog.gyp | bis83/pomdog | 133a9262958d539ae6d93664e6cb2207b5b6c7ff | [
"MIT"
] | null | null | null | build/pomdog.gyp | bis83/pomdog | 133a9262958d539ae6d93664e6cb2207b5b6c7ff | [
"MIT"
] | null | null | null | {
'includes': ['common.gypi'],
'conditions': [
['OS == "win"', {
'variables': {
'application_platform%': 'Win32',
'renderers%': ['Direct3D11', 'GL4'],
'audio%': 'XAudio2',
'input_devices%': ['DirectInput'],
},
}],
['OS == "mac"', {
'variables': {
'application_platform%': 'Cocoa',
'renderers%': ['GL4'],
'audio%': 'OpenAL',
'input_devices%': [],
},
}],
['OS == "ios"', {
'variables': {
'application_platform%': 'CocoaTouch',
'renderers%': ['Metal'],
'audio%': 'OpenAL',
'input_devices%': [],
},
}],
['OS == "linux" or OS == "freebsd" or OS == "openbsd"', {
'variables': {
'application_platform%': 'X11',
'renderers%': ['GL4'],
'audio%': 'OpenAL',
'input_devices%': [],
},
}],
],
'variables': {
'pomdog_third_party_dir%': '../third-party',
'pomdog_library_core_sources': [
'../include/Pomdog/Application/Duration.hpp',
'../include/Pomdog/Application/Game.hpp',
'../include/Pomdog/Application/GameClock.hpp',
'../include/Pomdog/Application/GameHost.hpp',
'../include/Pomdog/Application/GameWindow.hpp',
'../include/Pomdog/Application/MouseCursor.hpp',
'../include/Pomdog/Application/Timer.hpp',
'../include/Pomdog/Application/TimePoint.hpp',
# '../include/Pomdog/Async/Helpers.hpp',
# '../include/Pomdog/Async/ImmediateScheduler.hpp',
# '../include/Pomdog/Async/QueuedScheduler.hpp',
# '../include/Pomdog/Async/Scheduler.hpp',
# '../include/Pomdog/Async/Task.hpp',
'../include/Pomdog/Audio/AudioClip.hpp',
'../include/Pomdog/Audio/AudioChannels.hpp',
'../include/Pomdog/Audio/AudioEmitter.hpp',
'../include/Pomdog/Audio/AudioEngine.hpp',
'../include/Pomdog/Audio/AudioListener.hpp',
'../include/Pomdog/Audio/SoundEffect.hpp',
'../include/Pomdog/Audio/SoundState.hpp',
'../include/Pomdog/Audio/detail/ForwardDeclarations.hpp',
'../include/Pomdog/Basic/Export.hpp',
'../include/Pomdog/Basic/Platform.hpp',
'../include/Pomdog/Basic/Version.hpp',
'../include/Pomdog/Content/AssetManager.hpp',
'../include/Pomdog/Content/AssetBuilders/Builder.hpp',
'../include/Pomdog/Content/AssetBuilders/PipelineStateBuilder.hpp',
'../include/Pomdog/Content/AssetBuilders/ShaderBuilder.hpp',
'../include/Pomdog/Content/Utility/BinaryFileStream.hpp',
'../include/Pomdog/Content/Utility/BinaryReader.hpp',
'../include/Pomdog/Content/Utility/MakeFourCC.hpp',
'../include/Pomdog/Content/Utility/PathHelper.hpp',
'../include/Pomdog/Content/detail/AssetDictionary.hpp',
'../include/Pomdog/Content/detail/AssetLoaderContext.hpp',
'../include/Pomdog/Content/detail/AssetLoader.hpp',
'../include/Pomdog/Content/detail/AssetLoaders/AudioClipLoader.hpp',
'../include/Pomdog/Content/detail/AssetLoaders/Texture2DLoader.hpp',
'../include/Pomdog/Graphics/Blend.hpp',
'../include/Pomdog/Graphics/BlendDescription.hpp',
'../include/Pomdog/Graphics/BlendFunction.hpp',
'../include/Pomdog/Graphics/BufferUsage.hpp',
'../include/Pomdog/Graphics/ClearOptions.hpp',
'../include/Pomdog/Graphics/ComparisonFunction.hpp',
'../include/Pomdog/Graphics/ConstantBuffer.hpp',
'../include/Pomdog/Graphics/CullMode.hpp',
'../include/Pomdog/Graphics/DepthFormat.hpp',
'../include/Pomdog/Graphics/DepthStencilDescription.hpp',
'../include/Pomdog/Graphics/DepthStencilOperation.hpp',
'../include/Pomdog/Graphics/EffectAnnotation.hpp',
'../include/Pomdog/Graphics/EffectConstantDescription.hpp',
'../include/Pomdog/Graphics/EffectReflection.hpp',
'../include/Pomdog/Graphics/EffectVariableClass.hpp',
'../include/Pomdog/Graphics/EffectVariableType.hpp',
'../include/Pomdog/Graphics/EffectVariable.hpp',
'../include/Pomdog/Graphics/FillMode.hpp',
'../include/Pomdog/Graphics/GraphicsCommandList.hpp',
'../include/Pomdog/Graphics/GraphicsCommandQueue.hpp',
'../include/Pomdog/Graphics/GraphicsDevice.hpp',
'../include/Pomdog/Graphics/IndexBuffer.hpp',
'../include/Pomdog/Graphics/IndexElementSize.hpp',
'../include/Pomdog/Graphics/InputClassification.hpp',
'../include/Pomdog/Graphics/InputElement.hpp',
'../include/Pomdog/Graphics/InputElementFormat.hpp',
'../include/Pomdog/Graphics/InputLayoutDescription.hpp',
'../include/Pomdog/Graphics/InputLayoutHelper.hpp',
'../include/Pomdog/Graphics/PipelineState.hpp',
'../include/Pomdog/Graphics/PipelineStateDescription.hpp',
'../include/Pomdog/Graphics/PresentationParameters.hpp',
'../include/Pomdog/Graphics/PrimitiveTopology.hpp',
'../include/Pomdog/Graphics/RasterizerDescription.hpp',
'../include/Pomdog/Graphics/RenderTarget2D.hpp',
'../include/Pomdog/Graphics/RenderTargetBlendDescription.hpp',
'../include/Pomdog/Graphics/SamplerDescription.hpp',
'../include/Pomdog/Graphics/SamplerState.hpp',
'../include/Pomdog/Graphics/Shader.hpp',
'../include/Pomdog/Graphics/ShaderLanguage.hpp',
'../include/Pomdog/Graphics/ShaderPipelineStage.hpp',
'../include/Pomdog/Graphics/SurfaceFormat.hpp',
'../include/Pomdog/Graphics/StencilOperation.hpp',
'../include/Pomdog/Graphics/Texture.hpp',
'../include/Pomdog/Graphics/Texture2D.hpp',
'../include/Pomdog/Graphics/TextureAddressMode.hpp',
'../include/Pomdog/Graphics/TextureFilter.hpp',
'../include/Pomdog/Graphics/VertexBuffer.hpp',
'../include/Pomdog/Graphics/VertexBufferBinding.hpp',
'../include/Pomdog/Graphics/Viewport.hpp',
'../include/Pomdog/Graphics/detail/ForwardDeclarations.hpp',
'../include/Pomdog/Graphics/detail/EffectBinaryParameter.hpp',
'../include/Pomdog/Graphics/ShaderCompilers/GLSLCompiler.hpp',
'../include/Pomdog/Graphics/ShaderCompilers/HLSLCompiler.hpp',
'../include/Pomdog/Input/ButtonState.hpp',
'../include/Pomdog/Input/Gamepad.hpp',
'../include/Pomdog/Input/GamepadButtons.hpp',
'../include/Pomdog/Input/GamepadCapabilities.hpp',
'../include/Pomdog/Input/GamepadDPad.hpp',
'../include/Pomdog/Input/GamepadState.hpp',
'../include/Pomdog/Input/GamepadThumbSticks.hpp',
'../include/Pomdog/Input/GamepadType.hpp',
'../include/Pomdog/Input/Keyboard.hpp',
'../include/Pomdog/Input/KeyboardState.hpp',
'../include/Pomdog/Input/KeyState.hpp',
'../include/Pomdog/Input/Keys.hpp',
'../include/Pomdog/Input/Mouse.hpp',
'../include/Pomdog/Input/MouseState.hpp',
'../include/Pomdog/Input/PlayerIndex.hpp',
'../include/Pomdog/Input/TouchLocation.hpp',
'../include/Pomdog/Input/TouchLocationState.hpp',
'../include/Pomdog/Logging/Log.hpp',
'../include/Pomdog/Logging/LogChannel.hpp',
'../include/Pomdog/Logging/LogEntry.hpp',
'../include/Pomdog/Logging/LogLevel.hpp',
'../include/Pomdog/Logging/LogStream.hpp',
'../include/Pomdog/Math/BoundingBox.hpp',
'../include/Pomdog/Math/BoundingBox2D.hpp',
'../include/Pomdog/Math/BoundingCircle.hpp',
'../include/Pomdog/Math/BoundingSphere.hpp',
'../include/Pomdog/Math/Color.hpp',
'../include/Pomdog/Math/ContainmentType.hpp',
'../include/Pomdog/Math/Degree.hpp',
'../include/Pomdog/Math/MathHelper.hpp',
'../include/Pomdog/Math/Matrix2x2.hpp',
'../include/Pomdog/Math/Matrix3x2.hpp',
'../include/Pomdog/Math/Matrix3x3.hpp',
'../include/Pomdog/Math/Matrix4x4.hpp',
'../include/Pomdog/Math/Point2D.hpp',
'../include/Pomdog/Math/Point3D.hpp',
'../include/Pomdog/Math/Quaternion.hpp',
'../include/Pomdog/Math/Radian.hpp',
'../include/Pomdog/Math/Ray.hpp',
'../include/Pomdog/Math/Rectangle.hpp',
'../include/Pomdog/Math/Vector2.hpp',
'../include/Pomdog/Math/Vector3.hpp',
'../include/Pomdog/Math/Vector4.hpp',
'../include/Pomdog/Math/detail/Coordinate2D.hpp',
'../include/Pomdog/Math/detail/Coordinate2DImplementation.hpp',
'../include/Pomdog/Math/detail/Coordinate3D.hpp',
'../include/Pomdog/Math/detail/Coordinate3DImplementation.hpp',
'../include/Pomdog/Math/detail/FloatingPointMatrix2x2.hpp',
'../include/Pomdog/Math/detail/FloatingPointMatrix3x2.hpp',
'../include/Pomdog/Math/detail/FloatingPointMatrix3x3.hpp',
'../include/Pomdog/Math/detail/FloatingPointMatrix4x4.hpp',
'../include/Pomdog/Math/detail/FloatingPointQuaternion.hpp',
'../include/Pomdog/Math/detail/FloatingPointVector2.hpp',
'../include/Pomdog/Math/detail/FloatingPointVector3.hpp',
'../include/Pomdog/Math/detail/FloatingPointVector4.hpp',
'../include/Pomdog/Math/detail/ForwardDeclarations.hpp',
'../include/Pomdog/Math/detail/TaggedArithmetic.hpp',
'../include/Pomdog/Signals/Connection.hpp',
'../include/Pomdog/Signals/ConnectionList.hpp',
'../include/Pomdog/Signals/Event.hpp',
'../include/Pomdog/Signals/EventQueue.hpp',
'../include/Pomdog/Signals/Helpers.hpp',
'../include/Pomdog/Signals/ScopedConnection.hpp',
'../include/Pomdog/Signals/Signal.hpp',
'../include/Pomdog/Signals/detail/EventBody.hpp',
'../include/Pomdog/Signals/detail/ForwardDeclarations.hpp',
'../include/Pomdog/Signals/detail/SignalBody.hpp',
'../include/Pomdog/Utility/Any.hpp',
'../include/Pomdog/Utility/Assert.hpp',
'../include/Pomdog/Utility/Exception.hpp',
'../include/Pomdog/Utility/Optional.hpp',
'../include/Pomdog/Utility/StringHelper.hpp',
'../include/Pomdog/Utility/detail/CRC32.hpp',
'../include/Pomdog/Utility/detail/FileSystem.hpp',
'../include/Pomdog/Utility/detail/Tagged.hpp',
'../src/Application/GameClock.cpp',
'../src/Application/SubsystemScheduler.hpp',
'../src/Application/SystemEvents.hpp',
'../src/Application/Timer.cpp',
'../src/Application/TimeSource.hpp',
# '../src/Async/ImmediateScheduler.cpp',
# '../src/Async/QueuedScheduler.cpp',
# '../src/Async/Task.cpp',
'../src/Audio/AudioClip.cpp',
'../src/Audio/AudioEngine.cpp',
'../src/Audio/SoundEffect.cpp',
'../src/Content/AssetDictionary.cpp',
'../src/Content/AssetLoaderContext.cpp',
'../src/Content/AssetManager.cpp',
'../src/Content/AssetBuilders/PipelineStateBuilder.cpp',
'../src/Content/AssetBuilders/ShaderBuilder.cpp',
'../src/Content/AssetLoaders/AudioClipLoader.cpp',
'../src/Content/AssetLoaders/Texture2DLoader.cpp',
'../src/Content/Utility/DDSTextureReader.cpp',
'../src/Content/Utility/DDSTextureReader.hpp',
'../src/Content/Utility/MSWaveAudioLoader.cpp',
'../src/Content/Utility/MSWaveAudioLoader.hpp',
'../src/Content/Utility/PNGTextureReader.cpp',
'../src/Content/Utility/PNGTextureReader.hpp',
'../src/Graphics/ClearOptions.cpp',
'../src/Graphics/ConstantBuffer.cpp',
'../src/Graphics/EffectBinaryParameter.cpp',
'../src/Graphics/EffectReflection.cpp',
'../src/Graphics/GraphicsCommandList.cpp',
'../src/Graphics/GraphicsCommandQueue.cpp',
'../src/Graphics/GraphicsDevice.cpp',
'../src/Graphics/IndexBuffer.cpp',
'../src/Graphics/InputLayoutHelper.cpp',
'../src/Graphics/PipelineState.cpp',
'../src/Graphics/RenderTarget2D.cpp',
'../src/Graphics/SamplerState.cpp',
'../src/Graphics/Texture2D.cpp',
'../src/Graphics/Viewport.cpp',
'../src/Graphics/VertexBuffer.cpp',
'../src/Graphics/ShaderCompilers/GLSLCompiler.cpp',
'../src/Graphics/ShaderCompilers/HLSLCompiler.cpp',
'../src/Input/KeyboardState.cpp',
'../src/InputSystem/InputDeviceCreator.hpp',
'../src/InputSystem/InputDeviceFactory.cpp',
'../src/InputSystem/InputDeviceFactory.hpp',
'../src/Logging/Log.cpp',
'../src/Logging/LogChannel.cpp',
'../src/Logging/LogStream.cpp',
'../src/Math/BoundingBox.cpp',
'../src/Math/BoundingBox2D.cpp',
'../src/Math/BoundingCircle.cpp',
'../src/Math/BoundingSphere.cpp',
'../src/Math/Color.cpp',
'../src/Math/MathHelper.cpp',
'../src/Math/Ray.cpp',
'../src/Math/Rectangle.cpp',
'../src/Math/detail/FloatingPointMatrix2x2.cpp',
'../src/Math/detail/FloatingPointMatrix3x2.cpp',
'../src/Math/detail/FloatingPointMatrix3x3.cpp',
'../src/Math/detail/FloatingPointMatrix4x4.cpp',
'../src/Math/detail/FloatingPointQuaternion.cpp',
'../src/Math/detail/FloatingPointVector2.cpp',
'../src/Math/detail/FloatingPointVector3.cpp',
'../src/Math/detail/FloatingPointVector4.cpp',
'../src/RenderSystem/GraphicsCapabilities.hpp',
'../src/RenderSystem/GraphicsCommandListImmediate.cpp',
'../src/RenderSystem/GraphicsCommandListImmediate.hpp',
'../src/RenderSystem/GraphicsCommandQueueImmediate.cpp',
'../src/RenderSystem/GraphicsCommandQueueImmediate.hpp',
'../src/RenderSystem/GraphicsContext.cpp',
'../src/RenderSystem/GraphicsContext.hpp',
'../src/RenderSystem/NativeBuffer.hpp',
'../src/RenderSystem/NativeEffectReflection.hpp',
'../src/RenderSystem/NativeGraphicsCommandList.hpp',
'../src/RenderSystem/NativeGraphicsCommandQueue.hpp',
'../src/RenderSystem/NativeGraphicsContext.hpp',
'../src/RenderSystem/NativeGraphicsDevice.hpp',
'../src/RenderSystem/NativePipelineState.hpp',
'../src/RenderSystem/NativeRenderTarget2D.hpp',
'../src/RenderSystem/NativeSamplerState.hpp',
'../src/RenderSystem/NativeTexture2D.hpp',
'../src/RenderSystem/ShaderBytecode.hpp',
'../src/RenderSystem/ShaderCompileOptions.hpp',
'../src/RenderSystem/SurfaceFormatHelper.cpp',
'../src/RenderSystem/SurfaceFormatHelper.hpp',
'../src/RenderSystem/TextureHelper.cpp',
'../src/RenderSystem/TextureHelper.hpp',
'../src/Signals/Connection.cpp',
'../src/Signals/ConnectionList.cpp',
'../src/Signals/EventQueue.cpp',
'../src/Signals/ScopedConnection.cpp',
'../src/Utility/CRC32.cpp',
'../src/Utility/Noncopyable.hpp',
'../src/Utility/PathHelper.cpp',
'../src/Utility/ScopeGuard.hpp',
'../src/Utility/StringHelper.cpp',
],
'pomdog_library_opengl4_sources': [
'../src/RenderSystem.GL4/BlendStateGL4.cpp',
'../src/RenderSystem.GL4/BlendStateGL4.hpp',
'../src/RenderSystem.GL4/BufferGL4.cpp',
'../src/RenderSystem.GL4/BufferGL4.hpp',
'../src/RenderSystem.GL4/DepthStencilStateGL4.cpp',
'../src/RenderSystem.GL4/DepthStencilStateGL4.hpp',
'../src/RenderSystem.GL4/EffectReflectionGL4.cpp',
'../src/RenderSystem.GL4/EffectReflectionGL4.hpp',
'../src/RenderSystem.GL4/ErrorChecker.cpp',
'../src/RenderSystem.GL4/ErrorChecker.hpp',
'../src/RenderSystem.GL4/GraphicsContextGL4.cpp',
'../src/RenderSystem.GL4/GraphicsContextGL4.hpp',
'../src/RenderSystem.GL4/GraphicsDeviceGL4.cpp',
'../src/RenderSystem.GL4/GraphicsDeviceGL4.hpp',
'../src/RenderSystem.GL4/InputLayoutGL4.cpp',
'../src/RenderSystem.GL4/InputLayoutGL4.hpp',
'../src/RenderSystem.GL4/OpenGLContext.hpp',
'../src/RenderSystem.GL4/OpenGLPrerequisites.hpp',
'../src/RenderSystem.GL4/PipelineStateGL4.cpp',
'../src/RenderSystem.GL4/PipelineStateGL4.hpp',
'../src/RenderSystem.GL4/RasterizerStateGL4.cpp',
'../src/RenderSystem.GL4/RasterizerStateGL4.hpp',
'../src/RenderSystem.GL4/RenderTarget2DGL4.cpp',
'../src/RenderSystem.GL4/RenderTarget2DGL4.hpp',
'../src/RenderSystem.GL4/SamplerStateGL4.cpp',
'../src/RenderSystem.GL4/SamplerStateGL4.hpp',
'../src/RenderSystem.GL4/ShaderGL4.cpp',
'../src/RenderSystem.GL4/ShaderGL4.hpp',
'../src/RenderSystem.GL4/Texture2DGL4.cpp',
'../src/RenderSystem.GL4/Texture2DGL4.hpp',
'../src/RenderSystem.GL4/TypesafeGL4.hpp',
'../src/RenderSystem.GL4/TypesafeHelperGL4.hpp',
],
'pomdog_library_openal_sources': [
'../src/SoundSystem.OpenAL/AudioClipAL.cpp',
'../src/SoundSystem.OpenAL/AudioClipAL.hpp',
'../src/SoundSystem.OpenAL/AudioEngineAL.cpp',
'../src/SoundSystem.OpenAL/AudioEngineAL.hpp',
'../src/SoundSystem.OpenAL/ContextOpenAL.cpp',
'../src/SoundSystem.OpenAL/ContextOpenAL.hpp',
'../src/SoundSystem.OpenAL/ErrorCheckerAL.cpp',
'../src/SoundSystem.OpenAL/ErrorCheckerAL.hpp',
'../src/SoundSystem.OpenAL/PrerequisitesOpenAL.hpp',
'../src/SoundSystem.OpenAL/SoundEffectAL.cpp',
'../src/SoundSystem.OpenAL/SoundEffectAL.hpp',
],
'pomdog_library_apple_sources': [
'../src/Platform.Apple/FileSystemApple.mm',
'../src/Platform.Apple/TimeSourceApple.cpp',
'../src/Platform.Apple/TimeSourceApple.hpp',
],
'pomdog_library_cocoa_sources': [
'../include/Pomdog/Platform/Cocoa/Bootstrap.hpp',
'../include/Pomdog/Platform/Cocoa/PomdogOpenGLView.hpp',
'../src/Platform.Cocoa/Bootstrap.mm',
'../src/Platform.Cocoa/CocoaWindowDelegate.hpp',
'../src/Platform.Cocoa/CocoaWindowDelegate.mm',
'../src/Platform.Cocoa/GameHostCocoa.hpp',
'../src/Platform.Cocoa/GameHostCocoa.mm',
'../src/Platform.Cocoa/GameWindowCocoa.hpp',
'../src/Platform.Cocoa/GameWindowCocoa.mm',
'../src/Platform.Cocoa/KeyboardCocoa.hpp',
'../src/Platform.Cocoa/KeyboardCocoa.cpp',
'../src/Platform.Cocoa/MouseCocoa.hpp',
'../src/Platform.Cocoa/MouseCocoa.cpp',
'../src/Platform.Cocoa/OpenGLContextCocoa.hpp',
'../src/Platform.Cocoa/OpenGLContextCocoa.mm',
'../src/Platform.Cocoa/PomdogOpenGLView.mm',
],
'pomdog_library_dxgi_sources': [
'../src/RenderSystem.DXGI/DXGIFormatHelper.cpp',
'../src/RenderSystem.DXGI/DXGIFormatHelper.hpp',
],
'pomdog_library_direct3d_sources': [
'../src/RenderSystem.Direct3D/HLSLCompiling.cpp',
'../src/RenderSystem.Direct3D/HLSLCompiling.hpp',
'../src/RenderSystem.Direct3D/HLSLReflectionHelper.cpp',
'../src/RenderSystem.Direct3D/HLSLReflectionHelper.hpp',
'../src/RenderSystem.Direct3D/PrerequisitesDirect3D.hpp',
],
'pomdog_library_direct3d11_sources': [
'../src/RenderSystem.Direct3D11/BufferDirect3D11.cpp',
'../src/RenderSystem.Direct3D11/BufferDirect3D11.hpp',
'../src/RenderSystem.Direct3D11/EffectReflectionDirect3D11.cpp',
'../src/RenderSystem.Direct3D11/EffectReflectionDirect3D11.hpp',
'../src/RenderSystem.Direct3D11/GraphicsContextDirect3D11.cpp',
'../src/RenderSystem.Direct3D11/GraphicsContextDirect3D11.hpp',
'../src/RenderSystem.Direct3D11/GraphicsDeviceDirect3D11.cpp',
'../src/RenderSystem.Direct3D11/GraphicsDeviceDirect3D11.hpp',
'../src/RenderSystem.Direct3D11/PipelineStateDirect3D11.cpp',
'../src/RenderSystem.Direct3D11/PipelineStateDirect3D11.hpp',
'../src/RenderSystem.Direct3D11/PrerequisitesDirect3D11.hpp',
'../src/RenderSystem.Direct3D11/RenderTarget2DDirect3D11.cpp',
'../src/RenderSystem.Direct3D11/RenderTarget2DDirect3D11.hpp',
'../src/RenderSystem.Direct3D11/SamplerStateDirect3D11.cpp',
'../src/RenderSystem.Direct3D11/SamplerStateDirect3D11.hpp',
'../src/RenderSystem.Direct3D11/ShaderDirect3D11.cpp',
'../src/RenderSystem.Direct3D11/ShaderDirect3D11.hpp',
'../src/RenderSystem.Direct3D11/Texture2DDirect3D11.cpp',
'../src/RenderSystem.Direct3D11/Texture2DDirect3D11.hpp',
],
'pomdog_library_xaudio2_sources': [
'../src/SoundSystem.XAudio2/AudioClipXAudio2.cpp',
'../src/SoundSystem.XAudio2/AudioClipXAudio2.hpp',
'../src/SoundSystem.XAudio2/AudioEngineXAudio2.cpp',
'../src/SoundSystem.XAudio2/AudioEngineXAudio2.hpp',
'../src/SoundSystem.XAudio2/PrerequisitesXAudio2.hpp',
'../src/SoundSystem.XAudio2/SoundEffectXAudio2.cpp',
'../src/SoundSystem.XAudio2/SoundEffectXAudio2.hpp',
],
'pomdog_library_directinput_sources': [
'../src/InputSystem.DirectInput/DeviceContextDirectInput.cpp',
'../src/InputSystem.DirectInput/DeviceContextDirectInput.hpp',
'../src/InputSystem.DirectInput/PrerequisitesDirectInput.hpp',
],
'pomdog_library_win32_sources': [
'../include/Pomdog/Platform/Win32/Bootstrap.hpp',
'../include/Pomdog/Platform/Win32/BootstrapSettingsWin32.hpp',
'../include/Pomdog/Platform/Win32/PrerequisitesWin32.hpp',
'../src/Platform.Win32/Bootstrap.cpp',
'../src/Platform.Win32/GameHostWin32.cpp',
'../src/Platform.Win32/GameHostWin32.hpp',
'../src/Platform.Win32/GameWindowWin32.cpp',
'../src/Platform.Win32/GameWindowWin32.hpp',
'../src/Platform.Win32/FileSystemWin32.cpp',
'../src/Platform.Win32/KeyboardWin32.cpp',
'../src/Platform.Win32/KeyboardWin32.hpp',
'../src/Platform.Win32/MouseWin32.cpp',
'../src/Platform.Win32/MouseWin32.hpp',
'../src/Platform.Win32/TimeSourceWin32.cpp',
'../src/Platform.Win32/TimeSourceWin32.hpp',
],
'pomdog_library_win32_opengl_sources': [
'../src/Platform.Win32/OpenGLContextWin32.cpp',
'../src/Platform.Win32/OpenGLContextWin32.hpp',
],
'pomdog_library_x11_sources': [
'../include/Pomdog/Platform/X11/Bootstrap.hpp',
'../src/Platform.X11/Bootstrap.cpp',
'../src/Platform.X11/GameHostX11.cpp',
'../src/Platform.X11/GameHostX11.hpp',
'../src/Platform.X11/GameWindowX11.cpp',
'../src/Platform.X11/GameWindowX11.hpp',
'../src/Platform.X11/KeyboardX11.cpp',
'../src/Platform.X11/KeyboardX11.hpp',
'../src/Platform.X11/MouseX11.cpp',
'../src/Platform.X11/MouseX11.hpp',
'../src/Platform.X11/OpenGLContextX11.cpp',
'../src/Platform.X11/OpenGLContextX11.hpp',
'../src/Platform.X11/X11AtomCache.hpp',
'../src/Platform.X11/X11Context.cpp',
'../src/Platform.X11/X11Context.hpp',
],
'pomdog_library_linux_sources': [
'../src/Platform.Linux/FileSystemLinux.cpp',
'../src/Platform.Linux/TimeSourceLinux.cpp',
'../src/Platform.Linux/TimeSourceLinux.hpp',
],
},
'target_defaults': {
'dependencies': [
'<@(pomdog_third_party_dir)/libpng/libpng.gyp:libpng_static',
],
'include_dirs': [
'../include',
'<@(pomdog_third_party_dir)/libpng',
],
'sources': [
'<@(pomdog_library_core_sources)',
'../include/Pomdog/Pomdog.hpp',
],
'msbuild_settings': {
'ClCompile': {
'WarningLevel': 'Level4', # /W4
'TreatWarningAsError': 'true', # /WX
},
},
'xcode_settings': {
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
'CLANG_CXX_LANGUAGE_STANDARD': 'c++14',
'CLANG_CXX_LIBRARY': 'libc++',
# Warnings (Clang):
'CLANG_WARN_BOOL_CONVERSION': 'YES',
'CLANG_WARN_CONSTANT_CONVERSION': 'YES',
'CLANG_WARN_EMPTY_BODY': 'YES',
'CLANG_WARN_ENUM_CONVERSION': 'YES',
'CLANG_WARN_INT_CONVERSION': 'YES',
'CLANG_WARN_UNREACHABLE_CODE': 'YES',
# Warnings (GCC and Clang):
'GCC_WARN_64_TO_32_BIT_CONVERSION': 'YES',
'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'YES',
'GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS': 'YES',
'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',
'GCC_WARN_ABOUT_RETURN_TYPE': 'YES_ERROR',
'GCC_WARN_CHECK_SWITCH_STATEMENTS': 'YES',
'GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS': 'YES',
'GCC_WARN_MISSING_PARENTHESES': 'YES',
'GCC_WARN_NON_VIRTUAL_DESTRUCTOR': 'YES',
'GCC_WARN_SHADOW': 'YES',
'GCC_WARN_SIGN_COMPARE': 'YES',
'GCC_WARN_TYPECHECK_CALLS_TO_PRINTF': 'YES',
'GCC_WARN_UNINITIALIZED_AUTOS': 'YES_AGGRESSIVE',
'GCC_WARN_UNKNOWN_PRAGMAS': 'YES',
'GCC_WARN_UNUSED_FUNCTION': 'YES',
'GCC_WARN_UNUSED_LABEL': 'YES',
'GCC_WARN_UNUSED_VALUE': 'YES',
'GCC_WARN_UNUSED_VARIABLE': 'YES',
# Warnings - Objective-C:
'CLANG_WARN_DIRECT_OBJC_ISA_USAGE': 'YES_ERROR',
'CLANG_WARN__DUPLICATE_METHOD_MATCH': 'YES',
'GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL': 'YES',
'GCC_WARN_UNDECLARED_SELECTOR': 'YES',
'CLANG_WARN_OBJC_ROOT_CLASS': 'YES_ERROR',
# Warning Policies:
'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES',
'WARNING_CFLAGS': [
'-Wall',
],
# Symbols:
'CLANG_ENABLE_OBJC_ARC': 'YES',
'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', # '-fvisibility-inlines-hidden'
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # '-fvisibility=hidden'
},
'conditions': [
['"Direct3D11" in renderers', {
'defines': ['POMDOG_ENABLE_DIRECT3D11'],
'sources': [
'<@(pomdog_library_dxgi_sources)',
'<@(pomdog_library_direct3d_sources)',
'<@(pomdog_library_direct3d11_sources)',
],
'link_settings': {
'libraries': [
'-ldxgi.lib',
'-ld3d11.lib',
'-ld3dcompiler.lib',
'-ldxguid.lib', # using _IID_ID3D11ShaderReflection
],
},
}],
['"GL4" in renderers', {
'defines': ['POMDOG_ENABLE_GL4'],
'sources': [
'<@(pomdog_library_opengl4_sources)',
],
}],
['"GL4" in renderers and OS == "win"', {
'sources': [
'<@(pomdog_library_win32_opengl_sources)',
],
'defines': [
'GLEW_STATIC',
],
'dependencies': [
'<@(pomdog_third_party_dir)/glew/glew.gyp:glew_static',
],
'include_dirs': [
'<@(pomdog_third_party_dir)/glew/include',
],
'link_settings': {
'libraries': [
'-lopengl32.lib',
],
},
}],
['"Metal" in renderers and OS == "mac"', {
'link_settings': {
'libraries': [
'$(SDKROOT)/System/Library/Frameworks/Metal.framework',
],
},
}],
['"Metal" in renderers and OS == "ios"', {
'link_settings': {
'libraries': [
'$(SDKROOT)/System/Library/Frameworks/Metal.framework',
'$(SDKROOT)/System/Library/Frameworks/MetalKit.framework',
'$(SDKROOT)/System/Library/Frameworks/ModelIO.framework',
],
},
}],
['audio == "OpenAL"', {
'sources': [
'<@(pomdog_library_openal_sources)',
],
}],
['audio == "OpenAL" and OS == "mac"', {
'link_settings': {
'libraries': [
'$(SDKROOT)/System/Library/Frameworks/AudioToolBox.framework',
'$(SDKROOT)/System/Library/Frameworks/OpenAL.framework',
],
},
}],
['audio == "OpenAL" and OS == "ios"', {
'link_settings': {
'libraries': [
'$(SDKROOT)/System/Library/Frameworks/AudioToolBox.framework',
'$(SDKROOT)/System/Library/Frameworks/OpenAL.framework',
],
},
}],
['audio == "OpenAL" and OS == "linux"', {
'link_settings': {
'libraries': [
'-lopenal',
],
},
}],
['audio == "XAudio2"', {
'sources': [
'<@(pomdog_library_xaudio2_sources)',
],
'link_settings': {
'libraries': [
'-lxaudio2.lib',
],
},
}], # audio == "XAudio2"
['"DirectInput" in input_devices', {
'sources': [
'<@(pomdog_library_directinput_sources)',
],
'link_settings': {
'libraries': [
'-ldinput8.lib',
'-ldxguid.lib',
],
},
}],
['application_platform == "X11"', {
'sources': [
'<@(pomdog_library_x11_sources)',
],
}],
['application_platform == "X11" and OS == "linux"', {
'defines': [
'GLEW_STATIC',
],
'dependencies': [
'<@(pomdog_third_party_dir)/glew/glew.gyp:glew_static',
],
'include_dirs': [
'/usr/X11R6/include',
'<@(pomdog_third_party_dir)/glew/include',
],
'library_dirs': [
'/usr/X11R6/lib',
],
'link_settings': {
'libraries': [
'-lX11',
'-lGL',
],
},
}],
['application_platform == "Cocoa"', {
'sources': [
'<@(pomdog_library_cocoa_sources)',
],
'link_settings': {
'libraries': [
'$(SDKROOT)/System/Library/Frameworks/Cocoa.framework',
'$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
'$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework',
],
},
}],
['OS == "mac" or OS == "ios"', {
'sources': [
'<@(pomdog_library_apple_sources)',
],
}],
['OS == "mac"', {
'xcode_settings': {
'MACOSX_DEPLOYMENT_TARGET': '10.9',
},
}],
['OS == "ios"', {
'xcode_settings': {
'IPHONEOS_DEPLOYMENT_TARGET': '9.0',
'SDKROOT': 'iphoneos',
},
'link_settings': {
'libraries': [
'$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
'$(SDKROOT)/System/Library/Frameworks/UIKit.framework',
],
},
}],
['OS == "win"', {
'sources': [
'<@(pomdog_library_win32_sources)',
],
'link_settings': {
'libraries': [
'-lkernel32.lib',
'-luser32.lib',
'-lgdi32.lib',
'-lole32.lib',
'-lwinmm.lib',
#'-lws2_32.lib',
#'-lwinspool.lib',
#'-lcomdlg32.lib',
#'-ladvapi32.lib',
'-lshell32.lib',
#'-loleaut32.lib',
#'-luuid.lib',
#'-lodbc32.lib',
#'-lodbccp32.lib',
],
},
}], # OS == "win"
['OS == "linux"', {
'sources': [
'<@(pomdog_library_linux_sources)',
],
}],
],
},
'targets': [
{
'target_name': 'pomdog-static',
'product_name': 'pomdog',
'type': 'static_library',
'xcode_settings': {
'SKIP_INSTALL': 'YES',
},
},
{
'target_name': 'pomdog-shared',
'product_name': 'Pomdog',
'type': 'shared_library',
'msvs_guid': 'A8F27BAE-660F-42B4-BC27-D5A435EF94BF',
'mac_bundle': 1,
'defines': ['POMDOG_BUILDING_LIBRARY_EXPORTS=1'],
'xcode_settings': {
'PRODUCT_NAME': 'Pomdog', #'$(TARGET_NAME)',
'PRODUCT_BUNDLE_IDENTIFIER': 'net.enginetrouble.pomdog',
'INFOPLIST_FILE': '../src/Platform.Apple/Info.plist',
'INSTALL_PATH': '$(LOCAL_LIBRARY_DIR)/Frameworks',
'SKIP_INSTALL': 'YES',
#'DEFINES_MODULE': 'YES',
'DYLIB_INSTALL_NAME_BASE': '@rpath',
'LD_RUNPATH_SEARCH_PATHS': [
'$(inherited)',
'@executable_path/../Frameworks',
'@loader_path/Frameworks',
],
},
},
],
}
| 41.362434 | 78 | 0.620979 | 2,803 | 31,270 | 6.813414 | 0.184802 | 0.118442 | 0.13991 | 0.066604 | 0.157765 | 0.053985 | 0.035868 | 0.030527 | 0.030527 | 0.029061 | 0 | 0.019883 | 0.19418 | 31,270 | 755 | 79 | 41.417219 | 0.738035 | 0.022418 | 0 | 0.223738 | 0 | 0 | 0.723656 | 0.649289 | 0 | 0 | 0 | 0 | 0.001364 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
878e2e53576e2b93158335b6f62791d259a663a0 | 186 | py | Python | output/models/ms_data/datatypes/facets/any_uri/any_uri_b002_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/ms_data/datatypes/facets/any_uri/any_uri_b002_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/ms_data/datatypes/facets/any_uri/any_uri_b002_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.ms_data.datatypes.facets.any_uri.any_uri_b002_xsd.any_uri_b002 import (
Bar,
Ct,
Root,
St,
)
__all__ = [
"Bar",
"Ct",
"Root",
"St",
]
| 13.285714 | 90 | 0.580645 | 26 | 186 | 3.730769 | 0.653846 | 0.185567 | 0.206186 | 0.226804 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.044118 | 0.268817 | 186 | 13 | 91 | 14.307692 | 0.669118 | 0 | 0 | 0 | 0 | 0 | 0.05914 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.083333 | 0 | 0.083333 | 0 | 1 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
878e9c375065b11c93ecd7ccacefc88bd6387185 | 3,476 | py | Python | tests/fixtures/statement_lists.py | TylerYep/wolfbot | 8d4786ce9542bab344b227e0571bb24bc354298d | [
"MIT"
] | 3 | 2018-06-16T00:03:30.000Z | 2021-12-26T20:48:45.000Z | tests/fixtures/statement_lists.py | TylerYep/wolfbot | 8d4786ce9542bab344b227e0571bb24bc354298d | [
"MIT"
] | null | null | null | tests/fixtures/statement_lists.py | TylerYep/wolfbot | 8d4786ce9542bab344b227e0571bb24bc354298d | [
"MIT"
] | 2 | 2021-03-03T09:31:35.000Z | 2021-03-03T10:02:55.000Z | import pytest
from wolfbot.enums import Role, SwitchPriority
from wolfbot.statements import Statement
@pytest.fixture(scope="session")
def example_statement() -> Statement:
return Statement(
"test",
((2, frozenset({Role.ROBBER})), (0, frozenset({Role.SEER}))),
((SwitchPriority.ROBBER, 2, 0),),
Role.ROBBER,
)
@pytest.fixture(scope="session")
def small_statement_list() -> tuple[Statement, ...]:
return (
Statement("I am a Villager.", ((0, frozenset({Role.VILLAGER})),)),
Statement(
"I am a Robber and I swapped with Player 2. I am now a Seer.",
((1, frozenset({Role.ROBBER})), (2, frozenset({Role.SEER}))),
((SwitchPriority.ROBBER, 1, 2),),
),
Statement(
"I am a Seer and I saw that Player 1 was a Robber.",
((2, frozenset({Role.SEER})), (1, frozenset({Role.ROBBER}))),
),
)
@pytest.fixture(scope="session")
def medium_statement_list() -> tuple[Statement, ...]:
return (
Statement(
"I am a Seer and I saw that Player 2 was a Drunk.",
((0, frozenset({Role.SEER})), (2, frozenset({Role.DRUNK}))),
),
Statement(
"I am a Seer and I saw that Player 3 was a Minion.",
((1, frozenset({Role.SEER})), (3, frozenset({Role.MINION}))),
),
Statement(
"I am a Drunk and I swapped with Center 0.",
((2, frozenset({Role.DRUNK})),),
((SwitchPriority.DRUNK, 2, 5),),
),
Statement(
"I am a Robber and I swapped with Player 2. I am now a Drunk.",
((3, frozenset({Role.ROBBER})), (2, frozenset({Role.DRUNK}))),
((SwitchPriority.ROBBER, 3, 2),),
),
Statement(
"I am a Seer and I saw that Player 1 was a Wolf.",
((4, frozenset({Role.SEER})), (1, frozenset({Role.WOLF}))),
),
)
@pytest.fixture(scope="session")
def large_statement_list() -> tuple[Statement, ...]:
return (
Statement(
"I am a Robber and I swapped with Player 6. I am now a Drunk.",
((0, frozenset({Role.ROBBER})), (6, frozenset({Role.DRUNK}))),
((SwitchPriority.ROBBER, 6, 0),),
),
Statement(
"I am a Robber and I swapped with Player 0. I am now a Seer.",
((1, frozenset({Role.ROBBER})), (0, frozenset({Role.SEER}))),
((SwitchPriority.ROBBER, 0, 1),),
),
Statement(
"I am a Seer and I saw that Player 3 was a Villager.",
((2, frozenset({Role.SEER})), (3, frozenset({Role.VILLAGER}))),
),
Statement("I am a Villager.", ((3, frozenset({Role.VILLAGER})),)),
Statement(
"I am a Mason. The other Mason is Player 5.",
((4, frozenset({Role.MASON})), (5, frozenset({Role.MASON}))),
),
Statement(
"I am a Mason. The other Mason is Player 4.",
((5, frozenset({Role.MASON})), (4, frozenset({Role.MASON}))),
),
Statement(
"I am a Drunk and I swapped with Center 1.",
((6, frozenset({Role.DRUNK})),),
((SwitchPriority.ROBBER, 9, 6),),
),
Statement(
"I am a Robber and I swapped with Player 5. I am now a Seer.",
((7, frozenset({Role.ROBBER})), (5, frozenset({Role.SEER}))),
((SwitchPriority.ROBBER, 5, 7),),
),
)
| 35.469388 | 75 | 0.52244 | 415 | 3,476 | 4.359036 | 0.127711 | 0.215589 | 0.106136 | 0.114981 | 0.833057 | 0.689331 | 0.561636 | 0.488115 | 0.456606 | 0.311774 | 0 | 0.025052 | 0.31099 | 3,476 | 97 | 76 | 35.835052 | 0.730271 | 0 | 0 | 0.397727 | 0 | 0 | 0.221807 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.045455 | true | 0 | 0.034091 | 0.045455 | 0.125 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
87930ac2ba2d5084ba1fa7dbb011e1fe84ad4946 | 399 | py | Python | shield.com/metahumans/validators.py | euribates/curso-django | 06f71a7d5b239e294c0cc6b3972861ed8d1c59d0 | [
"CC-BY-4.0"
] | 1 | 2020-04-14T11:08:11.000Z | 2020-04-14T11:08:11.000Z | shield.com/metahumans/validators.py | euribates/curso-django | 06f71a7d5b239e294c0cc6b3972861ed8d1c59d0 | [
"CC-BY-4.0"
] | null | null | null | shield.com/metahumans/validators.py | euribates/curso-django | 06f71a7d5b239e294c0cc6b3972861ed8d1c59d0 | [
"CC-BY-4.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from django.core.exceptions import ValidationError
def between_zero_and_one_hundred(value):
if value < 0 or value > 100:
raise ValidationError('El nivel de poder debe oscilar entre 0 y 100.')
| 26.6 | 78 | 0.774436 | 56 | 399 | 5.107143 | 0.696429 | 0.13986 | 0.223776 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.026786 | 0.157895 | 399 | 14 | 79 | 28.5 | 0.824405 | 0.095238 | 0 | 0 | 0 | 0 | 0.125698 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.625 | 0 | 0.75 | 0.125 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
87ae6a9d8005591fc2347c0f2c5ef9bc24403258 | 1,777 | py | Python | wis2box/metadata/base.py | webb-ben/wis2node | e577d2bea5524f74872f47eee9deb35d6c510460 | [
"Apache-2.0"
] | 7 | 2021-10-05T11:48:50.000Z | 2022-02-04T12:47:15.000Z | wis2box/metadata/base.py | webb-ben/wis2node | e577d2bea5524f74872f47eee9deb35d6c510460 | [
"Apache-2.0"
] | 47 | 2022-02-15T18:24:22.000Z | 2022-03-31T11:32:52.000Z | wis2box/metadata/base.py | webb-ben/wis2node | e577d2bea5524f74872f47eee9deb35d6c510460 | [
"Apache-2.0"
] | 3 | 2022-02-16T19:36:36.000Z | 2022-03-14T08:14:20.000Z | ###############################################################################
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
#
###############################################################################
import logging
from typing import Union
from pygeometa.core import read_mcf
LOGGER = logging.getLogger(__name__)
class BaseMetadata:
"""base metadata"""
def __init__(self):
pass
def generate(self, mcf: dict, schema: str = None) -> Union[dict, str]:
"""
Generate metadata in a given schema
:param mcf: `dict` of MCF file
:param schema: `str` of metadata schema to generate
:returns: `dict` or `str` of metadata representation
"""
raise NotImplementedError()
def parse_record(self, metadata_record: bytes) -> dict:
"""
Parses MCF metadata into dict
:param metadata_record: string of metadata
:return: `dict` of MCF
"""
LOGGER.debug('reading MCF')
return read_mcf(metadata_record)
| 30.118644 | 79 | 0.630838 | 216 | 1,777 | 5.125 | 0.518519 | 0.054201 | 0.023487 | 0.028907 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002855 | 0.211593 | 1,777 | 58 | 80 | 30.637931 | 0.787295 | 0.584693 | 0 | 0 | 0 | 0 | 0.023355 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0.083333 | 0.25 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
87ba433641ad537815e75200ac70b792bbb16c42 | 152 | py | Python | ai/bertpredict/urls.py | thdwlsgus0/relay_15 | b5cb66ca250afd5402b0f19c870fda1852b77a28 | [
"MIT"
] | 3 | 2020-08-07T05:35:28.000Z | 2020-08-10T00:48:11.000Z | ai/bertpredict/urls.py | thdwlsgus0/relay_15 | b5cb66ca250afd5402b0f19c870fda1852b77a28 | [
"MIT"
] | null | null | null | ai/bertpredict/urls.py | thdwlsgus0/relay_15 | b5cb66ca250afd5402b0f19c870fda1852b77a28 | [
"MIT"
] | 11 | 2020-07-28T00:45:51.000Z | 2020-11-22T18:34:52.000Z | from django.urls import path
from . import views
app_name = 'bertpredict'
urlpatterns = [
path('bertpredict/', views.BertPredictView.as_view()),
] | 19 | 58 | 0.730263 | 18 | 152 | 6.055556 | 0.722222 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.144737 | 152 | 8 | 59 | 19 | 0.838462 | 0 | 0 | 0 | 0 | 0 | 0.150327 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
87c130e031505973ff9591b6295aca73c9bc126b | 158 | py | Python | keycards/urls.py | oangervuori/namubufferi | b9353b1d1a32e18e93cb1e9bd2b591950d54269a | [
"MIT"
] | 2 | 2016-12-05T03:31:47.000Z | 2017-02-13T20:10:39.000Z | keycards/urls.py | oangervuori/namubufferi | b9353b1d1a32e18e93cb1e9bd2b591950d54269a | [
"MIT"
] | 1 | 2016-12-14T10:53:15.000Z | 2016-12-17T18:52:25.000Z | keycards/urls.py | oangervuori/namubufferi | b9353b1d1a32e18e93cb1e9bd2b591950d54269a | [
"MIT"
] | 1 | 2017-01-14T10:56:28.000Z | 2017-01-14T10:56:28.000Z | from django.urls import path
from . import views
app_name = "keycards"
urlpatterns = [
path(f"", views.KeycardLoginFormView.as_view(), name="login"),
]
| 17.555556 | 66 | 0.708861 | 20 | 158 | 5.5 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.151899 | 158 | 8 | 67 | 19.75 | 0.820896 | 0 | 0 | 0 | 0 | 0 | 0.082278 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
87e20d41ac964f6f9b382bbcfc612a4214737a5d | 114 | py | Python | env/Lib/site-packages/countdowntimer_model/apps.py | gtkacz/fantasytrashtalk | 24ed8ba6c4fae2eca5b15f66b62338a8c87debd2 | [
"MIT"
] | 4 | 2021-03-29T07:35:41.000Z | 2022-01-12T09:54:55.000Z | env/Lib/site-packages/countdowntimer_model/apps.py | gtkacz/fantasytrashtalk | 24ed8ba6c4fae2eca5b15f66b62338a8c87debd2 | [
"MIT"
] | 4 | 2020-08-06T14:51:06.000Z | 2021-09-22T18:53:50.000Z | env/Lib/site-packages/countdowntimer_model/apps.py | gtkacz/fantasytrashtalk | 24ed8ba6c4fae2eca5b15f66b62338a8c87debd2 | [
"MIT"
] | 3 | 2020-04-20T18:54:10.000Z | 2021-03-29T07:35:13.000Z | from django.apps import AppConfig
class CountdowntimerModelConfig(AppConfig):
name = 'countdowntimer_model'
| 19 | 43 | 0.807018 | 11 | 114 | 8.272727 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.131579 | 114 | 5 | 44 | 22.8 | 0.919192 | 0 | 0 | 0 | 0 | 0 | 0.175439 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
87e4b92785c35afe3fe916f48cd07afc7baed2fa | 33 | py | Python | pyble/const/characteristic/time_with_dst.py | bgromov/PyBLEWrapper | 8a5d016e65b3c259391ddc97c371ab4b1b5c61b5 | [
"MIT"
] | 14 | 2015-03-30T23:11:36.000Z | 2020-04-07T00:57:12.000Z | pyble/const/characteristic/time_with_dst.py | bgromov/PyBLEWrapper | 8a5d016e65b3c259391ddc97c371ab4b1b5c61b5 | [
"MIT"
] | 3 | 2016-05-17T06:11:07.000Z | 2017-05-15T16:43:09.000Z | pyble/const/characteristic/time_with_dst.py | bgromov/PyBLEWrapper | 8a5d016e65b3c259391ddc97c371ab4b1b5c61b5 | [
"MIT"
] | 11 | 2016-03-11T08:53:03.000Z | 2019-03-11T21:32:13.000Z | NAME="Time with DST"
UUID=0x2A11
| 11 | 20 | 0.757576 | 6 | 33 | 4.166667 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.137931 | 0.121212 | 33 | 2 | 21 | 16.5 | 0.724138 | 0 | 0 | 0 | 0 | 0 | 0.393939 | 0 | 0 | 0 | 0.181818 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
355571e66551b980f466860ffabf578c8cf61baa | 1,771 | py | Python | pulse2percept/datasets/tests/test_nanduri2012.py | narenberg/pulse2percept | ca3aaf66672ccf3c9ee6a9a9d924184cdc6f031d | [
"BSD-3-Clause"
] | 40 | 2019-11-01T14:09:34.000Z | 2022-02-28T19:08:01.000Z | pulse2percept/datasets/tests/test_nanduri2012.py | narenberg/pulse2percept | ca3aaf66672ccf3c9ee6a9a9d924184cdc6f031d | [
"BSD-3-Clause"
] | 277 | 2019-11-22T03:30:31.000Z | 2022-03-28T00:11:03.000Z | pulse2percept/datasets/tests/test_nanduri2012.py | narenberg/pulse2percept | ca3aaf66672ccf3c9ee6a9a9d924184cdc6f031d | [
"BSD-3-Clause"
] | 31 | 2020-01-22T06:36:36.000Z | 2022-01-20T09:54:25.000Z | import pandas as pd
import numpy.testing as npt
from pulse2percept.datasets import load_nanduri2012
def test_load_nanduri2012():
data = load_nanduri2012(shuffle=False)
npt.assert_equal(isinstance(data, pd.DataFrame), True)
columns = ['subject', 'implant', 'electrode', 'task', 'stim_class',
'freq', 'amp_factor', 'ref_stim_class', 'ref_amp_factor',
'ref_freq', 'brightness', 'size', 'pulse_dur',
'interphase_dur', 'pulse_type', 'varied_param']
for expected_col in columns:
npt.assert_equal(expected_col in data.columns, True)
npt.assert_equal(data.shape, (128, 17))
npt.assert_equal(data.subject.unique(), ['S06'])
# Shuffle dataset (index will always be range(552), but rows are shuffled):
data = load_nanduri2012(shuffle=True, random_state=42)
npt.assert_equal(data.loc[0, 'subject'], 'S06')
npt.assert_equal(data.loc[0, 'electrode'], 'B1')
npt.assert_equal(data.loc[94, 'subject'], 'S06')
npt.assert_equal(data.loc[94, 'electrode'], 'A4')
# Select electrodes:
data = load_nanduri2012(electrodes='A2')
npt.assert_equal(data.shape, (16, 17))
npt.assert_equal(data.electrode.unique(), 'A2')
npt.assert_equal(data.subject.unique(), 'S06')
data = load_nanduri2012(electrodes=['A1', 'A9']) # 'A9' doesn't exist
npt.assert_equal(data.shape, (0, 17))
npt.assert_equal(data.electrode.unique(), 'A1')
npt.assert_equal(data.subject.unique(), 'S06')
# Select task
data = load_nanduri2012(task='rate')
npt.assert_equal(data.shape, (88, 17))
npt.assert_equal(data.task.unique(), 'rate')
data = load_nanduri2012(task='size')
npt.assert_equal(data.shape, (40, 17))
npt.assert_equal(data.task.unique(), 'size')
| 39.355556 | 79 | 0.671372 | 239 | 1,771 | 4.803347 | 0.338912 | 0.141115 | 0.219512 | 0.250871 | 0.40331 | 0.297909 | 0.256098 | 0 | 0 | 0 | 0 | 0.055744 | 0.169396 | 1,771 | 44 | 80 | 40.25 | 0.724677 | 0.069452 | 0 | 0.060606 | 0 | 0 | 0.135727 | 0 | 0 | 0 | 0 | 0 | 0.545455 | 1 | 0.030303 | false | 0 | 0.090909 | 0 | 0.121212 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
356d07de30049e8cf0f6aad0e41acef8b5f0d9cb | 1,291 | py | Python | ingenico/connect/sdk/domain/product/device_fingerprint_request.py | festicket/connect-sdk-python3 | c399c6443789dd978f319c89e1ebd387c812a77b | [
"MIT"
] | 12 | 2016-09-26T21:46:31.000Z | 2020-12-23T18:44:54.000Z | ingenico/connect/sdk/domain/product/device_fingerprint_request.py | festicket/connect-sdk-python3 | c399c6443789dd978f319c89e1ebd387c812a77b | [
"MIT"
] | 3 | 2020-05-02T16:53:02.000Z | 2020-06-02T12:49:51.000Z | ingenico/connect/sdk/domain/product/device_fingerprint_request.py | festicket/connect-sdk-python3 | c399c6443789dd978f319c89e1ebd387c812a77b | [
"MIT"
] | 11 | 2017-07-16T00:55:28.000Z | 2021-09-24T17:00:49.000Z | # -*- coding: utf-8 -*-
#
# This class was auto-generated from the API references found at
# https://epayments-api.developer-ingenico.com/s2sapi/v1/
#
from ingenico.connect.sdk.data_object import DataObject
class DeviceFingerprintRequest(DataObject):
__collector_callback = None
@property
def collector_callback(self):
"""
| You can supply a JavaScript function call that will be called after the device fingerprint data collecting using the provided JavaScript snippet is finished. This will then be added to the snippet that is returned in the property html.
Type: str
"""
return self.__collector_callback
@collector_callback.setter
def collector_callback(self, value):
self.__collector_callback = value
def to_dictionary(self):
dictionary = super(DeviceFingerprintRequest, self).to_dictionary()
if self.collector_callback is not None:
dictionary['collectorCallback'] = self.collector_callback
return dictionary
def from_dictionary(self, dictionary):
super(DeviceFingerprintRequest, self).from_dictionary(dictionary)
if 'collectorCallback' in dictionary:
self.collector_callback = dictionary['collectorCallback']
return self
| 34.891892 | 245 | 0.7134 | 144 | 1,291 | 6.256944 | 0.486111 | 0.169811 | 0.116537 | 0.053274 | 0.126526 | 0.126526 | 0 | 0 | 0 | 0 | 0 | 0.002964 | 0.216112 | 1,291 | 36 | 246 | 35.861111 | 0.887352 | 0.302091 | 0 | 0 | 1 | 0 | 0.05951 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.210526 | false | 0 | 0.052632 | 0 | 0.526316 | 0.157895 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
357015263198b1279e9ef9410456f9db3904f6f9 | 559 | py | Python | print_dict_results.py | ofirtal/alice_google_wordcount | 0a0d648e688b80c3f34fd0250ae464bcd5d0de05 | [
"Apache-2.0"
] | 1 | 2020-09-29T03:08:35.000Z | 2020-09-29T03:08:35.000Z | print_dict_results.py | ofirtal/alice_google_wordcount | 0a0d648e688b80c3f34fd0250ae464bcd5d0de05 | [
"Apache-2.0"
] | null | null | null | print_dict_results.py | ofirtal/alice_google_wordcount | 0a0d648e688b80c3f34fd0250ae464bcd5d0de05 | [
"Apache-2.0"
] | null | null | null | class PrintDictResults:
def __init__(self, dict_of_sorted_words):
self.list_of_sorted_words = dict_of_sorted_words
def print_items(self, counter):
print(f'{counter + 1}. "{self.list_of_sorted_words[counter][1]}" : {self.list_of_sorted_words[counter][0]}')
def get_all_words(self):
for item in self.list_of_sorted_words:
self.print_items((self.list_of_sorted_words.index(item)))
def get_top(self, number_of_wanted_items):
for i in range(0, number_of_wanted_items):
self.print_items(i)
| 37.266667 | 116 | 0.697674 | 85 | 559 | 4.152941 | 0.317647 | 0.15864 | 0.25779 | 0.226629 | 0.362606 | 0.184136 | 0.184136 | 0.184136 | 0 | 0 | 0 | 0.008869 | 0.193202 | 559 | 14 | 117 | 39.928571 | 0.773836 | 0 | 0 | 0 | 0 | 0.090909 | 0.175313 | 0.143113 | 0 | 0 | 0 | 0 | 0 | 1 | 0.363636 | false | 0 | 0 | 0 | 0.454545 | 0.363636 | 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 | 0 | 0 | 0 | 0 | 3 |
3575f69fbe1be7943d3fbe746ae637c360e21a03 | 1,103 | py | Python | controllers/api_error.py | elandcloud/python-api | fcdc0abe3e3273d5ec0aac6b9bdefbf00ca0f58b | [
"Apache-2.0"
] | null | null | null | controllers/api_error.py | elandcloud/python-api | fcdc0abe3e3273d5ec0aac6b9bdefbf00ca0f58b | [
"Apache-2.0"
] | 1 | 2021-03-31T19:27:16.000Z | 2021-03-31T19:27:16.000Z | controllers/api_error.py | elandcloud/python-api | fcdc0abe3e3273d5ec0aac6b9bdefbf00ca0f58b | [
"Apache-2.0"
] | 1 | 2020-01-02T02:33:39.000Z | 2020-01-02T02:33:39.000Z | from controllers.type_result import Error
def unknownError(err):
return Error(10001,"Unknown error",err)
def invalidParamError(field,condition,err):
return Error(10007, "Invalid field(%s: %s)"%(field, condition), err)
def parameterParsingError(err):
return Error(10008, "Parameter parsing error", err)
def missRequiredParamError(v):
return Error(10009,"'%s' is required parameter" % (v), None)
def notFoundError():
return Error(10010, "Resource is not found", None)
def notAuthorizedError():
return Error(10011, "Resource is not authorized", None)
def notAuthorizedActionError():
return Error(10012, "Action is not authorized", None)
def statusError(v):
return Error(10013, "'%s', Status not Allowed"% (v), None)
def notUpdatedError():
return Error(10014, "Resource is not updated", None)
def notDeletedError():
return Error(10015, "Resource is not deleted", None)
def notCreatedError():
return Error(10016, "Resource is not created", None)
def invalidFieldError(field):
return Error(10018, "Invalid fields [ %v ]" % field, None)
# print(statusError(111).code) | 26.902439 | 72 | 0.728921 | 139 | 1,103 | 5.776978 | 0.417266 | 0.164384 | 0.080946 | 0.047323 | 0.054795 | 0 | 0 | 0 | 0 | 0 | 0 | 0.066526 | 0.141432 | 1,103 | 41 | 73 | 26.902439 | 0.781415 | 0.025385 | 0 | 0 | 0 | 0 | 0.249534 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.48 | false | 0 | 0.04 | 0.48 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
3580446fc9f2895b65f629897e85da7d65bcfe94 | 149 | py | Python | project_pawz/sponsorships/apps.py | rlaneyjr/project_pawz | 27f316ef35968ed1319ec0585a050ebed795763a | [
"MIT"
] | null | null | null | project_pawz/sponsorships/apps.py | rlaneyjr/project_pawz | 27f316ef35968ed1319ec0585a050ebed795763a | [
"MIT"
] | 13 | 2020-02-12T00:12:52.000Z | 2022-02-12T09:42:36.000Z | project_pawz/sponsorships/apps.py | rlaneyjr/project_pawz | 27f316ef35968ed1319ec0585a050ebed795763a | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class SponsorshipsAppConfig(AppConfig):
name = 'project_pawz.sponsorships'
verbose_name = "Sponsorships"
| 21.285714 | 39 | 0.778523 | 15 | 149 | 7.6 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.147651 | 149 | 6 | 40 | 24.833333 | 0.897638 | 0 | 0 | 0 | 0 | 0 | 0.248322 | 0.167785 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
3591df80ea06a09fcf32bb3e38ed7f6312abf19d | 389 | py | Python | fabric/exceptions.py | lin-zh-cn/fabric | fd60d7e3d31eeddc2b90cfe367a573aff9f0540d | [
"BSD-2-Clause"
] | 1 | 2016-05-17T19:04:42.000Z | 2016-05-17T19:04:42.000Z | fabric/exceptions.py | offbyone/fabric | 4b1cd1f1326deee75d8699161e12d2da0cb09a1d | [
"BSD-2-Clause"
] | null | null | null | fabric/exceptions.py | offbyone/fabric | 4b1cd1f1326deee75d8699161e12d2da0cb09a1d | [
"BSD-2-Clause"
] | null | null | null | # TODO: this may want to move to Invoke if we can find a use for it there too?
# Or make it _more_ narrowly focused and stay here?
class NothingToDo(Exception):
pass
class GroupException(Exception):
"""
Lightweight exception wrapper for `.GroupResult` when one contains errors.
.. versionadded:: 2.0
"""
def __init__(self, result):
self.result = result
| 24.3125 | 78 | 0.686375 | 53 | 389 | 4.924528 | 0.830189 | 0.076628 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006689 | 0.231362 | 389 | 15 | 79 | 25.933333 | 0.866221 | 0.578406 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.066667 | 0 | 1 | 0.2 | false | 0.2 | 0 | 0 | 0.6 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
35a03d99d3719963febefb8c4a03a9c25373c377 | 17,650 | py | Python | tests/test_lccv.py | fmohr/llcv | 22ba7b9712397f750150ed7e793245b5a0ae3fdf | [
"BSD-3-Clause"
] | 3 | 2021-11-30T18:58:58.000Z | 2022-03-07T20:40:41.000Z | tests/test_lccv.py | fmohr/llcv | 22ba7b9712397f750150ed7e793245b5a0ae3fdf | [
"BSD-3-Clause"
] | null | null | null | tests/test_lccv.py | fmohr/llcv | 22ba7b9712397f750150ed7e793245b5a0ae3fdf | [
"BSD-3-Clause"
] | null | null | null | import logging
import lccv
import numpy as np
import sklearn.datasets
from sklearn import *
import unittest
from parameterized import parameterized
import itertools as it
import time
from sklearn.experimental import enable_hist_gradient_boosting # noqa
import openml
import pandas as pd
def get_dataset(openmlid):
ds = openml.datasets.get_dataset(openmlid)
df = ds.get_data()[0].dropna()
y = df[ds.default_target_attribute].values
categorical_attributes = df.select_dtypes(exclude=['number']).columns
expansion_size = 1
for att in categorical_attributes:
expansion_size *= len(pd.unique(df[att]))
if expansion_size > 10**5:
break
if expansion_size < 10**5:
X = pd.get_dummies(df[[c for c in df.columns if c != ds.default_target_attribute]]).values.astype(float)
else:
print("creating SPARSE data")
dfSparse = pd.get_dummies(df[[c for c in df.columns if c != ds.default_target_attribute]], sparse=True)
print("dummies created, now creating sparse matrix")
X = lil_matrix(dfSparse.shape, dtype=np.float32)
for i, col in enumerate(dfSparse.columns):
ix = dfSparse[col] != 0
X[np.where(ix), i] = 1
print("Done. shape is" + str(X.shape))
return X, y
class TestLccv(unittest.TestCase):
preprocessors = [None, sklearn.preprocessing.RobustScaler, sklearn.kernel_approximation.RBFSampler]
learners = [sklearn.svm.LinearSVC, sklearn.tree.DecisionTreeClassifier, sklearn.tree.ExtraTreeClassifier, sklearn.linear_model.LogisticRegression, sklearn.linear_model.PassiveAggressiveClassifier, sklearn.linear_model.Perceptron, sklearn.linear_model.RidgeClassifier, sklearn.linear_model.SGDClassifier, sklearn.neural_network.MLPClassifier, sklearn.discriminant_analysis.LinearDiscriminantAnalysis, sklearn.discriminant_analysis.QuadraticDiscriminantAnalysis, sklearn.naive_bayes.BernoulliNB, sklearn.naive_bayes.MultinomialNB, sklearn.neighbors.KNeighborsClassifier, sklearn.ensemble.ExtraTreesClassifier, sklearn.ensemble.RandomForestClassifier, sklearn.ensemble.GradientBoostingClassifier, sklearn.ensemble.GradientBoostingClassifier, sklearn.ensemble.HistGradientBoostingClassifier]
def setUpClass():
# setup logger for this test suite
logger = logging.getLogger('lccv_test')
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter(
'%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)
logger.addHandler(ch)
# configure lccv logger (by default set to WARN, change it to DEBUG if tests fail)
lccv_logger = logging.getLogger("lccv")
lccv_logger.setLevel(logging.INFO)
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
formatter = logging.Formatter(
'%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)
lccv_logger.addHandler(ch)
def setUp(self):
self.logger = logging.getLogger("lccv_test")
self.lccv_logger = logging.getLogger("lccv")
def test_partition_train_test_data(self):
self.logger.info("Start Test on Partitioning")
features, labels = sklearn.datasets.load_iris(return_X_y=True)
for seed in [0, 1, 2, 3, 4, 5]:
self.logger.info(f"Run test for seed {seed}")
n_te = 32
n_tr = 150 - n_te
f_tr, l_tr, f_te, l_te = lccv._partition_train_test_data(
features, labels, n_te, seed)
# check correct sizes
self.assertEqual(f_tr.shape, (n_tr, 4))
self.assertEqual(l_tr.shape, (n_tr, ))
self.assertEqual(f_te.shape, (n_te, 4))
self.assertEqual(l_te.shape, (n_te, ))
# assume exact same test set, also when train set is double
f_tr2, l_tr2, f_te2, l_te2 = lccv._partition_train_test_data(
features, labels, n_te, seed)
np.testing.assert_array_equal(f_te, f_te2)
np.testing.assert_array_equal(l_te, l_te2)
np.testing.assert_array_equal(f_tr, f_tr2)
np.testing.assert_array_equal(l_tr, l_tr2)
self.logger.info(f"Finished test for seed {seed}")
def test_lccv_normal_function(self):
features, labels = sklearn.datasets.load_iris(return_X_y=True)
learner = sklearn.tree.DecisionTreeClassifier(random_state=42)
self.logger.info(f"Starting test of LCCV on {learner.__class__.__name__}")
_, _, res, _ = lccv.lccv(learner, features, labels, base=2, min_exp=4, enforce_all_anchor_evaluations=True, logger=self.lccv_logger)
self.assertSetEqual(set(res.keys()), {16, 32, 64, 128, 135})
for key, val in res.items():
self.logger.info(f"Key: {key}, Val: {val}")
self.assertFalse(np.isnan(val['conf'][0]))
self.assertFalse(np.isnan(val['conf'][1]))
self.logger.info(f"Finished test of LCCV on {learner.__class__.__name__}")
def test_lccv_all_points_finish(self):
features, labels = sklearn.datasets.load_iris(return_X_y=True)
learner = sklearn.tree.DecisionTreeClassifier(random_state=42)
self.logger.info(f"Starting test of LCCV on {learner.__class__.__name__}")
_, _, res, _ = lccv.lccv(learner, features, labels, r=0.05, base=2, min_exp=4, enforce_all_anchor_evaluations=True, logger=self.lccv_logger)
self.assertSetEqual(set(res.keys()), {16, 32, 64, 128, 135})
for key, val in res.items():
self.logger.info(f"Key: {key}, Val: {val}")
self.assertFalse(np.isnan(val['conf'][0]))
self.assertFalse(np.isnan(val['conf'][1]))
self.logger.info(f"Finished test of LCCV on {learner.__class__.__name__}")
def test_lccv_all_points_skipped(self):
features, labels = sklearn.datasets.load_iris(return_X_y=True)
learner = sklearn.tree.DecisionTreeClassifier(random_state=42)
self.logger.info(f"Starting test of LCCV on {learner.__class__.__name__}")
_, _, res, _ = lccv.lccv(learner, features, labels, r=0.05, base=2, min_exp=4, enforce_all_anchor_evaluations=False, logger=self.lccv_logger)
self.assertSetEqual(set(res.keys()), {16, 32, 64, 135})
for key, val in res.items():
self.logger.info(f"Key: {key}, Val: {val}")
self.assertFalse(np.isnan(val['conf'][0]))
self.assertFalse(np.isnan(val['conf'][1]))
self.logger.info(f"Finished test of LCCV on {learner.__class__.__name__}")
def test_lccv_pruning(self):
features, labels = sklearn.datasets.load_digits(return_X_y=True)
learner = sklearn.tree.DecisionTreeClassifier(random_state=42)
self.logger.info(f"Starting test of LCCV on {learner.__class__.__name__}")
_, _, res, _ = lccv.lccv(learner, features, labels, r=-0.5, base=2, min_exp=4, enforce_all_anchor_evaluations=True, logger=self.lccv_logger)
self.assertSetEqual(set(res.keys()), {16, 32, 64})
for key, val in res.items():
self.logger.info(f"Key: {key}, Val: {val}")
self.assertFalse(np.isnan(val['conf'][0]))
self.assertFalse(np.isnan(val['conf'][1]))
self.logger.info(f"Finished test of LCCV on {learner.__class__.__name__}")
"""
This test checks whether the results are equivalent to a 5CV or 10CV
"""
@parameterized.expand(list(it.product(preprocessors, learners, [1464])))#[61])))
def test_lccv_runtime_and_result_bare(self, preprocessor, learner, dataset):
X, y = get_dataset(dataset)
self.logger.info(f"Start Test LCCV when running with r=1.0 on dataset {dataset}")
# configure pipeline
steps = []
if preprocessor is not None:
pp = preprocessor()
if "copy" in pp.get_params().keys():
pp = preprocessor(copy=False)
steps.append(("pp", pp))
learner_inst = learner()
if "warm_start" in learner_inst.get_params().keys(): # active warm starting if available, because this can cause problems.
learner_inst = learner(warm_start=True)
steps.append(("predictor", learner_inst))
pl = sklearn.pipeline.Pipeline(steps)
# do tests
try:
# run 5-fold CV
self.logger.info("Running 5CV")
start = time.time()
score_5cv = 1 - np.mean(sklearn.model_selection.cross_validate(sklearn.base.clone(pl), X, y, cv=5)["test_score"])
end = time.time()
runtime_5cv = end - start
self.logger.info(f"Finished 5CV within {runtime_5cv}s.")
# run 80lccv
self.logger.info("Running 80LCCV")
start = time.time()
score_80lccv = lccv.lccv(sklearn.base.clone(pl), X, y, target_anchor=.8, MAX_EVALUATIONS=5)[0]
end = time.time()
runtime_80lccv = end - start
self.logger.info(f"Finished 80LCCV within {runtime_80lccv}s. Runtime diff was {np.round(runtime_5cv - runtime_80lccv, 1)}s. Performance diff was {np.round(score_5cv - score_80lccv, 2)}.")
# check runtime and result
tol = 0.1#0.05 if dataset != 61 else 0.1
self.assertTrue(runtime_80lccv <= (runtime_5cv + 1), msg=f"Runtime of 80lccv was {runtime_80lccv}, which is more than the {runtime_5cv} of 5CV. Pipeline was {pl} and dataset {dataset}")
self.assertTrue(np.abs(score_5cv - score_80lccv) <= tol, msg=f"Avg Score of 80lccv was {score_80lccv}, which deviates by more than {tol} from the {score_5cv} of 5CV. Pipeline was {pl} and dataset {dataset}")
# run 10-fold CV
self.logger.info("Running 10CV")
start = time.time()
score_10cv = 1 - np.mean(sklearn.model_selection.cross_validate(sklearn.base.clone(pl), X, y, cv=10)["test_score"])
end = time.time()
runtime_10cv = end - start
self.logger.info(f"Finished 10CV within {runtime_10cv}s.")
# run 90lccv
self.logger.info("Running 90LCCV")
start = time.time()
score_90lccv = lccv.lccv(sklearn.base.clone(pl), X, y, target_anchor=.9)[0]
end = time.time()
runtime_90lccv = end - start
self.logger.info(f"Finished 90LCCV within {runtime_90lccv}s. Runtime diff was {np.round(runtime_10cv - runtime_90lccv, 1)}s. Performance diff was {np.round(score_10cv - score_90lccv, 2)}.")
# check runtime and result
tol = .1# 0.05 if dataset != 61 else 0.1
self.assertTrue(runtime_90lccv <= runtime_10cv + 1, msg=f"Runtime of 90lccv was {runtime_90lccv}, which is more than the {runtime_10cv} of 10CV. Pipeline was {pl} and dataset {dataset}")
self.assertTrue(np.abs(score_10cv - score_90lccv) <= tol, msg=f"Avg Score of 90lccv was {score_90lccv}, which deviates by more than {tol} from the {score_10cv} of 10CV. Pipeline was {pl} and dataset {dataset}")
except ValueError:
print("Skipping case in which training is not possible!")
"""
This test checks whether the results are equivalent to a 5CV or 10CV
"""
@parameterized.expand(list(it.product(preprocessors, learners, [(61, 0.0), (1485, 0.2)])))
def test_lccv_runtime_and_result_applied(self, preprocessor, learner, dataset):
X, y = get_dataset(dataset[0])
r = dataset[1]
self.logger.info(f"Start Test LCCV when running with r={r} on dataset {dataset[0]} wither preprocessor {preprocessor} and learner {learner}")
# configure pipeline
steps = []
if preprocessor is not None:
pp = preprocessor()
if "copy" in pp.get_params().keys():
pp = preprocessor(copy=False)
steps.append(("pp", pp))
learner_inst = learner()
if "warm_start" in learner_inst.get_params().keys(): # active warm starting if available, because this can cause problems.
learner_inst = learner(warm_start=True)
steps.append(("predictor", learner_inst))
pl = sklearn.pipeline.Pipeline(steps)
# do tests
try:
# run 5-fold CV
self.logger.info("Running 5CV")
start = time.time()
score_5cv = 1 - np.mean(sklearn.model_selection.cross_validate(sklearn.base.clone(pl), X, y, cv=5)["test_score"])
end = time.time()
runtime_5cv = end - start
self.logger.info(f"Finished 5CV within {round(runtime_5cv, 2)}s with score {np.round(score_5cv, 3)}.")
# run 80lccv
self.logger.info("Running 80LCCV")
start = time.time()
score_80lccv = lccv.lccv(sklearn.base.clone(pl), X, y, r=r, target_anchor=.8, MAX_EVALUATIONS=5)[0]
end = time.time()
runtime_80lccv = end - start
self.logger.info(f"Finished 80LCCV within {round(runtime_80lccv, 2)}s with score {np.round(score_80lccv, 3)}. Runtime diff was {np.round(runtime_5cv - runtime_80lccv, 1)}s. Performance diff was {np.round(score_5cv - score_80lccv, 2)}.")
# check runtime and result
tol = 0.05 if dataset != 61 else 0.1
self.assertTrue(runtime_80lccv <= 2 * (runtime_5cv + 1), msg=f"Runtime of 80lccv was {runtime_80lccv}, which is more than the {runtime_5cv} of 5CV. Pipeline was {pl}")
if np.isnan(score_80lccv):
self.assertTrue(score_5cv > r, msg=f"80lccv returned nan even though the {score_5cv} of 10CV is not worse than the threshold {r}. Pipeline was {pl} and dataset {dataset}")
else:
self.assertTrue(np.abs(score_5cv - score_80lccv) <= tol, msg=f"Avg Score of 80lccv was {score_80lccv}, which deviates by more than {tol} from the {score_5cv} of 5CV. Pipeline was {pl} and dataset {dataset}")
# run 10-fold CV
self.logger.info("Running 10CV")
start = time.time()
score_10cv = 1 - np.mean(sklearn.model_selection.cross_validate(sklearn.base.clone(pl), X, y, cv=10)["test_score"])
end = time.time()
runtime_10cv = end - start
self.logger.info(f"Finished 10CV within {round(runtime_10cv, 2)}s with score {np.round(score_10cv, 3)}")
# run 90lccv
self.logger.info("Running 90LCCV")
start = time.time()
score_90lccv = lccv.lccv(sklearn.base.clone(pl), X, y, r=r, target_anchor=.9)[0]
end = time.time()
runtime_90lccv = end - start
self.logger.info(f"Finished 90LCCV within {round(runtime_90lccv, 2)}s with score {np.round(score_90lccv, 3)}. Runtime diff was {np.round(runtime_10cv - runtime_90lccv, 1)}s. Performance diff was {np.round(score_10cv - score_90lccv, 2)}.")
# check runtime and result
tol = 0.05 if dataset != 61 else 0.1
self.assertTrue(runtime_90lccv <= 2 * (runtime_10cv + 1), msg=f"Runtime of 90lccv was {runtime_90lccv}, which is more than the {runtime_10cv} of 10CV. Pipeline was {pl}")
if np.isnan(score_90lccv):
self.assertTrue(score_10cv > r, msg=f"90lccv returned nan even though the {score_10cv} of 10CV is not worse than the threshold {r}. Pipeline was {pl} and dataset {dataset}")
else:
self.assertTrue(np.abs(score_10cv - score_90lccv) <= tol, msg=f"Avg Score of 90lccv was {score_90lccv}, which deviates by more than {tol} from the {score_10cv} of 10CV. Pipeline was {pl} and dataset {dataset}")
except ValueError:
print("Skipping case in which training is not possible!")
"""
This checks whether LCCV respects the timeout
"""
@parameterized.expand(list(it.product(preprocessors, learners, [(61, 0.0), (1485, 0.2)])))
def test_lccv_respects_timeouts(self, preprocessor, learner, dataset):
X, y = get_dataset(dataset[0])
r = dataset[1]
self.logger.info(f"Start Test LCCV when running with r={r} on dataset {dataset[0]} wither preprocessor {preprocessor} and learner {learner}")
# configure pipeline
steps = []
if preprocessor is not None:
pp = preprocessor()
if "copy" in pp.get_params().keys():
pp = preprocessor(copy=False)
steps.append(("pp", pp))
learner_inst = learner()
if "warm_start" in learner_inst.get_params().keys(): # active warm starting if available, because this can cause problems.
learner_inst = learner(warm_start=True)
steps.append(("predictor", learner_inst))
pl = sklearn.pipeline.Pipeline(steps)
timeout = 1.5
# do tests
try:
# run 80lccv
self.logger.info("Running 80LCCV")
start = time.time()
score_80lccv = lccv.lccv(sklearn.base.clone(pl), X, y, r=r, target_anchor=.8, MAX_EVALUATIONS=5, timeout=timeout)[0]
end = time.time()
runtime_80lccv = end - start
self.assertTrue(runtime_80lccv <= timeout, msg=f"Permitted runtime exceeded. Permitted was {timeout}s but true runtime was {runtime_80lccv}")
except ValueError:
print("Skipping case in which training is not possible!") | 53.810976 | 791 | 0.634051 | 2,324 | 17,650 | 4.659639 | 0.136403 | 0.033244 | 0.045249 | 0.034629 | 0.770708 | 0.743651 | 0.711054 | 0.699603 | 0.699603 | 0.691661 | 0 | 0.034415 | 0.250935 | 17,650 | 328 | 792 | 53.810976 | 0.784661 | 0.043343 | 0 | 0.572 | 0 | 0.072 | 0.234501 | 0.02534 | 0 | 0 | 0 | 0 | 0.124 | 1 | 0.044 | false | 0.004 | 0.048 | 0 | 0.108 | 0.024 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
35a69bb4fad1c93931ffcca42ca3cfdb048e79fa | 160 | py | Python | signalwire/relay/messaging/send_result.py | ramarketing/signalwire-python | c0663bdd0454faaa39f42af7c936cea1d43e1842 | [
"MIT"
] | 23 | 2018-12-19T14:48:18.000Z | 2022-01-11T03:58:36.000Z | signalwire/relay/messaging/send_result.py | ramarketing/signalwire-python | c0663bdd0454faaa39f42af7c936cea1d43e1842 | [
"MIT"
] | 13 | 2018-10-17T12:57:54.000Z | 2021-09-01T21:46:01.000Z | signalwire/relay/messaging/send_result.py | ramarketing/signalwire-python | c0663bdd0454faaa39f42af7c936cea1d43e1842 | [
"MIT"
] | 12 | 2020-01-21T14:29:43.000Z | 2022-01-11T07:48:06.000Z | class SendResult:
def __init__(self, result={}):
self.successful = result.get('code', None) == '200'
self.message_id = result.get('message_id', None)
| 32 | 55 | 0.66875 | 21 | 160 | 4.809524 | 0.619048 | 0.178218 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.022222 | 0.15625 | 160 | 4 | 56 | 40 | 0.725926 | 0 | 0 | 0 | 0 | 0 | 0.10625 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
35c12c665a38adb43714ee6a7e812bc5fee89003 | 325 | py | Python | tests/test_engine.py | znhv/winsio | 4d4e69961285ea3dcebc5ad6358e2d753d6b4f9d | [
"MIT"
] | null | null | null | tests/test_engine.py | znhv/winsio | 4d4e69961285ea3dcebc5ad6358e2d753d6b4f9d | [
"MIT"
] | null | null | null | tests/test_engine.py | znhv/winsio | 4d4e69961285ea3dcebc5ad6358e2d753d6b4f9d | [
"MIT"
] | null | null | null | import unittest.mock as mock
import pytest
from brainstorm.scripts import engine
from brainstorm.games import calc
# def test_player_ready(monkeypatch):
# with monkeypatch.context() as m:
# m.setattr('builtins.input', lambda prompt="": "y")
# result = engine.player_ready()
# assert result is True
| 25 | 60 | 0.707692 | 42 | 325 | 5.404762 | 0.690476 | 0.123348 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.193846 | 325 | 12 | 61 | 27.083333 | 0.866412 | 0.603077 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
35cadb5be4b90796980534e95cf42d32733a5cb1 | 875 | py | Python | apps/payroll/models/employee.py | youssriaboelseod/pyerp | 9ef9873e2ff340010656f0c518bccf9d7a14dbaa | [
"MIT"
] | 115 | 2019-08-18T16:12:54.000Z | 2022-03-29T14:17:20.000Z | apps/payroll/models/employee.py | youssriaboelseod/pyerp | 9ef9873e2ff340010656f0c518bccf9d7a14dbaa | [
"MIT"
] | 22 | 2019-09-09T01:34:54.000Z | 2022-03-12T00:33:40.000Z | apps/payroll/models/employee.py | youssriaboelseod/pyerp | 9ef9873e2ff340010656f0c518bccf9d7a14dbaa | [
"MIT"
] | 83 | 2019-08-17T17:09:20.000Z | 2022-03-25T04:46:53.000Z | # Django Library
from django.contrib.auth.models import User
from django.db import models
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
# Thirdparty Library
from apps.base.models import PyFather
# Tabla de Empleados
class PyEmployee(PyFather):
name = models.CharField('Nombre', max_length=80)
name2 = models.CharField('Segundo Nombre', max_length=80, blank=True)
first_name = models.CharField('Apellido Paterno', max_length=80, blank=True)
last_name = models.CharField('Apellido Materno', max_length=80, blank=True)
phone = models.CharField('Teléfono', max_length=20, blank=True)
email = models.CharField('Correo', max_length=40, blank=True)
def get_absolute_url(self):
return reverse('payroll:employee-detail', kwargs={'pk': self.pk})
def __str__(self):
return format(self.name)
| 35 | 80 | 0.742857 | 119 | 875 | 5.327731 | 0.495798 | 0.141956 | 0.069401 | 0.07571 | 0.094637 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017426 | 0.147429 | 875 | 24 | 81 | 36.458333 | 0.83244 | 0.059429 | 0 | 0 | 0 | 0 | 0.111111 | 0.028083 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.3125 | 0.125 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 3 |
35df05205df26d9b8705fd6ac8ad49277f753502 | 752 | py | Python | mailmerge/smtp_dummy.py | Denzeldeveloper/Python-Auto-MailMerge- | 4df95a67ef1b1c0f79a09f6c1c373b81d4220822 | [
"MIT"
] | null | null | null | mailmerge/smtp_dummy.py | Denzeldeveloper/Python-Auto-MailMerge- | 4df95a67ef1b1c0f79a09f6c1c373b81d4220822 | [
"MIT"
] | null | null | null | mailmerge/smtp_dummy.py | Denzeldeveloper/Python-Auto-MailMerge- | 4df95a67ef1b1c0f79a09f6c1c373b81d4220822 | [
"MIT"
] | null | null | null | """Dummy SMTP API."""
class SMTP_dummy(object): # pylint: disable=useless-object-inheritance
# pylint: disable=invalid-name, no-self-use
"""Dummy SMTP API."""
# Class variables track member function calls for later checking.
msg_from = None
msg_to = None
msg = None
def login(self, login, password):
"""Do nothing."""
def sendmail(self, msg_from, msg_to, msg):
"""Remember the recipients."""
SMTP_dummy.msg_from = msg_from
SMTP_dummy.msg_to = msg_to
SMTP_dummy.msg = msg
def close(self):
"""Do nothing."""
def clear(self):
"""Reset class variables."""
SMTP_dummy.msg_from = None
SMTP_dummy.msg_to = []
SMTP_dummy.msg = None
| 25.066667 | 71 | 0.606383 | 97 | 752 | 4.525773 | 0.391753 | 0.143508 | 0.164009 | 0.077449 | 0.077449 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.269947 | 752 | 29 | 72 | 25.931034 | 0.799636 | 0.336436 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0.071429 | 0 | 0 | 0.571429 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
ea088f92e58e2a58e35be9d342ed82158fd80454 | 209 | wsgi | Python | generators/app/templates/settings/apache/backend.wsgi | hallucino5105/generator-my-react-project | 18a7fbe70d1c847df8a043e1f8845e63938dadd4 | [
"Apache-2.0"
] | null | null | null | generators/app/templates/settings/apache/backend.wsgi | hallucino5105/generator-my-react-project | 18a7fbe70d1c847df8a043e1f8845e63938dadd4 | [
"Apache-2.0"
] | 5 | 2020-02-26T11:29:36.000Z | 2020-02-26T11:30:05.000Z | generators/app/templates/settings/apache/backend.wsgi | hallucino5105/generator-my-react-project | 18a7fbe70d1c847df8a043e1f8845e63938dadd4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
import os
import sys
import logging
logging.basicConfig(stream=sys.stderr)
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from app.app import application
| 16.076923 | 59 | 0.77512 | 33 | 209 | 4.787879 | 0.666667 | 0.075949 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005319 | 0.100478 | 209 | 12 | 60 | 17.416667 | 0.835106 | 0.162679 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.666667 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
ea0d7555db6e36c6d337cec2eb924498e3225c71 | 259 | py | Python | tilemapbase/__init__.py | Simage/TileMapBase | 85665c24a372028e327396a4b0feaca22c67d3ce | [
"MIT"
] | null | null | null | tilemapbase/__init__.py | Simage/TileMapBase | 85665c24a372028e327396a4b0feaca22c67d3ce | [
"MIT"
] | null | null | null | tilemapbase/__init__.py | Simage/TileMapBase | 85665c24a372028e327396a4b0feaca22c67d3ce | [
"MIT"
] | null | null | null | __version__ = "0.4.6"
from .tiles import init, get_cache
from .mapping import project, to_lonlat, Extent, Plotter, extent_from_frame
from .utils import start_logging
from . import tiles
from . import mapping
from . import utils
from . import ordnancesurvey
| 23.545455 | 75 | 0.787645 | 38 | 259 | 5.131579 | 0.552632 | 0.205128 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013575 | 0.146718 | 259 | 10 | 76 | 25.9 | 0.868778 | 0 | 0 | 0 | 0 | 0 | 0.019305 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.875 | 0 | 0.875 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
ea181d806b5b9dbcd288d38db58d0fa940f79080 | 223 | py | Python | topics/topic_1/9square_of_number.py | VladBaryliuk/my_trainings | 10c4bf2147c361ab918c591577a076b0d276ede0 | [
"Apache-2.0"
] | null | null | null | topics/topic_1/9square_of_number.py | VladBaryliuk/my_trainings | 10c4bf2147c361ab918c591577a076b0d276ede0 | [
"Apache-2.0"
] | null | null | null | topics/topic_1/9square_of_number.py | VladBaryliuk/my_trainings | 10c4bf2147c361ab918c591577a076b0d276ede0 | [
"Apache-2.0"
] | null | null | null | def square_of_number():
number = "179"
number_for_sum = "179"
for i in range (49):
number = number + number_for_sum
number = int(number)
number = number ** 2
print(number)
square_of_number()
| 22.3 | 40 | 0.623318 | 31 | 223 | 4.225806 | 0.451613 | 0.458015 | 0.21374 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.055215 | 0.269058 | 223 | 9 | 41 | 24.777778 | 0.748466 | 0 | 0 | 0 | 0 | 0 | 0.026906 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0 | 0 | 0.111111 | 0.111111 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ea281895334d9f6eb2e1d0053bb87208fe4b79cf | 428 | py | Python | backend/schemas/comment.py | golani04/bug-tracker | a3f91fe6a2202bd60721ab0b0f4bf46b0fb4d872 | [
"MIT"
] | null | null | null | backend/schemas/comment.py | golani04/bug-tracker | a3f91fe6a2202bd60721ab0b0f4bf46b0fb4d872 | [
"MIT"
] | 1 | 2021-05-21T16:15:52.000Z | 2021-05-21T16:15:52.000Z | backend/schemas/comment.py | golani04/bug-tracker | a3f91fe6a2202bd60721ab0b0f4bf46b0fb4d872 | [
"MIT"
] | null | null | null | from datetime import datetime
from uuid import UUID
from typing import Optional
from pydantic import BaseModel, Field
class CommentBase(BaseModel):
text: str
commenter: UUID
reply_to: Optional[int] = Field(None, description="Replying to the previous comment")
class CommentCreate(CommentBase):
pass
class Comment(CommentBase):
id: int
created_at: datetime
updated_at: Optional[datetime] = None
| 20.380952 | 89 | 0.75 | 53 | 428 | 6 | 0.54717 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.184579 | 428 | 20 | 90 | 21.4 | 0.911175 | 0 | 0 | 0 | 0 | 0 | 0.074766 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.071429 | 0.285714 | 0 | 0.928571 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.