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
6ccb856d1e3f4a1865f3be09e3538cbf927298dd
3,130
py
Python
utils/mpl.py
dlzcn/MemoryMonitor
863ef0c82917128c94575931661c7e666d56e20c
[ "MIT" ]
null
null
null
utils/mpl.py
dlzcn/MemoryMonitor
863ef0c82917128c94575931661c7e666d56e20c
[ "MIT" ]
null
null
null
utils/mpl.py
dlzcn/MemoryMonitor
863ef0c82917128c94575931661c7e666d56e20c
[ "MIT" ]
null
null
null
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # ****************************************************** # @author: Haifeng CHEN - optical.dlz@gmail.com # @date (created): 2019-10-22 21:27 # @file: mpl.py # @brief: Matplotlib utilities # @internal: # revision: 2 # last modified: 2019-10-25 10:49:40 # ***************************************************** import sys import matplotlib.pyplot as plt def mpl_setup_cjk_font(): """ update matplotlib sans-serif font list for CJK """ import locale country_or_region, _ = locale.getdefaultlocale() if sys.platform == 'win32': if country_or_region == 'zh_CN': plt.rcParams['font.sans-serif'].insert(0, 'Microsoft YaHei') elif country_or_region == 'zh_TW': plt.rcParams['font.sans-serif'].insert(0, 'Microsoft JhengHei') elif country_or_region == 'jp_JP': plt.rcParams['font.sans-serif'].insert(0, 'Meiryo') elif country_or_region == 'ko_KR': plt.rcParams['font.sans-serif'].insert(0, 'Malgun Gothic') else: plt.rcParams['font.sans-serif'] = \ ['Microsoft YaHei', 'Microsoft JhengHei', 'Meiryo', 'Malgun Gothic', 'Lucida Sans Unicode'] \ + plt.rcParams['font.sans-serif'] elif sys.platform == 'darwin': if country_or_region == 'zh_CN': plt.rcParams['font.sans-serif'].insert(0, 'PingFang SC') elif country_or_region == 'zh_TW': plt.rcParams['font.sans-serif'].insert(0, 'PingFang TC') elif country_or_region == 'jp_JP': plt.rcParams['font.sans-serif'].insert(0, 'Hiragino Sans') elif country_or_region == 'ko_KR': plt.rcParams['font.sans-serif'].insert(0, 'Apple SD Gothic Neo') else: plt.rcParams['font.sans-serif'] = \ ['PingFang SC', 'PingFang TC', 'PingFang HK', 'Hiragino Sans', 'Apple SD Gothic Neo', 'Source Han Sans', 'Noto Sans CJK'] \ + plt.rcParams['font.sans-serif'] else: if country_or_region == 'zh_CN': plt.rcParams['font.sans-serif'] = ['Source Han Sans CN', 'Noto Sans CJK'] + plt.rcParams['font.sans-serif'] elif country_or_region == 'zh_TW': plt.rcParams['font.sans-serif'] = ['Source Han Sans TW', 'Noto Sans CJK'] + plt.rcParams['font.sans-serif'] elif country_or_region == 'jp_JP': plt.rcParams['font.sans-serif'] = ['Source Han Sans JP', 'Noto Sans CJK'] + plt.rcParams['font.sans-serif'] # plt.rcParams['font.sans-serif'] = ['TakaoGothic', 'TakaoPGothic', 'Droid Sans Japanese'] + # plt.rcParams['font.sans-serif'] elif country_or_region == 'ko_KR': plt.rcParams['font.sans-serif'] = ['Source Han Sans KR', 'Noto Sans CJK'] + plt.rcParams['font.sans-serif'] else: plt.rcParams['font.sans-serif'] = ['Droid Sans Fallback', 'Source Han Sans', 'Noto Sans CJK'] + \ plt.rcParams['font.sans-serif'] plt.rcParams['axes.unicode_minus'] = False
48.90625
120
0.563578
378
3,130
4.55291
0.253968
0.130738
0.209181
0.264962
0.645555
0.638001
0.575247
0.575247
0.525276
0.486345
0
0.016638
0.251118
3,130
63
121
49.68254
0.717577
0.17508
0
0.444444
0
0
0.335544
0
0
0
0
0
0
1
0.022222
true
0
0.066667
0
0.088889
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
3
6cea4653ce149c498758ae8e65d871bbb3bdd1fb
611
py
Python
cipher_encoder_ASCII.py
rohanailoni/cipher
59baed56b95e47ea75e5f95eb26ab9ae2977da33
[ "MIT" ]
3
2020-02-23T13:02:50.000Z
2020-02-25T16:54:39.000Z
cipher_encoder_ASCII.py
rohanailoni/cipher
59baed56b95e47ea75e5f95eb26ab9ae2977da33
[ "MIT" ]
null
null
null
cipher_encoder_ASCII.py
rohanailoni/cipher
59baed56b95e47ea75e5f95eb26ab9ae2977da33
[ "MIT" ]
null
null
null
s=input(); k=int(input()) for i in s: elif ord(i)>=97 and ord(i)<=122: y=k%26;x=ord(i)-96; if x+y>26: print(chr(y-(26-x)+96),end="") else: print(chr(x+y+96),end="") elif ord(i)>=65 and ord(i)<=90: y = k % 26;x=ord(i)-64; if x+y>26: print(chr(y-(26-x)+64),end="") else: print(chr(x+y+64),end="") elif ord(i)>=48 and ord(i)<=57: y=k%10;x=ord(i)-47; if x+y>10: print(chr(y-(10-x)+47),end="") else: print(chr(x+y+47),end="") else: print(i,end="")
25.458333
42
0.412439
112
611
2.25
0.25
0.142857
0.190476
0.178571
0.416667
0.416667
0.142857
0.142857
0.142857
0
0
0.122195
0.343699
611
23
43
26.565217
0.506234
0
0
0.26087
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0.304348
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
1
0
0
0
0
0
0
0
0
3
6ceaf7d47274756db993bf275859c1ba52925e2f
494
py
Python
datasets/KITTI/segtrack/KITTI_MOTS_info.py
DesperateMaker/TrackR-CNN
861b697c4448aac57265d4a6866bd2a0e8b2c6e5
[ "MIT" ]
null
null
null
datasets/KITTI/segtrack/KITTI_MOTS_info.py
DesperateMaker/TrackR-CNN
861b697c4448aac57265d4a6866bd2a0e8b2c6e5
[ "MIT" ]
null
null
null
datasets/KITTI/segtrack/KITTI_MOTS_info.py
DesperateMaker/TrackR-CNN
861b697c4448aac57265d4a6866bd2a0e8b2c6e5
[ "MIT" ]
1
2020-03-17T19:18:21.000Z
2020-03-17T19:18:21.000Z
SEQ_IDS_TRAIN = ["%04d" % idx for idx in [0, 1, 3, 4, 5, 9, 11, 12, 15, 17, 19, 20]] SEQ_IDS_VAL = ["%04d" % idx for idx in [2, 6, 7, 8, 10, 13, 14, 16, 18]] TIMESTEPS_PER_SEQ = {"0000": 154, "0001": 447, "0002": 233, "0003": 144, "0004": 314, "0005": 297, "0006": 270, "0007": 800, "0008": 390, "0009": 803, "0010": 294, "0011": 373, "0012": 78, "0013": 340, "0014": 106, "0015": 376, "0016": 209, "0017": 145, "0018": 339, "0019": 1059, "0020": 837}
82.333333
112
0.502024
82
494
2.95122
0.890244
0.049587
0.07438
0.099174
0.115702
0
0
0
0
0
0
0.493261
0.248988
494
5
113
98.8
0.15903
0
0
0
0
0
0.186235
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
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
6cf8a1638dc4ca98d75efa8c572eb39e9d8d051f
168
py
Python
src/runanalysis.py
techlover10/StochasticSoundscape
6c86a3e5d671c657361ff8e1e78edc710af40c77
[ "MIT" ]
2
2017-05-02T10:40:43.000Z
2017-06-29T09:38:54.000Z
src/runanalysis.py
techlover10/StochasticSoundscape
6c86a3e5d671c657361ff8e1e78edc710af40c77
[ "MIT" ]
null
null
null
src/runanalysis.py
techlover10/StochasticSoundscape
6c86a3e5d671c657361ff8e1e78edc710af40c77
[ "MIT" ]
null
null
null
#!/usr/bin/python3 # # Copyright © 2017 jared <jared@jared-devstation> # # Generates data based on source material import analyze markov_data = analyze.data_gen()
12.923077
49
0.738095
23
168
5.347826
0.782609
0.162602
0
0
0
0
0
0
0
0
0
0.035211
0.154762
168
12
50
14
0.823944
0.625
0
0
1
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
1
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
6cf96920584f4c7107ab05ce65237ae262fac812
200
py
Python
data_collection/gazette/spiders/sc_otacilio_costa.py
Jefersonalves/diario-oficial
9a4bdfe2e31414c993d88831a67160c49a5ee657
[ "MIT" ]
3
2021-08-18T17:50:31.000Z
2021-11-12T23:36:33.000Z
data_collection/gazette/spiders/sc_otacilio_costa.py
Jefersonalves/diario-oficial
9a4bdfe2e31414c993d88831a67160c49a5ee657
[ "MIT" ]
4
2021-02-10T02:36:48.000Z
2022-03-02T14:55:34.000Z
data_collection/gazette/spiders/sc_otacilio_costa.py
Jefersonalves/diario-oficial
9a4bdfe2e31414c993d88831a67160c49a5ee657
[ "MIT" ]
null
null
null
from gazette.spiders.base import FecamGazetteSpider class ScOtacilioCostaSpider(FecamGazetteSpider): name = "sc_otacilio_costa" FECAM_QUERY = "cod_entidade:180" TERRITORY_ID = "4211751"
25
51
0.78
21
200
7.190476
0.952381
0
0
0
0
0
0
0
0
0
0
0.05848
0.145
200
7
52
28.571429
0.824561
0
0
0
0
0
0.2
0
0
0
0
0
0
1
0
false
0
0.2
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
3
6cfcedada186be7e3861a66132ec8a897e608837
180
py
Python
gluon/packages/dal/pydal/__init__.py
guadaltech/web2py-ruben
45e0f4f316774e707a3075f23e3f8b9fed00c387
[ "BSD-3-Clause" ]
null
null
null
gluon/packages/dal/pydal/__init__.py
guadaltech/web2py-ruben
45e0f4f316774e707a3075f23e3f8b9fed00c387
[ "BSD-3-Clause" ]
null
null
null
gluon/packages/dal/pydal/__init__.py
guadaltech/web2py-ruben
45e0f4f316774e707a3075f23e3f8b9fed00c387
[ "BSD-3-Clause" ]
null
null
null
__version__ = '17.11' from .base import DAL from .objects import Field from .helpers.classes import SQLCustomType from .helpers.methods import geoPoint, geoLine, geoPolygon
25.714286
59
0.777778
23
180
5.913043
0.695652
0.161765
0
0
0
0
0
0
0
0
0
0.026316
0.155556
180
6
60
30
0.868421
0
0
0
0
0
0.028736
0
0
0
0
0
0
1
0
false
0
0.8
0
0.8
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
9f11e57396b78a9599a9ab2485f5ab7774dae8f3
1,026
py
Python
elicit/all.py
pycopia/elicit
132eb9198b7dd7fc445567d9e98910f466b72fbc
[ "Apache-2.0" ]
3
2017-06-10T13:27:50.000Z
2020-03-19T19:28:26.000Z
elicit/all.py
pycopia/elicit
132eb9198b7dd7fc445567d9e98910f466b72fbc
[ "Apache-2.0" ]
1
2019-01-10T19:15:57.000Z
2019-01-10T19:15:57.000Z
elicit/all.py
kdart/elicit
132eb9198b7dd7fc445567d9e98910f466b72fbc
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python3 # 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. """ Import all important modules here for convenience. Use like: from elicit.all import * This will pull all necessary objects into your script. """ from elicit.commands import * # noqa from elicit.console import * # noqa from elicit.controller import * # noqa from elicit.env import * # noqa from elicit.parser import * # noqa from elicit.themes import * # noqa from elicit.ui import * # noqa # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
30.176471
74
0.746589
156
1,026
4.910256
0.596154
0.104439
0.109661
0.156658
0
0
0
0
0
0
0
0.009467
0.176413
1,026
33
75
31.090909
0.897041
0.753411
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
3
9f3169c25b4b95c77a42d2fd7ae104ae75bfa518
480
py
Python
app/forms.py
EddyCodeIt/SPA_Project_2016_Data_Rep-Quering
1a23e14ecf41117aaaeedb277d6c5b17a03bab56
[ "Apache-2.0" ]
null
null
null
app/forms.py
EddyCodeIt/SPA_Project_2016_Data_Rep-Quering
1a23e14ecf41117aaaeedb277d6c5b17a03bab56
[ "Apache-2.0" ]
null
null
null
app/forms.py
EddyCodeIt/SPA_Project_2016_Data_Rep-Quering
1a23e14ecf41117aaaeedb277d6c5b17a03bab56
[ "Apache-2.0" ]
null
null
null
#from flask_wtf import FlaskForm from wtforms import Form, StringField, PasswordField, validators class RegistrationForm(Form): username = StringField('Username', [validators.Length(min = 4, max = 20), validators.Required()], id = "input_fields") password = PasswordField('New Password', [validators.DataRequired(), validators.EqualTo('confirm', message = "Passwords must match")], id = "input_fields") confirm = PasswordField('Repeat Password', id = "input_fields")
60
159
0.74375
52
480
6.788462
0.615385
0.05949
0.110482
0
0
0
0
0
0
0
0
0.007143
0.125
480
7
160
68.571429
0.833333
0.064583
0
0
0
0
0.21875
0
0
0
0
0
0
1
0
false
0.6
0.2
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
3
9f6530563c3eccbd2034ac0c73cb87871d851924
467
py
Python
start_pylogo_GUI_interpreter.py
obo/loev3go
763c6cf61133add914d231d07bc8c3c29672aba9
[ "MIT" ]
1
2018-09-05T20:57:40.000Z
2018-09-05T20:57:40.000Z
start_pylogo_GUI_interpreter.py
obo/loev3go
763c6cf61133add914d231d07bc8c3c29672aba9
[ "MIT" ]
null
null
null
start_pylogo_GUI_interpreter.py
obo/loev3go
763c6cf61133add914d231d07bc8c3c29672aba9
[ "MIT" ]
2
2019-10-05T23:02:41.000Z
2020-06-25T20:21:02.000Z
#!/usr/bin/python # # BROKEN # This script should run the traditional pylogo user inferface. # It worked well while pylogo was in python2 and relying on python mega widgets # (Pmw) version 1.3. Pmw1.3 is for python2 only and I don't have the time to # try getting Pmw2 running (https://pypi.org/project/Pmw/) # # remember that PYTHONPATH must include two directories: # export PYTHONPATH=$PYTHONPATH:$(pwd):$(pwd)/Pmw.1.3 import pylogo.script pylogo.script.main()
33.357143
79
0.747323
75
467
4.653333
0.773333
0.011461
0
0
0
0
0
0
0
0
0
0.022613
0.147752
467
13
80
35.923077
0.854271
0.865096
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
3
9f75ffc9ee2d54982d194078b82ecf06638479b8
61
py
Python
audiotest.py
DeadpoolPancakes/lego-claptrap
fde1359288d0f554f4f36e08e716d1f9754e7c0e
[ "MIT" ]
null
null
null
audiotest.py
DeadpoolPancakes/lego-claptrap
fde1359288d0f554f4f36e08e716d1f9754e7c0e
[ "MIT" ]
null
null
null
audiotest.py
DeadpoolPancakes/lego-claptrap
fde1359288d0f554f4f36e08e716d1f9754e7c0e
[ "MIT" ]
null
null
null
import vlc p = vlc.MediaPlayer("file: Chirping.mp3") p.play()
20.333333
41
0.721311
10
61
4.4
0.8
0
0
0
0
0
0
0
0
0
0
0.018182
0.098361
61
3
42
20.333333
0.781818
0
0
0
0
0
0.290323
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
9f8d02f1cbdcab45e866434955bba41b200ffdf4
977
py
Python
psq/storage.py
Tomesco/bookshelf-demo-project
9d422f3aa04edbb3312d3e177caf699653ed6a73
[ "Apache-2.0" ]
210
2015-07-29T16:50:01.000Z
2022-03-02T15:24:52.000Z
psq/storage.py
Tomesco/bookshelf-demo-project
9d422f3aa04edbb3312d3e177caf699653ed6a73
[ "Apache-2.0" ]
60
2015-12-03T23:15:57.000Z
2021-01-21T09:25:42.000Z
psq/storage.py
Tomesco/bookshelf-demo-project
9d422f3aa04edbb3312d3e177caf699653ed6a73
[ "Apache-2.0" ]
47
2015-12-21T06:09:36.000Z
2021-09-04T13:20:21.000Z
# Copyright 2015 Google Inc. # # 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. class Storage(object): """ Storage implements task persistence. PSQ doesn't require any actual storage, but you can not get the return value of a task without it. This base class does not store any data and just stubs out the methods. """ def get_task(self, task_id): pass def put_task(self, task): pass def delete_task(self, task_id): pass
31.516129
75
0.716479
151
977
4.602649
0.622517
0.086331
0.051799
0.046043
0.051799
0
0
0
0
0
0
0.010471
0.218014
977
30
76
32.566667
0.899215
0.774821
0
0.428571
0
0
0
0
0
0
0
0
0
1
0.428571
false
0.428571
0
0
0.571429
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
3
9f93c98abb0b91b0a7fddf973c3d2b81cec9e629
671
py
Python
djangobb_forum/decorators.py
dboczek/DjangoBB
80c42274839714f0cc6c4529ba1b44ae5e4e03c1
[ "BSD-3-Clause" ]
null
null
null
djangobb_forum/decorators.py
dboczek/DjangoBB
80c42274839714f0cc6c4529ba1b44ae5e4e03c1
[ "BSD-3-Clause" ]
null
null
null
djangobb_forum/decorators.py
dboczek/DjangoBB
80c42274839714f0cc6c4529ba1b44ae5e4e03c1
[ "BSD-3-Clause" ]
null
null
null
from django.utils.decorators import available_attrs from functools import wraps def require_unbanned_user(view_func): """ Marks view function to be checked by Ban middleware """ def wrapped_view(*args, **kwargs): return view_func(*args, **kwargs) wrapped_view._unbanned_user_requirement = True return wraps(view_func, assigned=available_attrs(view_func))(wrapped_view)
44.733333
172
0.450075
53
671
5.433962
0.566038
0.111111
0
0
0
0
0
0
0
0
0
0
0.499255
671
14
173
47.928571
0.857143
0.076006
0
0
0
0
0
0
0
0
0
0
0
1
0.285714
false
0
0.285714
0.142857
0.857143
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
9fae4767c50f4f35b038b3946366e439d2f826d9
5,616
py
Python
scripts/signin.py
bhrt96/e-Learning-Portal
5ca4d7cc355999ddfcb2cfff18d9832d555cc081
[ "MIT" ]
null
null
null
scripts/signin.py
bhrt96/e-Learning-Portal
5ca4d7cc355999ddfcb2cfff18d9832d555cc081
[ "MIT" ]
null
null
null
scripts/signin.py
bhrt96/e-Learning-Portal
5ca4d7cc355999ddfcb2cfff18d9832d555cc081
[ "MIT" ]
null
null
null
#!/usr/bin/python import cgi import MySQLdb import Cookie import datetime import random cookie = Cookie.SimpleCookie() cookie["session"] = random.randint(1,1000000) expires = datetime.datetime.now() + datetime.timedelta(days=1) cookie["session"]["expires"] = expires.strftime('%a, %d %b %Y %H:%M:%S') # Wdy, DD-Mon-YY HH:MM:SS GMT print cookie print "Content-type:text/html\r\n\r\n" # print '<html>' # print '<body>' # print """<form name="form1" method="POST" action="\cgi-bin\scripts\signin.py"> # Username: <input type="text" name="username" id="username" required><br><br> # Password: <input type="password" name="password" id="password" required><br><br> # <input type="radio" name="sel" value="student">student # <input type="radio" name="sel" value="teacher">teacher # <br><br> # <input type="submit" value="Sign-In" > # </form>""" print r""" <!doctype html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel = "stylesheet" href = "/css/materialize.css" /> <script src = "/js/jquery-1.12.2.js"></script> <script src = "/js/materialize.js"></script> </head> <body background="/elearning/books2.jpg" class ="" > <div class = "row " style="padding-top:8%"> <div class = "row"> <div class = "card-panel col s4 offset-s1 " > <div class = "row"> <form class = "col s12" action = "\cgi-bin\scripts\signin.py" method = "post"> <div class="row"> <div class = "center-align"> <h4><a >Log In</a></h4> </div> <div class="input-field col s6"> <p> <input class="with-gap" name="sel" type="radio" value="teacher" id="teacher" checked/> <label for="teacher">Teacher</label> </p> </div> <div class="input-field col s6"> <p> <input class="with-gap" name="sel" type="radio" value="student" id="student" /> <label for="student" >Student</label> </p> </div> </div> <div class = "row"> <div class = "input-field col s12 "> <input name = "username" id = "username" type = "text" required> <label for="username">Username</label> </div> <div class = "input-field col s12 "> <input name = "password" id = "password" type = "password" required> <label for="password">Password</label> </div> </div> <div class = "row"> <button class="btn waves-effect waves-light" type="submit" > Submit </button> </div> </form> <div class="row right"> <a class="blue-text" href="/cgi-bin/scripts/register.py">New user? Click here to register</a> <div> </div> </div> </div> </div>""" form=cgi.FieldStorage() username =form.getvalue('username') password =form.getvalue('password') sel = form.getvalue('sel') db = MySQLdb.connect('localhost','root','1315','quiz', unix_socket="/opt/lampp/var/mysql/mysql.sock") cur=db.cursor() cur.execute("""delete from session where sessionId= '%s'"""% cookie["session"].value) db.commit() try: if sel=='student': sql="select * from studentRegister" cur.execute(sql) var=cur.fetchall() for var2 in var: if var2[2] == password and var2[1]==username: cookie["username"]= username cookie["password"]= password cur.execute("""delete from session where username = %s""" , cookie["username"].value) cur.execute("""insert into session values (%s, %s)""", (cookie["session"].value,cookie["username"].value)) print "<script>window.location.assign('/cgi-bin/scripts/choosesubject.py');</script>" break else : print "<script>window.alert('Invalid credentials');</script>" elif sel=='teacher': sql="select * from teacherRegister" cur.execute(sql) var=cur.fetchall() for var2 in var: if var2[2] == password and var2[1]==username: sql="""select subject from teacher as t join teacherRegister as tr on t.TeacherId=tr.TeacherId where tr.username=%s""" % username cookie["username"]=username cookie["password"]= password cur.execute("""delete from session where username = %s""" , cookie["username"].value) cur.execute("""insert into session values (%s, %s)""", (cookie["session"].value,cookie["username"].value)) print "<script>window.location.assign('/cgi-bin/scripts/teacher.py');</script>" break else : print "<script>window.alert('Invalid credentials');</script>" db.commit() db.close() except: print"<h1>Error</h1>" print '</body>' print '</html>'
39.272727
145
0.497863
589
5,616
4.745331
0.312394
0.037209
0.027549
0.02576
0.401789
0.376029
0.325581
0.325581
0.301968
0.301968
0
0.012265
0.346688
5,616
142
146
39.549296
0.749523
0.085648
0
0.436364
0
0.072727
0.696662
0.129612
0
0
0
0
0
0
null
null
0.063636
0.045455
null
null
0.090909
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
1
0
0
1
0
0
0
0
0
3
9fc445c6165c6d787145e2412f48a99144d7b211
162
py
Python
mobycity/contact/urls.py
LucienD/Mobct
1c8422b30c205bdb2dc21c988f74280194980ec4
[ "MIT" ]
null
null
null
mobycity/contact/urls.py
LucienD/Mobct
1c8422b30c205bdb2dc21c988f74280194980ec4
[ "MIT" ]
null
null
null
mobycity/contact/urls.py
LucienD/Mobct
1c8422b30c205bdb2dc21c988f74280194980ec4
[ "MIT" ]
null
null
null
from django.conf.urls import patterns, url from contact import views urlpatterns = patterns( '', url(r'^$', views.contact_form, name='contact_form'), )
18
56
0.697531
21
162
5.285714
0.619048
0.198198
0
0
0
0
0
0
0
0
0
0
0.166667
162
9
57
18
0.822222
0
0
0
0
0
0.08589
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
4c7cf06f6615026f91a04b38e7f6379eff09c2c5
1,962
py
Python
backpack/core/derivatives/batchnorm2d.py
maryamhgf/backpack
63d2717656df2e0f18b3b6ee50320e82ce7358b6
[ "MIT" ]
null
null
null
backpack/core/derivatives/batchnorm2d.py
maryamhgf/backpack
63d2717656df2e0f18b3b6ee50320e82ce7358b6
[ "MIT" ]
null
null
null
backpack/core/derivatives/batchnorm2d.py
maryamhgf/backpack
63d2717656df2e0f18b3b6ee50320e82ce7358b6
[ "MIT" ]
2
2021-06-11T14:15:28.000Z
2021-06-16T11:19:11.000Z
from warnings import warn from torch import einsum from torch.nn import BatchNorm2d import torch from backpack.core.derivatives.basederivatives import BaseParameterDerivatives class BatchNorm2dDerivatives(BaseParameterDerivatives): def get_module(self): return BatchNorm2d def hessian_is_zero(self): return False def hessian_is_diagonal(self): return False def _jac_mat_prod(self, module, g_inp, g_out, mat): return self._jac_t_mat_prod(module, g_inp, g_out, mat) def _jac_t_mat_prod(self, module, g_inp, g_out, mat): return None def _weight_jac_mat_prod(self, module, g_inp, g_out, mat): return None def get_normalized_input_and_var(self, module): input = module.input0 mean = input.mean(dim=(0, 2, 3), keepdim=True) var = input.var(dim=(0, 2, 3), unbiased=False, keepdim=True) return (input - mean) / (var + module.eps).sqrt(), var def _weight_jac_t_mat_prod(self, module, g_inp, g_out, mat, sum_batch): # TODO: complete this function if not sum_batch: warn( "BatchNorm batch summation disabled." "This may not compute meaningful quantities" ) x_hat, _ = self.get_normalized_input_and_var(module) equation = "vnihw,nihw->v{}i".format("" if sum_batch is True else "n") operands = [mat, x_hat] return einsum(equation, operands) def _bias_jac_mat_prod(self, module, g_inp, g_out, mat): return None def _bias_jac_t_mat_prod(self, module, g_inp, g_out, mat, sum_batch=True): # TODO: complete this function if not sum_batch: warn( "BatchNorm batch summation disabled." "This may not compute meaningful quantities" ) N_axis = 3,4 return mat.sum(N_axis) else: N_axis = 1 return mat.sum(N_axis)
31.645161
78
0.633028
266
1,962
4.413534
0.296992
0.041738
0.059625
0.065588
0.482964
0.413118
0.398637
0.398637
0.398637
0.398637
0
0.009233
0.282365
1,962
61
79
32.163934
0.824574
0.029052
0
0.326087
0
0
0.089905
0
0
0
0
0.016393
0
1
0.217391
false
0
0.108696
0.152174
0.586957
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
1
0
0
0
3
4c86a51544001c2dfc13bb79a6366ed8c9dfd180
2,994
py
Python
tests/test_graphql.py
d-danilkin/ariadne
62b1363752394439f21d8be1b48074b4ba280493
[ "BSD-3-Clause" ]
1,778
2018-07-09T09:54:24.000Z
2022-03-31T18:22:56.000Z
tests/test_graphql.py
d-danilkin/ariadne
62b1363752394439f21d8be1b48074b4ba280493
[ "BSD-3-Clause" ]
639
2018-07-12T12:39:25.000Z
2022-03-28T04:02:52.000Z
tests/test_graphql.py
d-danilkin/ariadne
62b1363752394439f21d8be1b48074b4ba280493
[ "BSD-3-Clause" ]
154
2018-08-10T18:50:49.000Z
2022-03-31T17:48:14.000Z
import pytest from graphql import GraphQLError from graphql.validation.rules import ValidationRule from ariadne import graphql, graphql_sync, subscribe class AlwaysInvalid(ValidationRule): def leave_operation_definition( # pylint: disable=unused-argument self, *args, **kwargs ): self.context.report_error(GraphQLError("Invalid")) def test_graphql_sync_executes_the_query(schema): success, result = graphql_sync(schema, {"query": '{ hello(name: "world") }'}) assert success assert result["data"] == {"hello": "Hello, world!"} def test_graphql_sync_uses_validation_rules(schema): success, result = graphql_sync( schema, {"query": '{ hello(name: "world") }'}, validation_rules=[AlwaysInvalid] ) assert not success assert result["errors"][0]["message"] == "Invalid" def test_graphql_sync_prevents_introspection_query_when_option_is_disabled(schema): success, result = graphql_sync( schema, {"query": "{ __schema { types { name } } }"}, introspection=False ) assert not success assert ( result["errors"][0]["message"] == "Cannot query '__schema': introspection is disabled." ) @pytest.mark.asyncio async def test_graphql_execute_the_query(schema): success, result = await graphql(schema, {"query": '{ hello(name: "world") }'}) assert success assert result["data"] == {"hello": "Hello, world!"} @pytest.mark.asyncio async def test_graphql_uses_validation_rules(schema): success, result = await graphql( schema, {"query": '{ hello(name: "world") }'}, validation_rules=[AlwaysInvalid] ) assert not success assert result["errors"][0]["message"] == "Invalid" @pytest.mark.asyncio async def test_graphql_prevents_introspection_query_when_option_is_disabled(schema): success, result = await graphql( schema, {"query": "{ __schema { types { name } } }"}, introspection=False ) assert not success assert ( result["errors"][0]["message"] == "Cannot query '__schema': introspection is disabled." ) @pytest.mark.asyncio async def test_subscription_returns_an_async_iterator(schema): success, result = await subscribe(schema, {"query": "subscription { ping }"}) assert success response = await result.__anext__() assert response.data == {"ping": "pong"} @pytest.mark.asyncio async def test_subscription_uses_validation_rules(schema): success, result = await subscribe( schema, {"query": "subscription { ping }"}, validation_rules=[AlwaysInvalid] ) assert not success assert result[0]["message"] == "Invalid" @pytest.mark.asyncio async def test_subscription_prevents_introspection_query_when_option_is_disabled( schema, ): success, result = await subscribe( schema, {"query": "{ __schema { types { name } } }"}, introspection=False ) assert not success assert result[0]["message"] == "Cannot query '__schema': introspection is disabled."
31.851064
88
0.690381
330
2,994
6.027273
0.20303
0.031674
0.085973
0.066365
0.807441
0.777778
0.768225
0.677728
0.62544
0.528406
0
0.002447
0.181029
2,994
93
89
32.193548
0.808728
0.010354
0
0.527778
0
0
0.194191
0
0
0
0
0
0.25
1
0.055556
false
0
0.055556
0
0.125
0
0
0
0
null
0
0
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
4c89860afb4f5c0a1a774e264d8171fe2b027967
116
py
Python
codeup/2782.py
shinkeonkim/today-ps
f3e5e38c5215f19579bb0422f303a9c18c626afa
[ "Apache-2.0" ]
2
2020-01-29T06:54:41.000Z
2021-11-07T13:23:27.000Z
codeup/2782.py
shinkeonkim/Today_PS
bb0cda0ee1b9c57e1cfa38355e29d0f1c6167a44
[ "Apache-2.0" ]
null
null
null
codeup/2782.py
shinkeonkim/Today_PS
bb0cda0ee1b9c57e1cfa38355e29d0f1c6167a44
[ "Apache-2.0" ]
null
null
null
from math import factorial as f a,b =map(int,input().split()) a-=1 b-=1 print((f(a+b) // (f(a) * f(b))) %1000000000)
23.2
44
0.603448
25
116
2.8
0.6
0.085714
0.085714
0
0
0
0
0
0
0
0
0.118812
0.12931
116
5
44
23.2
0.574257
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.2
0
0.2
0.2
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
3
4cc3954d297eebbd37ccdacd728db29e907bb798
457
py
Python
frappe/core/doctype/custom_script/custom_script.py
pawaranand/phr_frappe
d997ae7d6fbade4b2c4a2491603d988876dfd67e
[ "MIT" ]
1
2022-03-05T16:02:39.000Z
2022-03-05T16:02:39.000Z
frappe/core/doctype/custom_script/custom_script.py
pawaranand/phr_frappe
d997ae7d6fbade4b2c4a2491603d988876dfd67e
[ "MIT" ]
1
2015-07-11T20:52:38.000Z
2019-12-06T15:00:58.000Z
frappe/core/doctype/custom_script/custom_script.py
pawaranand/phr_frappe
d997ae7d6fbade4b2c4a2491603d988876dfd67e
[ "MIT" ]
2
2015-09-05T05:30:23.000Z
2018-03-21T19:45:10.000Z
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cstr from frappe.model.document import Document class CustomScript(Document): def autoname(self): self.name = self.dt + "-" + self.script_type def on_update(self): frappe.clear_cache(doctype=self.dt) def on_trash(self): frappe.clear_cache(doctype=self.dt)
22.85
71
0.761488
66
457
5.121212
0.590909
0.053254
0.088757
0.118343
0.195266
0.195266
0.195266
0
0
0
0
0.01023
0.14442
457
19
72
24.052632
0.85422
0.214442
0
0.181818
0
0
0.002825
0
0
0
0
0
0
1
0.272727
false
0
0.363636
0
0.727273
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
0
1
0
0
3
e21a48afd165335d659b5ee82935d3927a3b589f
1,262
py
Python
pyspark_kit/logger/log4j_proxy.py
saikocat/pyspark-kit
7d15e6429888050a46ce23ba98aa8cda2767f84a
[ "MIT" ]
null
null
null
pyspark_kit/logger/log4j_proxy.py
saikocat/pyspark-kit
7d15e6429888050a46ce23ba98aa8cda2767f84a
[ "MIT" ]
null
null
null
pyspark_kit/logger/log4j_proxy.py
saikocat/pyspark-kit
7d15e6429888050a46ce23ba98aa8cda2767f84a
[ "MIT" ]
null
null
null
# log4jLogger = sc._jvm.org.apache.log4j # LOGGER = log4jLogger.LogManager.getLogger(__name__) # LOGGER.info("pyspark script logger initialized") class Log4j(object): """Wrapper class for Log4j JVM object. :param spark: SparkSession object. """ def __init__(self, spark): # get spark app details with which to prefix all messages conf = spark.sparkContext.getConf() app_id = conf.get('spark.app.id') app_name = conf.get('spark.app.name') log4j = spark._jvm.org.apache.log4j message_prefix = '<' + app_name + ' ' + app_id + '>' self.logger = log4j.LogManager.getLogger(message_prefix) def trace(self, message): self.logger.trace(message) return None def debug(self, message): self.logger.debug(message) return None def info(self, message): self.logger.info(message) return None def warn(self, message): self.logger.warn(message) return None def error(self, message): self.logger.error(message) return None def fatal(self, message): self.logger.fatal(message) return None def set_level(self, level): self.logger.setLevel(level) return None
25.755102
65
0.627575
152
1,262
5.098684
0.315789
0.103226
0.116129
0.162581
0
0
0
0
0
0
0
0.008611
0.263867
1,262
48
66
26.291667
0.825619
0.212361
0
0.241379
0
0
0.029713
0
0
0
0
0
0
1
0.275862
false
0
0
0
0.551724
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
3
e2215b9d1f31c1a285af3e852e3b2fdae988fa43
238
py
Python
Demos/Demo-4.2 Modules/myprinter.py
Josverl/MicroPython-Bootcamp
29f5ccc9768fbea621029dcf6eea9c91ff84c1d5
[ "MIT" ]
4
2018-04-28T13:43:20.000Z
2021-03-11T16:10:35.000Z
Demos/Demo-4.2 Modules/myprinter.py
Josverl/MicroPython-Bootcamp
29f5ccc9768fbea621029dcf6eea9c91ff84c1d5
[ "MIT" ]
null
null
null
Demos/Demo-4.2 Modules/myprinter.py
Josverl/MicroPython-Bootcamp
29f5ccc9768fbea621029dcf6eea9c91ff84c1d5
[ "MIT" ]
null
null
null
""" my pretty printer module """ def printit(text): # use ANSI escape sequeences top print inverted, bold ,red text # https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit print("\033[;7m\033[1;31m{}\033[0;0m".format(str(text) ) )
23.8
64
0.697479
40
238
4.075
0.825
0.122699
0
0
0
0
0
0
0
0
0
0.081731
0.12605
238
9
65
26.444444
0.701923
0.592437
0
0
0
0
0.341176
0.341176
0
0
0
0
0
1
0.5
false
0
0
0
0.5
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
1
0
3
e23a8a1fd9ee7b65210f333c867d42311511632e
209
py
Python
noxfile.py
0xflotus/pyheck
852828f9d0bd5e9272ef6c85076d105965e05ca7
[ "MIT" ]
24
2022-01-24T16:19:26.000Z
2022-02-17T21:12:40.000Z
noxfile.py
kevinheavey/pybip39
1f668feb8ebcfe009e87f853bff47876846f5c83
[ "Apache-2.0" ]
1
2022-01-20T22:52:24.000Z
2022-01-20T22:52:24.000Z
noxfile.py
kevinheavey/pybip39
1f668feb8ebcfe009e87f853bff47876846f5c83
[ "Apache-2.0" ]
4
2022-01-20T22:48:38.000Z
2022-01-28T01:16:12.000Z
# type: ignore import nox @nox.session def python(session): session.install("pytest", "maturin", "sphinx") session.install(".", "--no-build-isolation") session.run("make", "test", external=True)
20.9
50
0.660287
25
209
5.52
0.76
0.202899
0
0
0
0
0
0
0
0
0
0
0.143541
209
9
51
23.222222
0.77095
0.057416
0
0
0
0
0.246154
0
0
0
0
0
0
1
0.166667
false
0
0.166667
0
0.333333
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
e2414e6120f47710808e08205df25bc03519717f
1,173
py
Python
src/ch9-sqlalchemy/start/pypi_sqlalchemy/pypi/controllers/account_controller.py
possnfiffer/data-driven-web-apps-with-pyramid-and-sqlalchemy
880dc4bc2a6d5dd5fcc91452725d5a1c7c9022c5
[ "MIT" ]
83
2018-07-04T22:19:20.000Z
2022-03-09T22:44:48.000Z
src/ch9-sqlalchemy/start/pypi_sqlalchemy/pypi/controllers/account_controller.py
possnfiffer/data-driven-web-apps-with-pyramid-and-sqlalchemy
880dc4bc2a6d5dd5fcc91452725d5a1c7c9022c5
[ "MIT" ]
9
2018-08-02T00:17:33.000Z
2021-11-17T17:18:05.000Z
src/ch9-sqlalchemy/start/pypi_sqlalchemy/pypi/controllers/account_controller.py
possnfiffer/data-driven-web-apps-with-pyramid-and-sqlalchemy
880dc4bc2a6d5dd5fcc91452725d5a1c7c9022c5
[ "MIT" ]
78
2018-07-28T14:07:07.000Z
2022-01-15T07:06:42.000Z
from pyramid.view import view_config # ################### INDEX ################################# @view_config(route_name='account_home', renderer='pypi:templates/account/index.pt') def index(request): return {} # ################### LOGIN ################################# @view_config(route_name='login', renderer='pypi:templates/account/login.pt', request_method='GET') def login_get(request): return {} @view_config(route_name='login', renderer='pypi:templates/account/login.pt', request_method='POST') def login_post(request): return {} # ################### REGISTRATION ############################ @view_config(route_name='register', renderer='pypi:templates/account/register.pt', request_method='GET') def register_get(request): return {} @view_config(route_name='register', renderer='pypi:templates/account/register.pt', request_method='POST') def register_post(request): return {} # ################### LOGOUT ############################ @view_config(route_name='logout') def logout(request): return {}
23.938776
63
0.538789
111
1,173
5.495496
0.216216
0.114754
0.147541
0.186885
0.586885
0.544262
0.544262
0.491803
0.491803
0.491803
0
0
0.184143
1,173
49
64
23.938776
0.637409
0.031543
0
0.642857
0
0
0.234979
0.172747
0
0
0
0
0
1
0.214286
false
0
0.035714
0.214286
0.464286
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
3
e2488ab43fc64895472fd4c4e6cd0e65a68427c1
20
py
Python
test/__init__.py
LeonSu070/jira_bug_analysis
6b1d814270be25a62706ab58b0b31c8771b649d9
[ "Apache-2.0" ]
2
2018-11-16T07:00:43.000Z
2018-12-13T08:17:39.000Z
test/__init__.py
LeonSu070/jira_bug_analysis
6b1d814270be25a62706ab58b0b31c8771b649d9
[ "Apache-2.0" ]
null
null
null
test/__init__.py
LeonSu070/jira_bug_analysis
6b1d814270be25a62706ab58b0b31c8771b649d9
[ "Apache-2.0" ]
1
2019-09-16T09:53:12.000Z
2019-09-16T09:53:12.000Z
__author__ = 'Jack'
10
19
0.7
2
20
5
1
0
0
0
0
0
0
0
0
0
0
0
0.15
20
1
20
20
0.588235
0
0
0
0
0
0.2
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
e2617623ef2efc44b44ea28d9b54e927b69dfd87
208,496
py
Python
colour_datasets/loaders/tests/test_kuopio.py
JGoldstone/colour-datasets
8e0b52870c63c0e9b72d8b848720e0c28e0cbfa4
[ "BSD-3-Clause" ]
1
2022-01-29T09:12:18.000Z
2022-01-29T09:12:18.000Z
colour_datasets/loaders/tests/test_kuopio.py
JGoldstone/colour-datasets
8e0b52870c63c0e9b72d8b848720e0c28e0cbfa4
[ "BSD-3-Clause" ]
null
null
null
colour_datasets/loaders/tests/test_kuopio.py
JGoldstone/colour-datasets
8e0b52870c63c0e9b72d8b848720e0c28e0cbfa4
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- """ Defines unit tests for :mod:`colour_datasets.loaders.kuopio` module. """ import numpy as np import os import unittest from colour import SpectralShape from colour_datasets.loaders.kuopio import ( MatFileMetadata_KuopioUniversity, read_sds_from_mat_file_KuopioUniversity) from colour_datasets.loaders.kuopio import ( DatasetLoader_MunsellColorsMattSpectrofotometerMeasured, DatasetLoader_MunsellColorsMattAOTFMeasured, DatasetLoader_MunsellColorsGlossySpectrofotometerMeasured, DatasetLoader_MunsellColorsGlossyAllSpectrofotometerMeasured, DatasetLoader_ForestColors, DatasetLoader_PaperSpectra, DatasetLoader_LumberSpectra, DatasetLoader_AgfaIT872Set) __author__ = 'Colour Developers' __copyright__ = 'Copyright (C) 2019-2021 - Colour Developers' __license__ = 'New BSD License - https://opensource.org/licenses/BSD-3-Clause' __maintainer__ = 'Colour Developers' __email__ = 'colour-developers@colour-science.org' __status__ = 'Production' __all__ = [ 'TestReadSdsFromMatFileKuopioUniversity', 'TestDatasetLoader_KuopioUniversity' ] class TestReadSdsFromMatFileKuopioUniversity(unittest.TestCase): """ Defines :func:`colour_datasets.loaders.kuopio.\ read_sds_from_mat_file_KuopioUniversity` definition unit tests methods. """ def test_read_sds_from_mat_file_KuopioUniversity(self): """ Tests :func:`colour_datasets.loaders.kuopio.\ read_sds_from_mat_file_KuopioUniversity` definition. """ mat_file = os.path.join( os.path.dirname(__file__), 'resources', 'Kuopio_Typical.mat') metadata = MatFileMetadata_KuopioUniversity( 'munsell', SpectralShape(400, 700, 10), True, 'S') sds = read_sds_from_mat_file_KuopioUniversity(mat_file, metadata) self.assertEqual(len(sds), 32) np.testing.assert_array_almost_equal( sds['5R 6/8 (3)'].values, np.array([ 17.870000000000000, 19.840000000000000, 19.530000000000000, 18.730000000000000, 18.230000000000000, 17.630000000000000, 17.040000000000000, 16.660000000000000, 15.700000000000000, 14.080000000000000, 12.810000000000000, 12.650000000000000, 12.110000000000000, 10.840000000000000, 10.890000000000000, 14.260000000000000, 23.080000000000000, 33.950000000000000, 43.500000000000000, 49.790000000000000, 52.340000000000000, 53.170000000000000, 53.300000000000000, 53.100000000000000, 52.960000000000000, 52.840000000000000, 52.700000000000000, 52.480000000000000, 52.120000000000000, 51.940000000000000, 51.890000000000000, ]), decimal=7) class TestDatasetLoader_KuopioUniversity(unittest.TestCase): """ Defines :class:`colour_datasets.loaders.kuopio.\ DatasetLoader_KuopioUniversity` class unit tests methods. """ def test_required_attributes(self): """ Tests presence of required attributes. """ required_attributes = ('ID', 'METADATA') for dataset_loader in ( DatasetLoader_MunsellColorsMattSpectrofotometerMeasured, DatasetLoader_MunsellColorsMattAOTFMeasured, DatasetLoader_MunsellColorsGlossySpectrofotometerMeasured, DatasetLoader_MunsellColorsGlossyAllSpectrofotometerMeasured, DatasetLoader_ForestColors, DatasetLoader_PaperSpectra, DatasetLoader_LumberSpectra, DatasetLoader_AgfaIT872Set): for attribute in required_attributes: self.assertIn(attribute, dir(dataset_loader)) def test_required_methods(self): """ Tests presence of required methods. """ required_methods = ('__init__', 'load') for dataset_loader in ( DatasetLoader_MunsellColorsMattSpectrofotometerMeasured, DatasetLoader_MunsellColorsMattAOTFMeasured, DatasetLoader_MunsellColorsGlossySpectrofotometerMeasured, DatasetLoader_MunsellColorsGlossyAllSpectrofotometerMeasured, DatasetLoader_ForestColors, DatasetLoader_PaperSpectra, DatasetLoader_LumberSpectra, DatasetLoader_AgfaIT872Set): for method in required_methods: self.assertIn(method, dir(dataset_loader)) def test_load(self): """ Tests :func:`colour_datasets.loaders.kuopio.\ DatasetLoader_KuopioUniversity.load` method. """ dataset_loaders = { DatasetLoader_MunsellColorsMattSpectrofotometerMeasured(): ( 'munsell', 1269, '2.5R 5/2', np.array([ 0.105600000000000, 0.114100000000000, 0.117000000000000, 0.119000000000000, 0.121900000000000, 0.124600000000000, 0.127100000000000, 0.135200000000000, 0.137100000000000, 0.141900000000000, 0.151300000000000, 0.155800000000000, 0.154900000000000, 0.162200000000000, 0.166000000000000, 0.168700000000000, 0.173300000000000, 0.174400000000000, 0.173900000000000, 0.179700000000000, 0.182200000000000, 0.183900000000000, 0.185500000000000, 0.184600000000000, 0.184800000000000, 0.187700000000000, 0.184600000000000, 0.183700000000000, 0.187600000000000, 0.186500000000000, 0.183200000000000, 0.185800000000000, 0.184400000000000, 0.181300000000000, 0.183800000000000, 0.181800000000000, 0.179500000000000, 0.181900000000000, 0.180200000000000, 0.178600000000000, 0.179600000000000, 0.176300000000000, 0.176300000000000, 0.178100000000000, 0.175100000000000, 0.174000000000000, 0.176300000000000, 0.173400000000000, 0.173800000000000, 0.175500000000000, 0.171100000000000, 0.170600000000000, 0.174300000000000, 0.171800000000000, 0.170600000000000, 0.172800000000000, 0.172300000000000, 0.171200000000000, 0.170900000000000, 0.169300000000000, 0.172000000000000, 0.175300000000000, 0.171500000000000, 0.169500000000000, 0.170800000000000, 0.167100000000000, 0.167700000000000, 0.170100000000000, 0.165600000000000, 0.164800000000000, 0.167500000000000, 0.164600000000000, 0.162500000000000, 0.165500000000000, 0.162500000000000, 0.163400000000000, 0.163600000000000, 0.161500000000000, 0.162400000000000, 0.164500000000000, 0.162200000000000, 0.163900000000000, 0.164900000000000, 0.162200000000000, 0.163600000000000, 0.166100000000000, 0.162900000000000, 0.164700000000000, 0.167400000000000, 0.164800000000000, 0.165200000000000, 0.165400000000000, 0.164400000000000, 0.166300000000000, 0.167600000000000, 0.163800000000000, 0.164400000000000, 0.163600000000000, 0.162100000000000, 0.163800000000000, 0.162900000000000, 0.158600000000000, 0.160300000000000, 0.159100000000000, 0.155300000000000, 0.157200000000000, 0.159000000000000, 0.154100000000000, 0.154500000000000, 0.154600000000000, 0.151100000000000, 0.153700000000000, 0.155000000000000, 0.151200000000000, 0.151100000000000, 0.151300000000000, 0.149300000000000, 0.152000000000000, 0.150700000000000, 0.148400000000000, 0.151300000000000, 0.152600000000000, 0.149000000000000, 0.152200000000000, 0.152700000000000, 0.149700000000000, 0.150800000000000, 0.151100000000000, 0.148300000000000, 0.152100000000000, 0.153100000000000, 0.150900000000000, 0.151100000000000, 0.149300000000000, 0.148500000000000, 0.150900000000000, 0.148300000000000, 0.145300000000000, 0.148100000000000, 0.147000000000000, 0.144900000000000, 0.146600000000000, 0.145300000000000, 0.143100000000000, 0.146300000000000, 0.144400000000000, 0.141000000000000, 0.141200000000000, 0.143700000000000, 0.142000000000000, 0.142900000000000, 0.142400000000000, 0.142700000000000, 0.145400000000000, 0.142900000000000, 0.141300000000000, 0.144500000000000, 0.143700000000000, 0.143400000000000, 0.148600000000000, 0.147500000000000, 0.147000000000000, 0.151300000000000, 0.153100000000000, 0.150800000000000, 0.155800000000000, 0.156400000000000, 0.158100000000000, 0.162700000000000, 0.164600000000000, 0.165200000000000, 0.171900000000000, 0.171900000000000, 0.173600000000000, 0.176300000000000, 0.176800000000000, 0.178200000000000, 0.183400000000000, 0.179800000000000, 0.177500000000000, 0.180400000000000, 0.184800000000000, 0.191700000000000, 0.194900000000000, 0.195100000000000, 0.193100000000000, 0.196400000000000, 0.196700000000000, 0.195900000000000, 0.201000000000000, 0.200100000000000, 0.197400000000000, 0.201200000000000, 0.200500000000000, 0.198200000000000, 0.203900000000000, 0.204700000000000, 0.201900000000000, 0.204000000000000, 0.203800000000000, 0.202000000000000, 0.206200000000000, 0.206600000000000, 0.204200000000000, 0.205500000000000, 0.204700000000000, 0.205100000000000, 0.208300000000000, 0.206300000000000, 0.204100000000000, 0.208100000000000, 0.206600000000000, 0.203300000000000, 0.206400000000000, 0.206400000000000, 0.203900000000000, 0.206100000000000, 0.205400000000000, 0.202700000000000, 0.204600000000000, 0.205300000000000, 0.204700000000000, 0.205800000000000, 0.204600000000000, 0.204000000000000, 0.206900000000000, 0.203500000000000, 0.202900000000000, 0.207000000000000, 0.206200000000000, 0.203400000000000, 0.206500000000000, 0.205500000000000, 0.204300000000000, 0.207100000000000, 0.205100000000000, 0.202300000000000, 0.205000000000000, 0.204100000000000, 0.203900000000000, 0.205800000000000, 0.203500000000000, 0.203800000000000, 0.205800000000000, 0.203200000000000, 0.201200000000000, 0.203700000000000, 0.200600000000000, 0.201400000000000, 0.206300000000000, 0.203100000000000, 0.201000000000000, 0.203600000000000, 0.200500000000000, 0.199300000000000, 0.202700000000000, 0.202300000000000, 0.201700000000000, 0.202900000000000, 0.199900000000000, 0.199200000000000, 0.202500000000000, 0.200400000000000, 0.199500000000000, 0.199800000000000, 0.196400000000000, 0.197200000000000, 0.200500000000000, 0.196800000000000, 0.196700000000000, 0.200100000000000, 0.197800000000000, 0.195700000000000, 0.198500000000000, 0.196500000000000, 0.197100000000000, 0.198400000000000, 0.195900000000000, 0.196400000000000, 0.200200000000000, 0.198300000000000, 0.199400000000000, 0.198500000000000, 0.193700000000000, 0.195300000000000, 0.198400000000000, 0.193300000000000, 0.193800000000000, 0.197200000000000, 0.193900000000000, 0.194700000000000, 0.197300000000000, 0.195000000000000, 0.197700000000000, 0.200700000000000, 0.197100000000000, 0.196300000000000, 0.197700000000000, 0.196800000000000, 0.197300000000000, 0.198000000000000, 0.193900000000000, 0.195300000000000, 0.196100000000000, 0.192900000000000, 0.195100000000000, 0.196100000000000, 0.188600000000000, 0.187100000000000, 0.192700000000000, 0.195800000000000, 0.194800000000000, 0.196100000000000, 0.192200000000000, 0.195100000000000, 0.196500000000000, 0.192600000000000, 0.195000000000000, 0.195500000000000, 0.193100000000000, 0.193200000000000, 0.194200000000000, 0.191800000000000, 0.194500000000000, 0.193600000000000, 0.191100000000000, 0.193100000000000, 0.192800000000000, 0.190600000000000, 0.193600000000000, 0.192400000000000, 0.189900000000000, 0.192900000000000, 0.193900000000000, 0.191700000000000, 0.194700000000000, 0.195900000000000, 0.192400000000000, 0.192900000000000, 0.193100000000000, 0.192200000000000, 0.195700000000000, 0.195500000000000, 0.192200000000000, 0.195100000000000, 0.193600000000000, 0.192300000000000, 0.196200000000000, 0.196100000000000, 0.193800000000000, 0.198400000000000, 0.196900000000000, 0.192900000000000, 0.196300000000000, 0.196800000000000, 0.194800000000000, 0.195600000000000, 0.194600000000000, 0.193700000000000, 0.196900000000000, 0.196100000000000, 0.194800000000000, 0.196700000000000, 0.193900000000000, 0.193400000000000, 0.197000000000000, 0.193000000000000, 0.192200000000000, 0.196000000000000, 0.193800000000000, 0.191800000000000, 0.194000000000000, 0.193500000000000, 0.191000000000000, 0.192300000000000, 0.190700000000000, 0.189500000000000, 0.191700000000000, 0.189900000000000, 0.191200000000000, 0.192400000000000, 0.189600000000000, 0.189500000000000, 0.193200000000000, 0.191200000000000, 0.188600000000000, 0.192800000000000, 0.191700000000000, 0.190800000000000, 0.194300000000000, 0.191600000000000, 0.190400000000000, 0.192700000000000, 0.191000000000000, 0.189300000000000, 0.192200000000000, 0.190200000000000, 0.190100000000000, 0.192900000000000, 0.191300000000000, 0.192900000000000, 0.196700000000000, 0.191600000000000, 0.192400000000000, 0.195900000000000, 0.189600000000000, 0.188700000000000, 0.192400000000000, 0.193200000000000, 0.193000000000000, 0.193400000000000, 0.190200000000000, 0.192200000000000, 0.193100000000000, 0.190000000000000, 0.191000000000000, 0.192500000000000, 0.190200000000000, 0.191300000000000, 0.192700000000000, 0.190000000000000, ])), DatasetLoader_MunsellColorsMattAOTFMeasured(): ( 'munsell', 1250, '10bV50C01.NM5', np.array([ 0.363525390625000, 0.486328125000000, 0.262451171875000, 0.270263671875000, 0.278076171875000, 0.293945312500000, 0.272705078125000, 0.253417968750000, 0.272216796875000, 0.255859375000000, 0.260498046875000, 0.253906250000000, 0.256591796875000, 0.248535156250000, 0.245849609375000, 0.243408203125000, 0.247802734375000, 0.240234375000000, 0.247314453125000, 0.243164062500000, 0.237548828125000, 0.238525390625000, 0.230957031250000, 0.227050781250000, 0.231689453125000, 0.232421875000000, 0.228027343750000, 0.223876953125000, 0.224853515625000, 0.219726562500000, 0.220703125000000, 0.218994140625000, 0.216552734375000, 0.217529296875000, 0.217041015625000, 0.213134765625000, 0.212402343750000, 0.204833984375000, 0.210205078125000, 0.205810546875000, 0.201416015625000, 0.202392578125000, 0.200439453125000, 0.198730468750000, 0.197998046875000, 0.193359375000000, 0.192871093750000, 0.193115234375000, 0.192626953125000, 0.188476562500000, 0.189208984375000, 0.185058593750000, 0.185546875000000, 0.186035156250000, 0.183349609375000, 0.183105468750000, 0.181884765625000, 0.178222656250000, 0.175292968750000, 0.169921875000000, 0.175048828125000, ])), DatasetLoader_MunsellColorsGlossySpectrofotometerMeasured(): ( 'munsell', 32, '5R 5/6', np.array([ 12.660000000000000, 13.540000000000000, 12.990000000000000, 12.260000000000000, 11.910000000000000, 11.580000000000000, 11.360000000000000, 11.430000000000000, 10.910000000000000, 9.8000000000000000, 9.1100000000000000, 9.1400000000000000, 8.5200000000000000, 7.4800000000000000, 8.1600000000000000, 11.190000000000000, 15.190000000000000, 18.460000000000000, 23.560000000000000, 29.770000000000000, 33.250000000000000, 34.400000000000000, 34.540000000000000, 34.350000000000000, 34.200000000000000, 34.050000000000000, 33.800000000000000, 33.560000000000000, 33.290000000000000, 33.080000000000000, 32.910000000000000, ])), DatasetLoader_MunsellColorsGlossyAllSpectrofotometerMeasured(): ( 'X', 1600, '5', np.array([ 0.0832583349355893, 0.0841964216140708, 0.0854254747054747, 0.0864870564212114, 0.0885143682165685, 0.0905455902475432, 0.0915811880405238, 0.0935670213290593, 0.0953374607500153, 0.0969212265220306, 0.0988861173336562, 0.1011019151764140, 0.1027070137118110, 0.1045144157706090, 0.1066298320094840, 0.1078871227364190, 0.1097310323760100, 0.1114069239380190, 0.1121451511457540, 0.1134318032825190, 0.1141553695955370, 0.1148042526315790, 0.1151973800818870, 0.1163717178232080, 0.1153836989247310, 0.1163973344056990, 0.1164192531233960, 0.1176007052049480, 0.1185813542341110, 0.1188167084135430, 0.1188947903717930, 0.1194576529747440, 0.1206333985004790, 0.1203924436437340, 0.1212710711071110, 0.1208673887423540, 0.1215377256924970, 0.1218716508912110, 0.1213794497567520, 0.1217316822846940, 0.1216057200200700, 0.1220691362725450, 0.1223934228755990, 0.1226491662040630, 0.1222738901730910, 0.1235775559991130, 0.1240115273049840, 0.1245753981184280, 0.1249519072803720, 0.1251793875497570, 0.1253437823548850, 0.1259486272019440, 0.1259670591996470, 0.1261504072273180, 0.1270547857142860, 0.1275530353200880, 0.1278131387343720, 0.1280998512642540, 0.1287212301001870, 0.1289580095830810, 0.1290085828891700, 0.1304132516826660, 0.1309290648193960, 0.1315601250826540, 0.1320659696068720, 0.1328932240677590, 0.1336453489265910, 0.1340303717553890, 0.1347657294298580, 0.1352923279986800, 0.1360370366290280, 0.1365566273001920, 0.1375466104152930, 0.1380393871162610, 0.1391758261775510, 0.1393372198783630, 0.1403947401936650, 0.1410517545489320, 0.1420981132075470, 0.1424267063197030, 0.1431591745373150, 0.1439438302804960, 0.1449724509333040, 0.1457406097108570, 0.1466319866826770, 0.1477144227624550, 0.1491561375701750, 0.1499657283479590, 0.1508730084930310, 0.1524472420812020, 0.1538901500326160, 0.1551999854276550, 0.1564189116238570, 0.1575284381833020, 0.1588692308277620, 0.1593696495517520, 0.1605326245110820, 0.1618569582133350, 0.1624176661422450, 0.1634395257586450, 0.1635596262494570, 0.1647163760720880, 0.1653961094581390, 0.1659311061379690, 0.1668263889643190, 0.1664016268098260, 0.1663602603460430, 0.1672364293227780, 0.1676109344315600, 0.1680388326738580, 0.1677260481471460, 0.1674615913396480, 0.1674423665261110, 0.1669457804244260, 0.1667212939521800, 0.1666681862479700, 0.1661996093893670, 0.1660631997190860, 0.1650462213562810, 0.1644598642563330, 0.1639480785837650, 0.1629394804605160, 0.1618968264677260, 0.1607553251918300, 0.1599774502784840, 0.1592006389084410, 0.1577751116168180, 0.1567381133546260, 0.1558041359727410, 0.1546063862270590, 0.1532839006439740, 0.1522304826541110, 0.1510174361195320, 0.1495370270065490, 0.1482986794128800, 0.1471751082251080, 0.1459533303020460, 0.1448406104887160, 0.1432260271395360, 0.1420294881655200, 0.1407796123863140, 0.1394713345247770, 0.1383847867252320, 0.1367663760554230, 0.1353930054621170, 0.1340665548764000, 0.1326094541324100, 0.1314476955556760, 0.1300619568392020, 0.1286112691620170, 0.1270600768689440, 0.1256763453237410, 0.1247108740387740, 0.1233902828348500, 0.1219225162024490, 0.1203756671729230, 0.1193858886718750, 0.1187244485879990, 0.1172117915401300, 0.1163088532870850, 0.1148534423920700, 0.1134792034486500, 0.1125721330001090, 0.1113368023192800, 0.1101989148244470, 0.1091195956961200, 0.1083813403562120, 0.1071390462089160, 0.1061137185040440, 0.1049129130387580, 0.1043954382535030, 0.1031281954323000, 0.1021073306429620, 0.1010716444082520, 0.1004949793702500, 0.0995802646626368, 0.0984846824799607, 0.0976298555319497, 0.0964366697093181, 0.0959713445121951, 0.0946097380316976, 0.0940169040274674, 0.0931408770974068, 0.0925075464007411, 0.0919924512854102, 0.0911384338532010, 0.0904112434318108, 0.0898916765781003, 0.0889631941324027, 0.0886735681284474, 0.0881560421558456, 0.0874990131233596, 0.0870141730990311, 0.0865602858079677, 0.0866091052286152, 0.0860980602739726, 0.0854415269900361, 0.0852274163424125, 0.0846683259332347, 0.0846999037966362, 0.0846302515481997, 0.0837975875576037, 0.0838024112149533, 0.0835321230735480, 0.0829661160327131, 0.0827144267149202, 0.0827143225629190, 0.0820904100032906, 0.0820583758300862, 0.0819189005552196, 0.0810632600471517, 0.0810455174001206, 0.0807908284431793, 0.0804156337410190, 0.0805326402629417, 0.0800952396585686, 0.0796956921896410, 0.0793305183644425, 0.0789345770872087, 0.0784959303128253, 0.0783585716629300, 0.0780296335618316, 0.0776355686360401, 0.0777728303000492, 0.0771084880319877, 0.0769203308138898, 0.0765511326039387, 0.0762573573616277, 0.0762127566381391, 0.0760990485894276, 0.0759584208223972, 0.0755359285636025, 0.0756633663670248, 0.0752572122010094, 0.0758166600909639, 0.0750690017513135, 0.0752405613919895, 0.0750479940841367, 0.0752528940517383, 0.0749732792022792, 0.0751002570131788, 0.0750104604924056, 0.0749880663745893, 0.0752553795596451, 0.0753496369021501, 0.0753240486895493, 0.0749273240054870, 0.0755281749629548, 0.0757077530932087, 0.0758634115061267, 0.0756506801228609, 0.0760071605101143, 0.0762060860026327, 0.0759151579640193, 0.0760791654510557, 0.0761815485996705, 0.0765150256522692, 0.0762693840004381, 0.0764163189645717, 0.0764907408057002, 0.0768342669584245, 0.0771621960440524, 0.0770743948220065, 0.0770292538916904, 0.0771631784423267, 0.0774133684557129, 0.0772509793050447, 0.0776359754048861, 0.0776684550740538, 0.0775999245903436, 0.0775543019880607, 0.0775452066523959, 0.0779931107448912, 0.0779379115287394, 0.0777371116127967, 0.0777113861657265, 0.0783069040254470, 0.0777791275336913, 0.0778322734546252, 0.0782278086575343, 0.0781885667306111, 0.0779885797133166, 0.0778922203584937, 0.0777887903693571, 0.0781322884794139, 0.0778500300990532, 0.0783473231527094, 0.0781106787355065, 0.0774791683038638, 0.0774638428430621, 0.0776397440804944, 0.0778363414820891, 0.0773739737159128, 0.0771565329105620, 0.0774208283325135, 0.0773433725061492, 0.0769061458287716, 0.0768768537704918, 0.0767942762841530, 0.0766405641193834, 0.0768223210852969, 0.0756511902310809, 0.0760848653489134, 0.0758909124746839, 0.0757557372797899, 0.0755393640350877, 0.0755921310541311, 0.0759533260309984, 0.0755523312534209, 0.0758025853417513, 0.0754538890712176, 0.0759966492343413, 0.0756392191463549, 0.0760002427745665, 0.0759172330727733, 0.0760517874821252, 0.0761247379087473, 0.0767259722054381, 0.0763790106863501, 0.0764716400109619, 0.0764261489525063, 0.0764849258345667, 0.0770762127916552, 0.0770786163439449, 0.0777177075901432, 0.0779242324199406, 0.0779871221093106, 0.0782395180299033, 0.0780202550409318, 0.0784945261194030, 0.0789988898659046, 0.0787182916666667, 0.0795837732500822, 0.0803447880449685, 0.0798549101363562, 0.0801640755957272, 0.0806020982436883, 0.0807538561632564, 0.0815723849317322, 0.0814840643355108, 0.0818510493352379, 0.0819726217696014, 0.0822825937877291, 0.0826006385614824, 0.0832230251162791, 0.0832401884518462, 0.0837584412217095, 0.0840583776960650, 0.0838307027945206, 0.0846559244351832, 0.0854320944276695, 0.0859695935852373, 0.0860562020024205, 0.0868489965268207, 0.0869247383567663, 0.0877802062760588, 0.0889851523971662, 0.0886742533164529, 0.0894202225519288, 0.0903602252401458, 0.0913718090645038, 0.0926356862097440, 0.0927020975529644, 0.0934591620557682, 0.0942531088738516, 0.0957034433521885, 0.0966463331682351, 0.0970120648886445, 0.0982979563203177, 0.0993772702256467, 0.1001024339091560, 0.1006514627853130, 0.1021924514103130, 0.1032385466651990, 0.1042875362287090, 0.1054265632733870, 0.1065878370941110, 0.1078802324765710, 0.1085841372602890, 0.1096687124910860, 0.1103224411182040, 0.1116595158900050, 0.1135477486645740, 0.1144331781621860, 0.1143250851485150, 0.1156502670851920, 0.1175013129411760, 0.1179270310695630, 0.1182087558274100, 0.1191784615553600, 0.1209157444943570, 0.1216799742574260, 0.1230600100148570, 0.1251525243466300, 0.1264191929573590, 0.1278286560939470, 0.1295155392232370, 0.1325001371944510, 0.1325402033842440, 0.1334973586771410, 0.1362069264544460, ])), DatasetLoader_ForestColors(): ('pine', 370, '5', np.array([ 0.010262410000000, 0.009839101400000, 0.012529907000000, 0.011030105000000, 0.010073634000000, 0.011320871000000, 0.011616203000000, 0.013212691000000, 0.012491421000000, 0.011912613000000, 0.013115942000000, 0.013417573000000, 0.013631902000000, 0.013967374000000, 0.014361868000000, 0.014427279000000, 0.014636329000000, 0.014908329000000, 0.014993297000000, 0.015136227000000, 0.015386547000000, 0.015711171000000, 0.015828966000000, 0.016981529000000, 0.018321589000000, 0.019439448000000, 0.021571993000000, 0.023876195000000, 0.025659029000000, 0.026894433000000, 0.028889134000000, 0.030469200000000, 0.030692223000000, 0.031212534000000, 0.030800426000000, 0.029837495000000, 0.029041031000000, 0.027807930000000, 0.027085866000000, 0.026870222000000, 0.026034403000000, 0.025490563000000, 0.025915747000000, 0.025255465000000, 0.024883133000000, 0.024609150000000, 0.023686946000000, 0.023991298000000, 0.023958765000000, 0.023967050000000, 0.023539582000000, 0.022725872000000, 0.022347244000000, 0.022138569000000, 0.021979660000000, 0.020823906000000, 0.021076211000000, 0.021165034000000, 0.022165784000000, 0.025146573000000, 0.029714434000000, 0.039837663000000, 0.052246223000000, 0.067425578000000, 0.083176671000000, 0.097080232000000, 0.111191460000000, 0.122961630000000, 0.134962030000000, 0.143059710000000, 0.149133660000000, 0.155173970000000, 0.155457870000000, 0.159591120000000, 0.164270350000000, 0.165211360000000, 0.167401470000000, 0.167736380000000, 0.169301000000000, 0.170914620000000, 0.171809910000000, 0.172325160000000, 0.174672460000000, 0.176431510000000, 0.174736990000000, 0.177491730000000, 0.176703620000000, 0.177523560000000, 0.182620180000000, 0.182529490000000, 0.183265810000000, 0.183518600000000, 0.186661620000000, ])), DatasetLoader_PaperSpectra(): ('newsprintsce', 36, '5', np.array([ 28.430000000000000, 37.390000000000000, 44.860000000000000, 48.860000000000000, 51.120000000000000, 52.330000000000000, 53.140000000000000, 53.930000000000000, 54.620000000000000, 55.090000000000000, 54.890000000000000, 53.670000000000000, 51.830000000000000, 50.610000000000000, 48.660000000000000, 45.180000000000000, 43.640000000000000, 48.450000000000000, 58.400000000000000, 67.180000000000000, 69.940000000000000, 69.630000000000000, 69.300000000000000, 69.340000000000000, 69.370000000000000, 69.190000000000000, 68.880000000000000, 68.610000000000000, 68.290000000000000, 68.250000000000000, 68.230000000000000, ])), DatasetLoader_LumberSpectra(): ('birchWp', 12, '5', np.array([ 0.044233333000000, 0.045133333000000, 0.045233333000000, 0.046333333000000, 0.046833333000000, 0.047633333000000, 0.048733333000000, 0.049633333000000, 0.049933333000000, 0.051733333000000, 0.052733333000000, 0.053133333000000, 0.053833333000000, 0.054633333000000, 0.055433333000000, 0.056333333000000, 0.056833333000000, 0.058033333000000, 0.058433333000000, 0.059633333000000, 0.059933333000000, 0.060433333000000, 0.061033333000000, 0.063233333000000, 0.063833333000000, 0.064133333000000, 0.064133333000000, 0.065533333000000, 0.066533333000000, 0.067033333000000, 0.067833333000000, 0.068233333000000, 0.068633333000000, 0.069933333000000, 0.070033333000000, 0.071533333000000, 0.071933333000000, 0.072433333000000, 0.072933333000000, 0.073833333000000, 0.074433333000000, 0.074933333000000, 0.075833333000000, 0.076233333000000, 0.076833333000000, 0.077233333000000, 0.077933333000000, 0.078133333000000, 0.078133333000000, 0.079933333000000, 0.080333333000000, 0.080833333000000, 0.081333333000000, 0.081633333000000, 0.082433333000000, 0.083733333000000, 0.083833333000000, 0.084233333000000, 0.085033333000000, 0.085733333000000, 0.085733333000000, 0.086333333000000, 0.086733333000000, 0.087433333000000, 0.088133333000000, 0.089033333000000, 0.089433333000000, 0.089733333000000, 0.090033333000000, 0.090333333000000, 0.090833333000000, 0.091533333000000, 0.092233333000000, 0.092633333000000, 0.092833333000000, 0.093333333000000, 0.094133333000000, 0.094833333000000, 0.095133333000000, 0.095833333000000, 0.096233333000000, 0.097133333000000, 0.096833333000000, 0.097733333000000, 0.098133333000000, 0.098933333000000, 0.099233333000000, 0.099633333000000, 0.100333330000000, 0.101433330000000, 0.101933330000000, 0.102533330000000, 0.102933330000000, 0.103633330000000, 0.103533330000000, 0.104533330000000, 0.104833330000000, 0.105833330000000, 0.106133330000000, 0.106933330000000, 0.106733330000000, 0.107733330000000, 0.108033330000000, 0.108133330000000, 0.108533330000000, 0.109633330000000, 0.109833330000000, 0.110533330000000, 0.111133330000000, 0.111633330000000, 0.111533330000000, 0.111833330000000, 0.113033330000000, 0.112833330000000, 0.113333330000000, 0.114033330000000, 0.114333330000000, 0.115233330000000, 0.116033330000000, 0.116433330000000, 0.116933330000000, 0.117333330000000, 0.117733330000000, 0.118633330000000, 0.118933330000000, 0.119633330000000, 0.119833330000000, 0.120733330000000, 0.121233330000000, 0.121833330000000, 0.122333330000000, 0.123133330000000, 0.123633330000000, 0.124133330000000, 0.124433330000000, 0.125233330000000, 0.125533330000000, 0.126033330000000, 0.126633330000000, 0.127033330000000, 0.127533330000000, 0.128033330000000, 0.128033330000000, 0.128833330000000, 0.129233330000000, 0.129433330000000, 0.130233330000000, 0.130833330000000, 0.130933330000000, 0.131833330000000, 0.132033330000000, 0.132433330000000, 0.133233330000000, 0.134233330000000, 0.134133330000000, 0.134533330000000, 0.135033330000000, 0.135433330000000, 0.136133330000000, 0.136033330000000, 0.136933330000000, 0.137733330000000, 0.138333330000000, 0.138533330000000, 0.139133330000000, 0.139633330000000, 0.139933330000000, 0.140133330000000, 0.140633330000000, 0.141433330000000, 0.141633330000000, 0.142433330000000, 0.142733330000000, 0.143933330000000, 0.143633330000000, 0.144233330000000, 0.144533330000000, 0.145333330000000, 0.145233330000000, 0.145933330000000, 0.146233330000000, 0.147133330000000, 0.147233330000000, 0.147533330000000, 0.148133330000000, 0.148733330000000, 0.148933330000000, 0.149533330000000, 0.149933330000000, 0.150733330000000, 0.151333330000000, 0.151633330000000, 0.152133330000000, 0.152033330000000, 0.152233330000000, 0.152333330000000, 0.153233330000000, 0.153833330000000, 0.154433330000000, 0.154333330000000, 0.154633330000000, 0.155433330000000, 0.155433330000000, 0.155333330000000, 0.155833330000000, 0.156833330000000, 0.157433330000000, 0.158033330000000, 0.158533330000000, 0.158933330000000, 0.158833330000000, 0.158533330000000, 0.158533330000000, 0.160633330000000, 0.161133330000000, 0.160933330000000, 0.161633330000000, 0.162033330000000, 0.162333330000000, 0.163033330000000, 0.163333330000000, 0.163433330000000, 0.163833330000000, 0.163933330000000, 0.164333330000000, 0.165433330000000, 0.165733330000000, 0.166033330000000, 0.166333330000000, 0.166433330000000, 0.166533330000000, 0.167833330000000, 0.167933330000000, 0.167733330000000, 0.168233330000000, 0.168333330000000, 0.168533330000000, 0.169333330000000, 0.169533330000000, 0.170333330000000, 0.170033330000000, 0.171033330000000, 0.170433330000000, 0.171233330000000, 0.171533330000000, 0.172233330000000, 0.172133330000000, 0.172233330000000, 0.172733330000000, 0.173533330000000, 0.174033330000000, 0.174133330000000, 0.175033330000000, 0.175433330000000, 0.175733330000000, 0.176133330000000, 0.175733330000000, 0.175833330000000, 0.175733330000000, 0.176833330000000, 0.176733330000000, 0.177033330000000, 0.176933330000000, 0.177233330000000, 0.178233330000000, 0.178933330000000, 0.178533330000000, 0.180033330000000, 0.180233330000000, 0.180633330000000, 0.180633330000000, 0.181433330000000, 0.180433330000000, 0.180833330000000, 0.181233330000000, 0.181033330000000, 0.181233330000000, 0.182333330000000, 0.181833330000000, 0.182133330000000, 0.183333330000000, 0.182333330000000, 0.182633330000000, 0.183533330000000, 0.183833330000000, 0.183933330000000, 0.183433330000000, 0.184733330000000, 0.184633330000000, 0.185033330000000, 0.185433330000000, 0.186033330000000, 0.185833330000000, 0.186833330000000, 0.185733330000000, 0.186433330000000, 0.187033330000000, 0.187333330000000, 0.187433330000000, 0.187833330000000, 0.187433330000000, 0.186333330000000, 0.186933330000000, 0.188433330000000, 0.188433330000000, 0.188833330000000, 0.189333330000000, 0.190133330000000, 0.189633330000000, 0.190433330000000, 0.190133330000000, 0.190733330000000, 0.190033330000000, 0.189933330000000, 0.190433330000000, 0.190433330000000, 0.190933330000000, 0.191633330000000, 0.191833330000000, 0.191933330000000, 0.191733330000000, 0.191233330000000, 0.192333330000000, 0.192833330000000, 0.193233330000000, 0.193633330000000, 0.193633330000000, 0.193033330000000, 0.192933330000000, 0.192833330000000, 0.193533330000000, 0.193433330000000, 0.193733330000000, 0.193833330000000, 0.194333330000000, 0.194033330000000, 0.195133330000000, 0.195033330000000, 0.194933330000000, 0.196233330000000, 0.197033330000000, 0.196833330000000, 0.197333330000000, 0.195533330000000, 0.195733330000000, 0.197233330000000, 0.198333330000000, 0.196433330000000, 0.197233330000000, 0.196833330000000, 0.197433330000000, 0.197033330000000, 0.196833330000000, 0.198433330000000, 0.198233330000000, 0.198233330000000, 0.198533330000000, 0.198233330000000, 0.197833330000000, 0.199133330000000, 0.199233330000000, 0.199333330000000, 0.199433330000000, 0.200133330000000, 0.200133330000000, 0.200533330000000, 0.199433330000000, 0.200633330000000, 0.200633330000000, 0.200233330000000, 0.199833330000000, 0.200133330000000, 0.201433330000000, 0.202233330000000, 0.201333330000000, 0.201233330000000, 0.201433330000000, 0.201833330000000, 0.201533330000000, 0.203233330000000, 0.202333330000000, 0.201433330000000, 0.203333330000000, 0.202733330000000, 0.202533330000000, 0.202633330000000, 0.203533330000000, 0.203433330000000, 0.202633330000000, 0.203133330000000, 0.203233330000000, 0.204533330000000, 0.204533330000000, 0.203533330000000, 0.203133330000000, 0.202633330000000, 0.203133330000000, 0.204433330000000, 0.205033330000000, 0.205533330000000, 0.204733330000000, 0.206333330000000, 0.205633330000000, 0.207733330000000, 0.207133330000000, 0.207233330000000, 0.206933330000000, 0.206833330000000, 0.209133330000000, 0.207533330000000, 0.207733330000000, 0.208333330000000, 0.208333330000000, 0.206133330000000, 0.207433330000000, 0.209033330000000, 0.209233330000000, 0.208633330000000, 0.207733330000000, 0.210233330000000, 0.209633330000000, 0.208833330000000, 0.210233330000000, 0.209633330000000, 0.210133330000000, 0.211033330000000, 0.210733330000000, 0.210133330000000, 0.210533330000000, 0.208633330000000, 0.209033330000000, 0.209733330000000, 0.210533330000000, 0.210033330000000, 0.208433330000000, 0.210433330000000, 0.210933330000000, 0.209633330000000, 0.210233330000000, 0.212233330000000, 0.212433330000000, 0.211433330000000, 0.212133330000000, 0.212733330000000, 0.211533330000000, 0.212033330000000, 0.211333330000000, 0.209733330000000, 0.210433330000000, 0.211233330000000, 0.212533330000000, 0.211533330000000, 0.211733330000000, 0.210133330000000, 0.210033330000000, 0.210833330000000, 0.211333330000000, 0.211233330000000, 0.213733330000000, 0.211133330000000, 0.211533330000000, 0.214833330000000, 0.211433330000000, 0.214633330000000, 0.214433330000000, 0.214833330000000, 0.216733330000000, 0.215833330000000, 0.214833330000000, 0.219333330000000, 0.216833330000000, 0.215333330000000, 0.215433330000000, 0.217633330000000, 0.216033330000000, 0.215233330000000, 0.217533330000000, 0.216933330000000, 0.215733330000000, 0.209633330000000, 0.209633330000000, 0.216766670000000, 0.217466670000000, 0.215466670000000, 0.215566670000000, 0.214766670000000, 0.213066670000000, 0.212366670000000, 0.212866670000000, 0.213166670000000, 0.211066670000000, 0.212366670000000, 0.213066670000000, 0.211666670000000, 0.209966670000000, 0.209366670000000, 0.210766670000000, 0.210066670000000, 0.210666670000000, 0.211766670000000, 0.208966670000000, 0.208266670000000, 0.210366670000000, 0.210866670000000, 0.209366670000000, 0.208966670000000, 0.209966670000000, 0.208166670000000, 0.207166670000000, 0.208766670000000, 0.208566670000000, 0.207566670000000, 0.205666670000000, 0.206166670000000, 0.206366670000000, 0.206166670000000, 0.206166670000000, 0.205766670000000, 0.204866670000000, 0.206066670000000, 0.205466670000000, 0.205066670000000, 0.204566670000000, 0.204266670000000, 0.204366670000000, 0.203666670000000, 0.203366670000000, 0.202066670000000, 0.202266670000000, 0.203866670000000, 0.203166670000000, 0.202866670000000, 0.201966670000000, 0.201166670000000, 0.201266670000000, 0.201266670000000, 0.200966670000000, 0.200766670000000, 0.200766670000000, 0.201266670000000, 0.200766670000000, 0.200066670000000, 0.199766670000000, 0.199366670000000, 0.199366670000000, 0.199466670000000, 0.199066670000000, 0.198466670000000, 0.198366670000000, 0.198466670000000, 0.198266670000000, 0.197966670000000, 0.198066670000000, 0.197266670000000, 0.196866670000000, 0.196566670000000, 0.196666670000000, 0.196266670000000, 0.195366670000000, 0.195366670000000, 0.195166670000000, 0.194066670000000, 0.193666670000000, 0.193266670000000, 0.193066670000000, 0.192266670000000, 0.192066670000000, 0.191766670000000, 0.190966670000000, 0.190666670000000, 0.190066670000000, 0.190066670000000, 0.190266670000000, 0.190366670000000, 0.190766670000000, 0.190866670000000, 0.190866670000000, 0.190966670000000, 0.190866670000000, 0.191166670000000, 0.191266670000000, 0.191366670000000, 0.191566670000000, 0.191766670000000, 0.191466670000000, 0.191766670000000, 0.191966670000000, 0.192166670000000, 0.191766670000000, 0.192366670000000, 0.192166670000000, 0.192266670000000, 0.192266670000000, 0.191966670000000, 0.191666670000000, 0.191966670000000, 0.191666670000000, 0.191466670000000, 0.191766670000000, 0.192266670000000, 0.191866670000000, 0.191866670000000, 0.191866670000000, 0.191966670000000, 0.191666670000000, 0.191266670000000, 0.191466670000000, 0.191566670000000, 0.191866670000000, 0.192566670000000, 0.192366670000000, 0.191966670000000, 0.192066670000000, 0.192366670000000, 0.192166670000000, 0.192266670000000, 0.192566670000000, 0.192866670000000, 0.192466670000000, 0.192966670000000, 0.192966670000000, 0.192966670000000, 0.192766670000000, 0.193066670000000, 0.193266670000000, 0.193066670000000, 0.193066670000000, 0.193366670000000, 0.192866670000000, 0.193366670000000, 0.193666670000000, 0.193966670000000, 0.193866670000000, 0.193566670000000, 0.193866670000000, 0.193566670000000, 0.193666670000000, 0.193966670000000, 0.194166670000000, 0.194366670000000, 0.194266670000000, 0.194066670000000, 0.194166670000000, 0.194266670000000, 0.194466670000000, 0.194466670000000, 0.194566670000000, 0.194866670000000, 0.194966670000000, 0.194866670000000, 0.194566670000000, 0.194466670000000, 0.194866670000000, 0.195166670000000, 0.195166670000000, 0.195066670000000, 0.195366670000000, 0.195566670000000, 0.195466670000000, 0.195766670000000, 0.195466670000000, 0.195466670000000, 0.195766670000000, 0.195466670000000, 0.195266670000000, 0.195566670000000, 0.195666670000000, 0.195666670000000, 0.195666670000000, 0.196366670000000, 0.196066670000000, 0.195766670000000, 0.195666670000000, 0.195966670000000, 0.195866670000000, 0.195866670000000, 0.196066670000000, 0.196566670000000, 0.196166670000000, 0.196666670000000, 0.196366670000000, 0.196466670000000, 0.196266670000000, 0.196066670000000, 0.196066670000000, 0.196366670000000, 0.196466670000000, 0.196466670000000, 0.196766670000000, 0.196866670000000, 0.196466670000000, 0.196866670000000, 0.196666670000000, 0.196066670000000, 0.196166670000000, 0.196666670000000, 0.196666670000000, 0.196666670000000, 0.197066670000000, 0.197366670000000, 0.197066670000000, 0.197166670000000, 0.197166670000000, 0.197366670000000, 0.197166670000000, 0.197066670000000, 0.197066670000000, 0.196766670000000, 0.197166670000000, 0.197266670000000, 0.196966670000000, 0.196966670000000, 0.197466670000000, 0.197066670000000, 0.196766670000000, 0.196966670000000, 0.197666670000000, 0.197066670000000, 0.196866670000000, 0.197166670000000, 0.197166670000000, 0.197366670000000, 0.197566670000000, 0.197466670000000, 0.197366670000000, 0.197366670000000, 0.197366670000000, 0.197266670000000, 0.196566670000000, 0.197266670000000, 0.197466670000000, 0.197066670000000, 0.196866670000000, 0.197066670000000, 0.196766670000000, 0.196966670000000, 0.197166670000000, 0.197366670000000, 0.196866670000000, 0.196966670000000, 0.196766670000000, 0.196466670000000, 0.195966670000000, 0.195666670000000, 0.195966670000000, 0.196066670000000, 0.195666670000000, 0.195366670000000, 0.195066670000000, 0.194966670000000, 0.194666670000000, 0.194566670000000, 0.194766670000000, 0.194466670000000, 0.194166670000000, 0.193866670000000, 0.193566670000000, 0.193366670000000, 0.193466670000000, 0.193866670000000, 0.193066670000000, 0.192866670000000, 0.192666670000000, 0.192366670000000, 0.192066670000000, 0.191966670000000, 0.191566670000000, 0.190966670000000, 0.190666670000000, 0.190666670000000, 0.190366670000000, 0.190266670000000, 0.190266670000000, 0.189866670000000, 0.189366670000000, 0.189066670000000, 0.189066670000000, 0.188466670000000, 0.188066670000000, 0.188166670000000, 0.187966670000000, 0.187466670000000, 0.187266670000000, 0.187266670000000, 0.187066670000000, 0.186766670000000, 0.186666670000000, 0.186666670000000, 0.186166670000000, 0.186466670000000, 0.186266670000000, 0.185966670000000, 0.185766670000000, 0.185766670000000, 0.185566670000000, 0.185166670000000, 0.184866670000000, 0.184966670000000, 0.185066670000000, 0.185166670000000, 0.184966670000000, 0.184466670000000, 0.184366670000000, 0.183866670000000, 0.183666670000000, 0.183666670000000, 0.183366670000000, 0.183066670000000, 0.183066670000000, 0.182166670000000, 0.180366670000000, 0.180166670000000, 0.180066670000000, 0.179766670000000, 0.179966670000000, 0.180066670000000, 0.179766670000000, 0.179566670000000, 0.179466670000000, 0.179766670000000, 0.179566670000000, 0.179466670000000, 0.179466670000000, 0.179466670000000, 0.179666670000000, 0.179566670000000, 0.179566670000000, 0.179366670000000, 0.179766670000000, 0.180166670000000, 0.179466670000000, 0.179466670000000, 0.179566670000000, 0.179466670000000, 0.179266670000000, 0.179466670000000, 0.179466670000000, 0.179766670000000, 0.179966670000000, 0.180266670000000, 0.180466670000000, 0.179766670000000, 0.180066670000000, 0.180266670000000, 0.179966670000000, 0.180166670000000, 0.180766670000000, 0.180666670000000, 0.180766670000000, 0.181066670000000, 0.180766670000000, 0.180766670000000, 0.181066670000000, 0.181366670000000, 0.181066670000000, 0.181266670000000, 0.181566670000000, 0.181566670000000, 0.181566670000000, 0.182066670000000, 0.182166670000000, 0.182066670000000, 0.182066670000000, 0.182066670000000, 0.182366670000000, 0.182266670000000, 0.182566670000000, 0.182566670000000, 0.182466670000000, 0.182966670000000, 0.182966670000000, 0.183166670000000, 0.182966670000000, 0.182366670000000, 0.182566670000000, 0.182966670000000, 0.183366670000000, 0.183366670000000, 0.183266670000000, 0.183166670000000, 0.183166670000000, 0.183566670000000, 0.183666670000000, 0.183466670000000, 0.183566670000000, 0.183566670000000, 0.183266670000000, 0.183466670000000, 0.184166670000000, 0.184366670000000, 0.183966670000000, 0.184066670000000, 0.184266670000000, 0.183866670000000, 0.183466670000000, 0.183666670000000, 0.183766670000000, 0.183866670000000, 0.183966670000000, 0.184266670000000, 0.184066670000000, 0.184166670000000, 0.184466670000000, 0.184366670000000, 0.184366670000000, 0.184866670000000, 0.185066670000000, 0.184866670000000, 0.184666670000000, 0.185166670000000, 0.185266670000000, 0.185566670000000, 0.185466670000000, 0.185266670000000, 0.185166670000000, 0.184966670000000, 0.185066670000000, 0.185366670000000, 0.185166670000000, 0.185366670000000, 0.185766670000000, 0.185666670000000, 0.185666670000000, 0.185366670000000, 0.185466670000000, 0.185066670000000, 0.184666670000000, 0.184666670000000, 0.184766670000000, 0.185366670000000, 0.185166670000000, 0.185366670000000, 0.185166670000000, 0.184866670000000, 0.184866670000000, 0.184566670000000, 0.184466670000000, 0.184566670000000, 0.184866670000000, 0.184666670000000, 0.184466670000000, 0.184366670000000, 0.184166670000000, 0.183466670000000, 0.183666670000000, 0.183866670000000, 0.183366670000000, 0.182766670000000, 0.182866670000000, 0.183266670000000, 0.182866670000000, 0.182966670000000, 0.182766670000000, 0.181966670000000, 0.181666670000000, 0.181266670000000, 0.180866670000000, 0.180466670000000, 0.180366670000000, 0.180666670000000, 0.180266670000000, 0.179366670000000, 0.179266670000000, 0.179066670000000, 0.178666670000000, 0.178466670000000, 0.178366670000000, 0.177966670000000, 0.177566670000000, 0.177766670000000, 0.177166670000000, 0.176866670000000, 0.176266670000000, 0.175666670000000, 0.175466670000000, 0.174866670000000, 0.174466670000000, 0.174166670000000, 0.173966670000000, 0.174366670000000, 0.174266670000000, 0.173766670000000, 0.173466670000000, 0.173166670000000, 0.173266670000000, 0.172266670000000, 0.171866670000000, 0.171566670000000, 0.171266670000000, 0.170766670000000, 0.170366670000000, 0.169566670000000, 0.169466670000000, 0.169166670000000, 0.169666670000000, 0.169666670000000, 0.169366670000000, 0.169366670000000, 0.169566670000000, 0.169766670000000, 0.169566670000000, 0.169466670000000, 0.169366670000000, 0.168166670000000, 0.167566670000000, 0.166866670000000, 0.167066670000000, 0.166666670000000, 0.166066670000000, 0.166266670000000, 0.165766670000000, 0.165566670000000, 0.165566670000000, 0.165166670000000, 0.164566670000000, 0.164166670000000, 0.163566670000000, 0.162466670000000, 0.161766670000000, 0.161866670000000, 0.160966670000000, 0.160266670000000, 0.159866670000000, 0.159566670000000, 0.159166670000000, 0.158166670000000, 0.157666670000000, 0.157066670000000, 0.156266670000000, 0.155466670000000, 0.154566670000000, 0.153766670000000, 0.153066670000000, 0.152066670000000, 0.151666670000000, 0.150666670000000, 0.150066670000000, 0.149966670000000, 0.149566670000000, 0.148566670000000, 0.148066670000000, 0.147766670000000, 0.147266670000000, 0.146266670000000, 0.146266670000000, 0.145466670000000, 0.144966670000000, 0.144466670000000, 0.144366670000000, 0.144366670000000, 0.143666670000000, 0.143466670000000, 0.143366670000000, 0.142966670000000, 0.142866670000000, 0.142166670000000, 0.142066670000000, 0.142266670000000, 0.142066670000000, 0.141966670000000, 0.141666670000000, 0.141366670000000, 0.141466670000000, 0.141366670000000, 0.140866670000000, 0.140966670000000, 0.141366670000000, 0.141166670000000, 0.141166670000000, 0.141366670000000, 0.141266670000000, 0.140966670000000, 0.140866670000000, 0.141066670000000, 0.141066670000000, 0.140866670000000, 0.141166670000000, 0.140866670000000, 0.140766670000000, 0.141366670000000, 0.141266670000000, 0.140866670000000, 0.140866670000000, 0.140966670000000, 0.140766670000000, 0.140466670000000, 0.140466670000000, 0.140566670000000, 0.140566670000000, 0.140966670000000, 0.140666670000000, 0.140466670000000, 0.140266670000000, 0.140166670000000, 0.140366670000000, 0.140266670000000, 0.140466670000000, 0.140566670000000, 0.140966670000000, 0.141466670000000, 0.141066670000000, 0.141366670000000, 0.141166670000000, 0.141366670000000, 0.141766670000000, 0.141666670000000, 0.141466670000000, 0.141666670000000, 0.141966670000000, 0.142266670000000, 0.141866670000000, 0.141666670000000, 0.142066670000000, 0.142266670000000, 0.142266670000000, 0.142566670000000, 0.142666670000000, 0.142766670000000, 0.143166670000000, 0.143266670000000, 0.143266670000000, 0.143066670000000, 0.143366670000000, 0.143566670000000, 0.143666670000000, 0.143866670000000, 0.144066670000000, 0.144166670000000, 0.143866670000000, 0.144666670000000, 0.144666670000000, 0.144666670000000, 0.144666670000000, 0.144866670000000, 0.145066670000000, 0.145166670000000, 0.145266670000000, 0.145566670000000, 0.145666670000000, 0.146166670000000, 0.146266670000000, 0.145666670000000, 0.145866670000000, 0.146366670000000, 0.146366670000000, 0.146066670000000, 0.145966670000000, 0.145866670000000, 0.146066670000000, 0.146866670000000, 0.146966670000000, 0.146666670000000, 0.146666670000000, 0.146766670000000, 0.146966670000000, 0.146766670000000, 0.146666670000000, 0.146766670000000, 0.146666670000000, 0.147166670000000, 0.147166670000000, 0.147066670000000, 0.147166670000000, 0.146966670000000, 0.146866670000000, 0.147166670000000, 0.147166670000000, 0.147066670000000, 0.147266670000000, 0.147866670000000, 0.147666670000000, 0.147066670000000, 0.147566670000000, 0.147366670000000, 0.147766670000000, 0.147566670000000, 0.147466670000000, 0.147766670000000, 0.147966670000000, 0.147966670000000, 0.147666670000000, 0.147966670000000, 0.148366670000000, 0.148166670000000, 0.148166670000000, 0.148366670000000, 0.148866670000000, 0.148566670000000, 0.148666670000000, 0.148666670000000, 0.148766670000000, 0.149066670000000, 0.148866670000000, 0.148866670000000, 0.148966670000000, 0.148866670000000, 0.148866670000000, 0.149066670000000, 0.148966670000000, 0.149066670000000, 0.149366670000000, 0.149966670000000, 0.149966670000000, 0.149766670000000, 0.149966670000000, 0.149966670000000, 0.149866670000000, 0.149966670000000, 0.150166670000000, 0.150666670000000, 0.150266670000000, 0.150666670000000, 0.150866670000000, 0.151066670000000, 0.151166670000000, 0.150866670000000, 0.150866670000000, 0.151166670000000, 0.151666670000000, 0.152266670000000, 0.152066670000000, 0.151966670000000, 0.152266670000000, 0.152366670000000, 0.152666670000000, 0.152866670000000, 0.153266670000000, 0.153166670000000, 0.153166670000000, 0.153666670000000, 0.153266670000000, 0.153866670000000, 0.154266670000000, 0.154666670000000, 0.154566670000000, 0.154566670000000, 0.154766670000000, 0.154866670000000, 0.154266670000000, 0.154966670000000, 0.155266670000000, 0.155866670000000, 0.155766670000000, 0.156166670000000, 0.156266670000000, 0.156066670000000, 0.156266670000000, 0.156266670000000, 0.156266670000000, 0.156466670000000, 0.156566670000000, 0.156466670000000, 0.156166670000000, 0.156466670000000, 0.156966670000000, 0.156966670000000, 0.156966670000000, 0.157066670000000, 0.157266670000000, 0.157366670000000, 0.157366670000000, 0.157566670000000, 0.157366670000000, 0.157466670000000, 0.157766670000000, 0.157366670000000, 0.157166670000000, 0.157666670000000, 0.157366670000000, 0.157366670000000, 0.157266670000000, 0.157466670000000, 0.157166670000000, 0.156966670000000, 0.157066670000000, 0.156866670000000, 0.156766670000000, 0.156766670000000, 0.156966670000000, 0.156866670000000, 0.156766670000000, 0.156566670000000, 0.156466670000000, 0.156666670000000, 0.155966670000000, 0.155666670000000, 0.155966670000000, 0.155866670000000, 0.155566670000000, 0.155966670000000, 0.156866670000000, 0.156566670000000, 0.156466670000000, 0.156366670000000, 0.155766670000000, 0.155766670000000, 0.155666670000000, 0.155266670000000, 0.154866670000000, 0.155466670000000, 0.154866670000000, 0.154966670000000, 0.154966670000000, 0.154566670000000, 0.154566670000000, 0.153966670000000, 0.154066670000000, 0.154066670000000, 0.153966670000000, 0.154166670000000, 0.154066670000000, 0.153666670000000, 0.153666670000000, 0.153866670000000, 0.153566670000000, 0.153066670000000, 0.153066670000000, 0.153066670000000, 0.152666670000000, 0.152866670000000, 0.153066670000000, 0.153066670000000, 0.152766670000000, 0.152566670000000, 0.152466670000000, 0.152466670000000, 0.152666670000000, 0.152466670000000, 0.152266670000000, 0.152066670000000, 0.152366670000000, 0.152266670000000, 0.152166670000000, 0.151766670000000, 0.151666670000000, 0.151866670000000, 0.151966670000000, 0.151666670000000, 0.151566670000000, 0.151866670000000, 0.151366670000000, 0.151366670000000, 0.151466670000000, 0.151466670000000, 0.151466670000000, 0.151566670000000, 0.151466670000000, 0.151566670000000, 0.151266670000000, 0.151466670000000, 0.151166670000000, 0.151066670000000, 0.151566670000000, 0.151566670000000, 0.151766670000000, 0.152066670000000, 0.151866670000000, 0.151666670000000, 0.151766670000000, 0.151966670000000, 0.151766670000000, 0.151966670000000, 0.152366670000000, 0.152666670000000, 0.152566670000000, 0.152466670000000, 0.152566670000000, 0.152166670000000, 0.151766670000000, 0.152266670000000, 0.152266670000000, 0.151866670000000, 0.152066670000000, 0.152166670000000, 0.152266670000000, 0.152466670000000, 0.152166670000000, 0.152066670000000, 0.152066670000000, 0.152666670000000, 0.152666670000000, 0.152166670000000, 0.152066670000000, 0.151666670000000, 0.151566670000000, 0.150966670000000, 0.150366670000000, 0.150566670000000, 0.150366670000000, 0.150866670000000, 0.150766670000000, 0.150966670000000, 0.151266670000000, 0.150966670000000, 0.150966670000000, 0.150966670000000, 0.150766670000000, 0.151066670000000, 0.151266670000000, 0.151966670000000, 0.151966670000000, 0.151566670000000, 0.151666670000000, 0.151466670000000, 0.151966670000000, 0.152166670000000, 0.152066670000000, 0.152166670000000, 0.152266670000000, 0.152666670000000, 0.152266670000000, 0.151766670000000, 0.152166670000000, 0.152166670000000, 0.151866670000000, 0.152066670000000, 0.152166670000000, 0.152366670000000, 0.152666670000000, 0.153066670000000, 0.152766670000000, 0.152566670000000, 0.152466670000000, 0.152266670000000, 0.152366670000000, 0.152166670000000, 0.152466670000000, 0.152266670000000, 0.152066670000000, 0.153366670000000, 0.153166670000000, 0.153066670000000, 0.153166670000000, 0.152866670000000, 0.153066670000000, 0.153266670000000, 0.153166670000000, 0.153266670000000, 0.153266670000000, 0.153666670000000, 0.153566670000000, 0.154166670000000, 0.153366670000000, 0.152766670000000, 0.153166670000000, 0.153866670000000, 0.153566670000000, 0.153866670000000, 0.154166670000000, 0.154766670000000, 0.154666670000000, 0.154966670000000, 0.155166670000000, 0.155166670000000, 0.155366670000000, 0.155366670000000, 0.155466670000000, 0.155466670000000, 0.156166670000000, 0.156166670000000, 0.155866670000000, 0.155566670000000, 0.155466670000000, 0.155366670000000, 0.154966670000000, 0.154966670000000, 0.154866670000000, 0.154066670000000, 0.154366670000000, 0.155366670000000, 0.154466670000000, 0.153866670000000, 0.153866670000000, 0.153766670000000, 0.153566670000000, 0.153766670000000, 0.154266670000000, 0.154366670000000, 0.154366670000000, 0.154766670000000, 0.154966670000000, 0.154966670000000, 0.154666670000000, 0.155466670000000, 0.155666670000000, 0.156166670000000, 0.156466670000000, 0.156366670000000, 0.156166670000000, 0.156966670000000, 0.155966670000000, 0.154966670000000, 0.154466670000000, 0.152766670000000, 0.151866670000000, 0.151066670000000, 0.150066670000000, 0.148566670000000, 0.148066670000000, 0.147366670000000, 0.146166670000000, 0.145466670000000, 0.144266670000000, 0.143666670000000, 0.143766670000000, 0.143066670000000, 0.142366670000000, 0.141466670000000, 0.141666670000000, 0.141166670000000, 0.140166670000000, 0.139566670000000, 0.139266670000000, 0.138166670000000, 0.137666670000000, 0.136666670000000, 0.136166670000000, 0.134766670000000, 0.134066670000000, 0.132966670000000, 0.132166670000000, 0.131066670000000, 0.130366670000000, 0.129366670000000, 0.128366670000000, 0.127166670000000, 0.126666670000000, 0.124966670000000, 0.124066670000000, 0.123866670000000, 0.123266670000000, 0.121466670000000, 0.121966670000000, 0.121266670000000, 0.120666670000000, 0.120066670000000, 0.119766670000000, 0.118866670000000, 0.118466670000000, 0.118566670000000, 0.118966670000000, 0.118266670000000, 0.117466670000000, 0.118066670000000, 0.117666670000000, 0.117266670000000, 0.117966670000000, 0.118166670000000, 0.117666670000000, 0.117766670000000, 0.117766670000000, 0.117666670000000, 0.117466670000000, 0.117866670000000, 0.118366670000000, 0.118766670000000, 0.118366670000000, 0.118766670000000, 0.119166670000000, 0.119766670000000, 0.118866670000000, 0.118766670000000, 0.119166670000000, 0.119266670000000, 0.119366670000000, 0.119866670000000, 0.119966670000000, 0.120066670000000, 0.120566670000000, 0.120966670000000, 0.120666670000000, 0.120566670000000, 0.120566670000000, 0.120766670000000, 0.120766670000000, 0.121066670000000, 0.121066670000000, 0.120866670000000, 0.121166670000000, 0.121766670000000, 0.121466670000000, 0.121166670000000, 0.121466670000000, 0.121366670000000, 0.121566670000000, 0.121466670000000, 0.121466670000000, 0.121666670000000, 0.121766670000000, 0.122566670000000, 0.122566670000000, 0.122566670000000, 0.122966670000000, 0.123666670000000, 0.124266670000000, 0.124466670000000, 0.124866670000000, 0.125966670000000, 0.125966670000000, 0.127266670000000, 0.127666670000000, 0.128466670000000, 0.128366670000000, 0.128866670000000, 0.129066670000000, 0.129366670000000, 0.129366670000000, 0.129466670000000, 0.129766670000000, 0.130466670000000, 0.130466670000000, 0.130866670000000, 0.131066670000000, 0.131466670000000, 0.131866670000000, 0.132366670000000, 0.132266670000000, 0.132666670000000, 0.133166670000000, 0.133366670000000, 0.133166670000000, 0.133566670000000, 0.133866670000000, 0.133966670000000, 0.134166670000000, 0.134366670000000, 0.134266670000000, 0.134166670000000, 0.134266670000000, 0.135066670000000, 0.134766670000000, 0.134566670000000, 0.134466670000000, 0.134066670000000, 0.134066670000000, 0.133566670000000, 0.133266670000000, 0.133466670000000, 0.133266670000000, 0.133966670000000, 0.133666670000000, 0.133066670000000, 0.133466670000000, 0.133366670000000, 0.133266670000000, 0.133466670000000, 0.133466670000000, 0.133066670000000, 0.132866670000000, 0.132766670000000, 0.132366670000000, 0.132166670000000, 0.131966670000000, 0.131566670000000, 0.131866670000000, 0.131266670000000, 0.131066670000000, 0.130866670000000, 0.130766670000000, 0.130866670000000, 0.130466670000000, 0.129966670000000, 0.129866670000000, 0.129566670000000, 0.129666670000000, 0.129366670000000, 0.128866670000000, 0.128266670000000, 0.128366670000000, 0.128366670000000, 0.127766670000000, 0.127466670000000, 0.127166670000000, 0.126766670000000, 0.126666670000000, 0.126466670000000, 0.126466670000000, 0.126066670000000, 0.125866670000000, 0.125766670000000, 0.125366670000000, 0.125366670000000, 0.124766670000000, 0.124266670000000, 0.123866670000000, 0.123266670000000, 0.123566670000000, 0.123066670000000, 0.122766670000000, 0.122866670000000, 0.122666670000000, 0.122466670000000, 0.122366670000000, 0.122066670000000, 0.121866670000000, 0.121466670000000, 0.121566670000000, 0.121266670000000, 0.120766670000000, 0.121366670000000, 0.120966670000000, 0.120266670000000, 0.120266670000000, 0.120066670000000, 0.119766670000000, 0.120066670000000, 0.120266670000000, 0.119766670000000, 0.119366670000000, 0.119666670000000, 0.119366670000000, 0.119566670000000, 0.119266670000000, 0.118566670000000, 0.118466670000000, 0.119066670000000, 0.118766670000000, 0.118666670000000, 0.118666670000000, 0.119366670000000, 0.119166670000000, 0.119666670000000, 0.118866670000000, 0.118266670000000, 0.118666670000000, 0.119166670000000, 0.118866670000000, 0.118466670000000, 0.118566670000000, 0.119066670000000, 0.118166670000000, 0.119066670000000, 0.118866670000000, 0.118766670000000, 0.118666670000000, 0.118766670000000, 0.119466670000000, 0.118666670000000, 0.118766670000000, 0.119266670000000, 0.118566670000000, 0.118866670000000, 0.119166670000000, 0.118766670000000, 0.118866670000000, 0.118666670000000, 0.119366670000000, 0.119266670000000, 0.119166670000000, 0.119866670000000, 0.120166670000000, 0.119566670000000, 0.120166670000000, 0.120466670000000, 0.119966670000000, 0.120166670000000, 0.120166670000000, 0.120066670000000, 0.119166670000000, 0.120666670000000, 0.120466670000000, 0.120166670000000, 0.120266670000000, 0.119966670000000, 0.119866670000000, 0.120866670000000, 0.120566670000000, 0.120866670000000, 0.121366670000000, 0.121566670000000, 0.121466670000000, 0.121566670000000, 0.122166670000000, 0.123066670000000, 0.124166670000000, 0.123766670000000, 0.122766670000000, 0.123466670000000, 0.124066670000000, 0.125466670000000, 0.124666670000000, 0.124366670000000, 0.124266670000000, 0.124066670000000, 0.124366670000000, 0.124866670000000, 0.124266670000000, 0.124966670000000, 0.125366670000000, 0.125466670000000, 0.124766670000000, 0.124166670000000, 0.124366670000000, 0.124566670000000, 0.123966670000000, 0.124366670000000, 0.124166670000000, 0.124766670000000, 0.124866670000000, 0.125766670000000, 0.126066670000000, 0.125166670000000, 0.126466670000000, 0.126466670000000, 0.126266670000000, 0.127066670000000, 0.127766670000000, 0.127366670000000, 0.126366670000000, 0.128266670000000, 0.127966670000000, 0.127366670000000, 0.127666670000000, 0.128366670000000, 0.127566670000000, 0.126866670000000, 0.127266670000000, 0.128766670000000, 0.127966670000000, 0.129466670000000, 0.130066670000000, 0.129866670000000, 0.128666670000000, 0.128166670000000, 0.129366670000000, 0.128266670000000, 0.127366670000000, 0.129166670000000, 0.128166670000000, 0.130766670000000, 0.130766670000000, 0.130566670000000, 0.129566670000000, 0.128366670000000, 0.128366670000000, 0.128766670000000, 0.127366670000000, 0.127966670000000, 0.128066670000000, 0.129066670000000, 0.127766670000000, 0.127266670000000, 0.127966670000000, 0.129366670000000, 0.129166670000000, 0.128266670000000, 0.127666670000000, 0.125066670000000, 0.124566670000000, 0.126166670000000, 0.124966670000000, 0.125866670000000, 0.127566670000000, 0.125566670000000, 0.125466670000000, 0.122366670000000, 0.123766670000000, 0.121066670000000, 0.119666670000000, 0.122366670000000, 0.120966670000000, 0.119566670000000, 0.120766670000000, 0.119966670000000, 0.119666670000000, 0.118066670000000, 0.119066670000000, 0.118666670000000, 0.116166670000000, 0.117266670000000, 0.119666670000000, 0.118566670000000, 0.115766670000000, 0.115266670000000, 0.116666670000000, 0.116466670000000, 0.116066670000000, 0.112066670000000, 0.111066670000000, 0.112866670000000, 0.113366670000000, 0.114266670000000, 0.112766670000000, 0.112166670000000, 0.113766670000000, 0.110966670000000, 0.111066670000000, 0.111466670000000, 0.112766670000000, 0.112866670000000, 0.111966670000000, 0.110666670000000, 0.111066670000000, 0.113266670000000, 0.112366670000000, 0.110966670000000, 0.110166670000000, 0.110566670000000, 0.111666670000000, 0.113066670000000, 0.111166670000000, 0.112366670000000, 0.114466670000000, 0.112266670000000, 0.111066670000000, 0.111966670000000, 0.111466670000000, 0.110366670000000, 0.109466670000000, 0.114066670000000, 0.113466670000000, 0.113366670000000, 0.114566670000000, 0.113966670000000, 0.115766670000000, 0.113366670000000, 0.113366670000000, 0.111766670000000, 0.107366670000000, 0.111066670000000, 0.112666670000000, 0.110066670000000, 0.112066670000000, 0.113466670000000, 0.114266670000000, 0.113066670000000, 0.114066670000000, 0.107566670000000, 0.108066670000000, 0.116366670000000, 0.116666670000000, 0.115266670000000, 0.112266670000000, 0.114466670000000, 0.114066670000000, 0.113166670000000, 0.111466670000000, 0.109266670000000, 0.109466670000000, 0.111466670000000, 0.110066670000000, 0.111266670000000, 0.111166670000000, 0.111166670000000, 0.109866670000000, 0.110066670000000, 0.109966670000000, 0.106266670000000, 0.107566670000000, 0.111766670000000, 0.112066670000000, 0.111866670000000, 0.110366670000000, 0.107466670000000, 0.107366670000000, 0.111966670000000, 0.108066670000000, 0.108666670000000, 0.109066670000000, 0.111466670000000, 0.107166670000000, 0.104366670000000, 0.107766670000000, 0.110766670000000, 0.110666670000000, 0.110366670000000, 0.110566670000000, 0.111266670000000, 0.111266670000000, 0.113866670000000, 0.111566670000000, 0.109466670000000, 0.108666670000000, 0.110466670000000, 0.109866670000000, 0.105266670000000, 0.109966670000000, 0.108666670000000, 0.107466670000000, 0.112766670000000, 0.112366670000000, 0.111966670000000, 0.107366670000000, 0.110266670000000, 0.110666670000000, 0.109566670000000, 0.110466670000000, 0.110866670000000, 0.111566670000000, 0.109166670000000, 0.108766670000000, 0.104266670000000, 0.106766670000000, 0.107866670000000, 0.107566670000000, 0.109466670000000, 0.109366670000000, 0.106666670000000, 0.107566670000000, 0.116166670000000, 0.114266670000000, 0.114466670000000, 0.112966670000000, 0.109466670000000, 0.109566670000000, 0.107366670000000, 0.105566670000000, 0.109866670000000, 0.115766670000000, 0.117766670000000, 0.113166670000000, 0.111566670000000, 0.113766670000000, 0.112966670000000, 0.111766670000000, 0.114266670000000, 0.113666670000000, 0.108866670000000, 0.108766670000000, 0.113166670000000, 0.112966670000000, 0.111966670000000, 0.111366670000000, 0.111566670000000, 0.111466670000000, 0.110066670000000, 0.111066670000000, 0.113266670000000, 0.107466670000000, 0.114166670000000, 0.113266670000000, 0.111666670000000, 0.108766670000000, 0.105666670000000, 0.106766670000000, 0.106666670000000, 0.111266670000000, 0.109266670000000, 0.107466670000000, 0.112366670000000, 0.113366670000000, 0.110066670000000, 0.106366670000000, 0.109166670000000, 0.111166670000000, 0.105466670000000, 0.102966670000000, 0.105966670000000, 0.106266670000000, 0.112866670000000, 0.111366670000000, 0.107766670000000, 0.106366670000000, 0.104766670000000, 0.108966670000000, 0.109366670000000, 0.107966670000000, 0.106066670000000, 0.106666670000000, 0.105966670000000, 0.103066670000000, 0.102766670000000, 0.103266670000000, 0.099166667000000, 0.105166670000000, 0.105066670000000, 0.101866670000000, 0.104666670000000, 0.106366670000000, 0.105966670000000, 0.100866670000000, 0.101566670000000, 0.107166670000000, 0.105966670000000, 0.104966670000000, 0.105466670000000, 0.112866670000000, 0.106266670000000, 0.104466670000000, 0.106666670000000, 0.103566670000000, 0.103066670000000, 0.097566667000000, 0.108366670000000, 0.103966670000000, 0.102266670000000, 0.100266670000000, 0.102866670000000, 0.094066667000000, 0.104766670000000, 0.104166670000000, 0.091766667000000, 0.090566667000000, 0.094666667000000, 0.098866667000000, 0.095666667000000, 0.096666667000000, 0.094366667000000, 0.091066667000000, 0.097966667000000, 0.095066667000000, 0.099266667000000, 0.091966667000000, 0.094966667000000, 0.099266667000000, 0.094466667000000, 0.088366667000000, 0.092566667000000, 0.096466667000000, 0.094366667000000, 0.092866667000000, 0.102266670000000, 0.095266667000000, 0.089366667000000, 0.098566667000000, 0.099466667000000, 0.095866667000000, 0.085666667000000, 0.091066667000000, 0.103866670000000, 0.097166667000000, 0.102766670000000, 0.101766670000000, 0.099366667000000, 0.094266667000000, 0.091166667000000, 0.091466667000000, 0.084366667000000, 0.085066667000000, 0.100666670000000, 0.101466670000000, 0.098766667000000, 0.097666667000000, 0.097466667000000, 0.091866667000000, 0.084666667000000, 0.094666667000000, 0.096566667000000, 0.087066667000000, 0.107666670000000, 0.099666667000000, 0.093566667000000, 0.093566667000000, 0.094666667000000, 0.093066667000000, 0.086266667000000, 0.085966667000000, 0.092266667000000, 0.097966667000000, 0.099166667000000, 0.097866667000000, 0.088466667000000, 0.092166667000000, 0.096066667000000, 0.097566667000000, 0.107766670000000, 0.098166667000000, 0.092066667000000, 0.097566667000000, 0.107966670000000, 0.093366667000000, 0.102966670000000, 0.106766670000000, 0.100166670000000, 0.104166670000000, 0.099166667000000, 0.098266667000000, 0.095166667000000, 0.104766670000000, 0.098166667000000, 0.101566670000000, 0.097566667000000, 0.099966667000000, 0.085066667000000, 0.084866667000000, 0.094266667000000, 0.087966667000000, 0.094566667000000, 0.104766670000000, 0.104866670000000, 0.106666670000000, 0.104166670000000, 0.115366670000000, 0.110066670000000, 0.103766670000000, 0.104066670000000, 0.100766670000000, 0.112366670000000, 0.106266670000000, 0.116066670000000, 0.122966670000000, 0.106366670000000, 0.104566670000000, 0.114966670000000, 0.122566670000000, 0.115766670000000, 0.122266670000000, 0.112866670000000, 0.106066670000000, 0.128666670000000, 0.128066670000000, 0.120866670000000, 0.101866670000000, 0.108366670000000, 0.114366670000000, 0.114466670000000, 0.113466670000000, 0.110566670000000, 0.096666667000000, 0.118666670000000, 0.115566670000000, 0.107166670000000, 0.111266670000000, 0.117166670000000, 0.120366670000000, 0.123066670000000, 0.102666670000000, 0.098766667000000, 0.117266670000000, 0.145466670000000, 0.123366670000000, 0.123666670000000, 0.134666670000000, 0.129566670000000, 0.135366670000000, 0.120466670000000, 0.108766670000000, 0.112166670000000, 0.100266670000000, 0.128266670000000, 0.129966670000000, 0.118766670000000, 0.133766670000000, 0.129966670000000, 0.125766670000000, 0.127166670000000, 0.119066670000000, 0.116466670000000, 0.115366670000000, 0.124166670000000, 0.116166670000000, 0.109866670000000, 0.110566670000000, 0.116766670000000, 0.110366670000000, 0.111666670000000, 0.113966670000000, 0.107866670000000, 0.107066670000000, 0.118166670000000, 0.110466670000000, 0.109166670000000, 0.105866670000000, 0.095566667000000, 0.095566667000000, 0.097366667000000, 0.096366667000000, 0.092966667000000, 0.088466667000000, 0.092366667000000, 0.093266667000000, 0.095566667000000, 0.096666667000000, 0.102666670000000, 0.100966670000000, 0.092066667000000, 0.090066667000000, 0.093066667000000, 0.089966667000000, 0.095766667000000, 0.097966667000000, 0.099966667000000, 0.094166667000000, 0.092366667000000, 0.097866667000000, 0.094966667000000, 0.093866667000000, 0.094066667000000, 0.097466667000000, 0.106466670000000, 0.099966667000000, 0.102966670000000, 0.098166667000000, 0.103566670000000, 0.106166670000000, 0.103366670000000, 0.103466670000000, 0.092766667000000, 0.095466667000000, 0.114066670000000, 0.099866667000000, 0.094766667000000, 0.105166670000000, 0.092566667000000, 0.093666667000000, 0.080566667000000, 0.081866667000000, 0.080866667000000, 0.075166667000000, 0.101966670000000, 0.093266667000000, 0.074666667000000, 0.078366667000000, 0.085066667000000, 0.089066667000000, 0.087566667000000, 0.091166667000000, 0.098666667000000, 0.092466667000000, 0.139666670000000, 0.083266667000000, 0.064766667000000, 0.087166667000000, 0.156066670000000, 0.181266670000000, 0.122966670000000, 0.173566670000000, 0.207666670000000, 0.213466670000000, 0.178966670000000, 0.277466670000000, ])), DatasetLoader_AgfaIT872Set(): ('agfa', 289, '5', np.array([ 8.6300000000000000, 12.090000000000000, 14.140000000000000, 14.020000000000000, 14.160000000000000, 14.190000000000000, 14.250000000000000, 14.530000000000000, 14.810000000000000, 14.880000000000000, 14.480000000000000, 13.610000000000000, 12.600000000000000, 11.720000000000000, 11.600000000000000, 12.690000000000000, 14.160000000000000, 16.350000000000000, 18.900000000000000, 20.870000000000000, 21.630000000000000, 21.230000000000000, 20.360000000000000, 19.520000000000000, 18.790000000000000, 18.400000000000000, 18.530000000000000, 19.180000000000000, 20.460000000000000, 22.580000000000000, 25.470000000000000, ])), } for dataset_loader, values in dataset_loaders.items(): self.assertEqual(len(dataset_loader.load()[values[0]]), values[1]) np.testing.assert_array_almost_equal( dataset_loader.content[values[0]][values[2]].values, values[3], decimal=7) if __name__ == '__main__': unittest.main()
58.418605
78
0.281439
7,261
208,496
8.061837
0.315108
0.003007
0.003195
0.003229
0.145634
0.048448
0.04293
0.021491
0.021491
0.01927
0
0.838527
0.683423
208,496
3,568
79
58.434978
0.04833
0.002758
0
0.533106
0
0
0.001988
0.00052
0
0
0
0
0.001705
1
0.001137
false
0
0.001705
0
0.00341
0.000284
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
e29c9edf2f4ffd2271c79a4b1ba091fbd8bc11a6
148
py
Python
easy/561-array-partition-i.py
changmeng72/leecode_python3
8384f52f0dd74b06b1b6aefa277dde6a228ff5f3
[ "MIT" ]
null
null
null
easy/561-array-partition-i.py
changmeng72/leecode_python3
8384f52f0dd74b06b1b6aefa277dde6a228ff5f3
[ "MIT" ]
null
null
null
easy/561-array-partition-i.py
changmeng72/leecode_python3
8384f52f0dd74b06b1b6aefa277dde6a228ff5f3
[ "MIT" ]
null
null
null
class Solution: def arrayPairSum(self, nums: List[int]) -> int: nums.sort() return sum(nums[i] for i in range(0,len(nums),2))
37
57
0.594595
23
148
3.826087
0.782609
0
0
0
0
0
0
0
0
0
0
0.018018
0.25
148
4
57
37
0.774775
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
3
e2b4314ef8bc163fb60b81c13fb7809c116746e2
1,958
py
Python
notebook/filter_usage.py
vhn0912/python-snippets
80b2e1d6b2b8f12ae30d6dbe86d25bb2b3a02038
[ "MIT" ]
174
2018-05-30T21:14:50.000Z
2022-03-25T07:59:37.000Z
notebook/filter_usage.py
vhn0912/python-snippets
80b2e1d6b2b8f12ae30d6dbe86d25bb2b3a02038
[ "MIT" ]
5
2019-08-10T03:22:02.000Z
2021-07-12T20:31:17.000Z
notebook/filter_usage.py
vhn0912/python-snippets
80b2e1d6b2b8f12ae30d6dbe86d25bb2b3a02038
[ "MIT" ]
53
2018-04-27T05:26:35.000Z
2022-03-25T07:59:37.000Z
l = [-2, -1, 0, 1, 2] print(filter(lambda x: x % 2 == 0, l)) # <filter object at 0x10bb38580> print(type(filter(lambda x: x % 2 == 0, l))) # <class 'filter'> for i in filter(lambda x: x % 2 == 0, l): print(i) # -2 # 0 # 2 print(list(filter(lambda x: x % 2 == 0, l))) # [-2, 0, 2] print(list(filter(lambda x: x % 2 != 0, l))) # [-1, 1] l_s = ['apple', 'orange', 'strawberry'] print(list(filter(lambda x: x.endswith('e'), l_s))) # ['apple', 'orange'] print(list(filter(lambda x: not x.endswith('e'), l_s))) # ['strawberry'] def is_even(x): return x % 2 == 0 l = [-2, -1, 0, 1, 2] print(list(filter(is_even, l))) # [-2, 0, 2] l = [-2, -1, 0, 1, 2] print(list(filter(lambda x: x % 2 == 0 and x > 0, l))) # [2] print(list(filter(lambda x: x % 2 == 0 or x > 0, l))) # [-2, 0, 1, 2] l_b = [True, False] print(list(filter(None, l_b))) # [True] l = [-2, -1, 0, 1, 2] print(list(filter(None, l))) # [-2, -1, 1, 2] l_2d = [[0, 1, 2], [], [3, 4, 5]] print(list(filter(None, l_2d))) # [[0, 1, 2], [3, 4, 5]] l_s = ['apple', '', 'orange', 'strawberry'] print(list(filter(None, l_s))) # ['apple', 'orange', 'strawberry'] import itertools l = [-2, -1, 0, 1, 2] print(list(itertools.filterfalse(lambda x: x % 2 == 0, l))) # [-1, 1] print(list(itertools.filterfalse(lambda x: x % 2 != 0, l))) # [-2, 0, 2] l_s = ['apple', 'orange', 'strawberry'] print(list(itertools.filterfalse(lambda x: x.endswith('e'), l_s))) # ['strawberry'] l = [-2, -1, 0, 1, 2] print(list(itertools.filterfalse(None, l))) # [0] l = [-2, -1, 0, 1, 2] print([x for x in l if x % 2 == 0]) # [-2, 0, 2] print([x for x in l if x % 2 != 0]) # [-1, 1] l_s = ['apple', 'orange', 'strawberry'] print([x for x in l_s if x.endswith('e')]) # ['apple', 'orange'] print([x for x in l_s if not x.endswith('e')]) # ['strawberry'] l = [-2, -1, 0, 1, 2] print([x for x in l if x]) # [-2, -1, 1, 2] l_2d = [[0, 1, 2], [], [3, 4, 5]] print([x for x in l_2d if x]) # [[0, 1, 2], [3, 4, 5]]
20.610526
66
0.528601
380
1,958
2.676316
0.110526
0.035398
0.038348
0.079646
0.818092
0.725664
0.690265
0.540806
0.375615
0.27532
0
0.087484
0.200204
1,958
94
67
20.829787
0.561941
0.176711
0
0.302326
0
0
0.056151
0
0
0
0
0
0
1
0.023256
false
0
0.023256
0.023256
0.069767
0.55814
0
0
0
null
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
3
2c3893825d290c60d6561bfc9ae6b13bc756d82e
298
py
Python
AutotestWebD/apps/common/config/permissionConst.py
yangjourney/sosotest
2e88099a829749910ca325253c9b1a2e368d21a0
[ "MIT" ]
422
2019-08-18T05:04:20.000Z
2022-03-31T06:49:19.000Z
AutotestWebD/apps/common/config/permissionConst.py
LinSongJian1985/sosotest
091863dee531b5726650bb63efd6f169267cbeb4
[ "MIT" ]
10
2019-10-24T09:55:38.000Z
2021-09-29T17:28:43.000Z
AutotestWebD/apps/common/config/permissionConst.py
LinSongJian1985/sosotest
091863dee531b5726650bb63efd6f169267cbeb4
[ "MIT" ]
202
2019-08-18T05:04:27.000Z
2022-03-30T05:57:18.000Z
class PermissionConst: ''' 目前有几种权限: add / edit / check / copy / run / delete / distinct ''' urlAllPermission = "urlAllPermission" urlDefaultPermission = "urlDefaultPermission" user_permission = "user_permission" team_url_permission = "team_url_permission"
21.285714
57
0.671141
24
298
8.083333
0.666667
0.14433
0.175258
0.278351
0
0
0
0
0
0
0
0
0.241611
298
13
58
22.923077
0.858407
0.201342
0
0
0
0
0.334928
0
0
0
0
0
0
1
0
false
0
0
0
1
0
1
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
3
2c4650e94fee91b5f49f98368ac81c86ddacf390
265
py
Python
torabot/lang/targets/test/ut.py
Answeror/torabot
b6260190ec1f0dc8bf3f7ba3512c0522668c59ed
[ "MIT" ]
42
2015-01-20T10:45:08.000Z
2021-04-17T05:10:27.000Z
torabot/lang/targets/test/ut.py
Answeror/torabot
b6260190ec1f0dc8bf3f7ba3512c0522668c59ed
[ "MIT" ]
4
2015-01-23T05:40:44.000Z
2016-12-19T03:52:20.000Z
torabot/lang/targets/test/ut.py
Answeror/torabot
b6260190ec1f0dc8bf3f7ba3512c0522668c59ed
[ "MIT" ]
8
2015-05-07T03:51:05.000Z
2019-03-20T05:40:47.000Z
import os from ...envs.fs import Env CURRENT_PATH = os.path.abspath(os.path.dirname(__file__)) def make_fs_env(): return Env(CURRENT_PATH) def read(name): with open(os.path.join(CURRENT_PATH, name), 'rb') as f: return f.read().decode('utf-8')
17.666667
59
0.675472
44
265
3.863636
0.568182
0.194118
0.164706
0
0
0
0
0
0
0
0
0.004545
0.169811
265
14
60
18.928571
0.768182
0
0
0
0
0
0.026415
0
0
0
0
0
0
1
0.25
false
0
0.25
0.125
0.75
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
2c5b65c5e6531b659a8e6e99893df6321affb8d2
1,566
py
Python
budgeted_bo/experiment_manager.py
RaulAstudillo06/BudgetedBO
740cbf8397ac68bcdb1a196f2b56381adb1be1b4
[ "MIT" ]
1
2022-03-30T11:45:59.000Z
2022-03-30T11:45:59.000Z
budgeted_bo/experiment_manager.py
RaulAstudillo06/BudgetedBO
740cbf8397ac68bcdb1a196f2b56381adb1be1b4
[ "MIT" ]
null
null
null
budgeted_bo/experiment_manager.py
RaulAstudillo06/BudgetedBO
740cbf8397ac68bcdb1a196f2b56381adb1be1b4
[ "MIT" ]
null
null
null
from typing import Callable, Dict, List, Optional import os import sys from budgeted_bo.budgeted_bo_trial import budgeted_bo_trial def experiment_manager( problem: str, algo: str, algo_params: Dict, restart: bool, first_trial: int, last_trial: int, get_objective_cost_function: Callable, input_dim: int, n_init_evals: int, budget: float, n_max_iter: int = 200, ignore_failures: bool = False, ) -> None: for trial in range(first_trial, last_trial + 1): get_objective_cost_function_output = get_objective_cost_function(seed=trial) if len(get_objective_cost_function_output) == 1: objective_cost_function = get_objective_cost_function_output[0] objective_function = None cost_function = None elif len(get_objective_cost_function_output) == 2: objective_cost_function = None objective_function = get_objective_cost_function_output[0] cost_function = get_objective_cost_function_output[1] budgeted_bo_trial( problem=problem, algo=algo, algo_params=algo_params, trial=trial, restart=restart, objective_function=objective_function, cost_function=cost_function, objective_cost_function=objective_cost_function, input_dim=input_dim, n_init_evals=n_init_evals, budget=budget, n_max_iter=n_max_iter, ignore_failures=ignore_failures, )
29.54717
84
0.658365
185
1,566
5.145946
0.286486
0.201681
0.264706
0.201681
0.289916
0.201681
0.130252
0
0
0
0
0.008
0.281609
1,566
52
85
30.115385
0.838222
0
0
0
0
0
0
0
0
0
0
0
0
1
0.023256
false
0
0.093023
0
0.116279
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
2c6286fd32645a00f545efe144b70f41a29faabd
291
py
Python
src/djask/exceptions.py
z-t-y/Djask
d9867b3b91e2c50a07c701b4e2ef51a0c583c82c
[ "MIT" ]
19
2021-11-10T07:26:56.000Z
2022-02-07T08:45:48.000Z
src/djask/exceptions.py
z-t-y/Djask
d9867b3b91e2c50a07c701b4e2ef51a0c583c82c
[ "MIT" ]
2
2021-11-10T07:25:19.000Z
2021-11-30T14:23:53.000Z
src/djask/exceptions.py
z-t-y/Djask
d9867b3b91e2c50a07c701b4e2ef51a0c583c82c
[ "MIT" ]
1
2021-11-10T13:06:57.000Z
2021-11-10T13:06:57.000Z
AuthModelInvalid = Exception( "The auth model you passed to the app config" "should be a subclass of djask.auth.abstract.AbstractUser." ) ModelTypeError = TypeError( "The arg passed to register_model() must be a subclass of" "Model instead of PureModel or something else." )
32.333333
63
0.735395
40
291
5.325
0.7
0.075117
0.103286
0.122066
0
0
0
0
0
0
0
0
0.19244
291
8
64
36.375
0.906383
0
0
0
0
0
0.690722
0.113402
0
0
0
0
0
1
0
false
0.25
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
3
2cbc43e5fdf0860ab5f93a19da28d89f2488e1bd
308
py
Python
examples/plot_expression_vs_inconsistent_splicing.py
YeoLab/flotilla
31da64567e59003c2b9c03fc8f4eb27ee62e299c
[ "MIT", "BSD-3-Clause" ]
98
2015-01-08T19:38:47.000Z
2021-05-04T02:11:55.000Z
examples/plot_expression_vs_inconsistent_splicing.py
YeoLab/flotilla
31da64567e59003c2b9c03fc8f4eb27ee62e299c
[ "MIT", "BSD-3-Clause" ]
123
2015-01-08T22:28:43.000Z
2019-12-20T05:22:29.000Z
examples/plot_expression_vs_inconsistent_splicing.py
YeoLab/flotilla
31da64567e59003c2b9c03fc8f4eb27ee62e299c
[ "MIT", "BSD-3-Clause" ]
27
2015-01-21T15:41:40.000Z
2020-12-22T05:40:47.000Z
""" Show percentage of splicing events whose psi scores are inconsistent between pooled and single ============================================================================================== """ import flotilla study = flotilla.embark(flotilla._shalek2013) study.plot_expression_vs_inconsistent_splicing()
44
94
0.577922
27
308
6.407407
0.814815
0
0
0
0
0
0
0
0
0
0
0.013986
0.071429
308
7
95
44
0.590909
0.613636
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
2cc3614089af5f1da1c7bc8aa724616051ecf077
8,055
py
Python
moonv4/moon_db/moon_db/migrate_repo/versions/001_moon.py
hashnfv/hashnfv-moon
daaba34fa2ed4426bc0fde359e54a5e1b872208c
[ "Apache-2.0" ]
null
null
null
moonv4/moon_db/moon_db/migrate_repo/versions/001_moon.py
hashnfv/hashnfv-moon
daaba34fa2ed4426bc0fde359e54a5e1b872208c
[ "Apache-2.0" ]
null
null
null
moonv4/moon_db/moon_db/migrate_repo/versions/001_moon.py
hashnfv/hashnfv-moon
daaba34fa2ed4426bc0fde359e54a5e1b872208c
[ "Apache-2.0" ]
null
null
null
# Copyright 2015 Open Platform for NFV Project, Inc. and its contributors # This software is distributed under the terms and conditions of the 'Apache-2.0' # license which can be found in the file 'LICENSE' in this package distribution # or at 'http://www.apache.org/licenses/LICENSE-2.0'. import sqlalchemy as sql def upgrade(migrate_engine): meta = sql.MetaData() meta.bind = migrate_engine table = sql.Table( 'pdp', meta, sql.Column('id', sql.String(64), primary_key=True), sql.Column('value', sql.Text(), nullable=True), mysql_engine='InnoDB', mysql_charset='utf8') table.create(migrate_engine, checkfirst=True) table = sql.Table( 'policies', meta, sql.Column('id', sql.String(64), primary_key=True), sql.Column('value', sql.Text(), nullable=True), mysql_engine='InnoDB', mysql_charset='utf8') table.create(migrate_engine, checkfirst=True) table = sql.Table( 'models', meta, sql.Column('id', sql.String(64), primary_key=True), sql.Column('value', sql.Text(), nullable=True), mysql_engine='InnoDB', mysql_charset='utf8') table.create(migrate_engine, checkfirst=True) subject_categories_table = sql.Table( 'subject_categories', meta, sql.Column('id', sql.String(64), primary_key=True), sql.Column('name', sql.String(256), nullable=False), sql.Column('description', sql.String(256), nullable=True), mysql_engine='InnoDB', mysql_charset='utf8') subject_categories_table.create(migrate_engine, checkfirst=True) object_categories_table = sql.Table( 'object_categories', meta, sql.Column('id', sql.String(64), primary_key=True), sql.Column('name', sql.String(256), nullable=False), sql.Column('description', sql.String(256), nullable=True), mysql_engine='InnoDB', mysql_charset='utf8') object_categories_table.create(migrate_engine, checkfirst=True) action_categories_table = sql.Table( 'action_categories', meta, sql.Column('id', sql.String(64), primary_key=True), sql.Column('name', sql.String(256), nullable=False), sql.Column('description', sql.String(256), nullable=True), mysql_engine='InnoDB', mysql_charset='utf8') action_categories_table.create(migrate_engine, checkfirst=True) subjects_table = sql.Table( 'subjects', meta, sql.Column('id', sql.String(64), primary_key=True), sql.Column('value', sql.Text(), nullable=True), mysql_engine='InnoDB', mysql_charset='utf8') subjects_table.create(migrate_engine, checkfirst=True) objects_table = sql.Table( 'objects', meta, sql.Column('id', sql.String(64), primary_key=True), sql.Column('value', sql.Text(), nullable=True), mysql_engine='InnoDB', mysql_charset='utf8') objects_table.create(migrate_engine, checkfirst=True) actions_table = sql.Table( 'actions', meta, sql.Column('id', sql.String(64), primary_key=True), sql.Column('value', sql.Text(), nullable=True), mysql_engine='InnoDB', mysql_charset='utf8') actions_table.create(migrate_engine, checkfirst=True) subject_data_table = sql.Table( 'subject_data', meta, sql.Column('id', sql.String(64), primary_key=True), sql.Column('value', sql.Text(), nullable=True), sql.Column('category_id', sql.ForeignKey("subject_categories.id"), nullable=False), sql.Column('policy_id', sql.ForeignKey("policies.id"), nullable=False), mysql_engine='InnoDB', mysql_charset='utf8') subject_data_table.create(migrate_engine, checkfirst=True) object_data_table = sql.Table( 'object_data', meta, sql.Column('id', sql.String(64), primary_key=True), sql.Column('value', sql.Text(), nullable=True), sql.Column('category_id', sql.ForeignKey("object_categories.id"), nullable=False), sql.Column('policy_id', sql.ForeignKey("policies.id"), nullable=False), mysql_engine='InnoDB', mysql_charset='utf8') object_data_table.create(migrate_engine, checkfirst=True) action_data_table = sql.Table( 'action_data', meta, sql.Column('id', sql.String(64), primary_key=True), sql.Column('value', sql.Text(), nullable=True), sql.Column('category_id', sql.ForeignKey("action_categories.id"), nullable=False), sql.Column('policy_id', sql.ForeignKey("policies.id"), nullable=False), mysql_engine='InnoDB', mysql_charset='utf8') action_data_table.create(migrate_engine, checkfirst=True) subject_assignments_table = sql.Table( 'subject_assignments', meta, sql.Column('id', sql.String(64), primary_key=True), sql.Column('assignments', sql.Text(), nullable=True), sql.Column('policy_id', sql.ForeignKey("policies.id"), nullable=False), sql.Column('subject_id', sql.ForeignKey("subjects.id"), nullable=False), sql.Column('category_id', sql.ForeignKey("subject_categories.id"), nullable=False), mysql_engine='InnoDB', mysql_charset='utf8') subject_assignments_table.create(migrate_engine, checkfirst=True) object_assignments_table = sql.Table( 'object_assignments', meta, sql.Column('id', sql.String(64), primary_key=True), sql.Column('assignments', sql.Text(), nullable=True), sql.Column('policy_id', sql.ForeignKey("policies.id"), nullable=False), sql.Column('object_id', sql.ForeignKey("objects.id"), nullable=False), sql.Column('category_id', sql.ForeignKey("object_categories.id"), nullable=False), mysql_engine='InnoDB', mysql_charset='utf8') object_assignments_table.create(migrate_engine, checkfirst=True) action_assignments_table = sql.Table( 'action_assignments', meta, sql.Column('id', sql.String(64), primary_key=True), sql.Column('assignments', sql.Text(), nullable=True), sql.Column('policy_id', sql.ForeignKey("policies.id"), nullable=False), sql.Column('action_id', sql.ForeignKey("actions.id"), nullable=False), sql.Column('category_id', sql.ForeignKey("action_categories.id"), nullable=False), mysql_engine='InnoDB', mysql_charset='utf8') action_assignments_table.create(migrate_engine, checkfirst=True) meta_rules_table = sql.Table( 'meta_rules', meta, sql.Column('id', sql.String(64), primary_key=True), sql.Column('value', sql.Text(), nullable=True), mysql_engine='InnoDB', mysql_charset='utf8') meta_rules_table.create(migrate_engine, checkfirst=True) rules_table = sql.Table( 'rules', meta, sql.Column('id', sql.String(64), primary_key=True), sql.Column('rule', sql.Text(), nullable=True), sql.Column('policy_id', sql.ForeignKey("policies.id"), nullable=False), sql.Column('meta_rule_id', sql.ForeignKey("meta_rules.id"), nullable=False), mysql_engine='InnoDB', mysql_charset='utf8') rules_table.create(migrate_engine, checkfirst=True) def downgrade(migrate_engine): meta = sql.MetaData() meta.bind = migrate_engine for _table in ( 'rules', 'meta_rules', 'action_assignments', 'object_assignments', 'subject_assignments', 'action_data', 'object_data', 'subject_data', 'actions', 'objects', 'subjects', 'action_categories', 'object_categories', 'subject_categories', 'models', 'policies', 'pdp' ): try: table = sql.Table(_table, meta, autoload=True) table.drop(migrate_engine, checkfirst=True) except Exception as e: print(e)
37.119816
91
0.638485
948
8,055
5.24789
0.100211
0.097688
0.062714
0.097688
0.776482
0.776482
0.761206
0.637186
0.637186
0.598794
0
0.012236
0.218746
8,055
216
92
37.291667
0.778325
0.034885
0
0.759358
0
0
0.146517
0.005407
0
0
0
0
0
1
0.010695
false
0
0.005348
0
0.016043
0.005348
0
0
0
null
0
0
0
0
1
1
0
0
0
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
3
e2c47328612db2e98bae7524f25a77728b3348bc
260
py
Python
chess/players.py
Jonxslays/Chess
e7dbad1bfb2825fa8db616c64e9e3719e58c526c
[ "MIT" ]
1
2021-12-16T13:33:05.000Z
2021-12-16T13:33:05.000Z
chess/players.py
Jonxslays/Chess
e7dbad1bfb2825fa8db616c64e9e3719e58c526c
[ "MIT" ]
null
null
null
chess/players.py
Jonxslays/Chess
e7dbad1bfb2825fa8db616c64e9e3719e58c526c
[ "MIT" ]
null
null
null
from __future__ import annotations from dataclasses import dataclass, field from chess.moves import Move @dataclass class Player: """Represents a chess player.""" color: str score: int = 0 captures: list[Move] = field(default_factory=list)
18.571429
54
0.726923
33
260
5.575758
0.69697
0
0
0
0
0
0
0
0
0
0
0.004762
0.192308
260
13
55
20
0.871429
0.1
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.375
0
0.875
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
3
e2d1bb0b22edf3413b741eb5f67bcbec7c51c19a
1,470
py
Python
work_dirs_bottle/cascade_rcnn_r50_fpn/reclass.py
speciallan/mmdetection
786a6b4eb9f0b9bb3fd5b3ab81ede7d1b23573d6
[ "Apache-2.0" ]
null
null
null
work_dirs_bottle/cascade_rcnn_r50_fpn/reclass.py
speciallan/mmdetection
786a6b4eb9f0b9bb3fd5b3ab81ede7d1b23573d6
[ "Apache-2.0" ]
null
null
null
work_dirs_bottle/cascade_rcnn_r50_fpn/reclass.py
speciallan/mmdetection
786a6b4eb9f0b9bb3fd5b3ab81ede7d1b23573d6
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author:Speciallan def main(): #gen coco pretrained weight path = './work_dirs_bottle/cascade_rcnn_r50_fpn/checkpoints/' import torch num_classes = 11 model_coco = torch.load(path+"cascade_rcnn_dconv_c3-c5_r50_fpn_1x_20190125-dfa53166.pth") # weight model_coco = torch.load(path+"cascade_rcnn_dconv_c3-c5_r101_fpn_1x_20190125-aaa877cc.pth") # weight model_coco = torch.load(path+"cascade_rcnn_x101_32x4d_fpn_2x_20181218-28f73c4c.pth") # weight model_coco["state_dict"]["bbox_head.0.fc_cls.weight"] = model_coco["state_dict"]["bbox_head.0.fc_cls.weight"][ :num_classes, :] model_coco["state_dict"]["bbox_head.1.fc_cls.weight"] = model_coco["state_dict"]["bbox_head.1.fc_cls.weight"][ :num_classes, :] model_coco["state_dict"]["bbox_head.2.fc_cls.weight"] = model_coco["state_dict"]["bbox_head.2.fc_cls.weight"][ :num_classes, :] model_coco["state_dict"]["bbox_head.0.fc_cls.bias"] = model_coco["state_dict"]["bbox_head.0.fc_cls.bias"][ :num_classes] model_coco["state_dict"]["bbox_head.1.fc_cls.bias"] = model_coco["state_dict"]["bbox_head.1.fc_cls.bias"][ :num_classes] model_coco["state_dict"]["bbox_head.2.fc_cls.bias"] = model_coco["state_dict"]["bbox_head.2.fc_cls.bias"][ :num_classes] # save new model torch.save(model_coco, path+"cascade_rcnn_x101_coco_pretrained_weights_classes_%d.pth" % num_classes) if __name__ == "__main__": main()
63.913043
134
0.729252
233
1,470
4.171674
0.261803
0.148148
0.17284
0.222222
0.66358
0.653292
0.653292
0.653292
0.653292
0.600823
0
0.057121
0.106803
1,470
23
135
63.913043
0.683168
0.082313
0
0
0
0
0.514903
0.419523
0
0
0
0
0
1
0.0625
false
0
0.0625
0
0.125
0
0
0
0
null
0
0
1
0
0
0
0
0
1
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
3
e2d59b1a9aed0843e778775b09a7e6c0571ef6a6
206
py
Python
Asset/Elements/Utility/DummyBuildingUtility.py
vd1371/GIAMS
dd6551f344b8d0377131d4496846eb5d03b6189c
[ "MIT" ]
null
null
null
Asset/Elements/Utility/DummyBuildingUtility.py
vd1371/GIAMS
dd6551f344b8d0377131d4496846eb5d03b6189c
[ "MIT" ]
null
null
null
Asset/Elements/Utility/DummyBuildingUtility.py
vd1371/GIAMS
dd6551f344b8d0377131d4496846eb5d03b6189c
[ "MIT" ]
null
null
null
import numpy as np from .BaseUtility import BaseUtility class DummyUtility(BaseUtility): def __init__(self): super().__init__() def utility_function(self, x): return 100 * (1 - np.exp(-0.19 * x))
18.727273
38
0.708738
29
206
4.724138
0.724138
0
0
0
0
0
0
0
0
0
0
0.040698
0.165049
206
11
39
18.727273
0.755814
0
0
0
0
0
0
0
0
0
0
0
0
1
0.285714
false
0
0.285714
0.142857
0.857143
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
3
3934036821b99f3a446c5842236bd774d012e9ea
283
py
Python
pirates.py
sanjeev8386/Debugging
dd4ad640cf22af1d06d3bdccb74acab29bab47fc
[ "Apache-2.0" ]
5
2019-03-03T06:18:45.000Z
2019-03-03T06:27:29.000Z
pirates.py
sanjeev8386/Debugging
dd4ad640cf22af1d06d3bdccb74acab29bab47fc
[ "Apache-2.0" ]
null
null
null
pirates.py
sanjeev8386/Debugging
dd4ad640cf22af1d06d3bdccb74acab29bab47fc
[ "Apache-2.0" ]
null
null
null
# greeting = input("Kya naam hai aapka?") # print(greeting) # greeting = input("Kya naam hai aapka?") # print(greeting) greeting = input("Hello, pirate ji! Andar aane ka password batao?") if "AbraKaDabra" == greeting: print("Andar aao ji!") else: print("Bhaag jaa pirate!")
28.3
67
0.674912
38
283
5.026316
0.552632
0.204188
0.167539
0.209424
0.497382
0.497382
0.497382
0.497382
0.497382
0.497382
0
0
0.169611
283
10
68
28.3
0.812766
0.392226
0
0
0
0
0.52381
0
0
0
0
0
0
1
0
false
0.2
0
0
0
0.4
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
3
3942c26296f00630ee50c69c002e490850562b67
14,568
py
Python
src/the_tale/the_tale/game/actions/tests/test_meta_action_arena_pvp_1x1.py
devapromix/the-tale
2a10efd3270734f8cf482b4cfbc5353ef8f0494c
[ "BSD-3-Clause" ]
1
2020-04-02T11:51:20.000Z
2020-04-02T11:51:20.000Z
src/the_tale/the_tale/game/actions/tests/test_meta_action_arena_pvp_1x1.py
devapromix/the-tale
2a10efd3270734f8cf482b4cfbc5353ef8f0494c
[ "BSD-3-Clause" ]
null
null
null
src/the_tale/the_tale/game/actions/tests/test_meta_action_arena_pvp_1x1.py
devapromix/the-tale
2a10efd3270734f8cf482b4cfbc5353ef8f0494c
[ "BSD-3-Clause" ]
null
null
null
import smart_imports smart_imports.all() class ArenaPvP1x1Test(utils_testcase.TestCase, pvp_helpers.PvPTestsMixin): def setUp(self): super(ArenaPvP1x1Test, self).setUp() game_logic.create_test_map() self.account_1 = self.accounts_factory.create_account() self.account_2 = self.accounts_factory.create_account() self.storage = game_logic_storage.LogicStorage() self.storage.load_account_data(self.account_1) self.storage.load_account_data(self.account_2) self.hero_1 = self.storage.accounts_to_heroes[self.account_1.id] self.hero_2 = self.storage.accounts_to_heroes[self.account_2.id] # for test data reset self.hero_1.health = self.hero_1.max_health / 2 self.battle_1 = self.pvp_create_battle(self.account_1, self.account_2, pvp_relations.BATTLE_1X1_STATE.PROCESSING) self.battle_1.calculate_rating = True self.battle_1.save() self.battle_2 = self.pvp_create_battle(self.account_2, self.account_1, pvp_relations.BATTLE_1X1_STATE.PROCESSING) self.battle_2.calculate_rating = True self.battle_2.save() self.meta_action_battle = meta_actions.ArenaPvP1x1.create(self.storage, self.hero_1, self.hero_2) self.meta_action_battle.set_storage(self.storage) prototypes.ActionMetaProxyPrototype.create(hero=self.hero_1, _bundle_id=self.hero_1.actions.current_action.bundle_id, meta_action=self.meta_action_battle) prototypes.ActionMetaProxyPrototype.create(hero=self.hero_2, _bundle_id=self.hero_1.actions.current_action.bundle_id, meta_action=self.meta_action_battle) def test_serialization(self): self.assertEqual(self.meta_action_battle.serialize(), meta_actions.ArenaPvP1x1.deserialize(self.meta_action_battle.serialize()).serialize()) def test_initialization(self): self.assertTrue(self.meta_action_battle.storage) self.assertEqual(self.meta_action_battle.hero_1, self.hero_1) self.assertEqual(self.meta_action_battle.hero_2, self.hero_2) self.assertEqual(self.meta_action_battle.uid, '%s#%d#%d' % (self.meta_action_battle.TYPE.value, self.hero_1.id, self.hero_2.id)) # test reset of pvp_data self.assertEqual(self.meta_action_battle.hero_1.health, self.hero_1.max_health) self.assertEqual(self.meta_action_battle.hero_1_pvp.advantage, 0) self.assertEqual(self.meta_action_battle.hero_1_pvp.effectiveness, c.PVP_EFFECTIVENESS_INITIAL) self.assertEqual(self.meta_action_battle.hero_1_pvp.energy, 0) self.assertEqual(self.meta_action_battle.hero_1_pvp.energy_speed, 1) self.assertEqual(self.meta_action_battle.hero_1_pvp.turn_advantage, 0) self.assertEqual(self.meta_action_battle.hero_1_pvp.turn_effectiveness, c.PVP_EFFECTIVENESS_INITIAL) self.assertEqual(self.meta_action_battle.hero_1_pvp.turn_energy, 0) self.assertEqual(self.meta_action_battle.hero_1_pvp.turn_energy_speed, 1) self.assertTrue(self.meta_action_battle.hero_1_context.pvp_advantage_strike_damage.total > 0) self.assertEqual(self.meta_action_battle.hero_2.health, self.hero_2.max_health) self.assertEqual(self.meta_action_battle.hero_2_pvp.advantage, 0) self.assertEqual(self.meta_action_battle.hero_2_pvp.effectiveness, c.PVP_EFFECTIVENESS_INITIAL) self.assertEqual(self.meta_action_battle.hero_2_pvp.energy, 0) self.assertEqual(self.meta_action_battle.hero_2_pvp.energy_speed, 1) self.assertEqual(self.meta_action_battle.hero_2_pvp.turn_advantage, 0) self.assertEqual(self.meta_action_battle.hero_2_pvp.turn_effectiveness, c.PVP_EFFECTIVENESS_INITIAL) self.assertEqual(self.meta_action_battle.hero_2_pvp.turn_energy, 0) self.assertEqual(self.meta_action_battle.hero_2_pvp.turn_energy_speed, 1) self.assertTrue(self.meta_action_battle.hero_2_context.pvp_advantage_strike_damage.total > 0) def test_one_hero_killed(self): self.hero_1.health = 0 self.meta_action_battle.process() self.assertEqual(self.meta_action_battle.state, meta_actions.ArenaPvP1x1.STATE.BATTLE_ENDING) game_turn.increment() self.meta_action_battle.process() self.assertEqual(self.meta_action_battle.state, meta_actions.ArenaPvP1x1.STATE.PROCESSED) self.assertTrue(self.hero_1.is_alive and self.hero_2.is_alive) self.assertEqual(self.hero_1.health, self.hero_1.max_health / 2) self.assertEqual(self.hero_2.health, self.hero_2.max_health) def check_hero_pvp_statistics(self, hero, battles, victories, draws, defeats): self.assertEqual(hero.statistics.pvp_battles_1x1_number, battles) self.assertEqual(hero.statistics.pvp_battles_1x1_victories, victories) self.assertEqual(hero.statistics.pvp_battles_1x1_draws, draws) self.assertEqual(hero.statistics.pvp_battles_1x1_defeats, defeats) def _end_battle(self, hero_1_health, hero_2_health): self.hero_1.health = hero_1_health self.hero_2.health = hero_2_health self.meta_action_battle.process() game_turn.increment() self.meta_action_battle.process() def test_hero_1_win(self): self._end_battle(hero_1_health=self.hero_1.max_health, hero_2_health=0) self.assertEqual(pvp_prototypes.Battle1x1Prototype._model_class.objects.all().count(), 0) self.check_hero_pvp_statistics(self.hero_1, 1, 1, 0, 0) self.check_hero_pvp_statistics(self.hero_2, 1, 0, 0, 1) def test_hero_2_win(self): self._end_battle(hero_1_health=0, hero_2_health=self.hero_2.max_health) self.assertEqual(pvp_prototypes.Battle1x1Prototype._model_class.objects.all().count(), 0) self.check_hero_pvp_statistics(self.hero_1, 1, 0, 0, 1) self.check_hero_pvp_statistics(self.hero_2, 1, 1, 0, 0) def test_draw(self): self._end_battle(hero_1_health=0, hero_2_health=0) self.assertEqual(pvp_prototypes.Battle1x1Prototype._model_class.objects.all().count(), 0) self.check_hero_pvp_statistics(self.hero_1, 1, 0, 1, 0) self.check_hero_pvp_statistics(self.hero_2, 1, 0, 1, 0) @mock.patch('the_tale.game.pvp.prototypes.Battle1x1Prototype.calculate_rating', False) def test_hero_1_win_no_stats(self): self._end_battle(hero_1_health=self.hero_1.max_health, hero_2_health=0) self.check_hero_pvp_statistics(self.hero_1, 0, 0, 0, 0) self.check_hero_pvp_statistics(self.hero_2, 0, 0, 0, 0) @mock.patch('the_tale.game.pvp.prototypes.Battle1x1Prototype.calculate_rating', False) def test_hero_2_win_no_stats(self): self._end_battle(hero_1_health=0, hero_2_health=self.hero_1.max_health) self.check_hero_pvp_statistics(self.hero_1, 0, 0, 0, 0) self.check_hero_pvp_statistics(self.hero_2, 0, 0, 0, 0) @mock.patch('the_tale.game.pvp.prototypes.Battle1x1Prototype.calculate_rating', False) def test_draw_no_stats(self): self._end_battle(hero_1_health=0, hero_2_health=0) self.check_hero_pvp_statistics(self.hero_1, 0, 0, 0, 0) self.check_hero_pvp_statistics(self.hero_2, 0, 0, 0, 0) def test_second_process_call_in_one_turn(self): with mock.patch('the_tale.game.actions.meta_actions.ArenaPvP1x1._process') as meta_action_process_counter: self.meta_action_battle.process() self.meta_action_battle.process() self.assertEqual(meta_action_process_counter.call_count, 1) def test_update_hero_pvp_info(self): self.meta_action_battle.hero_2_pvp.set_effectiveness(50) self.meta_action_battle.update_hero_pvp_info(self.meta_action_battle.hero_2_pvp) self.assertTrue(self.meta_action_battle.hero_2_pvp.energy > self.meta_action_battle.hero_1_pvp.energy) self.assertTrue(0 < self.meta_action_battle.hero_2_pvp.effectiveness < 50) # rename quest to fixt segmentation fault def test_z_advantage_after_turn(self): self.meta_action_battle.hero_1_pvp.set_effectiveness(50) self.meta_action_battle.hero_2_pvp.set_effectiveness(25) self.meta_action_battle.process() self.assertTrue(self.meta_action_battle.hero_1_pvp.advantage > 0) self.assertTrue(self.meta_action_battle.hero_2_pvp.advantage < 0) def test_full_battle(self): self.assertEqual(pvp_models.Battle1x1.objects.filter(state=pvp_relations.BATTLE_1X1_STATE.PROCESSING).count(), 2) while self.meta_action_battle.state != meta_actions.ArenaPvP1x1.STATE.PROCESSED: self.meta_action_battle.process() game_turn.increment() self.assertEqual(self.meta_action_battle.state, meta_actions.ArenaPvP1x1.STATE.PROCESSED) self.assertTrue(self.hero_1.is_alive and self.hero_2.is_alive) self.assertEqual(self.hero_1.health, self.hero_1.max_health / 2) self.assertEqual(self.hero_2.health, self.hero_2.max_health) self.assertEqual(pvp_models.Battle1x1.objects.all().count(), 0) self.assertEqual(pvp_models.Battle1x1Result.objects.all().count(), 1) battle_result = pvp_models.Battle1x1Result.objects.all()[0] self.assertNotEqual(battle_result.participant_1_id, battle_result.participant_2_id) def test_get_bot_pvp_properties(self): properties = self.meta_action_battle.bot_pvp_properties self.assertEqual(set(properties.keys()), set(('ability_chance', 'priorities'))) self.assertTrue(0 < properties['ability_chance'] <= 1) self.assertEqual(set(properties['priorities']), set(pvp_abilities.ABILITIES.keys())) for ability_priority in properties['priorities'].values(): self.assertTrue(ability_priority > 0) def test_process_bot_called__hero_1(self): self.hero_1.is_bot = True with mock.patch('the_tale.game.actions.meta_actions.ArenaPvP1x1.process_bot') as process_bot: self.meta_action_battle.process() self.assertEqual(process_bot.call_count, 1) self.assertEqual(process_bot.call_args[1]['bot'].id, self.hero_1.id) self.assertEqual(process_bot.call_args[1]['enemy'].id, self.hero_2.id) def test_process_bot_called__hero_2(self): self.hero_2.is_bot = True with mock.patch('the_tale.game.actions.meta_actions.ArenaPvP1x1.process_bot') as process_bot: self.meta_action_battle.process() self.assertEqual(process_bot.call_count, 1) self.assertEqual(process_bot.call_args[1]['bot'].id, self.hero_2.id) self.assertEqual(process_bot.call_args[1]['enemy'].id, self.hero_1.id) def test_process_bot_called__use_ability(self): self.hero_1.is_bot = True self.meta_action_battle.hero_1_pvp.set_energy(10) properties = self.meta_action_battle.bot_pvp_properties properties['ability_chance'] = 1.0 self.meta_action_battle.hero_2_pvp.set_energy_speed(2) # flame abilitie will not be used, if enemy energy speed is 1 self.meta_action_battle.process() self.assertTrue(self.meta_action_battle.hero_1_pvp.energy in (1, 2)) def test_initialize_bots__bot_is_second(self): account_1 = self.accounts_factory.create_account() account_2 = self.accounts_factory.create_account(is_bot=True) storage = game_logic_storage.LogicStorage() storage.load_account_data(account_1) storage.load_account_data(account_2) hero_1 = storage.accounts_to_heroes[account_1.id] hero_2 = storage.accounts_to_heroes[account_2.id] hero_1.level = 50 self.assertEqual(hero_2.level, 1) meta_actions.ArenaPvP1x1.create(storage, hero_1, hero_2) self.assertEqual(hero_2.level, 50) self.assertTrue(len(hero_2.abilities.all) > 1) self.assertEqual(hero_2.health, hero_2.max_health) def test_initialize_bots__bot_is_first(self): account_1 = self.accounts_factory.create_account(is_bot=True) account_2 = self.accounts_factory.create_account() storage = game_logic_storage.LogicStorage() storage.load_account_data(account_1) storage.load_account_data(account_2) hero_1 = storage.accounts_to_heroes[account_1.id] hero_2 = storage.accounts_to_heroes[account_2.id] hero_2.level = 50 self.assertEqual(hero_1.level, 1) meta_actions.ArenaPvP1x1.create(storage, hero_1, hero_2) self.assertEqual(hero_1.level, 50) self.assertTrue(len(hero_1.abilities.all) > 1) self.assertEqual(hero_1.health, hero_1.max_health) def test_initialize_bots__second_create(self): account_1 = self.accounts_factory.create_account() account_2 = self.accounts_factory.create_account(is_bot=True) storage = game_logic_storage.LogicStorage() storage.load_account_data(account_1) storage.load_account_data(account_2) hero_1 = storage.accounts_to_heroes[account_1.id] hero_2 = storage.accounts_to_heroes[account_2.id] hero_1.level = 50 self.assertEqual(hero_2.level, 1) self.pvp_create_battle(account_1, account_2, pvp_relations.BATTLE_1X1_STATE.PROCESSING) self.pvp_create_battle(account_2, account_1, pvp_relations.BATTLE_1X1_STATE.PROCESSING) meta_action = meta_actions.ArenaPvP1x1.create(storage, hero_1, hero_2) meta_action.process_battle_ending() meta_actions.ArenaPvP1x1.create(storage, hero_1, hero_2) self.assertEqual(hero_2.level, 50) self.assertTrue(len(hero_2.abilities.all) > 1) self.assertEqual(hero_2.health, hero_2.max_health) def test_process_bot__flame_ability_not_used(self): account_1 = self.accounts_factory.create_account(is_bot=True) account_2 = self.accounts_factory.create_account() storage = game_logic_storage.LogicStorage() storage.load_account_data(account_1) storage.load_account_data(account_2) hero_1 = storage.accounts_to_heroes[account_1.id] hero_2 = storage.accounts_to_heroes[account_2.id] self.meta_action_battle.bot_pvp_properties = {'priorities': {pvp_abilities.Flame.TYPE: 1}, 'ability_chance': 1} self.assertEqual(self.meta_action_battle.hero_2_pvp.energy_speed, 1) with mock.patch('the_tale.game.pvp.abilities.Flame.use') as use: for i in range(100): self.meta_action_battle.process_bot(hero_1, hero_2, self.meta_action_battle.hero_2_pvp) self.assertEqual(use.call_count, 0)
45.102167
162
0.737095
2,105
14,568
4.729691
0.078385
0.037164
0.091402
0.130575
0.845621
0.791784
0.71826
0.662616
0.598734
0.538971
0
0.032624
0.164676
14,568
322
163
45.242236
0.785521
0.009747
0
0.402715
0
0
0.036061
0.027739
0
0
0
0
0.339367
1
0.108597
false
0
0.00905
0
0.122172
0
0
0
0
null
0
0
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
3945918df30a9ed54072945849738662d8767f6a
461
py
Python
sources/t08/t08ej08.py
workready/pythonbasic
59bd82caf99244f5e711124e1f6f4dec8de22141
[ "MIT" ]
null
null
null
sources/t08/t08ej08.py
workready/pythonbasic
59bd82caf99244f5e711124e1f6f4dec8de22141
[ "MIT" ]
null
null
null
sources/t08/t08ej08.py
workready/pythonbasic
59bd82caf99244f5e711124e1f6f4dec8de22141
[ "MIT" ]
null
null
null
from functools import wraps def debug(func): msg = func.__qualname__ @wraps(func) def wrapper(*args, **kwargs): print(msg) return func(*args, **kwargs) return wrapper @debug def add(x, y): """ Función que suma dos números """ return x + y @debug def sub(x, y): return x - y @debug def mul(x, y): return x * y @debug def div(x, y): return x / y add(2, 2) sub(8, 3) mul(5,6) div(16, 2) help(add)
14.40625
36
0.566161
75
461
3.426667
0.426667
0.062257
0.124514
0.151751
0.241245
0.140078
0.140078
0
0
0
0
0.027439
0.288503
461
32
37
14.40625
0.756098
0.060738
0
0.16
0
0
0
0
0
0
0
0
0
1
0.24
false
0
0.04
0.12
0.52
0.04
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
39512081e501bea95e39139b8a09e836d559e349
61
py
Python
ninja_schema/types.py
eadwinCode/django-schema
94280270aa4f9c8ed08808c938283a4e217d17f0
[ "MIT" ]
9
2021-10-31T22:03:00.000Z
2022-03-27T19:40:40.000Z
ninja_schema/types.py
eadwinCode/django-schema
94280270aa4f9c8ed08808c938283a4e217d17f0
[ "MIT" ]
null
null
null
ninja_schema/types.py
eadwinCode/django-schema
94280270aa4f9c8ed08808c938283a4e217d17f0
[ "MIT" ]
null
null
null
from typing import Any, Dict DictStrAny = Dict[str, Any]
15.25
29
0.704918
9
61
4.777778
0.777778
0
0
0
0
0
0
0
0
0
0
0
0.213115
61
3
30
20.333333
0.895833
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
1a7d17cec7b26d8f082204fb03126fadc5b321d1
274
py
Python
docker_monitor/checks/active_build.py
cfpb/docker-monitor
b2073fcf79816744b3d3915b410f105b72b29f54
[ "CC0-1.0" ]
1
2021-07-14T02:36:43.000Z
2021-07-14T02:36:43.000Z
docker_monitor/checks/active_build.py
cfpb/docker-monitor
b2073fcf79816744b3d3915b410f105b72b29f54
[ "CC0-1.0" ]
null
null
null
docker_monitor/checks/active_build.py
cfpb/docker-monitor
b2073fcf79816744b3d3915b410f105b72b29f54
[ "CC0-1.0" ]
1
2021-02-18T11:38:52.000Z
2021-02-18T11:38:52.000Z
import logging from docker_monitor.policy import PolicyCheck logger = logging.getLogger(__name__) class ActiveBuildCheck(PolicyCheck): description = "is actively building" def __call__(self, container): # return self.PASS_FAST return self.PASS
18.266667
45
0.737226
30
274
6.4
0.766667
0.104167
0.145833
0
0
0
0
0
0
0
0
0
0.19708
274
14
46
19.571429
0.872727
0.076642
0
0
0
0
0.079681
0
0
0
0
0
0
1
0.142857
false
0.142857
0.285714
0.142857
0.857143
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
1
1
0
0
3
1a823f974ae1e361b95b99be09d1646e08691c04
204
py
Python
Dataset/Leetcode/test/125/253.py
kkcookies99/UAST
fff81885aa07901786141a71e5600a08d7cb4868
[ "MIT" ]
null
null
null
Dataset/Leetcode/test/125/253.py
kkcookies99/UAST
fff81885aa07901786141a71e5600a08d7cb4868
[ "MIT" ]
null
null
null
Dataset/Leetcode/test/125/253.py
kkcookies99/UAST
fff81885aa07901786141a71e5600a08d7cb4868
[ "MIT" ]
null
null
null
class Solution(object): def XXX(self, s): """ :type s: str :rtype: bool """ s = "".join([ch.lower() for ch in s if ch.isalnum()]) return s == s[::-1]
20.4
61
0.426471
27
204
3.222222
0.740741
0
0
0
0
0
0
0
0
0
0
0.008
0.387255
204
9
62
22.666667
0.688
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
3
1a965592916f1ea93fda3c740173e3525efb4396
513
py
Python
sqrt_test.py
patrickjwolf/lambdata
10098611d4a074ab6685a14eb1d3ef183975e814
[ "MIT" ]
null
null
null
sqrt_test.py
patrickjwolf/lambdata
10098611d4a074ab6685a14eb1d3ef183975e814
[ "MIT" ]
null
null
null
sqrt_test.py
patrickjwolf/lambdata
10098611d4a074ab6685a14eb1d3ef183975e814
[ "MIT" ]
null
null
null
import unittest from sqrt import lazy_sqrt, builtin_sqrt, newton_sqrt1 class SqrtTests(unittest.TestCase): """obligatory docstring, tests square root functions""" def test_sqrt9(self): self.assertEqual(newton_sqrt1(9), 3) self.assertEqual(lazy_sqrt(9), 3) def test_sqrt2(self): self.assertAlmostEqual(newton_sqrt1(2), 1.414213562) class SquaringTests(unittest.TestCase): def test_thing(self): pass if __name__ == '__main__': unittest.main()
28.5
61
0.68616
62
513
5.403226
0.564516
0.098507
0
0
0
0
0
0
0
0
0
0.049383
0.210526
513
18
62
28.5
0.777778
0.095517
0
0
0
0
0.0181
0
0
0
0
0
0.230769
1
0.230769
false
0.076923
0.153846
0
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
1
0
0
1
0
0
3
1aaad603bf5e83f2d58f456fd2cb27bd0fae1730
15,679
py
Python
ghostwriter/home/tests/test_views.py
bbhunter/Ghostwriter
1b684ddd119feed9891e83b39c9b314b41d086ca
[ "BSD-3-Clause" ]
1
2022-02-04T20:24:35.000Z
2022-02-04T20:24:35.000Z
ghostwriter/home/tests/test_views.py
bbhunter/Ghostwriter
1b684ddd119feed9891e83b39c9b314b41d086ca
[ "BSD-3-Clause" ]
null
null
null
ghostwriter/home/tests/test_views.py
bbhunter/Ghostwriter
1b684ddd119feed9891e83b39c9b314b41d086ca
[ "BSD-3-Clause" ]
null
null
null
# Standard Libraries import logging from datetime import date, timedelta # Django Imports from django.conf import settings from django.db.models import Q from django.test import Client, TestCase from django.test.utils import override_settings from django.urls import reverse # Ghostwriter Libraries from ghostwriter.factories import ( GroupFactory, ProjectAssignmentFactory, ProjectFactory, ProjectObjectiveFactory, ReportFactory, ReportFindingLinkFactory, UserFactory, ) from ghostwriter.home.templatetags import custom_tags logging.disable(logging.CRITICAL) PASSWORD = "SuperNaturalReporting!" # Tests related to custom template tags and filters class TemplateTagTests(TestCase): """Collection of tests for custom template tags.""" @classmethod def setUpTestData(cls): cls.group_1 = GroupFactory(name="Group 1") cls.group_2 = GroupFactory(name="Group 2") cls.user = UserFactory(password=PASSWORD, groups=(cls.group_1,)) cls.project = ProjectFactory() cls.report = ReportFactory(project=cls.project) cls.assignment = ProjectAssignmentFactory(project=cls.project, operator=cls.user) cls.Objective = ProjectObjectiveFactory._meta.model cls.objective = ProjectObjectiveFactory(project=cls.project, complete=False) cls.complete_objective = ProjectObjectiveFactory(project=cls.project, complete=True) cls.objectives = cls.Objective.objects.filter(project=cls.project) cls.num_of_findings = 3 ReportFindingLinkFactory.create_batch( cls.num_of_findings, report=cls.report, assigned_to=cls.user ) cls.uri = reverse("home:dashboard") def setUp(self): self.client_auth = Client() self.client_auth.login(username=self.user.username, password=PASSWORD) self.assertTrue( self.client_auth.login(username=self.user.username, password=PASSWORD) ) def test_tags(self): result = custom_tags.has_group(self.user, "Group 1") self.assertTrue(result) result = custom_tags.has_group(self.user, "Group 2") self.assertFalse(result) result = custom_tags.get_groups(self.user) self.assertEqual(result, "Group 1") response = self.client_auth.get(self.uri) request = response.wsgi_request result = custom_tags.count_assignments(request) self.assertEqual(result, self.num_of_findings) result = custom_tags.get_reports(request) self.assertEqual(len(result), 1) result = custom_tags.settings_value("DATE_FORMAT") self.assertEqual(result, settings.DATE_FORMAT) result = custom_tags.count_incomplete_objectives(self.objectives) self.assertEqual(result, 1) class DashboardTests(TestCase): """Collection of tests for :view:`home.dashboard`.""" @classmethod def setUpTestData(cls): cls.user = UserFactory(password=PASSWORD) cls.Project = ProjectFactory._meta.model cls.ProjectAssignment = ProjectAssignmentFactory._meta.model cls.ReportFindingLink = ReportFindingLinkFactory._meta.model cls.current_project = ProjectFactory( start_date=date.today() - timedelta(days=14), end_date=date.today(), complete=True ) cls.future_project = ProjectFactory( start_date=date.today() + timedelta(days=14), end_date=date.today() + timedelta(days=28), complete=False ) ProjectAssignmentFactory( project=cls.current_project, operator=cls.user, start_date=date.today(), end_date=date.today() + timedelta(days=14), ) ProjectAssignmentFactory( project=cls.future_project, operator=cls.user, start_date=date.today() + timedelta(days=14), end_date=date.today() + timedelta(days=28), ) cls.report = ReportFactory(project=cls.current_project) ReportFindingLinkFactory.create_batch(3, report=cls.report, assigned_to=cls.user) cls.user_tasks = ( cls.ReportFindingLink.objects.select_related("report", "report__project") .filter( Q(assigned_to=cls.user) & Q(report__complete=False) & Q(complete=False) ) .order_by("report__project__end_date")[:10] ) cls.user_projects = cls.ProjectAssignment.objects.select_related( "project", "project__client", "role" ).filter(Q(operator=cls.user)) cls.active_projects = cls.ProjectAssignment.objects.select_related( "project", "project__client", "role" ).filter(Q(operator=cls.user) & Q(project__complete=False)) cls.uri = reverse("home:dashboard") def setUp(self): self.client = Client() self.client_auth = Client() self.client_auth.login(username=self.user.username, password=PASSWORD) self.assertTrue( self.client_auth.login(username=self.user.username, password=PASSWORD) ) def test_view_uri_exists_at_desired_location(self): response = self.client_auth.get(self.uri) self.assertEqual(response.status_code, 200) def test_view_requires_login(self): response = self.client.get(self.uri) self.assertEqual(response.status_code, 302) def test_view_uses_correct_template(self): response = self.client_auth.get(self.uri) self.assertEqual(response.status_code, 200) self.assertTemplateUsed(response, "index.html") def test_custom_context_exists(self): response = self.client_auth.get(self.uri) self.assertIn("user_projects", response.context) self.assertIn("active_projects", response.context) self.assertIn("recent_tasks", response.context) self.assertIn("user_tasks", response.context) self.assertEqual(len(response.context["user_projects"]), 2) self.assertEqual(response.context["user_projects"][0], self.user_projects[0]) self.assertEqual(len(response.context["active_projects"]), 1) self.assertEqual( response.context["active_projects"][0], self.active_projects[0] ) self.assertEqual(len(response.context["user_tasks"]), 3) class ManagementTests(TestCase): """Collection of tests for :view:`home.Management`.""" @classmethod def setUpTestData(cls): cls.user = UserFactory(password=PASSWORD) cls.staff_user = UserFactory(password=PASSWORD, is_staff=True) cls.uri = reverse("home:management") def setUp(self): self.client = Client() self.client_auth = Client() self.client_staff = Client() self.assertTrue( self.client_auth.login(username=self.user.username, password=PASSWORD) ) self.assertTrue( self.client_staff.login(username=self.staff_user.username, password=PASSWORD) ) def test_view_uri_exists_at_desired_location(self): response = self.client_staff.get(self.uri) self.assertEqual(response.status_code, 200) def test_view_requires_login(self): response = self.client.get(self.uri) self.assertEqual(response.status_code, 302) def test_view_permissions(self): response = self.client_auth.get(self.uri) self.assertEqual(response.status_code, 302) response = self.client_staff.get(self.uri) self.assertEqual(response.status_code, 200) def test_view_uses_correct_template(self): response = self.client_staff.get(self.uri) self.assertEqual(response.status_code, 200) self.assertTemplateUsed(response, "home/management.html") def test_custom_context_exists(self): response = self.client_staff.get(self.uri) self.assertIn("timezone", response.context) class UpdateSessionTests(TestCase): """Collection of tests for :view:`home.update_session`.""" @classmethod def setUpTestData(cls): cls.user = UserFactory(password=PASSWORD) cls.uri = reverse("home:ajax_update_session") def setUp(self): self.client = Client() self.client_auth = Client() self.client_auth.login(username=self.user.username, password=PASSWORD) self.assertTrue( self.client_auth.login(username=self.user.username, password=PASSWORD) ) def test_view_requires_login(self): response = self.client.get(self.uri) self.assertEqual(response.status_code, 302) def test_sticky_sidebar_value(self): self.client_auth.post(self.uri, {"session_data": "sidebar"}) session = self.client_auth.session self.assertEqual(session["sidebar"]["sticky"], True) self.client_auth.post(self.uri, {"session_data": "sidebar"}) session = self.client_auth.session self.assertEqual(session["sidebar"]["sticky"], False) def test_invalid_get_method(self): response = self.client_auth.get(self.uri) self.assertEqual(response.status_code, 405) class TestAWSConnectionTests(TestCase): """Collection of tests for :view:`home.TestAWSConnection`.""" @classmethod def setUpTestData(cls): cls.user = UserFactory(password=PASSWORD) cls.staff_user = UserFactory(password=PASSWORD, is_staff=True) cls.uri = reverse("home:ajax_test_aws") def setUp(self): self.client = Client() self.client_auth = Client() self.client_staff = Client() self.assertTrue( self.client_auth.login(username=self.user.username, password=PASSWORD) ) self.assertTrue( self.client_staff.login(username=self.staff_user.username, password=PASSWORD) ) def test_view_uri_post(self): response = self.client_staff.post(self.uri) self.assertEqual(response.status_code, 200) def test_view_requires_login(self): response = self.client.get(self.uri) self.assertEqual(response.status_code, 302) def test_view_requires_staff(self): response = self.client_auth.get(self.uri) self.assertEqual(response.status_code, 302) class TestDOConnectionTests(TestCase): """Collection of tests for :view:`home.TestDOConnection`.""" @classmethod def setUpTestData(cls): cls.user = UserFactory(password=PASSWORD) cls.staff_user = UserFactory(password=PASSWORD, is_staff=True) cls.uri = reverse("home:ajax_test_do") def setUp(self): self.client = Client() self.client_auth = Client() self.client_staff = Client() self.assertTrue( self.client_auth.login(username=self.user.username, password=PASSWORD) ) self.assertTrue( self.client_staff.login(username=self.staff_user.username, password=PASSWORD) ) def test_view_uri_post(self): response = self.client_staff.post(self.uri) self.assertEqual(response.status_code, 200) def test_view_requires_login(self): response = self.client.get(self.uri) self.assertEqual(response.status_code, 302) def test_view_requires_staff(self): response = self.client_auth.get(self.uri) self.assertEqual(response.status_code, 302) class TestNamecheapConnectionTests(TestCase): """Collection of tests for :view:`home.TestNamecheapConnection`.""" @classmethod def setUpTestData(cls): cls.user = UserFactory(password=PASSWORD) cls.staff_user = UserFactory(password=PASSWORD, is_staff=True) cls.uri = reverse("home:ajax_test_namecheap") def setUp(self): self.client = Client() self.client_auth = Client() self.client_staff = Client() self.assertTrue( self.client_auth.login(username=self.user.username, password=PASSWORD) ) self.assertTrue( self.client_staff.login(username=self.staff_user.username, password=PASSWORD) ) def test_view_uri_post(self): response = self.client_staff.post(self.uri) self.assertEqual(response.status_code, 200) def test_view_requires_login(self): response = self.client.get(self.uri) self.assertEqual(response.status_code, 302) def test_view_requires_staff(self): response = self.client_auth.get(self.uri) self.assertEqual(response.status_code, 302) class TestSlackConnectionTests(TestCase): """Collection of tests for :view:`home.TestSlackConnection`.""" @classmethod def setUpTestData(cls): cls.user = UserFactory(password=PASSWORD) cls.staff_user = UserFactory(password=PASSWORD, is_staff=True) cls.uri = reverse("home:ajax_test_slack") def setUp(self): self.client = Client() self.client_auth = Client() self.client_staff = Client() self.assertTrue( self.client_auth.login(username=self.user.username, password=PASSWORD) ) self.assertTrue( self.client_staff.login(username=self.staff_user.username, password=PASSWORD) ) def test_view_uri_post(self): response = self.client_staff.post(self.uri) self.assertEqual(response.status_code, 200) def test_view_requires_login(self): response = self.client.get(self.uri) self.assertEqual(response.status_code, 302) def test_view_requires_staff(self): response = self.client_auth.get(self.uri) self.assertEqual(response.status_code, 302) class TestVirusTotalConnectionTests(TestCase): """Collection of tests for :view:`home.TestSlackConnection`.""" @classmethod def setUpTestData(cls): cls.user = UserFactory(password=PASSWORD) cls.staff_user = UserFactory(password=PASSWORD, is_staff=True) cls.uri = reverse("home:ajax_test_virustotal") def setUp(self): self.client = Client() self.client_auth = Client() self.client_staff = Client() self.assertTrue( self.client_auth.login(username=self.user.username, password=PASSWORD) ) self.assertTrue( self.client_staff.login(username=self.staff_user.username, password=PASSWORD) ) def test_view_uri_post(self): response = self.client_staff.post(self.uri) self.assertEqual(response.status_code, 200) def test_view_requires_login(self): response = self.client.get(self.uri) self.assertEqual(response.status_code, 302) def test_view_requires_staff(self): response = self.client_auth.get(self.uri) self.assertEqual(response.status_code, 302) class ProtectedServeTest(TestCase): """Collection of tests for :view:`home.protected_serve`.""" @classmethod def setUpTestData(cls): cls.user = UserFactory(password=PASSWORD) cls.staff_user = UserFactory(password=PASSWORD, is_staff=True) cls.uri = "/media/templates" def setUp(self): self.client = Client() self.client_auth = Client() self.assertTrue( self.client_auth.login(username=self.user.username, password=PASSWORD) ) @override_settings(DEBUG=True) def test_view_uri(self): assert settings.DEBUG response = self.client_auth.get(self.uri) self.assertEqual(response.status_code, 404) self.assertContains(response, "ghostwriter.home.views.protected_serve", status_code=404) def test_view_uri_requires_login(self): response = self.client.get(self.uri) self.assertEqual(response.status_code, 302)
34.611479
96
0.675553
1,786
15,679
5.759239
0.101344
0.075831
0.053082
0.057748
0.734882
0.709314
0.691231
0.655454
0.635718
0.632121
0
0.009535
0.217361
15,679
452
97
34.688053
0.828702
0.041138
0
0.591176
0
0
0.040654
0.010547
0
0
0
0
0.194118
1
0.147059
false
0.108824
0.026471
0
0.202941
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
1
0
0
0
0
0
3
1ac500dbb07444e0474269ea82dee2adab318324
11,587
py
Python
pycatia/tps_interfaces/capture.py
evereux/catia_python
08948585899b12587b0415ce3c9191a408b34897
[ "MIT" ]
90
2019-02-21T10:05:28.000Z
2022-03-19T01:53:41.000Z
pycatia/tps_interfaces/capture.py
evereux/catia_python
08948585899b12587b0415ce3c9191a408b34897
[ "MIT" ]
99
2019-05-21T08:29:12.000Z
2022-03-25T09:55:15.000Z
pycatia/tps_interfaces/capture.py
evereux/catia_python
08948585899b12587b0415ce3c9191a408b34897
[ "MIT" ]
26
2019-04-04T06:31:36.000Z
2022-03-30T07:24:47.000Z
#! usr/bin/python3.6 """ Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-09-25 14:34:21.593357 .. warning:: The notes denoted "CAA V5 Visual Basic Help" are to be used as reference only. They are there as a guide as to how the visual basic / catscript functions work and thus help debugging in pycatia. """ from typing import TYPE_CHECKING from pycatia.in_interfaces.camera_3d import Camera3D from pycatia.system_interfaces.any_object import AnyObject from pycatia.tps_interfaces.tps_view import TPSView from pycatia.tps_interfaces.tps_views import TPSViews from pycatia.tps_interfaces.tps_parallel_on_screen import TPSParallelOnScreen if TYPE_CHECKING: from pycatia.tps_interfaces.annotations import Annotations from pycatia.tps_interfaces.annotation_set import AnnotationSet class Capture(AnyObject): """ .. note:: :class: toggle CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357) | System.IUnknown | System.IDispatch | System.CATBaseUnknown | System.CATBaseDispatch | System.AnyObject | Capture | | The interface to access a CATIACapture """ def __init__(self, com_object): super().__init__(com_object) self.capture = com_object @property def active_view(self) -> TPSView: """ .. note:: :class: toggle CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357) | o Property ActiveView() As TPSView | | Retrieves the active view for the capture. :return: TPSView :rtype: TPSView """ return TPSView(self.capture.ActiveView) @active_view.setter def active_view(self, value: TPSView): """ :param TPSView value: """ self.capture.ActiveView = value @property def active_view_state(self) -> bool: """ .. note:: :class: toggle CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357) | o Property ActiveViewState() As boolean | | Retrieves the Active View state, saved or Not. The Active View state | describes what happens when Capture is displayed, if TRUE, the active view of | the tolerancing set is replaced by the active view of the capture. :return: bool :rtype: bool """ return self.capture.ActiveViewState @active_view_state.setter def active_view_state(self, value: bool): """ :param bool value: """ self.capture.ActiveViewState = value @property def annotations(self) -> 'Annotations': """ .. note:: :class: toggle CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357) | o Property Annotations() As Annotations | | Retrieves the TPSs that are visualy managed by this Capture. :return: Annotations :rtype: Annotations """ from pycatia.tps_interfaces.annotations import Annotations return Annotations(self.capture.Annotations) @annotations.setter def annotations(self, value: 'Annotations'): """ :param Annotations value: """ self.capture.Annotations = value @property def camera(self) -> Camera3D: """ .. note:: :class: toggle CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357) | o Property Camera() As Camera3D | | Retrieves or sets a camera. :return: Camera3D :rtype: Camera3D """ return Camera3D(self.capture.Camera) @camera.setter def camera(self, value: Camera3D): """ :param Camera3D value: """ self.capture.Camera = value @property def clipping_plane(self) -> bool: """ .. note:: :class: toggle CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357) | o Property ClippingPlane() As boolean | | Retrieves the clipping plane state, activated or Not. The Clipping plane | state describes what happens when Capture is displayed, if TRUE, the active | view is used to define a clipping plane. If FALSE, there is no clipping plane | applied. | | Parameters: | | oClipPlane | The clipping plane state. :return: bool :rtype: bool """ return self.capture.ClippingPlane @clipping_plane.setter def clipping_plane(self, value: bool): """ :param bool value: """ self.capture.ClippingPlane = value @property def current(self) -> bool: """ .. note:: :class: toggle CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357) | o Property Current() As boolean | | Retrieves the Capture state, current or Not. | | Parameters: | | oCurrentState | Capture state. if TRUE the capture is current.that means that after | the creation of the capture, the future TPSs that would be added to the | document will belong to the capture. :return: bool :rtype: bool """ return self.capture.Current @current.setter def current(self, value: bool): """ :param bool value: """ self.capture.Current = value @property def manage_hide_show_body(self) -> bool: """ .. note:: :class: toggle CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357) | o Property ManageHideShowBody() As boolean | | Manages the visibility of Part instances, bodies and geometrical sets | across the Capture. | | Parameters: | | obManageHideShowBody | TRUE: If Hide/Show of these elements will be managed FALSE: If | Hide/Show of these elements will not be managed :return: bool :rtype: bool """ return self.capture.ManageHideShowBody @manage_hide_show_body.setter def manage_hide_show_body(self, value: bool): """ :param bool value: """ self.capture.ManageHideShowBody = value @property def set(self) -> 'AnnotationSet': """ .. note:: :class: toggle CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357) | o Property Set() As AnnotationSet (Read Only) | | Retrieves tolerancing set the Capture belongs too. :return: AnnotationSet :rtype: AnnotationSet """ from pycatia.tps_interfaces.annotation_set import AnnotationSet return AnnotationSet(self.capture.Set) @property def tps_views(self) -> TPSViews: """ .. note:: :class: toggle CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357) | o Property TPSViews() As TPSViews | | Retrieves the TPS Views that are visualy managed by this Capture. :return: TPSViews :rtype: TPSViews """ return TPSViews(self.capture.TPSViews) @tps_views.setter def tps_views(self, value: TPSViews): """ :param TPSViews value: """ self.capture.TPSViews = value @property def view_point(self) -> bool: """ .. note:: :class: toggle CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357) | o Property ViewPoint() As boolean | | Retrieves the ViewPoint state, saved or Not. The ViewPoint state describes | what happens when Capture is displayed, if TRUE, the 3D Camera of the Capture | is used to change the 3D ViewPoint. :return: bool :rtype: bool """ return self.capture.ViewPoint @view_point.setter def view_point(self, value: bool): """ :param bool value: """ self.capture.ViewPoint = value def display_capture(self) -> None: """ .. note:: :class: toggle CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)) | o Sub DisplayCapture() | | Displays the Capture. :return: None :rtype: None """ return self.capture.DisplayCapture() def display_capture_2(self, ib_apply_mirror: bool) -> None: """ .. note:: :class: toggle CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)) | o Sub DisplayCapture2(boolean ibApplyMirror) | | Displays the Capture with mirroring annotations | management. | | Parameters: | | out | boolean ibApplyMirror [out] Annotations mirroring management: TRUE: | The annotations mirroring is activated. FALSE: The annotations mirroring is | desactivated. :param bool ib_apply_mirror: :return: None :rtype: None """ return self.capture.DisplayCapture2(ib_apply_mirror) # # # # Autogenerated comment: # # some methods require a system service call as the methods expects a vb array object # # passed to it and there is no way to do this directly with python. In those cases the following code # # should be uncommented and edited accordingly. Otherwise completely remove all this. # # vba_function_name = 'display_capture2' # # vba_code = """ # # Public Function display_capture2(capture) # # Dim ibApplyMirror (2) # # capture.DisplayCapture2 ibApplyMirror # # display_capture2 = ibApplyMirror # # End Function # # """ # # system_service = SystemService(self.application.SystemService) # # return system_service.evaluate(vba_code, 0, vba_function_name, [self.com_object]) def tps_parallel_on_screen(self) -> TPSParallelOnScreen: """ .. note:: :class: toggle CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)) | o Func TPSParallelOnScreen() As TPSParallelOnScreen | | Gets the annotation on TPSParallelOnScreen interface. :return: TPSParallelOnScreen :rtype: TPSParallelOnScreen """ return TPSParallelOnScreen(self.capture.TPSParallelOnScreen()) def __repr__(self): return f'Capture(name="{self.name}")'
30.018135
111
0.53793
1,157
11,587
5.312878
0.197061
0.041158
0.019522
0.024402
0.355783
0.322596
0.315764
0.256873
0.194729
0.179762
0
0.047739
0.383533
11,587
385
112
30.096104
0.812824
0.554414
0
0.175
1
0
0.017801
0.007752
0
0
0
0
0
1
0.3
false
0
0.125
0.0125
0.6125
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
3
1ad18fb2a9e0d96a010fcbc48c609ae14cc20cfb
415
py
Python
Python-Advanced/functions_advanced/absolute_values.py
Xamaneone/SoftUni-Intro
985fe3249cd2adf021c2003372e840219811d989
[ "MIT" ]
null
null
null
Python-Advanced/functions_advanced/absolute_values.py
Xamaneone/SoftUni-Intro
985fe3249cd2adf021c2003372e840219811d989
[ "MIT" ]
null
null
null
Python-Advanced/functions_advanced/absolute_values.py
Xamaneone/SoftUni-Intro
985fe3249cd2adf021c2003372e840219811d989
[ "MIT" ]
null
null
null
def convert_iterable_to_absolute(nums_list): result = list(map(lambda x: abs(x), nums_list)) return result nums = map(lambda el: float(el), input().split()) print(convert_iterable_to_absolute(nums)) # def convert_iterable_to_absolute(nums_list): # result = [abs(el) for el in nums_list] # return result # # nums = [float(el) for el in input().split()] # print(convert_iterable_to_absolute(nums))
27.666667
51
0.718072
63
415
4.47619
0.31746
0.212766
0.241135
0.35461
0.780142
0.609929
0.609929
0.609929
0
0
0
0
0.146988
415
15
52
27.666667
0.79661
0.462651
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0
0
0
0.4
0.2
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
1ad19cefd911536d3cd0c13616bd9ef7f9d045b4
2,686
py
Python
Question.py
asdfadrian/OpenTester
b893025fcdc3e5c9b8581a64b68fbafe32e30988
[ "Apache-2.0" ]
null
null
null
Question.py
asdfadrian/OpenTester
b893025fcdc3e5c9b8581a64b68fbafe32e30988
[ "Apache-2.0" ]
null
null
null
Question.py
asdfadrian/OpenTester
b893025fcdc3e5c9b8581a64b68fbafe32e30988
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- """ Created on Mon May 14 12:20:07 2018 @author: 1172334950C """ class Question(object): """ This is used as the structure to format questions and retrieve those properties for our tests number : string Display element number within the Test Container question : string Display string context answerSet : string[] Contains answers for each answer : string Literal question answer explain : string Explanation to the answer isFlagged : boolean User can flag answers for review """ def __init__(self, number, question, answerSet, answer, explain): self.number = number self.question = question self.answerSet = answerSet self.answer = answer self.explain = explain self.userCorrect = None self.gradedAnswers = [None] * 4 # user selections # Flagged answers will be reviewed at the end and also shown in Navigator self.flagSelection = False # save our users selection # assuming 4 possible answers self.answerSelection = [False] * 4 # Print all the properties for debug. def __str__(self): print(self.number) print(self.question) print(self.answers) print(self.answer) print(self.explain) # Standard Getters. def Number(self): return self.number def Question(self): return self.qustion # Return answer at specific index. def AnswerSetAt(self, index): return self.answerSet[index] def ShowAnswer(self): return self.answer def Explain(self): return self.explain def IsFlagged(self): return self.flagSelection def LoadAnswer(self, index): return self.answerSelection[index] def LoadAnswers(self): return self.answerSelection def LoadGrade(self): return self.gradedAnswers # Call this to check if we have graded the question yet # None = Not Graded # True = Right # False = Wrong def GotCorrect(self): return self.userCorrect def IsRight(self): self.userCorrect = True def IsWrong(self): self.userCorrect = False # Setters def SaveState(self, flag, answers): self.flagSelection = flag self.answerSelection = answers def SaveGrade(self, gradedAnswers): self.gradedAnswers = gradedAnswers print("Saved Answers: {} {} {} {}".format(gradedAnswers[0],gradedAnswers[1],gradedAnswers[2],gradedAnswers[3]))
27.131313
120
0.612063
288
2,686
5.680556
0.409722
0.061125
0.06846
0.023227
0
0
0
0
0
0
0
0.016251
0.312733
2,686
98
121
27.408163
0.869989
0.306404
0
0
0
0
0.015458
0
0
0
0
0
0
1
0.340426
false
0
0
0.212766
0.574468
0.12766
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
46bdf7ca5389b5cf7a84c57dce254fb87783c3f5
165
py
Python
packs/openhab/actions/set_state.py
jonico/st2contrib
149c9c553f24360d91a14fef7ea6146707de75fd
[ "Apache-2.0" ]
164
2015-01-17T16:08:33.000Z
2021-08-03T02:34:07.000Z
packs/openhab/actions/set_state.py
jonico/st2contrib
149c9c553f24360d91a14fef7ea6146707de75fd
[ "Apache-2.0" ]
442
2015-01-01T11:19:01.000Z
2017-09-06T23:26:17.000Z
packs/openhab/actions/set_state.py
jonico/st2contrib
149c9c553f24360d91a14fef7ea6146707de75fd
[ "Apache-2.0" ]
202
2015-01-13T00:37:40.000Z
2020-11-07T11:30:10.000Z
from lib.action import BaseAction class SetStateAction(BaseAction): def run(self, item, state): self._put(item, state) return {'status': 'ok'}
20.625
33
0.654545
20
165
5.35
0.8
0.168224
0
0
0
0
0
0
0
0
0
0
0.224242
165
7
34
23.571429
0.835938
0
0
0
0
0
0.048485
0
0
0
0
0
0
1
0.2
false
0
0.2
0
0.8
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
3
46c5bcf324a8b41403c291c8dfde501e02e20e93
188
py
Python
src/bitinfo_holding_alert/config.py
Jimsparkle/bitinfo_holding_alert
bc79112615686fadf98c9fe634fb8e7eefbe9918
[ "MIT" ]
null
null
null
src/bitinfo_holding_alert/config.py
Jimsparkle/bitinfo_holding_alert
bc79112615686fadf98c9fe634fb8e7eefbe9918
[ "MIT" ]
null
null
null
src/bitinfo_holding_alert/config.py
Jimsparkle/bitinfo_holding_alert
bc79112615686fadf98c9fe634fb8e7eefbe9918
[ "MIT" ]
null
null
null
"""Default configuration when no ENV variables are set.""" CLOUDFLARE_BYPASS_URL = "http://localhost:8191/v1" TRACK_COIN = "dogecoin" TRACK_ADDRESS = "DRSqEwcnJX3GZWH9Twtwk8D5ewqdJzi13k"
31.333333
58
0.792553
21
188
6.904762
0.952381
0
0
0
0
0
0
0
0
0
0
0.064706
0.095745
188
5
59
37.6
0.788235
0.276596
0
0
0
0
0.507692
0.261538
0
0
0
0
0
1
0
false
0.333333
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
3
46c8a4498347859a35abd81cfed9f5d58806930a
1,841
py
Python
src/zojax/widget/captcha/widget.py
Zojax/zojax.widget.captcha
9aa315bc0ec85ecd5bf0743296e4733e0b2b8de5
[ "ZPL-2.1" ]
null
null
null
src/zojax/widget/captcha/widget.py
Zojax/zojax.widget.captcha
9aa315bc0ec85ecd5bf0743296e4733e0b2b8de5
[ "ZPL-2.1" ]
null
null
null
src/zojax/widget/captcha/widget.py
Zojax/zojax.widget.captcha
9aa315bc0ec85ecd5bf0743296e4733e0b2b8de5
[ "ZPL-2.1" ]
null
null
null
############################################################################## # # Copyright (c) 2009 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """ $Id$ """ from zope.component import getUtility from zope.interface import implementer from z3c.form import interfaces, widget from z3c.form.browser.text import TextWidget from z3c.form.interfaces import DISPLAY_MODE, HIDDEN_MODE from z3c.pt.pagetemplate import ViewPageTemplateFile from interfaces import ICaptchaConfiglet class CaptchaWidget(TextWidget): captcha_template = ViewPageTemplateFile('widget.pt') def __init__(self, *kv, **kw): super(CaptchaWidget, self).__init__(*kv, **kw) self.configlet = getUtility(ICaptchaConfiglet) def captchaImage(self): return self.configlet.get_image_tag(self.request) def captchaAudio(self): return self.configlet.audio_url(self.request) def update(self): if self.mode == DISPLAY_MODE: self.mode = HIDDEN_MODE self.field.mode = interfaces.HIDDEN_MODE super(CaptchaWidget, self).update() def render(self): self.base_widget = super(CaptchaWidget, self).render() return self.captcha_template(self) @implementer(interfaces.IFieldWidget) def CaptchaWidgetFactory(field, request): return widget.FieldWidget(field, CaptchaWidget(request))
32.298246
78
0.67572
207
1,841
5.917874
0.478261
0.022857
0.026939
0.037551
0
0
0
0
0
0
0
0.006477
0.161325
1,841
56
79
32.875
0.786917
0.250407
0
0
0
0
0.007463
0
0
0
0
0
0
1
0.222222
false
0
0.259259
0.111111
0.703704
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
46d790318dd9872e70883f8227ecbf0ac8affa79
1,663
py
Python
python/test_demo.py
rensir/RapidOCR
2408ec64cd20145e468e08a5469eaa2c042cd1c6
[ "Apache-2.0" ]
null
null
null
python/test_demo.py
rensir/RapidOCR
2408ec64cd20145e468e08a5469eaa2c042cd1c6
[ "Apache-2.0" ]
null
null
null
python/test_demo.py
rensir/RapidOCR
2408ec64cd20145e468e08a5469eaa2c042cd1c6
[ "Apache-2.0" ]
null
null
null
# -*- encoding: utf-8 -*- # @Author: SWHL # @Contact: liekkaskono@163.com from rapid_ocr_api import TextSystem, visualize det_model_path = 'models/ch_ppocr_mobile_v2.0_det_infer.onnx' cls_model_path = 'models/ch_ppocr_mobile_v2.0_cls_infer.onnx' # 中英文识别 rec_model_path = 'models/ch_ppocr_mobile_v2.0_rec_infer.onnx' keys_path = 'ch_ppocr_mobile_v2_rec/ppocr_keys_v1.txt' text_sys = TextSystem(det_model_path, rec_model_path, use_angle_cls=True, cls_model_path=cls_model_path, keys_path=keys_path) image_path = r'test_images/det_images/ch_en_num.jpg' dt_boxes, rec_res = text_sys(image_path) visualize(image_path, dt_boxes, rec_res) # 只有中英文和数字识别 rec_model_path = 'models/en_number_mobile_v2.0_rec_infer.onnx' keys_path = 'en_number_ppocr_mobile_v2_rec/en_dict.txt' text_sys = TextSystem(det_model_path, rec_model_path, use_angle_cls=True, cls_model_path=cls_model_path, keys_path=keys_path) image_path = r'test_images/det_images/en_num.png' dt_boxes, rec_res = text_sys(image_path) visualize(image_path, dt_boxes, rec_res) # 日语识别 rec_model_path = 'models/japan_rec_crnn.onnx' keys_path = 'japan_ppocr_mobile_v2_rec/japan_dict.txt' text_sys = TextSystem(det_model_path, rec_model_path, use_angle_cls=True, cls_model_path=cls_model_path, keys_path=keys_path) image_path = r'test_images/det_images/japan.png' dt_boxes, rec_res = text_sys(image_path) visualize(image_path, dt_boxes, rec_res)
31.980769
62
0.693325
251
1,663
4.091633
0.219124
0.148978
0.081792
0.075949
0.701071
0.701071
0.701071
0.701071
0.562804
0.562804
0
0.012403
0.224293
1,663
51
63
32.607843
0.783721
0.053518
0
0.636364
0
0
0.266114
0.266114
0
0
0
0
0
1
0
false
0
0.030303
0
0.030303
0
0
0
0
null
0
0
0
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
46e51229bf81d16850dc1c99426ad60797e1a90e
746
py
Python
pointCollection/ATL06/tile.py
tsutterley/pointCollection
04e4359e463ff8a556e0d078373578bd96390151
[ "MIT" ]
null
null
null
pointCollection/ATL06/tile.py
tsutterley/pointCollection
04e4359e463ff8a556e0d078373578bd96390151
[ "MIT" ]
null
null
null
pointCollection/ATL06/tile.py
tsutterley/pointCollection
04e4359e463ff8a556e0d078373578bd96390151
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Oct 18 18:45:18 2019 @author: ben """ import pointCollection as pc class tile(pc.tile): def __default_field_dict__(self): return {None:['delta_time','h_li','h_li_sigma','latitude','longitude','atl06_quality_summary','segment_id','sigma_geo_h'], 'fit_statistics':['dh_fit_dx'], 'ground_track':['x_atc', 'sigma_geo_xt','sigma_geo_at'], 'geophysical' : ['dac','tide_ocean'], 'orbit_info':['rgt','cycle_number'], 'derived':['valid','matlab_time', 'n_pixels','LR','BP','spot','rss_along_track_dh']} def __time_field__(self): return 'delta_time' def __z_field__(self): return 'h_li'
27.62963
130
0.615282
101
746
4.108911
0.712871
0.072289
0.072289
0
0
0
0
0
0
0
0
0.026756
0.198391
746
26
131
28.692308
0.667224
0.124665
0
0
0
0
0.414596
0.032609
0
0
0
0
0
1
0.230769
false
0
0.076923
0.230769
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
1
0
0
0
1
1
0
0
3
46ec761cd98425860c5430fd123aaa948c1d1e0b
248
py
Python
ignoregen/__init__.py
rcook/ignoregen
d702b1fbe3d1b525dde312aa761080e098fc9111
[ "MIT" ]
null
null
null
ignoregen/__init__.py
rcook/ignoregen
d702b1fbe3d1b525dde312aa761080e098fc9111
[ "MIT" ]
1
2018-04-22T04:28:52.000Z
2018-04-22T04:31:24.000Z
ignoregen/__init__.py
rcook/ignoregen
d702b1fbe3d1b525dde312aa761080e098fc9111
[ "MIT" ]
null
null
null
################################################## # Copyright (C) 2017-2020, All rights reserved. ################################################## __project_name__ = "ignoregen" __version__ = "0.6" __description__ = "Generate Git ignore rules"
31
50
0.443548
18
248
5.388889
1
0
0
0
0
0
0
0
0
0
0
0.044248
0.08871
248
7
51
35.428571
0.384956
0.181452
0
0
0
0
0.366337
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
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
46faddb5936830fe08f886c938c95f1e747a2f63
362
py
Python
test/src/lib/idol/py_mar/codegen/all/target/optional_service.py
lyric-com/idol
285005e9ddaa92b2284b7e9c28cd12f1e34746ec
[ "MIT" ]
null
null
null
test/src/lib/idol/py_mar/codegen/all/target/optional_service.py
lyric-com/idol
285005e9ddaa92b2284b7e9c28cd12f1e34746ec
[ "MIT" ]
2
2020-03-24T18:03:10.000Z
2020-03-31T10:41:56.000Z
test/src/lib/idol/py_mar/codegen/all/target/optional_service.py
lyric-com/idol
285005e9ddaa92b2284b7e9c28cd12f1e34746ec
[ "MIT" ]
null
null
null
# DO NOT EDIT # This file was generated by idol_mar, any changes will be lost when idol_mar is rerun again from marshmallow import Schema from .optional_method import AllTargetOptionalMethodField class AllTargetOptionalServiceSchema(Schema): optional = AllTargetOptionalMethodField( dump_to="optional", load_from="optional", allow_none=False )
32.909091
92
0.792818
44
362
6.386364
0.772727
0.049822
0
0
0
0
0
0
0
0
0
0
0.154696
362
10
93
36.2
0.918301
0.281768
0
0
1
0
0.062257
0
0
0
0
0
0
1
0
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
1
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
3
46ff9fba20209668c437a076f4febcd60a6c1518
104,686
py
Python
EnrollmentStation/Binaries/YubikeyManager/pymodules/smartcard/scard/scard.py
dennisrahmen/EnrollmentStation
a145345f9bb91bccb2bd67b349af8cfc4ec9e290
[ "MIT" ]
1
2020-03-16T14:57:15.000Z
2020-03-16T14:57:15.000Z
EnrollmentStation/Binaries/YubikeyManager/pymodules/smartcard/scard/scard.py
dennisrahmen/EnrollmentStation
a145345f9bb91bccb2bd67b349af8cfc4ec9e290
[ "MIT" ]
null
null
null
EnrollmentStation/Binaries/YubikeyManager/pymodules/smartcard/scard/scard.py
dennisrahmen/EnrollmentStation
a145345f9bb91bccb2bd67b349af8cfc4ec9e290
[ "MIT" ]
1
2022-02-04T14:55:45.000Z
2022-02-04T14:55:45.000Z
# This file was automatically generated by SWIG (http://www.swig.org). # Version 4.0.0 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. """ The smartcard.scard module is a simple wrapper on top of the C language PCSC SCardXXX API. The smartcard.scard module is the lower layer of the pyscard framework that provides a higher level interface. You should avoid using the smartcard.scard package directly, and use the pyscard directly because: - smartcard.scard being a C wrapper, the code tends to look like C code written in python syntax - the smartcard package provides higher level abstractions (e.g. CardType, CardConnection), and makes programming easier since it is totally written in Python You can still use the smartcard.scard package if you want to write your own framework, or if you want to perform quick-and-dirty port of C language programs using SCardXXX calls, or if there are features of SCardXXX API that you want to use and that are not available in the pyscard library. Introduction The smartcard.scard module is a Python wrapper around PCSC smart card base services. On Windows, the wrapper is performed around the smart card base components winscard library. On linux and OS X, the wrapper is performed around the PCSC-lite library. The smartcard.scard module provides mapping for the following API functions, depending on the Operating System: =============================== ======= ======= Function Windows Linux OS X =============================== ======= ======= GetOpenCardName SCardAddReaderToGroup Y SCardBeginTransaction Y Y SCardCancel Y Y SCardConnect Y Y SCardControl Y Y SCardDisconnect Y Y SCardEndTransaction Y Y SCardEstablishConteYt Y Y SCardForgetCardType Y SCardForgetReader Y SCardForgetReaderGroup Y SCardFreeMemory SCardGetAttrib Y Y SCardGetCardTypeProviderName Y SCardGetErrorMessage Y SCardGetProviderId SCardGetStatusChange Y Y SCardIntroduceCardType Y SCardIntroduceReader Y SCardIntroduceReaderGroup Y SCardIsValidConteYt Y Y SCardListCards Y SCardListInterfaces Y SCardListReaderGroups Y Y SCardListReaders Y Y SCardLocateCards Y SCardReconnect Y Y SCardReleaseConteYt Y Y SCardRemoveReaderFromGroup Y SCardSetAttrib Y Y SCardSetCartTypeProviderName SCardStatus Y Y SCardTransmit Y Y SCardUIDlgSelectCard =============================== ======= ======= Comments, bug reports, improvements welcome. ------------------------------------------------------------------------------- Copyright 2001-2012 gemalto @Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com @Author: Ludovic Rousseau, mailto:ludovic.rousseau@free.fr This file is part of pyscard. pyscard is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. pyscard is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with pyscard; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA """ from sys import version_info as _swig_python_version_info if _swig_python_version_info < (2, 7, 0): raise RuntimeError('Python 2.7 or later required') # Import the low-level C/C++ module if __package__ or '.' in __name__: from . import _scard else: import _scard try: import builtins as __builtin__ except ImportError: import __builtin__ def _swig_setattr_nondynamic(self, class_type, name, value, static=1): if name == "thisown": return self.this.own(value) if name == "this": if type(value).__name__ == 'SwigPyObject': self.__dict__[name] = value return method = class_type.__swig_setmethods__.get(name, None) if method: return method(self, value) if not static: object.__setattr__(self, name, value) else: raise AttributeError("You cannot add attributes to %s" % self) def _swig_setattr(self, class_type, name, value): return _swig_setattr_nondynamic(self, class_type, name, value, 0) def _swig_getattr(self, class_type, name): if name == "thisown": return self.this.own() method = class_type.__swig_getmethods__.get(name, None) if method: return method(self) raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name)) def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() except __builtin__.Exception: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) def _swig_setattr_nondynamic_instance_variable(set): def set_instance_attr(self, name, value): if name == "thisown": self.this.own(value) elif name == "this": set(self, name, value) elif hasattr(self, name) and isinstance(getattr(type(self), name), property): set(self, name, value) else: raise AttributeError("You cannot add instance attributes to %s" % self) return set_instance_attr def _swig_setattr_nondynamic_class_variable(set): def set_class_attr(cls, name, value): if hasattr(cls, name) and not isinstance(getattr(cls, name), property): set(cls, name, value) else: raise AttributeError("You cannot add class attributes to %s" % cls) return set_class_attr def _swig_add_metaclass(metaclass): """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass""" def wrapper(cls): return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy()) return wrapper class _SwigNonDynamicMeta(type): """Meta class to enforce nondynamic attributes (no new attributes) for a class""" __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__) def SCardAddReaderToGroup(hcontext, readername, groupname): r""" SCardAddReaderToGroup( hcontext, readername, groupname) -> SCARDRETCODE Parameters ---------- hcontext: context handle return from SCardEstablishContext() readername: card reader name groupname: card reader group name adds a reader to a reader group Windows only, not supported by PCSC lite wrapper. example: from smartcard.scard import * ... establish context ... newgroup = 'SCard$MyOwnGroup' reader = 'SchlumbergerSema Reflex USB v.2 0' readeralias = 'SchlumbergerSema Reflex USB v.2 0 alias' hresult = SCardIntroduceReader(hcontext, readeralias, reader]) if hresult != SCARD_S_SUCCESS: raise error, 'Unable to introduce reader: ' + SCardGetErrorMessage(hresult) hresult = SCardAddReaderToGroup(hcontext, readeralias, newgroup) if hresult!=0: raise error, 'Unable to add reader to group: ' + SCardGetErrorMessage(hresult) ... """ return _scard.SCardAddReaderToGroup(hcontext, readername, groupname) def SCardForgetCardType(hcontext, cardname): r""" SCardForgetCardType( hcontext, cardname) -> SCARDRETCODE Parameters ---------- hcontext: context handle return from SCardEstablishContext() cardname: friendly name of a card removes an introduced smart card from the smart card subsystem. Windows only, not supported by PCSC lite wrapper. from smartcard.scard import * ... establish context ... hresult = SCardForgetCardType(hcontext, 'myCardName') if hresult != SCARD_S_SUCCESS: raise error, 'Failed to remove card type: ' + SCardGetErrorMessage(hresult) ... """ return _scard.SCardForgetCardType(hcontext, cardname) def SCardForgetReader(hcontext, readername): r""" SCardForgetReader( hcontext, readername) -> SCARDRETCODE Parameters ---------- hcontext: context handle return from SCardEstablishContext() readername: card reader name Removes a previously introduced smart card reader from the smart card subsystem. Windows only, not supported by PCSC lite wrapper. from smartcard.scard import * ... establish context ... ... hresult = SCardForgetReader(hcontext, dummyreader) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to forget readers ' + SCardGetErrorMessage(hresult) ... """ return _scard.SCardForgetReader(hcontext, readername) def SCardForgetReaderGroup(hcontext, groupname): r""" SCardForgetReaderGroup( hcontext, groupname) -> SCARDRETCODE Parameters ---------- hcontext: context handle return from SCardEstablishContext() groupname: card reader group name Removes a previously introduced smart card reader group from the smart card subsystem. Although this function automatically clears all readers from the group, it does not affect the existence of the individual readers in the database. Windows only, not supported by PCSC lite wrapper. from smartcard.scard import * ... establish context ... ... hresult = SCardForgetReaderGroup(hcontext, newgroup) if hresult != SCARD_S_SUCCESS: raise error, 'Unable to forget reader group: ' + SCardGetErrorMessage(hresult) ... """ return _scard.SCardForgetReaderGroup(hcontext, groupname) def SCardGetCardTypeProviderName(hcontext, cardname, dwProviderId): r""" SCardGetCardTypeProviderName( hcontext, cardname, dwProviderId) -> SCARDRETCODE Parameters ---------- hcontext: context handle return from SCardEstablishContext() cardname: friendly name of a card dwProviderId: provider type, SCARD_PROVIDER_PRIMARY or SCARD_PROVIDER_CSP Returns the name of the module (dynamic link library) containing the provider for a given card name and provider type. Windows only, not supported by PCSC lite wrapper. from smartcard.scard import * ... establish context ... hresult, cards = SCardListCards(hcontext, [], []) if hresult != SCARD_S_SUCCESS: raise error, 'Failure to list cards: ' + SCardGetErrorMessage(hresult) for i in cards: hresult, providername = SCardGetCardTypeProviderName(hcontext, i, SCARD_PROVIDER_PRIMARY) if hresult == SCARD_S_SUCCESS: print providername hresult, providername = SCardGetCardTypeProviderName(hcontext, i, SCARD_PROVIDER_CSP) if hresult == SCARD_S_SUCCESS: print providername ... """ return _scard.SCardGetCardTypeProviderName(hcontext, cardname, dwProviderId) def SCardIntroduceCardType(hcontext, cardname, primaryprovider, providerlist, atr, mask): r""" SCardIntroduceCardType( hcontext, cardname, GUID primaryprovider, GUID[] providerlist, byte[] atr, byte[] mask) -> SCARDRETCODE Parameters ---------- hcontext: context handle return from SCardEstablishContext() cardname: friendly name of a card primaryprovidername: GUID of the smart card primary service provider providerlist: list of GUIDs of interfaces supported by smart card atr: card ATR mask: mask to apply to card ATR Introduces a smart card to the smart card subsystem (for the active user) by adding it to the smart card database. Windows only, not supported by PCSC lite wrapper. from smartcard.scard import * ... znewcardName = 'dummy-card' znewcardATR = [0x3B, 0x77, 0x94, 0x00, 0x00, 0x82, 0x30, 0x00, 0x13, 0x6C, 0x9F, 0x22] znewcardMask = [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF] znewcardPrimGuid = smartcard.guid.strToGUID('{128F3806-4F70-4ccf-977A-60C390664840}') znewcardSecGuid = smartcard.guid.strToGUID('{EB7F69EA-BA20-47d0-8C50-11CFDEB63BBE}') ... hresult = SCardIntroduceCardType(hcontext, znewcardName, znewcardPrimGuid, znewcardPrimGuid + znewcardSecGuid, znewcardATR, znewcardMask) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to introduce card type: ' + SCardGetErrorMessage(hresult) ... """ return _scard.SCardIntroduceCardType(hcontext, cardname, primaryprovider, providerlist, atr, mask) def SCardIntroduceReader(hcontext, readername, devicename): r""" SCardIntroduceReader( hcontext, readername, devicename) -> SCARDRETCODE Parameters ---------- hcontext: context handle return from SCardEstablishContext() readername: card reader name devicename: card reader device name Introduces a reader to the smart card subsystem. Windows only, not supported by PCSC lite wrapper. from smartcard.scard import * ... dummyreader = readers[0] + ' dummy' hresult = SCardIntroduceReader(hcontext, dummyreader, readers[0]) if hresult != SCARD_S_SUCCESS: raise error, 'Unable to introduce reader: ' + dummyreader + ' : ' + SCardGetErrorMessage(hresult) ... """ return _scard.SCardIntroduceReader(hcontext, readername, devicename) def SCardIntroduceReaderGroup(hcontext, groupname): r""" SCardIntroduceReaderGroup( hcontext, groupname) -> SCARDRETCODE Parameters ---------- hcontext: context handle return from SCardEstablishContext() groupname: card reader group name Introduces a reader group to the smart card subsystem. However, the reader group is not created until the group is specified when adding a reader to the smart card database. Windows only, not supported by PCSC lite wrapper. from smartcard.scard import * hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) hresult = SCardIntroduceReaderGroup(hcontext, 'SCard$MyOwnGroup') if hresult != SCARD_S_SUCCESS: raise error, 'Unable to introduce reader group: ' + SCardGetErrorMessage(hresult) hresult = SCardAddReaderToGroup(hcontext, 'SchlumbergerSema Reflex USB v.2 0', 'SCard$MyOwnGroup') if hresult != SCARD_S_SUCCESS: raise error, 'Unable to add reader to group: ' + SCardGetErrorMessage(hresult) """ return _scard.SCardIntroduceReaderGroup(hcontext, groupname) def SCardListInterfaces(hcontext, cardname): r""" SCardListInterfaces( hcontext, cardname) -> SCARDRETCODE Parameters ---------- hcontext: context handle return from SCardEstablishContext() cardname: friendly name of a card Provides a list of interfaces supplied by a given card. The caller supplies the name of a smart card previously introduced to the subsystem, and receives the list of interfaces supported by the card Windows only, not supported by PCSC lite wrapper. from smartcard.scard import * hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) hresult, interfaces = SCardListInterfaces(hcontext, 'Schlumberger Cryptoflex 8k v2') if hresult != SCARD_S_SUCCESS: raise error, 'Failed to list interfaces: ' + SCardGetErrorMessage(hresult) ... """ return _scard.SCardListInterfaces(hcontext, cardname) def SCardListCards(hcontext, atr, providerlist): r""" SCardListCards( hcontext, byte[] atr, GUID[] providerlist) -> SCARDRETCODE Parameters ---------- hcontext: context handle return from SCardEstablishContext() atr: card ATR providerlist: list of GUIDs of interfaces supported by smart card Searches the smart card database and provides a list of named cards previously introduced to the system by the user. The caller specifies an ATR string, a set of interface identifiers (GUIDs), or both. If both an ATR string and an identifier array are supplied, the cards returned will match the ATR string supplied and support the interfaces specified. Windows only, not supported by PCSC lite wrapper. from smartcard.scard import * ... slbCryptoFlex8kv2ATR = [ 0x3B, 0x95, 0x15, 0x40, 0x00, 0x68, 0x01, 0x02, 0x00, 0x00 ] hresult, card = SCardListCards(hcontext, slbCryptoFlex8kv2ATR, []) if hresult ! =SCARD_S_SUCCESS: raise error, 'Failure to locate Schlumberger Cryptoflex 8k v2 card: ' + SCardGetErrorMessage(hresult) hresult, cards = SCardListCards(hcontext, [], []) if hresult != SCARD_S_SUCCESS: raise error, 'Failure to list cards: ' + SCardGetErrorMessage(hresult) print 'Cards: ', cards ... """ return _scard.SCardListCards(hcontext, atr, providerlist) def SCardLocateCards(hcontext, cards, readerstatelist): r""" SCardLocateCards( hcontext, cards, tuple[] readerstatelist) -> SCARDRETCODE Parameters ---------- hcontext: context handle return from SCardEstablishContext() cards: a list of cards to locate readerstatelist: in input/output, a list of reader state tuple (readername, state, atr) Searches the readers listed in the readerstate parameter for a card with an ATR string that matches one of the card names specified in mszCards, returning immediately with the result. Windows only, not supported by PCSC lite wrapper. from smartcard.scard import * hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) hresult, readers = SCardListReaders(hcontext, []) readerstates = [] cards = ['Schlumberger Cryptoflex 4k', 'Schlumberger Cryptoflex 8k', 'Schlumberger Cryptoflex 8k v2'] for i in xrange(len(readers)): readerstates += [(readers[i], SCARD_STATE_UNAWARE)] hresult, newstates = SCardLocateCards(hcontext, cards, readerstates) for i in newstates: reader, eventstate, atr = i print reader, for b in atr: print '0x%.2X' % b, print if eventstate & SCARD_STATE_ATRMATCH: print 'Card found' if eventstate & SCARD_STATE_EMPTY: print 'Reader empty' if eventstate & SCARD_STATE_PRESENT: print 'Card present in reader' ... """ return _scard.SCardLocateCards(hcontext, cards, readerstatelist) def SCardRemoveReaderFromGroup(hcontext, readername, groupname): r""" SCardRemoveReaderFromGroup( hcontext, readername, groupname) -> SCARDRETCODE Parameters ---------- hcontext: context handle return from SCardEstablishContext() readername: card reader name groupname: card reader group name Removes a reader from an existing reader group. This function has no affect on the reader. Windows only, not supported by PCSC lite wrapper. from smartcard.scard import * hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) hresult = SCardRemoveReaderFromGroup(hcontext, 'SchlumbergerSema Reflex USB v.2 0', 'SCard$MyOwnGroup') if hresult != SCARD_S_SUCCESS: raise error, 'Unable to remove reader from group: ' + SCardGetErrorMessage(hresult) ... """ return _scard.SCardRemoveReaderFromGroup(hcontext, readername, groupname) def SCardIsValidContext(hcontext): r""" SCardIsValidContext( hcontext) -> SCARDRETCODE Parameters ---------- hcontext: context handle return from SCardEstablishContext() This function determines whether a smart card context handle is still valid. After a smart card context handle has been set by SCardEstablishContext(), it may become not valid if the resource manager service has been shut down. from smartcard.scard import * hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) hresult = SCardIsValidContext(hcontext) if hresult != SCARD_S_SUCCESS: raise error, 'Invalid context: ' + SCardGetErrorMessage(hresult) ... """ return _scard.SCardIsValidContext(hcontext) def SCardGetAttrib(hcard, dwAttrId): r""" SCardGetAttrib( hcard, dwAttrId) -> SCARDRETCODE Parameters ---------- hcard: card handle return from SCardConnect() dwAttrId: value of attribute to get This function get an attribute from the IFD Handler. The possible attributes are: ======================================== ======= ======= Attribute Windows PSCS lite ======================================== ======= ======= SCARD_ATTR_ASYNC_PROTOCOL_TYPES Y SCARD_ATTR_ATR_STRING Y Y SCARD_ATTR_CHANNEL_ID Y Y SCARD_ATTR_CHARACTERISTICS Y Y SCARD_ATTR_CURRENT_BWT Y Y SCARD_ATTR_CURRENT_CLK Y Y SCARD_ATTR_CURRENT_CWT Y Y SCARD_ATTR_CURRENT_D Y Y SCARD_ATTR_CURRENT_EBC_ENCODING Y Y SCARD_ATTR_CURRENT_F Y Y SCARD_ATTR_CURRENT_IFSC Y Y SCARD_ATTR_CURRENT_IFSD Y Y SCARD_ATTR_CURRENT_IO_STATE Y Y SCARD_ATTR_CURRENT_N Y Y SCARD_ATTR_CURRENT_PROTOCOL_TYPE Y Y SCARD_ATTR_CURRENT_W Y Y SCARD_ATTR_DEFAULT_CLK Y Y SCARD_ATTR_DEFAULT_DATA_RATE Y Y SCARD_ATTR_DEVICE_FRIENDLY_NAME_A Y Y SCARD_ATTR_DEVICE_FRIENDLY_NAME_W Y Y SCARD_ATTR_DEVICE_IN_USE Y Y SCARD_ATTR_DEVICE_SYSTEM_NAME_A Y Y SCARD_ATTR_DEVICE_SYSTEM_NAME_W Y Y SCARD_ATTR_DEVICE_UNIT Y Y SCARD_ATTR_ESC_AUTHREQUEST Y Y SCARD_ATTR_ESC_CANCEL Y Y SCARD_ATTR_ESC_RESET Y Y SCARD_ATTR_EXTENDED_BWT Y Y SCARD_ATTR_ICC_INTERFACE_STATUS Y Y SCARD_ATTR_ICC_PRESENCE Y Y SCARD_ATTR_ICC_TYPE_PER_ATR Y Y SCARD_ATTR_MAXINPUT Y Y SCARD_ATTR_MAX_CLK Y Y SCARD_ATTR_MAX_DATA_RATE Y Y SCARD_ATTR_MAX_IFSD Y Y SCARD_ATTR_POWER_MGMT_SUPPORT Y Y SCARD_ATTR_SUPRESS_T1_IFS_REQUEST Y Y SCARD_ATTR_SYNC_PROTOCOL_TYPES Y SCARD_ATTR_USER_AUTH_INPUT_DEVICE Y Y SCARD_ATTR_USER_TO_CARD_AUTH_DEVICE Y Y SCARD_ATTR_VENDOR_IFD_SERIAL_NO Y Y SCARD_ATTR_VENDOR_IFD_TYPE Y Y SCARD_ATTR_VENDOR_IFD_VERSION Y Y SCARD_ATTR_VENDOR_NAME Y Y ======================================== ======= ======= Not all the dwAttrId values listed above may be implemented in the IFD Handler you are using. And some dwAttrId values not listed here may be implemented. from smartcard.scard import * ... establish context and connect to card ... hresult, attrib = SCardGetAttrib(hcard, SCARD_ATTR_ATR_STRING) if hresult == SCARD_S_SUCCESS: for j in attrib: print '0x%.2X' % attrib, ... """ return _scard.SCardGetAttrib(hcard, dwAttrId) def SCardSetAttrib(hcard, dwAttrId, ATTRIBUTESIN): r""" SCardSetAttrib( hcard, dwAttrId, BYTELIST * ATTRIBUTESIN) -> SCARDRETCODE Parameters ---------- hcard: card handle return from SCardConnect() dwAttrId: value of attribute to get ATTRIBUTESIN: BYTELIST * This function sets an attribute from the IFD Handler. Not all attributes are supported by all readers nor can they be set at all times. The possible attributes are: ======================================== ======= ======= Attribute Windows PSCS lite ======================================== ======= ======= SCARD_ATTR_ASYNC_PROTOCOL_TYPES Y SCARD_ATTR_ATR_STRING Y Y SCARD_ATTR_CHANNEL_ID Y Y SCARD_ATTR_CHARACTERISTICS Y Y SCARD_ATTR_CURRENT_BWT Y Y SCARD_ATTR_CURRENT_CLK Y Y SCARD_ATTR_CURRENT_CWT Y Y SCARD_ATTR_CURRENT_D Y Y SCARD_ATTR_CURRENT_EBC_ENCODING Y Y SCARD_ATTR_CURRENT_F Y Y SCARD_ATTR_CURRENT_IFSC Y Y SCARD_ATTR_CURRENT_IFSD Y Y SCARD_ATTR_CURRENT_IO_STATE Y Y SCARD_ATTR_CURRENT_N Y Y SCARD_ATTR_CURRENT_PROTOCOL_TYPE Y Y SCARD_ATTR_CURRENT_W Y Y SCARD_ATTR_DEFAULT_CLK Y Y SCARD_ATTR_DEFAULT_DATA_RATE Y Y SCARD_ATTR_DEVICE_FRIENDLY_NAME_A Y Y SCARD_ATTR_DEVICE_FRIENDLY_NAME_W Y Y SCARD_ATTR_DEVICE_IN_USE Y Y SCARD_ATTR_DEVICE_SYSTEM_NAME_A Y Y SCARD_ATTR_DEVICE_SYSTEM_NAME_W Y Y SCARD_ATTR_DEVICE_UNIT Y Y SCARD_ATTR_ESC_AUTHREQUEST Y Y SCARD_ATTR_ESC_CANCEL Y Y SCARD_ATTR_ESC_RESET Y Y SCARD_ATTR_EXTENDED_BWT Y Y SCARD_ATTR_ICC_INTERFACE_STATUS Y Y SCARD_ATTR_ICC_PRESENCE Y Y SCARD_ATTR_ICC_TYPE_PER_ATR Y Y SCARD_ATTR_MAXINPUT Y Y SCARD_ATTR_MAX_CLK Y Y SCARD_ATTR_MAX_DATA_RATE Y Y SCARD_ATTR_MAX_IFSD Y Y SCARD_ATTR_POWER_MGMT_SUPPORT Y Y SCARD_ATTR_SUPRESS_T1_IFS_REQUEST Y Y SCARD_ATTR_SYNC_PROTOCOL_TYPES Y SCARD_ATTR_USER_AUTH_INPUT_DEVICE Y Y SCARD_ATTR_USER_TO_CARD_AUTH_DEVICE Y Y SCARD_ATTR_VENDOR_IFD_SERIAL_NO Y Y SCARD_ATTR_VENDOR_IFD_TYPE Y Y SCARD_ATTR_VENDOR_IFD_VERSION Y Y SCARD_ATTR_VENDOR_NAME Y Y ======================================== ======= ======= Not all the dwAttrId values listed above may be implemented in the IFD Handler you are using. And some dwAttrId values not listed here may be implemented. from smartcard.scard import * ... establish context and connect to card ... hresult, attrib = SCardSetAttrib(hcard, SCARD_ATTR_VENDOR_NAME, ['G', 'e', 'm', 'a', 'l', 't', 'o']) if hresult != SCARD_S_SUCCESS: print 'Failed to set attribute' ... """ return _scard.SCardSetAttrib(hcard, dwAttrId, ATTRIBUTESIN) def SCardControl(hcard, dwControlCode, inbuffer): r""" SCardControl( hcard, dwControlCode, byte[] inbuffer) -> SCARDRETCODE Parameters ---------- hcard: card handle return from SCardConnect() dwControlCode: the control code to send inbuffer: list of bytes to send with the control code This function sends a control command to the reader connected to by SCardConnect(). It returns a result and the control response. from smartcard.scard import * hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) hresult, hcard, dwActiveProtocol = SCardConnect( hcontext, 'SchlumbergerSema Reflex USB v.2 0', SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0) CMD = [0x12, 0x34] hresult, response = SCardControl(hcard, 42, CMD) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to control: ' + SCardGetErrorMessage(hresult) """ return _scard.SCardControl(hcard, dwControlCode, inbuffer) def SCardBeginTransaction(hcard): r""" SCardBeginTransaction( hcard) -> SCARDRETCODE Parameters ---------- hcard: card handle return from SCardConnect() This function establishes a temporary exclusive access mode for doing a series of commands or transaction. You might want to use this when you are selecting a few files and then writing a large file so you can make sure that another application will not change the current file. If another application has a lock on this reader or this application is in SCARD_SHARE_EXCLUSIVE there will be no action taken. from smartcard.scard import * ... establish context ... hresult, hcard, dwActiveProtocol = SCardConnect( hcontext, 'SchlumbergerSema Reflex USB v.2 0', SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0) if hresult!=SCARD_S_SUCCESS: raise error, 'unable to connect: ' + SCardGetErrorMessage(hresult) hresult = SCardBeginTransaction(hcard) if hresult != SCARD_S_SUCCESS: raise error, 'failed to begin transaction: ' + SCardGetErrorMessage(hresult) ... """ return _scard.SCardBeginTransaction(hcard) def SCardCancel(hcontext): r""" SCardCancel( hcontext) -> SCARDRETCODE Parameters ---------- hcontext: context handle return from SCardEstablishContext() This function cancels all pending blocking requests on the ScardGetStatusChange() function. from smartcard.scard import * ... establish context ... hresult = SCardCancel(hcard) if hresult != SCARD_S_SUCCESS: raise error, 'failed to cancel pending actions: ' + SCardGetErrorMessage(hresult) ... """ return _scard.SCardCancel(hcontext) def SCardConnect(hcontext, readername, dwShareMode, dwPreferredProtocols): r""" SCardConnect( hcontext, readername, dwShareMode, dwPreferredProtocols) -> SCARDRETCODE Parameters ---------- hcontext: context handle return from SCardEstablishContext() readername: card reader name dwShareMode: share mode dwPreferredProtocols: preferred protocols This function establishes a connection to the friendly name of the reader specified in szReader. The first connection will power up and perform a reset on the card. Value of dwShareMode Meaning SCARD_SHARE_SHARED This application will allow others to share the reader SCARD_SHARE_EXCLUSIVE This application will NOT allow others to share the reader SCARD_SHARE_DIRECT Direct control of the reader, even without a card SCARD_SHARE_DIRECT can be used before using SCardControl() to send control commands to the reader even if a card is not present in the reader. Value of dwPreferredProtocols Meaning SCARD_PROTOCOL_T0 Use the T=0 protocol SCARD_PROTOCOL_T1 Use the T=1 protocol SCARD_PROTOCOL_RAW Use with memory type cards from smartcard.scard import * ... establish context ... hresult, readers = SCardListReaders(hcontext, 'NULL') if hresult != SCARD_S_SUCCESS: raise error, 'Failed to list readers:: ' + SCardGetErrorMessage(hresult) hresult, hcard, dwActiveProtocol = SCardConnect( hcontext, readers[0], SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0) if hresult != SCARD_S_SUCCESS: raise error, 'unable to connect: ' + SCardGetErrorMessage(hresult) ... """ return _scard.SCardConnect(hcontext, readername, dwShareMode, dwPreferredProtocols) def SCardDisconnect(hcard, dwDisposition): r""" SCardDisconnect( hcard, dwDisposition) -> SCARDRETCODE Parameters ---------- hcard: card handle return from SCardConnect() dwDisposition: card disposition on return This function terminates a connection to the connection made through SCardConnect. disposition can have the following values: Value of disposition Meaning SCARD_LEAVE_CARD Do nothing SCARD_RESET_CARD Reset the card (warm reset) SCARD_UNPOWER_CARD Unpower the card (cold reset) SCARD_EJECT_CARD Eject the card from smartcard.scard import * ... establish context and connect to card ... hresult = SCardDisconnect(hcard, SCARD_UNPOWER_CARD) if hresult != SCARD_S_SUCCESS: raise error, 'failed to disconnect: ' + SCardGetErrorMessage(hresult) ... """ return _scard.SCardDisconnect(hcard, dwDisposition) def SCardEndTransaction(hcard, dwDisposition): r""" SCardEndTransaction( hcard, dwDisposition) -> SCARDRETCODE Parameters ---------- hcard: card handle return from SCardConnect() dwDisposition: card disposition on return This function ends a previously begun transaction. The calling application must be the owner of the previously begun transaction or an error will occur. disposition can have the following values: The disposition action is not currently used in this release. Value of disposition Meaning SCARD_LEAVE_CARD Do nothing SCARD_RESET_CARD Reset the card SCARD_UNPOWER_CARD Unpower the card SCARD_EJECT_CARD Eject the card from smartcard.scard import * ... establish context, connect to card, begin transaction ... hresult = SCardEndTransaction(hcard, SCARD_LEAVE_CARD) if hresult != SCARD_S_SUCCESS: raise error, 'failed to end transaction: ' + SCardGetErrorMessage(hresult) """ return _scard.SCardEndTransaction(hcard, dwDisposition) def SCardEstablishContext(dwScope): r""" SCardEstablishContext( dwScope) -> SCARDRETCODE Parameters ---------- dwScope: context scope This function creates a communication context to the PC/SC Resource Manager. This must be the first function called in a PC/SC application. Value of dwScope Meaning SCARD_SCOPE_USER Operations performed within the scope of the User SCARD_SCOPE_TERMINAL Not used SCARD_SCOPE_GLOBAL Not used SCARD_SCOPE_SYSTEM Operations performed within the scope of the system from smartcard.scard import * hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to establish context: ' + SCardGetErrorMessage(hresult) """ return _scard.SCardEstablishContext(dwScope) def SCardGetStatusChange(hcontext, dwTimeout, readerstatelist): r""" SCardGetStatusChange( hcontext, dwTimeout, tuple[] readerstatelist) -> SCARDRETCODE Parameters ---------- hcontext: context handle return from SCardEstablishContext() dwTimeout: timeout value, INFINITE for infinite time-out readerstatelist: in input/output, a list of reader state tuple (readername, state, atr) This function receives a structure or list of tuples containing reader states. A READERSTATE hast three fields (readername, state, atr). It then blocks for a change in state to occur on any of the OR'd values contained in the current state for a maximum blocking time of dwTimeout or forever if INFINITE is used. The new event state will be contained in state. A status change might be a card insertion or removal event, a change in ATR, etc. Value of state Meaning SCARD_STATE_UNAWARE The application is unaware of the current state, and would like to know. The use of this value results in an immediate return from state transition monitoring services. This is represented by all bits set to zero SCARD_STATE_IGNORE This reader should be ignored SCARD_STATE_CHANGED There is a difference between the state believed by the application, and the state known by the resource manager. When this bit is set, the application may assume a significant state change has occurred on this reader SCARD_STATE_UNKNOWN The given reader name is not recognized by the resource manager. If this bit is set, then SCARD_STATE_CHANGED and SCARD_STATE_IGNORE will also be set SCARD_STATE_UNAVAILABLE The actual state of this reader is not available. If this bit is set, then all the following bits are clear SCARD_STATE_EMPTY There is no card in the reader. If this bit is set, all the following bits will be clear SCARD_STATE_PRESENT There is a card in the reader SCARD_STATE_ATRMATCH There is a card in the reader with an ATR matching one of the target cards. If this bit is set, SCARD_STATE_PRESENT will also be set. This bit is only returned on the SCardLocateCards function SCARD_STATE_EXCLUSIVE The card in the reader is allocated for exclusive use by another application. If this bit is set, SCARD_STATE_PRESENT will also be set SCARD_STATE_INUSE The card in the reader is in use by one or more other applications, but may be connected to in shared mode. If this bit is set, SCARD_STATE_PRESENT will also be set SCARD_STATE_MUTE There is an unresponsive card in the reader from smartcard.scard import * hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) hresult, readers = SCardListReaders(hcontext, []) readerstates = [] cards = [ 'Schlumberger Cryptoflex 4k', 'Schlumberger Cryptoflex 8k', 'Schlumberger Cryptoflex 8k v2' ] for i in xrange(len(readers)): readerstates += [ (readers[i], SCARD_STATE_UNAWARE) ] hresult, newstates = SCardLocateCards(hcontext, cards, readerstates) print '----- Please insert or remove a card ------------' hresult, newstates = SCardGetStatusChange(hcontext, INFINITE, newstates) for i in newstates reader, eventstate, atr = i if eventstate & SCARD_STATE_ATRMATCH: print ' Card found' if eventstate & SCARD_STATE_EMPTY: print ' Reader empty' """ return _scard.SCardGetStatusChange(hcontext, dwTimeout, readerstatelist) def SCardListReaders(hcontext, readergroups): r""" SCardListReaders( hcontext, [] readergroups) -> SCARDRETCODE Parameters ---------- hcontext: context handle return from SCardEstablishContext() readergroups: a list of reader groups to search for readers This function returns a list of currently available readers on the system. A list of group can be provided in input to list readers in a given group only. from smartcard.scard import * hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) hresult, readers = SCardListReaders(hcontext, []) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to list readers: ' + SCardGetErrorMessage(hresult) print 'PCSC Readers: ', readers hresult, readers = SCardListReaders(hcontext, ['SCard$T1ProtocolReaders', 'SCard$MyOwnGroup'] ... """ return _scard.SCardListReaders(hcontext, readergroups) def SCardListReaderGroups(hcontext): r""" SCardListReaderGroups( hcontext) -> SCARDRETCODE Parameters ---------- hcontext: context handle return from SCardEstablishContext() This function returns a list of currently available reader groups on the system. from smartcard.scard import * hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) hresult, readerGroups = SCardListReaderGroups(hcontext) if hresult != SCARD_S_SUCCESS: raise error, 'Unable to list reader groups: ' + SCardGetErrorMessage(hresult) print 'PCSC Reader groups: ', readerGroups """ return _scard.SCardListReaderGroups(hcontext) def SCardReconnect(hcard, dwShareMode, dwPreferredProtocols, dwInitialization): r""" SCardReconnect( hcard, dwShareMode, dwPreferredProtocols, dwInitialization) -> SCARDRETCODE Parameters ---------- hcard: card handle return from SCardConnect() dwShareMode: share mode dwPreferredProtocols: preferred protocols dwInitialization: the type of initialization that should be performed on the card This function reestablishes a connection to a reader that was previously connected to using SCardConnect(). In a multi application environment it is possible for an application to reset the card in shared mode. When this occurs any other application trying to access certain commands will be returned the value SCARD_W_RESET_CARD. When this occurs SCardReconnect() must be called in order to acknowledge that the card was reset and allow it to change it's state accordingly. Value of dwShareMode Meaning SCARD_SHARE_SHARED This application will allow others to share the reader SCARD_SHARE_EXCLUSIVE This application will NOT allow others to share the reader Value of dwPreferredProtocols Meaning SCARD_PROTOCOL_T0 Use the T=0 protocol SCARD_PROTOCOL_T1 Use the T=1 protocol SCARD_PROTOCOL_RAW Use with memory type cards dwPreferredProtocols is a bit mask of acceptable protocols for the connection. You can use (SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1) if you do not have a preferred protocol. Value of dwInitialization Meaning SCARD_LEAVE_CARD Do nothing SCARD_RESET_CARD Reset the card (warm reset) SCARD_UNPOWER_CARD Unpower the card (cold reset) SCARD_EJECT_CARD Eject the card from smartcard.scard import * hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) hresult, hcard, dwActiveProtocol = SCardConnect( hcontext, 'SchlumbergerSema Reflex USB v.2 0', SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0) hresult, activeProtocol = SCardReconnect(hcard, SCARD_SHARE_EXCLUSIVE, SCARD_PROTOCOL_T0, SCARD_RESET_CARD) ... """ return _scard.SCardReconnect(hcard, dwShareMode, dwPreferredProtocols, dwInitialization) def SCardReleaseContext(hcontext): r""" SCardReleaseContext( hcontext) -> SCARDRETCODE Parameters ---------- hcontext: context handle return from SCardEstablishContext() """ return _scard.SCardReleaseContext(hcontext) def SCardStatus(hcard): r""" SCardStatus( hcard) -> SCARDRETCODE Parameters ---------- hcard: card handle return from SCardConnect() This function returns the current status of the reader connected to by hcard. The reader friendly name is returned, as well as the state, protocol and ATR. The state is a DWORD possibly OR'd with the following values: Value of pdwState Meaning SCARD_ABSENT There is no card in the reader SCARD_PRESENT There is a card in the reader, but it has not been moved into position for use SCARD_SWALLOWED There is a card in the reader in position for use. The card is not powered SCARD_POWERED Power is being provided to the card, but the reader driver is unaware of the mode of the card SCARD_NEGOTIABLE The card has been reset and is awaiting PTS negotiation SCARD_SPECIFIC The card has been reset and specific communication protocols have been established Value of pdwProtocol Meaning SCARD_PROTOCOL_T0 Use the T=0 protocol SCARD_PROTOCOL_T1 Use the T=1 protocol from smartcard.scard import * hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) hresult, hcard, dwActiveProtocol = SCardConnect( hcontext, 'SchlumbergerSema Reflex USB v.2 0', SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0) hresult, reader, state, protocol, atr = SCardStatus(hcard) if hresult != SCARD_S_SUCCESS: raise error, 'failed to get status: ' + SCardGetErrorMessage(hresult) print 'Reader: ', reader print 'State: ', state print 'Protocol: ', protocol print 'ATR: ', for i in xrange(len(atr)): print '0x%.2X' % i, print ... """ return _scard.SCardStatus(hcard) def SCardTransmit(hcard, pioSendPci, apducommand): r""" SCardTransmit( hcard, unsigned long pioSendPci, byte[] apducommand) -> SCARDRETCODE Parameters ---------- hcard: card handle return from SCardConnect() pioSendPci: unsigned long apducommand: list of APDU bytes to transmit This function sends an APDU to the smart card contained in the reader connected to by SCardConnect(). It returns a result and the card APDU response. Value of pioSendPci Meaning SCARD_PCI_T0 Pre-defined T=0 PCI structure SCARD_PCI_T1 Pre-defined T=1 PCI structure from smartcard.scard import * hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) hresult, hcard, dwActiveProtocol = SCardConnect( hcontext, 'SchlumbergerSema Reflex USB v.2 0', SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0) SELECT = [0xA0, 0xA4, 0x00, 0x00, 0x02] DF_TELECOM = [0x7F, 0x10] hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) """ return _scard.SCardTransmit(hcard, pioSendPci, apducommand) def SCARD_CTL_CODE(code): r""" SCARD_CTL_CODE(long code) -> long Parameters ---------- code: long This function returns the value of a control code from smartcard.scard import * ... CM_IOCTL_GET_FEATURE_REQUEST = SCARD_CTL_CODE(3400) ... """ return _scard.SCARD_CTL_CODE(code) def SCardGetErrorMessage(lErrCode): r""" SCardGetErrorMessage(long lErrCode) -> ERRORSTRING * Parameters ---------- lErrCode: long This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ return _scard.SCardGetErrorMessage(lErrCode) error = _scard.error SCARD_SCOPE_USER = _scard.SCARD_SCOPE_USER r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_SCOPE_TERMINAL = _scard.SCARD_SCOPE_TERMINAL r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_SCOPE_SYSTEM = _scard.SCARD_SCOPE_SYSTEM r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_SHARE_SHARED = _scard.SCARD_SHARE_SHARED r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_SHARE_EXCLUSIVE = _scard.SCARD_SHARE_EXCLUSIVE r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_SHARE_DIRECT = _scard.SCARD_SHARE_DIRECT r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_LEAVE_CARD = _scard.SCARD_LEAVE_CARD r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_RESET_CARD = _scard.SCARD_RESET_CARD r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_UNPOWER_CARD = _scard.SCARD_UNPOWER_CARD r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_EJECT_CARD = _scard.SCARD_EJECT_CARD r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_STATE_UNAWARE = _scard.SCARD_STATE_UNAWARE r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_STATE_IGNORE = _scard.SCARD_STATE_IGNORE r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_STATE_CHANGED = _scard.SCARD_STATE_CHANGED r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_STATE_UNKNOWN = _scard.SCARD_STATE_UNKNOWN r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_STATE_UNAVAILABLE = _scard.SCARD_STATE_UNAVAILABLE r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_STATE_EMPTY = _scard.SCARD_STATE_EMPTY r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_STATE_PRESENT = _scard.SCARD_STATE_PRESENT r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_STATE_ATRMATCH = _scard.SCARD_STATE_ATRMATCH r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_STATE_EXCLUSIVE = _scard.SCARD_STATE_EXCLUSIVE r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_STATE_INUSE = _scard.SCARD_STATE_INUSE r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_STATE_MUTE = _scard.SCARD_STATE_MUTE r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_STATE_UNPOWERED = _scard.SCARD_STATE_UNPOWERED r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_PROTOCOL_UNDEFINED = _scard.SCARD_PROTOCOL_UNDEFINED r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_PROTOCOL_T0 = _scard.SCARD_PROTOCOL_T0 r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_PROTOCOL_T1 = _scard.SCARD_PROTOCOL_T1 r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_PROTOCOL_RAW = _scard.SCARD_PROTOCOL_RAW r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_PROTOCOL_Tx = _scard.SCARD_PROTOCOL_Tx r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_PROTOCOL_DEFAULT = _scard.SCARD_PROTOCOL_DEFAULT r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_PROTOCOL_OPTIMAL = _scard.SCARD_PROTOCOL_OPTIMAL r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_PROTOCOL_UNSET = _scard.SCARD_PROTOCOL_UNSET r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_PROTOCOL_ANY = _scard.SCARD_PROTOCOL_ANY r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_PROTOCOL_T15 = _scard.SCARD_PROTOCOL_T15 r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_PCI_T0 = _scard.SCARD_PCI_T0 r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_PCI_T1 = _scard.SCARD_PCI_T1 r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_PCI_RAW = _scard.SCARD_PCI_RAW r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_PROVIDER_PRIMARY = _scard.SCARD_PROVIDER_PRIMARY r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_PROVIDER_CSP = _scard.SCARD_PROVIDER_CSP r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_VENDOR_NAME = _scard.SCARD_ATTR_VENDOR_NAME r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_VENDOR_IFD_TYPE = _scard.SCARD_ATTR_VENDOR_IFD_TYPE r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_VENDOR_IFD_VERSION = _scard.SCARD_ATTR_VENDOR_IFD_VERSION r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_VENDOR_IFD_SERIAL_NO = _scard.SCARD_ATTR_VENDOR_IFD_SERIAL_NO r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_CHANNEL_ID = _scard.SCARD_ATTR_CHANNEL_ID r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_DEFAULT_CLK = _scard.SCARD_ATTR_DEFAULT_CLK r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_MAX_CLK = _scard.SCARD_ATTR_MAX_CLK r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_DEFAULT_DATA_RATE = _scard.SCARD_ATTR_DEFAULT_DATA_RATE r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_MAX_DATA_RATE = _scard.SCARD_ATTR_MAX_DATA_RATE r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_MAX_IFSD = _scard.SCARD_ATTR_MAX_IFSD r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_POWER_MGMT_SUPPORT = _scard.SCARD_ATTR_POWER_MGMT_SUPPORT r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_USER_TO_CARD_AUTH_DEVICE = _scard.SCARD_ATTR_USER_TO_CARD_AUTH_DEVICE r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_USER_AUTH_INPUT_DEVICE = _scard.SCARD_ATTR_USER_AUTH_INPUT_DEVICE r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_CHARACTERISTICS = _scard.SCARD_ATTR_CHARACTERISTICS r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_CURRENT_PROTOCOL_TYPE = _scard.SCARD_ATTR_CURRENT_PROTOCOL_TYPE r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_CURRENT_CLK = _scard.SCARD_ATTR_CURRENT_CLK r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_CURRENT_F = _scard.SCARD_ATTR_CURRENT_F r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_CURRENT_D = _scard.SCARD_ATTR_CURRENT_D r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_CURRENT_N = _scard.SCARD_ATTR_CURRENT_N r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_CURRENT_W = _scard.SCARD_ATTR_CURRENT_W r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_CURRENT_IFSC = _scard.SCARD_ATTR_CURRENT_IFSC r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_CURRENT_IFSD = _scard.SCARD_ATTR_CURRENT_IFSD r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_CURRENT_BWT = _scard.SCARD_ATTR_CURRENT_BWT r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_CURRENT_CWT = _scard.SCARD_ATTR_CURRENT_CWT r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_CURRENT_EBC_ENCODING = _scard.SCARD_ATTR_CURRENT_EBC_ENCODING r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_EXTENDED_BWT = _scard.SCARD_ATTR_EXTENDED_BWT r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_ICC_PRESENCE = _scard.SCARD_ATTR_ICC_PRESENCE r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_ICC_INTERFACE_STATUS = _scard.SCARD_ATTR_ICC_INTERFACE_STATUS r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_CURRENT_IO_STATE = _scard.SCARD_ATTR_CURRENT_IO_STATE r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_ATR_STRING = _scard.SCARD_ATTR_ATR_STRING r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_ICC_TYPE_PER_ATR = _scard.SCARD_ATTR_ICC_TYPE_PER_ATR r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_ESC_RESET = _scard.SCARD_ATTR_ESC_RESET r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_ESC_CANCEL = _scard.SCARD_ATTR_ESC_CANCEL r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_ESC_AUTHREQUEST = _scard.SCARD_ATTR_ESC_AUTHREQUEST r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_MAXINPUT = _scard.SCARD_ATTR_MAXINPUT r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_DEVICE_UNIT = _scard.SCARD_ATTR_DEVICE_UNIT r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_DEVICE_IN_USE = _scard.SCARD_ATTR_DEVICE_IN_USE r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_DEVICE_FRIENDLY_NAME_A = _scard.SCARD_ATTR_DEVICE_FRIENDLY_NAME_A r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_DEVICE_SYSTEM_NAME_A = _scard.SCARD_ATTR_DEVICE_SYSTEM_NAME_A r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_DEVICE_FRIENDLY_NAME_W = _scard.SCARD_ATTR_DEVICE_FRIENDLY_NAME_W r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_DEVICE_SYSTEM_NAME_W = _scard.SCARD_ATTR_DEVICE_SYSTEM_NAME_W r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_ATTR_SUPRESS_T1_IFS_REQUEST = _scard.SCARD_ATTR_SUPRESS_T1_IFS_REQUEST r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ ERROR_ALREADY_EXISTS = _scard.ERROR_ALREADY_EXISTS r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_S_SUCCESS = _scard.SCARD_S_SUCCESS r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_F_INTERNAL_ERROR = _scard.SCARD_F_INTERNAL_ERROR r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_CANCELLED = _scard.SCARD_E_CANCELLED r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_INVALID_HANDLE = _scard.SCARD_E_INVALID_HANDLE r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_INVALID_PARAMETER = _scard.SCARD_E_INVALID_PARAMETER r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_INVALID_TARGET = _scard.SCARD_E_INVALID_TARGET r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_NO_MEMORY = _scard.SCARD_E_NO_MEMORY r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_F_WAITED_TOO_LONG = _scard.SCARD_F_WAITED_TOO_LONG r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_INSUFFICIENT_BUFFER = _scard.SCARD_E_INSUFFICIENT_BUFFER r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_UNKNOWN_READER = _scard.SCARD_E_UNKNOWN_READER r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_TIMEOUT = _scard.SCARD_E_TIMEOUT r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_SHARING_VIOLATION = _scard.SCARD_E_SHARING_VIOLATION r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_NO_SMARTCARD = _scard.SCARD_E_NO_SMARTCARD r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_UNKNOWN_CARD = _scard.SCARD_E_UNKNOWN_CARD r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_CANT_DISPOSE = _scard.SCARD_E_CANT_DISPOSE r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_PROTO_MISMATCH = _scard.SCARD_E_PROTO_MISMATCH r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_NOT_READY = _scard.SCARD_E_NOT_READY r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_INVALID_VALUE = _scard.SCARD_E_INVALID_VALUE r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_SYSTEM_CANCELLED = _scard.SCARD_E_SYSTEM_CANCELLED r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_F_COMM_ERROR = _scard.SCARD_F_COMM_ERROR r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_F_UNKNOWN_ERROR = _scard.SCARD_F_UNKNOWN_ERROR r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_INVALID_ATR = _scard.SCARD_E_INVALID_ATR r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_NOT_TRANSACTED = _scard.SCARD_E_NOT_TRANSACTED r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_READER_UNAVAILABLE = _scard.SCARD_E_READER_UNAVAILABLE r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_PCI_TOO_SMALL = _scard.SCARD_E_PCI_TOO_SMALL r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_READER_UNSUPPORTED = _scard.SCARD_E_READER_UNSUPPORTED r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_DUPLICATE_READER = _scard.SCARD_E_DUPLICATE_READER r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_CARD_UNSUPPORTED = _scard.SCARD_E_CARD_UNSUPPORTED r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_NO_SERVICE = _scard.SCARD_E_NO_SERVICE r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_SERVICE_STOPPED = _scard.SCARD_E_SERVICE_STOPPED r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_NO_READERS_AVAILABLE = _scard.SCARD_E_NO_READERS_AVAILABLE r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_UNSUPPORTED_FEATURE = _scard.SCARD_E_UNSUPPORTED_FEATURE r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_W_UNSUPPORTED_CARD = _scard.SCARD_W_UNSUPPORTED_CARD r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_W_UNRESPONSIVE_CARD = _scard.SCARD_W_UNRESPONSIVE_CARD r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_W_UNPOWERED_CARD = _scard.SCARD_W_UNPOWERED_CARD r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_W_RESET_CARD = _scard.SCARD_W_RESET_CARD r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_W_REMOVED_CARD = _scard.SCARD_W_REMOVED_CARD r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_W_SECURITY_VIOLATION = _scard.SCARD_W_SECURITY_VIOLATION r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_W_WRONG_CHV = _scard.SCARD_W_WRONG_CHV r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_W_CHV_BLOCKED = _scard.SCARD_W_CHV_BLOCKED r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_W_EOF = _scard.SCARD_W_EOF r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_W_CANCELLED_BY_USER = _scard.SCARD_W_CANCELLED_BY_USER r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_W_CARD_NOT_AUTHENTICATED = _scard.SCARD_W_CARD_NOT_AUTHENTICATED r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_UNEXPECTED = _scard.SCARD_E_UNEXPECTED r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_ICC_INSTALLATION = _scard.SCARD_E_ICC_INSTALLATION r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_ICC_CREATEORDER = _scard.SCARD_E_ICC_CREATEORDER r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_DIR_NOT_FOUND = _scard.SCARD_E_DIR_NOT_FOUND r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_FILE_NOT_FOUND = _scard.SCARD_E_FILE_NOT_FOUND r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_NO_DIR = _scard.SCARD_E_NO_DIR r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_NO_FILE = _scard.SCARD_E_NO_FILE r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_NO_ACCESS = _scard.SCARD_E_NO_ACCESS r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_WRITE_TOO_MANY = _scard.SCARD_E_WRITE_TOO_MANY r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_BAD_SEEK = _scard.SCARD_E_BAD_SEEK r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_INVALID_CHV = _scard.SCARD_E_INVALID_CHV r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_UNKNOWN_RES_MNG = _scard.SCARD_E_UNKNOWN_RES_MNG r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_NO_SUCH_CERTIFICATE = _scard.SCARD_E_NO_SUCH_CERTIFICATE r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_CERTIFICATE_UNAVAILABLE = _scard.SCARD_E_CERTIFICATE_UNAVAILABLE r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_COMM_DATA_LOST = _scard.SCARD_E_COMM_DATA_LOST r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_NO_KEY_CONTAINER = _scard.SCARD_E_NO_KEY_CONTAINER r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_E_SERVER_TOO_BUSY = _scard.SCARD_E_SERVER_TOO_BUSY r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ ERROR_INVALID_HANDLE = _scard.ERROR_INVALID_HANDLE r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ SCARD_P_SHUTDOWN = _scard.SCARD_P_SHUTDOWN r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ INFINITE = _scard.INFINITE r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ resourceManager = _scard.resourceManager r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """ resourceManagerSubType = _scard.resourceManagerSubType r""" This function return a human readable text for the given PC/SC error code. from smartcard.scard import * ... hresult, response = SCardTransmit(hcard, SCARD_PCI_T0, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) ... """
33.424649
249
0.675936
12,600
104,686
5.418175
0.064444
0.055545
0.034086
0.052147
0.733085
0.704507
0.689112
0.676867
0.663464
0.656154
0
0.005151
0.243395
104,686
3,131
250
33.435324
0.856766
0.36961
0
0.029018
1
0
0.016095
0
0
0
0
0
0
1
0.091518
false
0
0.013393
0.004464
0.203125
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
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
200ef42bfef4d6393d9dcce9e1c4825bb9b3de29
7,162
py
Python
sacla/scripts/pv3.py
beamline-i24/DiamondChips
02fb58a95ad2c1712c41b641eb5f197d688c54c3
[ "Apache-2.0" ]
null
null
null
sacla/scripts/pv3.py
beamline-i24/DiamondChips
02fb58a95ad2c1712c41b641eb5f197d688c54c3
[ "Apache-2.0" ]
null
null
null
sacla/scripts/pv3.py
beamline-i24/DiamondChips
02fb58a95ad2c1712c41b641eb5f197d688c54c3
[ "Apache-2.0" ]
null
null
null
#PILATUS pilat_file_path = 'BL24I-EA-PILAT-01:cam1:FilePath' pilat_file_name = 'BL24I-EA-PILAT-01:cam1:FileName' pilat_file_temp = 'BL24I-EA-PILAT-01:cam1:FileTemplate' pilat_numb_imgs = 'BL24I-EA-PILAT-01:cam1:NumImages' pilat_file_num = 'BL24I-EA-PILAT-01:cam1:FileNumber' pilat_acquire = 'BL24I-EA-PILAT-01:cam1:Acquire' pilat_acq_time = 'BL24I-EA-PILAT-01:cam1:AcquireTime' pilat_acq_period = 'BL24I-EA-PILAT-01:cam1:AcquirePeriod' pilat_trig_mode = 'BL24I-EA-PILAT-01:cam1:TriggerMode' pilat_delay_time = 'BL24I-EA-PILAT-01:cam1:DelayTime' pilat_wavelength = 'BL24I-EA-PILAT-01:cam1:Wavelength' pilat_detdist = 'BL24I-EA-PILAT-01:cam1:DetDist' pilat_transm = 'BL24I-EA-PILAT-01:cam1:FilterTrasm' pilat_beamx = 'BL24I-EA-PILAT-01:cam1:BeamX' pilat_beamy = 'BL24I-EA-PILAT-01:cam1:BeamY' #ZEBRA zebra1_and3_inp1 = 'BL24I-EA-ZEBRA-01:AND3_INP1' zebra1_and3_inp2 = 'BL24I-EA-ZEBRA-01:AND3_INP2' zebra1_out2_ttl = 'BL24I-EA-ZEBRA-01:OUT2_TTL' zebra1_arm_out = 'BL24I-EA-ZEBRA-01:PC_ARM_OUT' zebra1_gate_sel = 'BL24I-EA-ZEBRA-01:PC_GATE_SEL' zebra1_gate_inp = 'BL24I-EA-ZEBRA-01:PC_GATE_INP' zebra1_puls_sel = 'BL24I-EA-ZEBRA-01:PC_PULSE_SEL' zebra1_puls_inp = 'BL24I-EA-ZEBRA-01:PC_PULSE_INP' zebra1_soft_b0 = 'BL24I-EA-ZEBRA-01:SOFT_IN:B0' zebra1_soft_b1 = 'BL24I-EA-ZEBRA-01:SOFT_IN:B1' zebra1_soft_b2 = 'BL24I-EA-ZEBRA-01:SOFT_IN:B2' #XPRESS3 xpress3_start = 'BL24I-EA-XSP3-01:Acquire' xpress3_erase = 'BL24I-EA-XSP3-01:ERASE' xpress3_acq_time = 'BL24I-EA-XSP3-01:AcquireTime' xpress3_num_frms = 'BL24I-EA-XSP3-01:NumImages' xpress3_trig_type = 'BL24I-EA-XSP3-01:TriggerMode' xpress3_roi_low = 'BL24I-EA-XSP3-01:C1_MCA_ROI1_LLM' xpress3_roi_high = 'BL24I-EA-XSP3-01:C1_MCA_ROI1_HLM' xpress3_total_count = 'BL24I-EA-XSP3-01:C1_ROI1:Value_RBV' #ME14E me14e_pmac_str = 'ME14E-MO-CHIP-01:PMAC_STRING' me14e_stage_x = 'ME14E-MO-CHIP-01:X' me14e_stage_y = 'ME14E-MO-CHIP-01:Y' me14e_stage_z = 'ME14E-MO-CHIP-01:Z' me14e_filter = 'ME14E-MO-CHIP-01:FILTER' me14e_filepath = 'ME14E-MO-CHIP-01:filePath' me14e_chip_name = 'ME14E-MO-CHIP-01:chipName' me14e_chipcapacity = 'ME14E-MO-CHIP-01:chipCapacity' me14e_blockcapacity = 'ME14E-MO-CHIP-01:blockCapacity' me14e_exptime = 'ME14E-MO-CHIP-01:expTime' me14e_dcdetdist= 'ME14E-MO-CHIP-01:detDistance' me14e_scanstatus = 'ME14E-MO-CHIP-01:signal:P2401' me14e_counter = 'ME14E-MO-CHIP-01:signal:P2402' me14e_gp1 = 'ME14E-MO-IOC-01:GP1' me14e_gp2 = 'ME14E-MO-IOC-01:GP2' me14e_gp3 = 'ME14E-MO-IOC-01:GP3' me14e_gp4 = 'ME14E-MO-IOC-01:GP4' me14e_gp5 = 'ME14E-MO-IOC-01:GP5' me14e_gp6 = 'ME14E-MO-IOC-01:GP6' me14e_gp7 = 'ME14E-MO-IOC-01:GP7' me14e_gp8 = 'ME14E-MO-IOC-01:GP8' me14e_gp9 = 'ME14E-MO-IOC-01:GP9' me14e_gp10 = 'ME14E-MO-IOC-01:GP10' me14e_gp11 = 'ME14E-MO-IOC-01:GP11' me14e_gp12 = 'ME14E-MO-IOC-01:GP12' me14e_gp13 = 'ME14E-MO-IOC-01:GP13' me14e_gp14 = 'ME14E-MO-IOC-01:GP14' me14e_gp15 = 'ME14E-MO-IOC-01:GP15' me14e_gp16 = 'ME14E-MO-IOC-01:GP16' me14e_gp17 = 'ME14E-MO-IOC-01:GP17' me14e_gp18 = 'ME14E-MO-IOC-01:GP18' me14e_gp19 = 'ME14E-MO-IOC-01:GP19' me14e_gp20 = 'ME14E-MO-IOC-01:GP20' me14e_gp21 = 'ME14E-MO-IOC-01:GP21' me14e_gp22 = 'ME14E-MO-IOC-01:GP22' me14e_gp23 = 'ME14E-MO-IOC-01:GP23' me14e_gp24 = 'ME14E-MO-IOC-01:GP24' me14e_gp25 = 'ME14E-MO-IOC-01:GP25' me14e_gp26 = 'ME14E-MO-IOC-01:GP26' me14e_gp27 = 'ME14E-MO-IOC-01:GP27' me14e_gp28 = 'ME14E-MO-IOC-01:GP28' me14e_gp29 = 'ME14E-MO-IOC-01:GP29' me14e_gp30 = 'ME14E-MO-IOC-01:GP30' me14e_gp31 = 'ME14E-MO-IOC-01:GP31' me14e_gp32 = 'ME14E-MO-IOC-01:GP32' me14e_gp33 = 'ME14E-MO-IOC-01:GP33' me14e_gp34 = 'ME14E-MO-IOC-01:GP34' me14e_gp35 = 'ME14E-MO-IOC-01:GP35' me14e_gp36 = 'ME14E-MO-IOC-01:GP36' me14e_gp37 = 'ME14E-MO-IOC-01:GP37' me14e_gp38 = 'ME14E-MO-IOC-01:GP38' me14e_gp39 = 'ME14E-MO-IOC-01:GP39' me14e_gp40 = 'ME14E-MO-IOC-01:GP40' me14e_gp41 = 'ME14E-MO-IOC-01:GP41' me14e_gp42 = 'ME14E-MO-IOC-01:GP42' me14e_gp43 = 'ME14E-MO-IOC-01:GP43' me14e_gp44 = 'ME14E-MO-IOC-01:GP44' me14e_gp45 = 'ME14E-MO-IOC-01:GP45' me14e_gp46 = 'ME14E-MO-IOC-01:GP46' me14e_gp47 = 'ME14E-MO-IOC-01:GP47' me14e_gp48 = 'ME14E-MO-IOC-01:GP48' me14e_gp49 = 'ME14E-MO-IOC-01:GP49' me14e_gp50 = 'ME14E-MO-IOC-01:GP50' me14e_gp51 = 'ME14E-MO-IOC-01:GP51' me14e_gp52 = 'ME14E-MO-IOC-01:GP52' me14e_gp53 = 'ME14E-MO-IOC-01:GP53' me14e_gp54 = 'ME14E-MO-IOC-01:GP54' me14e_gp55 = 'ME14E-MO-IOC-01:GP55' me14e_gp56 = 'ME14E-MO-IOC-01:GP56' me14e_gp57 = 'ME14E-MO-IOC-01:GP57' me14e_gp58 = 'ME14E-MO-IOC-01:GP58' me14e_gp59 = 'ME14E-MO-IOC-01:GP59' me14e_gp60 = 'ME14E-MO-IOC-01:GP60' me14e_gp61 = 'ME14E-MO-IOC-01:GP61' me14e_gp62 = 'ME14E-MO-IOC-01:GP62' me14e_gp63 = 'ME14E-MO-IOC-01:GP63' me14e_gp64 = 'ME14E-MO-IOC-01:GP64' me14e_gp65 = 'ME14E-MO-IOC-01:GP65' me14e_gp66 = 'ME14E-MO-IOC-01:GP66' me14e_gp67 = 'ME14E-MO-IOC-01:GP67' me14e_gp68 = 'ME14E-MO-IOC-01:GP68' me14e_gp69 = 'ME14E-MO-IOC-01:GP69' me14e_gp70 = 'ME14E-MO-IOC-01:GP70' me14e_gp71 = 'ME14E-MO-IOC-01:GP71' me14e_gp72 = 'ME14E-MO-IOC-01:GP72' me14e_gp73 = 'ME14E-MO-IOC-01:GP73' me14e_gp74 = 'ME14E-MO-IOC-01:GP74' me14e_gp75 = 'ME14E-MO-IOC-01:GP75' me14e_gp76 = 'ME14E-MO-IOC-01:GP76' me14e_gp77 = 'ME14E-MO-IOC-01:GP77' me14e_gp78 = 'ME14E-MO-IOC-01:GP78' me14e_gp79 = 'ME14E-MO-IOC-01:GP79' me14e_gp80 = 'ME14E-MO-IOC-01:GP80' me14e_gp81 = 'ME14E-MO-IOC-01:GP81' me14e_gp82 = 'ME14E-MO-IOC-01:GP82' me14e_gp83 = 'ME14E-MO-IOC-01:GP83' me14e_gp84 = 'ME14E-MO-IOC-01:GP84' me14e_gp85 = 'ME14E-MO-IOC-01:GP85' me14e_gp86 = 'ME14E-MO-IOC-01:GP86' me14e_gp87 = 'ME14E-MO-IOC-01:GP87' me14e_gp88 = 'ME14E-MO-IOC-01:GP88' me14e_gp89 = 'ME14E-MO-IOC-01:GP89' me14e_gp90 = 'ME14E-MO-IOC-01:GP90' me14e_gp91 = 'ME14E-MO-IOC-01:GP91' me14e_gp92 = 'ME14E-MO-IOC-01:GP92' me14e_gp93 = 'ME14E-MO-IOC-01:GP93' me14e_gp94 = 'ME14E-MO-IOC-01:GP94' me14e_gp95 = 'ME14E-MO-IOC-01:GP95' me14e_gp96 = 'ME14E-MO-IOC-01:GP96' me14e_gp97 = 'ME14E-MO-IOC-01:GP97' me14e_gp98 = 'ME14E-MO-IOC-01:GP98' me14e_gp99 = 'ME14E-MO-IOC-01:GP99' #PIN GONIOMETER pin_omega = 'BL24I-MO-GONIO-02:OMEGA' pin_kappa = 'BL24I-MO-GONIO-02:KAPPA' pin_phi = 'BL24I-MO-GONIO-02:PHI' pin_x = 'BL24I-MO-GONIO-02:PINX' pin_xs = 'BL24I-MO-GONIO-02:PINXS' pin_y = 'BL24I-MO-GONIO-02:PINY' pin_z = 'BL24I-MO-GONIO-02:PINZ' pin_zs = 'BL24I-MO-GONIO-02:PINZS' ptab_x = 'BL24I-MO-VPIN-01:X' ptab_y = 'BL24I-MO-VPIN-01:Y' ptab_z = 'BL24I-MO-VPIN-01:Z' #TRAY GONIOMETER tray_omega = 'BL24I-MO-GONIO-01:OMEGA' tray_y = 'BL24I-MO-TRAY-01:Y' tray_z = 'BL24I-MO-TRAY-01:Z' ttab_x = 'BL24I-MO-GONIO-01:TTABX' ttab_y = 'BL24I-MO-GONIO-01:TTABY' ttab_z = 'BL24I-MO-GONIO-01:TTABZ' #CRYOSTREAM cryo_r = 'BL24I-CG-JET-01:TRANS' cryo_pos = 'BL24I-CG-JET-01:MP:SELECT' cryo_toggle = 'BL24I-CG-JET-01:P1701' #GAPS ap_pos = 'BL24I-AL-APTR-01:MP:SELECT' sg1_x = 'BL24I-AL-GUARD-01:X' sg1_y = 'BL24I-AL-GUARD-01:Y' #FLUORESCENCE DETECTOR fluo_pos = 'BL24I-EA-DET-02:TRANS' fluo_outlim_pos = 'BL24I-EA-DET-02:OUT:LIMIT' #BEAMSTOP beamstop_pos = 'BL24I-RS-ABSB-02:MP:SELECT' beamstop_rot = 'BL24I-RS-ABSB-02:ROTY' #BACKLIGHT blighty_pos = 'BL24I-MO-LIGHT-01:MP:SELECT' #DETECTOR det_z = 'BL24I-EA-DET-01:Z' #DCM wavelength = 'BL24I-OP-DCM-01:LAMBDA' energy = 'BL24I-OP-DCM-01:ENERGY' #ATTENUATORS filter_transm = 'BL24I-OP-ATTN-01:MATCH'
34.599034
58
0.740575
1,344
7,162
3.773065
0.188988
0.154605
0.195228
0.234273
0.120489
0.047722
0.008677
0
0
0
0
0.211684
0.079866
7,162
206
59
34.76699
0.557815
0.017732
0
0
0
0
0.570798
0.261681
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
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
3
202b359513f51708d7eb7be95a2b59ab940c8140
36
py
Python
system/protocols/generic/__init__.py
UltrosBot/Ultros
639efc11f73ebf7e8f47f0554aced00a559d9e2d
[ "Artistic-2.0" ]
16
2015-01-02T00:16:11.000Z
2019-06-03T06:23:11.000Z
system/protocols/generic/__init__.py
UltrosBot/Ultros
639efc11f73ebf7e8f47f0554aced00a559d9e2d
[ "Artistic-2.0" ]
31
2015-01-18T12:14:53.000Z
2018-01-07T13:32:29.000Z
system/protocols/generic/__init__.py
UltrosBot/Ultros
639efc11f73ebf7e8f47f0554aced00a559d9e2d
[ "Artistic-2.0" ]
9
2015-02-13T09:38:53.000Z
2020-11-29T19:59:32.000Z
# coding=utf-8 __author__ = 'Sean'
9
19
0.666667
5
36
4
1
0
0
0
0
0
0
0
0
0
0
0.033333
0.166667
36
3
20
12
0.633333
0.333333
0
0
0
0
0.181818
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
203cbdc89d4f2978be7134d545c2c02ab6abca2d
190
py
Python
src/jobs/write_notification.py
daianasousa/Projeto-BLX
4006af4a998a4837b4f5e89d842d74cb454fc52c
[ "MIT" ]
null
null
null
src/jobs/write_notification.py
daianasousa/Projeto-BLX
4006af4a998a4837b4f5e89d842d74cb454fc52c
[ "MIT" ]
null
null
null
src/jobs/write_notification.py
daianasousa/Projeto-BLX
4006af4a998a4837b4f5e89d842d74cb454fc52c
[ "MIT" ]
null
null
null
def write_notification(email: str, mensagem=''): with open('log.txt', mode='a') as email_file: conteudo = f'Email: {email} - msg: {mensagem}\n' email_file.write(conteudo)
47.5
56
0.642105
26
190
4.576923
0.692308
0.151261
0
0
0
0
0
0
0
0
0
0
0.189474
190
4
57
47.5
0.772727
0
0
0
0
0
0.219895
0
0
0
0
0
0
1
0.25
false
0
0
0
0.25
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
3
203f675ff410bffb2f8fc129a258a5f53d79aacf
336
py
Python
mayan/apps/scheduler/permissions.py
Dave360-crypto/mayan-edms
9cd37537461347f79ff0429e4b8b16fd2446798d
[ "Apache-2.0" ]
3
2020-02-03T11:58:51.000Z
2020-10-20T03:52:21.000Z
mayan/apps/scheduler/permissions.py
Dave360-crypto/mayan-edms
9cd37537461347f79ff0429e4b8b16fd2446798d
[ "Apache-2.0" ]
null
null
null
mayan/apps/scheduler/permissions.py
Dave360-crypto/mayan-edms
9cd37537461347f79ff0429e4b8b16fd2446798d
[ "Apache-2.0" ]
2
2020-10-24T11:10:06.000Z
2021-03-03T20:05:38.000Z
from __future__ import absolute_import from django.utils.translation import ugettext_lazy as _ from permissions.models import PermissionNamespace, Permission namespace = PermissionNamespace('scheduler', _(u'Scheduler')) PERMISSION_VIEW_JOB_LIST = Permission.objects.register(namespace, 'jobs_list', _(u'View the interval job list'))
37.333333
112
0.827381
40
336
6.625
0.625
0.05283
0
0
0
0
0
0
0
0
0
0
0.092262
336
8
113
42
0.868852
0
0
0
0
0
0.157738
0
0
0
0
0
0
1
0
false
0
0.6
0
0.6
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
3
2047aaf1773627781dbbff3024237cc94ffa4aba
1,258
py
Python
spottelbot/botexceptions.py
mnowiasz/spottelbot
72ad0692edf5f244b7cb16171248d266ed82ce94
[ "MIT" ]
null
null
null
spottelbot/botexceptions.py
mnowiasz/spottelbot
72ad0692edf5f244b7cb16171248d266ed82ce94
[ "MIT" ]
null
null
null
spottelbot/botexceptions.py
mnowiasz/spottelbot
72ad0692edf5f244b7cb16171248d266ed82ce94
[ "MIT" ]
null
null
null
"""Custom exception where the builin exceptions won't suffice""" # Invalid user in the configfile (non-numeric UserID with no "@") class InvalidUser(Exception): def __init__(self, userid): self.bad_id = userid # No Token or empty token defined class MissingTelegramToken(Exception): pass # No users (or empty users). class MissingUsers(Exception): pass class DuplicateUsers(Exception): def __init__(self, telegram_id=None): self.duplicate_id = telegram_id # No username (or empty username) for spotify class MissingSpotifyUsername(Exception): pass # A section is missing class MissingSection(Exception): def __init__(self, section=None): self.missing_section = section # Invalid Bookmarks (more than one or two entries) class InvalidBookmark(Exception): def __init__(self, bookmark=None): self.invalid_bookmark = bookmark # Invalid range/argument to /last or /mark class InvalidRange(Exception): def __init__(self, argument=None): self.invalid_argument = argument # Unable to connect to spotify class SpotifyAuth(Exception): pass # Max message length class TelegramMessageLength(Exception): def __init__(self, length=0): self.invalid_length = length
22.070175
65
0.72814
153
1,258
5.777778
0.444444
0.081448
0.108597
0.135747
0
0
0
0
0
0
0
0.000981
0.189984
1,258
56
66
22.464286
0.866536
0.306041
0
0.153846
0
0
0
0
0
0
0
0
0
1
0.230769
false
0.153846
0
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
1
0
1
0
0
1
0
0
3
204ac12bfcc8a62a1ffcd3cacb0f4f80cf9ae16d
6,260
py
Python
web3/settings/__init__.py
anonymoose2/director
c73c0e106372031ffe84bf044d8a88137518635c
[ "MIT" ]
10
2017-03-20T14:40:56.000Z
2020-04-07T17:03:42.000Z
web3/settings/__init__.py
anonymoose2/director
c73c0e106372031ffe84bf044d8a88137518635c
[ "MIT" ]
50
2017-05-23T01:26:26.000Z
2020-06-05T17:13:25.000Z
web3/settings/__init__.py
anonymoose2/director
c73c0e106372031ffe84bf044d8a88137518635c
[ "MIT" ]
9
2017-03-18T01:23:38.000Z
2020-08-17T20:50:07.000Z
""" Django settings for web3 project. Generated by 'django-admin startproject' using Django 1.10.1. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) PROJECT_ROOT = BASE_DIR # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 's-gh_-#s^oq^0*5=y8k&*^l8m9540mvo@m*tazzw%3*o7$y&m0' ALLOWED_HOSTS = ["director.tjhsst.edu", "127.0.0.1", "localhost"] # This is the path to the certificate that is used to authenticate with the conductor agent. CONDUCTOR_CERT_PATH = os.path.join(PROJECT_ROOT, "settings/conductor.pem") # Maximum number of machines that a non-staff, non-superuser account can create. MAX_VMS = 5 # If this is set, the variable appears on all pages on Director. GLOBAL_WARNING = None # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True # Default database password used in development. DB_USERNAME = "web3" DB_PASSWORD = "web3" # Default project domain, subdomains are used for project websites. PROJECT_DOMAIN = "tjhsst.io" # Enables existing accounts to login with a username and password. # Default to not allow password authentication. PASSWORD_AUTH = False # Let's Encrypt Settings LE_WEBROOT = "/var/www/certbot/" ALLOWED_METRIC_SCRAPE_IPS = [] try: from .secret import * # noqa except ImportError: pass if "TRAVIS" in os.environ: DB_USERNAME = "postgres" DB_PASSWORD = "" # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django_extensions', 'social_django', 'simple_history', 'web3', 'web3.apps.auth', 'web3.apps.sites', 'web3.apps.users', 'web3.apps.vms', 'web3.apps.feedback', 'web3.apps.request', 'web3.apps.docs' ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'simple_history.middleware.HistoryRequestMiddleware' ] ROOT_URLCONF = 'web3.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [ os.path.join(BASE_DIR, "templates") ], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', 'social_django.context_processors.backends', 'social_django.context_processors.login_redirect', 'web3.apps.context_processors.email' ], }, }, ] if DEBUG: INSTALLED_APPS += ('debug_toolbar',) MIDDLEWARE += ('debug_toolbar.middleware.DebugToolbarMiddleware',) else: INSTALLED_APPS += ('raven.contrib.django.raven_compat',) WSGI_APPLICATION = 'web3.wsgi.application' # Database # https://docs.djangoproject.com/en/1.10/ref/settings/#databases DATABASES = { "default": { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'web3', 'USER': DB_USERNAME, 'PASSWORD': DB_PASSWORD, 'HOST': '127.0.0.1', 'PORT': '5432' } } # Password validation # https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ] # Internationalization # https://docs.djangoproject.com/en/1.10/topics/i18n/ LANGUAGE_CODE = 'en-us' TIME_ZONE = 'US/Eastern' USE_I18N = True USE_L10N = True USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.10/howto/static-files/ STATIC_URL = '/static/' STATICFILES_DIRS = ( os.path.join(PROJECT_ROOT, 'static/'), ) SOCIAL_AUTH_PIPELINE = ( 'social_core.pipeline.social_auth.social_details', 'social_core.pipeline.social_auth.social_uid', 'social_core.pipeline.social_auth.auth_allowed', 'social_core.pipeline.social_auth.social_user', 'web3.apps.auth.oauth.get_username', 'social_core.pipeline.social_auth.associate_by_email', 'social_core.pipeline.user.create_user', 'social_core.pipeline.social_auth.associate_user', 'social_core.pipeline.social_auth.load_extra_data', 'web3.apps.auth.oauth.create_user_group', 'web3.apps.auth.oauth.add_to_global_group' ) AUTHENTICATION_BACKENDS = ( 'web3.apps.auth.backends.PAMAuthenticationBackend', 'web3.apps.auth.oauth.IonOauth2', ) AUTH_USER_MODEL = "users.User" SOCIAL_AUTH_USER_FIELDS = ['username', 'full_name', 'email', 'id', 'is_superuser', 'is_staff'] SOCIAL_AUTH_URL_NAMESPACE = 'social' LOGIN_URL = '/login/' LOGIN_REDIRECT_URL = '/' LOGIN_ERROR_URL = '/login/' INTERNAL_IPS = ['127.0.0.1'] EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend" EMAIL_HOST = "mail.tjhsst.edu" EMAIL_PORT = 25 EMAIL_USE_TLS = False # FIXME: use tls EMAIL_SUBJECT_PREFIX = "[Director]" EMAIL_FROM = "director-noreply@tjhsst.edu" EMAIL_FEEDBACK = "director@tjhsst.edu" EMAIL_CONTACT = "director@tjhsst.edu"
27.099567
94
0.70607
758
6,260
5.662269
0.348285
0.045433
0.033551
0.040774
0.181267
0.149581
0.06384
0.06384
0.028658
0
0
0.016832
0.164856
6,260
230
95
27.217391
0.804132
0.238339
0
0.013986
1
0.006993
0.531785
0.405069
0
0
0
0.004348
0
1
0
false
0.06993
0.020979
0
0.020979
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
1
null
0
0
0
0
0
0
0
1
0
0
0
0
0
3
64586d11389e7cde5b3da86656bab0ca595bc703
179
py
Python
rockstarUse.py
druv777/TensorFlow-clone
70940acd8ef63455990522093c5642008e979415
[ "MIT" ]
null
null
null
rockstarUse.py
druv777/TensorFlow-clone
70940acd8ef63455990522093c5642008e979415
[ "MIT" ]
null
null
null
rockstarUse.py
druv777/TensorFlow-clone
70940acd8ef63455990522093c5642008e979415
[ "MIT" ]
null
null
null
from rockstar import RockStar swift_code = "print('Hello world')" rock_it_bro = RockStar(days=1900, file_name='hello.swift', code=swift_code) rock_it_bro.make_me_a_rockstar()
35.8
76
0.782123
29
179
4.482759
0.62069
0.207692
0.138462
0
0
0
0
0
0
0
0
0.024845
0.100559
179
5
77
35.8
0.782609
0
0
0
0
0
0.176136
0
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0.25
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
64614e9f6807adb4c793f96caabf995d3909e4b8
162
py
Python
idManager/model/integration/message_data.py
lgarciasbr/idm-api
3517d29d55eb2a06fb5b4b21359b6cf6d11529a0
[ "Apache-2.0" ]
2
2018-01-14T22:43:43.000Z
2018-01-14T22:43:48.000Z
idManager/model/integration/message_data.py
lgarciasbr/idm-api
3517d29d55eb2a06fb5b4b21359b6cf6d11529a0
[ "Apache-2.0" ]
null
null
null
idManager/model/integration/message_data.py
lgarciasbr/idm-api
3517d29d55eb2a06fb5b4b21359b6cf6d11529a0
[ "Apache-2.0" ]
null
null
null
from flask import current_app def send_log_message(text): try: log = current_app.extensions['sentry'].captureMessage(text) except: pass
18
67
0.679012
20
162
5.3
0.8
0.188679
0
0
0
0
0
0
0
0
0
0
0.234568
162
8
68
20.25
0.854839
0
0
0
0
0
0.037037
0
0
0
0
0
0
1
0.166667
false
0.166667
0.166667
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
3
6465246c84a3f23d3c843ed1a4eac86a1553e332
22
py
Python
filters/__init__.py
mouradmourafiq/data-analysis
1df2ca020a554f1fdab7cc9e53115e249cc199ac
[ "BSD-2-Clause" ]
17
2015-04-01T12:11:31.000Z
2022-03-15T16:44:01.000Z
filters/__init__.py
mouradmourafiq/data-analysis
1df2ca020a554f1fdab7cc9e53115e249cc199ac
[ "BSD-2-Clause" ]
null
null
null
filters/__init__.py
mouradmourafiq/data-analysis
1df2ca020a554f1fdab7cc9e53115e249cc199ac
[ "BSD-2-Clause" ]
17
2015-01-14T14:59:40.000Z
2021-07-01T05:46:14.000Z
__author__ = 'mourad'
11
21
0.727273
2
22
6
1
0
0
0
0
0
0
0
0
0
0
0
0.136364
22
1
22
22
0.631579
0
0
0
0
0
0.272727
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
6465fab1a57ae1dcc41f4c7c95793b6cf4866599
261
py
Python
example/mysite/polls/admin.py
jAlpedrinha/DeclRY
f6f1f18a0cc38d0b502945a6f8baec64c3b9a6fa
[ "BSD-3-Clause" ]
1
2015-08-12T12:02:54.000Z
2015-08-12T12:02:54.000Z
example/mysite/polls/admin.py
jAlpedrinha/DeclRY
f6f1f18a0cc38d0b502945a6f8baec64c3b9a6fa
[ "BSD-3-Clause" ]
null
null
null
example/mysite/polls/admin.py
jAlpedrinha/DeclRY
f6f1f18a0cc38d0b502945a6f8baec64c3b9a6fa
[ "BSD-3-Clause" ]
null
null
null
from declry import site from declry.apps import Application class FormacaoAdmin(Application): list_display = ('nome','modulo','local','data_inicio','data_fim','coordenador') list_filter = ('data_inicio',) search_fields = ('nome','modulo','local')
29
83
0.716475
31
261
5.83871
0.645161
0.110497
0.165746
0
0
0
0
0
0
0
0
0
0.126437
261
8
84
32.625
0.79386
0
0
0
0
0
0.272031
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
3
6479e45e219721aaae6c4905f1adba39680d17b1
2,094
py
Python
tilecloud/lib/sqlite3_.py
wendymhelson/tilecloud
70f54d24d05e4e350317b12defd56e4eebe1f2c1
[ "Unlicense" ]
null
null
null
tilecloud/lib/sqlite3_.py
wendymhelson/tilecloud
70f54d24d05e4e350317b12defd56e4eebe1f2c1
[ "Unlicense" ]
null
null
null
tilecloud/lib/sqlite3_.py
wendymhelson/tilecloud
70f54d24d05e4e350317b12defd56e4eebe1f2c1
[ "Unlicense" ]
null
null
null
from collections import MutableMapping as DictMixin def query(connection, *args): cursor = connection.cursor() cursor.execute(*args) return cursor class SQLiteDict(DictMixin): """A dict facade for an SQLite table""" def __init__(self, connection, commit=True, **kwargs): self.connection = connection self.commit = commit query(self.connection, self.CREATE_TABLE_SQL) if self.commit: self.connection.commit() self.update(kwargs) def __contains__(self, key): return query(self.connection, self.CONTAINS_SQL, self._packkey(key)).fetchone()[0] def __delitem__(self, key): query(self.connection, self.DELITEM_SQL, self._packkey(key)) if self.commit: self.connection.commit() def __getitem__(self, key): row = query(self.connection, self.GETITEM_SQL, self._packkey(key)).fetchone() if row is None: raise KeyError(key) return self._unpackvalue(row) def __iter__(self): return map(self._unpackkey, query(self.connection, self.ITER_SQL)) def __len__(self): return query(self.connection, self.LEN_SQL).fetchone()[0] def __setitem__(self, key, value): query(self.connection, self.SETITEM_SQL, self._packitem(key, value)) if self.commit: self.connection.commit() def iteritems(self): return map(self._unpackitem, query(self.connection, self.ITERITEMS_SQL)) def itervalues(self): return map(self._unpackvalue, query(self.connection, self.ITERVALUES_SQL)) def keys(self): return list(iter(self)) @staticmethod def _packitem(key, value): return (key, value) @staticmethod def _packkey(key): return (key,) @staticmethod def _packvalue(value): # pragma: no cover return (value,) @staticmethod def _unpackitem(row): # pragma: no cover return row @staticmethod def _unpackkey(row): return row[0] @staticmethod def _unpackvalue(row): return row[0]
26.846154
90
0.644222
243
2,094
5.337449
0.251029
0.151118
0.131843
0.159599
0.161912
0.078643
0.053971
0
0
0
0
0.002536
0.246896
2,094
77
91
27.194805
0.819911
0.032474
0
0.25
0
0
0
0
0
0
0
0
0
1
0.303571
false
0
0.017857
0.214286
0.589286
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
6493ad91016eb24320a1dda1bde3e1ebc624f532
324
py
Python
pypheus/__init__.py
xod442/pypheus
11988d7c0efe2772bca80c2d40a71cc8ba707153
[ "Apache-2.0" ]
null
null
null
pypheus/__init__.py
xod442/pypheus
11988d7c0efe2772bca80c2d40a71cc8ba707153
[ "Apache-2.0" ]
null
null
null
pypheus/__init__.py
xod442/pypheus
11988d7c0efe2772bca80c2d40a71cc8ba707153
[ "Apache-2.0" ]
null
null
null
""" Information ================== pypheus is a Python binding for Morpheus a prominent Cloud Management Platform. This application will abstract the the Morpheus API and allow users to make simple python requests. wookieware 2022 version 0.1.0 - init release """ from pypheus import (auth, network, storage, monitoring)
24.923077
99
0.743827
44
324
5.477273
0.863636
0
0
0
0
0
0
0
0
0
0
0.025455
0.151235
324
12
100
27
0.850909
0.796296
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
3
649a540a7b30e7793e5deda92e69dcaf44168a57
371
py
Python
app/src/subtitle/models.py
robertzm/VideoWebDemo
96e0e80b794c35ef77e92d1afce2e9bb498f0a2a
[ "Apache-2.0" ]
2
2020-12-09T23:34:58.000Z
2020-12-10T06:39:28.000Z
app/src/subtitle/models.py
robertzm/VideoWebDemo
96e0e80b794c35ef77e92d1afce2e9bb498f0a2a
[ "Apache-2.0" ]
2
2021-01-11T08:59:37.000Z
2021-01-11T09:00:06.000Z
app/src/subtitle/models.py
robertzm/VideoWebDemo
96e0e80b794c35ef77e92d1afce2e9bb498f0a2a
[ "Apache-2.0" ]
null
null
null
from app import db class SubtitlePath(db.Model): __tablename__ = "subtitle" id = db.Column(db.Integer, primary_key=True) uuid = db.Column(db.String(64), unique=True, nullable=True) lang = db.Column(db.String(32)) filepath = db.Column(db.String(128), nullable=False) def __repr__(self): return "<Subtitle path {}>".format(self.filepath)
28.538462
63
0.67655
51
371
4.745098
0.607843
0.132231
0.165289
0.198347
0
0
0
0
0
0
0
0.022951
0.177898
371
12
64
30.916667
0.770492
0
0
0
0
0
0.070081
0
0
0
0
0
0
1
0.111111
false
0
0.111111
0.111111
1
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
3
64a35f680e8ea36296637c6eb5830f1e36cb28a7
177
py
Python
fireCatcher.py
n1cfury/ViolentPython
c758de753bd56fe8b5c5b6db6f0f1b134023bf6f
[ "MIT" ]
null
null
null
fireCatcher.py
n1cfury/ViolentPython
c758de753bd56fe8b5c5b6db6f0f1b134023bf6f
[ "MIT" ]
null
null
null
fireCatcher.py
n1cfury/ViolentPython
c758de753bd56fe8b5c5b6db6f0f1b134023bf6f
[ "MIT" ]
null
null
null
def banner(): print "### Firesheep Detector p197-200 ###" print "" def fireCatcher(pkt): def main(): banner() fireCatcher(pkt): if __name__ == '__main__': main()
11.0625
48
0.615819
20
177
5.05
0.6
0.277228
0
0
0
0
0
0
0
0
0
0.042553
0.20339
177
16
49
11.0625
0.673759
0
0
0
0
0
0.267045
0
0
0
0
0
0
0
null
null
0
0
null
null
0.222222
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
1
0
0
0
0
0
0
0
0
3
64ac9a9800fc56bffbd8416996ff63c66a3c1e04
1,463
py
Python
PyOpenGL-3.0.2/OpenGL/raw/GL/ARB/occlusion_query.py
frederica07/Dragon_Programming_Process
c0dff2e20c1be6db5adc6f9977efae8f7f888ef5
[ "BSD-2-Clause" ]
null
null
null
PyOpenGL-3.0.2/OpenGL/raw/GL/ARB/occlusion_query.py
frederica07/Dragon_Programming_Process
c0dff2e20c1be6db5adc6f9977efae8f7f888ef5
[ "BSD-2-Clause" ]
null
null
null
PyOpenGL-3.0.2/OpenGL/raw/GL/ARB/occlusion_query.py
frederica07/Dragon_Programming_Process
c0dff2e20c1be6db5adc6f9977efae8f7f888ef5
[ "BSD-2-Clause" ]
null
null
null
'''Autogenerated by get_gl_extensions script, do not edit!''' from OpenGL import platform as _p, constants as _cs, arrays from OpenGL.GL import glget import ctypes EXTENSION_NAME = 'GL_ARB_occlusion_query' def _f( function ): return _p.createFunction( function,_p.GL,'GL_ARB_occlusion_query',False) _p.unpack_constants( """GL_QUERY_COUNTER_BITS_ARB 0x8864 GL_CURRENT_QUERY_ARB 0x8865 GL_QUERY_RESULT_ARB 0x8866 GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 GL_SAMPLES_PASSED_ARB 0x8914""", globals()) glget.addGLGetConstant( GL_QUERY_COUNTER_BITS_ARB, (1,) ) @_f @_p.types(None,_cs.GLsizei,arrays.GLuintArray) def glGenQueriesARB( n,ids ):pass @_f @_p.types(None,_cs.GLsizei,arrays.GLuintArray) def glDeleteQueriesARB( n,ids ):pass @_f @_p.types(_cs.GLboolean,_cs.GLuint) def glIsQueryARB( id ):pass @_f @_p.types(None,_cs.GLenum,_cs.GLuint) def glBeginQueryARB( target,id ):pass @_f @_p.types(None,_cs.GLenum) def glEndQueryARB( target ):pass @_f @_p.types(None,_cs.GLenum,_cs.GLenum,arrays.GLintArray) def glGetQueryivARB( target,pname,params ):pass @_f @_p.types(None,_cs.GLuint,_cs.GLenum,arrays.GLintArray) def glGetQueryObjectivARB( id,pname,params ):pass @_f @_p.types(None,_cs.GLuint,_cs.GLenum,arrays.GLuintArray) def glGetQueryObjectuivARB( id,pname,params ):pass def glInitOcclusionQueryARB(): '''Return boolean indicating whether this extension is available''' from OpenGL import extensions return extensions.hasGLExtension( EXTENSION_NAME )
33.25
76
0.796309
212
1,463
5.179245
0.363208
0.014572
0.051002
0.070128
0.324226
0.251366
0.230419
0.230419
0.160291
0.087432
0
0.019549
0.090909
1,463
43
77
34.023256
0.806015
0.079973
0
0.25641
1
0
0.147566
0.089139
0
0
0.022472
0
0
1
0.25641
false
0.230769
0.102564
0.025641
0.410256
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
3
64b306b8769d1a5395b2ff462d244969453f0281
39
py
Python
main/models/__init__.py
trandat9h/GotitFinalProject
c32b12ab7099ee7d389ba67816fde7d48b3014bc
[ "MIT" ]
1
2022-03-29T09:58:16.000Z
2022-03-29T09:58:16.000Z
main/models/__init__.py
trandat9h/GotitFinalProject
c32b12ab7099ee7d389ba67816fde7d48b3014bc
[ "MIT" ]
null
null
null
main/models/__init__.py
trandat9h/GotitFinalProject
c32b12ab7099ee7d389ba67816fde7d48b3014bc
[ "MIT" ]
null
null
null
__all__ = ["category", "item", "user"]
19.5
38
0.589744
4
39
4.75
1
0
0
0
0
0
0
0
0
0
0
0
0.128205
39
1
39
39
0.558824
0
0
0
0
0
0.410256
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
64b3729d10855edc071cb1c3176a8d1e927629f4
588
py
Python
tests/test_need_to_wrap.py
ffreemt/simple-proxy-pool
15cb083904e515ad909cc5fa30cb030e200f5787
[ "MIT" ]
2
2020-01-01T12:55:01.000Z
2020-02-25T03:59:12.000Z
tests/test_need_to_wrap.py
ffreemt/simple-proxy-pool
15cb083904e515ad909cc5fa30cb030e200f5787
[ "MIT" ]
null
null
null
tests/test_need_to_wrap.py
ffreemt/simple-proxy-pool
15cb083904e515ad909cc5fa30cb030e200f5787
[ "MIT" ]
1
2020-08-06T02:29:00.000Z
2020-08-06T02:29:00.000Z
''' test need_to_wrap >>> assert not need_to_wrap(['127.0.0.1:8889', '127.0.0.1']) >>> assert need_to_wrap(['127.0.0.1:8889', 'source']) ''' from simple_pp.need_to_wrap import need_to_wrap def test_trivial(): ''' trivial tests''' assert not need_to_wrap(['127.0.0.1:8889', '127.0.0.1']) # extract_ip_port (re.findall) converts to a list assert not need_to_wrap('127.0.0.1:8889') assert not need_to_wrap({}) # need to convert to (['127.0.0.1:8889', 'source'],) # before feeding to simple_pp assert need_to_wrap(['127.0.0.1:8889', 'source'])
24.5
64
0.636054
106
588
3.311321
0.273585
0.17094
0.25641
0.136752
0.564103
0.509972
0.464387
0.464387
0.464387
0.464387
0
0.148148
0.173469
588
23
65
25.565217
0.574074
0.481293
0
0
0
0
0.197232
0
0
0
0
0
0.666667
1
0.166667
true
0
0.166667
0
0.333333
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
1
0
0
0
0
0
0
3
64b6cb679b43df545569ed71a1c4d61297d2aef9
6,304
py
Python
CIM14/IEC61970/Generation/Production/__init__.py
MaximeBaudette/PyCIM
d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14
[ "MIT" ]
58
2015-04-22T10:41:03.000Z
2022-03-29T16:04:34.000Z
CIM14/IEC61970/Generation/Production/__init__.py
MaximeBaudette/PyCIM
d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14
[ "MIT" ]
12
2015-08-26T03:57:23.000Z
2020-12-11T20:14:42.000Z
CIM14/IEC61970/Generation/Production/__init__.py
MaximeBaudette/PyCIM
d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14
[ "MIT" ]
35
2015-01-10T12:21:03.000Z
2020-09-09T08:18:16.000Z
# Copyright (C) 2010-2011 Richard Lincoln # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. """The production package is responsible for classes which describe various kinds of generators. These classes also provide production costing information which is used to economically allocate demand among committed units and calculate reserve quantities. """ from CIM14.IEC61970.Generation.Production.LevelVsVolumeCurve import LevelVsVolumeCurve from CIM14.IEC61970.Generation.Production.FossilFuel import FossilFuel from CIM14.IEC61970.Generation.Production.SteamSendoutSchedule import SteamSendoutSchedule from CIM14.IEC61970.Generation.Production.EmissionCurve import EmissionCurve from CIM14.IEC61970.Generation.Production.CombinedCyclePlant import CombinedCyclePlant from CIM14.IEC61970.Generation.Production.StartIgnFuelCurve import StartIgnFuelCurve from CIM14.IEC61970.Generation.Production.HydroGeneratingEfficiencyCurve import HydroGeneratingEfficiencyCurve from CIM14.IEC61970.Generation.Production.StartRampCurve import StartRampCurve from CIM14.IEC61970.Generation.Production.GeneratingUnit import GeneratingUnit from CIM14.IEC61970.Generation.Production.NuclearGeneratingUnit import NuclearGeneratingUnit from CIM14.IEC61970.Generation.Production.WindGeneratingUnit import WindGeneratingUnit from CIM14.IEC61970.Generation.Production.StartMainFuelCurve import StartMainFuelCurve from CIM14.IEC61970.Generation.Production.StartupModel import StartupModel from CIM14.IEC61970.Generation.Production.AirCompressor import AirCompressor from CIM14.IEC61970.Generation.Production.HeatInputCurve import HeatInputCurve from CIM14.IEC61970.Generation.Production.CogenerationPlant import CogenerationPlant from CIM14.IEC61970.Generation.Production.ShutdownCurve import ShutdownCurve from CIM14.IEC61970.Generation.Production.InflowForecast import InflowForecast from CIM14.IEC61970.Generation.Production.HydroGeneratingUnit import HydroGeneratingUnit from CIM14.IEC61970.Generation.Production.TargetLevelSchedule import TargetLevelSchedule from CIM14.IEC61970.Generation.Production.EmissionAccount import EmissionAccount from CIM14.IEC61970.Generation.Production.GrossToNetActivePowerCurve import GrossToNetActivePowerCurve from CIM14.IEC61970.Generation.Production.HydroPumpOpSchedule import HydroPumpOpSchedule from CIM14.IEC61970.Generation.Production.Reservoir import Reservoir from CIM14.IEC61970.Generation.Production.CAESPlant import CAESPlant from CIM14.IEC61970.Generation.Production.GenUnitOpCostCurve import GenUnitOpCostCurve from CIM14.IEC61970.Generation.Production.PenstockLossCurve import PenstockLossCurve from CIM14.IEC61970.Generation.Production.HydroPump import HydroPump from CIM14.IEC61970.Generation.Production.GenUnitOpSchedule import GenUnitOpSchedule from CIM14.IEC61970.Generation.Production.FuelAllocationSchedule import FuelAllocationSchedule from CIM14.IEC61970.Generation.Production.HeatRateCurve import HeatRateCurve from CIM14.IEC61970.Generation.Production.IncrementalHeatRateCurve import IncrementalHeatRateCurve from CIM14.IEC61970.Generation.Production.ThermalGeneratingUnit import ThermalGeneratingUnit from CIM14.IEC61970.Generation.Production.TailbayLossCurve import TailbayLossCurve from CIM14.IEC61970.Generation.Production.HydroPowerPlant import HydroPowerPlant nsURI = "http://iec.ch/TC57/2009/CIM-schema-cim14#Production" nsPrefix = "cimProduction" class HydroPlantType(str): """The type of hydro power plant. Values are: runOfRiver, minorStorage, majorStorage, pumpedStorage """ pass class EmissionValueSource(str): """The source of the emission value. Values are: measured, calculated """ pass class GeneratorControlMode(str): """Unit control modes. Values are: setpoint, pulse """ pass class FuelType(str): """Type of fuel. Values are: lignite, coal, oil, gas """ pass class GeneratorControlSource(str): """The source of controls for a generating unit. Values are: unavailable, onAGC, plantControl, offAGC """ pass class HydroEnergyConversionKind(str): """Specifies the capability of the hydro generating unit to convert energy as a generator or pump. Values are: generator, pumpAndGenerator """ pass class SpillwayGateType(str): """Type of spillway gate. """ pass class SurgeTankCode(str): """Type (or absence) of surge tank that is associated with the hydro power plant. """ pass class EmissionType(str): """The type of emission Values are: chlorine, carbonDioxide, hydrogenSulfide, nitrogenOxide, sulfurDioxide, carbonDisulfide """ pass class GeneratorOperatingMode(str): """Operating mode for secondary generator control. Values are: fixed, EDC, manual, off, MRN, LFC, AGC, REG """ pass class PenstockType(str): """Type of hydro plant penstock. """ pass class Emission(float): """Quantity of emission per fuel heat content """ pass class HeatRate(float): """Heat generated, in energy pertime unit of elapsed time """ pass class Classification(int): """1..n, with 1 the most detailed, highest priority, etc. """ pass class CostPerHeatUnit(float): """Cost, in units of currency, per quantity of heat generated """ pass
43.178082
256
0.805996
714
6,304
7.116247
0.37395
0.061996
0.117103
0.185987
0.254871
0
0
0
0
0
0
0.047923
0.129442
6,304
145
257
43.475862
0.877915
0.383249
0
0.223881
0
0
0.017223
0
0
0
0
0
0
1
0
false
0.223881
0.522388
0
0.746269
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
1
0
0
0
0
3
64d2fdd94ccdefb499475d5010e12ef3310e43be
13,438
py
Python
debexpo/tests/test_gnupg.py
jadonk/debexpo
a022160492e40cd02bafc413a3cb009551fd6f8d
[ "MIT" ]
null
null
null
debexpo/tests/test_gnupg.py
jadonk/debexpo
a022160492e40cd02bafc413a3cb009551fd6f8d
[ "MIT" ]
null
null
null
debexpo/tests/test_gnupg.py
jadonk/debexpo
a022160492e40cd02bafc413a3cb009551fd6f8d
[ "MIT" ]
2
2017-01-20T23:08:40.000Z
2019-08-13T20:30:00.000Z
# -*- coding: utf-8 -*- # # utils.py — Debexpo utility functions # # This file is part of debexpo - https://alioth.debian.org/projects/debexpo/ # # Copyright © 2008 Serafeim Zanikolas <serzan@hellug.gr> # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (the "Software"), to deal in the Software without # restriction, including without limitation the rights to use, # copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the # Software is furnished to do so, subject to the following # conditions: # # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. """ Test cases for debexpo.lib.gnupg. """ __author__ = 'Serafeim Zanikolas, Clément Schreiner' __copyright__ = 'Copyright © 2008 Serafeim Zanikolas' __license__ = 'MIT' from unittest import TestCase import os import pylons.test from debexpo.lib.gnupg import GnuPG, GpgUserId clement_gpg_key = \ """-----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v2.0.19 (GNU/Linux) mQINBE6VVooBEADGVQo2fcwy5gsUvj2HZveR/RIR5imbuFaTSLyc/zxD3SwGXQCt oYlCdAP26yjHDWYT77GKSA+fp0LZfbnxntATww0jYaScOpSqaMMWImwQsiD2a+v/ oW4TkypO14harkZOCCUbMugVpXhwj0zJr+Mte3I9d0gh5Czjow4WmdDnPrCJ3/7L R7FKav8RSSn8gBFIVTzvV5vjRkIPj3UyRXyt7wXeAcnHg05LfQUKQ6Z3mDrFKCIx 521k9xI7Pnwj4FXJ+t82rKQ5KH7bJiUg3+3JhEus8R/agrA4P3Pi6m1zxWqqmsBs LvI0AWLyDO0R8AH9+3H/ZWh3vQgLHS2YHw4PePCo0E3F38ik7SviUDikyyXASXws h6IUBckY45zEW4iPvCYbUcL6GTrUdOygscqUYOXssHb/dbDivhcKUPo/9RuWaJrc pvUOI0br/qE1IZLi+LOOLGOL+AA4ixNjuyLXCeud7EQOC/B4ra392aoR8t8MLhf9 cEY6fjeIakcMZs8Opks/7phwNxUiPMHyqXQTEZ+37GapcEvnQnZEi1bRzWAZbPUg /ko4CexpEvKd9N52I/zhcrUpKEiTAz0Tw/3rAzrUEbyRz+hIC0mQVJIyqlRB/ehf AChv/6gopabaEnI5O2ulQw+5/cmZVhw7SW9s80NHGqihIbx1qrgOqJQdgQARAQAB tCNDbMOpbWVudCBTY2hyZWluZXIgPGNsZW1lbnRAbXV4Lm1lPokCOwQTAQIAJQIb AwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AFAk85NvICGQEACgkQXjng44Ej8nyh PA//bUrvjdZiF8V/dpXqYdg4tuCrIGYsWHCxcZ8iTV04cOrU9WBatOA7eZIfjCT/ b48N3BFDyzfJCsMzDsS1Joy64JXZ2RoQeAS0P2e94UwGxbN8VFCPpadfF4EezZYY OECaGX7JkX1R1+KowU5FoO4rYxgvHNua1AmnoZdLMq6CjntdjbArCtzSxZJ+ZK+B TgEz8ZubauVlhwWrQekeqwzlD350xjZOSxdqVoR/dBWn+db/bQScYBcDfx6fGTol aeGhH4rwDotGzzg3QGdx/tPQ4SJ4GacEAc0AdrJKa0EA0srCMNZmoLZDSkpOjxN5 eQrWOifmT75vV56CB0cW3JDpI6Cf/VLj7oeL8XUEJxjafkRVt/5fLYOb6hVsDUZ6 Q5JkClDeoD8H1ezHAt9EH7ytelRhEtv3i5gGsMlzxHg1Vb9fwQ2QlGGp6zxKn5xt tFBHCJyxe/+TU06Abbpl1PZ8qzHqr9ydy4cRMhnYJiSM554yZaaOGNOenprN006S N6piLw+/aIHNbKR4ovssDlPaL4U0nsfzPkobAyTD8iHJseo79NLjNH0KFzaxuudx 3Dq1JmOxJXQEGEZq2Rtu1FLmMHO1tVo2e5b1dihuqJdKOXGkZnXufgL8r2qGo4YU yL5qqY2N7/CsbmKjZE/QOxDcblki2qeWuqKvIaLnrju9ln+0NUNsw6ltZW50IFNj aHJlaW5lciA8Y2xlbWVudC5zY2hyZWluZXJAZXR1LnVuaXN0cmEuZnI+iQI4BBMB AgAiBQJOmy6eAhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRBeOeDjgSPy fP9gD/0degYKnU9WLQI8tA0b1ZIS1dZSCO+NqJb83vuLfg8lrdo0FTtjEyIGOSye jtV+HnTF7JhSZwlVMbcXkkS0CZbuSmdxmVYuLTdLGznDeqoRZvgSEvPkEO90+87u vIrILJMiDkCbHZmo/MK60WJ/9hsBc75i1Oz4uYOvGIWqeMTgDcPNh7QZUTlmGdJM C3IzP3mO/ZIYlbJSqXAdVM76w2BuwFA44VkdwaDHQWN6ueJshEWKsoOEc7jbcZ0H W63FVXKCsbFJc3pow/ouIWfzVEu1F00j8fC4w7S7ul0yUyp5iZpOBF2hm5b/97Iy 5OOjSWktA3QKcaHjfWzOeHZfo6BzikQXrTTWJuJwfuo+/fxbBHHt0ehtHF7UjYl9 hpvRJKfweZpR89nf76iwGMq0wQnyOqZYholWQRIpTEuLcY3C/vrxQtMQx/aX8qWU 1rdnaDq0VZT/dyv+PnbLIvG4QFADwVYTsazjByHIVdzg29gXFzxKeAMphca9pDWA +Q3e4qvmdsFNMhZ/N2BEhOxzmY7pg7u08u3N5XiJWUtDT/Iu01niQzeoHVU2B9ll ZmfrtcG8WThxH1bgUIKlbfYSyomT8gGjYbRSL1LagqNpOP3ahiQHCGDExLuzDUXx qX5J2yDkEbZFRwlS/pDNjycouqkqmL6sQPfF+vzzlprAhSUOgbQnQ2zDqW1lbnQg U2NocmVpbmVyIDxjbGVtdXhAY2xlbXV4LmluZm8+iQI4BBMBAgAiBQJOlVaKAhsD BgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRBeOeDjgSPyfBzhD/45GEXNg98Z KxtkUVLLB9YKUrDbr/eH2dPHiXYXBYzeahCHZ/vmFAGkAAmMPwPWkXNOVO95Mhzz paluv8FQ70VKZY3ErwfApBGuterVhFc2EO9JlBQ97fYNgX3serSdmM975jwF+lc4 +TFL7mUjVchxEW8pAAomhQSt2LdJgc0RxMUzp3g2JstUzqDBO5ucgTiAGgxDJdMO 3Tf9icL8a002V+73lOTdXa3rgsiAcb3rQzdi+eV48/oDZigNnRxyS1gWunFlTRkk VQKkOKlk6hQ4jYWlgrbumzao9qJR4K52em67Nbl7oRbIggg9tgI7XV7nlmKJg74M H1zAfPw0D/KrQlyJUAQ6Lf2tcZ32JUSXaGiLXOrmNlnH3GFb6FxwMXfSYuR7VzPu kOADx4NZIGh8hCzRFjGp0LR6Ku4CBHb8hsOC9IdPilhbmqjhRFp6mpWALGquJPbT 7OTkDlKDIXRp2EErXEEp2M8igVvhVEMjPVsNcqzY9OO10+CM1aH4JQ6Yhx+gKH8y 9ArrDBUdKb+zuRjiOII9OkDNPMXnJROFiPagdkUo5tBCkNSNDewG9IokcViL7ESe 2Kf1uViQL/NLsXoWT8cZ0uRk0AYwMYE+e/2Y+s3VV8H1XlbthCuk4g9Al40lWdo5 AbY1VCD5OYu1PsaoyCcmwSi5gR6payfVHLQlQ2zDqW1lbnQgU2NocmVpbmVyIDxj bGVtdXhAZ21haWwuY29tPokCOAQTAQIAIgUCT9TMYQIbAwYLCQgHAwIGFQgCCQoL BBYCAwECHgECF4AACgkQXjng44Ej8nx/Rg//RJes8i8mkBFYFcfB5YSexoroJyDS IyBKagvA5m0YefzKQGT39fq52od9EnWT6C30XQ5+SSbc9m9+5jAnVgsVwFH8CukN n7nsJbQ0Ket8G+JJP9gQZFl1YuNvZgGahZg5/A2SdfAN0PsLugLiWvyLRPD1E6Kx nv8nkHgjW1VeA5o9MVdFTIMcJRxyYWhqtU1uuCe0VTfFLasZVzLUrqQr22OOr++3 eWw1RShcwJToVYkUw9VKOj3gMHtjh7bf+fvizwfrXSQSvEKirwvm8mJ9NDV5q/Un OfWvgZxeHOKXT1Zr18BY1YaKmAIvyTJw+rMyb9DfxyY5m3FU/YWWysRS95pyNeR8 wX9OFqrOy1x7BAR2pplv11lAlz3KoEhKqb/EuNpvPm5Dvz4elg/9cmQsDfk6pK45 fGXQcWZE4pKsuOGwgfZ680E3lchZOg1th9T8t+qaIwBtcgGBNL5oaPZrjQu9Z+S9 luKZ4Fq+2yx+lQbcbB7Osd2mWyWDAIDhKi3Cl+D/D0q2EXIubIEiHPc0BMeLsQE7 3CADHvb2VvmiLo9yvQsv+sWS9eN15hR9Ct759n1Kq6gbvL5IWqV4dBP2oqvFSMew 20JlbeUDswctYiFjBcTvLUzkP681Nz4Cuh0aVmEBsMk2Bs8Ic1Vl9f0qiPS9FH/2 sEcEB6YOz1bbYVm5Ag0ETpVWigEQAKM5Om+Gze1gYFpuJs4MXSqPogh+gpfd7uX+ v+1c4I35agUwqrMTTqmwNirdZ4kq1ScodH95KgPJauQhhpSLG/vSUqDGmBfCR87Z 9dgZl9hs3zwP3dF/wwjZVq9huaRZbLB1i/jVSNlP6X72qY+jO2Sa46YLAQMBgsl4 qJX2EdIoLANVuqOSCfOD74VkTXWhhI639GZVqkoIY2wytpk5zMB31wVbDMoDgHpK 1LVR/5cjkeRQlIlp+p5iO+j97ArLzYR0VOgaZ4wDQ2AW19mMNbzHIS5FSJ9rMmke 8aTdCyNJsf7hmNyM39is5aQZv8NY2WY0pWHH9XXjHUQDdqGuw4aWNET8sqWQz6Fp kffty9Ggvtq1z4xD7pQ3xzzBB6l7o2ygKimcX2YvqaWNgiFsoJ0t+dBNlLwemYhw r0iQN5fA4PpEzhrVl3Xmb1sJEMzuj9LJGK1CQqPMGK1uK1CNsYows881mdsTvRVT pdLKxfDjJLOv3VgQdlwl2IOP1Gajs5NK+5GkrYZwXR9NsZAKWqcoRXux/qdEsRE2 kxfjuw929R5+qAe0sofjLePw4YQv/yg2N8opamLrMTQOIwvpSPHUapGLh+Oy+Pci kXblULMzz8rXLOHpKw4vpN6hReiQhrwNG5cmbjVj6r6Eu1MQBZ2l7q97hN9jCn3/ pOy/sCljABEBAAGJAh8EGAECAAkFAk6VVooCGwwACgkQXjng44Ej8nwfUxAAsNay K4abzfwLLRYT1uc/VWUL4/ccJ7cW4LXvA384/7BwqbYTO+CrSh612qhm3spvD9Nv wj6IuQTtPQIkPfsEQNgkajj8rMN+O/o+VPkJzWNa/HsuO/vmkX6y00V93FRtVeEZ dvmS+Haj1x19TR9Kbbqhbl/diTVZG5Iq8OrKLsbW+xcf8Xiz6MyrRCiIWyhLOUpQ qZ2gB1ZnYLVQmvAmO67fQskKW9KV540XJurgeI22xKhgI2bxyqv0t8QkDgIQhLDd dzuxt3Mxo+nkHHn9tu2YINJG0fWuJu8qzKGNO4wI0LNrxJia6TZa4sjDKkZ3ARCx nGHOjkcftWAHo53PvuFRs+4ngMLJzubK0HVVxw0fMibyxj4e2Ef61Nw6HGq8qbx9 rGEEdTwmtEpXR4ns8EJ+qg9+p0gfYos8ptRLbm3WsuLYt4M+ptupaE4HsxW0s428 z4VVO0CYblZygRJ1SqAH1YhrDhAen5iLF/TKYS97h9g9qDY9YLFSV3MoCqGKWxly IDvWmyZOvVYDVHKkFci/jlW5nE84pYYz3eTMYA81vKipqNwXTTqBBiXuwobbmUwb BX8mHtyoHs+4kUgji47G+LJEoqWr/7r66FavOJG6S95qKdmM483VI7Wj1QntWW6A VL17u/UK61KFOBNVOO+Jmx/cYVo75Bv1LBfIk8I= =Vbzv -----END PGP PUBLIC KEY BLOCK----- """ test_gpg_key = \ """-----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v2.0.9 (GNU/Linux) mQGiBEMnG4URBADovsaF04fRCsE1w5IHR0YHp2+Zd1Yjd4yo16B/J9nZ5Gj6Swih LaWhcjFL+crrP2tk6lKHXR+pYZ7pbm0jit4xAXDA2RQEvqVomps6vZVAQuZGVH57 7whF0SWrO/XJ7JH68Nk7/8gwz7ISVMlq12pzy+MTFT9216vpahI4h0rv7wCg6Y1K RVZUp9sSFZuxJ67+ivoMfUMD/iQD8v2BznLp1XEe0rqQ3LebkGp5uuRWCPWI632e wfI+XzNxXvqrQnn6aJ7nRsi65+bPEpz/qjKYsikSCwGMIWa6yTINutYO2ns7Ltez y41f73vEdNm+5k4OZ4XB+zTvxoOXrWpl7MWX3O5aulGrB/vnlOTDoqTv+xoNkv2I PwoPA/49Lr3Pm1R1rdoEBhsbnYCwBUWtUx4gEcHA45/7Gy0rmqVuCh/sqeWW4nn/ n8RfCzEDbgfxm8O5jduDkeGsem+AJJ96ERuBWiiVZ6f6rHZRwX3X5rtbGaFB0miY 48LXBwNvFBu6bcs1LSjjw1H8h5lbcJVaScl2mEn39AXmnHJKk7QlU2VyYWZlaW0g WmFuaWtvbGFzIDxzZXJ6YW5AaGVsbHVnLmdyPohhBBMRAgAhBgsJCAcDAgMVAgMD FgIBAh4BAheABQJIAJNBBQkMXkW8AAoJEO3CRWI1UwTk7XkAoLCRfv/kVFNq+X2Q 7E3M8cl8OAJcAKCUBbSr75DtKS9bo6Q0oeK4UkYu3YhbBBMRAgAbBgsJCAcDAgMV AgMDFgIBAh4BAheABQJHwhWtAAoJEO3CRWI1UwTkh6MAnibtG603HMtX/fzZfsW0 hlsVwfGxAKDHyLakJZMm6n6VaLtE96T1UzIDCIhhBBMRAgAhBQJDJxuFBQkFo5qA BgsJCAcDAgMVAgMDFgIBAh4BAheAAAoJEO3CRWI1UwTkjrwAn0+NVciUYdIhWFnj xgCHU8XAJHGwAKDa4PJgjBMUZixcfcikoCOX4lc5WohhBBMRAgAhBgsJCAcDAgMV AgMDFgIBAh4BAheABQJIAI9NBQkMXkHIAAoJEO3CRWI1UwTkJDUAoNX3eS0PRlIb ZJLLvTrlQxaCgp/3AKC9Uz7oAe4Blw4C55rBgdZs9/9Gg4hGBBARAgAGBQJIE4J5 AAoJEBVYlEWZ6B2g3yMAoLjneTTHkTD758PjswGiCbfASXmVAJ95tpgA6q5Xwtj5 sn6tcv403pNOSIhGBBARAgAGBQJIC88zAAoJELdRFAn8Fdvsvq4AoJtlGCZhhRAt V0w8/GY+tVYzY4SHAKDRGk6EzJZ4uVHypdXw/aVYD110R4hGBBARAgAGBQJIO/at AAoJEJYs2vc7xAgfW4oAnRyYl8uRtkA+njTJb0BFnkEVToYJAKCG3wte5Y68hkoa W4y0FEdywhObybkBDQRDJxuHEAQAjonzPvWecBu80Pte8+9J8FFoNc5THXFHhHU+ mqKNGk7bU4lCeVRM5tvMPJ/dV7+rmKgNF4MJ7MweQwQWpa0GKreB++EgijKUVtsR 95pskzJbIbwMAMnkZbMIXB/7H8VChjDH6bRtZxROpw80teQK3jE0Gw8H3Aa/ktOl nwgfqPMAAwUD/A4y0e7CgWlCrELidCtEp/Z5DMlUJC+weUOZyknJqy3Ng9KgSD4k 1HxmF46v8YtU/BcC83ijmZzJowa/P/72WDItC5EloPHhNnu/OQ19JPEvIJlPlkAM Y3Y26AsoHQBvZJes99XgGQYpm6N7nmJ9yoheAFIII91gVdipLAi//UuniEwEGBEC AAwFAkMnG4cFCQWjmoAACgkQ7cJFYjVTBOS3OwCg0XRWVkOp0Fn1htlXyQO1MdAs sS0An1yrKagH2JprS2yHBCLXdPcyAY6I =VNMB -----END PGP PUBLIC KEY BLOCK----- """ test_gpg_key_id = '1024D/355304E4' class TestGnuPGController(TestCase): def _get_gnupg(self, gpg_path='/usr/bin/gpg'): keyring_path = self._get_data_file('pubring_with_355304E4.gpg') gnupg = GnuPG(gpg_path, keyring_path) return gnupg def _get_data_file(self, name): gpg_data_dir = os.path.join(os.path.dirname(__file__), 'gpg') full_path = os.path.join(gpg_data_dir, name) assert os.path.exists(full_path) return full_path def testGnuPGfailure1(self): """ Test for debexpo.gpg_path being uninitialised. """ gnupg = self._get_gnupg(None) self.assertTrue(gnupg.is_unusable) def testGnuPGfailure2(self): """ Test for debexpo.gpg_path pointing to a non-existent file. """ gnupg = self._get_gnupg('/non/existent') self.assertTrue(gnupg.is_unusable) def testGnuPGfailure3(self): """ Test for debexpo.gpg_path pointing to a non-executable file. """ gnupg = self._get_gnupg('/etc/passwd') self.assertTrue(gnupg.is_unusable) def testParseKeyID(self): """ Test the extraction of key id from a given GPG key. """ gnupg = self._get_gnupg() self.assertFalse(gnupg.is_unusable) parsed_key_block = gnupg.parse_key_block(test_gpg_key) key_string = gnupg.key2string(parsed_key_block.key) self.assertEqual(key_string, test_gpg_key_id) def testStringToKey(self): gnupg = self._get_gnupg() expected_key = gnupg.parse_key_block(test_gpg_key).key key_string = gnupg.key2string(expected_key) key = gnupg.string2key(key_string) assert key == expected_key def testParseUserID(self): """ Test the extraction of user ids from a given GPG key. """ gnupg = self._get_gnupg() self.assertFalse(gnupg.is_unusable) parsed_key_block = gnupg.parse_key_block(test_gpg_key) (k, u) = parsed_key_block self.assertEqual(u, [GpgUserId('Serafeim Zanikolas', 'serzan@hellug.gr')]) def testParseInvalidKeyBlock(self): gnupg = self._get_gnupg() self.assertFalse(gnupg.is_unusable) invalid_block = self._get_data_file('invalid_key_block') kb = gnupg.parse_key_block(path=invalid_block) assert kb.key == None def testAddSignature(self): gnupg = self._get_gnupg() result = gnupg.add_signature(data=clement_gpg_key) print result.status gnupg.add_signature(data=test_gpg_key) self.assertTrue(result.success) def testObsoleteSignatureVerification(self): """ Verify the signature in the file debexpo/tests/gpg/signed_by_355304E4.gpg. Since the key the file was signed with is now obsolete, the signature should not be valid. """ gnupg = self._get_gnupg() self.assertFalse(gnupg.is_unusable) signed_file = self._get_data_file('signed_by_355304E4.gpg') verif = gnupg.verify_file(path=signed_file) self.assertFalse(verif.is_valid) def testGoodSignature(self): gnupg = self._get_gnupg() self.assertFalse(gnupg.is_unusable) signed_file_path = self._get_data_file('signed_by_8123F27C.gpg') pubring = self._get_data_file('pubring_with_8123F27C.gpg') verif = gnupg.verify_file(path=signed_file_path, pubring=pubring) self.assertTrue(verif.is_valid) assert verif.data == "Lorem Ipsum is simply dummy text of the printing" \ " and typesetting industry." def testInvalidSignature(self): """ Test that verify_sig() fails for an unsigned file. """ gnupg = self._get_gnupg() self.assertFalse(gnupg.is_unusable) verif = gnupg.verify_file(path='/etc/passwd') self.assertFalse(verif.is_valid) def testRemoveSignature(self): gnupg = self._get_gnupg() result = gnupg.remove_signature('355304E4') print result.status assert result.success
45.398649
81
0.828992
1,078
13,438
10.192022
0.498145
0.015564
0.013106
0.018567
0.126695
0.099663
0.07427
0.068445
0.0537
0.049422
0
0.09541
0.113186
13,438
295
82
45.552542
0.826299
0.093094
0
0.282353
0
0
0.096749
0.024848
0
1
0
0
0.235294
0
null
null
0.023529
0.047059
null
null
0.035294
0
0
1
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
1
0
0
0
1
0
0
0
0
0
0
0
0
3
64da5c521fe950343aab3131bdce93d575050b5a
478
py
Python
privacydates/mixins.py
EMPRI-DEVOPS/django-privacydates
609ccd312a2d682575f229a4825670cfc97cd1a3
[ "BSD-3-Clause" ]
null
null
null
privacydates/mixins.py
EMPRI-DEVOPS/django-privacydates
609ccd312a2d682575f229a4825670cfc97cd1a3
[ "BSD-3-Clause" ]
null
null
null
privacydates/mixins.py
EMPRI-DEVOPS/django-privacydates
609ccd312a2d682575f229a4825670cfc97cd1a3
[ "BSD-3-Clause" ]
null
null
null
class VanishingDateMixIn(): """The VanishingMixIn is used to register Signals for deletion events, so all registered VanishingDateTime will be deleted. Inherit it in every class/Model where VanishingDateTime is used. Otherwise the VanishingDateTime-Instances are not registered and therefore not deleted, when there "parent"-Class was deleted. """ # The class is supposed to be empty, # as its only use is to track its subclasses in apps.py
36.769231
68
0.740586
65
478
5.446154
0.692308
0.033898
0
0
0
0
0
0
0
0
0
0
0.211297
478
12
69
39.833333
0.938992
0.845188
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
1
0
0
3
b396228087c514f695b111b9c52c74d4e78ad950
186
py
Python
config.py
muni2explore/flask-api-starter-kit
96ebafa33537e00ddd1d7d6f72d97b4c53f03723
[ "MIT" ]
54
2020-08-10T10:00:03.000Z
2022-03-18T10:07:01.000Z
config.py
muni2explore/flask-api-starter-kit
96ebafa33537e00ddd1d7d6f72d97b4c53f03723
[ "MIT" ]
2
2022-02-07T14:31:34.000Z
2022-02-07T14:32:44.000Z
config.py
muni2explore/flask-api-starter-kit
96ebafa33537e00ddd1d7d6f72d97b4c53f03723
[ "MIT" ]
23
2020-07-15T08:58:06.000Z
2022-03-25T03:03:53.000Z
"""[General Configuration Params] """ from os import environ, path from dotenv import load_dotenv basedir = path.abspath(path.dirname(__file__)) load_dotenv(path.join(basedir, '.env'))
23.25
46
0.763441
25
186
5.44
0.64
0.147059
0
0
0
0
0
0
0
0
0
0
0.102151
186
7
47
26.571429
0.814371
0.16129
0
0
0
0
0.026846
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
b399ee56bb344df4e4713b0aa7fd7ec58e6b5b22
3,910
py
Python
app/base/models.py
aleksandrmalinoko/CP_HC_Sharp_object
8dde212db0a8fe6851050e153b05aac06c2ed4e1
[ "MIT" ]
null
null
null
app/base/models.py
aleksandrmalinoko/CP_HC_Sharp_object
8dde212db0a8fe6851050e153b05aac06c2ed4e1
[ "MIT" ]
null
null
null
app/base/models.py
aleksandrmalinoko/CP_HC_Sharp_object
8dde212db0a8fe6851050e153b05aac06c2ed4e1
[ "MIT" ]
null
null
null
from bcrypt import gensalt, hashpw from flask_login import UserMixin from sqlalchemy import Binary, Column, Integer, String, Float from app import db, login_manager class Pharmacy(db.Model): __table__name = 'Pharmacy' id = Column(Integer, primary_key=True) title = Column(String) dosage = Column(String) form = Column(String) signature = Column(String) def __init__(self, **kwargs): for property, value in kwargs.items(): # depending on whether value is an iterable or not, we must # unpack it's value (when **kwargs is request.form, some values # will be a 1-element list) if hasattr(value, '__iter__') and not isinstance(value, str): # the ,= unpack of a singleton fails PEP8 (travis flake8 test) value = value[0] if property == 'password': value = hashpw(value.encode('utf8'), gensalt()) setattr(self, property, value) def __repr__(self): return str(self.title) class Sugar(db.Model): __table__name = 'Sugar' id = Column(Integer, primary_key=True) current_time = Column(String) sugar = Column(Float) def __init__(self, **kwargs): for property, value in kwargs.items(): # depending on whether value is an iterable or not, we must # unpack it's value (when **kwargs is request.form, some values # will be a 1-element list) if hasattr(value, '__iter__') and not isinstance(value, str): # the ,= unpack of a singleton fails PEP8 (travis flake8 test) value = value[0] if property == 'password': value = hashpw(value.encode('utf8'), gensalt()) setattr(self, property, value) def __repr__(self): return str(self.sugar) class Patient(db.Model): __table__name = 'Patient' id = Column(Integer, primary_key=True) username = Column(String) birthday = Column(String) snails = Column(String) date_reception = Column(String) def __init__(self, **kwargs): for property, value in kwargs.items(): # depending on whether value is an iterable or not, we must # unpack it's value (when **kwargs is request.form, some values # will be a 1-element list) if hasattr(value, '__iter__') and not isinstance(value, str): # the ,= unpack of a singleton fails PEP8 (travis flake8 test) value = value[0] if property == 'password': value = hashpw(value.encode('utf8'), gensalt()) setattr(self, property, value) def __repr__(self): return str(self.snails) class User(db.Model, UserMixin): __tablename__ = 'User' id = Column(Integer, primary_key=True) username = Column(String, unique=True) email = Column(String, unique=True) password = Column(Binary) def __init__(self, **kwargs): for property, value in kwargs.items(): # depending on whether value is an iterable or not, we must # unpack it's value (when **kwargs is request.form, some values # will be a 1-element list) if hasattr(value, '__iter__') and not isinstance(value, str): # the ,= unpack of a singleton fails PEP8 (travis flake8 test) value = value[0] if property == 'password': value = hashpw(value.encode('utf8'), gensalt()) setattr(self, property, value) def __repr__(self): return str(self.username) @login_manager.user_loader def user_loader(id): return User.query.filter_by(id=id).first() @login_manager.request_loader def request_loader(request): username = request.form.get('username') user = User.query.filter_by(username=username).first() return user if user else None
34.910714
78
0.614834
484
3,910
4.801653
0.214876
0.056799
0.025818
0.037866
0.690189
0.690189
0.665232
0.665232
0.665232
0.623064
0
0.007143
0.283887
3,910
111
79
35.225225
0.822857
0.211509
0
0.493151
0
0
0.03653
0
0
0
0
0
0
1
0.136986
false
0.068493
0.054795
0.068493
0.616438
0
0
0
0
null
0
0
0
0
0
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
1
0
0
1
0
0
3
b3a798145cf76d04c4f488bfafc0e3156fde2d5d
190
py
Python
test7.py
DogukanKundum/Classification-tweets
097935a990277f46ba9b3bf5a8455e10727a069a
[ "MIT" ]
1
2021-12-10T19:16:51.000Z
2021-12-10T19:16:51.000Z
test7.py
DogukanKundum/Classification-tweets
097935a990277f46ba9b3bf5a8455e10727a069a
[ "MIT" ]
null
null
null
test7.py
DogukanKundum/Classification-tweets
097935a990277f46ba9b3bf5a8455e10727a069a
[ "MIT" ]
1
2020-12-05T12:31:00.000Z
2020-12-05T12:31:00.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- from textblob.classifiers import NaiveBayesClassifier with open('data/train.csv', 'r') as fp: cl = NaiveBayesClassifier(fp, format="json")
27.142857
53
0.7
25
190
5.32
0.92
0
0
0
0
0
0
0
0
0
0
0.006061
0.131579
190
6
54
31.666667
0.8
0.221053
0
0
0
0
0.130137
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
b3ba0fda33af2a7a5f1c8515ebec272724efa551
2,891
bzl
Python
tools/rules/twister2_core.bzl
FreddieSun/twister2
4c0a8ef7c86413cf190883cb7e1d9164467979e8
[ "Apache-2.0" ]
null
null
null
tools/rules/twister2_core.bzl
FreddieSun/twister2
4c0a8ef7c86413cf190883cb7e1d9164467979e8
[ "Apache-2.0" ]
null
null
null
tools/rules/twister2_core.bzl
FreddieSun/twister2
4c0a8ef7c86413cf190883cb7e1d9164467979e8
[ "Apache-2.0" ]
null
null
null
# Utility macros for Twister2 core files def twister2_core_files(): return twister2_core_conf_files() + twister2_core_lib_files() def twister2_core_conf_files(): return [ "//twister2/config/src/yaml:config-system-yaml", ] def twister2_core_lib_files(): return twister2_core_lib_resource_scheduler_files() + \ twister2_core_lib_task_scheduler_files() + \ twister2_core_lib_communication_files() def twister2_core_lib_resource_scheduler_files(): return [ "//twister2/resource-scheduler/src/java:resource-scheduler-java", ] def twister2_core_lib_task_scheduler_files(): return [ "//twister2/taskscheduler/src/java:taskscheduler-java", ] def twister2_core_lib_communication_files(): return [ "//twister2/comms/src/java:comms-java", "//twister2/proto:proto-jobmaster-java", ] def twister2_core_lib_connector_files(): return [ "//twister2/connectors/src/java:connector-java", "@org_xerial_snappy_snappy_java//jar", "@org_lz4_lz4_java//jar", "@org_slf4j_slf4j_api//jar", "@org_apache_kafka_kafka_clients//jar", ] def twister2_client_lib_master_files(): return [ "//twister2/connectors/src/java:master-java", ] def twister2_core_lib_data_files(): return [ "//twister2/data/src/main/java:data-java", "@org_apache_hadoop_hadoop_hdfs//jar", "@org_apache_hadoop_hadoop_common//jar", "@org_apache_hadoop_hadoop_annotations//jar", "@org_apache_hadoop_hadoop_auth//jar", "@org_apache_hadoop_hadoop_mapreduce_client_core//jar", "@com_google_code_findbugs_jsr305//jar", "@com_fasterxml_woodstox_woodstox_core//jar", "@org_codehaus_woodstox_stax2_api//jar", "@commons_io_commons_io//jar", "@commons_collections_commons_collections//jar", "@org_apache_commons_commons_lang3//jar", "@commons_configuration_commons_configuration//jar", "@log4j_log4j//jar", "@org_apache_htrace_htrace_core4//jar", "@org_apache_hadoop_hadoop_hdfs_client//jar", ] def twister2_core_lib_executor_files(): return [ "//twister2/executor/src/java:executor-java", ] def twister2_core_lib_data_lmdb_files(): return [ "//twister2/data/src/main/java:data-java", "@org_lmdbjava_lmdbjava//jar", "@org_lmdbjava_lmdbjava_native_linux_x86_64//jar", "@org_lmdbjava_lmdbjava_native_windows_x86_64//jar", "@org_lmdbjava_lmdbjava_native_osx_x86_64//jar", "@com_github_jnr_jnr_ffi//jar", "@com_github_jnr_jnr_constants//jar", "@com_github_jnr_jffi//jar", "//third_party:com_github_jnr_jffi_native", ] def twister2_harp_integration_files(): return [ "//third_party:harp_collective", "@it_unimi_dsi_fastutil//jar", ]
32.483146
73
0.690073
347
2,891
5.236311
0.244957
0.105669
0.099064
0.079252
0.402862
0.23115
0.085856
0.049532
0.049532
0.049532
0
0.022175
0.188862
2,891
88
74
32.852273
0.752665
0.013144
0
0.16
0
0
0.518765
0.512803
0
0
0
0
0
1
0.16
true
0
0
0.16
0.32
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
1
null
0
0
0
0
0
0
1
0
0
1
0
0
0
3
b3c5d34fe811208beb9d81269a32648ad7b7f5f4
125
py
Python
guest/runner.py
archerckk/PyTest
610dd89df8d70c096f4670ca11ed2f0ca3196ca5
[ "MIT" ]
null
null
null
guest/runner.py
archerckk/PyTest
610dd89df8d70c096f4670ca11ed2f0ca3196ca5
[ "MIT" ]
1
2020-01-19T01:19:57.000Z
2020-01-19T01:19:57.000Z
guest/runner.py
archerckk/PyTest
610dd89df8d70c096f4670ca11ed2f0ca3196ca5
[ "MIT" ]
null
null
null
import subprocess command='python ‪G:\Pycharm_Project\PyTest\guest\manage.py runserver' subprocess.Popen(command,shell=True)
31.25
69
0.832
18
125
5.777778
0.888889
0
0
0
0
0
0
0
0
0
0
0
0.048
125
4
70
31.25
0.865546
0
0
0
0
0
0.468254
0.333333
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
b3c8b9abb1acf23e964f85e4d58d9f98ef8202b4
330
py
Python
clusterManagement/MLClusterBase.py
micv-dev/DeepKubeGPUCluster
b1f674ea3c251a5287ee83d582b193248e04f9d6
[ "Apache-2.0" ]
2
2021-01-22T05:56:40.000Z
2021-07-03T17:50:49.000Z
clusterManagement/MLClusterBase.py
micv-dev/DeepKubeGPUCluster
b1f674ea3c251a5287ee83d582b193248e04f9d6
[ "Apache-2.0" ]
null
null
null
clusterManagement/MLClusterBase.py
micv-dev/DeepKubeGPUCluster
b1f674ea3c251a5287ee83d582b193248e04f9d6
[ "Apache-2.0" ]
null
null
null
class MLClusterBase(object): def __init__(self): pass def create_cluster(self, spec, cluster_management, namespace_name, volume_claim_name, **kwargs): pass def get_cluster_info(self,cluster_name,cluster_management,user_id): pass def delete_cluster(self,payload): pass
15.714286
100
0.675758
39
330
5.333333
0.564103
0.100962
0
0
0
0
0
0
0
0
0
0
0.245455
330
20
101
16.5
0.835341
0
0
0.444444
0
0
0
0
0
0
0
0
0
1
0.444444
false
0.444444
0
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
1
0
0
1
0
0
3
b3d4939cf2842d4fe41db98de6a4249b7479e181
310
py
Python
nally/port_scanner/scanning_strategies/syn_scanning_strategy.py
FreibergVlad/port-scanner
432dd9a07cb5118f3a0722fe4908434c76191b3b
[ "MIT" ]
null
null
null
nally/port_scanner/scanning_strategies/syn_scanning_strategy.py
FreibergVlad/port-scanner
432dd9a07cb5118f3a0722fe4908434c76191b3b
[ "MIT" ]
null
null
null
nally/port_scanner/scanning_strategies/syn_scanning_strategy.py
FreibergVlad/port-scanner
432dd9a07cb5118f3a0722fe4908434c76191b3b
[ "MIT" ]
null
null
null
from nally.port_scanner.scanning_strategies.scanning_strategy import ScanningStrategy class SynScanningStrategy(ScanningStrategy): def scan_port(self, host: str, port: int) -> bool: return False @staticmethod def get_strategy_name() -> str: return ScanningStrategy.SYN_STRATEGY
25.833333
85
0.751613
34
310
6.647059
0.705882
0
0
0
0
0
0
0
0
0
0
0
0.177419
310
11
86
28.181818
0.886275
0
0
0
0
0
0
0
0
0
0
0
0
1
0.285714
false
0
0.142857
0.285714
0.857143
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
b3da2e72ed59eb49c5853bcdb21f5237c0598cff
635
py
Python
hoodwatch/forms.py
kennedy-ben/My-Neighborhood
1f9df6e6d69a565c6fd545e8efd14c163e98abd7
[ "Unlicense" ]
1
2018-10-23T16:17:31.000Z
2018-10-23T16:17:31.000Z
hoodwatch/forms.py
kennedy-ben/My-Neighborhood
1f9df6e6d69a565c6fd545e8efd14c163e98abd7
[ "Unlicense" ]
5
2020-06-06T00:55:39.000Z
2021-09-08T01:46:30.000Z
hoodwatch/forms.py
kennedy-ben/My-Neighborhood
1f9df6e6d69a565c6fd545e8efd14c163e98abd7
[ "Unlicense" ]
3
2020-01-19T21:26:14.000Z
2020-11-04T08:37:38.000Z
from django import forms from .models import * class NewPostForm(forms.ModelForm): class Meta: model = Post exclude = ['user'] class UserForm(forms.ModelForm): class Meta: model = Profile fields = ('name','user_name','bio') class CreateHoodForm(forms.ModelForm): class Meta: model = Neighbourhood fields = ['name','location','occupants'] class ProfileForm(forms.ModelForm): class Meta: model = Profile fields = ['name','bio'] class BusinessForm(forms.ModelForm): class Meta: model = Business fields = ['name','hood','email']
19.84375
48
0.612598
65
635
5.969231
0.415385
0.180412
0.244845
0.296392
0.448454
0.231959
0.231959
0.231959
0
0
0
0
0.264567
635
31
49
20.483871
0.830835
0
0
0.318182
0
0
0.096063
0
0
0
0
0
0
1
0
false
0
0.090909
0
0.545455
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
3
b3e8e83d598e0044b9c4b657fe64a24013a98a83
83
py
Python
course_02_python_data_structures/week_1/strip.py
RicardoRodriguesCosta/python_for_everybody
59bf99061cae37a11ce0b4095610de26330e3193
[ "MIT" ]
null
null
null
course_02_python_data_structures/week_1/strip.py
RicardoRodriguesCosta/python_for_everybody
59bf99061cae37a11ce0b4095610de26330e3193
[ "MIT" ]
null
null
null
course_02_python_data_structures/week_1/strip.py
RicardoRodriguesCosta/python_for_everybody
59bf99061cae37a11ce0b4095610de26330e3193
[ "MIT" ]
null
null
null
text = "X-DSPAM-Confidence: 0.8475" print(float(text[text.find(" "):].strip()))
27.666667
43
0.626506
12
83
4.333333
0.833333
0
0
0
0
0
0
0
0
0
0
0.067568
0.108434
83
2
44
41.5
0.635135
0
0
0
0
0
0.361446
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
3
b3edaf56efd71001fda07b90b8f93a95f2eb34f0
325
py
Python
services/web/server/tests/unit/isolated/scicrunch/conftest.py
elisabettai/osparc-simcore
ad7b6e05111b50fe95e49306a992170490a7247f
[ "MIT" ]
null
null
null
services/web/server/tests/unit/isolated/scicrunch/conftest.py
elisabettai/osparc-simcore
ad7b6e05111b50fe95e49306a992170490a7247f
[ "MIT" ]
1
2021-11-29T13:38:09.000Z
2021-11-29T13:38:09.000Z
services/web/server/tests/unit/isolated/scicrunch/conftest.py
mrnicegyu11/osparc-simcore
b6fa6c245dbfbc18cc74a387111a52de9b05d1f4
[ "MIT" ]
null
null
null
# pylint: disable=redefined-outer-name # pylint: disable=unused-argument # pylint: disable=unused-variable import pytest from simcore_service_webserver.scicrunch.settings import SciCrunchSettings @pytest.fixture async def settings() -> SciCrunchSettings: return SciCrunchSettings(SCICRUNCH_API_KEY="fake-secret-key")
25
74
0.815385
37
325
7.054054
0.675676
0.149425
0.145594
0
0
0
0
0
0
0
0
0
0.095385
325
12
75
27.083333
0.887755
0.307692
0
0
0
0
0.067873
0
0
0
0
0
0
1
0
true
0
0.4
0
0.6
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
3
b60380395c1922c0bd45b30cccf4f2cff22d2c09
162
py
Python
PythonExercicios/ex027.py
VitorFRodrigues/Python-curso
af75ff4a7ca14bc7e67b4f3362af837d355b1746
[ "MIT" ]
null
null
null
PythonExercicios/ex027.py
VitorFRodrigues/Python-curso
af75ff4a7ca14bc7e67b4f3362af837d355b1746
[ "MIT" ]
null
null
null
PythonExercicios/ex027.py
VitorFRodrigues/Python-curso
af75ff4a7ca14bc7e67b4f3362af837d355b1746
[ "MIT" ]
null
null
null
nome = str(input('Digite seu nome completo: ')).strip() div_nome = nome.split() print('Primeiro = {}\nÚltimo = {}'.format(div_nome[0], div_nome[len(div_nome)-1]))
54
82
0.679012
25
162
4.24
0.64
0.264151
0
0
0
0
0
0
0
0
0
0.013605
0.092593
162
3
82
54
0.707483
0
0
0
0
0
0.319018
0
0
0
0
0
0
1
0
false
0
0
0
0
0.333333
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
374e12794e55f64210c0702578375d3bfa8fc2d6
311
py
Python
app/handlers/admin/find_assigned_group.py
jamestiotio/wthslack
4ada5e2354bfd9ffd46731abe35b65ef8a09d4f1
[ "MIT" ]
2
2020-07-10T21:06:53.000Z
2020-10-27T17:05:05.000Z
app/handlers/admin/find_assigned_group.py
wthdevelopers/wthslack
f6566e35b5455fcdfb12d9b33d65843b67aff17c
[ "MIT" ]
7
2020-02-09T12:08:00.000Z
2021-06-27T16:51:29.000Z
app/handlers/admin/find_assigned_group.py
jamestiotio/wthslack
4ada5e2354bfd9ffd46731abe35b65ef8a09d4f1
[ "MIT" ]
2
2020-02-07T15:35:24.000Z
2020-02-07T17:28:50.000Z
# coding: utf-8 # View a specific participant's assigned group details # Created by James Raphael Tiovalen (2021) import slack import ast import settings import config from slackers.hooks import commands conv_db = config.conv_handler @commands.on("viewgroupdeets") def viewgroupdeets(payload): return
16.368421
54
0.784566
42
311
5.761905
0.809524
0
0
0
0
0
0
0
0
0
0
0.018939
0.151125
311
18
55
17.277778
0.897727
0.344051
0
0
0
0
0.07
0
0
0
0
0
0
1
0.111111
false
0
0.555556
0.111111
0.777778
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
1
1
0
0
3
3763446b99da1e9825f4b04bb3b506f8b2412e46
1,918
py
Python
node_editor/dataframe_model_bak/datatable_content.py
lcopey/node_editor
04d56ae4c7f2149e46903d5dd2e46f3906ef69e6
[ "MIT" ]
1
2021-04-30T11:28:42.000Z
2021-04-30T11:28:42.000Z
node_editor/dataframe_model_bak/datatable_content.py
lcopey/node_editor
04d56ae4c7f2149e46903d5dd2e46f3906ef69e6
[ "MIT" ]
null
null
null
node_editor/dataframe_model_bak/datatable_content.py
lcopey/node_editor
04d56ae4c7f2149e46903d5dd2e46f3906ef69e6
[ "MIT" ]
null
null
null
import sys from PyQt5.QtWidgets import QVBoxLayout, QApplication, QMainWindow import pandas as pd from node_editor.node_content_widget import NodeContentWidget from .dataframe_view import DataframeView DEBUG = False class DataTableContent(NodeContentWidget): def __init__(self, node: 'Node', parent: 'QWidget' = None, editable=False, filterable=True): self.editable = editable self.filterable = filterable super().__init__(node, parent) def initUI(self): df = pd.DataFrame() # Define layout including the DataFrameView self.layout = QVBoxLayout() # self.layout.setContentsMargins(5, 5, 5, 5) self.setLayout(self.layout) self.view = DataframeView(dataframe=df, parent=self, editable=self.editable, filterable=self.filterable) self.layout.addWidget(self.view) self.view.setObjectName(self.node.content_label_objname) def print(self, *args): if DEBUG: print('>DataTableContent :', *args) def setDataFrame(self, dataframe: pd.DataFrame): self.view.setDataFrame(dataframe, ) # self.view.resizeColumnsToContents() def getDataFrame(self): return self.view.getDataFrame() def serialize(self): # must return a value otherwise crash on deserialize self.print('serialize') return 0 # # def deserialize(self, data: dict, hashmap: dict = {}, restore_id: bool = True): # res = super().deserialize(data, hashmap) # try: # value = data['value'] # self.edit.setText(value) # return True & res # except Exception as e: # dumpException(e) # return res class DataEditableTableContent(DataTableContent): # TODO Customize def __init__(self, node: 'Node', parent: 'QWidget' = None): super().__init__(node, parent, editable=True, filterable=True)
33.068966
112
0.656934
205
1,918
6.034146
0.385366
0.038804
0.017785
0.024252
0.058205
0.058205
0.058205
0.058205
0
0
0
0.004112
0.239312
1,918
57
113
33.649123
0.843729
0.248175
0
0
0
0
0.035063
0
0
0
0
0.017544
0
1
0.225806
false
0
0.16129
0.032258
0.516129
0.096774
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
1
0
0
0
0
1
0
0
3
37645efc570cfe79532495ffcd35874cf9a12e74
292
py
Python
2015/2.py
frodetb/aoc
2dad7c0d7342d97f4a3a2ad202afe302c3473368
[ "MIT" ]
null
null
null
2015/2.py
frodetb/aoc
2dad7c0d7342d97f4a3a2ad202afe302c3473368
[ "MIT" ]
null
null
null
2015/2.py
frodetb/aoc
2dad7c0d7342d97f4a3a2ad202afe302c3473368
[ "MIT" ]
null
null
null
instructions = [sorted([int(num) for num in line.split("x")]) for line in open("input_2", "r").readlines()] # Part 1 print("Part 1:", sum(3 * x * y + 2 * x * z + 2 * y * z for x, y, z in instructions)) # Part 1 print("Part 1:", sum(2 * x + 2 * y + x * y * z for x, y, z in instructions))
29.2
107
0.561644
58
292
2.810345
0.362069
0.122699
0.055215
0.171779
0.490798
0.490798
0.269939
0.269939
0
0
0
0.044643
0.232877
292
9
108
32.444444
0.683036
0.044521
0
0
0
0
0.083333
0
0
0
0
0
0
1
0
false
0
0
0
0
0.666667
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
3
37862852a9d332b6eed256faa5e15ad4b5cc2386
100
py
Python
setup.py
mulh8377/pybind11-skeleton
84e7a7b14475fc03025118aecdfbf0df27a6f86f
[ "MIT" ]
null
null
null
setup.py
mulh8377/pybind11-skeleton
84e7a7b14475fc03025118aecdfbf0df27a6f86f
[ "MIT" ]
null
null
null
setup.py
mulh8377/pybind11-skeleton
84e7a7b14475fc03025118aecdfbf0df27a6f86f
[ "MIT" ]
null
null
null
from setuptools import setup setup( name="example", version="0.1", author="mulh8377", )
14.285714
28
0.64
12
100
5.333333
0.916667
0
0
0
0
0
0
0
0
0
0
0.075949
0.21
100
7
29
14.285714
0.734177
0
0
0
0
0
0.178218
0
0
0
0
0
0
1
0
true
0
0.166667
0
0.166667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
3
3791a86fa50aa3b089136b2339b5891bf69c1ce0
13,959
py
Python
sdk/python/pulumi_okta/user_factor_question.py
pulumi/pulumi-okta
83f7617a85b3d05213901773fa4e6a151ab6076b
[ "ECL-2.0", "Apache-2.0" ]
5
2019-10-29T21:59:22.000Z
2021-11-08T12:00:24.000Z
sdk/python/pulumi_okta/user_factor_question.py
pulumi/pulumi-okta
83f7617a85b3d05213901773fa4e6a151ab6076b
[ "ECL-2.0", "Apache-2.0" ]
109
2020-01-06T10:28:09.000Z
2022-03-25T19:52:40.000Z
sdk/python/pulumi_okta/user_factor_question.py
pulumi/pulumi-okta
83f7617a85b3d05213901773fa4e6a151ab6076b
[ "ECL-2.0", "Apache-2.0" ]
2
2020-09-11T16:31:04.000Z
2020-11-24T12:23:17.000Z
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from . import _utilities __all__ = ['UserFactorQuestionArgs', 'UserFactorQuestion'] @pulumi.input_type class UserFactorQuestionArgs: def __init__(__self__, *, answer: pulumi.Input[str], key: pulumi.Input[str], user_id: pulumi.Input[str]): """ The set of arguments for constructing a UserFactorQuestion resource. :param pulumi.Input[str] answer: Security question answer. Note here that answer won't be set during the resource import. :param pulumi.Input[str] key: Security question unique key. :param pulumi.Input[str] user_id: ID of the user. Resource will be recreated when `user_id` changes. """ pulumi.set(__self__, "answer", answer) pulumi.set(__self__, "key", key) pulumi.set(__self__, "user_id", user_id) @property @pulumi.getter def answer(self) -> pulumi.Input[str]: """ Security question answer. Note here that answer won't be set during the resource import. """ return pulumi.get(self, "answer") @answer.setter def answer(self, value: pulumi.Input[str]): pulumi.set(self, "answer", value) @property @pulumi.getter def key(self) -> pulumi.Input[str]: """ Security question unique key. """ return pulumi.get(self, "key") @key.setter def key(self, value: pulumi.Input[str]): pulumi.set(self, "key", value) @property @pulumi.getter(name="userId") def user_id(self) -> pulumi.Input[str]: """ ID of the user. Resource will be recreated when `user_id` changes. """ return pulumi.get(self, "user_id") @user_id.setter def user_id(self, value: pulumi.Input[str]): pulumi.set(self, "user_id", value) @pulumi.input_type class _UserFactorQuestionState: def __init__(__self__, *, answer: Optional[pulumi.Input[str]] = None, key: Optional[pulumi.Input[str]] = None, status: Optional[pulumi.Input[str]] = None, text: Optional[pulumi.Input[str]] = None, user_id: Optional[pulumi.Input[str]] = None): """ Input properties used for looking up and filtering UserFactorQuestion resources. :param pulumi.Input[str] answer: Security question answer. Note here that answer won't be set during the resource import. :param pulumi.Input[str] key: Security question unique key. :param pulumi.Input[str] status: The status of the security question factor. :param pulumi.Input[str] text: Display text for security question. :param pulumi.Input[str] user_id: ID of the user. Resource will be recreated when `user_id` changes. """ if answer is not None: pulumi.set(__self__, "answer", answer) if key is not None: pulumi.set(__self__, "key", key) if status is not None: pulumi.set(__self__, "status", status) if text is not None: pulumi.set(__self__, "text", text) if user_id is not None: pulumi.set(__self__, "user_id", user_id) @property @pulumi.getter def answer(self) -> Optional[pulumi.Input[str]]: """ Security question answer. Note here that answer won't be set during the resource import. """ return pulumi.get(self, "answer") @answer.setter def answer(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "answer", value) @property @pulumi.getter def key(self) -> Optional[pulumi.Input[str]]: """ Security question unique key. """ return pulumi.get(self, "key") @key.setter def key(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "key", value) @property @pulumi.getter def status(self) -> Optional[pulumi.Input[str]]: """ The status of the security question factor. """ return pulumi.get(self, "status") @status.setter def status(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "status", value) @property @pulumi.getter def text(self) -> Optional[pulumi.Input[str]]: """ Display text for security question. """ return pulumi.get(self, "text") @text.setter def text(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "text", value) @property @pulumi.getter(name="userId") def user_id(self) -> Optional[pulumi.Input[str]]: """ ID of the user. Resource will be recreated when `user_id` changes. """ return pulumi.get(self, "user_id") @user_id.setter def user_id(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "user_id", value) class UserFactorQuestion(pulumi.CustomResource): @overload def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, answer: Optional[pulumi.Input[str]] = None, key: Optional[pulumi.Input[str]] = None, user_id: Optional[pulumi.Input[str]] = None, __props__=None): """ Creates security question factor for a user. This resource allows you to create and configure security question factor for a user. ## Example Usage ```python import pulumi import pulumi_okta as okta example_user = okta.user.User("exampleUser", first_name="John", last_name="Smith", login="john.smith@example.com", email="john.smith@example.com") example_user_security_questions = example_user.id.apply(lambda id: okta.get_user_security_questions(user_id=id)) example_factor = okta.factor.Factor("exampleFactor", provider_id="okta_question", active=True) example_user_factor_question = okta.UserFactorQuestion("exampleUserFactorQuestion", user_id=example_user.id, key=example_user_security_questions.questions[0].key, answer="meatball", opts=pulumi.ResourceOptions(depends_on=[example_factor])) ``` ## Import Security question factor for a user can be imported via the `user_id` and the `factor_id`. ```sh $ pulumi import okta:index/userFactorQuestion:UserFactorQuestion example <user id>/<question factor id> ``` :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] answer: Security question answer. Note here that answer won't be set during the resource import. :param pulumi.Input[str] key: Security question unique key. :param pulumi.Input[str] user_id: ID of the user. Resource will be recreated when `user_id` changes. """ ... @overload def __init__(__self__, resource_name: str, args: UserFactorQuestionArgs, opts: Optional[pulumi.ResourceOptions] = None): """ Creates security question factor for a user. This resource allows you to create and configure security question factor for a user. ## Example Usage ```python import pulumi import pulumi_okta as okta example_user = okta.user.User("exampleUser", first_name="John", last_name="Smith", login="john.smith@example.com", email="john.smith@example.com") example_user_security_questions = example_user.id.apply(lambda id: okta.get_user_security_questions(user_id=id)) example_factor = okta.factor.Factor("exampleFactor", provider_id="okta_question", active=True) example_user_factor_question = okta.UserFactorQuestion("exampleUserFactorQuestion", user_id=example_user.id, key=example_user_security_questions.questions[0].key, answer="meatball", opts=pulumi.ResourceOptions(depends_on=[example_factor])) ``` ## Import Security question factor for a user can be imported via the `user_id` and the `factor_id`. ```sh $ pulumi import okta:index/userFactorQuestion:UserFactorQuestion example <user id>/<question factor id> ``` :param str resource_name: The name of the resource. :param UserFactorQuestionArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. """ ... def __init__(__self__, resource_name: str, *args, **kwargs): resource_args, opts = _utilities.get_resource_args_opts(UserFactorQuestionArgs, pulumi.ResourceOptions, *args, **kwargs) if resource_args is not None: __self__._internal_init(resource_name, opts, **resource_args.__dict__) else: __self__._internal_init(resource_name, *args, **kwargs) def _internal_init(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, answer: Optional[pulumi.Input[str]] = None, key: Optional[pulumi.Input[str]] = None, user_id: Optional[pulumi.Input[str]] = None, __props__=None): if opts is None: opts = pulumi.ResourceOptions() if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = UserFactorQuestionArgs.__new__(UserFactorQuestionArgs) if answer is None and not opts.urn: raise TypeError("Missing required property 'answer'") __props__.__dict__["answer"] = answer if key is None and not opts.urn: raise TypeError("Missing required property 'key'") __props__.__dict__["key"] = key if user_id is None and not opts.urn: raise TypeError("Missing required property 'user_id'") __props__.__dict__["user_id"] = user_id __props__.__dict__["status"] = None __props__.__dict__["text"] = None super(UserFactorQuestion, __self__).__init__( 'okta:index/userFactorQuestion:UserFactorQuestion', resource_name, __props__, opts) @staticmethod def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None, answer: Optional[pulumi.Input[str]] = None, key: Optional[pulumi.Input[str]] = None, status: Optional[pulumi.Input[str]] = None, text: Optional[pulumi.Input[str]] = None, user_id: Optional[pulumi.Input[str]] = None) -> 'UserFactorQuestion': """ Get an existing UserFactorQuestion resource's state with the given name, id, and optional extra properties used to qualify the lookup. :param str resource_name: The unique name of the resulting resource. :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] answer: Security question answer. Note here that answer won't be set during the resource import. :param pulumi.Input[str] key: Security question unique key. :param pulumi.Input[str] status: The status of the security question factor. :param pulumi.Input[str] text: Display text for security question. :param pulumi.Input[str] user_id: ID of the user. Resource will be recreated when `user_id` changes. """ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = _UserFactorQuestionState.__new__(_UserFactorQuestionState) __props__.__dict__["answer"] = answer __props__.__dict__["key"] = key __props__.__dict__["status"] = status __props__.__dict__["text"] = text __props__.__dict__["user_id"] = user_id return UserFactorQuestion(resource_name, opts=opts, __props__=__props__) @property @pulumi.getter def answer(self) -> pulumi.Output[str]: """ Security question answer. Note here that answer won't be set during the resource import. """ return pulumi.get(self, "answer") @property @pulumi.getter def key(self) -> pulumi.Output[str]: """ Security question unique key. """ return pulumi.get(self, "key") @property @pulumi.getter def status(self) -> pulumi.Output[str]: """ The status of the security question factor. """ return pulumi.get(self, "status") @property @pulumi.getter def text(self) -> pulumi.Output[str]: """ Display text for security question. """ return pulumi.get(self, "text") @property @pulumi.getter(name="userId") def user_id(self) -> pulumi.Output[str]: """ ID of the user. Resource will be recreated when `user_id` changes. """ return pulumi.get(self, "user_id")
38.243836
134
0.624328
1,622
13,959
5.157213
0.107275
0.072325
0.088703
0.06838
0.757442
0.722295
0.691333
0.67101
0.664913
0.642439
0
0.000296
0.27373
13,959
364
135
38.348901
0.824818
0.376889
0
0.524862
1
0
0.076172
0.009115
0
0
0
0
0
1
0.154696
false
0.005525
0.027624
0
0.276243
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
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
379c7664f3196827528f606b799c51a4a8796797
450
py
Python
AuthenticationSystem/models/user.py
ljnath/RBAC
7a4c2b0b4fd2d533ffdbf92d8b2d00b1ff510cae
[ "MIT" ]
null
null
null
AuthenticationSystem/models/user.py
ljnath/RBAC
7a4c2b0b4fd2d533ffdbf92d8b2d00b1ff510cae
[ "MIT" ]
null
null
null
AuthenticationSystem/models/user.py
ljnath/RBAC
7a4c2b0b4fd2d533ffdbf92d8b2d00b1ff510cae
[ "MIT" ]
null
null
null
""" Base model class for User """ class UserModel(): def __init__(self, name:str, roles:list): """ Creates a user with given name and role :param name : name as string is the user name :param role : role as list of role """ self.__name = name self.__roles = roles @property def name(self): return self.__name @property def roles(self): return self.__roles
22.5
57
0.575556
58
450
4.258621
0.465517
0.097166
0.11336
0
0
0
0
0
0
0
0
0
0.335556
450
20
58
22.5
0.826087
0.324444
0
0.2
0
0
0
0
0
0
0
0
0
1
0.3
false
0
0
0.2
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
1
1
0
0
3
37a3c304b781c6585c4f8031de43d9bb105b23e7
306
py
Python
scp/validateLog.py
GAStudyGroup/VRP
54ec7ff3f0a4247d3effe609cf916fc235a08664
[ "MIT" ]
8
2018-11-28T15:13:26.000Z
2021-10-08T18:34:28.000Z
scp/validateLog.py
GAStudyGroup/VRP
54ec7ff3f0a4247d3effe609cf916fc235a08664
[ "MIT" ]
4
2018-03-28T19:26:27.000Z
2018-04-07T03:02:15.000Z
scp/validateLog.py
GAStudyGroup/VRP
54ec7ff3f0a4247d3effe609cf916fc235a08664
[ "MIT" ]
2
2019-12-12T09:36:48.000Z
2020-04-23T08:26:22.000Z
#!/usr/bin/env python import sys try: file = open("log.txt","r") except OSError: pass i=0 for line in file: i+=1 if line.find("CROSSOVER ")!=-1: array = line.split(" ") if (float(array[3]) < float(array[1])) and (float(array[3]) < float(array[2])): print(line)
20.4
87
0.54902
47
306
3.574468
0.659574
0.238095
0.130952
0.190476
0.25
0
0
0
0
0
0
0.030702
0.254902
306
15
88
20.4
0.70614
0.065359
0
0
0
0
0.066434
0
0
0
0
0
0
1
0
false
0.083333
0.083333
0
0.083333
0.083333
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
3
37b0b5325153d70a2933be3c3353f2d91d004e2d
194
py
Python
Exam/oppgave_3.py
Chillu1/PythonUiS
7169f0d625d6419a3e002b1e3285ca08fc99c020
[ "MIT" ]
null
null
null
Exam/oppgave_3.py
Chillu1/PythonUiS
7169f0d625d6419a3e002b1e3285ca08fc99c020
[ "MIT" ]
null
null
null
Exam/oppgave_3.py
Chillu1/PythonUiS
7169f0d625d6419a3e002b1e3285ca08fc99c020
[ "MIT" ]
1
2021-04-26T14:32:52.000Z
2021-04-26T14:32:52.000Z
def translate_date(date:str): split_date = date.split(".") modified_date = split_date[2]+"-"+split_date[1]+"-"+split_date[0] return modified_date print(translate_date("19.05.2021"))
32.333333
69
0.695876
29
194
4.37931
0.482759
0.283465
0
0
0
0
0
0
0
0
0
0.064327
0.118557
194
6
70
32.333333
0.678363
0
0
0
0
0
0.066667
0
0
0
0
0
0
1
0.2
false
0
0
0
0.4
0.2
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
805da18c2eba7f3fc55361ca302201ceacee9c53
2,927
py
Python
psx/_dump_/48/_dump_ida_/overlay_d/make_psx.py
maoa3/scalpel
2e7381b516cded28996d290438acc618d00b2aa7
[ "Unlicense" ]
15
2018-06-28T01:11:25.000Z
2021-09-27T15:57:18.000Z
psx/_dump_/48/_dump_ida_/overlay_d/make_psx.py
maoa3/scalpel
2e7381b516cded28996d290438acc618d00b2aa7
[ "Unlicense" ]
7
2018-06-29T04:08:23.000Z
2019-10-17T13:57:22.000Z
psx/_dump_/48/_dump_ida_/overlay_d/make_psx.py
maoa3/scalpel
2e7381b516cded28996d290438acc618d00b2aa7
[ "Unlicense" ]
7
2018-06-28T01:11:34.000Z
2020-05-23T09:21:48.000Z
set_name(0x80123B68, "EA_cd_seek", SN_NOWARN) set_name(0x80123B70, "MY_CdGetSector", SN_NOWARN) set_name(0x80123BA4, "init_cdstream", SN_NOWARN) set_name(0x80123BB4, "flush_cdstream", SN_NOWARN) set_name(0x80123BD8, "check_complete_frame", SN_NOWARN) set_name(0x80123C58, "reset_cdstream", SN_NOWARN) set_name(0x80123C80, "kill_stream_handlers", SN_NOWARN) set_name(0x80123CF0, "stream_cdready_handler", SN_NOWARN) set_name(0x80123ED0, "CD_stream_handler", SN_NOWARN) set_name(0x80123FC4, "install_stream_handlers", SN_NOWARN) set_name(0x80124034, "cdstream_service", SN_NOWARN) set_name(0x801240CC, "cdstream_get_chunk", SN_NOWARN) set_name(0x801241EC, "cdstream_is_last_chunk", SN_NOWARN) set_name(0x80124204, "cdstream_discard_chunk", SN_NOWARN) set_name(0x80124304, "close_cdstream", SN_NOWARN) set_name(0x80124398, "wait_cdstream", SN_NOWARN) set_name(0x80124450, "open_cdstream", SN_NOWARN) set_name(0x801245BC, "set_mdec_img_buffer", SN_NOWARN) set_name(0x801245F0, "start_mdec_decode", SN_NOWARN) set_name(0x80124774, "DCT_out_handler", SN_NOWARN) set_name(0x80124810, "init_mdec", SN_NOWARN) set_name(0x80124874, "init_mdec_buffer", SN_NOWARN) set_name(0x80124890, "split_poly_area", SN_NOWARN) set_name(0x80124C14, "rebuild_mdec_polys", SN_NOWARN) set_name(0x80124DE8, "clear_mdec_frame", SN_NOWARN) set_name(0x80124DF4, "draw_mdec_polys", SN_NOWARN) set_name(0x80125144, "invalidate_mdec_frame", SN_NOWARN) set_name(0x80125158, "is_frame_decoded", SN_NOWARN) set_name(0x80125164, "init_mdec_polys", SN_NOWARN) set_name(0x801255B4, "set_mdec_poly_bright", SN_NOWARN) set_name(0x8012561C, "init_mdec_stream", SN_NOWARN) set_name(0x8012566C, "init_mdec_audio", SN_NOWARN) set_name(0x80125724, "kill_mdec_audio", SN_NOWARN) set_name(0x80125754, "stop_mdec_audio", SN_NOWARN) set_name(0x80125778, "play_mdec_audio", SN_NOWARN) set_name(0x80125A14, "set_mdec_audio_volume", SN_NOWARN) set_name(0x80125AE0, "resync_audio", SN_NOWARN) set_name(0x80125B10, "stop_mdec_stream", SN_NOWARN) set_name(0x80125B5C, "dequeue_stream", SN_NOWARN) set_name(0x80125C48, "dequeue_animation", SN_NOWARN) set_name(0x80125DF8, "decode_mdec_stream", SN_NOWARN) set_name(0x80125FE4, "play_mdec_stream", SN_NOWARN) set_name(0x80126098, "clear_mdec_queue", SN_NOWARN) set_name(0x801260C4, "StrClearVRAM", SN_NOWARN) set_name(0x80126128, "PlayFMVOverLay", SN_NOWARN) set_name(0x80122104, "imgbuf", SN_NOWARN) set_name(0x80122158, "mdec_env", SN_NOWARN) set_name(0x80122258, "br", SN_NOWARN) set_name(0x80122898, "mdec_drmd", SN_NOWARN) set_name(0x801228C8, "tmdc_pol", SN_NOWARN) set_name(0x80122F08, "mdc_buf", SN_NOWARN) set_name(0x80122F18, "tmdc_pol_offs", SN_NOWARN) set_name(0x80123558, "temp_offs", SN_NOWARN) set_name(0x80123878, "mdc_idx", SN_NOWARN) set_name(0x801238A0, "mdec_queue", SN_NOWARN) set_name(0x801239E0, "mdec_drenv", SN_NOWARN) set_name(0x80123A60, "stream_buf", SN_NOWARN) set_name(0x80123AE4, "stream_bufh", SN_NOWARN)
49.610169
58
0.82166
438
2,927
5.020548
0.294521
0.184629
0.28513
0.388813
0.392451
0.191905
0
0
0
0
0
0.171086
0.059447
2,927
58
59
50.465517
0.627679
0
0
0
0
0
0.286642
0.044756
0
0
0.198155
0
0
1
0
true
0
0
0
0
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
3
80650e96ed810fec1ddeaacf215ceee808005014
952
py
Python
application.py
crawftv/python-portfolio
5264f4339428279e611539be67a53cc2c0135150
[ "BSD-3-Clause" ]
null
null
null
application.py
crawftv/python-portfolio
5264f4339428279e611539be67a53cc2c0135150
[ "BSD-3-Clause" ]
2
2020-03-24T17:07:58.000Z
2020-03-31T03:19:38.000Z
application.py
crawftv/python-portfolio
5264f4339428279e611539be67a53cc2c0135150
[ "BSD-3-Clause" ]
null
null
null
from flask import Flask, render_template from firestore_utilities import get_medium, db, get_github_events, get_projects application = Flask(__name__) @application.route("/") def root(): return render_template("root.html") @application.route("/blog") def blog(): blog_list = get_medium(db) return render_template("blog.html", blog_list=blog_list) @application.route("/github") def github(): labels, data, num_events = get_github_events(db) return render_template( "github.html", labels=labels, data=data, num_events=num_events ) @application.route("/projects") def projects(): projects = get_projects(db) return render_template("projects.html", projects=projects) @application.route("/twitter") def twitter(): return render_template("twitter.html") @application.route('/test') def test(): return render_template("root2.html") if __name__ == "__main__": application.run(host="0.0.0.0")
21.636364
79
0.719538
121
952
5.380165
0.272727
0.150538
0.184332
0.101382
0
0
0
0
0
0
0
0.00612
0.141807
952
43
80
22.139535
0.790698
0
0
0
0
0
0.119748
0
0
0
0
0
0
1
0.214286
false
0
0.071429
0.107143
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
1
0
0
0
1
0
0
0
3
807d3ab6f17cdae70028ea61e5d4a7c531be358c
529
py
Python
test/test_departures.py
leonardbinet/navitia-python
f3886793c84b541ed3d410a1732e12ac4b5e3dde
[ "MIT" ]
9
2017-01-10T14:40:31.000Z
2022-02-14T19:25:18.000Z
test/test_departures.py
leonardbinet/navitia-python
f3886793c84b541ed3d410a1732e12ac4b5e3dde
[ "MIT" ]
2
2016-12-15T15:05:58.000Z
2019-05-30T10:30:21.000Z
test/test_departures.py
leonardbinet/navitia-python
f3886793c84b541ed3d410a1732e12ac4b5e3dde
[ "MIT" ]
3
2017-10-06T10:45:38.000Z
2021-01-21T14:29:43.000Z
"""Tests for the object departures module.""" import responses # initialize package, and does not mix up names import test as _test import navitia_client import requests class DeparturesTest(_test.TestCase): def setUp(self): self.user = 'leo' self.core_url = "https://api.navitia.io/v1/" self.client = navitia_client.Client(self.user) self.coords = '2.333333;48.866667' def test_no_region_nor_coords(self): # Should raise error if no region nor coords specified pass
24.045455
62
0.689981
73
529
4.876712
0.671233
0.073034
0.061798
0.095506
0
0
0
0
0
0
0
0.038741
0.219282
529
21
63
25.190476
0.823245
0.26276
0
0
0
0
0.123037
0
0
0
0
0
0
1
0.166667
false
0.083333
0.333333
0
0.583333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
1
0
1
0
0
3
8085b1f5f46541c577be405f9307b4ff5a65fd68
8,396
py
Python
tests/unit_tests/test_syntheticdataset2_shapes.py
liyu711/SUAS
2f6592fc2ab316475eeabe2f4828e5ba5c1a4b0b
[ "MIT" ]
null
null
null
tests/unit_tests/test_syntheticdataset2_shapes.py
liyu711/SUAS
2f6592fc2ab316475eeabe2f4828e5ba5c1a4b0b
[ "MIT" ]
null
null
null
tests/unit_tests/test_syntheticdataset2_shapes.py
liyu711/SUAS
2f6592fc2ab316475eeabe2f4828e5ba5c1a4b0b
[ "MIT" ]
null
null
null
from SyntheticDataset2.ElementsCreator import * import unittest from PIL import Image class UpdatedSyntheticDatasetShapesTestCase(unittest.TestCase): def test_rectangle(self): width = 100 height = 50 color = (255,0,0) rotation = 45 midpoint = (250,250) test_background = Image.new('RGBA', (500,500), color=(0,0,255)) test_rectangle = Rectangle(width, height, color, rotation) self.assertEqual(test_rectangle.draw().getpixel((50,25)), (255,0,0,255)) self.assertEqual(test_rectangle.draw().getpixel((80,40)), (255,0,0,255)) test_rectangle.overlay(midpoint, test_background) self.assertEqual(test_background.getpixel(midpoint), (255,0,0,255)) self.assertEqual(test_background.getpixel((265,210)), (255,0,0,255)) def test_triangle(self): base = 100 height = 100 color = (255,0,0) rotation = 45 midpoint = (250,250) test_background = Image.new('RGBA', (500,500), color=(0,0,255)) test_triangle = Triangle(base,height,color,rotation) self.assertEqual(test_triangle.draw().getpixel((100,100)), (255,0,0,255)) self.assertEqual(test_triangle.draw().getpixel((75,130)), (255,0,0,255)) test_triangle.overlay(midpoint, test_background) self.assertEqual(test_background.getpixel(midpoint), (255,0,0,255)) self.assertEqual(test_background.getpixel((250,250)), (255,0,0,255)) def test_circle(self): radius = 100 color = (255,0,0) midpoint = (250,250) test_background = Image.new('RGBA', (500,500), color=(0,0,255)) test_circle = Circle(radius,color) self.assertEqual(test_circle.draw().getpixel((50,25)), (255,0,0,255)) self.assertEqual(test_circle.draw().getpixel((60,50)), (255,0,0,255)) test_circle.overlay(midpoint, test_background) self.assertEqual(test_background.getpixel(midpoint), (255,0,0,255)) self.assertEqual(test_background.getpixel((260,160)), (255,0,0,255)) def test_half_circle(self): radius = 100 color = (255,0,0) rotation = 45 midpoint = (250,250) test_background = Image.new('RGBA', (500,500), color=(0,0,255)) test_half_cirlce = HalfCircle(radius,color,rotation) self.assertEqual(test_half_cirlce.draw().getpixel((100,100)), (255,0,0,255)) self.assertEqual(test_half_cirlce.draw().getpixel((75,200)), (255,0,0,255)) test_half_cirlce.overlay(midpoint, test_background) self.assertEqual(test_background.getpixel(midpoint), (255,0,0,255)) self.assertEqual(test_background.getpixel((215,340)), (255,0,0,255)) def test_square(self): base = 100 color = (255,0,0) rotation = 45 midpoint = (250,250) test_background = Image.new('RGBA', (500,500), color=(0,0,255)) test_square = Square(base,color,rotation) self.assertEqual(test_square.draw().getpixel((50,25)), (255,0,0,255)) self.assertEqual(test_square.draw().getpixel((20,70)), (255,0,0,255)) test_square.overlay(midpoint, test_background) self.assertEqual(test_background.getpixel(midpoint), (255,0,0,255)) self.assertEqual(test_background.getpixel((250,195)), (255,0,0,255)) def test_trapezoid(self): base1 = 75 base2 = 100 height = 100 color = (255,0,0) rotation = 45 midpoint = (250,250) test_background = Image.new('RGBA', (500,500), color=(0,0,255)) test_trapezoid = Trapezoid(base1,base2,height,color,rotation) self.assertEqual(test_trapezoid.draw().getpixel((50,25)), (255,0,0,255)) self.assertEqual(test_trapezoid.draw().getpixel((70,30)), (255,0,0,255)) test_trapezoid.overlay(midpoint, test_background) self.assertEqual(test_background.getpixel(midpoint), (255,0,0,255)) self.assertEqual(test_background.getpixel((300,250)), (255,0,0,255)) def test_quarter_circle(self): radius = 100 color = (255,0,0) rotation = 45 midpoint = (250,250) test_background = Image.new('RGBA', (500,500), color=(0,0,255)) test_quarter_circle = QuarterCircle(radius,color,rotation) self.assertEqual(test_quarter_circle.draw().getpixel((100,100)), (255,0,0,255)) self.assertEqual(test_quarter_circle.draw().getpixel((70,20)), (255,0,0,255)) test_quarter_circle.overlay(midpoint, test_background) self.assertEqual(test_background.getpixel(midpoint), (255,0,0,255)) self.assertEqual(test_background.getpixel((250,300)), (255,0,0,255)) def test_cross(self): height = 100 color = (255,0,0) rotation = 45 midpoint = (250,250) test_background = Image.new('RGBA', (500,500), color=(0,0,255)) test_cross = Cross(height,color,rotation) self.assertEqual(test_cross.draw().getpixel((100,100)), (255,0,0,255)) self.assertEqual(test_cross.draw().getpixel((45,40)), (255,0,0,255)) test_cross.overlay(midpoint, test_background) self.assertEqual(test_background.getpixel(midpoint), (255,0,0,255)) self.assertEqual(test_background.getpixel((225,285)), (255,0,0,255)) def test_pentagon(self): radius = 100 color = (255,0,0) rotation = 45 midpoint = (250,250) test_background = Image.new('RGBA', (500,500), color=(0,0,255)) test_pentagon = Pentagon(radius,color,rotation) self.assertEqual(test_pentagon.draw().getpixel((150,150)), (255,0,0,255)) self.assertEqual(test_pentagon.draw().getpixel((125,60)), (255,0,0,255)) test_pentagon.overlay(midpoint, test_background) self.assertEqual(test_background.getpixel(midpoint), (255,0,0,255)) self.assertEqual(test_background.getpixel((210,330)), (255,0,0,255)) def test_star(self): radius = 100 color = (255,0,0) rotation = 45 midpoint = (250,250) test_background = Image.new('RGBA', (500,500), color=(0,0,255)) test_star = Star(radius,color,rotation) self.assertEqual(test_star.draw().getpixel((150,150)), (255,0,0,255)) self.assertEqual(test_star.draw().getpixel((170,100)), (255,0,0,255)) test_star.overlay(midpoint, test_background) self.assertEqual(test_background.getpixel(midpoint), (255,0,0,255)) self.assertEqual(test_background.getpixel((230,200)), (255,0,0,255)) def test_hexagon(self): radius = 100 color = (255,0,0) rotation = 45 midpoint = (250,250) test_background = Image.new('RGBA', (500,500), color=(0,0,255)) test_hexagon = Hexagon(radius,color,rotation) self.assertEqual(test_hexagon.draw().getpixel((150,150)), (255,0,0,255)) self.assertEqual(test_hexagon.draw().getpixel((90,100)), (255,0,0,255)) test_hexagon.overlay(midpoint, test_background) self.assertEqual(test_background.getpixel(midpoint), (255,0,0,255)) self.assertEqual(test_background.getpixel((260,200)), (255,0,0,255)) def test_heptagon(self): radius = 100 color = (255,0,0) rotation = 45 midpoint = (250,250) test_background = Image.new('RGBA', (500,500), color=(0,0,255)) test_heptagon = Heptagon(radius,color,rotation) self.assertEqual(test_heptagon.draw().getpixel((150,150)), (255,0,0,255)) self.assertEqual(test_heptagon.draw().getpixel((70,150)), (255,0,0,255)) test_heptagon.overlay(midpoint, test_background) self.assertEqual(test_background.getpixel(midpoint), (255,0,0,255)) self.assertEqual(test_background.getpixel((235,185)), (255,0,0,255)) def test_octagon(self): radius = 100 color = (255,0,0) rotation = 45 midpoint = (250,250) test_background = Image.new('RGBA', (500,500), color=(0,0,255)) test_octagon = Octagon(radius,color,rotation) self.assertEqual(test_octagon.draw().getpixel((150,150)), (255,0,0,255)) self.assertEqual(test_octagon.draw().getpixel((100,170)), (255,0,0,255)) test_octagon.overlay(midpoint, test_background) self.assertEqual(test_background.getpixel(midpoint), (255,0,0,255)) self.assertEqual(test_background.getpixel((240,200)), (255,0,0,255))
41.156863
87
0.638161
1,112
8,396
4.704137
0.072842
0.029822
0.06213
0.079526
0.903651
0.852418
0.67272
0.63831
0.632766
0.632766
0
0.1477
0.202477
8,396
203
88
41.359606
0.633513
0
0
0.472393
0
0
0.006193
0
0
0
0
0
0.319018
1
0.079755
false
0
0.018405
0
0.104294
0
0
0
0
null
0
0
0
1
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
8097ac4f2c3ab576de8d5aa4f37130c113315bd2
1,060
py
Python
scripts/dhp19/generate_DHP19/Python_Files/BackgroundFilter.py
preshmalinetpereira/lifting_events_to_3d_hpe
2d7b196dc6ab85e10ae07466657304f324a64a37
[ "Apache-2.0" ]
null
null
null
scripts/dhp19/generate_DHP19/Python_Files/BackgroundFilter.py
preshmalinetpereira/lifting_events_to_3d_hpe
2d7b196dc6ab85e10ae07466657304f324a64a37
[ "Apache-2.0" ]
null
null
null
scripts/dhp19/generate_DHP19/Python_Files/BackgroundFilter.py
preshmalinetpereira/lifting_events_to_3d_hpe
2d7b196dc6ab85e10ae07466657304f324a64a37
[ "Apache-2.0" ]
null
null
null
### File created by preshma import numpy as np import math def BackgroundFilter(x,y,t,pol,cam,xdim,ydim,dt): lastTimesMap=np.zeros((xdim,ydim)) index=np.zeros((len(t),1)) for i in range(len(t)): ts=t[i] xs=x[i]-1 #to compensate for matlab indexing starting from 1 ys=y[i]-1 deltaT=ts-lastTimesMap[xs,ys] if deltaT>dt: index[i]=math.nan if not (xs==0 or xs==xdim-1 or ys==0 or ys==ydim-1): lastTimesMap[xs-1, ys] = ts lastTimesMap[xs+1, ys] = ts lastTimesMap[xs, ys-1] = ts lastTimesMap[xs, ys+1] = ts lastTimesMap[xs-1, ys-1] = ts lastTimesMap[xs+1, ys+1] = ts lastTimesMap[xs-1, ys+1] = ts lastTimesMap[xs+1, ys-1] = ts x=x[np.transpose(~(np.isnan(index)))[0]] y=y[np.transpose(~(np.isnan(index)))[0]] t=t[np.transpose(~(np.isnan(index)))[0]] pol=pol[np.transpose(~(np.isnan(index)))[0]] cam=cam[np.transpose(~(np.isnan(index)))[0]] return x,y,t,pol,cam
32.121212
68
0.551887
173
1,060
3.381503
0.265896
0.215385
0.218803
0.174359
0.502564
0.471795
0.266667
0.205128
0.145299
0.145299
0
0.032342
0.270755
1,060
33
69
32.121212
0.72445
0.067925
0
0
0
0
0
0
0
0
0
0
0
1
0.037037
false
0
0.074074
0
0.148148
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
809fc3dd1ab1b80d5c8a28d77f62a444addf0bea
270
py
Python
python/utils/RunnerTypes.py
coreyjadams/harvard_production
233f20ef62ca34375f09417f4a507aa977c53a2a
[ "MIT" ]
null
null
null
python/utils/RunnerTypes.py
coreyjadams/harvard_production
233f20ef62ca34375f09417f4a507aa977c53a2a
[ "MIT" ]
null
null
null
python/utils/RunnerTypes.py
coreyjadams/harvard_production
233f20ef62ca34375f09417f4a507aa977c53a2a
[ "MIT" ]
1
2018-10-15T16:44:55.000Z
2018-10-15T16:44:55.000Z
from GalleryRunner import GalleryRunner from LarsoftRunner import LarsoftRunner class RunnerTypes(dict): def __init__(self, **kwargs): super(RunnerTypes, self).__init__(kwargs) self['larsoft'] = LarsoftRunner self['gallery'] = GalleryRunner
30
49
0.722222
26
270
7.192308
0.538462
0
0
0
0
0
0
0
0
0
0
0
0.185185
270
9
50
30
0.85
0
0
0
0
0
0.051661
0
0
0
0
0
0
1
0.142857
false
0
0.285714
0
0.571429
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
3
80b391e2678d590743874f2eed1fba1b2919164c
375
py
Python
pyAitu/models/media/image.py
waihislam/pyAitu
6e7c3bfa7454d6ae91ba998017cf772bb6a25770
[ "Apache-2.0" ]
11
2019-09-26T05:09:20.000Z
2021-05-20T10:45:28.000Z
pyAitu/models/media/image.py
waihislam/pyAitu
6e7c3bfa7454d6ae91ba998017cf772bb6a25770
[ "Apache-2.0" ]
8
2019-10-08T13:41:09.000Z
2020-06-25T11:35:56.000Z
pyAitu/models/media/image.py
waihislam/pyAitu
6e7c3bfa7454d6ae91ba998017cf772bb6a25770
[ "Apache-2.0" ]
4
2020-02-18T09:02:37.000Z
2020-11-25T06:11:05.000Z
class Image: def __init__(self, json_object): self.type = json_object.get("type") self.fileId = json_object.get("fileId") self.mimeType = json_object.get("mimeType") self.name = json_object.get("name") self.size = json_object.get("size") self.width = json_object.get("width") self.height = json_object.get("height")
41.666667
51
0.629333
49
375
4.571429
0.306122
0.357143
0.40625
0
0
0
0
0
0
0
0
0
0.226667
375
9
52
41.666667
0.772414
0
0
0
0
0
0.098404
0
0
0
0
0
0
1
0.111111
false
0
0
0
0.222222
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3