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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
26941f15190450548abb826ab5e7dae30c53951d
| 1,062
|
py
|
Python
|
database/chemprop/endpoint_acceptable_parameters.py
|
mshobair/invitro_cheminformatics
|
17201496c73453accd440646a1ee81726119a59c
|
[
"MIT"
] | null | null | null |
database/chemprop/endpoint_acceptable_parameters.py
|
mshobair/invitro_cheminformatics
|
17201496c73453accd440646a1ee81726119a59c
|
[
"MIT"
] | null | null | null |
database/chemprop/endpoint_acceptable_parameters.py
|
mshobair/invitro_cheminformatics
|
17201496c73453accd440646a1ee81726119a59c
|
[
"MIT"
] | null | null | null |
import datetime
from database.chemprop.endpoints import Endpoints
from database.chemprop.parameters import Parameters
from database.database_schemas import Schemas
from sqlalchemy import Column, Integer, String, DateTime, ForeignKey
from sqlalchemy.orm import relationship
from database.base import Base
class EndpointAcceptableParameters(Base):
"""Maps to endpoint_acceptable_parameters table in chemprop databases."""
__tablename__ = "endpoint_acceptable_parameters"
__table_args__ = {'schema': Schemas.chemprop_schema}
id = Column(Integer, primary_key=True, nullable=False)
fk_endpoint_id = Column(ForeignKey(Endpoints.id))
fk_parameter_id = Column(ForeignKey(Parameters.id))
created_by = Column(String(255), nullable=False)
updated_by = Column(String(255), nullable=False)
created_at = Column(DateTime, default=datetime.datetime.now, nullable=False)
updated_at = Column(DateTime, default=datetime.datetime.now, nullable=False)
endpoint = relationship("Endpoints")
parameter = relationship("Parameters")
| 37.928571
| 80
| 0.785311
| 122
| 1,062
| 6.639344
| 0.352459
| 0.080247
| 0.049383
| 0.081481
| 0.209877
| 0.209877
| 0.135802
| 0.135802
| 0.135802
| 0
| 0
| 0.006479
| 0.12806
| 1,062
| 27
| 81
| 39.333333
| 0.868251
| 0.063089
| 0
| 0
| 0
| 0
| 0.055612
| 0.030334
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.368421
| 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
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 2
|
13fa947a98ef38378e4092dccc8d0f5bf6aced03
| 2,009
|
py
|
Python
|
label_mapping.py
|
YoushaaMurhij/CenterPoint_Segmentation_Head
|
0610c1da18994f494a8609d983ffa21d62d7d876
|
[
"MIT"
] | null | null | null |
label_mapping.py
|
YoushaaMurhij/CenterPoint_Segmentation_Head
|
0610c1da18994f494a8609d983ffa21d62d7d876
|
[
"MIT"
] | null | null | null |
label_mapping.py
|
YoushaaMurhij/CenterPoint_Segmentation_Head
|
0610c1da18994f494a8609d983ffa21d62d7d876
|
[
"MIT"
] | null | null | null |
label_name_mapping = {
0: "unlabeled",
1: "outlier",
10: "car",
11: "bicycle",
13: "bus",
15: "motorcycle",
16: "on-rails",
18: "truck",
20: "other-vehicle",
30: "person",
31: "bicyclist",
32: "motorcyclist",
40: "road",
44: "parking",
48: "sidewalk",
49: "other-ground",
50: "building",
51: "fence",
52: "other-structure",
60: "lane-marking",
70: "vegetation",
71: "trunk",
72: "terrain",
80: "pole",
81: "traffic-sign",
99: "other-object",
252: "moving-car",
253: "moving-bicyclist",
254: "moving-person",
255: "moving-motorcyclist",
256: "moving-on-rails",
257: "moving-bus",
258: "moving-truck",
259: "moving-other-vehicle"
}
class2id = {
0: 0,
1: 1,
10: 2,
11: 3,
13: 4,
15: 5,
16: 6,
18: 7,
20: 8,
30: 9,
31: 10,
32: 11,
40: 12,
44: 13,
48: 14,
49: 15,
50: 16,
51: 17,
52: 18,
60: 19,
70: 20,
71: 21,
72: 22,
80: 23,
81: 24,
99: 25,
252: 2, #26,
253: 10, #27,
254: 9, #28,
255: 11, #29,
256: 6, #30,
257: 4, #31,
258: 7, #32,
259: 8 #33
}
id2class = {
0:0,
1:1,
2:10,
3:11,
4:13,
5:15,
6:16,
7:18,
8:20,
9:30,
10:31,
11:32,
12:40,
13:44,
14:48,
15:49,
16:50,
17:51,
18:52,
19:60,
20:70,
21:71,
22:72,
23:80,
24:81,
25:99,
26:252,
27:253,
28:254,
29:255,
30:256,
31:257,
32:258,
33:259
}
_kitti_labels = {
0: 'unlabeled',
1: 'car',
2: 'bicycle',
3: 'motorcycle',
4: 'truck',
5: 'other-vehicle',
6: 'person',
7: 'bicyclist',
8: 'motorcyclist',
9: 'road',
10: 'parking',
11: 'sidewalk',
12: 'other-ground',
13: 'building',
14: 'fence',
15: 'vegetation',
16: 'trunk',
17: 'terrain',
18: 'pole',
19: 'traffic-sign'
}
| 14.992537
| 31
| 0.442509
| 279
| 2,009
| 3.172043
| 0.336918
| 0.040678
| 0.024859
| 0.00904
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.29595
| 0.360876
| 2,009
| 134
| 32
| 14.992537
| 0.393302
| 0.011448
| 0
| 0.030769
| 0
| 0
| 0.244568
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
13fca46c746999501de84f40b50ef047a4b2c610
| 295
|
py
|
Python
|
archives/02/tootle/tests/test_state.py
|
asmodehn/caerbannog
|
47bb1138190748041a4c0d02e522c0924a9af962
|
[
"MIT"
] | 1
|
2019-01-22T20:57:45.000Z
|
2019-01-22T20:57:45.000Z
|
archives/03/footle/tests/test_state.py
|
asmodehn/functional-python
|
47bb1138190748041a4c0d02e522c0924a9af962
|
[
"MIT"
] | 3
|
2019-03-14T17:33:39.000Z
|
2019-03-14T18:09:42.000Z
|
archives/03/footle/tests/test_state.py
|
asmodehn/caerbannog
|
47bb1138190748041a4c0d02e522c0924a9af962
|
[
"MIT"
] | null | null | null |
from state import TurtleState
# TODO : improve... but with useful things for illustrating the point...
def test_move(distance):
s = TurtleState()
s.move(distance)
def test_turn(angle):
s = TurtleState()
s.turn(angle)
def test_random_path():
s = TurtleState
# TODO
| 15.526316
| 72
| 0.671186
| 39
| 295
| 4.974359
| 0.589744
| 0.108247
| 0.134021
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.223729
| 295
| 18
| 73
| 16.388889
| 0.847162
| 0.254237
| 0
| 0.222222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.055556
| 0
| 1
| 0.333333
| false
| 0
| 0.111111
| 0
| 0.444444
| 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
| 0
| 0
|
0
| 2
|
cd08e29c15d2756e6bc4a870585c434ad2c07d7a
| 2,935
|
py
|
Python
|
plots.py
|
klowrey/speed_arch
|
edb002b6d57915fa5e2024b36eb66acf30a7130a
|
[
"MIT"
] | null | null | null |
plots.py
|
klowrey/speed_arch
|
edb002b6d57915fa5e2024b36eb66acf30a7130a
|
[
"MIT"
] | null | null | null |
plots.py
|
klowrey/speed_arch
|
edb002b6d57915fa5e2024b36eb66acf30a7130a
|
[
"MIT"
] | null | null | null |
import numpy as np
import matplotlib.pyplot as plt
acc = np.array([7.95549917, 7.46641684, 8.16141701, 8.80025005, 7.29208231,
7.73391724, 8.16333294, 9.02033329, 7.60566664, 7.88175011,
7.77574968, 8.79116631, 8.24524975, 8.98549938, 7.3717494 ,
7.32324982, 8.14583302, 8.53608322, 9.30125046, 8.53458309,
8.01708317, 8.36941624, 8.23241711, 8.93550014, 8.73683262,
8.05008316, 8.68758297, 8.59083271, 9.0852499 , 9.07924938,
7.3904171 , 8.82283497, 9.41650009, 8.45791626, 8.04416656,
7.70391607, 9.05191612, 7.78883314, 8.56858349, 9.07366657,
8.77991581, 7.94008255, 8.1746664 , 8.28074932, 7.91550064,
7.4872508 , 8.59158325, 9.33758259, 8.21591663, 8.64350033,
9.00899982, 9.26983356, 8.7885828 , 9.43066692, 9.09299946,
8.55266666, 8.73725033, 7.50575018, 7.99300003, 8.16366673,
8.97633266, 8.19683361, 7.71091652, 8.65974998, 8.97108364,
8.03375053, 8.99700069, 9.18599987, 8.26491737, 8.64508343,
8.00825024, 7.80483294, 7.45008326, 8.23791695, 8.90425014,
9.47108269, 8.0963335 , 8.88658333, 7.99116659, 7.48541689,
8.23633289, 8.61583424, 7.75775003, 8.10883331, 8.57058334,
7.72616577, 7.29199982, 8.26725006, 7.80841637, 8.8257494 ,
9.35824871, 8.85208321, 7.50433302, 8.03266716, 8.77825069,
8.94516659, 8.56558323, 8.64266682, 8.70541668, 8.4321661 ])
spd = np.array([-15.733922 , -17.69332123, -15.09789562, -14.98722076,
-19.22259712, -20.7837429 , -19.90324211, -13.48655987,
-13.42676544, -10.76375103, -18.15335083, -9.28313065,
-11.35249805, -12.09126663, -13.63445187, -17.17600822,
-11.39536953, -13.01688385, -14.5902586 , -9.40825558,
-11.72452641, -9.74875546, -15.47906494, -17.58286476,
-13.81764889, -15.5894928 , -9.33745289, -11.58790493,
-12.6633606 , -12.95300007, -6.5169816 , -15.54349899,
-9.18311691, -11.59814739, -11.74293232, -18.68121147,
-12.44590282, -13.20860291, -8.75187683, -23.9044342 ,
-10.90840054, -11.39770985, -14.83057499, -13.2543335 ,
-13.18600559, -13.31662369, -12.91320515, -9.9495573 ,
-10.87206936, -11.35480595, -13.06026745, -10.52530384,
-13.57276917, -13.95710754, -9.0244627 , -12.21132755,
-9.00012493, -9.07794476, -12.50325108, -9.44294643,
-12.86182499, -8.95974827, -10.34585476, -16.70100594,
-7.63287163, -11.60797215, -11.73308086, -10.89833736,
-11.40105438, -8.59499645, -11.1452837 , -11.61797333,
-9.25040531, -9.30110741, -8.68466759, -10.68533611,
-11.68466282, -10.05351353, -11.61765003, -9.72268772,
-9.05587578, -10.88561535, -11.85619068, -12.46191692,
-8.43530369, -6.79801893, -9.91088772, -9.89115238,
-16.34910393, -12.32227421, -13.36759472, -17.33267021,
-10.66337585, -10.35019398, -11.29328632, -9.45415211,
-10.61021137, -14.06766415, -8.31783295, -11.77228069])
| 56.442308
| 79
| 0.65247
| 415
| 2,935
| 4.614458
| 0.544578
| 0.007311
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.763809
| 0.173424
| 2,935
| 51
| 80
| 57.54902
| 0.025556
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.042553
| 0
| 0.042553
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
cd094ee5dcfd76a9bf766f06eb8cdcb0b8027094
| 4,485
|
py
|
Python
|
tests/test_geojson.py
|
geographika/mappyfile-geojson
|
9525bb840ae243a0f5072730f6432bf98dcacbe9
|
[
"MIT"
] | 8
|
2018-08-08T06:47:38.000Z
|
2022-01-30T13:25:35.000Z
|
tests/test_geojson.py
|
geographika/mappyfile-geojson
|
9525bb840ae243a0f5072730f6432bf98dcacbe9
|
[
"MIT"
] | 4
|
2020-09-24T05:28:19.000Z
|
2022-03-29T22:18:13.000Z
|
tests/test_geojson.py
|
geographika/mappyfile-geojson
|
9525bb840ae243a0f5072730f6432bf98dcacbe9
|
[
"MIT"
] | 1
|
2018-08-08T06:47:42.000Z
|
2018-08-08T06:47:42.000Z
|
import os
import json
import geojson
import mappyfile_geojson
import mappyfile
import pytest
def get_geojson(fn):
tests = os.path.dirname(os.path.realpath(__file__))
fn = os.path.join(tests, fn)
with open(fn) as f:
gj = geojson.load(f)
return gj
def test_point():
gj = get_geojson("Point.json")
layer = mappyfile_geojson.convert(gj)
s = mappyfile.dumps(layer)
print(s)
assert s == """LAYER
EXTENT 102 0.5 102 0.5
STATUS ON
TYPE POINT
PROCESSING "ITEMS=prop0"
FEATURE
POINTS
102.0 0.5
END
ITEMS "value0"
END
END"""
def test_pointZ():
"""
Z-values are simply removed as they are not supported by inline
MapServer Features
"""
gj = get_geojson("PointZ.json")
layer = mappyfile_geojson.convert(gj)
s = mappyfile.dumps(layer)
print(s)
assert s == """LAYER
EXTENT 102 0.5 102 0.5
STATUS ON
TYPE POINT
PROCESSING "ITEMS=prop0"
FEATURE
POINTS
102.0 0.5
END
ITEMS "value0"
END
END"""
def test_linestring():
gj = get_geojson("LineString.json")
layer = mappyfile_geojson.convert(gj)
s = mappyfile.dumps(layer)
print(s)
assert s == """LAYER
EXTENT 102 0 105 1
STATUS ON
TYPE LINE
PROCESSING "ITEMS=prop0,prop1"
FEATURE
POINTS
102.0 0.0
103.0 1.0
104.0 0.0
105.0 1.0
END
ITEMS "value0;0.0"
END
END"""
def test_polygon():
gj = get_geojson("Polygon.json")
layer = mappyfile_geojson.convert(gj)
print(json.dumps(layer, indent=4))
s = mappyfile.dumps(layer)
print(s)
assert s == """LAYER
EXTENT 100 0 101 1
STATUS ON
TYPE POLYGON
PROCESSING "ITEMS=prop0,prop1"
FEATURE
POINTS
100.0 0.0
101.0 0.0
101.0 1.0
100.0 1.0
100.0 0.0
END
ITEMS "value0;value1"
END
END"""
def test_multipoint():
gj = get_geojson("MultiPoint.json")
layer = mappyfile_geojson.convert(gj)
s = mappyfile.dumps(layer)
print(s)
assert s == """LAYER
EXTENT 10 10 40 40
STATUS ON
TYPE POINT
PROCESSING "ITEMS=prop0"
FEATURE
POINTS
10.0 40.0
40.0 30.0
20.0 20.0
30.0 10.0
END
ITEMS "value0"
END
END"""
def test_multilinestring():
gj = get_geojson("MultiLineString.json")
layer = mappyfile_geojson.convert(gj)
s = mappyfile.dumps(layer)
print(s)
assert s == """LAYER
EXTENT 10 10 40 40
STATUS ON
TYPE LINE
PROCESSING "ITEMS=prop0,prop1"
FEATURE
POINTS
10.0 10.0
20.0 20.0
10.0 40.0
END
POINTS
40.0 40.0
30.0 30.0
40.0 20.0
30.0 10.0
END
ITEMS "value0;0.0"
END
END"""
def test_multipolygon():
gj = get_geojson("MultiPolygon.json")
layer = mappyfile_geojson.convert(gj)
s = mappyfile.dumps(layer)
print(s)
assert s == """LAYER
EXTENT 5 5 45 40
STATUS ON
TYPE POLYGON
PROCESSING "ITEMS=prop0,prop1"
FEATURE
POINTS
30.0 20.0
45.0 40.0
10.0 40.0
30.0 20.0
END
POINTS
15.0 5.0
40.0 10.0
10.0 20.0
5.0 10.0
15.0 5.0
END
ITEMS "value0;value1"
END
END"""
def test_featurecollection():
gj = get_geojson("FeatureCollection.json")
layer = mappyfile_geojson.convert(gj)
print(json.dumps(layer, indent=4))
s = mappyfile.dumps(layer)
print(s)
assert s == """LAYER
EXTENT 102 0 105 1
STATUS ON
TYPE LINE
PROCESSING "ITEMS=prop0"
FEATURE
POINTS
102.0 0.0
103.0 1.0
104.0 0.0
105.0 1.0
END
ITEMS "value0"
END
FEATURE
POINTS
102.0 0.0
103.0 1.0
104.0 0.0
105.0 1.0
END
ITEMS "value1"
END
END"""
def run_tests():
pytest.main(["tests/test_geojson.py", "-vv"])
if __name__ == '__main__':
# test_multipolygon()
run_tests()
print("Done!")
| 19.933333
| 68
| 0.515942
| 595
| 4,485
| 3.818487
| 0.146218
| 0.019366
| 0.011884
| 0.088028
| 0.699824
| 0.679137
| 0.666373
| 0.652289
| 0.652289
| 0.605634
| 0
| 0.118935
| 0.388852
| 4,485
| 224
| 69
| 20.022321
| 0.70996
| 0.022965
| 0
| 0.753846
| 0
| 0
| 0.587913
| 0.010231
| 0
| 0
| 0
| 0
| 0.041026
| 1
| 0.051282
| false
| 0
| 0.030769
| 0
| 0.087179
| 0.05641
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
cd0e89b4b693cd65319eaacf6298dcfed09dbd78
| 594
|
py
|
Python
|
fsttest/__init__.py
|
eddieantonio/fsttest
|
8ff71a9aa41a70a30832fa219b72e7478872c16f
|
[
"MIT"
] | null | null | null |
fsttest/__init__.py
|
eddieantonio/fsttest
|
8ff71a9aa41a70a30832fa219b72e7478872c16f
|
[
"MIT"
] | 1
|
2020-01-27T21:43:04.000Z
|
2020-01-28T15:57:05.000Z
|
fsttest/__init__.py
|
eddieantonio/fsttest
|
8ff71a9aa41a70a30832fa219b72e7478872c16f
|
[
"MIT"
] | 1
|
2021-04-26T17:46:19.000Z
|
2021-04-26T17:46:19.000Z
|
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
FST test -- test your Foma finite-state transducers!
"""
from .__version__ import VERSION as __version__
from ._fst import FST
from ._results import FailedTestResult, PassedTestResult, TestResults
from ._run import execute_test_case, run_tests
from ._test_case import TestCase
from .exceptions import FSTTestError, TestCaseDefinitionError
__all__ = [
"FST",
"FSTTestError",
"FailedTestResult",
"PassedTestResult",
"TestCase",
"TestCaseDefinitionError",
"TestResults",
"execute_test_case",
"run_tests",
]
| 22.846154
| 69
| 0.725589
| 62
| 594
| 6.580645
| 0.5
| 0.058824
| 0.073529
| 0.088235
| 0.112745
| 0
| 0
| 0
| 0
| 0
| 0
| 0.00404
| 0.166667
| 594
| 25
| 70
| 23.76
| 0.820202
| 0.161616
| 0
| 0
| 0
| 0
| 0.235174
| 0.047035
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.117647
| 0.352941
| 0
| 0.352941
| 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
| 0
| 0
|
0
| 2
|
cd10ef939588bc49c75df0d3a2c4ba2f987aa04b
| 1,164
|
py
|
Python
|
benchmark_runner.py
|
mamrehn/simplification
|
cb43ccadcbe011b89845142910d844b0bf7ca510
|
[
"MIT"
] | null | null | null |
benchmark_runner.py
|
mamrehn/simplification
|
cb43ccadcbe011b89845142910d844b0bf7ca510
|
[
"MIT"
] | null | null | null |
benchmark_runner.py
|
mamrehn/simplification
|
cb43ccadcbe011b89845142910d844b0bf7ca510
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Standalone benchmark runner
"""
import cProfile
import pstats
import profile
import numpy as np
print("Running Rust + Cython benchmarks")
# calibrate
pr = profile.Profile()
calibration = np.mean([pr.calibrate(100000) for x in xrange(5)])
# add the bias
profile.Profile.bias = calibration
cProfile.run(open('simplification/test/cprofile_rust_cython.py', 'rb'), 'simplification/test/output_stats_rust_cython')
rust_cython = pstats.Stats('simplification/test/output_stats_rust_cython')
cProfile.run(open('simplification/test/cprofile_rust_cython_complex.py', 'rb'), 'simplification/test/output_stats_rust_cython_complex')
rust_cython_c = pstats.Stats('simplification/test/output_stats_rust_cython_complex')
cProfile.run(open('simplification/test/cprofile_rust_cython_shapely.py', 'rb'), 'simplification/test/output_stats_rust_cython_shapely')
shapely = pstats.Stats('simplification/test/output_stats_rust_cython_shapely')
print("Rust Cython Benchmarks\n")
rust_cython.sort_stats('cumulative').print_stats(5)
rust_cython_c.sort_stats('cumulative').print_stats(5)
shapely.sort_stats('cumulative').print_stats(5)
| 35.272727
| 135
| 0.803265
| 160
| 1,164
| 5.58125
| 0.30625
| 0.167973
| 0.161254
| 0.194849
| 0.615901
| 0.615901
| 0.515118
| 0.483763
| 0
| 0
| 0
| 0.01012
| 0.066151
| 1,164
| 32
| 136
| 36.375
| 0.811408
| 0.079897
| 0
| 0
| 0
| 0
| 0.50283
| 0.416038
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.222222
| 0
| 0.222222
| 0.277778
| 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
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
cd3eb5a68afae376fb0cdba9c6455dc19c74e74f
| 3,552
|
py
|
Python
|
src/application/models.py
|
Chitrank-Dixit/WikiG
|
74d99a16afc635a991c17de8d237eb4f6eccbe86
|
[
"CNRI-Python"
] | 1
|
2015-11-05T03:51:44.000Z
|
2015-11-05T03:51:44.000Z
|
src/application/models.py
|
Chitrank-Dixit/WikiG
|
74d99a16afc635a991c17de8d237eb4f6eccbe86
|
[
"CNRI-Python"
] | null | null | null |
src/application/models.py
|
Chitrank-Dixit/WikiG
|
74d99a16afc635a991c17de8d237eb4f6eccbe86
|
[
"CNRI-Python"
] | null | null | null |
"""
models.py
App Engine datastore models
Documentation: https://developers.google.com/appengine/docs/python/ndb/entities
"""
from google.appengine.ext import ndb
from google.appengine.ext import blobstore
from google.appengine.api import users
import functools
import flask
from flaskext import login
from flaskext.login import current_user
from flaskext import oauth
from hashlib import md5
import util
import model
import config
from application import app
import urls
# from application.metadata import Session, Base
################################################################################
# Flaskext Login
################################################################################
login_manager = login.LoginManager()
class AnonymousUser(login.AnonymousUserMixin):
id = 0
admin = False
name = 'Anonymous'
user_db = None
def key(self):
return None
login_manager.anonymous_user = AnonymousUser
class FlaskUser(AnonymousUser):
def __init__(self, user_db):
self.user_db = user_db
self.id = user_db.key.id()
self.name = user_db.name
self.email = user_db.email
self.followed = user_db.followed
self.admin = user_db.admin
def get_name(self):
return self.user_db.name
def key(self):
return self.user_db.key.urlsafe()
def get_id(self):
return self.user_db.key.urlsafe()
def is_authenticated(self):
return True
def is_active(self):
return self.user_db.active
def is_anonymous(self):
return False
def avatar(self, size):
return 'http://www.gravatar.com/avatar/' + md5(self.email).hexdigest() + '?d=mm&s=' + str(size)
def follow(self, user):
if not self.is_following(user):
self.followed.put(user)
return self
def unfollow(self, user):
if self.is_following(user):
self.followed.remove(user)
return self
def is_following(self, user):
model_ex = model.Followers.query()
for entry in model_ex:
if entry.follower_name.string_id() == current_user.name and entry.followed_name.string_id() == user.name:
return True
return False
#return (cur_user.string_id() == current_user.name and to_follow.string_id() == user.name)
def has_follower(self,user):
model_ex = model.Followers.query()
for entry in model_ex:
if entry.follower_name.string_id() == user.name and entry.followed_name.string_id() == current_user.name:
return True
return False
def followed_posts(self):
return Post.query.join(followers, (followers.c.followed_id == Post.user_id)).filter(followers.c.follower_id == self.id).order_by(Post.timestamp.desc())
def __repr__(self): # pragma: no cover
return '<User %r>' % (self.name)
@login_manager.user_loader
def load_user(key):
user_db = ndb.Key(urlsafe=key).get()
if user_db:
return FlaskUser(user_db)
return None
login_manager.init_app(app)
login_manager.login_view = 'signin'
def current_user_id():
return login.current_user.id
def current_user_key():
return login.current_user.user_db.key if login.current_user.user_db else None
def current_user_db():
return login.current_user.user_db
def is_logged_in():
return login.current_user.id != 0
class EventData(model.Event):
def __init__(self, event_db):
self.event_db = event_db
self.id = event_db.key.id()
self.name = event_db.name
self.email = event_db.email
def avatar(self, size):
return 'http://www.gravatar.com/avatar/' + md5(self.email).hexdigest() + '?d=mm&s=' + str(size)
| 23.368421
| 155
| 0.677928
| 498
| 3,552
| 4.646586
| 0.232932
| 0.051858
| 0.025929
| 0.031115
| 0.373379
| 0.288678
| 0.195333
| 0.195333
| 0.135696
| 0.135696
| 0
| 0.001702
| 0.17286
| 3,552
| 151
| 156
| 23.523179
| 0.785909
| 0.0808
| 0
| 0.236559
| 0
| 0
| 0.032988
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.236559
| false
| 0
| 0.150538
| 0.16129
| 0.709677
| 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
| 0
| 0
|
0
| 2
|
cd517441104b9bb84c95422e46c5a618c55415fc
| 79
|
py
|
Python
|
project/enums/string_types_enum.py
|
vinibiavatti1/PythonFlaskCms
|
e43a4db84d1f77a5f66b1f8fcb9dc96e05e6c023
|
[
"MIT"
] | null | null | null |
project/enums/string_types_enum.py
|
vinibiavatti1/PythonFlaskCms
|
e43a4db84d1f77a5f66b1f8fcb9dc96e05e6c023
|
[
"MIT"
] | null | null | null |
project/enums/string_types_enum.py
|
vinibiavatti1/PythonFlaskCms
|
e43a4db84d1f77a5f66b1f8fcb9dc96e05e6c023
|
[
"MIT"
] | null | null | null |
"""
String format type value enumeration.
"""
TRUE = '1'
FALSE = '0'
NONE = ''
| 11.285714
| 37
| 0.594937
| 10
| 79
| 4.7
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.031746
| 0.202532
| 79
| 6
| 38
| 13.166667
| 0.714286
| 0.468354
| 0
| 0
| 0
| 0
| 0.058824
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 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
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
cd68c50658ac006c458874597809bf7939658dff
| 83
|
py
|
Python
|
examples/object/reference/change_list.py
|
zqmillet/kinopico_python_book
|
0db4b0a904a1ba1b7e90cf971871e134941aeb65
|
[
"MIT"
] | null | null | null |
examples/object/reference/change_list.py
|
zqmillet/kinopico_python_book
|
0db4b0a904a1ba1b7e90cf971871e134941aeb65
|
[
"MIT"
] | null | null | null |
examples/object/reference/change_list.py
|
zqmillet/kinopico_python_book
|
0db4b0a904a1ba1b7e90cf971871e134941aeb65
|
[
"MIT"
] | null | null | null |
a = [1, 2, 3]
b = a
a[0] = 'gouliguojiashengsiyi'
print('a =', a)
print('b =', b)
| 11.857143
| 29
| 0.506024
| 15
| 83
| 2.8
| 0.533333
| 0.095238
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.061538
| 0.216867
| 83
| 6
| 30
| 13.833333
| 0.584615
| 0
| 0
| 0
| 0
| 0
| 0.313253
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 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
| 0
| 0
| 0
| 0
|
0
| 2
|
cd6b149fb6473adbe7fd7149968a3e8e9f36d8bd
| 901
|
py
|
Python
|
src/conversion_spec_file_reader.py
|
Eldar1205/exchanger-python-demo-app
|
6733ff6044555f8c4639dc6e25baf4ef51401fd9
|
[
"MIT"
] | 7
|
2021-08-31T09:03:39.000Z
|
2021-09-27T13:45:58.000Z
|
src/conversion_spec_file_reader.py
|
Eldar1205/exchanger-python-demo-app
|
6733ff6044555f8c4639dc6e25baf4ef51401fd9
|
[
"MIT"
] | null | null | null |
src/conversion_spec_file_reader.py
|
Eldar1205/exchanger-python-demo-app
|
6733ff6044555f8c4639dc6e25baf4ef51401fd9
|
[
"MIT"
] | null | null | null |
import aiofiles
import asyncstdlib
from pydantic.types import PositiveFloat
from conversion_parameters import ConversionParameters
from conversion_spec import ConversionSpec, Currency
from conversion_spec_provider import ConversionSpecProvider
class ConversionSpecFileReader(ConversionSpecProvider):
async def provide_conversion_spec(self, conversion_parameters: ConversionParameters) -> ConversionSpec:
source_currency: Currency
target_currency: Currency
source_amounts: tuple[PositiveFloat]
async with aiofiles.open(conversion_parameters.file_path) as conversion_spec_file:
source_currency, target_currency, *source_amounts = await asyncstdlib.tuple(conversion_spec_file)
return ConversionSpec(
source_currency=source_currency,
target_currency=target_currency,
source_amounts=source_amounts,
)
| 37.541667
| 109
| 0.783574
| 87
| 901
| 7.827586
| 0.367816
| 0.10279
| 0.129222
| 0.082232
| 0.10279
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.175361
| 901
| 23
| 110
| 39.173913
| 0.916555
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.444444
| 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
| 0
| 0
|
0
| 2
|
cd887102450875f1d2f5fd98ea87c44fd4dd0888
| 303
|
py
|
Python
|
Python/8/SquareSum/square_sum.py
|
hwakabh/codewars
|
7afce5a7424d35abc55c350301ac134f2d3edd3d
|
[
"MIT"
] | null | null | null |
Python/8/SquareSum/square_sum.py
|
hwakabh/codewars
|
7afce5a7424d35abc55c350301ac134f2d3edd3d
|
[
"MIT"
] | 6
|
2020-02-21T17:01:59.000Z
|
2021-05-04T07:04:41.000Z
|
Python/8/SquareSum/square_sum.py
|
hwakabh/codewars
|
7afce5a7424d35abc55c350301ac134f2d3edd3d
|
[
"MIT"
] | null | null | null |
import sys
def square_sum(numbers):
return sum([n ** 2 for n in numbers])
if __name__ == "__main__":
if len(sys.argv) == 1:
nums = [int(e) for e in input('>>> Enter the numbers with comma-separeted: ').split(',')]
print(square_sum(numbers=nums))
else:
sys.exit(1)
| 23.307692
| 97
| 0.590759
| 45
| 303
| 3.755556
| 0.666667
| 0.106509
| 0.189349
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.013158
| 0.247525
| 303
| 13
| 98
| 23.307692
| 0.72807
| 0
| 0
| 0
| 0
| 0
| 0.174342
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.111111
| false
| 0
| 0.111111
| 0.111111
| 0.333333
| 0.111111
| 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
| 0
| 1
| 0
| 0
|
0
| 2
|
cd88a71325bc436cee432caaafbbae9750fb46b0
| 5,710
|
py
|
Python
|
spatial_ops/lazy_loader.py
|
LucaMarconato/spatial_ops
|
86e5b8557db9efa2ca263098ed47c16de05fab00
|
[
"MIT"
] | null | null | null |
spatial_ops/lazy_loader.py
|
LucaMarconato/spatial_ops
|
86e5b8557db9efa2ca263098ed47c16de05fab00
|
[
"MIT"
] | null | null | null |
spatial_ops/lazy_loader.py
|
LucaMarconato/spatial_ops
|
86e5b8557db9efa2ca263098ed47c16de05fab00
|
[
"MIT"
] | null | null | null |
import os
import pickle
from abc import ABC, abstractmethod
import h5py
import numpy as np
from .folders import get_pickle_lazy_loader_data_path, hdf5_lazy_loader_data_path
from .unpickler import CustomUnpickler
class LazyLoaderAssociatedInstance:
# when implementing this method in a derived class add an unique suffix (depending on the derived class and not
# on a specific instance of the derived class) so to ensure uniqueness among different classes which derive this
# class example, if we have a Dog with name 'Bobby' and a Cat with name 'Bobby', good unique identifiers are
# 'Cat_Bobby' and 'Dog_Bobby', not just 'Bobby'
def get_lazy_loader_unique_identifier(self) -> str:
raise NotImplementedError
class LazyLoader(ABC):
def __init__(self, associated_instance: LazyLoaderAssociatedInstance):
self.associated_instance = associated_instance
@abstractmethod
def get_resource_unique_identifier(self) -> str:
pass
@abstractmethod
def precompute(self):
pass
@abstractmethod
def delete_precomputation(self):
pass
@abstractmethod
def has_data_already_been_precomputed(self):
pass
def precompute_if_needed(self):
if not self.has_data_already_been_precomputed():
self.precompute()
@abstractmethod
def _load_precomputed_data(self):
pass
def load_data(self, store_precomputation_on_disk=True):
if self.associated_instance is None:
raise ValueError(f'self.associated_instance = {self.associated_instance}')
if not self.has_data_already_been_precomputed():
# print('precomputing')
data = self.precompute()
if data is None:
raise ValueError(f'data = {data}')
if store_precomputation_on_disk:
self._save_data(data)
return data
else:
# print('loading')
return self._load_precomputed_data()
@abstractmethod
def _save_data(self, data):
pass
class PickleLazyLoader(LazyLoader, ABC):
def get_pickle_path(self):
path = os.path.join(get_pickle_lazy_loader_data_path(),
self.associated_instance.get_lazy_loader_unique_identifier())
os.makedirs(path, exist_ok=True)
path = os.path.join(path, self.get_resource_unique_identifier() + '.pickle')
return path
def _load_precomputed_data(self):
pickle_path = self.get_pickle_path()
try:
data = CustomUnpickler(open(pickle_path, 'rb')).load()
# if the pickle is corrupted because a previous execution of the program was terminated while pickling a file
# then we want to delete the pickle file and recompute it
except EOFError:
self.delete_precomputation()
data = self.load_data()
return data
def has_data_already_been_precomputed(self):
pickle_path = self.get_pickle_path()
return os.path.isfile(pickle_path)
def delete_precomputation(self):
os.remove(self.get_pickle_path())
def _save_data(self, data):
pickle.dump(data, open(self.get_pickle_path(), 'wb'))
if not os.path.isfile(hdf5_lazy_loader_data_path):
f = h5py.File(hdf5_lazy_loader_data_path, 'w')
f.close()
class HDF5LazyLoader(LazyLoader, ABC):
# just for convenience, to have the path ready when deriving the subclass
def get_hdf5_file_path(self) -> str:
return hdf5_lazy_loader_data_path
def get_hdf5_resource_internal_path(self):
return self.associated_instance.get_lazy_loader_unique_identifier() \
+ '/' + self.get_resource_unique_identifier()
# using a singleton and opening the file only once in r+ mode would lead to better performance, but I will wait
# to see if the current performance are bad before implementing it
def _load_precomputed_data(self):
with h5py.File(self.get_hdf5_file_path(), 'r') as f:
data = np.array(f[self.get_hdf5_resource_internal_path()][...])
return data
def has_data_already_been_precomputed(self):
with h5py.File(self.get_hdf5_file_path(), 'r') as f:
return self.get_hdf5_resource_internal_path() in f
def delete_precomputation(self):
with h5py.File(self.get_hdf5_file_path(), 'r+') as f:
del f[self.get_hdf5_resource_internal_path()]
def _save_data(self, data):
with h5py.File(self.get_hdf5_file_path(), 'r+') as f:
f[self.get_hdf5_resource_internal_path()] = data
if __name__ == '__main__':
from spatial_ops.data import JacksonFischerDataset as jfd
from spatial_ops.data import Patient
patient = jfd.patients[15]
class NumberOfPlatesLoader0(PickleLazyLoader):
def get_resource_unique_identifier(self) -> str:
return 'example_quantity_pickle'
def precompute(self):
# just to enable the autocompletion within the ide
p: Patient = self.associated_instance
data = f'len = {len(p.plates)}'
return data
derived_quantity = NumberOfPlatesLoader0(patient)
print(derived_quantity.load_data())
class NumberOfPlatesLoader1(HDF5LazyLoader):
def get_resource_unique_identifier(self) -> str:
return 'example_quantity_hdf5'
def precompute(self):
p: Patient = self.associated_instance
data = f'len = {len(p.plates)}'
# data = np.zeros((2, 3))
return data
derived_quantity = NumberOfPlatesLoader1(patient)
# derived_quantity.delete_precomputation()
print(derived_quantity.load_data())
| 33.588235
| 117
| 0.680911
| 716
| 5,710
| 5.157821
| 0.243017
| 0.026537
| 0.053615
| 0.029245
| 0.388573
| 0.277552
| 0.232061
| 0.170593
| 0.122394
| 0.098565
| 0
| 0.007151
| 0.240806
| 5,710
| 169
| 118
| 33.786982
| 0.844752
| 0.164098
| 0
| 0.4375
| 0
| 0
| 0.037621
| 0.019756
| 0
| 0
| 0
| 0
| 0
| 1
| 0.223214
| false
| 0.053571
| 0.080357
| 0.035714
| 0.473214
| 0.017857
| 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
| 0
| 0
|
0
| 2
|
cd8f015fd57b190763452236dbe2f747d3309b7f
| 837
|
py
|
Python
|
tests/test_set.py
|
maxslarsson/tennis-probability
|
f26021b305e2b8abd87acad846454f7ce02e9199
|
[
"MIT"
] | null | null | null |
tests/test_set.py
|
maxslarsson/tennis-probability
|
f26021b305e2b8abd87acad846454f7ce02e9199
|
[
"MIT"
] | null | null | null |
tests/test_set.py
|
maxslarsson/tennis-probability
|
f26021b305e2b8abd87acad846454f7ce02e9199
|
[
"MIT"
] | null | null | null |
import pytest
from tennis_probability import set, InvalidInput, InvalidProbability, NegativeNumber
def test_set():
assert set(0, 0, 0) == 0
assert set(0, 0, 0.50) == 0.5
assert set(0, 0, 1) == 1
# Test valid inputs
assert set(5, 3, 0.13) == 0.008146509339015371
assert set(2, 2, 0.37) == 0.024086243446167555
assert set(4, 1, 0.91) == 0.9999999999999992
# Test invalid inputs
with pytest.raises(InvalidInput):
set(10, 3, 0.2)
with pytest.raises(InvalidInput):
set(2, 812, 0.5)
with pytest.raises(InvalidInput):
set(5, 5, 0.51)
with pytest.raises(NegativeNumber):
set(-1, 0, 0.9)
# Test invalid probabilities
with pytest.raises(InvalidProbability):
set(2, 3, 1.0001)
with pytest.raises(InvalidProbability):
set(1, 0, -1.001)
| 27.9
| 84
| 0.628435
| 120
| 837
| 4.366667
| 0.308333
| 0.026718
| 0.183206
| 0.062977
| 0.364504
| 0
| 0
| 0
| 0
| 0
| 0
| 0.185827
| 0.241338
| 837
| 29
| 85
| 28.862069
| 0.63937
| 0.076464
| 0
| 0.238095
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.285714
| 1
| 0.047619
| true
| 0
| 0.095238
| 0
| 0.142857
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
26aacebd7375e02a1085b024169371e35da36aab
| 59
|
py
|
Python
|
project1/tests/q0.py
|
ucsb-int5/int5-f19-notebooks
|
5b3d1ee6964d9357f211f4706787403ec5a3079c
|
[
"MIT"
] | 1
|
2019-10-02T21:43:12.000Z
|
2019-10-02T21:43:12.000Z
|
project1/tests/q0.py
|
ucsb-int5/int5-f19-notebooks
|
5b3d1ee6964d9357f211f4706787403ec5a3079c
|
[
"MIT"
] | 3
|
2019-12-14T06:20:14.000Z
|
2019-12-14T07:12:33.000Z
|
project1/tests/q0.py
|
ucsb-int5/int5-f19-notebooks
|
5b3d1ee6964d9357f211f4706787403ec5a3079c
|
[
"MIT"
] | 3
|
2019-10-02T18:36:06.000Z
|
2019-12-03T18:16:45.000Z
|
test = { 'name': 'q0',
'points': 0,
'suites': []}
| 19.666667
| 24
| 0.389831
| 6
| 59
| 3.833333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.04878
| 0.305085
| 59
| 3
| 25
| 19.666667
| 0.512195
| 0
| 0
| 0
| 0
| 0
| 0.3
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 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
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
26b4086be5d9ece68d83031748858af8aef6a984
| 663
|
py
|
Python
|
indjections/packages/django-allauth.py
|
pandichef/indjections
|
e8f0e62cf648607ed50330ac69dd12e9fc0cf710
|
[
"BSD-2-Clause"
] | 7
|
2020-07-20T00:33:15.000Z
|
2020-07-24T04:14:53.000Z
|
indjections/packages/django-allauth.py
|
pandichef/indjections
|
e8f0e62cf648607ed50330ac69dd12e9fc0cf710
|
[
"BSD-2-Clause"
] | 17
|
2020-07-20T03:17:06.000Z
|
2020-07-27T07:36:25.000Z
|
indjections/packages/django-allauth.py
|
pandichef/indjections
|
e8f0e62cf648607ed50330ac69dd12e9fc0cf710
|
[
"BSD-2-Clause"
] | null | null | null |
settings = """
try:
AUTHENTICATION_BACKENDS += [
"django.contrib.auth.backends.ModelBackend",
"allauth.account.auth_backends.AuthenticationBackend",
]
except NameError:
AUTHENTICATION_BACKENDS = [
"django.contrib.auth.backends.ModelBackend",
"allauth.account.auth_backends.AuthenticationBackend",
]
INSTALLED_APPS += [
"django.contrib.sites", # not installed by default
"allauth",
"allauth.account",
"allauth.socialaccount",
"allauth.socialaccount.providers.google",
]
SITE_ID = 1
"""
urls = """
from django.urls import include
urlpatterns += [path("accounts/", include("allauth.urls"))]
"""
| 24.555556
| 62
| 0.680241
| 61
| 663
| 7.295082
| 0.52459
| 0.107865
| 0.125843
| 0.157303
| 0.476404
| 0.476404
| 0.476404
| 0.476404
| 0.476404
| 0.476404
| 0
| 0.001838
| 0.179487
| 663
| 26
| 63
| 25.5
| 0.816176
| 0
| 0
| 0.25
| 0
| 0
| 0.950226
| 0.535445
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.041667
| 0
| 0.041667
| 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
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
26b7cad7376280941d68826426ca4c361383c494
| 351
|
py
|
Python
|
templates/checkcel/BrasExplor_Pictures_template.py
|
mboudet/braskoload
|
8f39f2d68638a683e0d8e5065b33a218afe370cb
|
[
"MIT"
] | null | null | null |
templates/checkcel/BrasExplor_Pictures_template.py
|
mboudet/braskoload
|
8f39f2d68638a683e0d8e5065b33a218afe370cb
|
[
"MIT"
] | null | null | null |
templates/checkcel/BrasExplor_Pictures_template.py
|
mboudet/braskoload
|
8f39f2d68638a683e0d8e5065b33a218afe370cb
|
[
"MIT"
] | null | null | null |
from checkcel import Checkplate
from checkcel.validators import SetValidator, NoValidator
from collections import OrderedDict
class MyTemplate(Checkplate):
validators = OrderedDict([
("name@Population", NoValidator()),
("Picture", NoValidator()),
("Type", SetValidator(valid_values=["whole plant", "population"]))
])
| 29.25
| 74
| 0.706553
| 31
| 351
| 7.967742
| 0.612903
| 0.097166
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.173789
| 351
| 11
| 75
| 31.909091
| 0.851724
| 0
| 0
| 0
| 0
| 0
| 0.133903
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.555556
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 2
|
26be0d11d5b6b76d30765326da6c34a562d5f111
| 621
|
py
|
Python
|
stock_experiment_sbb_with_vectors_of_ones.py
|
dvirg/auctions
|
da706f3d11b9582c7f811de9f50b96b43ac8cbd0
|
[
"MIT"
] | 1
|
2021-11-20T19:27:45.000Z
|
2021-11-20T19:27:45.000Z
|
stock_experiment_sbb_with_vectors_of_ones.py
|
dvirg/auctions
|
da706f3d11b9582c7f811de9f50b96b43ac8cbd0
|
[
"MIT"
] | null | null | null |
stock_experiment_sbb_with_vectors_of_ones.py
|
dvirg/auctions
|
da706f3d11b9582c7f811de9f50b96b43ac8cbd0
|
[
"MIT"
] | null | null | null |
#!python3
"""
Simulation experiment for our AAAI 2020 paper, with recipes that are vectors of ones.
Comparing McAfee's double auction to our SBB auctions.
Author: Dvir Gilor
Since: 2020-08
"""
from experiment_stock import experiment
from mcafee_protocol import mcafee_trade_reduction
from trade_reduction_protocol import budget_balanced_trade_reduction
from ascending_auction_protocol import budget_balanced_ascending_auction
import sys
results_file = "stock/results/experiment_sbb_with_vectors_of_ones_stock.csv"
experiment(results_file,budget_balanced_ascending_auction, "SBB Ascending Prices", recipe=4*(1,))
| 27
| 97
| 0.84219
| 87
| 621
| 5.724138
| 0.517241
| 0.084337
| 0.052209
| 0.11245
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.023381
| 0.10467
| 621
| 22
| 98
| 28.227273
| 0.872302
| 0.297907
| 0
| 0
| 0
| 0
| 0.185446
| 0.138498
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.714286
| 0
| 0.714286
| 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
| 0
| 1
| 0
|
0
| 2
|
26c5a8a0093950f0c391d5d30211cf53ae6f042f
| 5,022
|
py
|
Python
|
padevents/events.py
|
muffin-rice/pad-cogs
|
820ecf08f9569a3d7cf3264d0eb9567264b42edf
|
[
"MIT"
] | 2
|
2020-09-25T01:57:21.000Z
|
2020-10-02T13:46:48.000Z
|
padevents/events.py
|
muffin-rice/pad-cogs
|
820ecf08f9569a3d7cf3264d0eb9567264b42edf
|
[
"MIT"
] | 43
|
2020-08-29T06:16:39.000Z
|
2020-10-29T12:00:15.000Z
|
padevents/events.py
|
muffin-rice/pad-cogs
|
820ecf08f9569a3d7cf3264d0eb9567264b42edf
|
[
"MIT"
] | 6
|
2020-08-31T04:37:55.000Z
|
2020-10-19T05:09:17.000Z
|
import datetime
from datetime import timedelta
from typing import Callable, Collection, TYPE_CHECKING
import pytz
from tsutils.formatting import normalize_server_name
from tsutils.time import JP_TIMEZONE, KR_TIMEZONE, NA_TIMEZONE
from padevents.enums import DungeonType, EventLength
if TYPE_CHECKING:
from dbcog.models.scheduled_event_model import ScheduledEventModel
SUPPORTED_SERVERS = ["JP", "NA", "KR"]
SERVER_TIMEZONES = {
"JP": JP_TIMEZONE,
"NA": NA_TIMEZONE,
"KR": KR_TIMEZONE,
}
class Event:
def __init__(self, scheduled_event: "ScheduledEventModel"):
self.key = scheduled_event.event_id
self.server = SUPPORTED_SERVERS[scheduled_event.server_id]
self.open_datetime: datetime = scheduled_event.open_datetime
self.close_datetime: datetime = scheduled_event.close_datetime
self.group = scheduled_event.group_name
self.dungeon = scheduled_event.dungeon
self.dungeon_name = self.dungeon.name_en if self.dungeon else 'unknown_dungeon'
self.clean_dungeon_name = self.dungeon.clean_name_en if self.dungeon else 'unknown_dungeon'
self.dungeon_type = DungeonType(self.dungeon.dungeon_type) if self.dungeon else DungeonType.Unknown
@property
def event_length(self) -> EventLength:
# This is a little off. I don't know how exact these things are.
length = self.close_datetime - self.open_datetime
if length > timedelta(days=8):
return EventLength.special
if length > timedelta(days=2):
return EventLength.weekly
if length > timedelta(hours=20):
return EventLength.daily
return EventLength.limited
def start_from_now_sec(self) -> float:
now = datetime.datetime.now(pytz.utc)
return (self.open_datetime - now).total_seconds()
def end_from_now_sec(self) -> float:
now = datetime.datetime.now(pytz.utc)
return (self.close_datetime - now).total_seconds()
def is_started(self):
"""True if past the open time for the event."""
return self.start_from_now_sec() <= 0
def is_finished(self):
"""True if past the close time for the event."""
return self.end_from_now_sec() <= 0
def start_from_now_discord(self) -> str:
return f"<t:{int(self.open_datetime.timestamp())}:R>"
def end_from_now_discord(self) -> str:
return f"<t:{int(self.close_datetime.timestamp())}:R>"
def end_from_now_full_min(self) -> str:
days, sec = divmod(self.end_from_now_sec(), 86400)
hours, sec = divmod(sec, 3600)
minutes, sec = divmod(sec, 60)
if days > 0:
return '{:2}d {:2}h'.format(int(days), int(hours))
elif hours > 0:
return '{:2}h {:2}m'.format(int(hours), int(minutes))
else:
return '{:2}m'.format(int(minutes))
def group_long_name(self):
return self.group.upper() if self.group is not None else "ALL"
def to_partial_event(self, pe):
group = self.group_long_name()[0] if self.group is not None else " "
if self.is_started():
return "`" + group + " " + self.clean_dungeon_name + " " * (
max(24 - len(self.clean_dungeon_name), 0)) + "-`" + self.end_from_now_discord()
else:
return "`" + group + " " + self.clean_dungeon_name + " " * (
max(24 - len(self.clean_dungeon_name), 0)) + "-`" + self.start_from_now_discord()
def __repr__(self):
return f"Event<{self.clean_dungeon_name} ({self.group} {self.server})>"
class EventList:
def __init__(self, event_list: Collection[Event]):
self.event_list = event_list
def with_func(self, func: Callable[[Event], bool]) -> "EventList":
return EventList(list(filter(func, self.event_list)))
def with_server(self, *servers):
servers = {normalize_server_name(s) for s in servers}
return self.with_func(lambda e: e.server in servers)
def with_type(self, *event_types):
return self.with_func(lambda e: e.event_type in event_types)
def with_length(self, *event_lengths):
return self.with_func(lambda e: e.event_length in event_lengths)
def with_dungeon_type(self, *dungeon_types):
return self.with_func(lambda e: e.dungeon_type in dungeon_types)
def is_grouped(self):
return self.with_func(lambda e: e.group is not None)
def pending_only(self):
return self.with_func(lambda e: not e.is_started())
def active_only(self):
return self.with_func(lambda e: e.is_started() and not e.is_finished())
def today_only(self, server: str):
server_timezone = SERVER_TIMEZONES[normalize_server_name(server)]
today = datetime.datetime.now(server_timezone).date()
return self.with_func(lambda e: e.open_datetime.astimezone(server_timezone).date() == today)
def __iter__(self):
return iter(self.event_list)
def __bool__(self):
return bool(self.event_list)
| 36.656934
| 107
| 0.666866
| 683
| 5,022
| 4.664714
| 0.204978
| 0.040804
| 0.035154
| 0.045198
| 0.30634
| 0.250471
| 0.234777
| 0.186127
| 0.124922
| 0.099184
| 0
| 0.007941
| 0.22262
| 5,022
| 136
| 108
| 36.926471
| 0.808145
| 0.029669
| 0
| 0.06
| 0
| 0
| 0.05327
| 0.02427
| 0
| 0
| 0
| 0
| 0
| 1
| 0.24
| false
| 0
| 0.08
| 0.13
| 0.62
| 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
| 0
| 0
|
0
| 2
|
26def15c65ab2e4480b9091dca33bf04179a4722
| 3,705
|
py
|
Python
|
test_package/conanfile.py
|
sintef-ocean/conan-casadi
|
70a14829ca3b3ec4cdff8b254e3c060b345c1e79
|
[
"MIT"
] | null | null | null |
test_package/conanfile.py
|
sintef-ocean/conan-casadi
|
70a14829ca3b3ec4cdff8b254e3c060b345c1e79
|
[
"MIT"
] | null | null | null |
test_package/conanfile.py
|
sintef-ocean/conan-casadi
|
70a14829ca3b3ec4cdff8b254e3c060b345c1e79
|
[
"MIT"
] | null | null | null |
from conans import ConanFile, CMake, tools, RunEnvironment
class CasadiTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = ("cmake_paths", "cmake", "virtualrunenv", "virtualenv")
_cmake = None
def _configure_cmake(self):
if self._cmake is None:
self._cmake = CMake(self)
cmake = self._cmake
# TODO: non-free interfaces
# ampl, cplex, gurobi, knitro, ooqp, snopt, sqic, worhp
# TODO: swig_json, swig_matlab, swig_octave, clang_jit
# TODO: opencl, hpmpc, blasfeo, dsdp(?)
# LinSol
cmake.definitions["CASADI_CONAN_CSPARSE"] = self.options["casadi"].csparse
cmake.definitions["CASADI_CONAN_LAPACK"] = self.options["casadi"].lapack
cmake.definitions["CASADI_CONAN_MUMPS"] = self.options["casadi"].mumps
cmake.definitions["CASADI_CONAN_HSL"] = self.options["casadi"].hsl
# Conic
cmake.definitions["CASADI_CONAN_HPMPC"] = self.options["casadi"].hpmpc
cmake.definitions["CASADI_CONAN_OSQP"] = self.options["casadi"].osqp
cmake.definitions["CASADI_CONAN_QPOASES"] = self.options["casadi"].qpoases
cmake.definitions["CASADI_CONAN_SUPERSCS"] = self.options["casadi"].superscs
# NLP
cmake.definitions["CASADI_CONAN_BLOCKSQP"] = self.options["casadi"].blocksqp
cmake.definitions["CASADI_CONAN_IPOPT"] = self.options["casadi"].ipopt
# Integration
cmake.definitions["CASADI_CONAN_SUNDIALS"] = self.options["casadi"].sundials
# Other
cmake.definitions["CASADI_CONAN_SLICOT"] = self.options["casadi"].slicot
cmake.definitions["CASADI_CONAN_BLASFEO"] = self.options["casadi"].blasfeo
cmake.definitions["CASADI_CONAN_BONMIN"] = self.options["casadi"].bonmin
cmake.definitions["CASADI_CONAN_CBC"] = self.options["casadi"].cbc
cmake.definitions["CASADI_CONAN_CLP"] = self.options["casadi"].clp
cmake.definitions["CASADI_CONAN_DSDP"] = self.options["casadi"].dsdp
cmake.definitions["CASADI_CONAN_TINYXML"] = self.options["casadi"].tinyxml
self._cmake.configure()
return self._cmake
def build(self):
if not tools.cross_building(self.settings):
cmake = self._configure_cmake()
cmake.build()
def test(self):
if tools.cross_building(self.settings):
print("NOT RUN (cross-building)")
return
# swig_python
if self.options["casadi"].swig_python:
self.output.info("Try to load 'casadi' python module")
try:
import casadi
A = casadi.SX.eye(2)
if casadi.trace(A) == 2:
self.output.info("Completed conanized casadi climax")
except ModuleNotFoundError:
try:
import numpy
except ModuleNotFoundError:
self.output.error("Casadi requires 'numpy', but it was not found")
self.output.error("Unable to proplerly load python casadi module")
self.output.info("Run consumer tests for library interfaces")
cmake = self._configure_cmake()
if self.options["casadi"].hpmpc:
self.output.warn("HPMPC plugin interface is not tested")
if self.options["casadi"].dsdp:
self.output.warn("DSDP interface is not tested(?)")
env_build = RunEnvironment(self)
with tools.environment_append(env_build.vars):
cmake.test()
self.output.info("Casadi OK!")
| 42.102273
| 88
| 0.612146
| 393
| 3,705
| 5.615776
| 0.300254
| 0.104667
| 0.161758
| 0.220208
| 0.027186
| 0
| 0
| 0
| 0
| 0
| 0
| 0.00074
| 0.270985
| 3,705
| 87
| 89
| 42.586207
| 0.816364
| 0.05857
| 0
| 0.1
| 0
| 0
| 0.236986
| 0.018119
| 0
| 0
| 0
| 0.011494
| 0
| 1
| 0.05
| false
| 0
| 0.05
| 0
| 0.2
| 0.016667
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
26e08af32bb2b5d0bbed9fd354924f064bde0ecf
| 254
|
py
|
Python
|
ma.py
|
AmandaKhol/DLT-Blockchain
|
ee464b0d7b55bffe791eb0b814513620430bfa1c
|
[
"MIT"
] | 1
|
2021-04-05T18:59:04.000Z
|
2021-04-05T18:59:04.000Z
|
ma.py
|
AmandaKhol/DLT-Blockchain
|
ee464b0d7b55bffe791eb0b814513620430bfa1c
|
[
"MIT"
] | null | null | null |
ma.py
|
AmandaKhol/DLT-Blockchain
|
ee464b0d7b55bffe791eb0b814513620430bfa1c
|
[
"MIT"
] | null | null | null |
"""
title : ma.py
description : Marshmallow object
author : Amanda Garcia-Garcia
version : 0
usage : python server_api.py
python_version : 3.6.1
"""
from flask_marshmallow import Marshmallow
ma = Marshmallow()
| 19.538462
| 41
| 0.629921
| 29
| 254
| 5.413793
| 0.724138
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.022222
| 0.291339
| 254
| 13
| 42
| 19.538462
| 0.85
| 0.716535
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 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
| 0
| 0
|
0
| 2
|
26ec29318bc12813be99da269d94707649d0104c
| 3,244
|
py
|
Python
|
prisma/generated/models.py
|
mao-shonen/prisma-client-py-tortoise-orm
|
e26d8451ea0775bd7ddfec42f663510434537a77
|
[
"MIT"
] | null | null | null |
prisma/generated/models.py
|
mao-shonen/prisma-client-py-tortoise-orm
|
e26d8451ea0775bd7ddfec42f663510434537a77
|
[
"MIT"
] | null | null | null |
prisma/generated/models.py
|
mao-shonen/prisma-client-py-tortoise-orm
|
e26d8451ea0775bd7ddfec42f663510434537a77
|
[
"MIT"
] | null | null | null |
__doc__ = '''
This file is generated by the `prisma-client-py-tortoise-orm (0.2.2)`,
Please do not modify directly.
repository: https://github.com/mao-shonen/prisma-client-py-tortoise-orm
'''
import typing
from enum import Enum
from tortoise import fields
from tortoise.models import Model
from prisma import base as base
class Role(str, Enum):
'''
- USER
- ADMIN
'''
USER = 'USER'
ADMIN = 'ADMIN'
class User(base.User, Model):
'''
model comment
fields:
- 🔟 id [Int] 🔑
- default: auto_increment()
- doc: field comment
- 🆎 *password [String]
- 🆎 *email [String] 📌
- 🔟 weight [Float?]
- ✅ is18 [Boolean?]
- 🆎 name [String?]
- 🔟 *wallet [Decimal]
- 🪢 successor [User?]
- 🪢 predecessor [User?]
- 🪢 role [Role]
- default: Role.USER
- 🪢 posts [Post]
- 🪢 *biography [Json]
- 🪢 group [group?]
- 🕑 createdAt [DateTime]
- default: now()
- 🕑 *updatedAt [DateTime]
'''
id = fields.IntField(pk=True, description='field comment')
password = fields.CharField(max_length=255)
email = fields.CharField(max_length=255, unique=True)
weight = fields.FloatField(null=True)
is_18 = fields.BooleanField(null=True)
name = fields.CharField(max_length=255, null=True)
wallet = fields.DecimalField(max_digits=12, decimal_places=2)
successor: fields.OneToOneRelation[typing.Union['User', typing.Any]] = fields.OneToOneField(source_field='successorId', model_name='models.User', to_field='id', related_name='predecessor', null=True)
predecessor: fields.ReverseRelation['User']
role = fields.CharEnumField(enum_type=Role, default=Role.USER)
posts: fields.ReverseRelation['Post']
biography = fields.JSONField()
group: fields.ForeignKeyRelation[typing.Union['Group', typing.Any]] = fields.ForeignKeyField(source_field='groupId', model_name='models.Group', to_field='id', related_name='user', null=True)
created_at = fields.DatetimeField(auto_now_add=True)
updated_at = fields.DatetimeField(auto_now=True)
class Meta(base.User.Meta):
table = 'User'
def __str__(self) -> str:
return f'User<{self.id}>'
class Post(base.Post, Model):
'''
fields:
- 🔟 id [Int] 🔑
- default: auto_increment()
- 🪢 user [User?]
'''
id = fields.IntField(pk=True)
user: fields.ForeignKeyRelation[typing.Union['User', typing.Any]] = fields.ForeignKeyField(model_name='models.User', to_field='id', related_name='posts', on_delete=fields.SET_NULL, null=True)
class Meta:
table = 'Post'
def __str__(self) -> str:
return f'Post<{self.id}>'
class Group(base.Group, Model):
'''
fields:
- 🔟 id [Int] 🔑
- default: auto_increment()
- 🆎 name [String]
- default: default
- ✅ public [Boolean]
- default: true
- 🪢 User [User]
'''
id = fields.IntField(pk=True)
name = fields.CharField(max_length=255, default='default')
public = fields.BooleanField(default=True)
user: fields.ReverseRelation['User']
class Meta:
table = 'groups'
def __str__(self) -> str:
return f'Group<{self.id}>'
__all__ = ['Role', 'User', 'Post', 'Group']
| 30.317757
| 203
| 0.633785
| 406
| 3,244
| 5.004926
| 0.302956
| 0.023622
| 0.035433
| 0.047244
| 0.313484
| 0.214075
| 0.15502
| 0.122539
| 0.075787
| 0
| 0
| 0.008661
| 0.217016
| 3,244
| 107
| 204
| 30.317757
| 0.781496
| 0.203761
| 0
| 0.14
| 1
| 0.04
| 0.160752
| 0.012526
| 0
| 0
| 0
| 0
| 0
| 1
| 0.06
| false
| 0.02
| 0.1
| 0.06
| 0.82
| 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
| 0
| 1
| 0
|
0
| 2
|
f80c608952146d7fe3d7ed75d5f4bc0dc27ba8ce
| 774
|
py
|
Python
|
pyretri/index/dim_processor/dim_processors_impl/l2_normalize.py
|
dongan-beta/PyRetri
|
8756d5d5813a5211b58855373b6c6cd33d7a11f6
|
[
"Apache-2.0"
] | 1,063
|
2020-04-21T12:42:05.000Z
|
2022-03-31T06:32:50.000Z
|
pyretri/index/dim_processor/dim_processors_impl/l2_normalize.py
|
dongan-beta/PyRetri
|
8756d5d5813a5211b58855373b6c6cd33d7a11f6
|
[
"Apache-2.0"
] | 39
|
2020-05-07T07:24:19.000Z
|
2022-02-02T23:49:23.000Z
|
pyretri/index/dim_processor/dim_processors_impl/l2_normalize.py
|
dongan-beta/PyRetri
|
8756d5d5813a5211b58855373b6c6cd33d7a11f6
|
[
"Apache-2.0"
] | 174
|
2020-04-26T04:33:11.000Z
|
2022-03-17T02:58:45.000Z
|
# -*- coding: utf-8 -*-
import numpy as np
from ..dim_processors_base import DimProcessorBase
from ...registry import DIMPROCESSORS
from sklearn.preprocessing import normalize
from typing import Dict, List
@DIMPROCESSORS.register
class L2Normalize(DimProcessorBase):
"""
L2 normalize the features.
"""
default_hyper_params = dict()
def __init__(self, feature_names: List[str], hps: Dict or None = None):
"""
Args:
feature_names (list): a list of features names to be loaded.
hps (dict): default hyper parameters in a dict (keys, values).
"""
super(L2Normalize, self).__init__(feature_names, hps)
def __call__(self, fea: np.ndarray) -> np.ndarray:
return normalize(fea, norm="l2")
| 27.642857
| 75
| 0.666667
| 94
| 774
| 5.287234
| 0.574468
| 0.072435
| 0.064386
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.008375
| 0.228682
| 774
| 27
| 76
| 28.666667
| 0.824121
| 0.241602
| 0
| 0
| 0
| 0
| 0.003759
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0.416667
| 0.083333
| 0.833333
| 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
| 0
| 1
| 0
|
0
| 2
|
f80e19316ce840fcc2138b746a64f522d8f4566b
| 866
|
py
|
Python
|
app/wqFull/G200/testAll.py
|
fkwai/geolearn
|
30cb4353d22af5020a48100d07ab04f465a315b0
|
[
"MIT"
] | null | null | null |
app/wqFull/G200/testAll.py
|
fkwai/geolearn
|
30cb4353d22af5020a48100d07ab04f465a315b0
|
[
"MIT"
] | null | null | null |
app/wqFull/G200/testAll.py
|
fkwai/geolearn
|
30cb4353d22af5020a48100d07ab04f465a315b0
|
[
"MIT"
] | 2
|
2021-04-04T02:45:59.000Z
|
2022-03-19T09:41:39.000Z
|
import pandas as pd
from hydroDL.data import usgs, gageII, gridMET, ntn, GLASS, transform, dbBasin
import numpy as np
import matplotlib.pyplot as plt
from hydroDL.post import axplot, figplot
from hydroDL import kPath, utils
import json
import os
import importlib
from hydroDL.master import basinFull
from hydroDL.app.waterQuality import WRTDS
# dataName = 'G200N'
# labelLst = ['QFPRT2C', 'FPRT2C', 'FPRT2QC', 'QFPT2C', 'QFRT2C']
dataName = 'G200'
labelLst = ['QFPRT2C']
trainLst = ['rmR20', 'rmL20', 'rmRT20', 'rmYr5', 'B10']
testLst = ['pkR20', 'pkL20', 'pkRT20', 'pkYr5', 'A10']
DF = dbBasin.DataFrameBasin(dataName)
for label in labelLst:
for trainSet, testSet in zip(trainLst, testLst):
outName = '{}-{}-{}'.format(dataName, label, trainSet)
print(outName)
yP, ycP = basinFull.testModel(outName, DF=DF, testSet=testSet, ep=500)
| 29.862069
| 78
| 0.706697
| 109
| 866
| 5.614679
| 0.633028
| 0.089869
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.045267
| 0.158199
| 866
| 28
| 79
| 30.928571
| 0.794239
| 0.094688
| 0
| 0
| 0
| 0
| 0.085897
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.52381
| 0
| 0.52381
| 0.047619
| 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
| 0
| 1
| 0
|
0
| 2
|
f810c90f204568fd67dca941d0e6266424f5517d
| 261
|
py
|
Python
|
test/unit/bot/test_bot.py
|
kubicki14/BurtTheCardKing
|
d0854ea08ffdffee687830097b0645069e263d9d
|
[
"MIT"
] | null | null | null |
test/unit/bot/test_bot.py
|
kubicki14/BurtTheCardKing
|
d0854ea08ffdffee687830097b0645069e263d9d
|
[
"MIT"
] | 1
|
2020-03-04T04:39:20.000Z
|
2020-03-04T04:39:20.000Z
|
test/unit/bot/test_bot.py
|
kubicki14/BurtTheCardKing
|
d0854ea08ffdffee687830097b0645069e263d9d
|
[
"MIT"
] | null | null | null |
import pytest
from bot.bot import Bot
class TestBotClass:
# Can't instantiate abstract classes. skipping test for abstract class.
def setup(self):
self.bot = 1
def test_init(self):
test_bot = 1
assert test_bot == self.bot
| 20.076923
| 75
| 0.659004
| 37
| 261
| 4.567568
| 0.540541
| 0.08284
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.010526
| 0.272031
| 261
| 12
| 76
| 21.75
| 0.878947
| 0.264368
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 1
| 0.25
| false
| 0
| 0.25
| 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
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 2
|
f8125fde876b086f96371a2951d0cf190eba3f48
| 1,437
|
py
|
Python
|
Hackerrank/30DaysOfCode/Day9-Recursion3.py
|
eduardormonteiro/PythonPersonalLibrary
|
561733bb8305c4e25a08f99c28b60ec77251ad67
|
[
"MIT"
] | null | null | null |
Hackerrank/30DaysOfCode/Day9-Recursion3.py
|
eduardormonteiro/PythonPersonalLibrary
|
561733bb8305c4e25a08f99c28b60ec77251ad67
|
[
"MIT"
] | null | null | null |
Hackerrank/30DaysOfCode/Day9-Recursion3.py
|
eduardormonteiro/PythonPersonalLibrary
|
561733bb8305c4e25a08f99c28b60ec77251ad67
|
[
"MIT"
] | null | null | null |
"""
Hackerrank
Day 9: Recursion 3
https://www.hackerrank.com/challenges/30-recursion/problem?h_r=email&unlock_token=bc6d5f3963afb26ed0b2f69c3f4f3ddb1826e1b2&utm_campaign=30_days_of_code_continuous&utm_medium=email&utm_source=daily_reminder
Objective
Today, we are learning about an algorithmic concept called recursion. Check out the Tutorial tab for learning materials and an instructional video.
Recursive Method for Calculating Factorial
Function Description
Complete the factorial function in the editor below. Be sure to use recursion.
factorial has the following paramter:
int n: an integer
Returns
int: the factorial of
Note: If you fail to use recursion or fail to name your recursive function factorial or Factorial, you will get a score of .
Input Format
A single integer, (the argument to pass to factorial).
Constraints
Your submission must contain a recursive function named factorial.
Sample Input
3
Sample Output
6
Explanation
Consider the following steps. After the recursive calls from step 1 to 3, results are accumulated from step 3 to 1.
"""
import math
import os
import random
import re
import sys
# Complete the factorial function below.
def factorial(n):
if n <= 1:
return 1
return n * factorial(n-1)
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
n = int(input())
result = factorial(n)
fptr.write(str(result) + '\n')
fptr.close()
| 22.809524
| 205
| 0.76618
| 213
| 1,437
| 5.079812
| 0.56338
| 0.047135
| 0.036969
| 0.051756
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.030151
| 0.169102
| 1,437
| 63
| 206
| 22.809524
| 0.876047
| 0.770355
| 0
| 0
| 0
| 0
| 0.06875
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.066667
| false
| 0
| 0.333333
| 0
| 0.533333
| 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
| 0
| 1
| 0
|
0
| 2
|
f8126dd049c2dae8dffb8bb81f37f683297e9ca7
| 408
|
py
|
Python
|
todolist/main/models.py
|
gda2048/TODOlist
|
cc6c359ab0a8d2f43ed82b19dfc0eb5d640f8b9f
|
[
"MIT"
] | 1
|
2019-12-19T19:04:02.000Z
|
2019-12-19T19:04:02.000Z
|
todolist/main/models.py
|
gda2048/TODOlist
|
cc6c359ab0a8d2f43ed82b19dfc0eb5d640f8b9f
|
[
"MIT"
] | 5
|
2020-02-12T02:57:13.000Z
|
2021-12-13T20:02:16.000Z
|
todolist/main/models.py
|
gda2048/TODOlist
|
cc6c359ab0a8d2f43ed82b19dfc0eb5d640f8b9f
|
[
"MIT"
] | null | null | null |
from django.db import models
class Card(models.Model):
"""
Stores all information about the TODOlist item
"""
id = models.AutoField(primary_key=True)
name = models.CharField('Название', max_length=50)
description = models.TextField('Описание', max_length=500)
is_archived = models.BooleanField('Архивировано', default=False)
def __str__(self):
return str(self.name)
| 29.142857
| 68
| 0.70098
| 50
| 408
| 5.56
| 0.8
| 0.064748
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.01506
| 0.186275
| 408
| 14
| 69
| 29.142857
| 0.822289
| 0.112745
| 0
| 0
| 0
| 0
| 0.080692
| 0
| 0
| 0
| 0
| 0.071429
| 0
| 1
| 0.125
| false
| 0
| 0.125
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 2
|
f816d939ecc6c4f196c356dcf81afa3b4caf0b94
| 2,175
|
py
|
Python
|
aioauth/responses.py
|
grmnz/aioauth
|
e69c989bc81284d60798599816c39ff91074a24b
|
[
"MIT"
] | null | null | null |
aioauth/responses.py
|
grmnz/aioauth
|
e69c989bc81284d60798599816c39ff91074a24b
|
[
"MIT"
] | null | null | null |
aioauth/responses.py
|
grmnz/aioauth
|
e69c989bc81284d60798599816c39ff91074a24b
|
[
"MIT"
] | null | null | null |
"""
.. code-block:: python
from aioauth import responses
Response objects used throughout the project.
----
"""
from dataclasses import dataclass, field
from http import HTTPStatus
from typing import Dict
from .collections import HTTPHeaderDict
from .constances import default_headers
from .types import ErrorType, TokenType
@dataclass
class ErrorResponse:
"""Response for errors."""
error: ErrorType
description: str
error_uri: str = ""
@dataclass
class AuthorizationCodeResponse:
"""Response for ``authorization_code``.
Used by :py:class:`aioauth.response_type.ResponseTypeAuthorizationCode`.
"""
code: str
scope: str
@dataclass
class NoneResponse:
"""Response for :py:class:`aioauth.response_type.ResponseTypeNone`.
See: `OAuth v2 multiple response types <openid.net/specs/oauth-v2-multiple-response-types-1_0.html#none>`_,
"""
@dataclass
class TokenResponse:
"""Response for valid token.
Used by :py:class:`aioauth.response_type.ResponseTypeToken`.
"""
expires_in: int
refresh_token_expires_in: int
access_token: str
refresh_token: str
scope: str
token_type: str = "Bearer"
@dataclass
class IdTokenResponse:
"""Response for OpenID id_token.
Used by :py:class:`aioauth.response_type.ResponseResponseTypeIdTokenTypeToken`.
"""
id_token: str
@dataclass
class TokenActiveIntrospectionResponse:
"""Response for a valid access token.
Used by :py:meth:`aioauth.server.AuthorizationServer.create_token_introspection_response`.
"""
scope: str
client_id: str
token_type: TokenType
expires_in: int
active: bool = True
@dataclass
class TokenInactiveIntrospectionResponse:
"""For an invalid, revoked or expired token.
Used by :py:meth:`aioauth.server.AuthorizationServer.create_token_introspection_response`.
"""
active: bool = False
@dataclass
class Response:
"""General response class.
Used by :py:class:`aioauth.server.AuthorizationServer`.
"""
content: Dict = field(default_factory=dict)
status_code: HTTPStatus = HTTPStatus.OK
headers: HTTPHeaderDict = default_headers
| 20.518868
| 111
| 0.722299
| 241
| 2,175
| 6.394191
| 0.381743
| 0.07268
| 0.031149
| 0.033744
| 0.240104
| 0.173913
| 0.173913
| 0.153147
| 0.105127
| 0.105127
| 0
| 0.00225
| 0.182529
| 2,175
| 105
| 112
| 20.714286
| 0.864454
| 0.44
| 0
| 0.302326
| 0
| 0
| 0.00542
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.139535
| 0
| 0.813953
| 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
| 0
| 0
| 1
| 0
|
0
| 2
|
f82ef0c0ee2c3fc021e7566fc3d68636a538299f
| 596
|
py
|
Python
|
scripts/load_sample_data.py
|
thobbs/logsandra
|
a17abc995dcb0573f3db2f714c1b47d3aff8b20a
|
[
"MIT"
] | 7
|
2015-05-18T13:00:54.000Z
|
2018-08-06T08:27:57.000Z
|
scripts/load_sample_data.py
|
thobbs/logsandra
|
a17abc995dcb0573f3db2f714c1b47d3aff8b20a
|
[
"MIT"
] | null | null | null |
scripts/load_sample_data.py
|
thobbs/logsandra
|
a17abc995dcb0573f3db2f714c1b47d3aff8b20a
|
[
"MIT"
] | 4
|
2015-06-16T11:09:53.000Z
|
2020-04-27T19:25:57.000Z
|
#!/usr/bin/env python
import sys
import os
sys.path.append(os.path.join(os.path.dirname('__file__'), '..', 'src'))
from random import randint
from datetime import datetime, timedelta
from logsandra.model.client import CassandraClient
client = CassandraClient('test', 'localhost', 9160, 3)
keywords = ['foo', 'bar', 'baz']
print "Loading sample data for the following keywords:", ', '.join(keywords)
today = datetime.now()
for i in range(1000):
d = today + timedelta(randint(-7, -1), randint(-3600*24, 3600*24))
client.add_log(d, 'test entry', 'here', [keywords[i % len(keywords)]])
| 28.380952
| 76
| 0.697987
| 84
| 596
| 4.892857
| 0.630952
| 0.029197
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.044487
| 0.13255
| 596
| 20
| 77
| 29.8
| 0.750484
| 0.033557
| 0
| 0
| 0
| 0
| 0.170435
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.384615
| null | null | 0.076923
| 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
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 2
|
f837f76576c4f735618a20e51681085aeb556de5
| 251
|
py
|
Python
|
led/hhh/rta2.py
|
tushar-tdm/osvi
|
813499162b7f487ccafa8c08d3e5bf6d05b074de
|
[
"CC-BY-3.0"
] | 3
|
2020-02-21T01:16:26.000Z
|
2020-07-12T08:06:11.000Z
|
led/hhh/rta2.py
|
tushar-tdm/osvi
|
813499162b7f487ccafa8c08d3e5bf6d05b074de
|
[
"CC-BY-3.0"
] | 6
|
2020-02-11T23:27:43.000Z
|
2022-03-11T23:34:39.000Z
|
led/hhh/rta2.py
|
tushar-tdm/osvi
|
813499162b7f487ccafa8c08d3e5bf6d05b074de
|
[
"CC-BY-3.0"
] | null | null | null |
import os
import sys
import serial
import time
import struct
ser = serial.Serial('/dev/ttyACM0',9600)
led = sys.argv[1]
act = sys.argv[2]
l = str(led)
"""a = str(act)"""
time.sleep(5)
ser.write(struct.pack(l.encode())
""" ser.write(l.encode()) """
| 14.764706
| 40
| 0.661355
| 43
| 251
| 3.860465
| 0.534884
| 0.084337
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.036697
| 0.131474
| 251
| 16
| 41
| 15.6875
| 0.724771
| 0
| 0
| 0
| 0
| 0
| 0.058824
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.454545
| null | null | 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
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 2
|
f8430cf263194ac34b0078e29e9eec8808714370
| 255
|
py
|
Python
|
ex10.6.py
|
Dikaeinstein/Think_Python
|
370cb5af25230ff20994206e2d8023fd1d4c2c74
|
[
"MIT"
] | null | null | null |
ex10.6.py
|
Dikaeinstein/Think_Python
|
370cb5af25230ff20994206e2d8023fd1d4c2c74
|
[
"MIT"
] | null | null | null |
ex10.6.py
|
Dikaeinstein/Think_Python
|
370cb5af25230ff20994206e2d8023fd1d4c2c74
|
[
"MIT"
] | null | null | null |
def is_anagram ( word1, word2 ):
'''
Returns True if word1 is 'anagram' of word2 or False if otherwise.
word1: str
word2: str
'''
return sorted(word1) == sorted(word2)
print(is_anagram("silence", "listen"))
| 19.615385
| 70
| 0.576471
| 31
| 255
| 4.677419
| 0.580645
| 0.186207
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.045198
| 0.305882
| 255
| 13
| 71
| 19.615385
| 0.774011
| 0.34902
| 0
| 0
| 0
| 0
| 0.093525
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.666667
| 0.333333
| 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
| 0
| 1
| 0
|
0
| 2
|
f86d356d798352c0185a9ec2592dc21b131a7ed8
| 337
|
py
|
Python
|
logconfig.py
|
Erick-Faster/gerbot-api
|
36d723c7e9df525b99fd4eff2da318e9046e7734
|
[
"Apache-2.0"
] | null | null | null |
logconfig.py
|
Erick-Faster/gerbot-api
|
36d723c7e9df525b99fd4eff2da318e9046e7734
|
[
"Apache-2.0"
] | null | null | null |
logconfig.py
|
Erick-Faster/gerbot-api
|
36d723c7e9df525b99fd4eff2da318e9046e7734
|
[
"Apache-2.0"
] | null | null | null |
import logging
import logging.config
logging.config.fileConfig('./instance/logging.conf')
# create logger
logger = logging.getLogger('Cognitive-API')
# 'application' code
'''
logger.debug('debug message')
logger.info('info message')
logger.warning('warn message')
logger.error('error message')
logger.critical('critical message')
'''
| 19.823529
| 52
| 0.756677
| 40
| 337
| 6.375
| 0.5
| 0.203922
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.086053
| 337
| 17
| 53
| 19.823529
| 0.827922
| 0.094955
| 0
| 0
| 0
| 0
| 0.257143
| 0.164286
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 2
|
f870be2bd112b621b44e0d7642b1d268ee31edf5
| 728
|
py
|
Python
|
subscriptions/subscription.py
|
iamsharmaapoorv/availability-checker
|
02fc28f495140f74fa38c02a3e4a5111e196151f
|
[
"MIT"
] | null | null | null |
subscriptions/subscription.py
|
iamsharmaapoorv/availability-checker
|
02fc28f495140f74fa38c02a3e4a5111e196151f
|
[
"MIT"
] | null | null | null |
subscriptions/subscription.py
|
iamsharmaapoorv/availability-checker
|
02fc28f495140f74fa38c02a3e4a5111e196151f
|
[
"MIT"
] | null | null | null |
from products.product import Product
from notifications.notification import Notification
from clients.client import Client
class Subscription:
def __init__(self, product: Product, timing: int):
self.notifications = []
self.product = product
self.timing = timing
def add_notification(self, notification: Notification) -> None:
self.notifications.append(notification)
def check_availability(self, client: Client):
return self.product.check_availability(client)
def send_notifications(self, client: Client):
for notification in self.notifications:
notification.notify(self.product.title,
self.product.content, client)
| 33.090909
| 67
| 0.696429
| 75
| 728
| 6.653333
| 0.36
| 0.11022
| 0.072144
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.228022
| 728
| 21
| 68
| 34.666667
| 0.8879
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.1875
| 0.0625
| 0.5625
| 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
| 0
| 1
| 0
|
0
| 2
|
f87515fbbdca8d3d26053fb65bc3d5ece4d188b8
| 290
|
py
|
Python
|
cursoDePythonNaPratica/aula18 - telegram.py
|
wemerson-henrique/kivy
|
3cb6061a2d19b01e86c3738206f30c8a853763d4
|
[
"MIT"
] | null | null | null |
cursoDePythonNaPratica/aula18 - telegram.py
|
wemerson-henrique/kivy
|
3cb6061a2d19b01e86c3738206f30c8a853763d4
|
[
"MIT"
] | null | null | null |
cursoDePythonNaPratica/aula18 - telegram.py
|
wemerson-henrique/kivy
|
3cb6061a2d19b01e86c3738206f30c8a853763d4
|
[
"MIT"
] | null | null | null |
import telepot
# Não criei um bot no telegram ainda, dessa forma este codigo não funciona
# TODO: Criar bot no telegram e pegar chave
bot = telepot.Bot("Aqui vai minha chave do Telegram")
def recebendoMsg(msg):
print(msg['text'])
bot.message_loop(recebendoMsg)
while True:
pass
| 20.714286
| 74
| 0.741379
| 45
| 290
| 4.755556
| 0.733333
| 0.046729
| 0.121495
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.17931
| 290
| 14
| 75
| 20.714286
| 0.89916
| 0.393103
| 0
| 0
| 0
| 0
| 0.206897
| 0
| 0
| 0
| 0
| 0.071429
| 0
| 1
| 0.142857
| false
| 0.142857
| 0.142857
| 0
| 0.285714
| 0.142857
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 2
|
f88205db59ac35f6745b81386eb53c57775a1972
| 3,164
|
py
|
Python
|
gcode_gen/gcode.py
|
tulth/gcode_gen
|
d6e276f2074d4fe66755b2ae06c5b4d85583c563
|
[
"BSD-3-Clause"
] | null | null | null |
gcode_gen/gcode.py
|
tulth/gcode_gen
|
d6e276f2074d4fe66755b2ae06c5b4d85583c563
|
[
"BSD-3-Clause"
] | null | null | null |
gcode_gen/gcode.py
|
tulth/gcode_gen
|
d6e276f2074d4fe66755b2ae06c5b4d85583c563
|
[
"BSD-3-Clause"
] | null | null | null |
'''
Library for gcode commands objects that render to strings.
'''
from .number import num2str
from .point import XYZ
class GcodePoint(XYZ):
def __str__(self):
ret_list = []
for label, val in zip(('X', 'Y', 'Z'), self.xyz):
if val is not None:
ret_list.append('{}{}'.format(label, num2str(val)))
return ' '.join(ret_list)
class BaseGcode(object):
def __init__(self, cmd, x=None, y=None, z=None):
super().__init__()
self.cmd = cmd
self.point = GcodePoint(x, y, z)
def __str__(self):
point_str = str(self.point)
if point_str != '':
point_str = ' ' + point_str
return '{}{}'.format(self.cmd, point_str)
class Home(BaseGcode):
'''homing cycle'''
def __init__(self):
super().__init__('$H')
class Comment(BaseGcode):
'''comment'''
def __str__(self):
return '({})'.format(self.cmd)
class UnitsInches(BaseGcode):
'''Set system units to inches'''
def __init__(self):
super().__init__('G20')
class UnitsMillimeters(BaseGcode):
'''Set system units to millimeters'''
def __init__(self):
super().__init__('G21')
class MotionAbsolute(BaseGcode):
'''Set system to use absolute motion'''
def __init__(self):
super().__init__('G90')
class MotionRelative(BaseGcode):
'''Set system to use relative motion'''
def __init__(self):
raise Exception('Not supported!!')
# super().__init__('G91')
class SetSpindleSpeed(BaseGcode):
'''Set spindle rotation speed'''
def __init__(self, spindle_speed):
super().__init__('S {}'.format(spindle_speed))
class SetFeedRate(BaseGcode):
'''set feed rate. CAUTION: feed rate is system units per minute'''
def __init__(self, feedRate):
self.feedRate = feedRate
super().__init__('F {}'.format(num2str(feedRate)))
class ActivateSpindleCW(BaseGcode):
'''Activate spindle (clockwise)'''
def __init__(self, ):
super().__init__('M3')
class StopSpindle(BaseGcode):
'''Stop spindle'''
def __init__(self, ):
super().__init__('M5')
class G0(BaseGcode):
'''linear NONcut motion'''
def __init__(self, x=None, y=None, z=None):
super().__init__('G0', x, y, z)
class G1(BaseGcode):
'''linear CUT motion'''
def __init__(self, x=None, y=None, z=None):
super().__init__('G1', x, y, z)
class BaseArcGcode(BaseGcode):
def __init__(self, cmd, x=None, y=None, z=None, r=None):
assert r is not None
# need at least one rectangular coordinate
assert not all(rect_coord is None for rect_coord in (x, y, z))
self.radius = r
super().__init__(cmd, x, y, z)
def __str__(self):
return "{} R{}".format(super().__str__(), num2str(self.radius))
class G2(BaseArcGcode):
'''clockwise arc CUT motion'''
def __init__(self, x=None, y=None, z=None, r=None):
super().__init__('G2', x, y, z, r)
class G3(BaseArcGcode):
'''clockwise arc CUT motion'''
def __init__(self, x=None, y=None, z=None, r=None):
super().__init__('G3', x, y, z, r)
| 24.913386
| 71
| 0.60335
| 400
| 3,164
| 4.3925
| 0.27
| 0.072851
| 0.09391
| 0.034149
| 0.310188
| 0.187251
| 0.172453
| 0.172453
| 0.164485
| 0.164485
| 0
| 0.009125
| 0.23799
| 3,164
| 126
| 72
| 25.111111
| 0.719618
| 0.155499
| 0
| 0.214286
| 0
| 0
| 0.02662
| 0
| 0
| 0
| 0
| 0
| 0.028571
| 1
| 0.271429
| false
| 0
| 0.028571
| 0.028571
| 0.6
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 2
|
f8837ac94ce790820bfbaf796665ce3cc290523c
| 101
|
py
|
Python
|
ex1.py
|
luismachado/python_project_euler
|
79798ee00c18f4f8cc1b397aa7c92f8175a3ed33
|
[
"MIT"
] | null | null | null |
ex1.py
|
luismachado/python_project_euler
|
79798ee00c18f4f8cc1b397aa7c92f8175a3ed33
|
[
"MIT"
] | null | null | null |
ex1.py
|
luismachado/python_project_euler
|
79798ee00c18f4f8cc1b397aa7c92f8175a3ed33
|
[
"MIT"
] | null | null | null |
sum = 0
for x in range(1,1000):
if x%3 == 0 or x%5 == 0:
sum += x
print ("Total is:", sum)
| 14.428571
| 26
| 0.485149
| 22
| 101
| 2.227273
| 0.681818
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.144928
| 0.316832
| 101
| 7
| 27
| 14.428571
| 0.565217
| 0
| 0
| 0
| 0
| 0
| 0.09375
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.2
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
f8885de2c1bf956e3ffc0a2b8c32753cd240d5eb
| 2,679
|
py
|
Python
|
can_decoder/Frame.py
|
justinwald99/can_decoder
|
abfdd839856745f88b3fc3a58c8bedbdd05d5616
|
[
"MIT"
] | 17
|
2020-08-18T02:34:57.000Z
|
2022-03-16T16:26:53.000Z
|
can_decoder/Frame.py
|
justinwald99/can_decoder
|
abfdd839856745f88b3fc3a58c8bedbdd05d5616
|
[
"MIT"
] | 4
|
2020-09-09T04:18:28.000Z
|
2022-02-23T10:29:14.000Z
|
can_decoder/Frame.py
|
justinwald99/can_decoder
|
abfdd839856745f88b3fc3a58c8bedbdd05d5616
|
[
"MIT"
] | 3
|
2021-08-18T18:30:43.000Z
|
2022-02-21T07:11:09.000Z
|
from typing import List, Optional
from can_decoder.Signal import Signal
class Frame(object):
id = 0 # type: int
size = 0 # type: int
signals = None # type: List[Signal]
multiplexer = None # type: Optional[Signal]
def __init__(
self,
frame_id: int,
frame_size: int,
) -> None:
self.id = frame_id
self.size = frame_size
self.signals = []
def _get_tuple(self):
return (
self.id,
self.size
)
def add_signal(self, *args, **kwargs) -> bool:
"""Add a new signal directly to this frame. All arguments are passed on the the Signal constructor.
:param args:
:param kwargs:
:return: True if signal added. False otherwise.
"""
result = False
# If only one argument is supplied, check if it already is a signal.
if len(args) == 1:
signal = args[0]
if isinstance(signal, Signal):
result = True
else:
try:
signal = Signal(*args, **kwargs)
except Exception:
signal = None
result = False
if result:
# Add the signal to the internal storage.
self.signals.append(signal)
# If the signal is a multiplexer, and no other signal is a multiplexer, set this as the root multiplexer.
if self.multiplexer is None and signal.is_multiplexer:
self.multiplexer = signal
elif signal.is_multiplexer:
raise ValueError(
"""
Multiplexed signal added to frame, but frame already contains a root multiplexed signal.
Should the signal have been added to another signal as a multiplexed value?
"""
)
pass
return result
def __str__(self) -> str:
result = f"CAN Frame with ID 0x{self.id:08X} - {self.size} bytes and {len(self.signals)} direct signals"
for signal in self.signals:
signal_str = str(signal)
for line in signal_str.splitlines():
result += f"\n\t{line}"
if self.multiplexer:
# TODO: Count multiplexed signals
pass
return result
def __hash__(self) -> int:
return hash(self._get_tuple())
def __eq__(self, other) -> bool:
if not isinstance(other, Frame):
return NotImplemented
return self._get_tuple() == other._get_tuple()
pass
| 29.43956
| 117
| 0.528182
| 297
| 2,679
| 4.649832
| 0.346801
| 0.031861
| 0.011586
| 0.028965
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.004332
| 0.39679
| 2,679
| 90
| 118
| 29.766667
| 0.850248
| 0.181411
| 0
| 0.122807
| 0
| 0.017544
| 0.052388
| 0
| 0
| 0
| 0
| 0.011111
| 0
| 1
| 0.105263
| false
| 0.052632
| 0.035088
| 0.035088
| 0.333333
| 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
| 0
| 0
|
0
| 2
|
f888a9124299142dae94af378de65454815c28dd
| 268
|
py
|
Python
|
Curso_de_Python_ Curso_em_Video/PythonTeste/operadoresAritmeticosEx007.py
|
DanilooSilva/Cursos_de_Python
|
8f167a4c6e16f01601e23b6f107578aa1454472d
|
[
"MIT"
] | null | null | null |
Curso_de_Python_ Curso_em_Video/PythonTeste/operadoresAritmeticosEx007.py
|
DanilooSilva/Cursos_de_Python
|
8f167a4c6e16f01601e23b6f107578aa1454472d
|
[
"MIT"
] | null | null | null |
Curso_de_Python_ Curso_em_Video/PythonTeste/operadoresAritmeticosEx007.py
|
DanilooSilva/Cursos_de_Python
|
8f167a4c6e16f01601e23b6f107578aa1454472d
|
[
"MIT"
] | null | null | null |
largura = float(input('Digite a largura da parede: '))
altura = float(input('Digite a altura da parede: '))
area = largura * altura
tinta = area / 2
print('A área da parede é de {}'.format(area))
print('Será necessário para pintar {} litros de tinta'.format(tinta))
| 29.777778
| 69
| 0.697761
| 41
| 268
| 4.560976
| 0.512195
| 0.128342
| 0.171123
| 0.181818
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.004444
| 0.160448
| 268
| 8
| 70
| 33.5
| 0.826667
| 0
| 0
| 0
| 0
| 0
| 0.466418
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.333333
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
f888dc9c7ee0e666487347bc03cdcb3278274bed
| 174
|
py
|
Python
|
terraform.py
|
kyleslater/254-space-log
|
7496ff4e134b1a916580d8c0f8a0493e4863e9a2
|
[
"MIT"
] | null | null | null |
terraform.py
|
kyleslater/254-space-log
|
7496ff4e134b1a916580d8c0f8a0493e4863e9a2
|
[
"MIT"
] | null | null | null |
terraform.py
|
kyleslater/254-space-log
|
7496ff4e134b1a916580d8c0f8a0493e4863e9a2
|
[
"MIT"
] | null | null | null |
#Kyle Slater
import re
def terraformable(content:str):
pattern = re.compile("\"TerraformState\":\"Terraformable\"")
matches = pattern.findall(content)
return len(matches)
| 24.857143
| 61
| 0.752874
| 20
| 174
| 6.55
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.097701
| 174
| 7
| 62
| 24.857143
| 0.834395
| 0.063218
| 0
| 0
| 0
| 0
| 0.018405
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.2
| 0
| 0.6
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
f88a9c72050c19a376ad171a7a2391d21f7e3ac6
| 256
|
py
|
Python
|
bugzilla_service/bzservice_flask/app/tests/test_flaskr.py
|
5GEVE/5G-EVE-PORTAL-BACKEND-tsb
|
3fe3140b26d30e7e7ff1a034315183eaed60a599
|
[
"MIT"
] | null | null | null |
bugzilla_service/bzservice_flask/app/tests/test_flaskr.py
|
5GEVE/5G-EVE-PORTAL-BACKEND-tsb
|
3fe3140b26d30e7e7ff1a034315183eaed60a599
|
[
"MIT"
] | 3
|
2021-02-08T20:38:29.000Z
|
2021-06-02T00:55:43.000Z
|
file_storage_service/tests/test_flaskr.py
|
5GEVE/5G-EVE-PORTAL-BACKEND-fs
|
27d5d10fa39e3007cfee2e48e3b95047abf2c144
|
[
"MIT"
] | null | null | null |
import os
import tempfile
import requests
api_url = "http://127.0.0.1:8989"
def test_no_token():
"""Request home without token"""
response = requests.get(api_url+"/isvalid")
print(response.status_code)
assert response.status_code == 401
| 23.272727
| 47
| 0.707031
| 37
| 256
| 4.72973
| 0.702703
| 0.068571
| 0.205714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.060748
| 0.164063
| 256
| 11
| 48
| 23.272727
| 0.757009
| 0.101563
| 0
| 0
| 0
| 0
| 0.128889
| 0
| 0
| 0
| 0
| 0
| 0.125
| 1
| 0.125
| false
| 0
| 0.375
| 0
| 0.5
| 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
| 0
| 0
|
0
| 2
|
f8b628877707fa6132110ae047367879935e3268
| 444
|
py
|
Python
|
mezzanine_pagedown/defaults.py
|
eht16/mezzanine-pagedown
|
e6090f5713097e664e85b279a4a17febb73b00a1
|
[
"BSD-2-Clause"
] | 94
|
2015-01-28T15:46:02.000Z
|
2020-11-02T12:56:15.000Z
|
mezzanine_pagedown/defaults.py
|
eht16/mezzanine-pagedown
|
e6090f5713097e664e85b279a4a17febb73b00a1
|
[
"BSD-2-Clause"
] | 56
|
2015-04-05T03:18:41.000Z
|
2021-08-29T00:50:57.000Z
|
mezzanine_pagedown/defaults.py
|
eht16/mezzanine-pagedown
|
e6090f5713097e664e85b279a4a17febb73b00a1
|
[
"BSD-2-Clause"
] | 38
|
2015-08-26T08:10:12.000Z
|
2021-06-11T19:36:31.000Z
|
from mezzanine.conf import register_setting
register_setting(
name="PAGEDOWN_SERVER_SIDE_PREVIEW",
description="Render previews on the server using the same "
"converter that generates the actual pages.",
editable=False,
default=False,
)
register_setting(
name="PAGEDOWN_MARKDOWN_EXTENSIONS",
description="A tuple specifying enabled python-markdown extensions.",
editable=False,
default=(),
)
| 24.666667
| 73
| 0.725225
| 49
| 444
| 6.408163
| 0.673469
| 0.143312
| 0.121019
| 0.171975
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.193694
| 444
| 17
| 74
| 26.117647
| 0.877095
| 0
| 0
| 0.285714
| 0
| 0
| 0.443694
| 0.126126
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.071429
| 0
| 0.071429
| 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
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
f8bab3dc683ade4a29b7e25ca1a99e68f49ac849
| 462
|
py
|
Python
|
30/00/1.py
|
pylangstudy/201707
|
c1cc72667f1e0b6e8eef4ee85067d7fa4ca500b6
|
[
"CC0-1.0"
] | null | null | null |
30/00/1.py
|
pylangstudy/201707
|
c1cc72667f1e0b6e8eef4ee85067d7fa4ca500b6
|
[
"CC0-1.0"
] | 46
|
2017-06-30T22:19:07.000Z
|
2017-07-31T22:51:31.000Z
|
30/00/1.py
|
pylangstudy/201707
|
c1cc72667f1e0b6e8eef4ee85067d7fa4ca500b6
|
[
"CC0-1.0"
] | null | null | null |
def RetT(): print('True'); return True
def RetF(): print('False'); return False
print('----- or -----')
RetT() or RetF()
RetF() or RetT() #第一引数が偽のときにのみ、第二引数が評価されます。
print('----- and -----')
RetT() and RetF() #第一引数が真のときにのみ、第二引数が評価されます。
RetF() and RetT() #第一引数が真のときにのみ、第二引数が評価されます。
print('----- not -----')
print(not True and True)
print(False or not True)
print(not True == True)
#print(True == not True) #SyntaxError: invalid syntax
print(True == (not True))
| 25.666667
| 53
| 0.645022
| 61
| 462
| 4.885246
| 0.262295
| 0.11745
| 0.080537
| 0.107383
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.12987
| 462
| 17
| 54
| 27.176471
| 0.741294
| 0.272727
| 0
| 0
| 0
| 0
| 0.160121
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.153846
| true
| 0
| 0
| 0
| 0.153846
| 0.692308
| 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
| 0
| 0
| 0
| 1
|
0
| 2
|
f8d06ccac9f1d3cb709d0653c37332224ffae6f4
| 20,941
|
py
|
Python
|
pysnmp/DPS-MIB-V38.py
|
agustinhenze/mibs.snmplabs.com
|
1fc5c07860542b89212f4c8ab807057d9a9206c7
|
[
"Apache-2.0"
] | 11
|
2021-02-02T16:27:16.000Z
|
2021-08-31T06:22:49.000Z
|
pysnmp/DPS-MIB-V38.py
|
agustinhenze/mibs.snmplabs.com
|
1fc5c07860542b89212f4c8ab807057d9a9206c7
|
[
"Apache-2.0"
] | 75
|
2021-02-24T17:30:31.000Z
|
2021-12-08T00:01:18.000Z
|
pysnmp/DPS-MIB-V38.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 DPS-MIB-V38 (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DPS-MIB-V38
# Produced by pysmi-0.3.4 at Mon Apr 29 18:39:21 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)
#
Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ValueRangeConstraint, ConstraintsIntersection, ConstraintsUnion, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsIntersection", "ConstraintsUnion", "ValueSizeConstraint")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
iso, ModuleIdentity, Unsigned32, Counter64, Gauge32, ObjectIdentity, IpAddress, enterprises, NotificationType, Integer32, Bits, TimeTicks, MibScalar, MibTable, MibTableRow, MibTableColumn, MibIdentifier, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "iso", "ModuleIdentity", "Unsigned32", "Counter64", "Gauge32", "ObjectIdentity", "IpAddress", "enterprises", "NotificationType", "Integer32", "Bits", "TimeTicks", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "MibIdentifier", "Counter32")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
dpsInc = MibIdentifier((1, 3, 6, 1, 4, 1, 2682))
dpsAlarmControl = MibIdentifier((1, 3, 6, 1, 4, 1, 2682, 1))
tmonXM = MibIdentifier((1, 3, 6, 1, 4, 1, 2682, 1, 1))
tmonIdent = MibIdentifier((1, 3, 6, 1, 4, 1, 2682, 1, 1, 1))
tmonIdentManufacturer = MibScalar((1, 3, 6, 1, 4, 1, 2682, 1, 1, 1, 1), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: tmonIdentManufacturer.setStatus('mandatory')
tmonIdentModel = MibScalar((1, 3, 6, 1, 4, 1, 2682, 1, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: tmonIdentModel.setStatus('mandatory')
tmonIdentSoftwareVersion = MibScalar((1, 3, 6, 1, 4, 1, 2682, 1, 1, 1, 3), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: tmonIdentSoftwareVersion.setStatus('mandatory')
tmonAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 2682, 1, 1, 2), )
if mibBuilder.loadTexts: tmonAlarmTable.setStatus('mandatory')
tmonAlarmEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2682, 1, 1, 2, 1), ).setIndexNames((0, "DPS-MIB-V38", "tmonAIndex"))
if mibBuilder.loadTexts: tmonAlarmEntry.setStatus('mandatory')
tmonAIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2682, 1, 1, 2, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: tmonAIndex.setStatus('mandatory')
tmonASite = MibTableColumn((1, 3, 6, 1, 4, 1, 2682, 1, 1, 2, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(30, 30)).setFixedLength(30)).setMaxAccess("readonly")
if mibBuilder.loadTexts: tmonASite.setStatus('mandatory')
tmonADesc = MibTableColumn((1, 3, 6, 1, 4, 1, 2682, 1, 1, 2, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(40, 40)).setFixedLength(40)).setMaxAccess("readonly")
if mibBuilder.loadTexts: tmonADesc.setStatus('mandatory')
tmonAState = MibTableColumn((1, 3, 6, 1, 4, 1, 2682, 1, 1, 2, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: tmonAState.setStatus('mandatory')
tmonASeverity = MibTableColumn((1, 3, 6, 1, 4, 1, 2682, 1, 1, 2, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: tmonASeverity.setStatus('mandatory')
tmonAChgDate = MibTableColumn((1, 3, 6, 1, 4, 1, 2682, 1, 1, 2, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: tmonAChgDate.setStatus('mandatory')
tmonAChgTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2682, 1, 1, 2, 1, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: tmonAChgTime.setStatus('mandatory')
tmonAAuxDesc = MibTableColumn((1, 3, 6, 1, 4, 1, 2682, 1, 1, 2, 1, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(30, 30)).setFixedLength(30)).setMaxAccess("readonly")
if mibBuilder.loadTexts: tmonAAuxDesc.setStatus('mandatory')
tmonADispDesc = MibTableColumn((1, 3, 6, 1, 4, 1, 2682, 1, 1, 2, 1, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(14, 14)).setFixedLength(14)).setMaxAccess("readonly")
if mibBuilder.loadTexts: tmonADispDesc.setStatus('mandatory')
tmonAPntType = MibTableColumn((1, 3, 6, 1, 4, 1, 2682, 1, 1, 2, 1, 10), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: tmonAPntType.setStatus('mandatory')
tmonAPort = MibTableColumn((1, 3, 6, 1, 4, 1, 2682, 1, 1, 2, 1, 11), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: tmonAPort.setStatus('mandatory')
tmonAAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 2682, 1, 1, 2, 1, 12), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: tmonAAddress.setStatus('mandatory')
tmonADisplay = MibTableColumn((1, 3, 6, 1, 4, 1, 2682, 1, 1, 2, 1, 13), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: tmonADisplay.setStatus('mandatory')
tmonAPoint = MibTableColumn((1, 3, 6, 1, 4, 1, 2682, 1, 1, 2, 1, 14), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: tmonAPoint.setStatus('mandatory')
tmonCommandGrid = MibIdentifier((1, 3, 6, 1, 4, 1, 2682, 1, 1, 3))
tmonCPType = MibScalar((1, 3, 6, 1, 4, 1, 2682, 1, 1, 3, 1), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: tmonCPType.setStatus('mandatory')
tmonCPort = MibScalar((1, 3, 6, 1, 4, 1, 2682, 1, 1, 3, 2), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: tmonCPort.setStatus('mandatory')
tmonCAddress = MibScalar((1, 3, 6, 1, 4, 1, 2682, 1, 1, 3, 3), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: tmonCAddress.setStatus('mandatory')
tmonCDisplay = MibScalar((1, 3, 6, 1, 4, 1, 2682, 1, 1, 3, 4), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: tmonCDisplay.setStatus('mandatory')
tmonCPoint = MibScalar((1, 3, 6, 1, 4, 1, 2682, 1, 1, 3, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 64))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: tmonCPoint.setStatus('mandatory')
tmonCEvent = MibScalar((1, 3, 6, 1, 4, 1, 2682, 1, 1, 3, 6), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: tmonCEvent.setStatus('mandatory')
tmonCAction = MibScalar((1, 3, 6, 1, 4, 1, 2682, 1, 1, 3, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 17, 18, 19))).clone(namedValues=NamedValues(("latch", 1), ("release", 2), ("momentary", 3), ("ack", 17), ("tag", 18), ("untag", 19)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: tmonCAction.setStatus('mandatory')
tmonCAuxText = MibScalar((1, 3, 6, 1, 4, 1, 2682, 1, 1, 3, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(30, 30)).setFixedLength(30)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: tmonCAuxText.setStatus('mandatory')
tmonCResult = MibScalar((1, 3, 6, 1, 4, 1, 2682, 1, 1, 3, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("success", 1), ("failure", 2), ("pending", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: tmonCResult.setStatus('mandatory')
dpsRTU = MibIdentifier((1, 3, 6, 1, 4, 1, 2682, 1, 2))
dpsRTUIdent = MibIdentifier((1, 3, 6, 1, 4, 1, 2682, 1, 2, 1))
dpsRTUManufacturer = MibScalar((1, 3, 6, 1, 4, 1, 2682, 1, 2, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(30, 30)).setFixedLength(30)).setMaxAccess("readonly")
if mibBuilder.loadTexts: dpsRTUManufacturer.setStatus('mandatory')
dpsRTUModel = MibScalar((1, 3, 6, 1, 4, 1, 2682, 1, 2, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(30, 30)).setFixedLength(30)).setMaxAccess("readonly")
if mibBuilder.loadTexts: dpsRTUModel.setStatus('mandatory')
dpsRTUFirmwareVersion = MibScalar((1, 3, 6, 1, 4, 1, 2682, 1, 2, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(20, 20)).setFixedLength(20)).setMaxAccess("readonly")
if mibBuilder.loadTexts: dpsRTUFirmwareVersion.setStatus('mandatory')
dpsRTUDateTime = MibScalar((1, 3, 6, 1, 4, 1, 2682, 1, 2, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(23, 23)).setFixedLength(23)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: dpsRTUDateTime.setStatus('mandatory')
dpsRTUSyncReq = MibScalar((1, 3, 6, 1, 4, 1, 2682, 1, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1))).clone(namedValues=NamedValues(("sync", 1)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: dpsRTUSyncReq.setStatus('mandatory')
dpsRTUDisplayGrid = MibTable((1, 3, 6, 1, 4, 1, 2682, 1, 2, 2), )
if mibBuilder.loadTexts: dpsRTUDisplayGrid.setStatus('mandatory')
dpsRTUDisplayEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2682, 1, 2, 2, 1), ).setIndexNames((0, "DPS-MIB-V38", "dpsRTUPort"), (0, "DPS-MIB-V38", "dpsRTUAddress"), (0, "DPS-MIB-V38", "dpsRTUDisplay"))
if mibBuilder.loadTexts: dpsRTUDisplayEntry.setStatus('mandatory')
dpsRTUPort = MibTableColumn((1, 3, 6, 1, 4, 1, 2682, 1, 2, 2, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: dpsRTUPort.setStatus('mandatory')
dpsRTUAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 2682, 1, 2, 2, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: dpsRTUAddress.setStatus('mandatory')
dpsRTUDisplay = MibTableColumn((1, 3, 6, 1, 4, 1, 2682, 1, 2, 2, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: dpsRTUDisplay.setStatus('mandatory')
dpsRTUDispDesc = MibTableColumn((1, 3, 6, 1, 4, 1, 2682, 1, 2, 2, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(20, 20)).setFixedLength(20)).setMaxAccess("readonly")
if mibBuilder.loadTexts: dpsRTUDispDesc.setStatus('mandatory')
dpsRTUPntMap = MibTableColumn((1, 3, 6, 1, 4, 1, 2682, 1, 2, 2, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(71, 71)).setFixedLength(71)).setMaxAccess("readonly")
if mibBuilder.loadTexts: dpsRTUPntMap.setStatus('mandatory')
dpsRTUControlGrid = MibIdentifier((1, 3, 6, 1, 4, 1, 2682, 1, 2, 3))
dpsRTUCPort = MibScalar((1, 3, 6, 1, 4, 1, 2682, 1, 2, 3, 1), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: dpsRTUCPort.setStatus('mandatory')
dpsRTUCAddress = MibScalar((1, 3, 6, 1, 4, 1, 2682, 1, 2, 3, 2), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: dpsRTUCAddress.setStatus('mandatory')
dpsRTUCDisplay = MibScalar((1, 3, 6, 1, 4, 1, 2682, 1, 2, 3, 3), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: dpsRTUCDisplay.setStatus('mandatory')
dpsRTUCPoint = MibScalar((1, 3, 6, 1, 4, 1, 2682, 1, 2, 3, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 64))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: dpsRTUCPoint.setStatus('mandatory')
dpsRTUCAction = MibScalar((1, 3, 6, 1, 4, 1, 2682, 1, 2, 3, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("latch", 1), ("release", 2), ("momentary", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: dpsRTUCAction.setStatus('mandatory')
dpsRTUAlarmGrid = MibTable((1, 3, 6, 1, 4, 1, 2682, 1, 2, 5), )
if mibBuilder.loadTexts: dpsRTUAlarmGrid.setStatus('mandatory')
dpsRTUAlarmEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2682, 1, 2, 5, 1), ).setIndexNames((0, "DPS-MIB-V38", "dpsRTUAPort"), (0, "DPS-MIB-V38", "dpsRTUAAddress"), (0, "DPS-MIB-V38", "dpsRTUADisplay"), (0, "DPS-MIB-V38", "dpsRTUAPoint"))
if mibBuilder.loadTexts: dpsRTUAlarmEntry.setStatus('mandatory')
dpsRTUAPort = MibTableColumn((1, 3, 6, 1, 4, 1, 2682, 1, 2, 5, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: dpsRTUAPort.setStatus('mandatory')
dpsRTUAAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 2682, 1, 2, 5, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: dpsRTUAAddress.setStatus('mandatory')
dpsRTUADisplay = MibTableColumn((1, 3, 6, 1, 4, 1, 2682, 1, 2, 5, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: dpsRTUADisplay.setStatus('mandatory')
dpsRTUAPoint = MibTableColumn((1, 3, 6, 1, 4, 1, 2682, 1, 2, 5, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: dpsRTUAPoint.setStatus('mandatory')
dpsRTUAPntDesc = MibTableColumn((1, 3, 6, 1, 4, 1, 2682, 1, 2, 5, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(21, 21)).setFixedLength(21)).setMaxAccess("readonly")
if mibBuilder.loadTexts: dpsRTUAPntDesc.setStatus('mandatory')
dpsRTUAState = MibTableColumn((1, 3, 6, 1, 4, 1, 2682, 1, 2, 5, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: dpsRTUAState.setStatus('mandatory')
tmonCRalarmSet = NotificationType((1, 3, 6, 1, 4, 1, 2682, 1, 1) + (0,10)).setObjects(("DPS-MIB-V38", "tmonASite"), ("DPS-MIB-V38", "tmonADesc"), ("DPS-MIB-V38", "tmonAState"), ("DPS-MIB-V38", "tmonASeverity"), ("DPS-MIB-V38", "tmonAChgDate"), ("DPS-MIB-V38", "tmonAChgTime"), ("DPS-MIB-V38", "tmonAAuxDesc"), ("DPS-MIB-V38", "tmonADispDesc"), ("DPS-MIB-V38", "tmonAPntType"), ("DPS-MIB-V38", "tmonAPort"), ("DPS-MIB-V38", "tmonAAddress"), ("DPS-MIB-V38", "tmonADisplay"), ("DPS-MIB-V38", "tmonAPoint"), ("DPS-MIB-V38", "tmonCEvent"))
tmonCRalarmClr = NotificationType((1, 3, 6, 1, 4, 1, 2682, 1, 1) + (0,11)).setObjects(("DPS-MIB-V38", "tmonASite"), ("DPS-MIB-V38", "tmonADesc"), ("DPS-MIB-V38", "tmonAState"), ("DPS-MIB-V38", "tmonASeverity"), ("DPS-MIB-V38", "tmonAChgDate"), ("DPS-MIB-V38", "tmonAChgTime"), ("DPS-MIB-V38", "tmonAAuxDesc"), ("DPS-MIB-V38", "tmonADispDesc"), ("DPS-MIB-V38", "tmonAPntType"), ("DPS-MIB-V38", "tmonAPort"), ("DPS-MIB-V38", "tmonAAddress"), ("DPS-MIB-V38", "tmonADisplay"), ("DPS-MIB-V38", "tmonAPoint"), ("DPS-MIB-V38", "tmonCEvent"))
tmonMJalarmSet = NotificationType((1, 3, 6, 1, 4, 1, 2682, 1, 1) + (0,12)).setObjects(("DPS-MIB-V38", "tmonASite"), ("DPS-MIB-V38", "tmonADesc"), ("DPS-MIB-V38", "tmonAState"), ("DPS-MIB-V38", "tmonASeverity"), ("DPS-MIB-V38", "tmonAChgDate"), ("DPS-MIB-V38", "tmonAChgTime"), ("DPS-MIB-V38", "tmonAAuxDesc"), ("DPS-MIB-V38", "tmonADispDesc"), ("DPS-MIB-V38", "tmonAPntType"), ("DPS-MIB-V38", "tmonAPort"), ("DPS-MIB-V38", "tmonAAddress"), ("DPS-MIB-V38", "tmonADisplay"), ("DPS-MIB-V38", "tmonAPoint"), ("DPS-MIB-V38", "tmonCEvent"))
tmonMJalarmClr = NotificationType((1, 3, 6, 1, 4, 1, 2682, 1, 1) + (0,13)).setObjects(("DPS-MIB-V38", "tmonASite"), ("DPS-MIB-V38", "tmonADesc"), ("DPS-MIB-V38", "tmonAState"), ("DPS-MIB-V38", "tmonASeverity"), ("DPS-MIB-V38", "tmonAChgDate"), ("DPS-MIB-V38", "tmonAChgTime"), ("DPS-MIB-V38", "tmonAAuxDesc"), ("DPS-MIB-V38", "tmonADispDesc"), ("DPS-MIB-V38", "tmonAPntType"), ("DPS-MIB-V38", "tmonAPort"), ("DPS-MIB-V38", "tmonAAddress"), ("DPS-MIB-V38", "tmonADisplay"), ("DPS-MIB-V38", "tmonAPoint"), ("DPS-MIB-V38", "tmonCEvent"))
tmonMNalarmSet = NotificationType((1, 3, 6, 1, 4, 1, 2682, 1, 1) + (0,14)).setObjects(("DPS-MIB-V38", "tmonASite"), ("DPS-MIB-V38", "tmonADesc"), ("DPS-MIB-V38", "tmonAState"), ("DPS-MIB-V38", "tmonASeverity"), ("DPS-MIB-V38", "tmonAChgDate"), ("DPS-MIB-V38", "tmonAChgTime"), ("DPS-MIB-V38", "tmonAAuxDesc"), ("DPS-MIB-V38", "tmonADispDesc"), ("DPS-MIB-V38", "tmonAPntType"), ("DPS-MIB-V38", "tmonAPort"), ("DPS-MIB-V38", "tmonAAddress"), ("DPS-MIB-V38", "tmonADisplay"), ("DPS-MIB-V38", "tmonAPoint"), ("DPS-MIB-V38", "tmonCEvent"))
tmonMNalarmClr = NotificationType((1, 3, 6, 1, 4, 1, 2682, 1, 1) + (0,15)).setObjects(("DPS-MIB-V38", "tmonASite"), ("DPS-MIB-V38", "tmonADesc"), ("DPS-MIB-V38", "tmonAState"), ("DPS-MIB-V38", "tmonASeverity"), ("DPS-MIB-V38", "tmonAChgDate"), ("DPS-MIB-V38", "tmonAChgTime"), ("DPS-MIB-V38", "tmonAAuxDesc"), ("DPS-MIB-V38", "tmonADispDesc"), ("DPS-MIB-V38", "tmonAPntType"), ("DPS-MIB-V38", "tmonAPort"), ("DPS-MIB-V38", "tmonAAddress"), ("DPS-MIB-V38", "tmonADisplay"), ("DPS-MIB-V38", "tmonAPoint"), ("DPS-MIB-V38", "tmonCEvent"))
tmonSTalarmSet = NotificationType((1, 3, 6, 1, 4, 1, 2682, 1, 1) + (0,16)).setObjects(("DPS-MIB-V38", "tmonASite"), ("DPS-MIB-V38", "tmonADesc"), ("DPS-MIB-V38", "tmonAState"), ("DPS-MIB-V38", "tmonASeverity"), ("DPS-MIB-V38", "tmonAChgDate"), ("DPS-MIB-V38", "tmonAChgTime"), ("DPS-MIB-V38", "tmonAAuxDesc"), ("DPS-MIB-V38", "tmonADispDesc"), ("DPS-MIB-V38", "tmonAPntType"), ("DPS-MIB-V38", "tmonAPort"), ("DPS-MIB-V38", "tmonAAddress"), ("DPS-MIB-V38", "tmonADisplay"), ("DPS-MIB-V38", "tmonAPoint"), ("DPS-MIB-V38", "tmonCEvent"))
tmonSTalarmClr = NotificationType((1, 3, 6, 1, 4, 1, 2682, 1, 1) + (0,17)).setObjects(("DPS-MIB-V38", "tmonASite"), ("DPS-MIB-V38", "tmonADesc"), ("DPS-MIB-V38", "tmonAState"), ("DPS-MIB-V38", "tmonASeverity"), ("DPS-MIB-V38", "tmonAChgDate"), ("DPS-MIB-V38", "tmonAChgTime"), ("DPS-MIB-V38", "tmonAAuxDesc"), ("DPS-MIB-V38", "tmonADispDesc"), ("DPS-MIB-V38", "tmonAPntType"), ("DPS-MIB-V38", "tmonAPort"), ("DPS-MIB-V38", "tmonAAddress"), ("DPS-MIB-V38", "tmonADisplay"), ("DPS-MIB-V38", "tmonAPoint"), ("DPS-MIB-V38", "tmonCEvent"))
dpsRTUPointSet = NotificationType((1, 3, 6, 1, 4, 1, 2682, 1, 2) + (0,20)).setObjects(("DPS-MIB-V38", "sysDescr"), ("DPS-MIB-V38", "sysLocation"), ("DPS-MIB-V38", "dpsRTUDateTime"), ("DPS-MIB-V38", "dpsRTUAPort"), ("DPS-MIB-V38", "dpsRTUAAddress"), ("DPS-MIB-V38", "dpsRTUADisplay"), ("DPS-MIB-V38", "dpsRTUAPoint"), ("DPS-MIB-V38", "dpsRTUAPntDesc"), ("DPS-MIB-V38", "dpsRTUAState"))
dpsRTUPointClr = NotificationType((1, 3, 6, 1, 4, 1, 2682, 1, 2) + (0,21)).setObjects(("DPS-MIB-V38", "sysDescr"), ("DPS-MIB-V38", "sysLocation"), ("DPS-MIB-V38", "dpsRTUDateTime"), ("DPS-MIB-V38", "dpsRTUAPort"), ("DPS-MIB-V38", "dpsRTUCAddress"), ("DPS-MIB-V38", "dpsRTUADisplay"), ("DPS-MIB-V38", "dpsRTUAPoint"), ("DPS-MIB-V38", "dpsRTUAPntDesc"), ("DPS-MIB-V38", "dpsRTUAState"))
dpsRTUsumPSet = NotificationType((1, 3, 6, 1, 4, 1, 2682, 1, 2) + (0,101)).setObjects(("DPS-MIB-V38", "sysDescr"), ("DPS-MIB-V38", "sysLocation"), ("DPS-MIB-V38", "dpsRTUDateTime"))
dpsRTUsumPClr = NotificationType((1, 3, 6, 1, 4, 1, 2682, 1, 2) + (0,102)).setObjects(("DPS-MIB-V38", "sysDescr"), ("DPS-MIB-V38", "sysLocation"), ("DPS-MIB-V38", "dpsRTUDateTime"))
dpsRTUcomFailed = NotificationType((1, 3, 6, 1, 4, 1, 2682, 1, 2) + (0,103)).setObjects(("DPS-MIB-V38", "sysDescr"), ("DPS-MIB-V38", "sysLocation"), ("DPS-MIB-V38", "dpsRTUDateTime"))
dpsRTUcomRestored = NotificationType((1, 3, 6, 1, 4, 1, 2682, 1, 2) + (0,104)).setObjects(("DPS-MIB-V38", "sysDescr"), ("DPS-MIB-V38", "sysLocation"), ("DPS-MIB-V38", "dpsRTUDateTime"))
mibBuilder.exportSymbols("DPS-MIB-V38", tmonAlarmEntry=tmonAlarmEntry, tmonAIndex=tmonAIndex, tmonAChgDate=tmonAChgDate, tmonCAddress=tmonCAddress, tmonSTalarmClr=tmonSTalarmClr, dpsRTUFirmwareVersion=dpsRTUFirmwareVersion, tmonAChgTime=tmonAChgTime, dpsRTUCPoint=dpsRTUCPoint, dpsRTU=dpsRTU, dpsRTUPntMap=dpsRTUPntMap, dpsRTUsumPSet=dpsRTUsumPSet, tmonASite=tmonASite, tmonAlarmTable=tmonAlarmTable, dpsRTUcomFailed=dpsRTUcomFailed, tmonCRalarmSet=tmonCRalarmSet, dpsRTUDisplayEntry=dpsRTUDisplayEntry, dpsRTUAlarmGrid=dpsRTUAlarmGrid, tmonAAddress=tmonAAddress, dpsRTUADisplay=dpsRTUADisplay, dpsRTUDisplayGrid=dpsRTUDisplayGrid, tmonADispDesc=tmonADispDesc, dpsRTUManufacturer=dpsRTUManufacturer, dpsRTUModel=dpsRTUModel, dpsRTUDispDesc=dpsRTUDispDesc, tmonCPoint=tmonCPoint, tmonMJalarmSet=tmonMJalarmSet, dpsRTUAPntDesc=dpsRTUAPntDesc, dpsInc=dpsInc, dpsAlarmControl=dpsAlarmControl, tmonAPort=tmonAPort, dpsRTUAlarmEntry=dpsRTUAlarmEntry, dpsRTUSyncReq=dpsRTUSyncReq, tmonIdent=tmonIdent, tmonASeverity=tmonASeverity, tmonMNalarmClr=tmonMNalarmClr, dpsRTUcomRestored=dpsRTUcomRestored, tmonCAction=tmonCAction, tmonIdentSoftwareVersion=tmonIdentSoftwareVersion, tmonIdentModel=tmonIdentModel, dpsRTUCAction=dpsRTUCAction, tmonMNalarmSet=tmonMNalarmSet, tmonADesc=tmonADesc, tmonCEvent=tmonCEvent, tmonSTalarmSet=tmonSTalarmSet, tmonADisplay=tmonADisplay, dpsRTUIdent=dpsRTUIdent, dpsRTUAPort=dpsRTUAPort, dpsRTUAAddress=dpsRTUAAddress, dpsRTUAddress=dpsRTUAddress, dpsRTUCPort=dpsRTUCPort, tmonAPntType=tmonAPntType, dpsRTUCAddress=dpsRTUCAddress, dpsRTUCDisplay=dpsRTUCDisplay, dpsRTUAState=dpsRTUAState, tmonCResult=tmonCResult, tmonXM=tmonXM, dpsRTUDateTime=dpsRTUDateTime, dpsRTUAPoint=dpsRTUAPoint, dpsRTUsumPClr=dpsRTUsumPClr, tmonCommandGrid=tmonCommandGrid, tmonCPType=tmonCPType, tmonAState=tmonAState, dpsRTUPort=dpsRTUPort, tmonMJalarmClr=tmonMJalarmClr, dpsRTUDisplay=dpsRTUDisplay, dpsRTUPointSet=dpsRTUPointSet, dpsRTUPointClr=dpsRTUPointClr, tmonAPoint=tmonAPoint, tmonCRalarmClr=tmonCRalarmClr, tmonIdentManufacturer=tmonIdentManufacturer, tmonCAuxText=tmonCAuxText, dpsRTUControlGrid=dpsRTUControlGrid, tmonAAuxDesc=tmonAAuxDesc, tmonCPort=tmonCPort, tmonCDisplay=tmonCDisplay)
| 146.440559
| 2,200
| 0.719641
| 2,567
| 20,941
| 5.870666
| 0.082197
| 0.060916
| 0.091374
| 0.019907
| 0.6142
| 0.574253
| 0.531918
| 0.520902
| 0.470405
| 0.455806
| 0
| 0.085467
| 0.082565
| 20,941
| 142
| 2,201
| 147.471831
| 0.698938
| 0.01509
| 0
| 0
| 0
| 0
| 0.230258
| 0.002134
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.044444
| 0
| 0.044444
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
6ef1936814cf84ad0a8d2c89da28ee0ee1c74c44
| 929
|
py
|
Python
|
_correlation_grad.py
|
jgorgenucsd/corr_tf
|
ad777821283f7d18d8bdd04d584e12df9a3fba69
|
[
"BSD-2-Clause"
] | 22
|
2017-12-27T07:37:14.000Z
|
2021-11-15T05:51:44.000Z
|
_correlation_grad.py
|
jgorgenucsd/corr_tf
|
ad777821283f7d18d8bdd04d584e12df9a3fba69
|
[
"BSD-2-Clause"
] | 4
|
2018-04-03T17:08:43.000Z
|
2019-08-07T08:55:24.000Z
|
_correlation_grad.py
|
jgorgenucsd/corr_tf
|
ad777821283f7d18d8bdd04d584e12df9a3fba69
|
[
"BSD-2-Clause"
] | 12
|
2018-02-06T02:35:12.000Z
|
2022-03-02T07:18:19.000Z
|
#!/usr/bin/env python3
"""
Gradients for inner product.
"""
import tensorflow as tf
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import sparse_ops
correlation_grad_module = tf.load_op_library('./build/libcorrelation_grad.so')
@ops.RegisterGradient("Correlation")
def _correlation_grad_cc(op, grad):
"""
The gradient for `correlation` using the operation implemented in C++.
:param op: `correlation` `Operation` that we are differentiating, which we can use
to find the inputs and outputs of the original op.
:param grad: gradient with respect to the output of the `correlation` op.
:return: gradients with respect to the input of `correlation`.
"""
return correlation_grad_module.correlation_grad(grad, op.inputs[0], op.inputs[1],stride=op.get_attr('stride'),max_displacement=op.get_attr('max_displacement'))
| 38.708333
| 163
| 0.750269
| 130
| 929
| 5.230769
| 0.492308
| 0.088235
| 0.088235
| 0.067647
| 0.094118
| 0.094118
| 0
| 0
| 0
| 0
| 0
| 0.003802
| 0.1507
| 929
| 23
| 164
| 40.391304
| 0.858048
| 0.427341
| 0
| 0
| 0
| 0
| 0.128834
| 0.06135
| 0
| 0
| 0
| 0
| 0
| 1
| 0.125
| false
| 0
| 0.5
| 0
| 0.75
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 2
|
6efc120e05e2c5cbca1587bd26026c11c811582c
| 2,257
|
py
|
Python
|
python homework 2.py
|
pkpatricia/python34
|
5ee4f864444b8835f8ee6cf416bc9fd1d969595b
|
[
"bzip2-1.0.6"
] | null | null | null |
python homework 2.py
|
pkpatricia/python34
|
5ee4f864444b8835f8ee6cf416bc9fd1d969595b
|
[
"bzip2-1.0.6"
] | null | null | null |
python homework 2.py
|
pkpatricia/python34
|
5ee4f864444b8835f8ee6cf416bc9fd1d969595b
|
[
"bzip2-1.0.6"
] | null | null | null |
Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC v.1600 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>>
>>> ================================ RESTART ================================
>>>
What is your favorite color?blue
I like that color too
>>> ================================ RESTART ================================
>>>
What is your favorite color?black
I do not care too much for that color
>>> ================================ RESTART ================================
>>>
What is your favorite color?green
That is my favorite color.
>>> ================================ RESTART ================================
>>>
What is your favorite color?green
That is my 2nd favorite color.
>>> ================================ RESTART ================================
>>>
What is your favorite color?violet
Traceback (most recent call last):
File "C:/Users/P/Desktop/two_b.py", line 7, in <module>
rank = color.index(pick) + 1
ValueError: 'violet' is not in list
>>> ================================ RESTART ================================
>>>
What is your favorite color?violet
I do not care too much for that color
>>> ================================ RESTART ================================
>>>
What is your favorite color?yello
I do not care too much for that color
>>> ================================ RESTART ================================
>>>
What is your favorite color?yellow
That is my 6th favorite color.
>>> ================================ RESTART ================================
>>>
Bach
Antheil
Chopin
Mozart
Handel
>>> ================================ RESTART ================================
>>>
Please enter a lower bound: 4
Please enter an upper bound: 23
2**4=16
2**5=32
2**6=64
2**7=128
2**8=256
2**9=512
2**10=1024
2**11=2048
2**12=4096
2**13=8192
2**14=16384
2**15=32768
2**16=65536
2**17=131072
2**18=262144
2**19=524288
2**20=1048576
2**21=2097152
2**22=4194304
>>> ================================ RESTART ================================
>>>
Please enter a lower bound: 0
Please enter an upper bound: 6
2**0 = 1
2**1 = 2
2**2 = 4
2**3 = 8
2**4 = 16
2**5 = 32
2**6 = 64
>>>
| 27.52439
| 94
| 0.438635
| 274
| 2,257
| 3.609489
| 0.434307
| 0.144591
| 0.105157
| 0.137513
| 0.524773
| 0.478261
| 0.358948
| 0.316481
| 0.264914
| 0.240647
| 0
| 0.102278
| 0.124945
| 2,257
| 81
| 95
| 27.864198
| 0.398481
| 0
| 0
| 0.469136
| 0
| 0
| 0.025698
| 0.011963
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
6efda603db469ce3236855097b257374262f3443
| 178
|
py
|
Python
|
Python/Samples/Flyweight/Flyweight_models.py
|
plasroom46/DesignPattern.Sample
|
86c05c5ae356cb01f3d075f248c45da3e6534d07
|
[
"MIT"
] | 9
|
2019-03-14T01:54:31.000Z
|
2021-11-26T13:00:32.000Z
|
Python/Samples/Flyweight/Flyweight_models.py
|
plasroom46/DesignPattern.Sample
|
86c05c5ae356cb01f3d075f248c45da3e6534d07
|
[
"MIT"
] | null | null | null |
Python/Samples/Flyweight/Flyweight_models.py
|
plasroom46/DesignPattern.Sample
|
86c05c5ae356cb01f3d075f248c45da3e6534d07
|
[
"MIT"
] | 2
|
2019-08-19T06:00:04.000Z
|
2021-07-15T01:23:52.000Z
|
class Content:
def __init__(self, id="", value=""):
if(id == ""):
raise TypeError
else:
self.id = id
self.value = value
| 17.8
| 40
| 0.438202
| 18
| 178
| 4.111111
| 0.611111
| 0.162162
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.426966
| 178
| 9
| 41
| 19.777778
| 0.72549
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.142857
| false
| 0
| 0
| 0
| 0.285714
| 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
| 0
| 0
|
0
| 2
|
6efe244e5a0524f99c737e6f3d3da045c5866cd7
| 101
|
py
|
Python
|
hello.py
|
zhuiyue568/test27
|
f96438c29711b62000eb363ff32c059529a0e142
|
[
"MIT"
] | null | null | null |
hello.py
|
zhuiyue568/test27
|
f96438c29711b62000eb363ff32c059529a0e142
|
[
"MIT"
] | null | null | null |
hello.py
|
zhuiyue568/test27
|
f96438c29711b62000eb363ff32c059529a0e142
|
[
"MIT"
] | null | null | null |
name="zhuiyue"
num="123456"
num=111
num3=333
str="keep going"
num4=666
num5=888
num5=777
num6=999
| 7.769231
| 16
| 0.722772
| 19
| 101
| 3.842105
| 0.894737
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.329545
| 0.128713
| 101
| 12
| 17
| 8.416667
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0.23
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 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
| 2
|
3e0b03ec64f84131a309427f748ab4fc729497d0
| 1,723
|
py
|
Python
|
sustainableCityManagement/main_project/Population_API/views_population.py
|
Josh-repository/Dashboard-CityManager-
|
6287881be9fb2c6274a755ce5d75ad355346468a
|
[
"RSA-MD"
] | null | null | null |
sustainableCityManagement/main_project/Population_API/views_population.py
|
Josh-repository/Dashboard-CityManager-
|
6287881be9fb2c6274a755ce5d75ad355346468a
|
[
"RSA-MD"
] | null | null | null |
sustainableCityManagement/main_project/Population_API/views_population.py
|
Josh-repository/Dashboard-CityManager-
|
6287881be9fb2c6274a755ce5d75ad355346468a
|
[
"RSA-MD"
] | 1
|
2021-05-13T16:33:18.000Z
|
2021-05-13T16:33:18.000Z
|
from django.http import JsonResponse
from django.http import HttpResponse
from rest_framework.views import APIView
from .store_population import StorePopulation
import time as processTiming
import uuid
# API to fetch Ireland population used by frontend. The result consist of population estimate and year.
class IrelandPopulationView(APIView):
@classmethod
def get(self, request, fetch_population=StorePopulation()):
startTime = processTiming.time()
call_uuid = uuid.uuid4()
ID = "IRELAND_POPULATION_INFO"
result = fetch_population.fetch_irish_population()
# If query param doesn't match any condition above.
return JsonResponse(
{
"API_ID": ID,
"CALL_UUID": call_uuid,
"DATA": {
"RESULT": result
},
"TIMESTAMP": "{} seconds".format(float(round(processTiming.time() - startTime, 2)))}
)
# API to fetch Dublin population used by frontend. The result consist of population estimate and year.
class DublinPopulationView(APIView):
@classmethod
def get(self, request, fetch_population=StorePopulation()):
startTime = processTiming.time()
call_uuid = uuid.uuid4()
ID = "DUBLIN_POPULATION_INFO"
result = fetch_population.fetch_dublin_population()
# If query param doesn't match any condition above.
return JsonResponse(
{
"API_ID": ID,
"CALL_UUID": call_uuid,
"DATA": {
"RESULT": result
},
"TIMESTAMP": "{} seconds".format(float(round(processTiming.time() - startTime, 2)))}
)
| 39.159091
| 103
| 0.62101
| 175
| 1,723
| 5.988571
| 0.36
| 0.045802
| 0.026718
| 0.038168
| 0.740458
| 0.740458
| 0.664122
| 0.664122
| 0.664122
| 0.664122
| 0
| 0.003279
| 0.291933
| 1,723
| 44
| 104
| 39.159091
| 0.855738
| 0.175276
| 0
| 0.526316
| 0
| 0
| 0.09386
| 0.031757
| 0
| 0
| 0
| 0
| 0
| 1
| 0.052632
| false
| 0
| 0.157895
| 0
| 0.315789
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 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
| 2
|
3e1d0a3af98bd0674017ebccc343c54e9d715f7e
| 325
|
py
|
Python
|
reactivex/scheduler/mainloop/__init__.py
|
christiansandberg/RxPY
|
036027d2858ea6c9d45839c863bd791e5bb50c36
|
[
"MIT"
] | null | null | null |
reactivex/scheduler/mainloop/__init__.py
|
christiansandberg/RxPY
|
036027d2858ea6c9d45839c863bd791e5bb50c36
|
[
"MIT"
] | null | null | null |
reactivex/scheduler/mainloop/__init__.py
|
christiansandberg/RxPY
|
036027d2858ea6c9d45839c863bd791e5bb50c36
|
[
"MIT"
] | null | null | null |
from .gtkscheduler import GtkScheduler
from .pygamescheduler import PyGameScheduler
from .qtscheduler import QtScheduler
from .tkinterscheduler import TkinterScheduler
from .wxscheduler import WxScheduler
__all__ = [
"GtkScheduler",
"PyGameScheduler",
"QtScheduler",
"TkinterScheduler",
"WxScheduler",
]
| 23.214286
| 46
| 0.775385
| 26
| 325
| 9.538462
| 0.307692
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.153846
| 325
| 13
| 47
| 25
| 0.901818
| 0
| 0
| 0
| 0
| 0
| 0.2
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.416667
| 0
| 0.416667
| 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
| 0
| 0
|
0
| 2
|
3e1f67673a3fc56ac1f18b117525630eebc9c6b7
| 207
|
py
|
Python
|
convenient_ai/nlp/spacy/types/RulePattern.py
|
leftshiftone/convenient-nlp
|
8f24ff070ffaa2117af02ae16aaf00bc4d7cf32f
|
[
"MIT"
] | null | null | null |
convenient_ai/nlp/spacy/types/RulePattern.py
|
leftshiftone/convenient-nlp
|
8f24ff070ffaa2117af02ae16aaf00bc4d7cf32f
|
[
"MIT"
] | null | null | null |
convenient_ai/nlp/spacy/types/RulePattern.py
|
leftshiftone/convenient-nlp
|
8f24ff070ffaa2117af02ae16aaf00bc4d7cf32f
|
[
"MIT"
] | null | null | null |
import dataclasses
from dataclasses import dataclass
@dataclass
class RulePattern:
id: str
label: str
pattern: str
@property
def as_dict(self):
return dataclasses.asdict(self)
| 14.785714
| 39
| 0.695652
| 24
| 207
| 5.958333
| 0.708333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.246377
| 207
| 13
| 40
| 15.923077
| 0.916667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.1
| false
| 0
| 0.2
| 0.1
| 0.8
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 2
|
3e1ff4f3721e11c343d5fecb39e8c79bd6aafa15
| 1,014
|
py
|
Python
|
cocos2d/tools/cocos2d-console/plugins/plugin_run.py
|
meiry/Cocos2d-x-EarthWarrior3D-win-desktop-version
|
6611cf5bfac64e22f0b053681ef9bf563f93f06c
|
[
"MIT"
] | 7
|
2015-05-19T07:54:48.000Z
|
2021-12-17T06:01:24.000Z
|
cocos2d/tools/cocos2d-console/plugins/plugin_run.py
|
meiry/Cocos2d-x-EarthWarrior3D-win-desktop-version
|
6611cf5bfac64e22f0b053681ef9bf563f93f06c
|
[
"MIT"
] | null | null | null |
cocos2d/tools/cocos2d-console/plugins/plugin_run.py
|
meiry/Cocos2d-x-EarthWarrior3D-win-desktop-version
|
6611cf5bfac64e22f0b053681ef9bf563f93f06c
|
[
"MIT"
] | 4
|
2015-11-24T06:27:16.000Z
|
2021-05-29T10:50:44.000Z
|
#!/usr/bin/python
# ----------------------------------------------------------------------------
# cocos2d "install" plugin
#
# Authr: Luis Parravicini
#
# License: MIT
# ----------------------------------------------------------------------------
'''
"run" plugin for cocos2d command line tool
'''
__docformat__ = 'restructuredtext'
import sys
import os
import cocos2d
class CCPluginRun(cocos2d.CCPlugin):
"""
Compiles a project and install it on a device
"""
@staticmethod
def depends_on():
return ('compile', 'install')
@staticmethod
def plugin_name():
return "run"
@staticmethod
def brief_description():
return "compiles a project and install the files on a device"
def run(self, argv, dependencies):
cocos2d.Logging.info("starting application")
self.parse_args(argv)
install_dep = dependencies['install']
self._run_cmd("adb shell am start -n %s/%s" %
(install_dep.package, install_dep.activity))
| 24.142857
| 78
| 0.554241
| 101
| 1,014
| 5.435644
| 0.594059
| 0.081967
| 0.058288
| 0.069217
| 0.094718
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006188
| 0.203156
| 1,014
| 41
| 79
| 24.731707
| 0.673267
| 0.316568
| 0
| 0.15
| 0
| 0
| 0.209653
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.15
| 0.15
| 0.55
| 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
| 0
| 1
| 1
| 0
|
0
| 2
|
3e28b00c8be476ae7052942943b00801e357b52e
| 4,337
|
py
|
Python
|
cpauto/objects/threat.py
|
krnnrt/cpauto
|
6076ee0e3f55769aac5b2480453d82f99371a31f
|
[
"Apache-2.0"
] | 16
|
2016-12-07T02:45:31.000Z
|
2022-01-20T11:46:24.000Z
|
cpauto/objects/threat.py
|
krnnrt/cpauto
|
6076ee0e3f55769aac5b2480453d82f99371a31f
|
[
"Apache-2.0"
] | 2
|
2017-07-20T21:12:27.000Z
|
2021-09-09T14:57:01.000Z
|
cpauto/objects/threat.py
|
krnnrt/cpauto
|
6076ee0e3f55769aac5b2480453d82f99371a31f
|
[
"Apache-2.0"
] | 5
|
2017-07-28T14:06:25.000Z
|
2021-09-06T12:01:18.000Z
|
# -*- coding: utf-8 -*-
# Copyright 2016 Dana James Traversie and Check Point Software Technologies, Ltd. All Rights Reserved.
#
# 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.
# cpauto.objects.threat
# ~~~~~~~~~~~~~~~~~~~~~
"""This module contains the classes needed to manage threat prevention objects."""
from ._common import _CommonClient
class ThreatProfile:
"""Manage threat profiles."""
def __init__(self, core_client):
self.__common_client = _CommonClient(core_client)
def add(self, name='', params={}):
"""Adds a threat profile.
https://sc1.checkpoint.com/documents/R80/APIs/#web/add-threat-profile
:param name: A name for the new threat profile.
:param params: (optional) A dictionary of additional, supported
parameter names and values.
:rtype: CoreClientResult
"""
return self.__common_client._add('add-threat-profile', name, params)
def show(self, name='', uid='', details_level=''):
"""Shows details of an threat profile with the specified name or uid.
https://sc1.checkpoint.com/documents/R80/APIs/#web/show-threat-profile
:param name: (optional) The name of an existing threat profile.
:param uid: (optional) The unique identifier of an existing threat profile.
:param details_level: (optional) The level of detail to show. Default
value is 'standard' and the other options are: 'uid' or 'full'
:rtype: CoreClientResult
"""
return self.__common_client._show('show-threat-profile', name=name, uid=uid, details_level=details_level)
def set(self, name='', uid='', params={}):
"""Sets new values for an existing threat profile with the specified
name or uid.
https://sc1.checkpoint.com/documents/R80/APIs/#web/set-threat-profile
:param name: (optional) The name of an existing threat profile.
:param uid: (optional) The unique identifier of an existing threat profile.
:param params: (optional) A dictionary of additional, supported parameter names and values.
:rtype: CoreClientResult
"""
return self.__common_client._set('set-threat-profile', name=name, uid=uid, params=params)
def delete(self, name='', uid='', params={}):
"""Deletes an existing threat profile with the specified
name or uid.
https://sc1.checkpoint.com/documents/R80/APIs/#web/delete-threat-profile
:param name: (optional) The name of an existing threat profile.
:param uid: (optional) The unique identifier of an existing threat profile.
:param params: (optional) A dictionary of additional, supported parameter name$
:rtype: CoreClientResult
"""
return self.__common_client._delete('delete-threat-profile', name=name, uid=uid, params=params)
def show_all(self, limit=50, offset=0, order=[], details_level=''):
"""Shows all threat profiles with some reasonable limitations.
https://sc1.checkpoint.com/documents/R80/APIs/#web/show-threat-profiles
:param limit: (optional) Limit the total number of results shown.
The default value is 50 and allowed values are in the range 1 to 500.
:param offset: (optional) Skip a number of items in the results
before they are shown. Default value is 0.
:param order: (optional) Sort the results by the specified field. The
default is a random order.
:param details_level: (optional) The level of detail to show. Default
value is 'standard' and the other options are: 'uid' or 'full'
:rtype: CoreClientResult
"""
return self.__common_client._show_all('show-threat-profiles', limit=limit,
offset=offset, order=order, details_level=details_level)
| 44.255102
| 113
| 0.679733
| 569
| 4,337
| 5.107206
| 0.28471
| 0.084997
| 0.068135
| 0.063317
| 0.504818
| 0.504818
| 0.48073
| 0.48073
| 0.466965
| 0.438059
| 0
| 0.010035
| 0.218815
| 4,337
| 97
| 114
| 44.71134
| 0.847698
| 0.677888
| 0
| 0
| 0
| 0
| 0.092575
| 0.020251
| 0
| 0
| 0
| 0
| 0
| 1
| 0.4
| false
| 0
| 0.066667
| 0
| 0.866667
| 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
| 0
| 1
| 0
|
0
| 2
|
3e70d3317c13de0952315e701a55b920df03ec85
| 1,441
|
py
|
Python
|
20210607_fizzbuzz.py
|
sayloren/codechallenges
|
b31b64c176a1c03c937e915f3b60657669495681
|
[
"Apache-2.0"
] | null | null | null |
20210607_fizzbuzz.py
|
sayloren/codechallenges
|
b31b64c176a1c03c937e915f3b60657669495681
|
[
"Apache-2.0"
] | null | null | null |
20210607_fizzbuzz.py
|
sayloren/codechallenges
|
b31b64c176a1c03c937e915f3b60657669495681
|
[
"Apache-2.0"
] | null | null | null |
# code golf challenge
# https://code.golf/fizz-buzz#python
# wren 20210607
# Print the numbers from 1 to 100 inclusive, each on their own line.
# If, however, the number is a multiple of three then print Fizz instead,
# and if the number is a multiple of five then print Buzz.
# For numbers which are multiples of both three and five then print FizzBuzz.
# iterate through reange of required numbers - plus one because range is
# zero based if 3 print fizz, if 5 print buzz, and if both fizzbuzz
# i feel like there should be a way to have the 15/fizzbuzz not be a
# seperate condition
for number in range(1,101):
# if there are no remainders for the number in the range divied by 15
# condition for both 5 and 3 - 15 is lowest divisor, where both fizz and buzz
if number%15==0):print('FizzBuzz')
# if there are no remainders for the number in the range divied by 3
# elif condition for just 3 - fizz
elif number%3 ==0:print('Fizz')
# if there are no remainders for the number in the range divied by 5
# elif condition for just 5, buzz
elif number%5==0:print('Buzz')
# else none of the conditions, just print the number
else:print(number)
# alternative approach in one liner
# for loop the same, but conditions where there are no remainders for the
# divisability are all wrapped in a print statement
for number in range(1, 101): print("Fizz"*(number%3==0)+"Buzz"*(number%5==0) or str(number))
| 46.483871
| 92
| 0.725191
| 254
| 1,441
| 4.114173
| 0.358268
| 0.051675
| 0.038278
| 0.076555
| 0.254545
| 0.254545
| 0.149282
| 0.149282
| 0.149282
| 0.149282
| 0
| 0.039233
| 0.204025
| 1,441
| 30
| 93
| 48.033333
| 0.87184
| 0
| 0
| 0
| 0
| 0
| 0.078431
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0.833333
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 2
|
3e7a7495c3ea96af4211a7bee33396978138c459
| 605
|
py
|
Python
|
docs/examples/best_practices/dynamic_configuration/cdk_appconfig.py
|
ran-isenberg/aws-lambda-handler-cookbook
|
adfe58dacd87315151265818869bb842c7eb4971
|
[
"MIT"
] | 61
|
2022-02-07T05:21:14.000Z
|
2022-03-27T14:11:30.000Z
|
docs/examples/best_practices/dynamic_configuration/cdk_appconfig.py
|
ran-isenberg/aws-lambda-handler-cookbook
|
adfe58dacd87315151265818869bb842c7eb4971
|
[
"MIT"
] | 17
|
2022-02-26T05:25:31.000Z
|
2022-03-16T20:02:46.000Z
|
docs/examples/best_practices/dynamic_configuration/cdk_appconfig.py
|
ran-isenberg/aws-lambda-handler-cookbook
|
adfe58dacd87315151265818869bb842c7eb4971
|
[
"MIT"
] | 4
|
2022-02-17T16:35:27.000Z
|
2022-03-07T03:13:07.000Z
|
from aws_cdk import Stack
from aws_lambda_handler_cookbook.service_stack.configuration.configuration_construct import ConfigurationStore
from aws_lambda_handler_cookbook.service_stack.constants import CONFIGURATION_NAME, ENVIRONMENT, SERVICE_NAME
from constructs import Construct
class CookBookConfigurationStack(Stack):
# pylint: disable=redefined-builtin
def __init__(self, scope: Construct, id: str, **kwargs) -> None:
super().__init__(scope, id, **kwargs)
self.dynamic_configuration = ConfigurationStore(self, 'dynamic_conf', ENVIRONMENT, SERVICE_NAME, CONFIGURATION_NAME)
| 43.214286
| 124
| 0.809917
| 68
| 605
| 6.852941
| 0.485294
| 0.045064
| 0.055794
| 0.085837
| 0.171674
| 0.171674
| 0.171674
| 0
| 0
| 0
| 0
| 0
| 0.115702
| 605
| 13
| 125
| 46.538462
| 0.871028
| 0.054545
| 0
| 0
| 0
| 0
| 0.021053
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.125
| false
| 0
| 0.5
| 0
| 0.75
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 2
|
3e82a49073596a4c986e7e70b3ddc02848ac39cb
| 385
|
py
|
Python
|
tests/fixtures.py
|
hdsr-mid/string_finder
|
64aa38afa562beddc897a0fcb84bf39e53b935fd
|
[
"MIT"
] | null | null | null |
tests/fixtures.py
|
hdsr-mid/string_finder
|
64aa38afa562beddc897a0fcb84bf39e53b935fd
|
[
"MIT"
] | null | null | null |
tests/fixtures.py
|
hdsr-mid/string_finder
|
64aa38afa562beddc897a0fcb84bf39e53b935fd
|
[
"MIT"
] | null | null | null |
from pathlib import Path
from string_finder.constants import TEST_DATA_DIR
from typing import List
import pytest
@pytest.fixture
def caw_xml_paths() -> List[Path]:
xml_dir = TEST_DATA_DIR / "xmls"
assert xml_dir.is_dir()
_paths = [x for x in xml_dir.iterdir()]
assert len(_paths) == 4, f"expected 4 xml files in {xml_dir}, but found {len(_paths)}"
return _paths
| 25.666667
| 90
| 0.719481
| 63
| 385
| 4.142857
| 0.52381
| 0.091954
| 0.084291
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006369
| 0.184416
| 385
| 14
| 91
| 27.5
| 0.824841
| 0
| 0
| 0
| 0
| 0
| 0.161039
| 0
| 0
| 0
| 0
| 0
| 0.181818
| 1
| 0.090909
| false
| 0
| 0.363636
| 0
| 0.545455
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 2
|
e445d667e0d2518eeb5e300fca8baeaa532b0501
| 427
|
py
|
Python
|
t_mongo.py
|
iloghyr/easy_python
|
b750f6817d54562b23630e2419bace19da0abf8b
|
[
"Apache-2.0"
] | 1
|
2018-03-01T02:42:52.000Z
|
2018-03-01T02:42:52.000Z
|
t_mongo.py
|
iloghyr/easy_python
|
b750f6817d54562b23630e2419bace19da0abf8b
|
[
"Apache-2.0"
] | null | null | null |
t_mongo.py
|
iloghyr/easy_python
|
b750f6817d54562b23630e2419bace19da0abf8b
|
[
"Apache-2.0"
] | null | null | null |
#!/bin/env python
#coding: utf-8
import pymongo
print [x for x in range(2)]
con = pymongo.MongoClient("localhost", 27017)
db = con.mars
collection = db.users
data = collection.find_one({"username":"hyr"})
print data
data['age'] = 225
print collection.update({"_idd":data['_id']}, data)
print collection.find_one({"username":"hyr"})
# for i in collection.find().sort('_id', pymongo.DESCENDING).limit(1):
# print i
| 17.08
| 70
| 0.683841
| 63
| 427
| 4.555556
| 0.587302
| 0.146341
| 0.118467
| 0.174216
| 0.195122
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02981
| 0.135831
| 427
| 24
| 71
| 17.791667
| 0.747967
| 0.257611
| 0
| 0
| 0
| 0
| 0.132686
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.1
| null | null | 0.4
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
e462bb80e8e5cfe48f10d58ffcdefb6c7a4fc2ec
| 680
|
py
|
Python
|
test.py
|
jsayles/LPD8806
|
6f13b65ae92f3bd903df684459964b8f5f621942
|
[
"MIT"
] | null | null | null |
test.py
|
jsayles/LPD8806
|
6f13b65ae92f3bd903df684459964b8f5f621942
|
[
"MIT"
] | null | null | null |
test.py
|
jsayles/LPD8806
|
6f13b65ae92f3bd903df684459964b8f5f621942
|
[
"MIT"
] | null | null | null |
import time
from lightpi.hardware import strip, string1, string2
DELAY_SEC = 0.3
# Test the RGB Strip
strip.red()
time.sleep(DELAY_SEC)
strip.green()
time.sleep(DELAY_SEC)
strip.blue()
time.sleep(DELAY_SEC)
strip.off()
# Test the LED Strings
string1.on()
time.sleep(DELAY_SEC)
string1.off()
time.sleep(DELAY_SEC)
string2.on()
time.sleep(DELAY_SEC)
string2.off()
################################################################################
# Helper Methods
################################################################################
def allOn():
strip.white()
string1.on()
string2.on()
def allOff():
strip.off()
string1.off()
string2.off()
| 17.435897
| 80
| 0.535294
| 79
| 680
| 4.518987
| 0.367089
| 0.156863
| 0.235294
| 0.285714
| 0.378151
| 0
| 0
| 0
| 0
| 0
| 0
| 0.020067
| 0.120588
| 680
| 38
| 81
| 17.894737
| 0.576923
| 0.079412
| 0
| 0.64
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.08
| false
| 0
| 0.08
| 0
| 0.16
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
e4710ca29b9a5a6a2747143e02042c64942aa376
| 1,865
|
py
|
Python
|
src/blockchain/crypto_tools/__init__.py
|
ParisNeo/blockchain
|
8bc2768a3e89088e202ea89e5f301576f6f9d95c
|
[
"MIT"
] | null | null | null |
src/blockchain/crypto_tools/__init__.py
|
ParisNeo/blockchain
|
8bc2768a3e89088e202ea89e5f301576f6f9d95c
|
[
"MIT"
] | null | null | null |
src/blockchain/crypto_tools/__init__.py
|
ParisNeo/blockchain
|
8bc2768a3e89088e202ea89e5f301576f6f9d95c
|
[
"MIT"
] | null | null | null |
"""
"""
from Crypto.PublicKey import RSA
from Crypto.Hash import SHA256
from Crypto.Signature import PKCS1_v1_5
from base58 import b58encode, b58decode
# ================= cryptography helpers ======================================
def hash(data):
"""Hash some data
"""
# Hash the stuff we need to hash
digest = SHA256.new()
digest.update(data)
hash= digest.hexdigest()
return hash
def generateKeys():
private_key = RSA.generate(1024)
public_key = private_key.public_key()
return private_key, public_key
def sign(private_key:RSA.RsaKey, message):
"""Sign a message
Parameters
----------
private_key (RSAPublicKey) : The private key to sign the message with
message (str) : The message to be signed
"""
hasher = SHA256.new(message)
signer = PKCS1_v1_5.new(private_key)
signature = signer.sign(hasher)
return signature
def verify(public_key, message, signature):
"""Verify the message signature
Parameters
----------
public_key (RSAPublicKey) : The public key to verify that the sender is the right one
message (str) : The signed message (used for verification)
signature (str) : The signature
"""
hasher = SHA256.new(message)
verifier = PKCS1_v1_5.new(public_key)
return verifier.verify(hasher, signature)
def privateKey2Text(key:RSA.RsaKey):
"""Converts a private key to text
"""
return b58encode(key.exportKey('DER'))
def publicKey2Text(key:RSA.RsaKey):
"""Converts a public key to text
"""
return b58encode(key.exportKey('DER'))
def text2PrivateKey(text:str):
"""Convert a text to a private key
"""
return RSA.importKey(b58decode(text))
def text2PublicKey(text:str):
"""Convert a text to a key
"""
return RSA.importKey(b58decode(text))
| 26.267606
| 92
| 0.642895
| 229
| 1,865
| 5.157205
| 0.292576
| 0.076207
| 0.020322
| 0.032176
| 0.201524
| 0.165961
| 0.108383
| 0.071126
| 0.071126
| 0
| 0
| 0.029696
| 0.223592
| 1,865
| 70
| 93
| 26.642857
| 0.785912
| 0.368901
| 0
| 0.2
| 0
| 0
| 0.005525
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.266667
| false
| 0
| 0.2
| 0
| 0.733333
| 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
| 0
| 1
| 0
|
0
| 2
|
e472f3485c0e5680d2198a1ae932c5d7712b5057
| 19,303
|
py
|
Python
|
tools/unit_tests/test_config_transforms.py
|
dice-project/DICE-deployment-service
|
e209c6a061a78f170e81cfc03d2959af0283ed15
|
[
"Apache-2.0"
] | 2
|
2018-04-03T20:45:26.000Z
|
2022-02-07T19:53:42.000Z
|
tools/unit_tests/test_config_transforms.py
|
dice-project/DICE-deployment-service
|
e209c6a061a78f170e81cfc03d2959af0283ed15
|
[
"Apache-2.0"
] | 3
|
2016-11-15T10:41:43.000Z
|
2020-03-16T07:49:03.000Z
|
tools/unit_tests/test_config_transforms.py
|
dice-project/DICE-deployment-service
|
e209c6a061a78f170e81cfc03d2959af0283ed15
|
[
"Apache-2.0"
] | 2
|
2018-07-04T11:37:12.000Z
|
2022-02-07T19:53:43.000Z
|
import unittest
import copy
import os
import tempfile
from config_tool.utils import *
class TestConfigurationTransformation(unittest.TestCase):
@classmethod
def setUpClass(cls):
base_path = os.path.dirname(os.path.realpath(__file__))
file_path = os.path.join(base_path, 'files')
def fpath(*names):
return os.path.join(file_path, *names)
cls.blueprints = {
'single-node': fpath('single-node-blueprint.yaml'),
'full': fpath('full-blueprint.yaml'),
'mixed': fpath('full-blueprint-mixed.yaml'),
'conflicting': fpath('full-blueprint-conflicting.yaml'),
}
cls.options = {
'normal': fpath('expconfig.yaml'),
'multinode': fpath('expconfig-multinode.yaml'),
'bad-var-info': fpath('expconfig-bad-var-info.yaml'),
}
cls.config = {
'matlab': fpath('config-matlab.txt'),
'json': fpath('config-matlab.json'),
}
def test_load_blueprint(self):
"""
Load the blueprint from a yaml file and check its contents
"""
blueprint = load_blueprint(self.blueprints['single-node'])
self.assertIsNotNone(blueprint)
self.assertTrue('tosca_definitions_version' in blueprint)
self.assertTrue('imports' in blueprint)
self.assertTrue('node_templates' in blueprint)
self.assertTrue('outputs' in blueprint)
node_templates = blueprint['node_templates']
self.assertTrue('storm_vm' in node_templates)
self.assertTrue('storm' in node_templates)
storm = node_templates['storm']
self.assertTrue('properties' in storm)
storm_config = storm['properties']['configuration']
expected_storm_config = {
"component.count_bolt_num": 1,
"component.split_bolt_num": 1,
"component.spout_num": 3,
"storm.messaging.netty.min_wait_ms": 100,
"topology.max.spout.pending": 100,
"topology.sleep.spout.wait.strategy.time.ms": 1
}
self.assertEqual(expected_storm_config, storm_config)
def test_load_options(self):
"""
Load the Configuration Optimization options and check their
contents.
"""
options = load_options(self.options['normal'])
expected_options = [
{ 'node': 'storm', 'paramname': 'component.spout_num' },
{ 'node': 'storm', 'paramname': 'topology.max.spout.pending' },
{ 'node': 'storm',
'paramname': 'topology.sleep.spout.wait.strategy.time.ms' },
{ 'node': 'storm', 'paramname': 'component.split_bolt_num' },
{ 'node': 'storm', 'paramname': 'component.count_bolt_num' },
{ 'node': 'storm',
'paramname': 'storm.messaging.netty.min_wait_ms' },
]
self.assertEqual(expected_options, options)
def test_load_options_multiple_nodes(self):
"""
Load the Configuration Optimization options containing several nodes
and check their contents.
"""
options = load_options(self.options['multinode'])
expected_options = [
{
'node': ['storm', 'storm_nimbus'],
'paramname': 'component.spout_num'
},
{
'node': ['storm', 'storm_nimbus'],
'paramname': 'topology.max.spout.pending'
},
{
'node': ['storm', 'storm_nimbus'],
'paramname': 'topology.sleep.spout.wait.strategy.time.ms'
},
{
'node': ['storm', 'storm_nimbus'],
'paramname': 'component.split_bolt_num'
},
{
'node': ['storm', 'storm_nimbus'],
'paramname': 'component.count_bolt_num'
},
{
'node': ['storm', 'storm_nimbus'],
'paramname': 'storm.messaging.netty.min_wait_ms'
},
{
'node': 'zookeeper',
'paramname': 'tickTime'
},
{
'node': 'zookeeper',
'paramname': 'initLimit'
},
{
'node': 'zookeeper',
'paramname': 'syncLimit'
},
]
self.assertEqual(expected_options, options)
def test_load_options_bad_var_info(self):
"""
Loading of variables where not all fields are present is not supported
"""
with self.assertRaises(KeyError):
load_options(self.options['bad-var-info'])
def test_load_config_matlab(self):
"""
Test loading the configuration data. We assume that this is a dump
from Matlab.
"""
expected_config = [2, 4, 10, 15000, 20, 2.400003]
config = load_configuration_matlab(self.config['matlab'])
self.assertEqual(expected_config, config)
def test_load_config_json(self):
"""
Test loading the configuration data. We assume that this is a json file
containing an array.
"""
expected_config = [2, 4, 10, 15000, 20, 2.400003]
config = load_configuration_json(self.config['json'])
self.assertEqual(expected_config, config)
def test_export_config(self):
"""
Confirm that the configuration values exported to string (for text file
outputs) can be read back again properly.
"""
# example configurations
configurations = [
[ 3, 100, 1, 2, 3, 110 ],
[ 3, 100, None, 2, 3, 110, None ],
[ ],
]
for configuration in configurations:
with tempfile.NamedTemporaryFile('w+') as f:
fname = f.name
# dump json
save_configuration_json(configuration, fname)
# read json back
configuration_imported_json = load_configuration_json(fname)
# check the contents
self.assertEqual(configuration, configuration_imported_json)
# dump matlab
save_configuration_matlab(configuration, fname)
# read matlab back
configuration_imported_matlab = load_configuration_matlab(fname)
# check the contents
self.assertEqual(configuration, configuration_imported_matlab)
def test_single_node_update(self):
"""
Load a blueprint with a single node (one VM, one Storm service
on top of it). Update the blueprint with new configurations.
"""
# Load and set the input parameters
blueprint = load_blueprint(self.blueprints['single-node'])
options = load_options(self.options['normal'])
config = [ 2, 4, 10, 15, 20, 2 ]
# routine check of the blueprint representation
self.assertIsNotNone(blueprint)
self.assertTrue('node_templates' in blueprint)
node_templates = blueprint['node_templates']
self.assertTrue('storm' in node_templates)
# run the update
updated_blueprint = update_blueprint(blueprint, options, config)
# prepare the expected values
configuration = {
"component.spout_num": 2,
"topology.max.spout.pending": 4,
"topology.sleep.spout.wait.strategy.time.ms": 10,
"component.split_bolt_num": 15,
"component.count_bolt_num": 20,
"storm.messaging.netty.min_wait_ms": 2
}
blueprint['node_templates']['storm']['properties']['configuration'] = \
configuration
# verify the outcome
self.maxDiff = None
self.assertEqual(blueprint, updated_blueprint)
def test_single_node_shorter_config(self):
"""
Test updating a blueprint where the blueprint has a longer list of
properties than the configuration to be updated.
"""
# Load and set the input parameters: truncated options and config values
blueprint = load_blueprint(self.blueprints['single-node'])
options = load_options(self.options['normal'])
options = options[0:4]
config = [ 2, 4, 10, 15 ]
self.assertEqual(len(config), len(options))
# routine check of the blueprint representation
self.assertIsNotNone(blueprint)
self.assertTrue('node_templates' in blueprint)
node_templates = blueprint['node_templates']
self.assertTrue('storm' in node_templates)
# run the update
updated_blueprint = update_blueprint(blueprint, options, config)
# prepare the expected values
configuration = {
"component.spout_num": 2,
"topology.max.spout.pending": 4,
"topology.sleep.spout.wait.strategy.time.ms": 10,
"component.split_bolt_num": 15,
"component.count_bolt_num": 1,
"storm.messaging.netty.min_wait_ms": 100
}
blueprint['node_templates']['storm']['properties']['configuration'] = \
configuration
# verify the outcome
self.assertEqual(blueprint, updated_blueprint)
def test_single_node_longer_config(self):
"""
Test updating a blueprint where the configuration to be updated has a
longer list of properties than the configuration to be updated.
"""
# Load and set the input parameters
blueprint = load_blueprint(self.blueprints['single-node'])
options = load_options(self.options['normal'])
config = [ 2, 4, 10, 15, 20, 2 ]
# routine check of the blueprint representation
self.assertIsNotNone(blueprint)
self.assertTrue('node_templates' in blueprint)
node_templates = blueprint['node_templates']
self.assertTrue('storm' in node_templates)
# truncate the blueprint's parameter list
blueprint_storm_config = \
blueprint['node_templates']['storm']['properties']['configuration']
del blueprint_storm_config['component.split_bolt_num']
del blueprint_storm_config['component.spout_num']
del blueprint_storm_config['storm.messaging.netty.min_wait_ms']
self.assertEqual(3, len(blueprint_storm_config))
# run the update
updated_blueprint = update_blueprint(blueprint, options, config)
# prepare the expected values
configuration = {
"component.spout_num": 2,
"topology.max.spout.pending": 4,
"topology.sleep.spout.wait.strategy.time.ms": 10,
"component.split_bolt_num": 15,
"component.count_bolt_num": 20,
"storm.messaging.netty.min_wait_ms": 2
}
blueprint['node_templates']['storm']['properties']['configuration'] = \
configuration
# verify the outcome
self.maxDiff = None
self.assertEqual(blueprint, updated_blueprint)
def test_multiple_node_update(self):
"""
Load a blueprint with multiple nodes. Update the blueprint with new
configurations.
"""
# Load and set the input parameters
blueprint = load_blueprint(self.blueprints['full'])
options = load_options(self.options['multinode'])
config = [ 2, 4, 10, 15, 20, 2, 3000, 21, 7 ]
# routine check of the blueprint representation
self.assertIsNotNone(blueprint)
self.assertTrue('node_templates' in blueprint)
node_templates = blueprint['node_templates']
self.assertTrue('storm' in node_templates)
self.assertTrue('storm_nimbus' in node_templates)
self.assertTrue('zookeeper' in node_templates)
# run the update
updated_blueprint = update_blueprint(blueprint, options, config)
# prepare the expected values
expected_storm_nimbus_config = {
"component.spout_num": 2,
"topology.max.spout.pending": 4,
"topology.sleep.spout.wait.strategy.time.ms": 10,
"component.split_bolt_num": 15,
"component.count_bolt_num": 20,
"storm.messaging.netty.min_wait_ms": 2
}
expected_storm_config = {
"component.spout_num": 2,
"topology.max.spout.pending": 4,
"topology.sleep.spout.wait.strategy.time.ms": 10,
"component.split_bolt_num": 15,
"component.count_bolt_num": 20,
"storm.messaging.netty.min_wait_ms": 2
}
expected_zookeeper_config = {
"tickTime": 3000,
"initLimit": 21,
"syncLimit": 7
}
blueprint['node_templates']['storm']['properties']\
['configuration'] = expected_storm_config
blueprint['node_templates']['storm_nimbus']['properties'] = \
{'configuration': expected_storm_nimbus_config}
blueprint['node_templates']['zookeeper']['properties']\
['configuration'] = expected_zookeeper_config
# verify the outcome
self.maxDiff = None
self.assertEqual(blueprint, updated_blueprint)
def test_multiple_node_partial_config_update(self):
"""
In the input configuration, some of the values may be missing. In the
Python array representation, the missing values are marked with None.
The corresponding parameters then have to be absent from the blueprint
(effectively setting them to the default value).
"""
# Load and set the input parameters
blueprint = load_blueprint(self.blueprints['mixed'])
options = load_options(self.options['multinode'])
config = [ None, 4, 10, 15, None, 2, 3000, 21, 7 ]
# routine check of the blueprint representation
self.assertIsNotNone(blueprint)
self.assertTrue('node_templates' in blueprint)
node_templates = blueprint['node_templates']
self.assertTrue('storm' in node_templates)
self.assertTrue('storm_nimbus' in node_templates)
self.assertTrue('zookeeper' in node_templates)
# run the update
updated_blueprint = update_blueprint(blueprint, options, config)
# prepare the expected values
expected_storm_nimbus_config = {
#"component.spout_num": 2, # omitted - missing in config
"topology.max.spout.pending": 4,
"topology.sleep.spout.wait.strategy.time.ms": 10,
"component.split_bolt_num": 15,
"component.spout_num": 3,
#"component.count_bolt_num": 20,# missing in config and blueprint
"storm.messaging.netty.min_wait_ms": 2,
"nimbus.thrift.max_buffer_size": 1048576, # present in blueprint
}
expected_storm_config = {
#"component.spout_num": 2, # omitted - missing in config
"topology.max.spout.pending": 4,
"topology.sleep.spout.wait.strategy.time.ms": 10,
"component.split_bolt_num": 15,
"component.spout_num": 3,
#"component.count_bolt_num": 20,# missing in config and blueprint
"storm.messaging.netty.min_wait_ms": 2,
"nimbus.thrift.max_buffer_size": 1048576, # present in blueprint
}
expected_zookeeper_config = {
"tickTime": 3000,
"initLimit": 21,
"syncLimit": 7,
"preAllocSize": 64, # present in blueprint
}
blueprint['node_templates']['storm']['properties']\
['configuration'] = expected_storm_config
blueprint['node_templates']['storm_nimbus']['properties'] = \
{'configuration': expected_storm_nimbus_config}
blueprint['node_templates']['zookeeper']['properties']\
['configuration'] = expected_zookeeper_config
# verify the outcome
self.maxDiff = None
self.assertEqual(blueprint, updated_blueprint)
def test_single_node_config_extract_full(self):
"""
Load a blueprint with a single node (one VM, one Storm service
on top of it). This blueprint has the complete set of propertes
needed for the configuration.
"""
# Load and set the input parameters
blueprint = load_blueprint(self.blueprints['single-node'])
options = load_options(self.options['normal'])
# run the extraction
extracted_config = extract_blueprint_config(blueprint, options)
# prepare the expected values
config = [ 3, 100, 1, 1, 1, 100 ]
# verify the outcome
self.assertEqual(config, extracted_config)
def test_multiple_node_config_extract_full(self):
"""
Load a blueprint with multiple nodes, which already has the set of
properties matching the ones in the configuration.
"""
# Load and set the input parameters
blueprint = load_blueprint(self.blueprints['full'])
options = load_options(self.options['multinode'])
# run the extraction
extracted_config = extract_blueprint_config(blueprint, options)
# prepare the expected values
config = [ 3, 100, 1, 1, 1, 100, 1500, 10, 5 ]
# verify the outcome
self.assertEqual(config, extracted_config)
def test_multiple_node_config_extract_mixed(self):
"""
Load a blueprint with multiple nodes, which has a mixed set of
properties in comparison with the options: some of the properties are
present, some are missing, and there are a few in the blueprint that are
not declared in the options. The extraction needs to pick up the ones
that are present, use a dedicated value for the missing ones and ignore
the extra ones in the blueprint.
"""
# Load and set the input parameters
blueprint = load_blueprint(self.blueprints['mixed'])
options = load_options(self.options['multinode'])
# run the extraction
extracted_config = extract_blueprint_config(blueprint, options)
# prepare the expected values
config = [ 3, 100, 1, None, None, 100, None, 10, 5 ]
# verify the outcome
self.assertEqual(config, extracted_config)
def test_multiple_node_config_extract_conflicting(self):
"""
Load a blueprint with multiple nodes, which already has the set of
properties matching the ones in the configuration. The properties
appearing in multiple nodes have conflicting values, which the
tool has to reject with an error.
"""
# Load and set the input parameters
blueprint = load_blueprint(self.blueprints['conflicting'])
options = load_options(self.options['multinode'])
# run the extraction
with self.assertRaises(Exception):
extracted_config = extract_blueprint_config(blueprint, options)
if __name__ == '__main__':
unittest.main()
| 38.528942
| 80
| 0.600425
| 2,018
| 19,303
| 5.577304
| 0.11893
| 0.046202
| 0.043003
| 0.023456
| 0.751044
| 0.733363
| 0.703687
| 0.64016
| 0.619014
| 0.568014
| 0
| 0.018903
| 0.301145
| 19,303
| 500
| 81
| 38.606
| 0.815419
| 0.193649
| 0
| 0.540984
| 0
| 0
| 0.230759
| 0.114677
| 0
| 0
| 0
| 0
| 0.15082
| 1
| 0.059016
| false
| 0
| 0.032787
| 0.003279
| 0.098361
| 0.216393
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
e4797fdc0550e8c83ce7e94b28483dfdbf77d5d3
| 344
|
py
|
Python
|
02. Programacion estructurada/05. datos tupla/e1.py
|
Cidryl/python-desde-cero
|
fade09d13ab0ed0cbb4f45a49a4ad9e3980f3276
|
[
"MIT"
] | null | null | null |
02. Programacion estructurada/05. datos tupla/e1.py
|
Cidryl/python-desde-cero
|
fade09d13ab0ed0cbb4f45a49a4ad9e3980f3276
|
[
"MIT"
] | null | null | null |
02. Programacion estructurada/05. datos tupla/e1.py
|
Cidryl/python-desde-cero
|
fade09d13ab0ed0cbb4f45a49a4ad9e3980f3276
|
[
"MIT"
] | null | null | null |
def cargar_fecha():
dd=int(input("Ingrese numero de dia:"))
mm=int(input("Ingrese numero de mes:"))
aa=int(input("Ingrese numero de año:"))
tupla = (dd,mm,aa)
return tupla
def imprimir_fecha(fecha):
print(fecha[0],fecha[1],fecha[2],sep="/")
# bloque principal
fecha=cargar_fecha()
imprimir_fecha(fecha)
| 22.933333
| 46
| 0.639535
| 50
| 344
| 4.32
| 0.48
| 0.111111
| 0.208333
| 0.291667
| 0.319444
| 0
| 0
| 0
| 0
| 0
| 0
| 0.01087
| 0.197674
| 344
| 15
| 47
| 22.933333
| 0.771739
| 0.046512
| 0
| 0
| 0
| 0
| 0.214058
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0
| 0
| 0.3
| 0.1
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
e483e0a6252d9a8ff4f77f42bb3708e55acf3498
| 330
|
py
|
Python
|
flask/part3_templates/ex3-app/students2.py
|
macloo/python-beginners
|
1124922cd57d3f647eacafa0b82948587514d4bd
|
[
"MIT"
] | 42
|
2018-03-25T22:41:57.000Z
|
2022-01-08T21:23:02.000Z
|
flask/part3_templates/ex3-app/students2.py
|
pavanpatil45/python-beginners
|
1124922cd57d3f647eacafa0b82948587514d4bd
|
[
"MIT"
] | null | null | null |
flask/part3_templates/ex3-app/students2.py
|
pavanpatil45/python-beginners
|
1124922cd57d3f647eacafa0b82948587514d4bd
|
[
"MIT"
] | 17
|
2018-03-20T00:56:57.000Z
|
2022-01-12T06:36:18.000Z
|
# two templates are used in this app
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/student/<idnum>')
def student(idnum):
return render_template('student.html', id=idnum)
if __name__ == '__main__':
app.run(debug=True)
| 20.625
| 52
| 0.70303
| 46
| 330
| 4.717391
| 0.565217
| 0.193548
| 0.184332
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.148485
| 330
| 15
| 53
| 22
| 0.772242
| 0.10303
| 0
| 0
| 0
| 0
| 0.16041
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.1
| 0.2
| 0.5
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 2
|
e4b4e1f9c8eb01d9ce9d5ca44f6c9f1bce4a4c9a
| 91
|
py
|
Python
|
travian4api/resources.py
|
ihoromi4/travian4api
|
1fa9023d62d8dfca00f5276eff13868ddc057811
|
[
"BSD-3-Clause"
] | 2
|
2022-03-08T20:50:08.000Z
|
2022-03-08T20:50:13.000Z
|
travian4api/resources.py
|
ihoromi4/travian4api
|
1fa9023d62d8dfca00f5276eff13868ddc057811
|
[
"BSD-3-Clause"
] | null | null | null |
travian4api/resources.py
|
ihoromi4/travian4api
|
1fa9023d62d8dfca00f5276eff13868ddc057811
|
[
"BSD-3-Clause"
] | 2
|
2021-03-10T18:43:53.000Z
|
2021-12-18T13:31:22.000Z
|
RESOURCE_TYPES = ['lumber', 'clay', 'iron', 'crop']
LUMBER = 0
CLAY = 1
IRON = 2
CROP = 3
| 13
| 51
| 0.593407
| 14
| 91
| 3.785714
| 0.714286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.055556
| 0.208791
| 91
| 6
| 52
| 15.166667
| 0.680556
| 0
| 0
| 0
| 0
| 0
| 0.2
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 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
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
e4c4cb3330bd82155cdbb03b29afb2dbeedea99b
| 23,602
|
py
|
Python
|
pysnmp-with-texts/NSCHippiSonet-MIB.py
|
agustinhenze/mibs.snmplabs.com
|
1fc5c07860542b89212f4c8ab807057d9a9206c7
|
[
"Apache-2.0"
] | 8
|
2019-05-09T17:04:00.000Z
|
2021-06-09T06:50:51.000Z
|
pysnmp-with-texts/NSCHippiSonet-MIB.py
|
agustinhenze/mibs.snmplabs.com
|
1fc5c07860542b89212f4c8ab807057d9a9206c7
|
[
"Apache-2.0"
] | 4
|
2019-05-31T16:42:59.000Z
|
2020-01-31T21:57:17.000Z
|
pysnmp-with-texts/NSCHippiSonet-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 NSCHippiSonet-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/NSCHippiSonet-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:25:03 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ConstraintsUnion, ValueSizeConstraint, ConstraintsIntersection, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ConstraintsUnion", "ValueSizeConstraint", "ConstraintsIntersection", "SingleValueConstraint")
nscHippiSonet, = mibBuilder.importSymbols("NSC-MIB", "nscHippiSonet")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
Gauge32, Bits, IpAddress, Integer32, NotificationType, MibIdentifier, iso, ObjectIdentity, Unsigned32, MibScalar, MibTable, MibTableRow, MibTableColumn, ModuleIdentity, TimeTicks, Counter64, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "Gauge32", "Bits", "IpAddress", "Integer32", "NotificationType", "MibIdentifier", "iso", "ObjectIdentity", "Unsigned32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ModuleIdentity", "TimeTicks", "Counter64", "Counter32")
TextualConvention, DisplayString, PhysAddress = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString", "PhysAddress")
nscHippiSonetEngineStatus = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 1), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetEngineStatus.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetEngineStatus.setDescription('String describing the current state of the engine.')
nscHippiSonetRegisters = MibIdentifier((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 2))
nscHippiSonetMonitor = MibIdentifier((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 3))
nscHippiSonetAtoD = MibIdentifier((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 4))
nscHippiSonetSourceIField = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 5), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetSourceIField.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetSourceIField.setDescription('Hippi source I-Field register.')
nscHippiSonetProfile = MibIdentifier((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 6))
nscHippiSonetUnframer = MibIdentifier((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 2, 1))
nscHippiSonetUnframerStatus = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 2, 1, 1), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetUnframerStatus.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetUnframerStatus.setDescription('Unframer status register.')
nscHippiSonetUnframerOHdma = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 2, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetUnframerOHdma.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetUnframerOHdma.setDescription('Unframer overhead DMA register.')
nscHippiSonetFramer = MibIdentifier((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 2, 2))
nscHippiSonetFramerStatus = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 2, 2, 1), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetFramerStatus.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetFramerStatus.setDescription('Framer status register.')
nscHippiSonetFramerAdaptID = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 2, 2, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetFramerAdaptID.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetFramerAdaptID.setDescription('Adaptor ID (HDA) and enable status.')
nscHippiSonetFramerInput = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 2, 2, 3), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetFramerInput.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetFramerInput.setDescription('Framer input register.')
nscHippiSonetFramerData = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 2, 2, 4), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetFramerData.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetFramerData.setDescription('Framer data register.')
nscHippiSonetFramerIField = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 2, 2, 5), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetFramerIField.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetFramerIField.setDescription('Framer I-Field register.')
nscHippiSonetMegaFifo = MibIdentifier((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 2, 3))
nscHippiSonetMFcontrol = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 2, 3, 1), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMFcontrol.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMFcontrol.setDescription('Mega FIFO control register.')
nscHippiSonetMFstatus = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 2, 3, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMFstatus.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMFstatus.setDescription('Mega FIFO status register.')
nscHippiSonetMFtimeout = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 2, 3, 3), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMFtimeout.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMFtimeout.setDescription('Mega FIFO timeout register.')
nscHippiSonetMFConnectStatus = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 2, 3, 4), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMFConnectStatus.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMFConnectStatus.setDescription('Mega FIFO connection status register.')
nscHippiSonetMonClock = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 3, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMonClock.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMonClock.setDescription('500 Khz clock value (for time stamps).')
nscHippiSonetMonMFFlowControl = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 3, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMonMFFlowControl.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMonMFFlowControl.setDescription('Mega FIFO flow control duration.')
nscHippiSonetMonDLFlowControl = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 3, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMonDLFlowControl.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMonDLFlowControl.setDescription('Down line flow control duration')
nscHippiSonetMonBIPErrors = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 3, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMonBIPErrors.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMonBIPErrors.setDescription('Received path BIP Errors.')
nscHippiSonetMonSrcBusy = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 3, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMonSrcBusy.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMonSrcBusy.setDescription('Duration in 500Khz that the source was busy.')
nscHippiSonetMonSrcSOC = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 3, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMonSrcSOC.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMonSrcSOC.setDescription('Number of source start of connections')
nscHippiSonetMonSrcEOC = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 3, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMonSrcEOC.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMonSrcEOC.setDescription('Number of source end of connections')
nscHippiSonetMonDstConnectDuration = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 3, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMonDstConnectDuration.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMonDstConnectDuration.setDescription('Number 500Khz cycles destination has been connected')
nscHippiSonetMonSrcConnectDuration = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 3, 9), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMonSrcConnectDuration.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMonSrcConnectDuration.setDescription('Number 500Khz cycles source has been connected')
nscHippiSonetMonDstConnectReject = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 3, 10), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMonDstConnectReject.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMonDstConnectReject.setDescription('Number of Destination connect rejects.')
nscHippiSonetMonSrcConnectFail = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 3, 11), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMonSrcConnectFail.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMonSrcConnectFail.setDescription('Number of source connect failures.')
nscHippiSonetMonLOF = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 3, 12), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMonLOF.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMonLOF.setDescription('Number of receive sonet Loss of Frame events')
nscHippiSonetMonLOS = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 3, 13), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMonLOS.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMonLOS.setDescription('Number of receive sonet Loss of Signal events')
nscHippiSonetMonDstBursts = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 3, 14), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMonDstBursts.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMonDstBursts.setDescription('Number of Destination bursts')
nscHippiSonetMonDstPackets = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 3, 15), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMonDstPackets.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMonDstPackets.setDescription('Number of Destination packets')
nscHippiSonetMonDstSync = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 3, 16), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMonDstSync.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMonDstSync.setDescription('Number of Destination sync errors')
nscHippiSonetMonDstLLRC = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 3, 17), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMonDstLLRC.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMonDstLLRC.setDescription('Number of Destination LLRC errors')
nscHippiSonetMonDstPE = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 3, 18), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMonDstPE.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMonDstPE.setDescription('Number of Destination Parity Errors')
nscHippiSonetMonDstConnect = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 3, 19), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMonDstConnect.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMonDstConnect.setDescription('Number of Destination connects')
nscHippiSonetMonSrcConnect = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 3, 20), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMonSrcConnect.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMonSrcConnect.setDescription('Number of source connects')
nscHippiSonetMonSrcPackets = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 3, 21), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMonSrcPackets.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMonSrcPackets.setDescription('Number of source packets')
nscHippiSonetMonSrcBursts = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 3, 22), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMonSrcBursts.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMonSrcBursts.setDescription('Number of source bursts')
nscHippiSonetMonSrcForceErrors = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 3, 23), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMonSrcForceErrors.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMonSrcForceErrors.setDescription('Number of Source Bad-data Force Errors')
nscHippiSonetMonSrcCRC = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 3, 24), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMonSrcCRC.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMonSrcCRC.setDescription('Number of Source CRC errors')
nscHippiSonetMonDstWords = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 3, 25), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMonDstWords.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMonDstWords.setDescription('Number of Destination burst words / 32 (Kbits)')
nscHippiSonetMonSrcWords = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 3, 26), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetMonSrcWords.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetMonSrcWords.setDescription('Number of Destination burst words / 32 (Kbits)')
nscHippiSonetADRecvOpticalPower = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 4, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetADRecvOpticalPower.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetADRecvOpticalPower.setDescription("Receive optical power in dbm's")
nscHippiSonetADLaserBias = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 4, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetADLaserBias.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetADLaserBias.setDescription('Laser bias voltage (in milli-volts)')
nscHippiSonetADLaserBackface = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 4, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetADLaserBackface.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetADLaserBackface.setDescription('Laser backface voltage (in milli-volts)')
nscHippiSonetADInternalTemp = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 4, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetADInternalTemp.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetADInternalTemp.setDescription('Internal temperature (degrees F)')
nscHippiSonetADExhaustTemp = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 4, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetADExhaustTemp.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetADExhaustTemp.setDescription('Exhaust temperature (degrees F)')
nscHippiSonetOpticalRcvOffset = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 6, 1), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetOpticalRcvOffset.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetOpticalRcvOffset.setDescription('String representation of the floating value for the offset of the optical receive light formula.')
nscHippiSonetOpticalRcvSlope = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 6, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetOpticalRcvSlope.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetOpticalRcvSlope.setDescription('String representation of the floating value for the slope of the optical receive light formula.')
nscHippiSonetBiasCurrent = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 6, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetBiasCurrent.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetBiasCurrent.setDescription('Integer representation of the floating value for the baseline current of the transmit laser in milliamps. This value is used by the machine to determine the life of the laser.')
nscHippiSonetBiasTemp = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 6, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetBiasTemp.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetBiasTemp.setDescription('Temperature in celcius at which the profiled bias current was taken. This value is used with the bias current to determine the life of the laser.')
nscHippiSonetBackfaceVoltage = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 6, 5), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nscHippiSonetBackfaceVoltage.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetBackfaceVoltage.setDescription('String representation of the floting value of the Voltage in millivolts that was measured at the backface of the laser when it was new. This value is used with the current backface voltage as an additional method of determining if the transmit laser has become defective.')
nscHippiSonetIField = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 6, 6), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: nscHippiSonetIField.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetIField.setDescription('The I-Field address that is used by the hippi interface.')
nscHippiSonetBootPort = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 6, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: nscHippiSonetBootPort.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetBootPort.setDescription('Which rs232 port the boot information should be sent to. Ports 1 & 2 are the only valid ports with 1 being located on the back of the machine and 2 on the front.')
nscHippiSonetPortSpeed = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 6, 8), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: nscHippiSonetPortSpeed.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetPortSpeed.setDescription('The baud rate to set the rs232 ports to at boot time.')
nscHippiSonetThreshold = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 6, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: nscHippiSonetThreshold.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetThreshold.setDescription('Threshold of the mega-fifo at which flow control will be activated. The value represents 8ths of the fifo with 7 representing the fifo must be full before flow control is activated and 0 indicating that flow control will happen as soon as the mega-fifo starts to fill. This value may need to be adjusted to deal with time delays over vary long sonet links in that you want flow control to propagate back to the transmitting sonet box before it puts enough information on the line to overflow this machine.')
nscHippiTimeout = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 6, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 32767))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: nscHippiTimeout.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiTimeout.setDescription('Timeout value to use when trying to connect from our hippi source. This timer is started when the source raises connect. If the destination fails to respond before the timer goes off, the connect will be aborted. The timer is represented as the number of 500 KHz clock ticks.')
nscHippiSonetDipSwitch = MibScalar((1, 3, 6, 1, 4, 1, 10, 2, 1, 5, 6, 11), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: nscHippiSonetDipSwitch.setStatus('mandatory')
if mibBuilder.loadTexts: nscHippiSonetDipSwitch.setDescription('This is a software switch that functions much like a hardware dip switch. At the moment, the only use of this switch is to define whether the unit will act as the master clock for the sonet line. The bit values are defined as follows: x x x x x x 1 - assert master clock x x x x x 1 x - not assigned x x x x 1 x x - not assigned x x x 1 x x x - not assigned x x 1 x x x x - not assigned x 1 x x x x x - not assigned 1 x x x x x x - not assigned')
mibBuilder.exportSymbols("NSCHippiSonet-MIB", nscHippiSonetMonClock=nscHippiSonetMonClock, nscHippiSonetMonDstPackets=nscHippiSonetMonDstPackets, nscHippiSonetMonDLFlowControl=nscHippiSonetMonDLFlowControl, nscHippiSonetMegaFifo=nscHippiSonetMegaFifo, nscHippiSonetMonLOS=nscHippiSonetMonLOS, nscHippiSonetEngineStatus=nscHippiSonetEngineStatus, nscHippiSonetFramerAdaptID=nscHippiSonetFramerAdaptID, nscHippiSonetMonSrcConnectFail=nscHippiSonetMonSrcConnectFail, nscHippiSonetBiasTemp=nscHippiSonetBiasTemp, nscHippiSonetMonSrcPackets=nscHippiSonetMonSrcPackets, nscHippiSonetFramerIField=nscHippiSonetFramerIField, nscHippiSonetMonDstConnectDuration=nscHippiSonetMonDstConnectDuration, nscHippiSonetBackfaceVoltage=nscHippiSonetBackfaceVoltage, nscHippiSonetUnframerStatus=nscHippiSonetUnframerStatus, nscHippiSonetFramerStatus=nscHippiSonetFramerStatus, nscHippiSonetMonDstConnectReject=nscHippiSonetMonDstConnectReject, nscHippiSonetMonDstWords=nscHippiSonetMonDstWords, nscHippiSonetOpticalRcvOffset=nscHippiSonetOpticalRcvOffset, nscHippiSonetMonBIPErrors=nscHippiSonetMonBIPErrors, nscHippiSonetMonDstConnect=nscHippiSonetMonDstConnect, nscHippiSonetPortSpeed=nscHippiSonetPortSpeed, nscHippiSonetMonDstLLRC=nscHippiSonetMonDstLLRC, nscHippiSonetUnframerOHdma=nscHippiSonetUnframerOHdma, nscHippiSonetMonDstSync=nscHippiSonetMonDstSync, nscHippiSonetADLaserBias=nscHippiSonetADLaserBias, nscHippiSonetMFtimeout=nscHippiSonetMFtimeout, nscHippiSonetADExhaustTemp=nscHippiSonetADExhaustTemp, nscHippiSonetFramerInput=nscHippiSonetFramerInput, nscHippiSonetMonSrcCRC=nscHippiSonetMonSrcCRC, nscHippiSonetMonLOF=nscHippiSonetMonLOF, nscHippiSonetMonDstBursts=nscHippiSonetMonDstBursts, nscHippiSonetADRecvOpticalPower=nscHippiSonetADRecvOpticalPower, nscHippiSonetADInternalTemp=nscHippiSonetADInternalTemp, nscHippiSonetMFcontrol=nscHippiSonetMFcontrol, nscHippiSonetMFConnectStatus=nscHippiSonetMFConnectStatus, nscHippiSonetMonSrcConnectDuration=nscHippiSonetMonSrcConnectDuration, nscHippiSonetFramer=nscHippiSonetFramer, nscHippiSonetDipSwitch=nscHippiSonetDipSwitch, nscHippiSonetMonitor=nscHippiSonetMonitor, nscHippiSonetMonMFFlowControl=nscHippiSonetMonMFFlowControl, nscHippiSonetUnframer=nscHippiSonetUnframer, nscHippiSonetFramerData=nscHippiSonetFramerData, nscHippiSonetIField=nscHippiSonetIField, nscHippiSonetOpticalRcvSlope=nscHippiSonetOpticalRcvSlope, nscHippiSonetRegisters=nscHippiSonetRegisters, nscHippiSonetSourceIField=nscHippiSonetSourceIField, nscHippiSonetMonSrcForceErrors=nscHippiSonetMonSrcForceErrors, nscHippiSonetBiasCurrent=nscHippiSonetBiasCurrent, nscHippiSonetMonDstPE=nscHippiSonetMonDstPE, nscHippiSonetProfile=nscHippiSonetProfile, nscHippiSonetMonSrcBusy=nscHippiSonetMonSrcBusy, nscHippiSonetMonSrcSOC=nscHippiSonetMonSrcSOC, nscHippiSonetAtoD=nscHippiSonetAtoD, nscHippiTimeout=nscHippiTimeout, nscHippiSonetMFstatus=nscHippiSonetMFstatus, nscHippiSonetMonSrcConnect=nscHippiSonetMonSrcConnect, nscHippiSonetMonSrcEOC=nscHippiSonetMonSrcEOC, nscHippiSonetMonSrcWords=nscHippiSonetMonSrcWords, nscHippiSonetBootPort=nscHippiSonetBootPort, nscHippiSonetMonSrcBursts=nscHippiSonetMonSrcBursts, nscHippiSonetThreshold=nscHippiSonetThreshold, nscHippiSonetADLaserBackface=nscHippiSonetADLaserBackface)
| 125.542553
| 3,243
| 0.800398
| 2,606
| 23,602
| 7.249041
| 0.150422
| 0.069875
| 0.12228
| 0.013128
| 0.401673
| 0.263829
| 0.190143
| 0.100259
| 0.094966
| 0.088825
| 0
| 0.047579
| 0.087238
| 23,602
| 187
| 3,244
| 126.213904
| 0.829318
| 0.013897
| 0
| 0
| 0
| 0.038889
| 0.222093
| 0.001891
| 0
| 0
| 0
| 0
| 0.005556
| 1
| 0
| false
| 0
| 0.038889
| 0
| 0.038889
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
e4e47a927be1df6a8c7ab23bada3a5ee286f11b3
| 590
|
py
|
Python
|
bootstrapvz/plugins/insecure/tasks.py
|
null0000/bootstrap-vz
|
003cdd9808bac90383b4c46738507bd7e1daa268
|
[
"Apache-2.0"
] | null | null | null |
bootstrapvz/plugins/insecure/tasks.py
|
null0000/bootstrap-vz
|
003cdd9808bac90383b4c46738507bd7e1daa268
|
[
"Apache-2.0"
] | null | null | null |
bootstrapvz/plugins/insecure/tasks.py
|
null0000/bootstrap-vz
|
003cdd9808bac90383b4c46738507bd7e1daa268
|
[
"Apache-2.0"
] | null | null | null |
from bootstrapvz.base import Task
from bootstrapvz.common import phases
import os
import shutil
class EnableInsecureAccess(Task):
description = 'Enabling shell access via /dev/ttyS1'
phase = phases.system_modification
@classmethod
def run(cls, info):
# Append a line to /etc/inittab launching /bin/bash on
# /dev/ttyS1.
insecure_line_source = os.path.join(os.path.dirname(__file__), 'ttyS1.inittab')
with open(os.path.join(info.root, 'etc', 'inittab'), 'a') as inittab:
with open(insecure_line_source, 'r') as insecure_line:
shutil.copyfileobj(insecure_line, inittab)
| 31.052632
| 81
| 0.754237
| 83
| 590
| 5.228916
| 0.578313
| 0.110599
| 0.082949
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005871
| 0.133898
| 590
| 18
| 82
| 32.777778
| 0.843444
| 0.108475
| 0
| 0
| 0
| 0
| 0.116635
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.076923
| false
| 0
| 0.307692
| 0
| 0.615385
| 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
| 0
| 1
| 0
|
0
| 2
|
e4ec28c7bf7bd90f9b875de7df12fd87fba4eede
| 4,961
|
py
|
Python
|
atlas/foundations_contrib/src/test/models/test_queued_job.py
|
DeepLearnI/atlas
|
8aca652d7e647b4e88530b93e265b536de7055ed
|
[
"Apache-2.0"
] | 296
|
2020-03-16T19:55:00.000Z
|
2022-01-10T19:46:05.000Z
|
atlas/foundations_contrib/src/test/models/test_queued_job.py
|
DeepLearnI/atlas
|
8aca652d7e647b4e88530b93e265b536de7055ed
|
[
"Apache-2.0"
] | 57
|
2020-03-17T11:15:57.000Z
|
2021-07-10T14:42:27.000Z
|
atlas/foundations_contrib/src/test/models/test_queued_job.py
|
DeepLearnI/atlas
|
8aca652d7e647b4e88530b93e265b536de7055ed
|
[
"Apache-2.0"
] | 38
|
2020-03-17T21:06:05.000Z
|
2022-02-08T03:19:34.000Z
|
import unittest
from mock import Mock
from foundations_spec.helpers import let, let_patch_mock, let_patch_instance, set_up
from foundations_spec.helpers.spec import Spec
from foundations_contrib.models.queued_job import QueuedJob
from fakeredis import FakeRedis
class TestQueuedJob(Spec):
mock_time = let_patch_mock('time.time')
mock_redis = let_patch_mock('foundations_contrib.global_state.redis_connection', FakeRedis())
@let
def mock_redis_pipeline(self):
from foundations_contrib.redis_pipeline_wrapper import RedisPipelineWrapper
pipeline = self.mock_redis.pipeline()
return RedisPipelineWrapper(pipeline)
@let
def job_id(self):
return self.faker.sha256()
@let
def queued_time(self):
import random
return random.randint(1, 100)
@let
def project_name(self):
import uuid
return str(uuid.uuid4())
@let
def time_since_queued(self):
import random
return random.randint(1, 100)
@let
def job_id_two(self):
return self.faker.sha256()
@let
def queued_time_two(self):
import random
return random.randint(1, 100)
@let
def project_name_two(self):
import uuid
return str(uuid.uuid4())
@let
def time_since_queued_two(self):
from time import time
return time() - self.queued_time_two
@let
def queued_job(self):
return QueuedJob(
job_id=self.job_id,
queued_time=self.queued_time,
project_name=self.project_name,
time_since_queued=self.time_since_queued
)
@let
def queued_job_two(self):
return QueuedJob(
job_id=self.job_id_two,
queued_time=self.queued_time_two,
project_name=self.project_name_two,
time_since_queued=self.time_since_queued_two
)
@let
def queue_message(self):
return {'job_id': self.job_id, 'project_name': self.project_name}
@let
def queue_message_two(self):
return {'job_id': self.job_id_two, 'project_name': self.project_name_two}
@set_up
def set_up(self):
self.mock_time.return_value = self.queued_time + self.time_since_queued
def test_has_job_id(self):
self.assertEqual(self.job_id, self.queued_job.job_id)
def test_has_queued_time(self):
self.assertEqual(self.queued_time, self.queued_job.queued_time)
def test_has_project_name(self):
self.assertEqual(self.project_name, self.queued_job.project_name)
def test_has_time_since_queued(self):
self.assertEqual(
self.time_since_queued,
self.queued_job.time_since_queued
)
def test_find_async_returns_none_when_job_does_not_exist(self):
async_job = QueuedJob.find_async(self.mock_redis_pipeline, self.job_id)
self.mock_redis_pipeline.execute()
self.assertIsNone(async_job.get())
def test_find_async_returns_data_for_single_job(self):
self._store_job_data()
async_job = QueuedJob.find_async(self.mock_redis_pipeline, self.job_id)
self.mock_redis_pipeline.execute()
job = async_job.get()
self.assertEqual(self.queued_job, job)
def test_all_async_returns_empty_list_when_no_queued_jobs(self):
jobs = QueuedJob.all()
self.assertEqual([], jobs)
def test_all_async_returns_jobs(self):
self._store_job_data()
jobs = QueuedJob.all()
self.assert_list_contains_items([self.queued_job], jobs)
def test_all_async_returns_jobs_multiple_jobs(self):
self._store_job_data()
self._store_job_data_two()
jobs = QueuedJob.all()
self.assert_list_contains_items([self.queued_job, self.queued_job_two], jobs)
def _store_job_data(self):
from foundations_events.consumers.jobs.queued.creation_time import CreationTime
from foundations_events.consumers.jobs.queued.project_name import ProjectName
from foundations_events.consumers.jobs.queued.global_listing import GlobalListing
CreationTime(self.mock_redis).call(self.queue_message, self.queued_time, {})
ProjectName(self.mock_redis).call(self.queue_message, self.queued_time, {})
GlobalListing(self.mock_redis).call(self.queue_message, self.queued_time, {})
def _store_job_data_two(self):
from foundations_events.consumers.jobs.queued.creation_time import CreationTime
from foundations_events.consumers.jobs.queued.project_name import ProjectName
from foundations_events.consumers.jobs.queued.global_listing import GlobalListing
CreationTime(self.mock_redis).call(self.queue_message_two, self.queued_time_two, {})
ProjectName(self.mock_redis).call(self.queue_message_two, self.queued_time_two, {})
GlobalListing(self.mock_redis).call(self.queue_message_two, self.queued_time_two, {})
| 31.598726
| 97
| 0.702882
| 656
| 4,961
| 4.96189
| 0.126524
| 0.058372
| 0.043932
| 0.0553
| 0.621813
| 0.546237
| 0.531797
| 0.458065
| 0.423041
| 0.397849
| 0
| 0.00512
| 0.212659
| 4,961
| 156
| 98
| 31.801282
| 0.828213
| 0
| 0
| 0.37069
| 0
| 0
| 0.018952
| 0.009879
| 0
| 0
| 0
| 0
| 0.077586
| 1
| 0.215517
| false
| 0
| 0.163793
| 0.051724
| 0.517241
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 2
|
e4f43253efd72ee6f97db976bf7d874a78157c8f
| 347
|
py
|
Python
|
psim/packages/tictoc/__init__.py
|
bburns/psimPython
|
610321313a220bc413560daaf64ff2274ae05c02
|
[
"MIT"
] | null | null | null |
psim/packages/tictoc/__init__.py
|
bburns/psimPython
|
610321313a220bc413560daaf64ff2274ae05c02
|
[
"MIT"
] | null | null | null |
psim/packages/tictoc/__init__.py
|
bburns/psimPython
|
610321313a220bc413560daaf64ff2274ae05c02
|
[
"MIT"
] | null | null | null |
"""
tictoc
matlab-like tic and toc functions
see https://stackoverflow.com/questions/5849800/what-is-the-python-equivalent-of-matlabs-tic-and-toc-functions
"""
import time
tics = []
def tic():
tics.append(time.process_time())
def toc():
if len(tics) == 0:
return None
else:
return time.process_time() - tics.pop()
| 17.35
| 110
| 0.665706
| 49
| 347
| 4.673469
| 0.673469
| 0.052402
| 0.078603
| 0.157205
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.028269
| 0.184438
| 347
| 19
| 111
| 18.263158
| 0.780919
| 0.435159
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.222222
| false
| 0
| 0.111111
| 0
| 0.555556
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 2
|
9001723e3ad1821cbe597698ec69edc8b0731984
| 839
|
py
|
Python
|
uninas/modules/modules/cnn.py
|
cogsys-tuebingen/uninas
|
06729b9cf517ec416fb798ae387c5bd9c3a278ac
|
[
"MIT"
] | 18
|
2020-11-22T16:03:08.000Z
|
2022-03-15T12:11:46.000Z
|
uninas/modules/modules/cnn.py
|
cogsys-tuebingen/uninas
|
06729b9cf517ec416fb798ae387c5bd9c3a278ac
|
[
"MIT"
] | 2
|
2022-01-04T08:10:17.000Z
|
2022-01-05T08:13:14.000Z
|
uninas/modules/modules/cnn.py
|
cogsys-tuebingen/uninas
|
06729b9cf517ec416fb798ae387c5bd9c3a278ac
|
[
"MIT"
] | 6
|
2021-03-08T07:08:52.000Z
|
2022-02-24T12:00:43.000Z
|
import torch
import torch.nn as nn
class SqueezeModule(nn.Module):
def forward(self, x: torch.Tensor) -> torch.Tensor:
return x.squeeze()
class GapSqueezeModule(nn.Module):
""" global average pooling and squeezing """
def __init__(self):
super().__init__()
self.gap = nn.AdaptiveAvgPool2d(1)
def forward(self, x: torch.Tensor) -> torch.Tensor:
return self.gap(x).squeeze()
class PaddingToValueModule(nn.Module):
def __init__(self, to_value: int, dim=-1):
super().__init__()
self.to_value = to_value
self.dim = dim
def forward(self, x: torch.Tensor) -> torch.Tensor:
shape = list(x.shape)
shape[self.dim] = self.to_value - shape[self.dim]
return torch.cat([x, torch.zeros(shape, dtype=x.dtype, device=x.device)], dim=self.dim)
| 27.064516
| 95
| 0.640048
| 113
| 839
| 4.575221
| 0.318584
| 0.12766
| 0.081238
| 0.087041
| 0.237911
| 0.237911
| 0.237911
| 0.237911
| 0.166344
| 0
| 0
| 0.004594
| 0.221692
| 839
| 30
| 96
| 27.966667
| 0.787136
| 0.042908
| 0
| 0.25
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.1
| 0.1
| 0.65
| 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
| 0
| 1
| 0
|
0
| 2
|
900c0768bdb748b6c9e90f7a675de1895a6d4acc
| 4,386
|
py
|
Python
|
app/api/V1/views/auth_endpoints.py
|
eduhmik/Store-Manager-api
|
50395d39758800784fbd0b3e516b8bedc900cdeb
|
[
"MIT"
] | null | null | null |
app/api/V1/views/auth_endpoints.py
|
eduhmik/Store-Manager-api
|
50395d39758800784fbd0b3e516b8bedc900cdeb
|
[
"MIT"
] | 8
|
2018-10-24T01:33:32.000Z
|
2019-10-21T17:36:01.000Z
|
app/api/V1/views/auth_endpoints.py
|
eduhmik/Store-Manager-api
|
50395d39758800784fbd0b3e516b8bedc900cdeb
|
[
"MIT"
] | 1
|
2018-10-19T21:57:48.000Z
|
2018-10-19T21:57:48.000Z
|
from flask import Flask, request, jsonify, Blueprint, json, make_response
from flask_restplus import Resource, reqparse, Api, Namespace, fields
from ..models.user_model import User
api = Namespace('Register Endpoint', description='A collection of register endpoints for the user model')
ns = Namespace('Users Endpoints', description='Users endpoints to fetch all users and delete them')
ns2 = Namespace('Login_endpoint', description='Login endpoints for the user model')
ns3 = Namespace('Logout Endpoint', description='An endpoint to logout')
parser = reqparse.RequestParser()
parser.add_argument('username', help = 'This field cannot be blank')
parser.add_argument('email', help = 'This field cannot be blank', required = True)
parser.add_argument('phone', help = 'This field cannot be blank')
parser.add_argument('role', help = 'This field cannot be blank')
parser.add_argument('password', help = 'This field cannot be blank', required = True)
login_fields = api.model('Login', {
'email': fields.String,
'password': fields.String
})
"""user login"""
@ns2.route('')
class UserLogin(Resource):
@ns2.expect(login_fields)
def post(self):
args = parser.parse_args()
email = args['email']
password = args['password']
try:
<<<<<<< HEAD
current_user = User.get_single_user(email)
=======
current_user = User.get_single_user(self, email)
>>>>>>> develop
if current_user == 'not found':
return make_response(jsonify({
'status': 'success',
'message': 'User does not exist, sign up!'
}), 200)
if current_user and User.verify_hash(password, current_user['password']):
role = current_user['role']
email = current_user['email']
auth_token = User.encode_auth_token(email, role)
if auth_token:
return make_response(jsonify({
'status' : 'ok',
'message' : 'Logged in successfully',
'auth_token': auth_token.decode()
}), 200)
else:
return make_response(jsonify({
'message' : 'Incorrect email or password',
'status' : 'fail'
}), 400)
except Exception as e:
return make_response(jsonify({
'message' : str(e),
'status' : 'failed'
}), 500)
registration_fields = api.model('Registration', {
'username' : fields.String,
'email': fields.String,
'phone' : fields.String,
'role': fields.String,
'password': fields.String
})
"""user regitration"""
@api.route('')
class UserRegistration(Resource):
@api.expect(registration_fields)
def post(self):
args = parser.parse_args()
username = args['username']
email = args['email']
phone = args['phone']
role = args['role']
password = args['password']
found_email = User.get_single_user(self, email)
if found_email == 'not found':
try:
new_user = User(email, User.generate_hash(password), username, role, phone)
created_user = new_user.create_user()
return make_response(jsonify({
'status': 'ok',
'message': 'User created successfully',
'users': created_user
}), 201)
except Exception as e:
return make_response(jsonify({
'message' : str(e),
'status' : 'failed'
}), 500)
return make_response(jsonify({
'status': 'fail',
'message' : 'Email already exists, please log in'
}))
"""fetch all users"""
@ns.route('')
class AllUsers(Resource):
@ns.doc(security='apikey')
def get(self):
users_list = User.get_all_users(self)
return make_response(jsonify({
'message': 'Get all users successful',
'status': 'ok',
'users': users_list
}), 200)
"""user logout"""
@ns3.route('')
class UserLogoutAccess(Resource):
@ns3.doc(security='apikey')
def post(self):
pass
| 33.227273
| 105
| 0.559052
| 452
| 4,386
| 5.303097
| 0.280973
| 0.045056
| 0.060075
| 0.083438
| 0.347101
| 0.27451
| 0.206508
| 0.173133
| 0.111389
| 0.057572
| 0
| 0.009015
| 0.317145
| 4,386
| 131
| 106
| 33.480916
| 0.791319
| 0
| 0
| 0.367925
| 0
| 0
| 0.196797
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0.084906
| 0.028302
| null | null | 0.009434
| 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
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 2
|
9037ec295216061bb4362e12f89dff7a2894c6f3
| 3,125
|
py
|
Python
|
profesionales/migrations/0005_auto_20190928_2338.py
|
cluster311/ggg
|
262173c66fe40ada30083d439a79f16f841f5772
|
[
"BSD-3-Clause"
] | 6
|
2020-03-16T02:51:16.000Z
|
2020-11-10T00:58:01.000Z
|
profesionales/migrations/0005_auto_20190928_2338.py
|
cluster311/ggg
|
262173c66fe40ada30083d439a79f16f841f5772
|
[
"BSD-3-Clause"
] | 204
|
2019-09-19T02:00:57.000Z
|
2022-02-10T10:48:52.000Z
|
profesionales/migrations/0005_auto_20190928_2338.py
|
cluster311/ggg
|
262173c66fe40ada30083d439a79f16f841f5772
|
[
"BSD-3-Clause"
] | 3
|
2019-09-16T22:59:24.000Z
|
2022-03-21T22:52:44.000Z
|
# Generated by Django 2.2.4 on 2019-09-28 23:38
import address.models
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('address', '0002_auto_20160213_1726'),
('profesionales', '0004_auto_20190927_0004'),
]
operations = [
migrations.AlterModelOptions(
name='profesional',
options={'permissions': [('can_view_tablero', 'Puede ver los tableros de comandos sobre profesionales')], 'verbose_name_plural': 'Profesionales'},
),
migrations.RemoveField(
model_name='profesional',
name='departamento',
),
migrations.RemoveField(
model_name='profesional',
name='dni',
),
migrations.RemoveField(
model_name='profesional',
name='domicilio',
),
migrations.RemoveField(
model_name='profesional',
name='localidad',
),
migrations.RemoveField(
model_name='profesional',
name='telefono',
),
migrations.AddField(
model_name='profesional',
name='direccion',
field=address.models.AddressField(null=True, on_delete=django.db.models.deletion.SET_NULL, to='address.Address'),
),
migrations.AddField(
model_name='profesional',
name='fecha_nacimiento',
field=models.DateField(blank=True, null=True),
),
migrations.AddField(
model_name='profesional',
name='nacionalidad',
field=models.CharField(choices=[('argentina', 'argentina'), ('boliviana', 'boliviana'), ('brasilera', 'brasilera'), ('chilena', 'chilena'), ('colombiana', 'colombiana'), ('ecuatoriana', 'ecuatoriana'), ('paraguaya', 'paraguaya'), ('peruana', 'peruana'), ('uruguaya', 'uruguaya'), ('venezolana', 'venezolana'), ('otra', 'otra')], default='argentina', max_length=50),
),
migrations.AddField(
model_name='profesional',
name='numero_documento',
field=models.CharField(blank=True, help_text='Deje en blanco si está indocumentado', max_length=30, null=True),
),
migrations.AddField(
model_name='profesional',
name='sexo',
field=models.CharField(choices=[('masculino', 'masculino'), ('femenino', 'femenino'), ('otro', 'otro')], default='masculino', max_length=20),
),
migrations.AddField(
model_name='profesional',
name='tipo_documento',
field=models.CharField(choices=[('DNI', 'DNI'), ('LC', 'LC'), ('LE', 'LE'), ('PASAPORTE', 'PASAPORTE'), ('OTRO', 'OTRO')], default='DNI', max_length=20),
),
migrations.AlterField(
model_name='profesional',
name='apellidos',
field=models.CharField(max_length=30),
),
migrations.AlterField(
model_name='profesional',
name='nombres',
field=models.CharField(max_length=50),
),
]
| 38.580247
| 377
| 0.57824
| 276
| 3,125
| 6.42029
| 0.387681
| 0.11851
| 0.146727
| 0.176072
| 0.360609
| 0.327878
| 0.056433
| 0.056433
| 0
| 0
| 0
| 0.025945
| 0.27232
| 3,125
| 80
| 378
| 39.0625
| 0.753298
| 0.0144
| 0
| 0.540541
| 1
| 0
| 0.260234
| 0.014945
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.040541
| 0
| 0.081081
| 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
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
90429ee16f26834b4fd4e1ca6831ceabda97033d
| 298
|
py
|
Python
|
api/applications/migrations/0042_merge_20201213_0228.py
|
django-doctor/lite-api
|
1ba278ba22ebcbb977dd7c31dd3701151cd036bf
|
[
"MIT"
] | 3
|
2019-05-15T09:30:39.000Z
|
2020-04-22T16:14:23.000Z
|
api/applications/migrations/0042_merge_20201213_0228.py
|
django-doctor/lite-api
|
1ba278ba22ebcbb977dd7c31dd3701151cd036bf
|
[
"MIT"
] | 85
|
2019-04-24T10:39:35.000Z
|
2022-03-21T14:52:12.000Z
|
api/applications/migrations/0042_merge_20201213_0228.py
|
django-doctor/lite-api
|
1ba278ba22ebcbb977dd7c31dd3701151cd036bf
|
[
"MIT"
] | 1
|
2021-01-17T11:12:19.000Z
|
2021-01-17T11:12:19.000Z
|
# Generated by Django 2.2.16 on 2020-12-13 02:28
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("applications", "0041_goodonapplication_is_precedent"),
("applications", "0041_goodonapplicationdocument"),
]
operations = []
| 21.285714
| 64
| 0.694631
| 31
| 298
| 6.548387
| 0.806452
| 0.157635
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.1
| 0.194631
| 298
| 13
| 65
| 22.923077
| 0.745833
| 0.154362
| 0
| 0
| 1
| 0
| 0.356
| 0.26
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.142857
| 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
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 2
|
5f50dd9219cff3c1253c4849dd5381638d312cc3
| 1,214
|
py
|
Python
|
py/py_0736_paths_to_equality.py
|
lcsm29/project-euler
|
fab794ece5aa7a11fc7c2177f26250f40a5b1447
|
[
"MIT"
] | null | null | null |
py/py_0736_paths_to_equality.py
|
lcsm29/project-euler
|
fab794ece5aa7a11fc7c2177f26250f40a5b1447
|
[
"MIT"
] | null | null | null |
py/py_0736_paths_to_equality.py
|
lcsm29/project-euler
|
fab794ece5aa7a11fc7c2177f26250f40a5b1447
|
[
"MIT"
] | null | null | null |
# Solution of;
# Project Euler Problem 736: Paths to Equality
# https://projecteuler.net/problem=736
#
# Define two functions on lattice points:$r(x,y) = (x+1,2y)$$s(x,y) =
# (2x,y+1)$A path to equality of length $n$ for a pair $(a,b)$ is a sequence
# $\Big((a_1,b_1),(a_2,b_2),\ldots,(a_n,b_n)\Big)$, where:$(a_1,b_1) =
# (a,b)$$(a_k,b_k) = r(a_{k-1},b_{k-1})$ or $(a_k,b_k) = s(a_{k-1},b_{k-1})$
# for $k > 1$$a_k \ne b_k$ for $k < n$$a_n = b_n$$a_n = b_n$ is called the
# final value. For example,$(45,90)\xrightarrow{r}
# (46,180)\xrightarrow{s}(92,181)\xrightarrow{s}(184,182)\xrightarrow{s}(368,183)\xrightarrow{s}(736,184)\xrightarrow{r}$$(737,368)\xrightarrow{s}(1474,369)\xrightarrow{r}(1475,738)\xrightarrow{r}(1476,1476)$This
# is a path to equality for $(45,90)$ and is of length 10 with final value
# 1476. There is no path to equality of $(45,90)$ with smaller length. Find
# the unique path to equality for $(45,90)$ with smallest odd length. Enter
# the final value as your answer.
#
# by lcsm29 http://github.com/lcsm29/project-euler
import timed
def dummy(n):
pass
if __name__ == '__main__':
n = 1000
i = 10000
prob_id = 736
timed.caller(dummy, n, i, prob_id)
| 40.466667
| 213
| 0.651565
| 237
| 1,214
| 3.202532
| 0.409283
| 0.065876
| 0.073781
| 0.01581
| 0.096179
| 0.071146
| 0
| 0
| 0
| 0
| 0
| 0.112195
| 0.155684
| 1,214
| 29
| 214
| 41.862069
| 0.628293
| 0.846787
| 0
| 0
| 0
| 0
| 0.047619
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.125
| false
| 0.125
| 0.125
| 0
| 0.25
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 2
|
5f54a49151f01f5e6cf35cf93d8091376f6fa1d7
| 431
|
py
|
Python
|
doping_test/Standard.py
|
Biewer/Doping-Tests-for-Cyber-Physical-Systems-Tool
|
eb359ba618f0022dcd403edc99904f3ef2940e65
|
[
"MIT"
] | null | null | null |
doping_test/Standard.py
|
Biewer/Doping-Tests-for-Cyber-Physical-Systems-Tool
|
eb359ba618f0022dcd403edc99904f3ef2940e65
|
[
"MIT"
] | null | null | null |
doping_test/Standard.py
|
Biewer/Doping-Tests-for-Cyber-Physical-Systems-Tool
|
eb359ba618f0022dcd403edc99904f3ef2940e65
|
[
"MIT"
] | null | null | null |
class Standard(object):
"""Abstract class for representation of Standard LTS"""
def __init__(self):
super(Standard, self).__init__()
def get_any_trace(self, boundary):
# Return any of the traces of standard LTS S
raise NotImplementedError('Abstract method not implemented!')
def get_traces(self, boundary):
# Return all traces up to length `boundary`
raise NotImplementedError('Abstract method not implemented!')
| 30.785714
| 63
| 0.756381
| 56
| 431
| 5.625
| 0.517857
| 0.063492
| 0.08254
| 0.24127
| 0.330159
| 0.330159
| 0
| 0
| 0
| 0
| 0
| 0
| 0.150812
| 431
| 13
| 64
| 33.153846
| 0.860656
| 0.313225
| 0
| 0.285714
| 0
| 0
| 0.222222
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.428571
| false
| 0
| 0
| 0
| 0.571429
| 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
| 0
| 0
|
0
| 2
|
5f72433b75556b159f57faa7593653f49eb2cb21
| 3,557
|
py
|
Python
|
T53/webapp/accounts/models.py
|
DevelopAppWithMe/Hackathon_5.0
|
6af503a995721c04986931d6a29d8f946ceaa067
|
[
"MIT"
] | null | null | null |
T53/webapp/accounts/models.py
|
DevelopAppWithMe/Hackathon_5.0
|
6af503a995721c04986931d6a29d8f946ceaa067
|
[
"MIT"
] | null | null | null |
T53/webapp/accounts/models.py
|
DevelopAppWithMe/Hackathon_5.0
|
6af503a995721c04986931d6a29d8f946ceaa067
|
[
"MIT"
] | null | null | null |
from django.db import models
# Create your models here.
from django.contrib.auth.models import (
AbstractBaseUser,
BaseUserManager,
PermissionsMixin,
)
from django.core.validators import RegexValidator
from django.db import models
class UserManager(BaseUserManager):
def create_user(self, phone_number, password):
if not phone_number:
raise ValueError("Phone number must be set")
if not password:
raise ValueError("Password must be set")
# pass fields as arguments which are REQUIRED_FIELDS to user = self.model()
user = self.model(phone_number=phone_number)
user.set_password(password)
user.save(using=self._db)
return user
def create_superuser(self, phone_number, password):
# for super user admin role is fixed to 1
user = self.create_user(phone_number, password=password,)
user.is_staff = True
user.is_superuser = True
user.save(using=self._db)
return user
class User(AbstractBaseUser, PermissionsMixin):
phone_regex = RegexValidator(
regex=r"^\+?1?\d{9,15}$",
message="Phone number must be entered in the format: '+919939799264'. Up to 15 digits allowed.",
)
phone_number = models.CharField(
validators=[phone_regex], max_length=15, unique=True, null=False, blank=False
)
is_active = models.BooleanField(default=True, null=False, blank=False)
is_staff = models.BooleanField(default=False, null=False, blank=False)
is_superuser = models.BooleanField(default=False, null=False, blank=False)
created_at = models.DateTimeField(auto_now_add=True)
last_login = models.DateTimeField(auto_now_add=True)
# set USERNAME_FIELD to phone_number
USERNAME_FIELD = "phone_number"
# username AND password by default are included in REQUIRED_FIELDS
REQUIRED_FIELDS = []
objects = UserManager()
def __str__(self):
return self.phone_number
def get_full_name(self):
return self.phone_number
class PhoneOTP(models.Model):
phone_regex = RegexValidator(
regex=r"^\+?1?\d{9,15}$",
message="Phone number must be entered in the format: '+919939799264'. Up to 15 digits allowed.",
)
phone_number = models.CharField(
validators=[phone_regex], max_length=15, null=False, blank=False
)
otp = models.CharField(max_length=9, blank=False, null=False)
timestamp = models.DateTimeField(auto_now_add=True)
validated = models.BooleanField(default=False)
def __str__(self):
return str(self.phone_number) + " otp is " + str(self.otp)
class UserLoginActivity(models.Model):
SUCCESS = "S"
FAILED = "F"
LOGIN_STATUS = ((SUCCESS, "Success"), (FAILED, "Failed"))
phone_regex = RegexValidator(
regex=r"^\+?1?\d{9,15}$",
message="Phone number must be entered in the format: '+919939799264'. Up to 15 digits allowed.",
) # phone_number max length 15 including country code
login_phone_number = models.CharField(
validators=[phone_regex], max_length=15, null=False, blank=False
)
login_ip = models.GenericIPAddressField(null=True, blank=True)
login_datetime = models.DateTimeField(auto_now=True)
status = models.CharField(
max_length=1, choices=LOGIN_STATUS, default=SUCCESS, null=True, blank=True
)
class Meta:
verbose_name = "user_login_activity"
verbose_name_plural = "user_login_activities"
def __str__(self):
return str(self.login_phone_number)
| 32.336364
| 104
| 0.687939
| 448
| 3,557
| 5.285714
| 0.261161
| 0.092905
| 0.035473
| 0.048142
| 0.420186
| 0.377956
| 0.295608
| 0.271115
| 0.22973
| 0.22973
| 0
| 0.023214
| 0.21282
| 3,557
| 109
| 105
| 32.633028
| 0.8225
| 0.080967
| 0
| 0.307692
| 0
| 0
| 0.128449
| 0.006438
| 0
| 0
| 0
| 0
| 0
| 1
| 0.076923
| false
| 0.076923
| 0.051282
| 0.051282
| 0.564103
| 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
| 0
| 0
| 1
| 0
|
0
| 2
|
5f82a8065c53d38a11111b87bd83da3803a657ae
| 1,981
|
py
|
Python
|
django-server/fras/attendance/utils.py
|
ArleneAndrews/Facial-Recognition-Attendance-System
|
104d17e56af87358974331ef491949b557ab2f01
|
[
"MIT"
] | 52
|
2019-01-29T14:46:17.000Z
|
2022-01-14T16:11:37.000Z
|
django-server/fras/attendance/utils.py
|
etrigaen47/Facial-Recognition-Attendance-System
|
ad0bd18cf9582cc12002baf8c92f6638f632c46e
|
[
"MIT"
] | 13
|
2018-11-04T12:29:48.000Z
|
2020-02-11T23:47:35.000Z
|
django-server/fras/attendance/utils.py
|
etrigaen47/Facial-Recognition-Attendance-System
|
ad0bd18cf9582cc12002baf8c92f6638f632c46e
|
[
"MIT"
] | 16
|
2019-03-07T11:07:16.000Z
|
2021-08-13T07:19:28.000Z
|
def convert_str_to_date(string):
from datetime import datetime
datetime.strptime(string, "%Y-%m-%d %H:%M:%S.%f")
def create_database():
from attendance.models.Student import Student
from attendance.models.WorkingDay import WorkingDay
from attendance.models.LectureAttendance import LectureAttendance
from datetime import date, timedelta
create_students = True
create_working_days = True
create_lecture_attendances = True
if create_students:
student = Student(id=1, full_name='Rohan Sawant', face_id='9ee44c8c-920d-41cd-a1e0-95e9c53e649e')
student.save()
student = Student(id=2, full_name='Tanmay Sawant', face_id='85e9211d-6e2a-4a0e-9dba-917311393e2e')
student.save()
student = Student(id=3, full_name='Anirudh Iyer', face_id='2274d070-127c-4472-bc48-9df549417c19')
student.save()
if create_working_days:
for i in range(30):
working_day = WorkingDay(date=date.today() + timedelta(i))
working_day.save()
working_day = WorkingDay(date=date.today())
working_day.save()
if create_lecture_attendances:
for working_day in WorkingDay.objects.all():
LectureAttendance(working_day=working_day, lecture_name="Physics").save()
LectureAttendance(working_day=working_day, lecture_name="English").save()
LectureAttendance(working_day=working_day, lecture_name="Geography").save()
LectureAttendance(working_day=working_day, lecture_name="Civics").save()
LectureAttendance(working_day=working_day, lecture_name="Recess").save()
LectureAttendance(working_day=working_day, lecture_name="Recess").save()
LectureAttendance(working_day=working_day, lecture_name="History").save()
LectureAttendance(working_day=working_day, lecture_name="Mathematics").save()
LectureAttendance(working_day=working_day, lecture_name="Biology").save()
| 43.065217
| 106
| 0.704695
| 232
| 1,981
| 5.793103
| 0.327586
| 0.171131
| 0.180804
| 0.227679
| 0.443452
| 0.403274
| 0.354167
| 0.318452
| 0.125
| 0.125
| 0
| 0.043451
| 0.186774
| 1,981
| 45
| 107
| 44.022222
| 0.790813
| 0
| 0
| 0.2
| 0
| 0
| 0.116667
| 0.054545
| 0
| 0
| 0
| 0
| 0
| 1
| 0.057143
| false
| 0
| 0.142857
| 0
| 0.2
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
5f972ab5ab25213d75c3f56834078dbd2a9d9668
| 706
|
py
|
Python
|
python/src/day06.py
|
azuline/aoc2020
|
849b48adf3a67ac0eeb485818e38a4b3a72fc03a
|
[
"Apache-2.0"
] | 3
|
2020-12-09T11:36:31.000Z
|
2020-12-11T01:41:52.000Z
|
python/src/day06.py
|
azuline/aoc2020
|
849b48adf3a67ac0eeb485818e38a4b3a72fc03a
|
[
"Apache-2.0"
] | null | null | null |
python/src/day06.py
|
azuline/aoc2020
|
849b48adf3a67ac0eeb485818e38a4b3a72fc03a
|
[
"Apache-2.0"
] | null | null | null |
#!/usr/bin/env python
from itertools import chain
from pathlib import Path
from typing import List
INPUT_FILE = Path.cwd().parent / "inputs" / "day06.txt"
AnswerGroup = List[str]
def transform_input(input: str) -> List[AnswerGroup]:
return [x.split("\n") for x in input.strip().split("\n\n")]
def part1(groups: List[AnswerGroup]) -> int:
return sum(len(set(chain(*x))) for x in groups)
def part2(groups: List[AnswerGroup]) -> int:
return sum(len(set.intersection(*[set(y) for y in x])) for x in groups)
if __name__ == "__main__":
with INPUT_FILE.open("r") as f:
input = transform_input(f.read())
print(f"Part 1: {part1(input)}")
print(f"Part 2: {part2(input)}")
| 23.533333
| 75
| 0.660057
| 110
| 706
| 4.127273
| 0.472727
| 0.099119
| 0.039648
| 0.105727
| 0.229075
| 0.171806
| 0.171806
| 0.171806
| 0
| 0
| 0
| 0.013699
| 0.172805
| 706
| 29
| 76
| 24.344828
| 0.763699
| 0.028329
| 0
| 0
| 0
| 0
| 0.108029
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.1875
| false
| 0
| 0.1875
| 0.1875
| 0.5625
| 0.125
| 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
| 0
| 1
| 1
| 0
|
0
| 2
|
5f98d7e1817b744273f69d626fee4ccb8dd5c371
| 319
|
py
|
Python
|
pythonProject/MUNDO 2/Desafio 57.py
|
lucasjlgc/Aulas-de-Python-
|
6aaed1c660487a680e9c449210600ccdfa326612
|
[
"MIT"
] | null | null | null |
pythonProject/MUNDO 2/Desafio 57.py
|
lucasjlgc/Aulas-de-Python-
|
6aaed1c660487a680e9c449210600ccdfa326612
|
[
"MIT"
] | 1
|
2021-06-25T15:29:11.000Z
|
2021-06-25T15:29:11.000Z
|
pythonProject/MUNDO 2/Desafio 57.py
|
lucasjlgc/Aulas-de-Python-
|
6aaed1c660487a680e9c449210600ccdfa326612
|
[
"MIT"
] | null | null | null |
#Leia o sexo de uma pessoa, só aceite as letras M ou F; Caso contrario, peça a digitação novamente
sexo= str(input('Digite seu sexo [M/F]: ')).strip().upper()[0]
while sexo not in 'MF':
sexo=str(input('DIGITE O SEXO [M/F]: ')).strip().upper()[0]
print('seu sexo é {} e está registrado com sucesso!'.format(sexo))
| 39.875
| 98
| 0.670846
| 57
| 319
| 3.754386
| 0.666667
| 0.046729
| 0.11215
| 0.168224
| 0.158879
| 0.158879
| 0
| 0
| 0
| 0
| 0
| 0.007435
| 0.15674
| 319
| 8
| 99
| 39.875
| 0.788104
| 0.304075
| 0
| 0
| 0
| 0
| 0.405405
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.25
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
5f9e9628295536489ee271571858b5c113c24c7c
| 99,362
|
py
|
Python
|
Scripts/generated/protocolbuffers/Social_pb2.py
|
velocist/TS4CheatsInfo
|
b59ea7e5f4bd01d3b3bd7603843d525a9c179867
|
[
"Apache-2.0"
] | null | null | null |
Scripts/generated/protocolbuffers/Social_pb2.py
|
velocist/TS4CheatsInfo
|
b59ea7e5f4bd01d3b3bd7603843d525a9c179867
|
[
"Apache-2.0"
] | null | null | null |
Scripts/generated/protocolbuffers/Social_pb2.py
|
velocist/TS4CheatsInfo
|
b59ea7e5f4bd01d3b3bd7603843d525a9c179867
|
[
"Apache-2.0"
] | null | null | null |
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: D:\dev\TS4\_deploy\Client\Releasex64\Python\Generated\protocolbuffers\Social_pb2.py
# Compiled at: 2020-12-13 14:24:09
# Size of source mod 2**32: 103336 bytes
from google.protobuf import descriptor
from google.protobuf import message
from google.protobuf import reflection
from google.protobuf import descriptor_pb2
import protocolbuffers.Consts_pb2 as Consts_pb2
import protocolbuffers.Chat_pb2 as Chat_pb2
import protocolbuffers.S4Common_pb2 as S4Common_pb2
import protocolbuffers.Localization_pb2 as Localization_pb2
import protocolbuffers.Exchange_pb2 as Exchange_pb2
DESCRIPTOR = descriptor.FileDescriptor(name='Social.proto',
package='EA.Sims4.Network',
serialized_pb='\n\x0cSocial.proto\x12\x10EA.Sims4.Network\x1a\x0cConsts.proto\x1a\nChat.proto\x1a\x0eS4Common.proto\x1a\x12Localization.proto\x1a\x0eExchange.proto"v\n\x0fSocialFriendMsg\x12\r\n\x05simId\x18\x01 \x01(\x04\x12\x11\n\tnucleusid\x18\x02 \x01(\x04\x12\x0c\n\x04note\x18\x03 \x01(\t\x12\x0e\n\x06prefix\x18\x04 \x01(\t\x12\x0f\n\x07persona\x18\x05 \x01(\t\x12\x12\n\ncheatForce\x18\x06 \x01(\x08",\n\x18SocialPersonaResponseMsg\x12\x10\n\x08personas\x18\x01 \x03(\t"\x7f\n\x15SocialGenericResponse\x12\r\n\x05error\x18\x01 \x01(\r\x121\n\x08msg_type\x18\x02 \x01(\x0e2\x1f.EA.Sims4.Network.SocialOpTypes\x12\x0e\n\x06postId\x18\x03 \x01(\x0c\x12\x14\n\x0cpostParentId\x18\x04 \x01(\x0c"¼\x02\n\x14SocialPlayerInfoList\x12B\n\x07players\x18\x01 \x03(\x0b21.EA.Sims4.Network.SocialPlayerInfoList.PlayerInfo\x1aß\x01\n\nPlayerInfo\x12\x13\n\x0bAccountName\x18\x01 \x01(\t\x12\x14\n\x0cAccountNotes\x18\x02 \x01(\t\x128\n\x08presence\x18\x03 \x01(\x0e2&.EA.Sims4.Network.OnlinePresenceStatus\x12\x15\n\rOnlineStatus2\x18\x04 \x01(\t\x12\x11\n\tNucleusId\x18\t \x01(\x04\x12\x11\n\tPlayerBio\x18\n \x01(\t\x12\x18\n\x10exclude_reported\x18\x0b \x01(\x08\x12\x15\n\rIsUserBlocked\x18\x0c \x01(\x08"a\n\x0fSocialSearchMsg\x12\x0e\n\x06prefix\x18\x01 \x01(\t\x12>\n\x0esearch_results\x18\x02 \x03(\x0b2&.EA.Sims4.Network.LocalizedStringToken"=\n\x12OriginErrorMessage\x12\x11\n\terrorcode\x18\x01 \x01(\r\x12\x14\n\x0cerrormessage\x18\x02 \x01(\t"\x97\x01\n\x1bSocialInviteResponseMessage\x12\x14\n\x0cinvitationid\x18\x01 \x01(\t\x12\x16\n\x0einvitationtype\x18\x02 \x01(\r\x12\x18\n\x10inviternucleusid\x18\x03 \x01(\x04\x12\x19\n\x11accepternucleusid\x18\x04 \x01(\x04\x12\x15\n\ractionSuccess\x18\x05 \x01(\x08"J\n\x13SocialCassandraTest\x123\n\x06opcode\x18\x01 \x01(\x0e2#.EA.Sims4.Network.CassandraTestCode"\x88\x01\n\x1eSocialFriendListRequestMessage\x12\x12\n\naccount_id\x18\x01 \x01(\x04\x12\x11\n\tfriend_id\x18\x02 \x01(\x04\x12\x13\n\x0baddress_str\x18\x03 \x01(\t\x12\x12\n\nobject_str\x18\x04 \x01(\t\x12\x16\n\x0ereply_proxy_id\x18\x05 \x01(\x04"_\n!SocialRequestNucleusIdFromPersona\x12\x11\n\trequestid\x18\x01 \x01(\x04\x12\x13\n\x0bpersonaName\x18\x02 \x01(\t\x12\x12\n\nmessage_id\x18\x03 \x01(\r"^\n"SocialNucleusIdFromPersonaResponse\x12\x11\n\trequestid\x18\x01 \x01(\x04\x12\x11\n\tnucleusid\x18\x02 \x01(\x04\x12\x12\n\nmessage_id\x18\x03 \x01(\r"S\n\x15SocialExchangeMessage\x12:\n\x08envelope\x18\x01 \x01(\x0b2(.EA.Sims4.Network.ExchangeSocialEnvelope"+\n\x16SocialFollowersMessage\x12\x11\n\tsfim_blob\x18\x01 \x03(\x0c"Û\x02\n\x15SocialFeedItemMessage\x12\x0f\n\x07feed_id\x18\x01 \x01(\x0c\x127\n\tfeed_type\x18\x02 \x01(\x0e2$.EA.Sims4.Network.SocialFeedItemType\x120\n\x08metadata\x18\x03 \x01(\x0b2\x1e.EA.Sims4.Network.TrayMetadata\x12\x11\n\tnucleusid\x18\x04 \x01(\x04\x12\x0f\n\x07persona\x18\x05 \x01(\t\x12\x10\n\x08quantity\x18\x06 \x01(\x04\x12\x1a\n\x12follower_nucleusid\x18\x07 \x01(\x04\x12\x18\n\x10follower_persona\x18\x08 \x01(\t\x12@\n\x0efollowers_blob\x18\t \x01(\x0b2(.EA.Sims4.Network.SocialFollowersMessage\x12\x18\n\x10is_maxis_curated\x18\n \x01(\x08"Z\n!SocialFeedItemUnserializedMessage\x12\x0f\n\x07feed_id\x18\x01 \x01(\x0c\x12\x0c\n\x04data\x18\x02 \x01(\x0c\x12\x16\n\x0ecount_override\x18\x03 \x01(\x04"d\n\x18SocialWallCommentMessage\x12\x0c\n\x04uuid\x18\x01 \x01(\x0c\x12\x11\n\tauthor_id\x18\x02 \x01(\x04\x12\x16\n\x0eauthor_persona\x18\x03 \x01(\t\x12\x0f\n\x07message\x18\x04 \x01(\t"Ù\x01\n\x1cSocialGetWallCommentsMessage\x12\x11\n\tnucleusid\x18\x01 \x01(\x04\x12\x12\n\ngallery_id\x18\x02 \x01(\x0c\x12\x15\n\rstarting_uuid\x18\x03 \x01(\x0c\x12\x13\n\x0bnum_results\x18\x04 \x01(\r\x12<\n\x08messages\x18\x05 \x03(\x0b2*.EA.Sims4.Network.SocialWallCommentMessage\x12\x0e\n\x06hidden\x18\x06 \x01(\x08\x12\x18\n\x10exclude_reported\x18\x07 \x01(\x08"\x82\x01\n\x1cSocialPostWallCommentMessage\x12\x11\n\tnucleusid\x18\x01 \x01(\x04\x12\x12\n\ngallery_id\x18\x02 \x01(\x0c\x12;\n\x07message\x18\x03 \x01(\x0b2*.EA.Sims4.Network.SocialWallCommentMessage"U\n\x1eSocialDeleteWallCommentMessage\x12\x11\n\tnucleusid\x18\x01 \x01(\x04\x12\x12\n\ngallery_id\x18\x02 \x01(\x0c\x12\x0c\n\x04uuid\x18\x03 \x01(\x0c"Õ\x01\n\x1cSocialRequestFeedWallMessage\x12\x13\n\x0bending_uuid\x18\x01 \x01(\x0c\x129\n\x08messages\x18\x02 \x03(\x0b2\'.EA.Sims4.Network.SocialFeedItemMessage\x12R\n\x15unserialized_messages\x18\x03 \x03(\x0b23.EA.Sims4.Network.SocialFeedItemUnserializedMessage\x12\x11\n\tnum_items\x18\x04 \x01(\r"m\n\x1dSocialRequestFollowersMessage\x12\x10\n\x08playerid\x18\x01 \x01(\x04\x12\n\n\x02id\x18\x02 \x01(\t\x12\x19\n\x11prev_last_persona\x18\x03 \x01(\t\x12\x13\n\x0bnum_request\x18\x04 \x01(\r";\n\x1eSocialRequestIgnoreListMessage\x12\x19\n\x11player_nucleus_id\x18\x01 \x01(\x04"é\x01\n\x1eSocialGetPlayerInfoListMessage\x12\x19\n\x11player_nucleus_id\x18\x01 \x01(\x04\x12U\n\x10player_info_list\x18\x02 \x03(\x0b2;.EA.Sims4.Network.SocialGetPlayerInfoListMessage.PlayerInfo\x1aU\n\nPlayerInfo\x12\x12\n\nnucleus_id\x18\x01 \x01(\x04\x12\x16\n\x0eorigin_persona\x18\x02 \x01(\t\x12\x1b\n\x13first_party_persona\x18\x03 \x01(\t"X\n\x1cSocialCommentPetitionMessage\x12\x11\n\tnucleusid\x18\x01 \x01(\x04\x12\x11\n\tcommentid\x18\x02 \x01(\x0c\x12\x12\n\ncommentKey\x18\x03 \x01(\t"D\n\x18SocialBioPetitionMessage\x12\x11\n\tnucleusid\x18\x01 \x01(\x04\x12\x15\n\rbio_nucleusid\x18\x02 \x01(\x04"+\n\x18SocialFeedRemovalMessage\x12\x0f\n\x07feed_id\x18\x01 \x01(\x0c"\x8f\x12\n\x14SocialControlMessage\x12/\n\x06opcode\x18\x01 \x02(\x0e2\x1f.EA.Sims4.Network.SocialOpTypes\x12.\n\x05subop\x18\x02 \x01(\x0e2\x1f.EA.Sims4.Network.SocialOpTypes\x12\x15\n\rtransactionId\x18\x03 \x01(\x04\x12\x0e\n\x06result\x18d \x01(\r\x12J\n\x12getwallcommentsmsg\x18\x04 \x01(\x0b2..EA.Sims4.Network.SocialGetWallCommentsMessage\x12J\n\x12postwallcommentmsg\x18\x05 \x01(\x0b2..EA.Sims4.Network.SocialPostWallCommentMessage\x12N\n\x14deletewallcommentmsg\x18\x06 \x01(\x0b20.EA.Sims4.Network.SocialDeleteWallCommentMessage\x124\n\tfriendmsg\x18\x07 \x01(\x0b2!.EA.Sims4.Network.SocialFriendMsg\x12@\n\x0fgenericresponse\x18\x08 \x01(\x0b2\'.EA.Sims4.Network.SocialGenericResponse\x12:\n\nplayerinfo\x18\t \x01(\x0b2&.EA.Sims4.Network.SocialPlayerInfoList\x12:\n\nfeedsubmsg\x18\n \x01(\x0b2&.EA.Sims4.Network.SocialFeedSubMessage\x12:\n\x0fsearchresultmsg\x18\x0b \x01(\x0b2!.EA.Sims4.Network.SocialSearchMsg\x12H\n\x11inviteresponsemsg\x18\x0c \x01(\x0b2-.EA.Sims4.Network.SocialInviteResponseMessage\x129\n\x0boriginerror\x18\r \x01(\x0b2$.EA.Sims4.Network.OriginErrorMessage\x12B\n\x13socialcassandratest\x18\x0e \x01(\x0b2%.EA.Sims4.Network.SocialCassandraTest\x12T\n\x1asocialfriendlistrequestmsg\x18\x0f \x01(\x0b20.EA.Sims4.Network.SocialFriendListRequestMessage\x12^\n!socialrequestnucleusidfrompersona\x18\x10 \x01(\x0b23.EA.Sims4.Network.SocialRequestNucleusIdFromPersona\x12`\n"socialnucleusidfrompersonaresponse\x18\x11 \x01(\x0b24.EA.Sims4.Network.SocialNucleusIdFromPersonaResponse\x12F\n\x15socialexchangemessage\x18\x12 \x01(\x0b2\'.EA.Sims4.Network.SocialExchangeMessage\x12T\n\x1csocialrequestfeedwallmessage\x18\x13 \x01(\x0b2..EA.Sims4.Network.SocialRequestFeedWallMessage\x12A\n\x0cstat_tickers\x18\x15 \x01(\x0b2+.EA.Sims4.Network.ExchangeStatTickerMessage\x12L\n\x14comment_petition_msg\x18\x16 \x01(\x0b2..EA.Sims4.Network.SocialCommentPetitionMessage\x12B\n\x0efeedremovalmsg\x18\x17 \x01(\x0b2*.EA.Sims4.Network.SocialFeedRemovalMessage\x12D\n\x10bio_petition_msg\x18\x18 \x01(\x0b2*.EA.Sims4.Network.SocialBioPetitionMessage\x12B\n\x0cfb_event_msg\x18\x19 \x01(\x0b2,.EA.Sims4.Network.SocialFacebookEventMessage\x12M\n\x14requestfollowers_msg\x18\x1a \x01(\x0b2/.EA.Sims4.Network.SocialRequestFollowersMessage\x12O\n\x15responsefollowers_msg\x18\x1b \x01(\x0b20.EA.Sims4.Network.SocialResponseFollowersMessage\x12O\n\x15requestignorelist_msg\x18\x1c \x01(\x0b20.EA.Sims4.Network.SocialRequestIgnoreListMessage\x12W\n\x1dresponse_player_info_list_msg\x18\x1d \x01(\x0b20.EA.Sims4.Network.SocialGetPlayerInfoListMessage\x12_\n\x1eplayer_identification_list_msg\x18\x1e \x01(\x0b27.EA.Sims4.Network.ServerPlayerIdentificationListMessage\x12@\n\rcandidate_msg\x18\x1f \x01(\x0b2).EA.Sims4.Network.SocialCandidatesMessage\x12P\n\x16evaluation_results_msg\x18 \x01(\x0b20.EA.Sims4.Network.SocialEvaluationResultsMessage\x12>\n\rcg_update_msg\x18! \x01(\x0b2\'.EA.Sims4.Network.SocialCGUpdateMessage"7\n\x13SocialInvalidateMsg\x12\x13\n\x0bcache_index\x18\x01 \x01(\r\x12\x0b\n\x03key\x18\x02 \x01(\x0c"t\n"SocialControlQueueBroadcastMessage\x127\n\x07control\x18\x01 \x01(\x0b2&.EA.Sims4.Network.SocialControlMessage\x12\x15\n\tfriendIds\x18\x03 \x03(\x04B\x02\x10\x01"5\n\x10LifeEventMessage\x12\x0c\n\x04type\x18\x01 \x01(\r\x12\x13\n\x07sim_ids\x18\x02 \x03(\x06B\x02\x10\x01"Q\n\x1aSocialFacebookEventMessage\x12\x10\n\x08objectId\x18\x01 \x02(\t\x12\x13\n\x0baccessToken\x18\x02 \x02(\t\x12\x0c\n\x04guid\x18\x03 \x02(\t"¹\x01\n"SocialCandidateStatisticSubmessage\x12\x11\n\tremote_id\x18\x01 \x01(\x0c\x12\x13\n\x0bviews_count\x18\x02 \x01(\r\x12\x12\n\nwins_count\x18\x03 \x01(\r\x12\x10\n\x08platform\x18\x04 \x01(\r\x12\x10\n\x08category\x18\x05 \x01(\r\x12\x18\n\x0cwas_reported\x18\x06 \x01(\x08B\x02\x18\x01\x12\x19\n\x11expires_epoch_sec\x18\x07 \x01(\x04"ì\x01\n\x17SocialCandidatesMessage\x12\r\n\x05count\x18\x01 \x01(\r\x12\x1c\n\x14platform_restriction\x18\x02 \x01(\r\x12\x1c\n\x14category_restriction\x18\x03 \x01(\r\x12\x11\n\tchallenge\x18\x04 \x01(\t\x12\x0e\n\x06digest\x18\x05 \x01(\x0c\x12H\n\ncandidates\x18\x06 \x03(\x0b24.EA.Sims4.Network.SocialCandidateStatisticSubmessage\x12\x19\n\x11expire_epoch_secs\x18\x07 \x01(\x04"W\n\x1eSocialEvaluationResultsMessage\x12\x12\n\nwinner_ids\x18\x01 \x03(\t\x12\x11\n\tloser_ids\x18\x02 \x03(\t\x12\x0e\n\x06digest\x18\x03 \x01(\x0c"t\n\x15SocialCGDigestMessage\x12\x11\n\tchallenge\x18\x01 \x01(\t\x12H\n\ncandidates\x18\x02 \x03(\x0b24.EA.Sims4.Network.SocialCandidateStatisticSubmessage*¾\x01\n\x12SocialFeedItemType\x12\x17\n\x13SFI_ITEM_DOWNLOADED\x10\x00\x12\x15\n\x11SFI_ITEM_UPLOADED\x10\x01\x12\x16\n\x12SFI_ITEM_FAVORITED\x10\x02\x12\x16\n\x12SFI_ITEM_COMMENTED\x10\x03\x12\x16\n\x12SFI_ITEM_SHOWCASED\x10\x04\x12\x19\n\x15SFI_PROFILE_COMMENTED\x10\x05\x12\x15\n\x11SFI_NEW_FOLLOWERS\x10\x06*\x86\x02\n\x18SocialClusterMessageType\x12\r\n\tSOC_LOGIN\x10\x00\x12\x0e\n\nSOC_LOGOFF\x10\x01\x12\x16\n\x12SOC_PRESENCEUPDATE\x10\x02\x12\x12\n\x0eSOC_FEEDUPDATE\x10\x03\x12\x13\n\x0fSOC_ADD_FEEDSUB\x10\x04\x12\x16\n\x12SOC_REMOVE_FEEDSUB\x10\x05\x12\x18\n\x14SOC_BROADCAST_PRIVOP\x10\x06\x12\x18\n\x14SOC_BROADCAST_QUEUED\x10\x08\x12"\n\x1eSOC_BROADCAST_CACHE_INVALIDATE\x10\t\x12\x1a\n\x16SOC_REST_USER_REGISTER\x10\n')
_SOCIALFEEDITEMTYPE = descriptor.EnumDescriptor(name='SocialFeedItemType',
full_name='EA.Sims4.Network.SocialFeedItemType',
filename=None,
file=DESCRIPTOR,
values=[
descriptor.EnumValueDescriptor(name='SFI_ITEM_DOWNLOADED',
index=0,
number=0,
options=None,
type=None),
descriptor.EnumValueDescriptor(name='SFI_ITEM_UPLOADED',
index=1,
number=1,
options=None,
type=None),
descriptor.EnumValueDescriptor(name='SFI_ITEM_FAVORITED',
index=2,
number=2,
options=None,
type=None),
descriptor.EnumValueDescriptor(name='SFI_ITEM_COMMENTED',
index=3,
number=3,
options=None,
type=None),
descriptor.EnumValueDescriptor(name='SFI_ITEM_SHOWCASED',
index=4,
number=4,
options=None,
type=None),
descriptor.EnumValueDescriptor(name='SFI_PROFILE_COMMENTED',
index=5,
number=5,
options=None,
type=None),
descriptor.EnumValueDescriptor(name='SFI_NEW_FOLLOWERS',
index=6,
number=6,
options=None,
type=None)],
containing_type=None,
options=None,
serialized_start=6663,
serialized_end=6853)
_SOCIALCLUSTERMESSAGETYPE = descriptor.EnumDescriptor(name='SocialClusterMessageType',
full_name='EA.Sims4.Network.SocialClusterMessageType',
filename=None,
file=DESCRIPTOR,
values=[
descriptor.EnumValueDescriptor(name='SOC_LOGIN',
index=0,
number=0,
options=None,
type=None),
descriptor.EnumValueDescriptor(name='SOC_LOGOFF',
index=1,
number=1,
options=None,
type=None),
descriptor.EnumValueDescriptor(name='SOC_PRESENCEUPDATE',
index=2,
number=2,
options=None,
type=None),
descriptor.EnumValueDescriptor(name='SOC_FEEDUPDATE',
index=3,
number=3,
options=None,
type=None),
descriptor.EnumValueDescriptor(name='SOC_ADD_FEEDSUB',
index=4,
number=4,
options=None,
type=None),
descriptor.EnumValueDescriptor(name='SOC_REMOVE_FEEDSUB',
index=5,
number=5,
options=None,
type=None),
descriptor.EnumValueDescriptor(name='SOC_BROADCAST_PRIVOP',
index=6,
number=6,
options=None,
type=None),
descriptor.EnumValueDescriptor(name='SOC_BROADCAST_QUEUED',
index=7,
number=8,
options=None,
type=None),
descriptor.EnumValueDescriptor(name='SOC_BROADCAST_CACHE_INVALIDATE',
index=8,
number=9,
options=None,
type=None),
descriptor.EnumValueDescriptor(name='SOC_REST_USER_REGISTER',
index=9,
number=10,
options=None,
type=None)],
containing_type=None,
options=None,
serialized_start=6856,
serialized_end=7118)
SFI_ITEM_DOWNLOADED = 0
SFI_ITEM_UPLOADED = 1
SFI_ITEM_FAVORITED = 2
SFI_ITEM_COMMENTED = 3
SFI_ITEM_SHOWCASED = 4
SFI_PROFILE_COMMENTED = 5
SFI_NEW_FOLLOWERS = 6
SOC_LOGIN = 0
SOC_LOGOFF = 1
SOC_PRESENCEUPDATE = 2
SOC_FEEDUPDATE = 3
SOC_ADD_FEEDSUB = 4
SOC_REMOVE_FEEDSUB = 5
SOC_BROADCAST_PRIVOP = 6
SOC_BROADCAST_QUEUED = 8
SOC_BROADCAST_CACHE_INVALIDATE = 9
SOC_REST_USER_REGISTER = 10
_SOCIALFRIENDMSG = descriptor.Descriptor(name='SocialFriendMsg',
full_name='EA.Sims4.Network.SocialFriendMsg',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='simId',
full_name='EA.Sims4.Network.SocialFriendMsg.simId',
index=0,
number=1,
type=4,
cpp_type=4,
label=1,
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='nucleusid',
full_name='EA.Sims4.Network.SocialFriendMsg.nucleusid',
index=1,
number=2,
type=4,
cpp_type=4,
label=1,
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='note',
full_name='EA.Sims4.Network.SocialFriendMsg.note',
index=2,
number=3,
type=9,
cpp_type=9,
label=1,
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),
descriptor.FieldDescriptor(name='prefix',
full_name='EA.Sims4.Network.SocialFriendMsg.prefix',
index=3,
number=4,
type=9,
cpp_type=9,
label=1,
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),
descriptor.FieldDescriptor(name='persona',
full_name='EA.Sims4.Network.SocialFriendMsg.persona',
index=4,
number=5,
type=9,
cpp_type=9,
label=1,
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),
descriptor.FieldDescriptor(name='cheatForce',
full_name='EA.Sims4.Network.SocialFriendMsg.cheatForce',
index=5,
number=6,
type=8,
cpp_type=7,
label=1,
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,
extension_ranges=[],
serialized_start=112,
serialized_end=230)
_SOCIALPERSONARESPONSEMSG = descriptor.Descriptor(name='SocialPersonaResponseMsg',
full_name='EA.Sims4.Network.SocialPersonaResponseMsg',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='personas',
full_name='EA.Sims4.Network.SocialPersonaResponseMsg.personas',
index=0,
number=1,
type=9,
cpp_type=9,
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,
extension_ranges=[],
serialized_start=232,
serialized_end=276)
_SOCIALGENERICRESPONSE = descriptor.Descriptor(name='SocialGenericResponse',
full_name='EA.Sims4.Network.SocialGenericResponse',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='error',
full_name='EA.Sims4.Network.SocialGenericResponse.error',
index=0,
number=1,
type=13,
cpp_type=3,
label=1,
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='msg_type',
full_name='EA.Sims4.Network.SocialGenericResponse.msg_type',
index=1,
number=2,
type=14,
cpp_type=8,
label=1,
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='postId',
full_name='EA.Sims4.Network.SocialGenericResponse.postId',
index=2,
number=3,
type=12,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b'',
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
options=None),
descriptor.FieldDescriptor(name='postParentId',
full_name='EA.Sims4.Network.SocialGenericResponse.postParentId',
index=3,
number=4,
type=12,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b'',
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,
extension_ranges=[],
serialized_start=278,
serialized_end=405)
_SOCIALPLAYERINFOLIST_PLAYERINFO = descriptor.Descriptor(name='PlayerInfo',
full_name='EA.Sims4.Network.SocialPlayerInfoList.PlayerInfo',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='AccountName',
full_name='EA.Sims4.Network.SocialPlayerInfoList.PlayerInfo.AccountName',
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
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),
descriptor.FieldDescriptor(name='AccountNotes',
full_name='EA.Sims4.Network.SocialPlayerInfoList.PlayerInfo.AccountNotes',
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
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),
descriptor.FieldDescriptor(name='presence',
full_name='EA.Sims4.Network.SocialPlayerInfoList.PlayerInfo.presence',
index=2,
number=3,
type=14,
cpp_type=8,
label=1,
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='OnlineStatus2',
full_name='EA.Sims4.Network.SocialPlayerInfoList.PlayerInfo.OnlineStatus2',
index=3,
number=4,
type=9,
cpp_type=9,
label=1,
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),
descriptor.FieldDescriptor(name='NucleusId',
full_name='EA.Sims4.Network.SocialPlayerInfoList.PlayerInfo.NucleusId',
index=4,
number=9,
type=4,
cpp_type=4,
label=1,
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='PlayerBio',
full_name='EA.Sims4.Network.SocialPlayerInfoList.PlayerInfo.PlayerBio',
index=5,
number=10,
type=9,
cpp_type=9,
label=1,
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),
descriptor.FieldDescriptor(name='exclude_reported',
full_name='EA.Sims4.Network.SocialPlayerInfoList.PlayerInfo.exclude_reported',
index=6,
number=11,
type=8,
cpp_type=7,
label=1,
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='IsUserBlocked',
full_name='EA.Sims4.Network.SocialPlayerInfoList.PlayerInfo.IsUserBlocked',
index=7,
number=12,
type=8,
cpp_type=7,
label=1,
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,
extension_ranges=[],
serialized_start=501,
serialized_end=724)
_SOCIALPLAYERINFOLIST = descriptor.Descriptor(name='SocialPlayerInfoList',
full_name='EA.Sims4.Network.SocialPlayerInfoList',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='players',
full_name='EA.Sims4.Network.SocialPlayerInfoList.players',
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=[
_SOCIALPLAYERINFOLIST_PLAYERINFO],
enum_types=[],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=408,
serialized_end=724)
_SOCIALSEARCHMSG = descriptor.Descriptor(name='SocialSearchMsg',
full_name='EA.Sims4.Network.SocialSearchMsg',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='prefix',
full_name='EA.Sims4.Network.SocialSearchMsg.prefix',
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
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),
descriptor.FieldDescriptor(name='search_results',
full_name='EA.Sims4.Network.SocialSearchMsg.search_results',
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,
extension_ranges=[],
serialized_start=726,
serialized_end=823)
_ORIGINERRORMESSAGE = descriptor.Descriptor(name='OriginErrorMessage',
full_name='EA.Sims4.Network.OriginErrorMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='errorcode',
full_name='EA.Sims4.Network.OriginErrorMessage.errorcode',
index=0,
number=1,
type=13,
cpp_type=3,
label=1,
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='errormessage',
full_name='EA.Sims4.Network.OriginErrorMessage.errormessage',
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
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,
extension_ranges=[],
serialized_start=825,
serialized_end=886)
_SOCIALINVITERESPONSEMESSAGE = descriptor.Descriptor(name='SocialInviteResponseMessage',
full_name='EA.Sims4.Network.SocialInviteResponseMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='invitationid',
full_name='EA.Sims4.Network.SocialInviteResponseMessage.invitationid',
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
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),
descriptor.FieldDescriptor(name='invitationtype',
full_name='EA.Sims4.Network.SocialInviteResponseMessage.invitationtype',
index=1,
number=2,
type=13,
cpp_type=3,
label=1,
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='inviternucleusid',
full_name='EA.Sims4.Network.SocialInviteResponseMessage.inviternucleusid',
index=2,
number=3,
type=4,
cpp_type=4,
label=1,
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='accepternucleusid',
full_name='EA.Sims4.Network.SocialInviteResponseMessage.accepternucleusid',
index=3,
number=4,
type=4,
cpp_type=4,
label=1,
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='actionSuccess',
full_name='EA.Sims4.Network.SocialInviteResponseMessage.actionSuccess',
index=4,
number=5,
type=8,
cpp_type=7,
label=1,
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,
extension_ranges=[],
serialized_start=889,
serialized_end=1040)
_SOCIALCASSANDRATEST = descriptor.Descriptor(name='SocialCassandraTest',
full_name='EA.Sims4.Network.SocialCassandraTest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='opcode',
full_name='EA.Sims4.Network.SocialCassandraTest.opcode',
index=0,
number=1,
type=14,
cpp_type=8,
label=1,
has_default_value=False,
default_value=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,
extension_ranges=[],
serialized_start=1042,
serialized_end=1116)
_SOCIALFRIENDLISTREQUESTMESSAGE = descriptor.Descriptor(name='SocialFriendListRequestMessage',
full_name='EA.Sims4.Network.SocialFriendListRequestMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='account_id',
full_name='EA.Sims4.Network.SocialFriendListRequestMessage.account_id',
index=0,
number=1,
type=4,
cpp_type=4,
label=1,
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='friend_id',
full_name='EA.Sims4.Network.SocialFriendListRequestMessage.friend_id',
index=1,
number=2,
type=4,
cpp_type=4,
label=1,
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='address_str',
full_name='EA.Sims4.Network.SocialFriendListRequestMessage.address_str',
index=2,
number=3,
type=9,
cpp_type=9,
label=1,
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),
descriptor.FieldDescriptor(name='object_str',
full_name='EA.Sims4.Network.SocialFriendListRequestMessage.object_str',
index=3,
number=4,
type=9,
cpp_type=9,
label=1,
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),
descriptor.FieldDescriptor(name='reply_proxy_id',
full_name='EA.Sims4.Network.SocialFriendListRequestMessage.reply_proxy_id',
index=4,
number=5,
type=4,
cpp_type=4,
label=1,
has_default_value=False,
default_value=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,
extension_ranges=[],
serialized_start=1119,
serialized_end=1255)
_SOCIALREQUESTNUCLEUSIDFROMPERSONA = descriptor.Descriptor(name='SocialRequestNucleusIdFromPersona',
full_name='EA.Sims4.Network.SocialRequestNucleusIdFromPersona',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='requestid',
full_name='EA.Sims4.Network.SocialRequestNucleusIdFromPersona.requestid',
index=0,
number=1,
type=4,
cpp_type=4,
label=1,
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='personaName',
full_name='EA.Sims4.Network.SocialRequestNucleusIdFromPersona.personaName',
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
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),
descriptor.FieldDescriptor(name='message_id',
full_name='EA.Sims4.Network.SocialRequestNucleusIdFromPersona.message_id',
index=2,
number=3,
type=13,
cpp_type=3,
label=1,
has_default_value=False,
default_value=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,
extension_ranges=[],
serialized_start=1257,
serialized_end=1352)
_SOCIALNUCLEUSIDFROMPERSONARESPONSE = descriptor.Descriptor(name='SocialNucleusIdFromPersonaResponse',
full_name='EA.Sims4.Network.SocialNucleusIdFromPersonaResponse',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='requestid',
full_name='EA.Sims4.Network.SocialNucleusIdFromPersonaResponse.requestid',
index=0,
number=1,
type=4,
cpp_type=4,
label=1,
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='nucleusid',
full_name='EA.Sims4.Network.SocialNucleusIdFromPersonaResponse.nucleusid',
index=1,
number=2,
type=4,
cpp_type=4,
label=1,
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='message_id',
full_name='EA.Sims4.Network.SocialNucleusIdFromPersonaResponse.message_id',
index=2,
number=3,
type=13,
cpp_type=3,
label=1,
has_default_value=False,
default_value=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,
extension_ranges=[],
serialized_start=1354,
serialized_end=1448)
_SOCIALEXCHANGEMESSAGE = descriptor.Descriptor(name='SocialExchangeMessage',
full_name='EA.Sims4.Network.SocialExchangeMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='envelope',
full_name='EA.Sims4.Network.SocialExchangeMessage.envelope',
index=0,
number=1,
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=[],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=1450,
serialized_end=1533)
_SOCIALFOLLOWERSMESSAGE = descriptor.Descriptor(name='SocialFollowersMessage',
full_name='EA.Sims4.Network.SocialFollowersMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='sfim_blob',
full_name='EA.Sims4.Network.SocialFollowersMessage.sfim_blob',
index=0,
number=1,
type=12,
cpp_type=9,
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,
extension_ranges=[],
serialized_start=1535,
serialized_end=1578)
_SOCIALFEEDITEMMESSAGE = descriptor.Descriptor(name='SocialFeedItemMessage',
full_name='EA.Sims4.Network.SocialFeedItemMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='feed_id',
full_name='EA.Sims4.Network.SocialFeedItemMessage.feed_id',
index=0,
number=1,
type=12,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b'',
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
options=None),
descriptor.FieldDescriptor(name='feed_type',
full_name='EA.Sims4.Network.SocialFeedItemMessage.feed_type',
index=1,
number=2,
type=14,
cpp_type=8,
label=1,
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='metadata',
full_name='EA.Sims4.Network.SocialFeedItemMessage.metadata',
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='nucleusid',
full_name='EA.Sims4.Network.SocialFeedItemMessage.nucleusid',
index=3,
number=4,
type=4,
cpp_type=4,
label=1,
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='persona',
full_name='EA.Sims4.Network.SocialFeedItemMessage.persona',
index=4,
number=5,
type=9,
cpp_type=9,
label=1,
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),
descriptor.FieldDescriptor(name='quantity',
full_name='EA.Sims4.Network.SocialFeedItemMessage.quantity',
index=5,
number=6,
type=4,
cpp_type=4,
label=1,
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='follower_nucleusid',
full_name='EA.Sims4.Network.SocialFeedItemMessage.follower_nucleusid',
index=6,
number=7,
type=4,
cpp_type=4,
label=1,
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='follower_persona',
full_name='EA.Sims4.Network.SocialFeedItemMessage.follower_persona',
index=7,
number=8,
type=9,
cpp_type=9,
label=1,
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),
descriptor.FieldDescriptor(name='followers_blob',
full_name='EA.Sims4.Network.SocialFeedItemMessage.followers_blob',
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),
descriptor.FieldDescriptor(name='is_maxis_curated',
full_name='EA.Sims4.Network.SocialFeedItemMessage.is_maxis_curated',
index=9,
number=10,
type=8,
cpp_type=7,
label=1,
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,
extension_ranges=[],
serialized_start=1581,
serialized_end=1928)
_SOCIALFEEDITEMUNSERIALIZEDMESSAGE = descriptor.Descriptor(name='SocialFeedItemUnserializedMessage',
full_name='EA.Sims4.Network.SocialFeedItemUnserializedMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='feed_id',
full_name='EA.Sims4.Network.SocialFeedItemUnserializedMessage.feed_id',
index=0,
number=1,
type=12,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b'',
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
options=None),
descriptor.FieldDescriptor(name='data',
full_name='EA.Sims4.Network.SocialFeedItemUnserializedMessage.data',
index=1,
number=2,
type=12,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b'',
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
options=None),
descriptor.FieldDescriptor(name='count_override',
full_name='EA.Sims4.Network.SocialFeedItemUnserializedMessage.count_override',
index=2,
number=3,
type=4,
cpp_type=4,
label=1,
has_default_value=False,
default_value=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,
extension_ranges=[],
serialized_start=1930,
serialized_end=2020)
_SOCIALWALLCOMMENTMESSAGE = descriptor.Descriptor(name='SocialWallCommentMessage',
full_name='EA.Sims4.Network.SocialWallCommentMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='uuid',
full_name='EA.Sims4.Network.SocialWallCommentMessage.uuid',
index=0,
number=1,
type=12,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b'',
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
options=None),
descriptor.FieldDescriptor(name='author_id',
full_name='EA.Sims4.Network.SocialWallCommentMessage.author_id',
index=1,
number=2,
type=4,
cpp_type=4,
label=1,
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='author_persona',
full_name='EA.Sims4.Network.SocialWallCommentMessage.author_persona',
index=2,
number=3,
type=9,
cpp_type=9,
label=1,
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),
descriptor.FieldDescriptor(name='message',
full_name='EA.Sims4.Network.SocialWallCommentMessage.message',
index=3,
number=4,
type=9,
cpp_type=9,
label=1,
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,
extension_ranges=[],
serialized_start=2022,
serialized_end=2122)
_SOCIALGETWALLCOMMENTSMESSAGE = descriptor.Descriptor(name='SocialGetWallCommentsMessage',
full_name='EA.Sims4.Network.SocialGetWallCommentsMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='nucleusid',
full_name='EA.Sims4.Network.SocialGetWallCommentsMessage.nucleusid',
index=0,
number=1,
type=4,
cpp_type=4,
label=1,
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='gallery_id',
full_name='EA.Sims4.Network.SocialGetWallCommentsMessage.gallery_id',
index=1,
number=2,
type=12,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b'',
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
options=None),
descriptor.FieldDescriptor(name='starting_uuid',
full_name='EA.Sims4.Network.SocialGetWallCommentsMessage.starting_uuid',
index=2,
number=3,
type=12,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b'',
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
options=None),
descriptor.FieldDescriptor(name='num_results',
full_name='EA.Sims4.Network.SocialGetWallCommentsMessage.num_results',
index=3,
number=4,
type=13,
cpp_type=3,
label=1,
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='messages',
full_name='EA.Sims4.Network.SocialGetWallCommentsMessage.messages',
index=4,
number=5,
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='hidden',
full_name='EA.Sims4.Network.SocialGetWallCommentsMessage.hidden',
index=5,
number=6,
type=8,
cpp_type=7,
label=1,
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='exclude_reported',
full_name='EA.Sims4.Network.SocialGetWallCommentsMessage.exclude_reported',
index=6,
number=7,
type=8,
cpp_type=7,
label=1,
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,
extension_ranges=[],
serialized_start=2125,
serialized_end=2342)
_SOCIALPOSTWALLCOMMENTMESSAGE = descriptor.Descriptor(name='SocialPostWallCommentMessage',
full_name='EA.Sims4.Network.SocialPostWallCommentMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='nucleusid',
full_name='EA.Sims4.Network.SocialPostWallCommentMessage.nucleusid',
index=0,
number=1,
type=4,
cpp_type=4,
label=1,
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='gallery_id',
full_name='EA.Sims4.Network.SocialPostWallCommentMessage.gallery_id',
index=1,
number=2,
type=12,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b'',
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
options=None),
descriptor.FieldDescriptor(name='message',
full_name='EA.Sims4.Network.SocialPostWallCommentMessage.message',
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)],
extensions=[],
nested_types=[],
enum_types=[],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=2345,
serialized_end=2475)
_SOCIALDELETEWALLCOMMENTMESSAGE = descriptor.Descriptor(name='SocialDeleteWallCommentMessage',
full_name='EA.Sims4.Network.SocialDeleteWallCommentMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='nucleusid',
full_name='EA.Sims4.Network.SocialDeleteWallCommentMessage.nucleusid',
index=0,
number=1,
type=4,
cpp_type=4,
label=1,
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='gallery_id',
full_name='EA.Sims4.Network.SocialDeleteWallCommentMessage.gallery_id',
index=1,
number=2,
type=12,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b'',
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
options=None),
descriptor.FieldDescriptor(name='uuid',
full_name='EA.Sims4.Network.SocialDeleteWallCommentMessage.uuid',
index=2,
number=3,
type=12,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b'',
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,
extension_ranges=[],
serialized_start=2477,
serialized_end=2562)
_SOCIALREQUESTFEEDWALLMESSAGE = descriptor.Descriptor(name='SocialRequestFeedWallMessage',
full_name='EA.Sims4.Network.SocialRequestFeedWallMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='ending_uuid',
full_name='EA.Sims4.Network.SocialRequestFeedWallMessage.ending_uuid',
index=0,
number=1,
type=12,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b'',
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
options=None),
descriptor.FieldDescriptor(name='messages',
full_name='EA.Sims4.Network.SocialRequestFeedWallMessage.messages',
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),
descriptor.FieldDescriptor(name='unserialized_messages',
full_name='EA.Sims4.Network.SocialRequestFeedWallMessage.unserialized_messages',
index=2,
number=3,
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='num_items',
full_name='EA.Sims4.Network.SocialRequestFeedWallMessage.num_items',
index=3,
number=4,
type=13,
cpp_type=3,
label=1,
has_default_value=False,
default_value=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,
extension_ranges=[],
serialized_start=2565,
serialized_end=2778)
_SOCIALREQUESTFOLLOWERSMESSAGE = descriptor.Descriptor(name='SocialRequestFollowersMessage',
full_name='EA.Sims4.Network.SocialRequestFollowersMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='playerid',
full_name='EA.Sims4.Network.SocialRequestFollowersMessage.playerid',
index=0,
number=1,
type=4,
cpp_type=4,
label=1,
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='id',
full_name='EA.Sims4.Network.SocialRequestFollowersMessage.id',
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
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),
descriptor.FieldDescriptor(name='prev_last_persona',
full_name='EA.Sims4.Network.SocialRequestFollowersMessage.prev_last_persona',
index=2,
number=3,
type=9,
cpp_type=9,
label=1,
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),
descriptor.FieldDescriptor(name='num_request',
full_name='EA.Sims4.Network.SocialRequestFollowersMessage.num_request',
index=3,
number=4,
type=13,
cpp_type=3,
label=1,
has_default_value=False,
default_value=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,
extension_ranges=[],
serialized_start=2780,
serialized_end=2889)
_SOCIALREQUESTIGNORELISTMESSAGE = descriptor.Descriptor(name='SocialRequestIgnoreListMessage',
full_name='EA.Sims4.Network.SocialRequestIgnoreListMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='player_nucleus_id',
full_name='EA.Sims4.Network.SocialRequestIgnoreListMessage.player_nucleus_id',
index=0,
number=1,
type=4,
cpp_type=4,
label=1,
has_default_value=False,
default_value=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,
extension_ranges=[],
serialized_start=2891,
serialized_end=2950)
_SOCIALGETPLAYERINFOLISTMESSAGE_PLAYERINFO = descriptor.Descriptor(name='PlayerInfo',
full_name='EA.Sims4.Network.SocialGetPlayerInfoListMessage.PlayerInfo',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='nucleus_id',
full_name='EA.Sims4.Network.SocialGetPlayerInfoListMessage.PlayerInfo.nucleus_id',
index=0,
number=1,
type=4,
cpp_type=4,
label=1,
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='origin_persona',
full_name='EA.Sims4.Network.SocialGetPlayerInfoListMessage.PlayerInfo.origin_persona',
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
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),
descriptor.FieldDescriptor(name='first_party_persona',
full_name='EA.Sims4.Network.SocialGetPlayerInfoListMessage.PlayerInfo.first_party_persona',
index=2,
number=3,
type=9,
cpp_type=9,
label=1,
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,
extension_ranges=[],
serialized_start=3101,
serialized_end=3186)
_SOCIALGETPLAYERINFOLISTMESSAGE = descriptor.Descriptor(name='SocialGetPlayerInfoListMessage',
full_name='EA.Sims4.Network.SocialGetPlayerInfoListMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='player_nucleus_id',
full_name='EA.Sims4.Network.SocialGetPlayerInfoListMessage.player_nucleus_id',
index=0,
number=1,
type=4,
cpp_type=4,
label=1,
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='player_info_list',
full_name='EA.Sims4.Network.SocialGetPlayerInfoListMessage.player_info_list',
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=[
_SOCIALGETPLAYERINFOLISTMESSAGE_PLAYERINFO],
enum_types=[],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=2953,
serialized_end=3186)
_SOCIALCOMMENTPETITIONMESSAGE = descriptor.Descriptor(name='SocialCommentPetitionMessage',
full_name='EA.Sims4.Network.SocialCommentPetitionMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='nucleusid',
full_name='EA.Sims4.Network.SocialCommentPetitionMessage.nucleusid',
index=0,
number=1,
type=4,
cpp_type=4,
label=1,
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='commentid',
full_name='EA.Sims4.Network.SocialCommentPetitionMessage.commentid',
index=1,
number=2,
type=12,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b'',
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
options=None),
descriptor.FieldDescriptor(name='commentKey',
full_name='EA.Sims4.Network.SocialCommentPetitionMessage.commentKey',
index=2,
number=3,
type=9,
cpp_type=9,
label=1,
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,
extension_ranges=[],
serialized_start=3188,
serialized_end=3276)
_SOCIALBIOPETITIONMESSAGE = descriptor.Descriptor(name='SocialBioPetitionMessage',
full_name='EA.Sims4.Network.SocialBioPetitionMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='nucleusid',
full_name='EA.Sims4.Network.SocialBioPetitionMessage.nucleusid',
index=0,
number=1,
type=4,
cpp_type=4,
label=1,
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='bio_nucleusid',
full_name='EA.Sims4.Network.SocialBioPetitionMessage.bio_nucleusid',
index=1,
number=2,
type=4,
cpp_type=4,
label=1,
has_default_value=False,
default_value=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,
extension_ranges=[],
serialized_start=3278,
serialized_end=3346)
_SOCIALFEEDREMOVALMESSAGE = descriptor.Descriptor(name='SocialFeedRemovalMessage',
full_name='EA.Sims4.Network.SocialFeedRemovalMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='feed_id',
full_name='EA.Sims4.Network.SocialFeedRemovalMessage.feed_id',
index=0,
number=1,
type=12,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b'',
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,
extension_ranges=[],
serialized_start=3348,
serialized_end=3391)
_SOCIALCONTROLMESSAGE = descriptor.Descriptor(name='SocialControlMessage',
full_name='EA.Sims4.Network.SocialControlMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='opcode',
full_name='EA.Sims4.Network.SocialControlMessage.opcode',
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='subop',
full_name='EA.Sims4.Network.SocialControlMessage.subop',
index=1,
number=2,
type=14,
cpp_type=8,
label=1,
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='transactionId',
full_name='EA.Sims4.Network.SocialControlMessage.transactionId',
index=2,
number=3,
type=4,
cpp_type=4,
label=1,
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='result',
full_name='EA.Sims4.Network.SocialControlMessage.result',
index=3,
number=100,
type=13,
cpp_type=3,
label=1,
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='getwallcommentsmsg',
full_name='EA.Sims4.Network.SocialControlMessage.getwallcommentsmsg',
index=4,
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='postwallcommentmsg',
full_name='EA.Sims4.Network.SocialControlMessage.postwallcommentmsg',
index=5,
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='deletewallcommentmsg',
full_name='EA.Sims4.Network.SocialControlMessage.deletewallcommentmsg',
index=6,
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='friendmsg',
full_name='EA.Sims4.Network.SocialControlMessage.friendmsg',
index=7,
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='genericresponse',
full_name='EA.Sims4.Network.SocialControlMessage.genericresponse',
index=8,
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='playerinfo',
full_name='EA.Sims4.Network.SocialControlMessage.playerinfo',
index=9,
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),
descriptor.FieldDescriptor(name='feedsubmsg',
full_name='EA.Sims4.Network.SocialControlMessage.feedsubmsg',
index=10,
number=10,
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='searchresultmsg',
full_name='EA.Sims4.Network.SocialControlMessage.searchresultmsg',
index=11,
number=11,
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='inviteresponsemsg',
full_name='EA.Sims4.Network.SocialControlMessage.inviteresponsemsg',
index=12,
number=12,
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='originerror',
full_name='EA.Sims4.Network.SocialControlMessage.originerror',
index=13,
number=13,
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='socialcassandratest',
full_name='EA.Sims4.Network.SocialControlMessage.socialcassandratest',
index=14,
number=14,
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='socialfriendlistrequestmsg',
full_name='EA.Sims4.Network.SocialControlMessage.socialfriendlistrequestmsg',
index=15,
number=15,
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='socialrequestnucleusidfrompersona',
full_name='EA.Sims4.Network.SocialControlMessage.socialrequestnucleusidfrompersona',
index=16,
number=16,
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='socialnucleusidfrompersonaresponse',
full_name='EA.Sims4.Network.SocialControlMessage.socialnucleusidfrompersonaresponse',
index=17,
number=17,
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='socialexchangemessage',
full_name='EA.Sims4.Network.SocialControlMessage.socialexchangemessage',
index=18,
number=18,
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='socialrequestfeedwallmessage',
full_name='EA.Sims4.Network.SocialControlMessage.socialrequestfeedwallmessage',
index=19,
number=19,
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='stat_tickers',
full_name='EA.Sims4.Network.SocialControlMessage.stat_tickers',
index=20,
number=21,
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='comment_petition_msg',
full_name='EA.Sims4.Network.SocialControlMessage.comment_petition_msg',
index=21,
number=22,
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='feedremovalmsg',
full_name='EA.Sims4.Network.SocialControlMessage.feedremovalmsg',
index=22,
number=23,
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='bio_petition_msg',
full_name='EA.Sims4.Network.SocialControlMessage.bio_petition_msg',
index=23,
number=24,
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='fb_event_msg',
full_name='EA.Sims4.Network.SocialControlMessage.fb_event_msg',
index=24,
number=25,
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='requestfollowers_msg',
full_name='EA.Sims4.Network.SocialControlMessage.requestfollowers_msg',
index=25,
number=26,
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='responsefollowers_msg',
full_name='EA.Sims4.Network.SocialControlMessage.responsefollowers_msg',
index=26,
number=27,
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='requestignorelist_msg',
full_name='EA.Sims4.Network.SocialControlMessage.requestignorelist_msg',
index=27,
number=28,
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='response_player_info_list_msg',
full_name='EA.Sims4.Network.SocialControlMessage.response_player_info_list_msg',
index=28,
number=29,
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='player_identification_list_msg',
full_name='EA.Sims4.Network.SocialControlMessage.player_identification_list_msg',
index=29,
number=30,
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='candidate_msg',
full_name='EA.Sims4.Network.SocialControlMessage.candidate_msg',
index=30,
number=31,
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='evaluation_results_msg',
full_name='EA.Sims4.Network.SocialControlMessage.evaluation_results_msg',
index=31,
number=32,
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='cg_update_msg',
full_name='EA.Sims4.Network.SocialControlMessage.cg_update_msg',
index=32,
number=33,
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=[],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=3394,
serialized_end=5713)
_SOCIALINVALIDATEMSG = descriptor.Descriptor(name='SocialInvalidateMsg',
full_name='EA.Sims4.Network.SocialInvalidateMsg',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='cache_index',
full_name='EA.Sims4.Network.SocialInvalidateMsg.cache_index',
index=0,
number=1,
type=13,
cpp_type=3,
label=1,
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='key',
full_name='EA.Sims4.Network.SocialInvalidateMsg.key',
index=1,
number=2,
type=12,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b'',
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,
extension_ranges=[],
serialized_start=5715,
serialized_end=5770)
_SOCIALCONTROLQUEUEBROADCASTMESSAGE = descriptor.Descriptor(name='SocialControlQueueBroadcastMessage',
full_name='EA.Sims4.Network.SocialControlQueueBroadcastMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='control',
full_name='EA.Sims4.Network.SocialControlQueueBroadcastMessage.control',
index=0,
number=1,
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='friendIds',
full_name='EA.Sims4.Network.SocialControlQueueBroadcastMessage.friendIds',
index=1,
number=3,
type=4,
cpp_type=4,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
options=(descriptor._ParseOptions(descriptor_pb2.FieldOptions(), '\x10\x01')))],
extensions=[],
nested_types=[],
enum_types=[],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=5772,
serialized_end=5888)
_LIFEEVENTMESSAGE = descriptor.Descriptor(name='LifeEventMessage',
full_name='EA.Sims4.Network.LifeEventMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='type',
full_name='EA.Sims4.Network.LifeEventMessage.type',
index=0,
number=1,
type=13,
cpp_type=3,
label=1,
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='sim_ids',
full_name='EA.Sims4.Network.LifeEventMessage.sim_ids',
index=1,
number=2,
type=6,
cpp_type=4,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
options=(descriptor._ParseOptions(descriptor_pb2.FieldOptions(), '\x10\x01')))],
extensions=[],
nested_types=[],
enum_types=[],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=5890,
serialized_end=5943)
_SOCIALFACEBOOKEVENTMESSAGE = descriptor.Descriptor(name='SocialFacebookEventMessage',
full_name='EA.Sims4.Network.SocialFacebookEventMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='objectId',
full_name='EA.Sims4.Network.SocialFacebookEventMessage.objectId',
index=0,
number=1,
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),
descriptor.FieldDescriptor(name='accessToken',
full_name='EA.Sims4.Network.SocialFacebookEventMessage.accessToken',
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),
descriptor.FieldDescriptor(name='guid',
full_name='EA.Sims4.Network.SocialFacebookEventMessage.guid',
index=2,
number=3,
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,
extension_ranges=[],
serialized_start=5945,
serialized_end=6026)
_SOCIALCANDIDATESTATISTICSUBMESSAGE = descriptor.Descriptor(name='SocialCandidateStatisticSubmessage',
full_name='EA.Sims4.Network.SocialCandidateStatisticSubmessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='remote_id',
full_name='EA.Sims4.Network.SocialCandidateStatisticSubmessage.remote_id',
index=0,
number=1,
type=12,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b'',
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
options=None),
descriptor.FieldDescriptor(name='views_count',
full_name='EA.Sims4.Network.SocialCandidateStatisticSubmessage.views_count',
index=1,
number=2,
type=13,
cpp_type=3,
label=1,
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='wins_count',
full_name='EA.Sims4.Network.SocialCandidateStatisticSubmessage.wins_count',
index=2,
number=3,
type=13,
cpp_type=3,
label=1,
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='platform',
full_name='EA.Sims4.Network.SocialCandidateStatisticSubmessage.platform',
index=3,
number=4,
type=13,
cpp_type=3,
label=1,
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='category',
full_name='EA.Sims4.Network.SocialCandidateStatisticSubmessage.category',
index=4,
number=5,
type=13,
cpp_type=3,
label=1,
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='was_reported',
full_name='EA.Sims4.Network.SocialCandidateStatisticSubmessage.was_reported',
index=5,
number=6,
type=8,
cpp_type=7,
label=1,
has_default_value=False,
default_value=False,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
options=(descriptor._ParseOptions(descriptor_pb2.FieldOptions(), '\x18\x01'))),
descriptor.FieldDescriptor(name='expires_epoch_sec',
full_name='EA.Sims4.Network.SocialCandidateStatisticSubmessage.expires_epoch_sec',
index=6,
number=7,
type=4,
cpp_type=4,
label=1,
has_default_value=False,
default_value=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,
extension_ranges=[],
serialized_start=6029,
serialized_end=6214)
_SOCIALCANDIDATESMESSAGE = descriptor.Descriptor(name='SocialCandidatesMessage',
full_name='EA.Sims4.Network.SocialCandidatesMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='count',
full_name='EA.Sims4.Network.SocialCandidatesMessage.count',
index=0,
number=1,
type=13,
cpp_type=3,
label=1,
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='platform_restriction',
full_name='EA.Sims4.Network.SocialCandidatesMessage.platform_restriction',
index=1,
number=2,
type=13,
cpp_type=3,
label=1,
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='category_restriction',
full_name='EA.Sims4.Network.SocialCandidatesMessage.category_restriction',
index=2,
number=3,
type=13,
cpp_type=3,
label=1,
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='challenge',
full_name='EA.Sims4.Network.SocialCandidatesMessage.challenge',
index=3,
number=4,
type=9,
cpp_type=9,
label=1,
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),
descriptor.FieldDescriptor(name='digest',
full_name='EA.Sims4.Network.SocialCandidatesMessage.digest',
index=4,
number=5,
type=12,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b'',
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
options=None),
descriptor.FieldDescriptor(name='candidates',
full_name='EA.Sims4.Network.SocialCandidatesMessage.candidates',
index=5,
number=6,
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='expire_epoch_secs',
full_name='EA.Sims4.Network.SocialCandidatesMessage.expire_epoch_secs',
index=6,
number=7,
type=4,
cpp_type=4,
label=1,
has_default_value=False,
default_value=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,
extension_ranges=[],
serialized_start=6217,
serialized_end=6453)
_SOCIALEVALUATIONRESULTSMESSAGE = descriptor.Descriptor(name='SocialEvaluationResultsMessage',
full_name='EA.Sims4.Network.SocialEvaluationResultsMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='winner_ids',
full_name='EA.Sims4.Network.SocialEvaluationResultsMessage.winner_ids',
index=0,
number=1,
type=9,
cpp_type=9,
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='loser_ids',
full_name='EA.Sims4.Network.SocialEvaluationResultsMessage.loser_ids',
index=1,
number=2,
type=9,
cpp_type=9,
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='digest',
full_name='EA.Sims4.Network.SocialEvaluationResultsMessage.digest',
index=2,
number=3,
type=12,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b'',
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,
extension_ranges=[],
serialized_start=6455,
serialized_end=6542)
_SOCIALCGDIGESTMESSAGE = descriptor.Descriptor(name='SocialCGDigestMessage',
full_name='EA.Sims4.Network.SocialCGDigestMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(name='challenge',
full_name='EA.Sims4.Network.SocialCGDigestMessage.challenge',
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
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),
descriptor.FieldDescriptor(name='candidates',
full_name='EA.Sims4.Network.SocialCGDigestMessage.candidates',
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,
extension_ranges=[],
serialized_start=6544,
serialized_end=6660)
_SOCIALGENERICRESPONSE.fields_by_name['msg_type'].enum_type = Consts_pb2._SOCIALOPTYPES
_SOCIALPLAYERINFOLIST_PLAYERINFO.fields_by_name['presence'].enum_type = Consts_pb2._ONLINEPRESENCESTATUS
_SOCIALPLAYERINFOLIST_PLAYERINFO.containing_type = _SOCIALPLAYERINFOLIST
_SOCIALPLAYERINFOLIST.fields_by_name['players'].message_type = _SOCIALPLAYERINFOLIST_PLAYERINFO
_SOCIALSEARCHMSG.fields_by_name['search_results'].message_type = Localization_pb2._LOCALIZEDSTRINGTOKEN
_SOCIALCASSANDRATEST.fields_by_name['opcode'].enum_type = Consts_pb2._CASSANDRATESTCODE
_SOCIALEXCHANGEMESSAGE.fields_by_name['envelope'].message_type = Exchange_pb2._EXCHANGESOCIALENVELOPE
_SOCIALFEEDITEMMESSAGE.fields_by_name['feed_type'].enum_type = _SOCIALFEEDITEMTYPE
_SOCIALFEEDITEMMESSAGE.fields_by_name['metadata'].message_type = Exchange_pb2._TRAYMETADATA
_SOCIALFEEDITEMMESSAGE.fields_by_name['followers_blob'].message_type = _SOCIALFOLLOWERSMESSAGE
_SOCIALGETWALLCOMMENTSMESSAGE.fields_by_name['messages'].message_type = _SOCIALWALLCOMMENTMESSAGE
_SOCIALPOSTWALLCOMMENTMESSAGE.fields_by_name['message'].message_type = _SOCIALWALLCOMMENTMESSAGE
_SOCIALREQUESTFEEDWALLMESSAGE.fields_by_name['messages'].message_type = _SOCIALFEEDITEMMESSAGE
_SOCIALREQUESTFEEDWALLMESSAGE.fields_by_name['unserialized_messages'].message_type = _SOCIALFEEDITEMUNSERIALIZEDMESSAGE
_SOCIALGETPLAYERINFOLISTMESSAGE_PLAYERINFO.containing_type = _SOCIALGETPLAYERINFOLISTMESSAGE
_SOCIALGETPLAYERINFOLISTMESSAGE.fields_by_name['player_info_list'].message_type = _SOCIALGETPLAYERINFOLISTMESSAGE_PLAYERINFO
_SOCIALCONTROLMESSAGE.fields_by_name['opcode'].enum_type = Consts_pb2._SOCIALOPTYPES
_SOCIALCONTROLMESSAGE.fields_by_name['subop'].enum_type = Consts_pb2._SOCIALOPTYPES
_SOCIALCONTROLMESSAGE.fields_by_name['getwallcommentsmsg'].message_type = _SOCIALGETWALLCOMMENTSMESSAGE
_SOCIALCONTROLMESSAGE.fields_by_name['postwallcommentmsg'].message_type = _SOCIALPOSTWALLCOMMENTMESSAGE
_SOCIALCONTROLMESSAGE.fields_by_name['deletewallcommentmsg'].message_type = _SOCIALDELETEWALLCOMMENTMESSAGE
_SOCIALCONTROLMESSAGE.fields_by_name['friendmsg'].message_type = _SOCIALFRIENDMSG
_SOCIALCONTROLMESSAGE.fields_by_name['genericresponse'].message_type = _SOCIALGENERICRESPONSE
_SOCIALCONTROLMESSAGE.fields_by_name['playerinfo'].message_type = _SOCIALPLAYERINFOLIST
_SOCIALCONTROLMESSAGE.fields_by_name['feedsubmsg'].message_type = Exchange_pb2._SOCIALFEEDSUBMESSAGE
_SOCIALCONTROLMESSAGE.fields_by_name['searchresultmsg'].message_type = _SOCIALSEARCHMSG
_SOCIALCONTROLMESSAGE.fields_by_name['inviteresponsemsg'].message_type = _SOCIALINVITERESPONSEMESSAGE
_SOCIALCONTROLMESSAGE.fields_by_name['originerror'].message_type = _ORIGINERRORMESSAGE
_SOCIALCONTROLMESSAGE.fields_by_name['socialcassandratest'].message_type = _SOCIALCASSANDRATEST
_SOCIALCONTROLMESSAGE.fields_by_name['socialfriendlistrequestmsg'].message_type = _SOCIALFRIENDLISTREQUESTMESSAGE
_SOCIALCONTROLMESSAGE.fields_by_name['socialrequestnucleusidfrompersona'].message_type = _SOCIALREQUESTNUCLEUSIDFROMPERSONA
_SOCIALCONTROLMESSAGE.fields_by_name['socialnucleusidfrompersonaresponse'].message_type = _SOCIALNUCLEUSIDFROMPERSONARESPONSE
_SOCIALCONTROLMESSAGE.fields_by_name['socialexchangemessage'].message_type = _SOCIALEXCHANGEMESSAGE
_SOCIALCONTROLMESSAGE.fields_by_name['socialrequestfeedwallmessage'].message_type = _SOCIALREQUESTFEEDWALLMESSAGE
_SOCIALCONTROLMESSAGE.fields_by_name['stat_tickers'].message_type = Exchange_pb2._EXCHANGESTATTICKERMESSAGE
_SOCIALCONTROLMESSAGE.fields_by_name['comment_petition_msg'].message_type = _SOCIALCOMMENTPETITIONMESSAGE
_SOCIALCONTROLMESSAGE.fields_by_name['feedremovalmsg'].message_type = _SOCIALFEEDREMOVALMESSAGE
_SOCIALCONTROLMESSAGE.fields_by_name['bio_petition_msg'].message_type = _SOCIALBIOPETITIONMESSAGE
_SOCIALCONTROLMESSAGE.fields_by_name['fb_event_msg'].message_type = _SOCIALFACEBOOKEVENTMESSAGE
_SOCIALCONTROLMESSAGE.fields_by_name['requestfollowers_msg'].message_type = _SOCIALREQUESTFOLLOWERSMESSAGE
_SOCIALCONTROLMESSAGE.fields_by_name['responsefollowers_msg'].message_type = Exchange_pb2._SOCIALRESPONSEFOLLOWERSMESSAGE
_SOCIALCONTROLMESSAGE.fields_by_name['requestignorelist_msg'].message_type = _SOCIALREQUESTIGNORELISTMESSAGE
_SOCIALCONTROLMESSAGE.fields_by_name['response_player_info_list_msg'].message_type = _SOCIALGETPLAYERINFOLISTMESSAGE
_SOCIALCONTROLMESSAGE.fields_by_name['player_identification_list_msg'].message_type = Exchange_pb2._SERVERPLAYERIDENTIFICATIONLISTMESSAGE
_SOCIALCONTROLMESSAGE.fields_by_name['candidate_msg'].message_type = _SOCIALCANDIDATESMESSAGE
_SOCIALCONTROLMESSAGE.fields_by_name['evaluation_results_msg'].message_type = _SOCIALEVALUATIONRESULTSMESSAGE
_SOCIALCONTROLMESSAGE.fields_by_name['cg_update_msg'].message_type = Exchange_pb2._SOCIALCGUPDATEMESSAGE
_SOCIALCONTROLQUEUEBROADCASTMESSAGE.fields_by_name['control'].message_type = _SOCIALCONTROLMESSAGE
_SOCIALCANDIDATESMESSAGE.fields_by_name['candidates'].message_type = _SOCIALCANDIDATESTATISTICSUBMESSAGE
_SOCIALCGDIGESTMESSAGE.fields_by_name['candidates'].message_type = _SOCIALCANDIDATESTATISTICSUBMESSAGE
DESCRIPTOR.message_types_by_name['SocialFriendMsg'] = _SOCIALFRIENDMSG
DESCRIPTOR.message_types_by_name['SocialPersonaResponseMsg'] = _SOCIALPERSONARESPONSEMSG
DESCRIPTOR.message_types_by_name['SocialGenericResponse'] = _SOCIALGENERICRESPONSE
DESCRIPTOR.message_types_by_name['SocialPlayerInfoList'] = _SOCIALPLAYERINFOLIST
DESCRIPTOR.message_types_by_name['SocialSearchMsg'] = _SOCIALSEARCHMSG
DESCRIPTOR.message_types_by_name['OriginErrorMessage'] = _ORIGINERRORMESSAGE
DESCRIPTOR.message_types_by_name['SocialInviteResponseMessage'] = _SOCIALINVITERESPONSEMESSAGE
DESCRIPTOR.message_types_by_name['SocialCassandraTest'] = _SOCIALCASSANDRATEST
DESCRIPTOR.message_types_by_name['SocialFriendListRequestMessage'] = _SOCIALFRIENDLISTREQUESTMESSAGE
DESCRIPTOR.message_types_by_name['SocialRequestNucleusIdFromPersona'] = _SOCIALREQUESTNUCLEUSIDFROMPERSONA
DESCRIPTOR.message_types_by_name['SocialNucleusIdFromPersonaResponse'] = _SOCIALNUCLEUSIDFROMPERSONARESPONSE
DESCRIPTOR.message_types_by_name['SocialExchangeMessage'] = _SOCIALEXCHANGEMESSAGE
DESCRIPTOR.message_types_by_name['SocialFollowersMessage'] = _SOCIALFOLLOWERSMESSAGE
DESCRIPTOR.message_types_by_name['SocialFeedItemMessage'] = _SOCIALFEEDITEMMESSAGE
DESCRIPTOR.message_types_by_name['SocialFeedItemUnserializedMessage'] = _SOCIALFEEDITEMUNSERIALIZEDMESSAGE
DESCRIPTOR.message_types_by_name['SocialWallCommentMessage'] = _SOCIALWALLCOMMENTMESSAGE
DESCRIPTOR.message_types_by_name['SocialGetWallCommentsMessage'] = _SOCIALGETWALLCOMMENTSMESSAGE
DESCRIPTOR.message_types_by_name['SocialPostWallCommentMessage'] = _SOCIALPOSTWALLCOMMENTMESSAGE
DESCRIPTOR.message_types_by_name['SocialDeleteWallCommentMessage'] = _SOCIALDELETEWALLCOMMENTMESSAGE
DESCRIPTOR.message_types_by_name['SocialRequestFeedWallMessage'] = _SOCIALREQUESTFEEDWALLMESSAGE
DESCRIPTOR.message_types_by_name['SocialRequestFollowersMessage'] = _SOCIALREQUESTFOLLOWERSMESSAGE
DESCRIPTOR.message_types_by_name['SocialRequestIgnoreListMessage'] = _SOCIALREQUESTIGNORELISTMESSAGE
DESCRIPTOR.message_types_by_name['SocialGetPlayerInfoListMessage'] = _SOCIALGETPLAYERINFOLISTMESSAGE
DESCRIPTOR.message_types_by_name['SocialCommentPetitionMessage'] = _SOCIALCOMMENTPETITIONMESSAGE
DESCRIPTOR.message_types_by_name['SocialBioPetitionMessage'] = _SOCIALBIOPETITIONMESSAGE
DESCRIPTOR.message_types_by_name['SocialFeedRemovalMessage'] = _SOCIALFEEDREMOVALMESSAGE
DESCRIPTOR.message_types_by_name['SocialControlMessage'] = _SOCIALCONTROLMESSAGE
DESCRIPTOR.message_types_by_name['SocialInvalidateMsg'] = _SOCIALINVALIDATEMSG
DESCRIPTOR.message_types_by_name['SocialControlQueueBroadcastMessage'] = _SOCIALCONTROLQUEUEBROADCASTMESSAGE
DESCRIPTOR.message_types_by_name['LifeEventMessage'] = _LIFEEVENTMESSAGE
DESCRIPTOR.message_types_by_name['SocialFacebookEventMessage'] = _SOCIALFACEBOOKEVENTMESSAGE
DESCRIPTOR.message_types_by_name['SocialCandidateStatisticSubmessage'] = _SOCIALCANDIDATESTATISTICSUBMESSAGE
DESCRIPTOR.message_types_by_name['SocialCandidatesMessage'] = _SOCIALCANDIDATESMESSAGE
DESCRIPTOR.message_types_by_name['SocialEvaluationResultsMessage'] = _SOCIALEVALUATIONRESULTSMESSAGE
DESCRIPTOR.message_types_by_name['SocialCGDigestMessage'] = _SOCIALCGDIGESTMESSAGE
class SocialFriendMsg(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALFRIENDMSG
class SocialPersonaResponseMsg(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALPERSONARESPONSEMSG
class SocialGenericResponse(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALGENERICRESPONSE
class SocialPlayerInfoList(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
class PlayerInfo(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALPLAYERINFOLIST_PLAYERINFO
DESCRIPTOR = _SOCIALPLAYERINFOLIST
class SocialSearchMsg(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALSEARCHMSG
class OriginErrorMessage(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _ORIGINERRORMESSAGE
class SocialInviteResponseMessage(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALINVITERESPONSEMESSAGE
class SocialCassandraTest(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALCASSANDRATEST
class SocialFriendListRequestMessage(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALFRIENDLISTREQUESTMESSAGE
class SocialRequestNucleusIdFromPersona(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALREQUESTNUCLEUSIDFROMPERSONA
class SocialNucleusIdFromPersonaResponse(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALNUCLEUSIDFROMPERSONARESPONSE
class SocialExchangeMessage(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALEXCHANGEMESSAGE
class SocialFollowersMessage(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALFOLLOWERSMESSAGE
class SocialFeedItemMessage(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALFEEDITEMMESSAGE
class SocialFeedItemUnserializedMessage(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALFEEDITEMUNSERIALIZEDMESSAGE
class SocialWallCommentMessage(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALWALLCOMMENTMESSAGE
class SocialGetWallCommentsMessage(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALGETWALLCOMMENTSMESSAGE
class SocialPostWallCommentMessage(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALPOSTWALLCOMMENTMESSAGE
class SocialDeleteWallCommentMessage(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALDELETEWALLCOMMENTMESSAGE
class SocialRequestFeedWallMessage(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALREQUESTFEEDWALLMESSAGE
class SocialRequestFollowersMessage(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALREQUESTFOLLOWERSMESSAGE
class SocialRequestIgnoreListMessage(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALREQUESTIGNORELISTMESSAGE
class SocialGetPlayerInfoListMessage(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
class PlayerInfo(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALGETPLAYERINFOLISTMESSAGE_PLAYERINFO
DESCRIPTOR = _SOCIALGETPLAYERINFOLISTMESSAGE
class SocialCommentPetitionMessage(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALCOMMENTPETITIONMESSAGE
class SocialBioPetitionMessage(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALBIOPETITIONMESSAGE
class SocialFeedRemovalMessage(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALFEEDREMOVALMESSAGE
class SocialControlMessage(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALCONTROLMESSAGE
class SocialInvalidateMsg(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALINVALIDATEMSG
class SocialControlQueueBroadcastMessage(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALCONTROLQUEUEBROADCASTMESSAGE
class LifeEventMessage(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _LIFEEVENTMESSAGE
class SocialFacebookEventMessage(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALFACEBOOKEVENTMESSAGE
class SocialCandidateStatisticSubmessage(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALCANDIDATESTATISTICSUBMESSAGE
class SocialCandidatesMessage(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALCANDIDATESMESSAGE
class SocialEvaluationResultsMessage(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALEVALUATIONRESULTSMESSAGE
class SocialCGDigestMessage(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _SOCIALCGDIGESTMESSAGE
| 31.050625
| 10,693
| 0.763723
| 11,997
| 99,362
| 6.098275
| 0.056431
| 0.056642
| 0.046309
| 0.03957
| 0.719126
| 0.679419
| 0.561119
| 0.522314
| 0.511939
| 0.501415
| 0
| 0.043324
| 0.119351
| 99,362
| 3,200
| 10,694
| 31.050625
| 0.792704
| 0.003351
| 0
| 0.785005
| 0
| 0.003525
| 0.23742
| 0.208012
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.002884
| 0
| 0.025953
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
5fc115feb7229821fab8bd49844fdb6a161d73e2
| 408
|
py
|
Python
|
deploy/api/src/schemas/koe_favorite_schema.py
|
bonybody/2020_hew_app
|
d09cdafd55348ed70424a443d8619114cae3d27f
|
[
"MIT"
] | 1
|
2021-06-03T02:54:51.000Z
|
2021-06-03T02:54:51.000Z
|
deploy/api/src/schemas/koe_favorite_schema.py
|
bonybody/agri
|
d09cdafd55348ed70424a443d8619114cae3d27f
|
[
"MIT"
] | 19
|
2021-01-01T09:48:51.000Z
|
2021-04-08T09:11:30.000Z
|
deploy/api/src/schemas/koe_favorite_schema.py
|
bonybody/agri
|
d09cdafd55348ed70424a443d8619114cae3d27f
|
[
"MIT"
] | 1
|
2021-09-28T11:54:25.000Z
|
2021-09-28T11:54:25.000Z
|
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from database.database import ma
from models import KoeFavorite
from .user_schema import UserSchema
from .koe_schema import KoeSchema
class KoeFavoriteSchema(ma.SQLAlchemyAutoSchema):
Koe = ma.Nested(KoeSchema)
user = ma.Nested(UserSchema)
class Meta:
model = KoeFavorite
| 25.5
| 77
| 0.742647
| 52
| 408
| 5.711538
| 0.461538
| 0.060606
| 0.087542
| 0.10101
| 0.107744
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.176471
| 408
| 15
| 78
| 27.2
| 0.883929
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.833333
| 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
| 0
| 1
| 0
|
0
| 2
|
395b088785153a0b12425d78d2c97981d28c0b99
| 584
|
py
|
Python
|
bluebottle/test/factory_models/pages.py
|
terrameijar/bluebottle
|
b4f5ba9c4f03e678fdd36091b29240307ea69ffd
|
[
"BSD-3-Clause"
] | 10
|
2015-05-28T18:26:40.000Z
|
2021-09-06T10:07:03.000Z
|
bluebottle/test/factory_models/pages.py
|
terrameijar/bluebottle
|
b4f5ba9c4f03e678fdd36091b29240307ea69ffd
|
[
"BSD-3-Clause"
] | 762
|
2015-01-15T10:00:59.000Z
|
2022-03-31T15:35:14.000Z
|
bluebottle/test/factory_models/pages.py
|
terrameijar/bluebottle
|
b4f5ba9c4f03e678fdd36091b29240307ea69ffd
|
[
"BSD-3-Clause"
] | 9
|
2015-02-20T13:19:30.000Z
|
2022-03-08T14:09:17.000Z
|
from builtins import object
from datetime import timedelta
import factory
from django.utils.timezone import now
from bluebottle.pages.models import Page
from .accounts import BlueBottleUserFactory
class PageFactory(factory.DjangoModelFactory):
class Meta(object):
model = Page
language = 'en'
title = factory.Sequence(lambda n: 'Page Title {0}'.format(n))
author = factory.SubFactory(BlueBottleUserFactory)
slug = factory.Sequence(lambda n: 'slug-{0}'.format(n))
status = Page.PageStatus.published
publication_date = now() - timedelta(days=4)
| 27.809524
| 66
| 0.741438
| 70
| 584
| 6.171429
| 0.571429
| 0.069444
| 0.097222
| 0.101852
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006148
| 0.164384
| 584
| 20
| 67
| 29.2
| 0.879098
| 0
| 0
| 0
| 0
| 0
| 0.041096
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4
| 0
| 0.933333
| 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
| 0
| 1
| 0
|
0
| 2
|
39671833a02d25c6d6b9a61a074e54f03e6112e8
| 1,124
|
py
|
Python
|
decision_tree/dt_author_id.py
|
ncfausti/udacity-machine-learning
|
223eb1821e739d048d278629a2e466b3f2af8912
|
[
"MIT"
] | null | null | null |
decision_tree/dt_author_id.py
|
ncfausti/udacity-machine-learning
|
223eb1821e739d048d278629a2e466b3f2af8912
|
[
"MIT"
] | null | null | null |
decision_tree/dt_author_id.py
|
ncfausti/udacity-machine-learning
|
223eb1821e739d048d278629a2e466b3f2af8912
|
[
"MIT"
] | null | null | null |
#!/usr/bin/python
"""
this is the code to accompany the Lesson 3 (decision tree) mini-project
use an DT to identify emails from the Enron corpus by their authors
Sara has label 0
Chris has label 1
"""
import sys
from time import time
sys.path.append("../tools/")
from email_preprocess import preprocess
from sklearn import tree
from sklearn.metrics import accuracy_score
import time
### features_train and features_test are the features for the training
### and testing datasets, respectively
### labels_train and labels_test are the corresponding item labels
features_train, features_test, labels_train, labels_test = preprocess()
clf = tree.DecisionTreeClassifier(min_samples_split = 40)
clf = clf.fit(features_train, labels_train)
prediction = clf.predict(features_test)
accuracy = accuracy_score(prediction, labels_test)
print("Accuracy: %.6f" % accuracy)
print("Feature length: %d" % len(features_train[0]))
#########################################################
### your code goes here ###
#########################################################
def running_time():
pass
| 24.434783
| 75
| 0.674377
| 143
| 1,124
| 5.167832
| 0.545455
| 0.070365
| 0.027064
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.007299
| 0.146797
| 1,124
| 46
| 76
| 24.434783
| 0.763295
| 0.336299
| 0
| 0
| 0
| 0
| 0.069847
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.0625
| false
| 0.0625
| 0.375
| 0
| 0.4375
| 0.125
| 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
| 0
| 0
|
0
| 2
|
397474e797b04315ff3ee3188dba1be27f9df132
| 752
|
py
|
Python
|
fullthrottleapp/models.py
|
Pranjali16/FullThrottle-Project
|
bb6fbd3783d22c2e47ad85687e18f02a30c69799
|
[
"Apache-2.0"
] | null | null | null |
fullthrottleapp/models.py
|
Pranjali16/FullThrottle-Project
|
bb6fbd3783d22c2e47ad85687e18f02a30c69799
|
[
"Apache-2.0"
] | null | null | null |
fullthrottleapp/models.py
|
Pranjali16/FullThrottle-Project
|
bb6fbd3783d22c2e47ad85687e18f02a30c69799
|
[
"Apache-2.0"
] | null | null | null |
from django.db import models
from django.contrib.auth.models import AbstractBaseUser
class User(AbstractBaseUser, models.Model):
"""User Model"""
name = models.CharField(max_length=500, blank=True, null=True)
tz = models.CharField(max_length=500, blank=True, null=True)
USERNAME_FIELD = 'name'
def __str__(self):
return str(self.name)
class ActivityPeriod(models.Model):
""" Activity Period Model"""
user_id = models.ForeignKey(User, related_name='user_activity', null=True, blank=True,
on_delete=models.CASCADE)
start_time = models.CharField(max_length=500, blank=True, null=True)
end_time = models.CharField(max_length=500, blank=True, null=True)
| 34.181818
| 91
| 0.679521
| 95
| 752
| 5.221053
| 0.4
| 0.090726
| 0.145161
| 0.193548
| 0.370968
| 0.370968
| 0.370968
| 0.370968
| 0.370968
| 0.193548
| 0
| 0.020134
| 0.207447
| 752
| 21
| 92
| 35.809524
| 0.812081
| 0.042553
| 0
| 0
| 0
| 0
| 0.024745
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.076923
| false
| 0
| 0.153846
| 0.076923
| 0.923077
| 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
| 0
| 1
| 0
|
0
| 2
|
39ab4f35e7e866e763852b3e23d066d864569549
| 1,120
|
py
|
Python
|
conti_wc.py
|
saturn99/cleaks
|
c826c973d9695c3bfc31bf580b470267792807e7
|
[
"MIT"
] | 6
|
2022-03-01T10:33:52.000Z
|
2022-03-05T22:26:27.000Z
|
conti_wc.py
|
saturn99/cleaks
|
c826c973d9695c3bfc31bf580b470267792807e7
|
[
"MIT"
] | 1
|
2022-03-01T13:40:29.000Z
|
2022-03-01T13:40:29.000Z
|
conti_wc.py
|
saturn99/cleaks
|
c826c973d9695c3bfc31bf580b470267792807e7
|
[
"MIT"
] | 2
|
2022-03-01T10:40:57.000Z
|
2022-03-01T13:21:23.000Z
|
# -*- coding: utf-8 -*-
# import libraries
import os
from PIL import Image
import nltk
import numpy as np
import matplotlib.pyplot as plt
import random
from scipy.ndimage import gaussian_gradient_magnitude
from wordcloud import WordCloud, ImageColorGenerator, STOPWORDS
# import mask image. Search for stencil image for better results
mask = np.array(Image.open("darthvader01.png"))
# define function for grayscale coloring
def grey_color_func(word, font_size, position, orientation, random_state=None,
**kwargs):
return "hsl(0, 0%%, %d%%)" % random.randint(60, 100)
# Load and text and decode
text = open(('conti_just_body.txt'), "rb").read().decode('UTF-8', errors='replace')
# Load stopwords for EN language from nlkt
stopwords = nltk.corpus.stopwords.words('english')
# Create Worldcloud
wc = WordCloud(max_words=100000, width=1596, height=584, stopwords=stopwords, mask=mask).generate(text)
# Recolor our Wordcloud
plt.imshow(wc.recolor(color_func=grey_color_func, random_state=3),
interpolation="bilinear")
# Save worldcloud file
wc.to_file("CONTI_Darth.png")
| 25.454545
| 103
| 0.738393
| 155
| 1,120
| 5.23871
| 0.619355
| 0.033251
| 0.03202
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.026261
| 0.15
| 1,120
| 43
| 104
| 26.046512
| 0.826681
| 0.241071
| 0
| 0
| 0
| 0
| 0.114422
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.055556
| false
| 0
| 0.444444
| 0.055556
| 0.555556
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 2
|
39abb2ca3dacb04c99f9108d126a09ef92f5c7d4
| 1,824
|
py
|
Python
|
swift_cloud_py/validate_safety_restrictions/validate.py
|
stijnfleuren/swift_cloud_api
|
30f3b6c1fd80e5cfa5ce11e1daa08a09ab1e4e9b
|
[
"MIT"
] | 3
|
2021-05-25T18:29:38.000Z
|
2021-08-03T17:04:29.000Z
|
swift_cloud_py/validate_safety_restrictions/validate.py
|
stijnfleuren/swift_cloud_api
|
30f3b6c1fd80e5cfa5ce11e1daa08a09ab1e4e9b
|
[
"MIT"
] | null | null | null |
swift_cloud_py/validate_safety_restrictions/validate.py
|
stijnfleuren/swift_cloud_api
|
30f3b6c1fd80e5cfa5ce11e1daa08a09ab1e4e9b
|
[
"MIT"
] | null | null | null |
from swift_cloud_py.entities.control_output.fixed_time_schedule import FixedTimeSchedule
from swift_cloud_py.entities.intersection.intersection import Intersection
from swift_cloud_py.validate_safety_restrictions.validate_bounds import validate_bounds
from swift_cloud_py.validate_safety_restrictions.validate_completeness import validate_completeness
from swift_cloud_py.validate_safety_restrictions.validate_conflicts import validate_conflicts
from swift_cloud_py.validate_safety_restrictions.validate_fixed_orders import validate_fixed_orders
from swift_cloud_py.validate_safety_restrictions.validate_other_sg_relations import validate_other_sg_relations
def validate_safety_restrictions(intersection: Intersection, fixed_time_schedule: FixedTimeSchedule,
tolerance: float = 10**(-2)) -> None:
"""
Check if the fixed-time schedule satisfies the safety restrictions such as bounds on greenyellow times
and bounds on red times.
:param intersection: intersection object (this object also contains safety restrictions that a
fixed-time schedule should satisfy)
:param fixed_time_schedule: the schedule that we would like to validate
:param tolerance: tolerance in seconds for violating safety restrictions
This method raises a SafetyViolation-exception if the safety restrictions are not satisfied.
"""
validate_bounds(intersection=intersection, fts=fixed_time_schedule, tolerance=tolerance)
validate_conflicts(intersection=intersection, fts=fixed_time_schedule, tolerance=tolerance)
validate_other_sg_relations(intersection=intersection, fts=fixed_time_schedule, tolerance=tolerance)
validate_completeness(intersection=intersection, fts=fixed_time_schedule)
validate_fixed_orders(intersection=intersection, fts=fixed_time_schedule)
| 67.555556
| 111
| 0.838268
| 223
| 1,824
| 6.556054
| 0.29148
| 0.06156
| 0.116279
| 0.076607
| 0.407661
| 0.374829
| 0.314637
| 0.314637
| 0.143639
| 0
| 0
| 0.001862
| 0.116776
| 1,824
| 26
| 112
| 70.153846
| 0.905649
| 0.272478
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.071429
| false
| 0
| 0.5
| 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
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 2
|
39ad13fb0f9312898dcd01e19fe49f2a734c1783
| 58
|
py
|
Python
|
pyjpboatrace/utils/__init__.py
|
miyamamoto/pyjpboatrace
|
fbc4a794d1f03e2ed7dfcafcb20c43098c1434a6
|
[
"MIT"
] | null | null | null |
pyjpboatrace/utils/__init__.py
|
miyamamoto/pyjpboatrace
|
fbc4a794d1f03e2ed7dfcafcb20c43098c1434a6
|
[
"MIT"
] | null | null | null |
pyjpboatrace/utils/__init__.py
|
miyamamoto/pyjpboatrace
|
fbc4a794d1f03e2ed7dfcafcb20c43098c1434a6
|
[
"MIT"
] | null | null | null |
from .str2num import str2num
__all__ = [
'str2num'
]
| 9.666667
| 28
| 0.655172
| 6
| 58
| 5.666667
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.068182
| 0.241379
| 58
| 5
| 29
| 11.6
| 0.704545
| 0
| 0
| 0
| 0
| 0
| 0.12069
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.25
| 0
| 0.25
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
39ae3c36550302817294c61764f3350d2f47cf3d
| 2,168
|
py
|
Python
|
snippets/integers.py
|
rhishi/python-snippets
|
60020d3a187d7687b38b6b58f74ceb03a37983b9
|
[
"Apache-2.0"
] | null | null | null |
snippets/integers.py
|
rhishi/python-snippets
|
60020d3a187d7687b38b6b58f74ceb03a37983b9
|
[
"Apache-2.0"
] | null | null | null |
snippets/integers.py
|
rhishi/python-snippets
|
60020d3a187d7687b38b6b58f74ceb03a37983b9
|
[
"Apache-2.0"
] | null | null | null |
import sys
# First: to understand the uses of "format" below, read these:
# Format String Syntax https://docs.python.org/2/library/string.html#formatstrings
# Format Specification Mini-Language https://docs.python.org/2/library/string.html#formatspec
# In Python 2, there are two integer types: int, long.
# int is the underlying platform's signed integer type,
# either 32 or 64 bit, depending on the platform.
print "2^31 - 1 = {0:20} = {0:17x} ".format((1 << 31) - 1)
print "2^63 - 1 = {0:20} = {0:17x} ".format((1 << 63) - 1)
# sys.maxint gives the maximum value of int. It is 2^31-1 or 2^63-1.
maxint = sys.maxint
print " max int = {0:20} = {0:17x} {1}".format(maxint, type(maxint))
# There is no sys.minint, but it's simply -sys.maxint-1 as said in Python documentation
# http://docs.python.org/2/library/stdtypes.html#numeric-types-int-float-long-complex
minint = -maxint - 1
print " min int = {0:20} = {0:17x} {1}".format(minint, type(minint))
print
# long is an integer type with unlimited range. Python automatically
# switches over from int to long whenever there is overflow.
# That's why, there is no sys.maxlong.
# Python 3 even gets rid of sys.maxint, because it has just single
# integer type: int. It actually behaves like 2's long i.e. has unlimited range.
# 3 has sys.maxsize, which loosely relates to 2's sys.maxint.
# http://docs.python.org/3.3/whatsnew/3.0.html#integers
# http://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex
# Let's test the automatic switchover from int to long
# On 64-bit platform, the switchover point is between 2^63-1 and 2^63.
for r in [ range(1, 22), range(28, 37), range(53, 69), range(88, 100), range(123, 131) ]:
for i in r:
# make 2^i - 1, without spilling beyond i bits.
n = (((1 << (i-1)) - 1) << 1) + 1
# i is formatted as left-aligned ('<'), width 3.
# n is formatted as hex ('x') with 0x prefix ('#'), width 35.
print "2**{0:<3} - 1 = {1:#35x} {2}".format(i, n, type(n))
print " + 1 = {1:#35x} {2}".format(i, n+1, type(n+1))
print "..."
print
print -1
print -1 & 0xFF
print -1 & 0xFFF
| 38.714286
| 95
| 0.652675
| 377
| 2,168
| 3.753316
| 0.374005
| 0.035336
| 0.045936
| 0.019788
| 0.20636
| 0.171025
| 0.171025
| 0.050883
| 0
| 0
| 0
| 0.075029
| 0.194649
| 2,168
| 55
| 96
| 39.418182
| 0.735395
| 0.646218
| 0
| 0.111111
| 0
| 0
| 0.258152
| 0
| 0
| 0
| 0.012228
| 0
| 0
| 0
| null | null | 0
| 0.055556
| null | null | 0.666667
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 2
|
39b6bd6353821651a0a01cf687e78a807a34d494
| 337
|
py
|
Python
|
tests/base_test_case.py
|
caoziyao/orm
|
24121b8b10910c121a5dff19c6fd9f25ec7f425c
|
[
"MIT"
] | 1
|
2016-10-30T14:41:39.000Z
|
2016-10-30T14:41:39.000Z
|
tests/base_test_case.py
|
caoziyao/orm
|
24121b8b10910c121a5dff19c6fd9f25ec7f425c
|
[
"MIT"
] | null | null | null |
tests/base_test_case.py
|
caoziyao/orm
|
24121b8b10910c121a5dff19c6fd9f25ec7f425c
|
[
"MIT"
] | null | null | null |
# coding: utf-8
"""
@author: csy
@license: (C) Copyright 2017-2018
@contact: [email protected]
@time: 2018/11/22
@desc:
"""
import unittest
from orm.data_base import Database
class BaseTestCase(unittest.TestCase):
def setUp(self):
url = 'mysql://root:zy123456@localhost/wiki?charset=utf8'
self.db = Database(url)
| 18.722222
| 65
| 0.688427
| 46
| 337
| 5.021739
| 0.869565
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.085409
| 0.166172
| 337
| 17
| 66
| 19.823529
| 0.736655
| 0.341246
| 0
| 0
| 0
| 0
| 0.228972
| 0.228972
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0.333333
| 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
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 2
|
39c42e302788d37384d6aba69dfd98df2d11d258
| 1,000
|
py
|
Python
|
datasets/linear/parking/lr.py
|
diego1q2w/lregret
|
823c7f609559d1012ed52f619b1aa1297d5f2517
|
[
"Apache-2.0"
] | null | null | null |
datasets/linear/parking/lr.py
|
diego1q2w/lregret
|
823c7f609559d1012ed52f619b1aa1297d5f2517
|
[
"Apache-2.0"
] | null | null | null |
datasets/linear/parking/lr.py
|
diego1q2w/lregret
|
823c7f609559d1012ed52f619b1aa1297d5f2517
|
[
"Apache-2.0"
] | null | null | null |
import os
from datetime import datetime
import time
import pandas as pd
from datasets.linear import LinearProblem
from regresion.linear.feature import PolFeatures
from regresion.linear.linear import LinearRegression
class ParkingProblem(LinearProblem):
def dataset_title(self) -> str:
return "Parking"
def __init__(self, regression: LinearRegression, pol_features=PolFeatures(1)) -> None:
file_name = os.path.join(os.path.dirname(__file__), 'dataset.csv')
df = pd.read_csv(file_name)
def format_date(raw_date: str) -> float:
timestamp = time.mktime(datetime.strptime(raw_date, '%Y-%m-%d %H:%M:%S').timetuple())
delta = timestamp - 1475539200.0
return delta / 60.0
df['LastUpdated'] = df['LastUpdated'] \
.apply(format_date)
super().__init__(df[['Capacity', 'LastUpdated']], df['Occupancy'], regression, pol_features)
# lr = LinearRegression()
# p = ParkingProblem(lr)
# p.fit_solving()
| 29.411765
| 100
| 0.678
| 120
| 1,000
| 5.458333
| 0.533333
| 0.042748
| 0.058015
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.018727
| 0.199
| 1,000
| 33
| 101
| 30.30303
| 0.799001
| 0.062
| 0
| 0
| 0
| 0
| 0.091006
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.15
| false
| 0
| 0.35
| 0.05
| 0.65
| 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
| 0
| 1
| 0
|
0
| 2
|
39c714143377ff9b1982f6d7182df1f2ee8d4c39
| 244
|
py
|
Python
|
output/models/nist_data/atomic/name/schema_instance/nistschema_sv_iv_atomic_name_max_length_1_xsd/__init__.py
|
tefra/xsdata-w3c-tests
|
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
|
[
"MIT"
] | 1
|
2021-08-14T17:59:21.000Z
|
2021-08-14T17:59:21.000Z
|
output/models/nist_data/atomic/name/schema_instance/nistschema_sv_iv_atomic_name_max_length_1_xsd/__init__.py
|
tefra/xsdata-w3c-tests
|
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
|
[
"MIT"
] | 4
|
2020-02-12T21:30:44.000Z
|
2020-04-15T20:06:46.000Z
|
output/models/nist_data/atomic/name/schema_instance/nistschema_sv_iv_atomic_name_max_length_1_xsd/__init__.py
|
tefra/xsdata-w3c-tests
|
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
|
[
"MIT"
] | null | null | null |
from output.models.nist_data.atomic.name.schema_instance.nistschema_sv_iv_atomic_name_max_length_1_xsd.nistschema_sv_iv_atomic_name_max_length_1 import NistschemaSvIvAtomicNameMaxLength1
__all__ = [
"NistschemaSvIvAtomicNameMaxLength1",
]
| 40.666667
| 186
| 0.889344
| 30
| 244
| 6.533333
| 0.633333
| 0.153061
| 0.142857
| 0.204082
| 0.346939
| 0.346939
| 0.346939
| 0.346939
| 0
| 0
| 0
| 0.017391
| 0.057377
| 244
| 5
| 187
| 48.8
| 0.834783
| 0
| 0
| 0
| 0
| 0
| 0.139344
| 0.139344
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.25
| 0
| 0.25
| 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
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
39cf488b67a5b1e7312e55ca067c9bf0bfbe9c6e
| 156
|
py
|
Python
|
receives/pytest.py
|
felixsch/receives
|
0d149e3a24c0377ac60d502736299c9f4348244a
|
[
"MIT"
] | null | null | null |
receives/pytest.py
|
felixsch/receives
|
0d149e3a24c0377ac60d502736299c9f4348244a
|
[
"MIT"
] | null | null | null |
receives/pytest.py
|
felixsch/receives
|
0d149e3a24c0377ac60d502736299c9f4348244a
|
[
"MIT"
] | null | null | null |
import pytest
from receives.receiver import Receiver
@pytest.fixture
def receive():
receiver = Receiver()
yield receiver
receiver.finalize()
| 14.181818
| 38
| 0.730769
| 17
| 156
| 6.705882
| 0.588235
| 0.280702
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.192308
| 156
| 10
| 39
| 15.6
| 0.904762
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.142857
| false
| 0
| 0.285714
| 0
| 0.428571
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
39d67d232e49de41fe6fece39a3376037a1fe5cc
| 1,650
|
py
|
Python
|
simulator/card_defs.py
|
NewLordVile/alphasheep
|
2a86cf0009b686edafee8c80aa961d7075a5bd46
|
[
"MIT"
] | 8
|
2019-11-25T22:05:58.000Z
|
2022-01-19T23:48:39.000Z
|
simulator/card_defs.py
|
NewLordVile/alphasheep
|
2a86cf0009b686edafee8c80aa961d7075a5bd46
|
[
"MIT"
] | 5
|
2019-12-23T12:43:40.000Z
|
2020-03-19T19:16:46.000Z
|
simulator/card_defs.py
|
NewLordVile/alphasheep
|
2a86cf0009b686edafee8c80aa961d7075a5bd46
|
[
"MIT"
] | 4
|
2020-03-14T21:25:29.000Z
|
2022-01-27T22:59:31.000Z
|
"""
Definitions for Card, Suit, Pip, etc.
WARN: DO NOT CHANGE THE ENUMS IN THIS FILE!
Changing the values might affect the ordering of the state/action space of agents, and will break compatibility with previously
saved model checkpoints.
"""
from enum import IntEnum
class Suit(IntEnum):
schellen = 0
herz = 1
gras = 2
eichel = 3
def __str__(self):
return self.name
class Pip(IntEnum):
sieben = 1
acht = 2
neun = 3
unter = 4
ober = 5
koenig = 6
zehn = 7
sau = 8
def __str__(self):
return self.name
class Card:
def __init__(self, suit: Suit, pip: Pip):
self.suit = suit
self.pip = pip
# There are some performance problems doing enum lookups, apparently Python implements them in a bit of a convoluted way.
# We often use Card as a dict key, so this has turned out to be a bit problematic. It turns out to be much faster
# to just precalc a unique card ID instead of comparing suits and pips (Python 3.5).
self._unique_hash = hash(Card) * 23 + self.suit.value * 23 + self.pip.value
def __str__(self):
return "({} {})".format(self.suit.name, self.pip.name)
def __eq__(self, other):
return isinstance(other, Card) and self._unique_hash == other._unique_hash
def __hash__(self):
return self._unique_hash
pip_scores = {
Pip.sieben: 0,
Pip.acht: 0,
Pip.neun: 0,
Pip.unter: 2,
Pip.ober: 3,
Pip.koenig: 4,
Pip.zehn: 10,
Pip.sau: 11}
def new_deck():
""" Returns an ordered deck. """
return [Card(suit, pip) for suit in Suit for pip in Pip]
| 23.571429
| 129
| 0.633333
| 250
| 1,650
| 4.044
| 0.484
| 0.039565
| 0.029674
| 0.047478
| 0.057369
| 0.057369
| 0.057369
| 0
| 0
| 0
| 0
| 0.023411
| 0.275152
| 1,650
| 69
| 130
| 23.913043
| 0.821906
| 0.349697
| 0
| 0.121951
| 0
| 0
| 0.006623
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.170732
| false
| 0
| 0.02439
| 0.121951
| 0.707317
| 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
| 0
| 1
| 1
| 0
|
0
| 2
|
39ef2ca7f17378b96bb6865f18c59fdf8633759c
| 680
|
py
|
Python
|
src/nodeforge/StartEngine.py
|
nsk89/nodeforge
|
51e798092cfaf52112cfdc96af359633741da799
|
[
"BSD-3-Clause"
] | null | null | null |
src/nodeforge/StartEngine.py
|
nsk89/nodeforge
|
51e798092cfaf52112cfdc96af359633741da799
|
[
"BSD-3-Clause"
] | 1
|
2018-10-21T05:30:32.000Z
|
2018-10-31T05:53:18.000Z
|
src/nodeforge/StartEngine.py
|
nsk89/nodeforge
|
51e798092cfaf52112cfdc96af359633741da799
|
[
"BSD-3-Clause"
] | 2
|
2018-10-31T05:56:34.000Z
|
2018-10-31T05:57:36.000Z
|
"""
This file should be imported at the bottom of configure.py
TODO:
All of this may be moved into a single function in the future
so people can choose a reactor in configure.py
"""
from twisted.internet import reactor
from twisted.internet.task import LoopingCall
from threading import currentThread, Thread
# Check to see if main thread is alive
mainthread = currentThread()
def checkExit():
if not mainthread.isAlive():
reactor.stop()
# Every second, make sure that the interface thread is alive.
LoopingCall(checkExit).start(1)
# start the network loop in a new thread
Thread(target=lambda : reactor.run(installSignalHandlers=0)).start()
| 29.565217
| 68
| 0.744118
| 98
| 680
| 5.163265
| 0.653061
| 0.043478
| 0.075099
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.003617
| 0.186765
| 680
| 23
| 68
| 29.565217
| 0.911392
| 0.457353
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.043478
| 0
| 1
| 0.111111
| false
| 0
| 0.333333
| 0
| 0.444444
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 2
|
f2d47c8b76e7230c4405127adcd43ba0cfb587fd
| 2,386
|
py
|
Python
|
client/elementtype.py
|
Schille/weimar-graphstore
|
76b47f98fba419ec6290628b56a202c60d8f2d46
|
[
"MIT"
] | 2
|
2016-08-27T04:51:01.000Z
|
2020-09-05T01:34:41.000Z
|
client/elementtype.py
|
Schille/weimar-graphstore
|
76b47f98fba419ec6290628b56a202c60d8f2d46
|
[
"MIT"
] | null | null | null |
client/elementtype.py
|
Schille/weimar-graphstore
|
76b47f98fba419ec6290628b56a202c60d8f2d46
|
[
"MIT"
] | null | null | null |
"""
.. module:: elementtype.py
:platform: Linux
.. moduleauthor:: Michael Schilonka <[email protected]>
"""
import logging
class ElementType(object):
'''
The ElementType class is an in-memory representation of a graph element
type. It provides some functions to operate on all entities of the same type
and keeps the description of the structured attributes.
'''
def __init__(self, type_svr, type_name, graph_name):
self._type_svr = type_svr
self._typename = type_name
self._graphname = graph_name
def get_type_definition(self):
'''
Returns a dictionary comprising the structured attributes of
this graph element type.
Return:
The created type declaration (dict).
'''
return self._type_svr.get_type_definition(self._graphname, self._typename)
def get_type_name(self):
'''
Returns the type name of this object.
Return:
The type name (str).
'''
return self._typename
def count(self):
'''
Returns the number of graph elements associated with this type.
Return:
Count of related graph elements (int).
'''
return self._type_svr.count(self._graphname, self._typename)
#TDOD provide search method on these elements
class VertexType(ElementType, object):
'''
The VertexType.
'''
def __init__(self, type_svr, vertex_type, graph_name):
vertex_type = 'vertex:' + vertex_type
super(VertexType, self).__init__(type_svr, vertex_type, graph_name)
def get_vertices(self):
pass
def remove(self):
'''
Removes this element type and all associated elements.
'''
self._type_svr.remove(self._graphname, self._typename)
class EdgeType(ElementType, object):
'''
The EdgeType.
'''
def __init__(self, type_svr, edge_type, graph_name):
edge_type = 'edge:' + edge_type
super(EdgeType, self).__init__(type_svr, edge_type, graph_name)
def get_edges(self):
pass
def remove(self):
'''
Removes this element type and all associated elements.
'''
self._type_svr.remove(self._graphname, self._typename)
| 24.854167
| 82
| 0.60855
| 270
| 2,386
| 5.114815
| 0.292593
| 0.055757
| 0.063722
| 0.072411
| 0.267922
| 0.230268
| 0.157857
| 0.157857
| 0.157857
| 0.157857
| 0
| 0
| 0.30637
| 2,386
| 95
| 83
| 25.115789
| 0.834441
| 0.344091
| 0
| 0.214286
| 0
| 0
| 0.009181
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.357143
| false
| 0.071429
| 0.035714
| 0
| 0.607143
| 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
| 0
| 0
|
0
| 2
|
f2e440f4b6da4c3dc8c1545aee15d9066fc4d3f5
| 724
|
py
|
Python
|
codility-python/util/test_strings.py
|
mforoni/codility
|
be5005e96612dd7bb33b88bb76a590d28084b032
|
[
"MIT"
] | null | null | null |
codility-python/util/test_strings.py
|
mforoni/codility
|
be5005e96612dd7bb33b88bb76a590d28084b032
|
[
"MIT"
] | null | null | null |
codility-python/util/test_strings.py
|
mforoni/codility
|
be5005e96612dd7bb33b88bb76a590d28084b032
|
[
"MIT"
] | null | null | null |
import unittest
import util.strings as strings
class TestStrings(unittest.TestCase):
def test_first_index_of(self):
self.assertEqual(1, strings.first_index_of('1', "0103003004"))
self.assertEqual(20, strings.first_index_of('f', "post this text on a form"))
def test_last_index_of(self):
self.assertEqual(9, strings.last_index_of('1', "01030030014"))
self.assertEqual(20, strings.last_index_of('f', "post this text on a form"))
def test_indexes_of(self):
self.assertEqual([1, 9], strings.indexes_of('1', "01030030014"))
self.assertEqual([20, 30], strings.indexes_of('f', "post this text on a fantastic form"))
if __name__ == '__main__':
unittest.main()
| 31.478261
| 97
| 0.686464
| 103
| 724
| 4.572816
| 0.330097
| 0.089172
| 0.076433
| 0.133758
| 0.473461
| 0.314225
| 0.18259
| 0.144374
| 0.144374
| 0.144374
| 0
| 0.078727
| 0.175414
| 724
| 22
| 98
| 32.909091
| 0.710218
| 0
| 0
| 0
| 0
| 0
| 0.176796
| 0
| 0
| 0
| 0
| 0
| 0.428571
| 1
| 0.214286
| false
| 0
| 0.142857
| 0
| 0.428571
| 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
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
f2e72fd64f8c76f1c9fc74fe2d074f594b42d146
| 215
|
py
|
Python
|
src/output_module.py
|
abhishekpandeyIT/Virtual_Intelligent_Personal_Agent
|
786261fbcf1468bcbaee9f6d17aea3f3cc06f81e
|
[
"Apache-2.0"
] | null | null | null |
src/output_module.py
|
abhishekpandeyIT/Virtual_Intelligent_Personal_Agent
|
786261fbcf1468bcbaee9f6d17aea3f3cc06f81e
|
[
"Apache-2.0"
] | null | null | null |
src/output_module.py
|
abhishekpandeyIT/Virtual_Intelligent_Personal_Agent
|
786261fbcf1468bcbaee9f6d17aea3f3cc06f81e
|
[
"Apache-2.0"
] | null | null | null |
import assistantResume
from speak_module import speak
from database import speak_is_on
def output(o):
# For command line input
if speak_is_on():
speak(o)
print(assistantResume.name +": "+o+"\n")
| 23.888889
| 44
| 0.702326
| 31
| 215
| 4.709677
| 0.612903
| 0.150685
| 0.123288
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.2
| 215
| 9
| 44
| 23.888889
| 0.848837
| 0.102326
| 0
| 0
| 0
| 0
| 0.020833
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.142857
| false
| 0
| 0.428571
| 0
| 0.571429
| 0.142857
| 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
| 0
| 0
|
0
| 2
|
f2f2ed4004131258cff5093c7d766ecf35ed6781
| 848
|
py
|
Python
|
orders/migrations/0005_auto_20210619_0848.py
|
garrett-rh/Slice-of-a-Pizza
|
0e30e3a27b0e65e77cd52db1ef7db0470dea7a3f
|
[
"MIT"
] | 2
|
2020-05-15T10:20:13.000Z
|
2021-04-03T12:38:37.000Z
|
orders/migrations/0005_auto_20210619_0848.py
|
garrett-rh/Slice-of-a-Pizza
|
0e30e3a27b0e65e77cd52db1ef7db0470dea7a3f
|
[
"MIT"
] | 2
|
2020-05-15T10:39:42.000Z
|
2021-11-26T03:01:19.000Z
|
orders/migrations/0005_auto_20210619_0848.py
|
garrett-rh/Slice-of-a-Pizza
|
0e30e3a27b0e65e77cd52db1ef7db0470dea7a3f
|
[
"MIT"
] | 1
|
2021-11-12T12:10:57.000Z
|
2021-11-12T12:10:57.000Z
|
# Generated by Django 3.2.4 on 2021-06-19 08:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('orders', '0004_auto_20210619_0847'),
]
operations = [
migrations.AlterField(
model_name='dinner_platters',
name='Tops',
field=models.ManyToManyField(related_name='DPAddons', to='orders.Topping'),
),
migrations.AlterField(
model_name='regular_pizza',
name='toppings',
field=models.ManyToManyField(blank=True, related_name='rpAddons', to='orders.Topping'),
),
migrations.AlterField(
model_name='sicilian_pizza',
name='Tops',
field=models.ManyToManyField(blank=True, related_name='spAddons', to='orders.Topping'),
),
]
| 29.241379
| 99
| 0.604953
| 84
| 848
| 5.964286
| 0.547619
| 0.11976
| 0.149701
| 0.173653
| 0.443114
| 0.359281
| 0.359281
| 0
| 0
| 0
| 0
| 0.050162
| 0.271226
| 848
| 28
| 100
| 30.285714
| 0.760518
| 0.053066
| 0
| 0.363636
| 1
| 0
| 0.191011
| 0.028714
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.045455
| 0
| 0.181818
| 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
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
f2f8aa778931cc06d7071bcf8a708498a3154677
| 5,244
|
py
|
Python
|
cc_plugin_eustace/eustace_global_attrs.py
|
eustace-data/cc-plugin-eustace
|
4b44d287433b632ea6f859cd72d5dd4b8c361cee
|
[
"BSD-2-Clause"
] | null | null | null |
cc_plugin_eustace/eustace_global_attrs.py
|
eustace-data/cc-plugin-eustace
|
4b44d287433b632ea6f859cd72d5dd4b8c361cee
|
[
"BSD-2-Clause"
] | null | null | null |
cc_plugin_eustace/eustace_global_attrs.py
|
eustace-data/cc-plugin-eustace
|
4b44d287433b632ea6f859cd72d5dd4b8c361cee
|
[
"BSD-2-Clause"
] | null | null | null |
#!/usr/bin/env python
"""
cc_plugin_eustace.eustace_global_attrs
Compliance Test Suite: Check core global attributes in EUSTACE files
"""
import os
from netCDF4 import Dataset
# Import base objects from compliance checker
from compliance_checker.base import Result, BaseNCCheck, GenericFile
# Restrict which vocabs will load (for efficiency)
os.environ["ESSV_VOCABS_ACTIVE"] = "eustace-team"
# Import checklib
import checklib.register.nc_file_checks_register as check_package
class EUSTACEGlobalAttrsCheck(BaseNCCheck):
register_checker = True
name = 'eustace-global-attrs'
_cc_spec = 'eustace-global-attrs'
_cc_spec_version = '0.2'
supported_ds = [GenericFile, Dataset]
_cc_display_headers = {
3: 'Required',
2: 'Recommended',
1: 'Suggested'
}
def setup(self, ds):
pass
def check_cr01(self, ds):
return check_package.ValidGlobalAttrsMatchFileNameCheck(kwargs={'delimiter': '_', 'order': 'institution_id,realm,frequency', 'extension': '.nc'},
level="HIGH",
vocabulary_ref="eustace-team:eustace")(ds)
def check_cr02(self, ds):
return check_package.GlobalAttrRegexCheck(kwargs={'regex': 'CF-1\\.6', 'attribute': 'Conventions'},
level="HIGH",
vocabulary_ref="")(ds)
def check_cr03(self, ds):
return check_package.GlobalAttrRegexCheck(kwargs={'regex': '.{4,}', 'attribute': 'source'},
level="HIGH",
vocabulary_ref="")(ds)
def check_cr04(self, ds):
return check_package.GlobalAttrRegexCheck(kwargs={'regex': 'EUSTACE', 'attribute': 'project_id'},
level="HIGH",
vocabulary_ref="")(ds)
def check_cr05(self, ds):
return check_package.GlobalAttrRegexCheck(kwargs={'regex': '.{4,}', 'attribute': 'contact'},
level="HIGH",
vocabulary_ref="")(ds)
def check_cr06(self, ds):
return check_package.GlobalAttrRegexCheck(kwargs={'regex': '.{4,}', 'attribute': 'history'},
level="MEDIUM",
vocabulary_ref="")(ds)
def check_cr07(self, ds):
return check_package.GlobalAttrRegexCheck(kwargs={'regex': '.{4,}', 'attribute': 'references'},
level="MEDIUM",
vocabulary_ref="")(ds)
def check_cr08(self, ds):
return check_package.GlobalAttrRegexCheck(kwargs={'regex': '.{1,}', 'attribute': 'product_version'},
level="HIGH",
vocabulary_ref="")(ds)
def check_cr09(self, ds):
return check_package.GlobalAttrRegexCheck(kwargs={'regex': '.{4,}', 'attribute': 'title'},
level="HIGH",
vocabulary_ref="")(ds)
def check_cr10(self, ds):
return check_package.GlobalAttrRegexCheck(kwargs={'regex': '.{20,}', 'attribute': 'summary'},
level="HIGH",
vocabulary_ref="")(ds)
def check_cr11(self, ds):
return check_package.GlobalAttrRegexCheck(kwargs={'regex': '.{4,}', 'attribute': 'creator_name'},
level="HIGH",
vocabulary_ref="")(ds)
def check_cr12(self, ds):
return check_package.GlobalAttrRegexCheck(kwargs={'regex': '.+@.+\\..+', 'attribute': 'creator_email'},
level="HIGH",
vocabulary_ref="")(ds)
def check_cr13(self, ds):
return check_package.GlobalAttrVocabCheck(kwargs={'attribute': 'frequency', 'vocab_lookup': 'canonical_name'},
level="LOW",
vocabulary_ref="eustace-team:eustace")(ds)
def check_cr14(self, ds):
return check_package.GlobalAttrVocabCheck(kwargs={'attribute': 'institution_id', 'vocab_lookup': 'canonical_name'},
level="HIGH",
vocabulary_ref="eustace-team:eustace")(ds)
def check_cr15(self, ds):
return check_package.GlobalAttrRegexCheck(kwargs={'regex': '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.*', 'attribute': 'creation_date'},
level="MEDIUM",
vocabulary_ref="")(ds)
| 46.821429
| 153
| 0.474256
| 425
| 5,244
| 5.668235
| 0.291765
| 0.079701
| 0.07472
| 0.105853
| 0.618514
| 0.554172
| 0.554172
| 0.406393
| 0.203404
| 0.203404
| 0
| 0.017014
| 0.405988
| 5,244
| 111
| 154
| 47.243243
| 0.75634
| 0.045385
| 0
| 0.371795
| 0
| 0.012821
| 0.153954
| 0.014615
| 0
| 0
| 0
| 0
| 0
| 1
| 0.205128
| false
| 0.012821
| 0.051282
| 0.192308
| 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
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 2
|
f2fc68a089e1541439b963f873f1136d0c533af5
| 705
|
py
|
Python
|
final_project/machinetranslation/tests/tests.py
|
NicoFRizzo/xzceb-flask_eng_fr
|
71c8a4c970e7a179f496ff0960d5fae2bba0ffc1
|
[
"Apache-2.0"
] | null | null | null |
final_project/machinetranslation/tests/tests.py
|
NicoFRizzo/xzceb-flask_eng_fr
|
71c8a4c970e7a179f496ff0960d5fae2bba0ffc1
|
[
"Apache-2.0"
] | null | null | null |
final_project/machinetranslation/tests/tests.py
|
NicoFRizzo/xzceb-flask_eng_fr
|
71c8a4c970e7a179f496ff0960d5fae2bba0ffc1
|
[
"Apache-2.0"
] | null | null | null |
import unittest
import translator
class TestTranslator(unittest.TestCase):
def test_one_e2f(self):
respopnse = translator.english_to_french('IBM Translator')
self.assertEqual(respopnse, 'Traducteur IBM')
def test_un_f2e(self):
respopnse = translator.french_to_english('Traducteur IBM')
self.assertEqual(respopnse, 'IBM Translator')
def test_hello_2f(self):
respopnse = translator.english_to_french('Hello')
self.assertEqual(respopnse, 'Bonjour')
def test_bonjour_2e(self):
respopnse = translator.french_to_english('Bonjour')
self.assertEqual(respopnse, 'Hello')
if __name__ == "__main__":
unittest.main()
| 32.045455
| 66
| 0.695035
| 77
| 705
| 6.051948
| 0.350649
| 0.060086
| 0.197425
| 0.128755
| 0.32618
| 0.32618
| 0
| 0
| 0
| 0
| 0
| 0.007117
| 0.202837
| 705
| 22
| 67
| 32.045455
| 0.822064
| 0
| 0
| 0
| 0
| 0
| 0.124646
| 0
| 0
| 0
| 0
| 0
| 0.235294
| 1
| 0.235294
| false
| 0
| 0.117647
| 0
| 0.411765
| 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
| 0
| 0
|
0
| 2
|
840025939ea1c2adbcc0cc3524f18c7230eb6fad
| 374
|
py
|
Python
|
exercicios-python/ex031.py
|
anavesilva/python-introduction
|
d85fb9381e348262584fd2942e4818ee822adbe5
|
[
"MIT"
] | null | null | null |
exercicios-python/ex031.py
|
anavesilva/python-introduction
|
d85fb9381e348262584fd2942e4818ee822adbe5
|
[
"MIT"
] | null | null | null |
exercicios-python/ex031.py
|
anavesilva/python-introduction
|
d85fb9381e348262584fd2942e4818ee822adbe5
|
[
"MIT"
] | null | null | null |
# Custo da viagem
distancia = float(input('Qual a distância da sua viagem? '))
valor1 = distancia * 0.5
valor2 = distancia * 0.45
print('Você está prestes a começar uma viagem de {}Km/h.'.format(distancia))
if distancia <= 200:
print('O preço de sua passagem será de R${:.2f}.'.format(valor1))
else:
print('O preço de sua passagem será de R${:.2f}.'.format(valor2))
| 37.4
| 76
| 0.687166
| 61
| 374
| 4.213115
| 0.557377
| 0.077821
| 0.085603
| 0.101167
| 0.303502
| 0.303502
| 0.303502
| 0.303502
| 0.303502
| 0.303502
| 0
| 0.044728
| 0.163102
| 374
| 9
| 77
| 41.555556
| 0.776358
| 0.040107
| 0
| 0
| 0
| 0
| 0.456583
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.25
| 0
| 0
| 0
| 0.375
| 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
| 1
| 0
| 0
| 0
| 0
|
0
| 2
|
840d5087c07149f28ccd99ef85cfdb7e07ab4198
| 1,005
|
py
|
Python
|
src/deterministicpasswordgenerator/compile.py
|
jelford/deterministic-password-generator
|
ad839a2e0d82e1742227a686c248d2ad03ef2fc1
|
[
"MIT"
] | 1
|
2016-08-22T22:48:50.000Z
|
2016-08-22T22:48:50.000Z
|
src/deterministicpasswordgenerator/compile.py
|
jelford/deterministic-password-generator
|
ad839a2e0d82e1742227a686c248d2ad03ef2fc1
|
[
"MIT"
] | null | null | null |
src/deterministicpasswordgenerator/compile.py
|
jelford/deterministic-password-generator
|
ad839a2e0d82e1742227a686c248d2ad03ef2fc1
|
[
"MIT"
] | null | null | null |
import zipfile
from getpass import getpass
import os
import stat
import tempfile
from os import path
from .crypto import encrypt
def compile_ruleset(ruleset_path, ruleset_encryption_password=None, output_path=None):
output_path = output_path or os.getcwd()
ruleset_encryption_password = ruleset_encryption_password or getpass('Password (used to encrypt compiled ruleset):')
ruleset_name = path.basename(ruleset_path)
with tempfile.SpooledTemporaryFile() as output_ruleset:
with zipfile.PyZipFile(output_ruleset, mode='w') as ruleset:
ruleset.writepy(pathname=ruleset_path)
output_ruleset.seek(0)
encrypted_output = encrypt(output_ruleset.read(), key=ruleset_encryption_password)
compiled_ruleset_output_path = path.join(output_path, '{ruleset}.dpgr'.format(ruleset=ruleset_name))
with open(compiled_ruleset_output_path, 'wb') as output:
os.chmod(compiled_ruleset_output_path, stat.S_IREAD)
output.write(encrypted_output)
| 34.655172
| 120
| 0.769154
| 129
| 1,005
| 5.728682
| 0.356589
| 0.094723
| 0.135318
| 0.101489
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.001174
| 0.152239
| 1,005
| 28
| 121
| 35.892857
| 0.866197
| 0
| 0
| 0
| 0
| 0
| 0.060697
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.05
| false
| 0.2
| 0.35
| 0
| 0.4
| 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
| 0
| 0
|
0
| 2
|
8412473069d247b24941bba95ee50eaf3af4a33f
| 521
|
py
|
Python
|
tests/forked/test_update.py
|
rarity-adventure/rarity-names
|
e940b8bea296823faf003ecb9ab8735820ff54d1
|
[
"MIT"
] | null | null | null |
tests/forked/test_update.py
|
rarity-adventure/rarity-names
|
e940b8bea296823faf003ecb9ab8735820ff54d1
|
[
"MIT"
] | null | null | null |
tests/forked/test_update.py
|
rarity-adventure/rarity-names
|
e940b8bea296823faf003ecb9ab8735820ff54d1
|
[
"MIT"
] | 2
|
2021-09-22T01:34:17.000Z
|
2022-02-09T06:04:51.000Z
|
import brownie
def test_update(n1, barb, barb2, owner):
tx = n1.update_capitalization(1, "coNan", {'from': owner})
assert tx.events["NameUpdated"].values() == (1, "Conan", "coNan")
assert n1.summoner_name(1) == "coNan"
def test_update_fails(n1, barb, barb2, owner, accounts):
with brownie.reverts("!owner or approved name"):
n1.update_capitalization(1, "coNan", {'from': accounts[5]})
with brownie.reverts("name different"):
n1.update_capitalization(1, "Conan1", {'from': owner})
| 32.5625
| 69
| 0.662188
| 67
| 521
| 5.044776
| 0.432836
| 0.071006
| 0.195266
| 0.204142
| 0.189349
| 0.189349
| 0
| 0
| 0
| 0
| 0
| 0.034483
| 0.165067
| 521
| 16
| 70
| 32.5625
| 0.742529
| 0
| 0
| 0
| 0
| 0
| 0.17433
| 0
| 0
| 0
| 0
| 0
| 0.2
| 1
| 0.2
| false
| 0
| 0.1
| 0
| 0.3
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 2
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.