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
a04fac865dfcbbd962e5b717dc2e9bcf370f552a
24
py
Python
search_zone_number/__init__.py
MIERUNE/search_zone_number
fd25e99a85e8f6688c6b21a19f97a46657c2fdc6
[ "MIT" ]
3
2021-04-14T01:22:26.000Z
2022-02-14T01:32:58.000Z
search_zone_number/__init__.py
MIERUNE/search_zone_number
fd25e99a85e8f6688c6b21a19f97a46657c2fdc6
[ "MIT" ]
null
null
null
search_zone_number/__init__.py
MIERUNE/search_zone_number
fd25e99a85e8f6688c6b21a19f97a46657c2fdc6
[ "MIT" ]
1
2021-04-14T01:14:28.000Z
2021-04-14T01:14:28.000Z
from .lib import CityGdf
24
24
0.833333
4
24
5
1
0
0
0
0
0
0
0
0
0
0
0
0.125
24
1
24
24
0.952381
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
a07762445d6ed6c3d18eb2c7b55ca949a148dd27
4,285
py
Python
py/idasplode/font_table.py
zachriggle/ida-splode
a4aee3be415b318a0e051a523ebd0a8d6d5e0026
[ "MIT" ]
87
2015-01-08T08:53:35.000Z
2022-03-18T11:52:39.000Z
py/idasplode/font_table.py
nihilus/ida-splode
0128879b8a5dabbf78550acb7b830784861b3611
[ "MIT" ]
null
null
null
py/idasplode/font_table.py
nihilus/ida-splode
0128879b8a5dabbf78550acb7b830784861b3611
[ "MIT" ]
26
2015-02-08T18:57:19.000Z
2020-12-16T03:47:01.000Z
def go(): ptr_size=4 tableStart = LocByName('_function') fns=['itrp_SVTCA_0', 'itrp_SVTCA_1', 'itrp_SPVTCA_0', 'itrp_SPVTCA_1', 'itrp_SFVTCA_0', 'itrp_SFVTCA_1', 'itrp_SPVTL', 'itrp_SPVTL', 'itrp_SFVTL', 'itrp_SFVTL', 'itrp_WPV', 'itrp_WFV', 'itrp_RPV', 'itrp_RFV', 'itrp_SFVTPV', 'itrp_ISECT', 'itrp_SRP0', 'itrp_SRP1', 'itrp_SRP2', 'itrp_SetElementPtr', 'itrp_SetElementPtr', 'itrp_SetElementPtr', 'itrp_SetElementPtr', 'itrp_LLOOP', 'itrp_RTG', 'itrp_RTHG', 'itrp_LMD', 'itrp_ELSE', 'itrp_JMPR', 'itrp_LWTCI', 'itrp_LSWCI', 'itrp_LSW', 'itrp_DUP', 'itrp_POP', 'itrp_CLEAR', 'itrp_SWAP', 'itrp_DEPTH', 'itrp_CINDEX', 'itrp_MINDEX', 'itrp_ALIGNPTS', 'itrp_RAW', 'itrp_UTP', 'itrp_LOOPCALL', 'itrp_CALL', 'itrp_FDEF', 'itrp_IllegalInstruction', 'itrp_MDAP', 'itrp_MDAP', 'itrp_IUP', 'itrp_IUP', 'itrp_SHP', 'itrp_SHP', 'itrp_SHC', 'itrp_SHC', 'itrp_SHE', 'itrp_SHE', 'itrp_SHPIX', 'itrp_IP', 'itrp_MSIRP', 'itrp_MSIRP', 'itrp_ALIGNRP', 'itrp_RTDG', 'itrp_MIAP', 'itrp_MIAP', 'itrp_NPUSHB', 'itrp_NPUSHW', 'itrp_WS', 'itrp_RS', 'itrp_WCVT', 'itrp_RCVT', 'itrp_RC', 'itrp_RC', 'itrp_WC', 'itrp_MD', 'itrp_MD', 'itrp_MPPEM', 'itrp_MPS', 'itrp_FLIPON', 'itrp_FLIPOFF', 'itrp_AA', 'itrp_LT', 'itrp_LTEQ', 'itrp_GT', 'itrp_GTEQ', 'itrp_EQ', 'itrp_NEQ', 'itrp_ODD', 'itrp_EVEN', 'itrp_IF', '??0EPOINTFIX@@QEAA@XZ', 'itrp_AND', 'itrp_OR', 'itrp_NOT', 'itrp_DELTAP1', 'itrp_SDB', 'itrp_SDS', 'itrp_ADD', 'itrp_SUB', 'itrp_DIV', 'itrp_MUL', 'itrp_ABS', 'itrp_NEG', 'itrp_FLOOR', 'itrp_CEILING', 'itrp_ROUND', 'itrp_ROUND', 'itrp_ROUND', 'itrp_ROUND', 'itrp_NROUND', 'itrp_NROUND', 'itrp_NROUND', 'itrp_NROUND', 'itrp_WCVTFOD', 'itrp_DELTAP2', 'itrp_DELTAP3', 'itrp_DELTAC1', 'itrp_DELTAC2', 'itrp_DELTAC3', 'itrp_SROUND', 'itrp_S45ROUND', 'itrp_JROT', 'itrp_JROF', 'itrp_ROFF', 'itrp_IllegalInstruction', 'itrp_RUTG', 'itrp_RDTG', 'itrp_SANGW', 'itrp_AA', 'itrp_FLIPPT', 'itrp_FLIPRGON', 'itrp_FLIPRGOFF', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_SCANCTRL', 'itrp_SDPVTL', 'itrp_SDPVTL', 'itrp_GETINFO', 'itrp_IDEF', 'itrp_ROTATE', 'itrp_MAX', 'itrp_MIN', 'itrp_SCANTYPE', 'itrp_INSTCTRL', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_IDefPatch', 'itrp_PUSHB1', 'itrp_PUSHB', 'itrp_PUSHB', 'itrp_PUSHB', 'itrp_PUSHB', 'itrp_PUSHB', 'itrp_PUSHB', 'itrp_PUSHB', 'itrp_PUSHW1', 'itrp_PUSHW', 'itrp_PUSHW', 'itrp_PUSHW', 'itrp_PUSHW', 'itrp_PUSHW', 'itrp_PUSHW', 'itrp_PUSHW', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MDRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP', 'itrp_MIRP'] if tableStart != BADADDR: for i in xrange(len(fns)): Ptr = tableStart + i*ptr_size Fn = Dword(Ptr) if ptr_size == 4 else Qword(Ptr) print "%x => %x" % (Ptr, Fn) MakeData(Ptr, FF_DWRD, 4, 0) MakeName(Fn, "") MakeName(Fn, "%s" % fns[i]) SetType(Fn, "char* function(char* pbyInst, int lOpCode);") else: print "Could not find '_function' table" try: go() except: import traceback traceback.print_exc()
204.047619
3,680
0.690082
593
4,285
4.53457
0.278246
0.169208
0.221272
0.319078
0.46746
0.456303
0.456303
0.399777
0.399777
0.399777
0
0.006298
0.110618
4,285
21
3,681
204.047619
0.699292
0
0
0
0
0
0.642522
0.015706
0
0
0
0
0
0
null
null
0
0.05
null
null
0.15
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
1
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
6
a09ee21230f359e20612040439159bd2531ab1c2
46
py
Python
uiza/api_resources/user/__init__.py
uizaio/api-wrapper-python
e67c162e711857341f7ef5752178219e94f604d3
[ "MIT" ]
2
2019-04-22T11:39:36.000Z
2020-05-26T04:01:43.000Z
uiza/api_resources/user/__init__.py
uizaio/api-wrapper-python
e67c162e711857341f7ef5752178219e94f604d3
[ "MIT" ]
null
null
null
uiza/api_resources/user/__init__.py
uizaio/api-wrapper-python
e67c162e711857341f7ef5752178219e94f604d3
[ "MIT" ]
2
2019-02-11T09:34:03.000Z
2019-02-12T10:31:41.000Z
from uiza.api_resources.user.user import User
23
45
0.847826
8
46
4.75
0.75
0
0
0
0
0
0
0
0
0
0
0
0.086957
46
1
46
46
0.904762
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
a0a38eaf90c42cc12afca07b730c258dbd9d76ca
124
py
Python
src/app/routes.py
YevheniiM/GitApi
8ef7d087ccdfada4b17aa7401d32c2d4b32fb422
[ "MIT" ]
null
null
null
src/app/routes.py
YevheniiM/GitApi
8ef7d087ccdfada4b17aa7401d32c2d4b32fb422
[ "MIT" ]
null
null
null
src/app/routes.py
YevheniiM/GitApi
8ef7d087ccdfada4b17aa7401d32c2d4b32fb422
[ "MIT" ]
null
null
null
from .views import search_repositories def setup_routes(app): app.router.add_get("/api/search/", search_repositories)
20.666667
59
0.774194
17
124
5.411765
0.764706
0.391304
0
0
0
0
0
0
0
0
0
0
0.112903
124
5
60
24.8
0.836364
0
0
0
0
0
0.096774
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0
0.666667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
0
1
0
0
6
a0b628087ea7202e454cf805dedf91aacde71b8b
162
py
Python
polytester/parsers/default.py
skoczen/polytester
c32c99aa61eb4dcfd2b3f6860b5d9d342a7ecfa8
[ "MIT" ]
115
2015-01-23T13:37:37.000Z
2020-11-16T09:40:53.000Z
polytester/parsers/default.py
skoczen/polytester
c32c99aa61eb4dcfd2b3f6860b5d9d342a7ecfa8
[ "MIT" ]
18
2015-01-21T14:13:14.000Z
2021-03-25T21:38:07.000Z
polytester/parsers/default.py
skoczen/polytester
c32c99aa61eb4dcfd2b3f6860b5d9d342a7ecfa8
[ "MIT" ]
11
2015-01-28T19:43:37.000Z
2017-06-30T13:20:24.000Z
from .base import BaseParser class DefaultParser(BaseParser): name = "standard" def tests_passed(self, result): return result.return_code == 0
18
38
0.697531
19
162
5.842105
0.842105
0.216216
0
0
0
0
0
0
0
0
0
0.007874
0.216049
162
8
39
20.25
0.866142
0
0
0
0
0
0.049383
0
0
0
0
0
0
1
0.2
false
0.2
0.2
0.2
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
1
1
0
0
6
2606c9e100fd84d8ec02a1b3ea3976beb7e36533
202
py
Python
build/lib/Kronos_heureka_code/Zeit/Datum/Tag/__init__.py
heureka-code/Kronos-heureka-code
0ddbc93ec69f0bc50075071e6a3e406c9cc97737
[ "MIT" ]
null
null
null
build/lib/Kronos_heureka_code/Zeit/Datum/Tag/__init__.py
heureka-code/Kronos-heureka-code
0ddbc93ec69f0bc50075071e6a3e406c9cc97737
[ "MIT" ]
null
null
null
build/lib/Kronos_heureka_code/Zeit/Datum/Tag/__init__.py
heureka-code/Kronos-heureka-code
0ddbc93ec69f0bc50075071e6a3e406c9cc97737
[ "MIT" ]
null
null
null
from Kronos_heureka_code.Zeit.Datum.Tag.TagException import \ TagException, \ TagZuGross, \ TagKeineGanzeZahl, \ TagKleinerAlsEins from Kronos_heureka_code.Zeit.Datum.Tag.Tag import Tag
28.857143
61
0.772277
23
202
6.608696
0.521739
0.131579
0.223684
0.276316
0.434211
0.434211
0.434211
0
0
0
0
0
0.153465
202
6
62
33.666667
0.888889
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
6
269133a8e775159288bec970652c586cb635324f
37
py
Python
crslab/model/policy/conv_bert/__init__.py
hcmus-nlp-chatbot/CRSLab
b3ab262a4ad93cbae98fe66541eb735377768a35
[ "MIT" ]
315
2021-01-05T06:31:57.000Z
2022-03-16T21:12:23.000Z
crslab/model/policy/conv_bert/__init__.py
hcmus-nlp-chatbot/CRSLab
b3ab262a4ad93cbae98fe66541eb735377768a35
[ "MIT" ]
23
2021-01-09T05:43:26.000Z
2022-03-28T21:05:49.000Z
crslab/model/policy/conv_bert/__init__.py
hcmus-nlp-chatbot/CRSLab
b3ab262a4ad93cbae98fe66541eb735377768a35
[ "MIT" ]
71
2021-01-05T06:31:59.000Z
2022-03-06T06:30:35.000Z
from .conv_bert import ConvBERTModel
18.5
36
0.864865
5
37
6.2
1
0
0
0
0
0
0
0
0
0
0
0
0.108108
37
1
37
37
0.939394
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
cd15fa02dad1c20276ebfc9889fef208e5690581
22,921
py
Python
examples/dataset.py
Sirui-Xu/Arena
6ae9e69d795919f8775ded5d2dd6d6b60ae8ffea
[ "MIT" ]
1
2021-06-13T11:50:48.000Z
2021-06-13T11:50:48.000Z
examples/dataset.py
Sirui-Xu/Arena
6ae9e69d795919f8775ded5d2dd6d6b60ae8ffea
[ "MIT" ]
null
null
null
examples/dataset.py
Sirui-Xu/Arena
6ae9e69d795919f8775ded5d2dd6d6b60ae8ffea
[ "MIT" ]
null
null
null
import sys import json import numpy as np from tqdm import tqdm import torch from torch.utils.data.dataset import Dataset from torch_geometric.data import Data from torch.distributions import Normal class GamePatch(Dataset): """Provide patches according to GT boxes or proposals""" def __init__(self, data, star_shaped=False, std=None): self.data = data # Note that it is xywh format. self.gt_boxes = [] self.gt_classes = [] for data in self.data: shape = data["state"]["global"]["shape"] boxes = [] classes = [] for local_info in data["state"]["local"]: box = local_info["position"] + local_info["box"] + local_info["velocity"] + [local_info["speed"], local_info["speed"]] box = np.array(box, dtype=np.float32) box[::2] /= shape[0] box[1::2] /= shape[1] boxes.append(box) classes.append(local_info["type_index"]) self.gt_boxes.append(np.array(boxes, dtype=np.float32)) self.gt_classes.append(np.array(classes, dtype=np.float32)) self.star_shaped = star_shaped self.std = std # self.class_dim = self.gt_classes[0].shape[0] # self.box_dim = self.gt_boxes[0].shape[0] def __getitem__(self, index): data = self.data[index] # {image, annotations, indices} boxes = self.gt_boxes[index].copy() boxes_tensor = torch.tensor(boxes, dtype=torch.float32) # add augmentation if self.std: std_tensor = boxes_tensor.new_tensor(self.std) boxes_tensor = Normal(boxes_tensor, std_tensor).sample() classes_tensor = torch.tensor(self.gt_classes[index], dtype=torch.float32) n = boxes_tensor.size(0) if self.star_shaped: edge_index = torch.tensor([[0, j] for j in range(1, n)], dtype=torch.long).transpose(0, 1) # edge_attr = torch.cat([(boxes_tensor[j] - boxes_tensor[0]).unsqueeze(0) for j in range(1, n)], dim=0) edge_attr = torch.tensor([[0] for j in range(1, n)], dtype=torch.float32) else: edge_index = torch.tensor([[i, j] for i in range(n) for j in range(n)], dtype=torch.long).transpose(0, 1) # edge_attr = torch.cat([(boxes_tensor[j] - boxes_tensor[i]).unsqueeze(0) for i in range(n) for j in range(n)], dim=0) edge_attr = torch.tensor([[0] for i in range(n) for j in range(n)], dtype=torch.float32) # get target target = data["action"] target = torch.tensor(target, dtype=torch.float32).unsqueeze(0) out = Data( x=classes_tensor, y=target, edge_index=edge_index.long(), edge_attr=edge_attr.float(), pos=boxes_tensor.float(), idx=torch.tensor([index], dtype=torch.int64), # for visualization and dp size=torch.tensor([1], dtype=torch.int64), # indicate batch size ) return out def __len__(self): return len(self.data) class GamePatchReduce(Dataset): """Provide patches according to GT boxes or proposals""" def __init__(self, data, star_shaped=False, std=None): self.data = data # Note that it is xywh format. self.gt_boxes = [] self.gt_classes = [] for data in self.data: shape = data["state"]["global"]["shape"] boxes = [] classes = [] for local_info in data["state"]["local"]: box = local_info["position"] + local_info["box"] + local_info["velocity"] + [local_info["speed"], local_info["speed"]] box = np.array(box, dtype=np.float32) box[::2] /= shape[0] box[1::2] /= shape[1] boxes.append(box) classes.append(local_info["type_index"]) self.gt_boxes.append(np.array(boxes, dtype=np.float32)) self.gt_classes.append(np.array(classes, dtype=np.float32)) self.star_shaped = star_shaped self.std = std # self.class_dim = self.gt_classes[0].shape[0] # self.box_dim = self.gt_boxes[0].shape[0] def __getitem__(self, index): data = self.data[index] # {image, annotations, indices} boxes = self.gt_boxes[index].copy() boxes_tensor = torch.tensor(boxes, dtype=torch.float32) # add augmentation if self.std: std_tensor = boxes_tensor.new_tensor(self.std) boxes_tensor = Normal(boxes_tensor, std_tensor).sample() classes_tensor = torch.tensor(self.gt_classes[index], dtype=torch.float32) n = boxes_tensor.size(0) if self.star_shaped: edge_index = torch.tensor([[0, j] for j in range(1, n)], dtype=torch.long).transpose(0, 1) # edge_attr = torch.cat([(boxes_tensor[j] - boxes_tensor[0]).unsqueeze(0) for j in range(1, n)], dim=0) edge_attr = torch.tensor([[0] for j in range(1, n)], dtype=torch.float32) else: edge_index = torch.tensor([[i, j] for i in range(n) for j in range(n)], dtype=torch.long).transpose(0, 1) # edge_attr = torch.cat([(boxes_tensor[j] - boxes_tensor[i]).unsqueeze(0) for i in range(n) for j in range(n)], dim=0) edge_attr = torch.tensor([[0] for i in range(n) for j in range(n)], dtype=torch.float32) # get target target = data["action"] target = torch.tensor(target, dtype=torch.float32).unsqueeze(0) out = Data( x=classes_tensor, y=target, edge_index=edge_index.long(), edge_attr=edge_attr.float(), pos=boxes_tensor.float(), idx=torch.tensor([index], dtype=torch.int64), # for visualization and dp size=torch.tensor([1], dtype=torch.int64), # indicate batch size ) return out def __len__(self): return len(self.data) class GamePatchMaze(Dataset): """Provide patches according to GT boxes or proposals""" def __init__(self, data, star_shaped=False, std=None): self.data = data # Note that it is xywh format. self.gt_boxes = [] self.gt_classes = [] for data in self.data: shape = data["state"]["global"]["shape"] boxes = [] classes = [] for local_info in data["state"]["local"]: box = local_info["position"] + local_info["box"] + local_info["velocity"] + [local_info["speed"], local_info["speed"]] box = np.array(box, dtype=np.float32) box[::2] /= shape[0] box[1::2] /= shape[1] boxes.append(box) classes.append([0] + local_info["type_index"]) maze = data["state"]["global"]["maze"] for x in maze: for y in maze: if maze[x, y] != 0: box = [(x+0.5), (y+0.5)] + \ [x, y, (x+1), (y+1)] + \ [0, 0, 0, 0] box[::2] /= maze.shape[0] box[1::2] /= maze.shape[1] boxes.append(box) classes.append([maze[x, y]] + [0 for _ in len(data["state"]["local"][0]["type_index"])]) self.gt_boxes.append(np.array(boxes, dtype=np.float32)) self.gt_classes.append(np.array(classes, dtype=np.float32)) self.star_shaped = star_shaped self.std = std # self.class_dim = self.gt_classes[0].shape[0] # self.box_dim = self.gt_boxes[0].shape[0] def __getitem__(self, index): data = self.data[index] # {image, annotations, indices} boxes = self.gt_boxes[index].copy() boxes_tensor = torch.tensor(boxes, dtype=torch.float32) # add augmentation if self.std: std_tensor = boxes_tensor.new_tensor(self.std) boxes_tensor = Normal(boxes_tensor, std_tensor).sample() classes_tensor = torch.tensor(self.gt_classes[index], dtype=torch.float32) n = boxes_tensor.size(0) if self.star_shaped: edge_index = torch.tensor([[0, j] for j in range(1, n)], dtype=torch.long).transpose(0, 1) # edge_attr = torch.cat([(boxes_tensor[j] - boxes_tensor[0]).unsqueeze(0) for j in range(1, n)], dim=0) edge_attr = torch.tensor([[0] for j in range(1, n)], dtype=torch.float32) else: edge_index = torch.tensor([[i, j] for i in range(n) for j in range(n)], dtype=torch.long).transpose(0, 1) # edge_attr = torch.cat([(boxes_tensor[j] - boxes_tensor[i]).unsqueeze(0) for i in range(n) for j in range(n)], dim=0) edge_attr = torch.tensor([[0] for i in range(n) for j in range(n)], dtype=torch.float32) # get target target = data["action"] target = torch.tensor(target, dtype=torch.float32).unsqueeze(0) out = Data( x=classes_tensor, y=target, edge_index=edge_index.long(), edge_attr=edge_attr.float(), pos=boxes_tensor.float(), idx=torch.tensor([index], dtype=torch.int64), # for visualization and dp size=torch.tensor([1], dtype=torch.int64), # indicate batch size ) return out def __len__(self): return len(self.data) class GamePatchLandmark(Dataset): """Provide patches according to GT boxes or proposals""" def __init__(self, data, star_shaped=False, std=None): self.data = data # Note that it is xywh format. self.gt_boxes = [] self.gt_classes = [] for data in self.data: shape = data["state"]["global"]["shape"] boxes = [] classes = [] for local_info in data["state"]["local"]: box = local_info["position"] + local_info["box"] + local_info["velocity"] + [local_info["speed"], local_info["speed"]] box = np.array(box, dtype=np.float32) box[::2] /= shape[0] box[1::2] /= shape[1] boxes.append(box) classes.append([0] + local_info["type_index"]) maze = data["state"]["global"]["maze"] for x in maze: for y in maze: if maze[x, y] != 0: box = [(x+0.5), (y+0.5)] + \ [x, y, (x+1), (y+1)] + \ [0, 0, 0, 0] box[::2] /= maze.shape[0] box[1::2] /= maze.shape[1] boxes.append(box) classes.append([maze[x, y]] + [0 for _ in len(data["state"]["local"][0]["type_index"])]) self.gt_boxes.append(np.array(boxes, dtype=np.float32)) self.gt_classes.append(np.array(classes, dtype=np.float32)) self.star_shaped = star_shaped self.std = std # self.class_dim = self.gt_classes[0].shape[0] # self.box_dim = self.gt_boxes[0].shape[0] def __getitem__(self, index): data = self.data[index] # {image, annotations, indices} boxes = self.gt_boxes[index].copy() boxes_tensor = torch.tensor(boxes, dtype=torch.float32) # add augmentation if self.std: std_tensor = boxes_tensor.new_tensor(self.std) boxes_tensor = Normal(boxes_tensor, std_tensor).sample() classes_tensor = torch.tensor(self.gt_classes[index], dtype=torch.float32) n = boxes_tensor.size(0) if self.star_shaped: edge_index = torch.tensor([[0, j] for j in range(1, n)], dtype=torch.long).transpose(0, 1) # edge_attr = torch.cat([(boxes_tensor[j] - boxes_tensor[0]).unsqueeze(0) for j in range(1, n)], dim=0) edge_attr = torch.tensor([[0] for j in range(1, n)], dtype=torch.float32) else: edge_index = torch.tensor([[i, j] for i in range(n) for j in range(n)], dtype=torch.long).transpose(0, 1) # edge_attr = torch.cat([(boxes_tensor[j] - boxes_tensor[i]).unsqueeze(0) for i in range(n) for j in range(n)], dim=0) edge_attr = torch.tensor([[0] for i in range(n) for j in range(n)], dtype=torch.float32) # get target target = data["action"] target = torch.tensor(target, dtype=torch.float32).unsqueeze(0) out = Data( x=classes_tensor, y=target, edge_index=edge_index.long(), edge_attr=edge_attr.float(), pos=boxes_tensor.float(), idx=torch.tensor([index], dtype=torch.int64), # for visualization and dp size=torch.tensor([1], dtype=torch.int64), # indicate batch size ) return out def __len__(self): return len(self.data) class GamePatchLandmark(Dataset): def __init__(self, data, star_shaped=False, std=None): self.data = data self.gt_nodes = [] # graph_node self.gt_classes = [] # node attribution self.gt_edges = [] # graph edge for data in self.data: shape = data["state"]["global"]["shape"] boxes = [] classes = [] for local_info in data["state"]["local"]: box = local_info["position"] + local_info["box"] + local_info["velocity"] + [local_info["speed"], local_info["speed"]] box = np.array(box, dtype=np.float32) box[::2] /= shape[0] box[1::2] /= shape[1] boxes.append(box) classes.append(local_info["type_index"]) self.gt_boxes.append(np.array(boxes, dtype=np.float32)) self.gt_classes.append(np.array(classes, dtype=np.float32)) data['maze'] = np.array(data['maze']) width, height = data['maze'].shape # Coordinates for "player" boxes = [[data["player_x"], data["player_y"]]] # node attribution follows [type=1, Detonation time(only for bomb)=-1, Direction_x=0, Direction_y=0] classes = [[1, -1, 0, 0]] # Coordinates for "creep" boxes += [data["creep_pos"][i] for i in range(len(data["creep_pos"]))] # node attribution follows [type=2, Detonation time(only for bomb)=-1, Direction_x, Direction_y] direction in last frame classes += [ [2, -1] + data["creep_dir"][i] for i in range(len(data["creep_dir"]))] # Coordinates for "bomb" boxes += [data["bomb_pos"][i] for i in range(len(data["bomb_pos"]))] # node attribution follows [type=3, Detonation time, Direction_x=0, Direction_y=0] classes += [[3, data["bomb_life"][i], 0, 0] for i in range(len(data["bomb_pos"]))] # ---------------------------------------------------------------------------- # # Generate graph nodes # ---------------------------------------------------------------------------- # coor2index = {} gt_class = [] nodes = [] for x in range(1, width - 1): for y in range(1, height - 1): pos = [x, y] if pos in boxes: # Generate landmark to represent the maze nodes.append(pos) coor2index[(x, y)] = [len(nodes) - 1] gt_class.append([0, -1, 0, 0]) # Generate special node such as player, creep and bomb k = 0 while pos in boxes[k:]: k = boxes.index(pos, k) box = boxes[k] nodes.append(box) coor2index[(x, y)].append(len(nodes) - 1) gt_class.append(classes[k]) k += 1 # ---------------------------------------------------------------------------- # # Generate landmark to represent the maze # ---------------------------------------------------------------------------- # else: if data['maze'][x, y] == 1: # not a wall continue if data['maze'][x, y - 1] != 1 and data['maze'][x, y + 1] != 1 and data['maze'][x - 1, y] == 1 and data['maze'][x + 1, y] == 1: # not a passageway continue if data['maze'][x - 1, y] != 1 and data['maze'][x + 1, y] != 1 and data['maze'][x, y - 1] == 1 and data['maze'][x, y + 1] == 1: # not a passageway continue # If this location is a corner or a fork in the road, it is landmark nodes.append(pos) coor2index[(x, y)] = [len(nodes) - 1] gt_class.append([0, -1, 0, 0]) # ---------------------------------------------------------------------------- # # Generate graph edges # ---------------------------------------------------------------------------- # edges = [] # Connect all adjacent nodes # Connect edges in the Y direction flag = True for x in range(width): last_pos = None for y in range(height): pos = (x, y) # There is a wall if data['maze'][x, y] == 1: flag = False elif pos in coor2index.keys(): # There is no wall between the two sides if flag == True: assert last_pos is not None # connect two adjacent landmark edges.append((coor2index[last_pos][0], coor2index[pos][0])) # connect the all special node with landmark for index in coor2index[pos][1:]: edges.append((coor2index[pos][0], index)) # only the first side else: flag = True # connect the all special node with landmark for index in coor2index[pos][1:]: edges.append((coor2index[pos][0], index)) last_pos = (x, y) # Connect edges in the X direction flag = True for y in range(data['maze'].shape[1]): last_pos = None for x in range(data['maze'].shape[0]): pos = (x, y) # There is a wall if data['maze'][x, y] == 1: flag = False elif pos in coor2index.keys(): # There is no wall between the two sides if flag == True: assert last_pos is not None edges.append((coor2index[last_pos][0], coor2index[pos][0])) else: flag = True last_pos = (x, y) self.gt_classes.append(gt_class) # print(boxes, edges, data['maze']) nodes = np.array(nodes, dtype=np.float32) self.gt_nodes.append(nodes) self.gt_edges.append(edges) self.std = std self.n_actions = n_actions def __getitem__(self, index): data = self.data[index] nodes = self.gt_nodes[index].copy() edges = self.gt_edges[index].copy() # normalize nodes_tensor = torch.tensor(nodes, dtype=torch.float32) # add augmentation if self.std: std_tensor = nodes_tensor.new_tensor(self.std) nodes_tensor = Normal(nodes_tensor, std_tensor).sample() classes = torch.Tensor(self.gt_classes[index]) edge_index = torch.tensor(edges, dtype=torch.long).transpose(0, 1) edge_attr = torch.cat([(nodes_tensor[edges[i][1]] - nodes_tensor[edges[i][0]]).unsqueeze(0) for i in range(len(edges))], dim=0) # get target danger_scores = data.get("danger_scores", None) explosion_scores = data.get("explosion_scores", None) _action = data.get("action", None) distance = data.get("distance", None) _direction = data.get("direction", None) action, direction = None, None y = None if _action is not None: action = torch.zeros(1, self.n_actions, dtype=torch.float32) action[0, _action % self.n_actions] = 1 y = action.clone().detach() if distance is not None: distance = torch.Tensor([float(distance)]).unsqueeze_(0) if _direction is not None: direction = torch.zeros(1, 4, dtype=torch.float32) direction[0, _direction % 4] = 1 if explosion_scores is not None: explosion_scores = torch.Tensor([explosion_scores]).unsqueeze_(0) if danger_scores is not None: danger_scores = torch.Tensor([danger_scores]).unsqueeze_(0) # print( # action, # distance, # direction, # explosion_scores, # danger_scores, # ) out = Data( x=classes, y=y, action=action, distance=distance, direction=direction, explosion_scores=explosion_scores, danger_scores=danger_scores, edge_index=edge_index.long(), edge_attr=edge_attr.float(), pos=nodes_tensor.float(), idx=torch.tensor([index], dtype=torch.int64), # for visualization and dp size=torch.tensor([1], dtype=torch.int64), # indicate batch size ) return out def __len__(self): return len(self.data) if __name__ == "__main__": import os.path as osp import json data_path = osp.join('../algorithm/result/data/waterworld_greedycollectv1_[7]_[3, 5, 7, 9]_[20]_513.json') with open(data_path, 'r') as f: data = json.load(f) dataset = GamePatch(data) node_dim = dataset[0].x[0].shape[0] pos_dim = dataset[0].pos[0].shape[0] print(len(dataset), node_dim, pos_dim) for i in tqdm(range(10)): data = dataset[i] print(data.x) print(data.y) print(data.pos)
41.373646
170
0.509838
2,780
22,921
4.071583
0.069065
0.029066
0.012722
0.023324
0.782755
0.767471
0.749183
0.744942
0.726124
0.718526
0
0.024226
0.344488
22,921
554
171
41.373646
0.729118
0.159853
0
0.733681
0
0.002611
0.03714
0.003082
0
0
0
0
0.005222
1
0.039164
false
0
0.02611
0.013055
0.104439
0.010444
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
cd2908f55c312a37f617ef2cd2d8dba28041590f
104
py
Python
SQLTemplatedPythonOperator/__init__.py
asdfgeoff/airflow-operators
e013b276e10e39c2b675cd4532e2ae3e30717a3f
[ "MIT" ]
1
2021-09-06T14:47:21.000Z
2021-09-06T14:47:21.000Z
SQLTemplatedPythonOperator/__init__.py
asdfgeoff/airflow-operators
e013b276e10e39c2b675cd4532e2ae3e30717a3f
[ "MIT" ]
null
null
null
SQLTemplatedPythonOperator/__init__.py
asdfgeoff/airflow-operators
e013b276e10e39c2b675cd4532e2ae3e30717a3f
[ "MIT" ]
null
null
null
from .operator import SQLTemplatedPythonOperator from .asserts import assert_pct_less_than, assert_zero
34.666667
54
0.884615
13
104
6.769231
0.769231
0
0
0
0
0
0
0
0
0
0
0
0.086538
104
2
55
52
0.926316
0
0
0
0
0
0
0
0
0
0
0
0.5
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
1
0
1
0
1
0
0
6
cd29477d44291d19780c6dd779090fe9c1680bfa
63
py
Python
spikeextractors/extractors/bindatrecordingextractor/__init__.py
zekearneodo/spikeextractors
d30aa85e69d0331fffdb58a03a2bb628f93b405e
[ "MIT" ]
145
2018-12-06T23:12:54.000Z
2022-02-10T22:57:35.000Z
spikeextractors/extractors/bindatrecordingextractor/__init__.py
zekearneodo/spikeextractors
d30aa85e69d0331fffdb58a03a2bb628f93b405e
[ "MIT" ]
396
2018-11-26T11:46:30.000Z
2022-01-04T07:27:47.000Z
spikeextractors/extractors/bindatrecordingextractor/__init__.py
zekearneodo/spikeextractors
d30aa85e69d0331fffdb58a03a2bb628f93b405e
[ "MIT" ]
67
2018-11-19T12:38:01.000Z
2021-09-25T03:18:22.000Z
from .bindatrecordingextractor import BinDatRecordingExtractor
31.5
62
0.920635
4
63
14.5
0.75
0
0
0
0
0
0
0
0
0
0
0
0.063492
63
1
63
63
0.983051
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
cd4ee99d51da4e369393165189e180839341f3ae
35
py
Python
sparkplug/__init__.py
Quva/sparkplug
c6ec310ae1f53067fece6e690d7b10c1eb69516e
[ "Apache-2.0" ]
null
null
null
sparkplug/__init__.py
Quva/sparkplug
c6ec310ae1f53067fece6e690d7b10c1eb69516e
[ "Apache-2.0" ]
null
null
null
sparkplug/__init__.py
Quva/sparkplug
c6ec310ae1f53067fece6e690d7b10c1eb69516e
[ "Apache-2.0" ]
null
null
null
from .spark_plug import SparkPlug
11.666667
33
0.828571
5
35
5.6
1
0
0
0
0
0
0
0
0
0
0
0
0.142857
35
2
34
17.5
0.933333
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
cd6a5f5592042ab5dc515155079ca32262fa64bb
71
py
Python
buzz.py
trrevvorr/DIY-Smart-Door-Lock
7ca7a219c6e8e840672a4640568420ae700b42c3
[ "MIT" ]
null
null
null
buzz.py
trrevvorr/DIY-Smart-Door-Lock
7ca7a219c6e8e840672a4640568420ae700b42c3
[ "MIT" ]
null
null
null
buzz.py
trrevvorr/DIY-Smart-Door-Lock
7ca7a219c6e8e840672a4640568420ae700b42c3
[ "MIT" ]
null
null
null
import _control_lock import commands _control_lock.main(commands.BUZZ)
17.75
33
0.873239
10
71
5.8
0.6
0.37931
0
0
0
0
0
0
0
0
0
0
0.070423
71
4
33
17.75
0.878788
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
26956e99360e04496194769d72392f26a5e452f6
35
py
Python
pyinvsqrt/__init__.py
skailasa/pyinvsqrt
c9ccf90391f355c2468ad9b88d0e0d54121d66bf
[ "MIT" ]
2
2021-03-15T08:15:58.000Z
2021-05-16T02:45:33.000Z
pyinvsqrt/__init__.py
skailasa/pyinvsqrt
c9ccf90391f355c2468ad9b88d0e0d54121d66bf
[ "MIT" ]
null
null
null
pyinvsqrt/__init__.py
skailasa/pyinvsqrt
c9ccf90391f355c2468ad9b88d0e0d54121d66bf
[ "MIT" ]
1
2022-02-12T23:31:48.000Z
2022-02-12T23:31:48.000Z
# API from invsqrtc import invsqrt
11.666667
28
0.8
5
35
5.6
1
0
0
0
0
0
0
0
0
0
0
0
0.171429
35
2
29
17.5
0.965517
0.085714
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
26e39ca2a2bb5e5acaa7d7c016b5da616a6f1c57
28,638
py
Python
tensorflow/compiler/tests/sharding_util_ops_test.py
EricRemmerswaal/tensorflow
141ff27877579c81a213fa113bd1b474c1749aca
[ "Apache-2.0" ]
190,993
2015-11-09T13:17:30.000Z
2022-03-31T23:05:27.000Z
tensorflow/compiler/tests/sharding_util_ops_test.py
EricRemmerswaal/tensorflow
141ff27877579c81a213fa113bd1b474c1749aca
[ "Apache-2.0" ]
48,461
2015-11-09T14:21:11.000Z
2022-03-31T23:17:33.000Z
tensorflow/compiler/tests/sharding_util_ops_test.py
EricRemmerswaal/tensorflow
141ff27877579c81a213fa113bd1b474c1749aca
[ "Apache-2.0" ]
104,981
2015-11-09T13:40:17.000Z
2022-03-31T19:51:54.000Z
# Copyright 2021 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== """Tests for sharding util ops (XlaSplitND, XlaConcatND).""" from typing import Any, List, Optional from absl.testing import parameterized import numpy as np from tensorflow.compiler.tests import xla_test from tensorflow.python.client.session import Session from tensorflow.python.framework import constant_op from tensorflow.python.framework.ops import control_dependencies from tensorflow.python.framework.ops import Tensor from tensorflow.python.ops import gen_tpu_ops from tensorflow.python.ops import math_ops from tensorflow.python.ops import resource_variable_ops from tensorflow.python.ops import variables from tensorflow.python.platform import test def create_tensor_split_graph( sess: Session, input_value: Any, input_dtype: Any, num_outputs: int, num_splits: List[int], paddings: Optional[List[int]] = None) -> List[Tensor]: del sess const_input_op = constant_op.constant(input_value, dtype=input_dtype) return gen_tpu_ops.xla_split_nd( const_input_op, num_outputs, num_splits, paddings=paddings) def create_resource_split_graph( sess: Session, input_value: Any, input_dtype: Any, num_outputs: int, num_splits: List[int], paddings: Optional[List[int]] = None) -> List[Tensor]: variable = resource_variable_ops.ResourceVariable( initial_value=input_value, dtype=input_dtype) sess.run(variables.variables_initializer([variable])) return gen_tpu_ops.read_variable_xla_split_nd( variable.handle, input_dtype, num_outputs, num_splits, paddings=paddings) class XlaSplitNDOpTest(xla_test.XLATestCase, parameterized.TestCase): @parameterized.named_parameters(('Tensor', create_tensor_split_graph), ('Resource', create_resource_split_graph)) def testSplitDimensionZero(self, graph_fn): for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): split = graph_fn( sess, input_value=[[[0]]], input_dtype=dtype, num_outputs=1, num_splits=[1, 1, 0]) with self.assertRaisesOpError('index 2 must be positive, but got 0'): sess.run(split) @parameterized.named_parameters(('Tensor', create_tensor_split_graph), ('Resource', create_resource_split_graph)) def testSplitDimensionNegative(self, graph_fn): for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): split = graph_fn( sess, input_value=[[[0]]], input_dtype=dtype, num_outputs=1, num_splits=[1, -1, 1]) with self.assertRaisesOpError('index 1 must be positive, but got -1'): sess.run(split) @parameterized.named_parameters(('Tensor', create_tensor_split_graph), ('Resource', create_resource_split_graph)) def testNumOutputsMismatch(self, graph_fn): for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): split = graph_fn( sess, input_value=[0, 1], input_dtype=dtype, num_outputs=1, num_splits=[2]) with self.assertRaisesOpError('\'N\' must match number of slices 2'): sess.run(split) @parameterized.named_parameters(('Tensor', create_tensor_split_graph), ('Resource', create_resource_split_graph)) def testPaddingsLengthMismatch(self, graph_fn): for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): split = graph_fn( sess, input_value=[[0, 1], [2, 3]], input_dtype=dtype, num_outputs=4, num_splits=[2, 2], paddings=[0]) with self.assertRaisesOpError('length 2, but got 1'): sess.run(split) @parameterized.named_parameters(('Tensor', create_tensor_split_graph), ('Resource', create_resource_split_graph)) def testPaddingsNegative(self, graph_fn): for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): split = graph_fn( sess, input_value=[[0, 1], [2, 3]], input_dtype=dtype, num_outputs=4, num_splits=[2, 2], paddings=[0, -1]) with self.assertRaisesOpError('non-negative, but got -1 at index 1'): sess.run(split) @parameterized.named_parameters(('Tensor', create_tensor_split_graph), ('Resource', create_resource_split_graph)) def testInputRankSplitMismatch(self, graph_fn): for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): split = graph_fn( sess, input_value=[[0, 1], [2, 3]], input_dtype=dtype, num_outputs=8, num_splits=[2, 2, 2]) with self.assertRaisesOpError( '\'num_splits\' length 3, but got rank 2'): sess.run(split) @parameterized.named_parameters(('Tensor', create_tensor_split_graph), ('Resource', create_resource_split_graph)) def testDimNotEvenlySplit(self, graph_fn): for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): split = graph_fn( sess, input_value=[[0, 1], [2, 3], [4, 5], [6, 7]], input_dtype=dtype, num_outputs=6, num_splits=[3, 2]) with self.assertRaisesOpError('divisible by \'num_splits\' 3'): sess.run(split) @parameterized.named_parameters(('Tensor', create_tensor_split_graph), ('Resource', create_resource_split_graph)) def testDimWithPaddingNotEvenlySplit(self, graph_fn): for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): split = graph_fn( sess, input_value=[[0, 1], [2, 3], [4, 5], [6, 7]], input_dtype=dtype, num_outputs=4, num_splits=[2, 2], paddings=[0, 1]) with self.assertRaisesOpError('divisible by \'num_splits\' 2'): sess.run(split) @parameterized.named_parameters(('Tensor', create_tensor_split_graph), ('Resource', create_resource_split_graph)) def testNoSplits(self, graph_fn): for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): split = graph_fn( sess, input_value=[[[0, 1], [2, 3]], [[4, 5], [6, 7]]], input_dtype=dtype, num_outputs=1, num_splits=[1, 1, 1]) results = sess.run(split) self.assertLen(results, 1) self.assertAllClose(results[0], [[[0, 1], [2, 3]], [[4, 5], [6, 7]]]) @parameterized.named_parameters(('Tensor', create_tensor_split_graph), ('Resource', create_resource_split_graph)) def testNoSplitsWithPadding(self, graph_fn): for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): split = graph_fn( sess, input_value=[[[0]], [[1]]], input_dtype=dtype, num_outputs=1, num_splits=[1, 1, 1], paddings=[0, 1, 1]) results = sess.run(split) self.assertLen(results, 1) self.assertAllClose(results[0], [[[0, 0], [0, 0]], [[1, 0], [0, 0]]]) @parameterized.named_parameters(('Tensor', create_tensor_split_graph), ('Resource', create_resource_split_graph)) def testSplitNoPadding(self, graph_fn): for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): split = graph_fn( sess, input_value=[ [0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11], [12, 13, 14, 15], ], input_dtype=dtype, num_outputs=4, num_splits=[2, 2]) results = sess.run(split) self.assertLen(results, 4) self.assertAllClose(results[0], [[0, 1], [4, 5]]) self.assertAllClose(results[1], [[2, 3], [6, 7]]) self.assertAllClose(results[2], [[8, 9], [12, 13]]) self.assertAllClose(results[3], [[10, 11], [14, 15]]) @parameterized.named_parameters(('Tensor', create_tensor_split_graph), ('Resource', create_resource_split_graph)) def testSplitPartialPadding(self, graph_fn): for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): split = graph_fn( sess, input_value=[ [0, 1, 2], [3, 4, 5], [6, 7, 8], ], input_dtype=dtype, num_outputs=4, num_splits=[2, 2], paddings=[1, 1]) results = sess.run(split) self.assertLen(results, 4) self.assertAllClose(results[0], [[0, 1], [3, 4]]) self.assertAllClose(results[1], [[2, 0], [5, 0]]) self.assertAllClose(results[2], [[6, 7], [0, 0]]) self.assertAllClose(results[3], [[8, 0], [0, 0]]) @parameterized.named_parameters(('Tensor', create_tensor_split_graph), ('Resource', create_resource_split_graph)) def testSplitCompletePadding(self, graph_fn): for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): split = graph_fn( sess, input_value=[[0], [1]], input_dtype=dtype, num_outputs=4, num_splits=[2, 2], paddings=[2, 3]) results = sess.run(split) self.assertLen(results, 4) self.assertAllClose(results[0], [[0, 0], [1, 0]]) self.assertAllClose(results[1], [[0, 0], [0, 0]]) self.assertAllClose(results[2], [[0, 0], [0, 0]]) self.assertAllClose(results[3], [[0, 0], [0, 0]]) @parameterized.named_parameters( ('1Tensor', create_tensor_split_graph, 1), ('2Tensor', create_tensor_split_graph, 2), ('3Tensor', create_tensor_split_graph, 3), ('4Tensor', create_tensor_split_graph, 4), ('5Tensor', create_tensor_split_graph, 5), ('6Tensor', create_tensor_split_graph, 6), ('7Tensor', create_tensor_split_graph, 7), ('8Tensor', create_tensor_split_graph, 8), ('1Resource', create_resource_split_graph, 1), ('2Resource', create_resource_split_graph, 2), ('3Resource', create_resource_split_graph, 3), ('4Resource', create_resource_split_graph, 4), ('5Resource', create_resource_split_graph, 5), ('6Resource', create_resource_split_graph, 6), ('7Resource', create_resource_split_graph, 7), ('8Resource', create_resource_split_graph, 8), ) def testRanked(self, graph_fn, rank): num_splits = [2] * rank num_outputs = 2 << (rank - 1) input_value = np.reshape(np.arange(np.product(num_splits)), num_splits) for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): split = graph_fn( sess, input_value=input_value, input_dtype=dtype, num_outputs=num_outputs, num_splits=num_splits) results = sess.run(split) self.assertLen(results, num_outputs) for i, result in enumerate(results): expected_output = np.reshape(i, [1] * rank).astype(dtype) self.assertAllClose(result, expected_output) def create_tensor_concat_graph( sess: Session, input_values: List[Any], input_dtype: Any, num_concats: List[int], paddings: Optional[List[int]] = None, output_shape: Optional[List[int]] = None) -> Tensor: del sess del output_shape const_input_ops = [ constant_op.constant(i, dtype=input_dtype) for i in input_values ] return gen_tpu_ops.xla_concat_nd(const_input_ops, num_concats, paddings) def create_resource_concat_graph( sess: Session, input_values: List[Any], input_dtype: Any, num_concats: List[int], paddings: Optional[List[int]] = None, output_shape: Optional[List[int]] = None) -> Tensor: variable_shape = [] if output_shape is None else output_shape variable = resource_variable_ops.ResourceVariable( initial_value=np.zeros(variable_shape, dtype=input_dtype), dtype=input_dtype) sess.run(variables.variables_initializer([variable])) const_input_ops = [ constant_op.constant(i, dtype=input_dtype) for i in input_values ] concat = gen_tpu_ops.assign_variable_xla_concat_nd(variable.handle, const_input_ops, num_concats, paddings) with control_dependencies([concat]): return variable.read_value() class XlaConcatNDOpTest(xla_test.XLATestCase, parameterized.TestCase): @parameterized.named_parameters(('Tensor', create_tensor_concat_graph), ('Resource', create_resource_concat_graph)) def testConcatDimensionZero(self, graph_fn): for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): concat = graph_fn( sess, input_values=[[[[0]]]], input_dtype=dtype, num_concats=[1, 1, 0]) with self.assertRaisesOpError('index 2 must be positive, but got 0'): sess.run(concat) @parameterized.named_parameters(('Tensor', create_tensor_concat_graph), ('Resource', create_resource_concat_graph)) def testConcatDimensionNegative(self, graph_fn): for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): concat = graph_fn( sess, input_values=[[[[0]]]], input_dtype=dtype, num_concats=[1, -1, 1]) with self.assertRaisesOpError('index 1 must be positive, but got -1'): sess.run(concat) @parameterized.named_parameters(('Tensor', create_tensor_concat_graph), ('Resource', create_resource_concat_graph)) def testNumInputsMismatch(self, graph_fn): for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): concat = graph_fn( sess, input_values=[[0, 1]], input_dtype=dtype, num_concats=[2]) with self.assertRaisesOpError('\'N\' must match number of slices 2'): sess.run(concat) @parameterized.named_parameters(('Tensor', create_tensor_concat_graph), ('Resource', create_resource_concat_graph)) def testPaddingsLengthMismatch(self, graph_fn): for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): concat = graph_fn( sess, input_values=[[[0, 1], [2, 3]]], input_dtype=dtype, num_concats=[1, 1], paddings=[0]) with self.assertRaisesOpError('length 2, but got 1'): sess.run(concat) @parameterized.named_parameters(('Tensor', create_tensor_concat_graph), ('Resource', create_resource_concat_graph)) def testPaddingsNegative(self, graph_fn): for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): concat = graph_fn( sess, input_values=[[[0, 1], [2, 3]]], input_dtype=dtype, num_concats=[1, 1], paddings=[0, -1]) with self.assertRaisesOpError('non-negative, but got -1 at index 1'): sess.run(concat) @parameterized.named_parameters(('Tensor', create_tensor_concat_graph), ('Resource', create_resource_concat_graph)) def testInputRankConcatMismatch(self, graph_fn): for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): concat = graph_fn( sess, input_values=[[0]], input_dtype=dtype, num_concats=[1, 1]) with self.assertRaisesOpError( '\'num_concats\' length 2, but got rank 1'): sess.run(concat) @parameterized.named_parameters(('Tensor', create_tensor_concat_graph), ('Resource', create_resource_concat_graph)) def testDifferentShapedInputs(self, graph_fn): for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): concat = graph_fn( sess, input_values=[[0], [1, 2]], input_dtype=dtype, num_concats=[2]) with self.assertRaisesOpError( r'same expected shape \[1\], but got \[2\] at index 1'): sess.run(concat) @parameterized.named_parameters(('Tensor', create_tensor_concat_graph), ('Resource', create_resource_concat_graph)) def testPaddingExceedsOutputDimSize(self, graph_fn): for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): concat = graph_fn( sess, input_values=[[0]], input_dtype=dtype, num_concats=[1], paddings=[2]) with self.assertRaisesOpError( 'exceed expected output shape dimension 1 at index 0, but got 2'): sess.run(concat) @parameterized.named_parameters(('Tensor', create_tensor_concat_graph), ('Resource', create_resource_concat_graph)) def testNoConcats(self, graph_fn): for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): concat = graph_fn( sess, input_values=[[[[0, 1], [2, 3]], [[4, 5], [6, 7]]]], input_dtype=dtype, num_concats=[1, 1, 1], output_shape=[2, 2, 2]) result = sess.run(concat) self.assertAllClose(result, [[[0, 1], [2, 3]], [[4, 5], [6, 7]]]) @parameterized.named_parameters(('Tensor', create_tensor_concat_graph), ('Resource', create_resource_concat_graph)) def testNoConcatsWithPadding(self, graph_fn): for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): concat = graph_fn( sess, input_values=[[[[0, 1], [2, 3]], [[4, 5], [6, 7]]]], input_dtype=dtype, num_concats=[1, 1, 1], output_shape=[1, 1, 1], paddings=[1, 1, 1]) result = sess.run(concat) self.assertAllClose(result, [[[0]]]) @parameterized.named_parameters(('Tensor', create_tensor_concat_graph), ('Resource', create_resource_concat_graph)) def testConcatNoPadding(self, graph_fn): for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): concat = graph_fn( sess, input_values=[ [[0, 1], [2, 3]], [[4, 5], [6, 7]], [[8, 9], [10, 11]], [[12, 13], [14, 15]], ], input_dtype=dtype, num_concats=[2, 2], output_shape=[4, 4]) result = sess.run(concat) self.assertAllClose( result, [[0, 1, 4, 5], [2, 3, 6, 7], [8, 9, 12, 13], [10, 11, 14, 15]]) @parameterized.named_parameters(('Tensor', create_tensor_concat_graph), ('Resource', create_resource_concat_graph)) def testConcatPartialPadding(self, graph_fn): for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): concat = graph_fn( sess, input_values=[ [[0, 1], [2, 3]], [[4, 5], [6, 7]], [[8, 9], [10, 11]], [[12, 13], [14, 15]], ], input_dtype=dtype, num_concats=[2, 2], output_shape=[3, 3], paddings=[1, 1]) result = sess.run(concat) self.assertAllClose(result, [[0, 1, 4], [2, 3, 6], [8, 9, 12]]) @parameterized.named_parameters(('Tensor', create_tensor_concat_graph), ('Resource', create_resource_concat_graph)) def testConcatCompletePadding(self, graph_fn): for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): concat = graph_fn( sess, input_values=[ [[0, 1], [2, 3]], [[4, 5], [6, 7]], [[8, 9], [10, 11]], [[12, 13], [14, 15]], ], input_dtype=dtype, num_concats=[2, 2], output_shape=[2, 2], paddings=[2, 2]) result = sess.run(concat) self.assertAllClose(result, [[0, 1], [2, 3]]) @parameterized.named_parameters( ('1Tensor', create_tensor_concat_graph, 1), ('2Tensor', create_tensor_concat_graph, 2), ('3Tensor', create_tensor_concat_graph, 3), ('4Tensor', create_tensor_concat_graph, 4), ('5Tensor', create_tensor_concat_graph, 5), ('6Tensor', create_tensor_concat_graph, 6), ('7Tensor', create_tensor_concat_graph, 7), ('8Tensor', create_tensor_concat_graph, 8), ('1Resource', create_resource_concat_graph, 1), ('2Resource', create_resource_concat_graph, 2), ('3Resource', create_resource_concat_graph, 3), ('4Resource', create_resource_concat_graph, 4), ('5Resource', create_resource_concat_graph, 5), ('6Resource', create_resource_concat_graph, 6), ('7Resource', create_resource_concat_graph, 7), ('8Resource', create_resource_concat_graph, 8), ) def testRanked(self, graph_fn, rank): num_concats = [2] * rank num_inputs = 2 << (rank - 1) input_values = [np.reshape(i, [1] * rank) for i in range(num_inputs)] for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): concat = graph_fn( sess, input_values=input_values, input_dtype=dtype, num_concats=num_concats, output_shape=num_concats) result = sess.run(concat) expected_output = np.arange(0, num_inputs).reshape(num_concats).astype(dtype) self.assertAllClose(result, expected_output) def create_tensor_roundtrip_graph( sess: Session, value: Any, dtype: Any, num_partitions: List[int], paddings: Optional[List[int]] = None) -> Tensor: del sess const_input_op = constant_op.constant(value, dtype=dtype) split = gen_tpu_ops.xla_split_nd( const_input_op, np.prod(num_partitions), num_partitions, paddings=paddings) concat = gen_tpu_ops.xla_concat_nd(split, num_partitions, paddings) return math_ops.equal(const_input_op, concat) def create_resource_roundtrip_graph( sess: Session, value: Any, dtype: Any, num_partitions: List[int], paddings: Optional[List[int]] = None) -> Tensor: variable = resource_variable_ops.ResourceVariable( initial_value=value, dtype=dtype) sess.run(variables.variables_initializer([variable])) split = gen_tpu_ops.read_variable_xla_split_nd( variable.handle, dtype, np.prod(num_partitions), num_partitions, paddings=paddings) concat = gen_tpu_ops.assign_variable_xla_concat_nd(variable.handle, split, num_partitions, paddings) with control_dependencies([concat]): return math_ops.equal(variable.read_value(), constant_op.constant(value, dtype=dtype)) class XlaSplitConcatNDTest(xla_test.XLATestCase, parameterized.TestCase): @parameterized.named_parameters( ('1Tensor', create_tensor_roundtrip_graph, 1), ('2Tensor', create_tensor_roundtrip_graph, 2), ('3Tensor', create_tensor_roundtrip_graph, 3), ('4Tensor', create_tensor_roundtrip_graph, 4), ('5Tensor', create_tensor_roundtrip_graph, 5), ('6Tensor', create_tensor_roundtrip_graph, 6), ('7Tensor', create_tensor_roundtrip_graph, 7), ('8Tensor', create_tensor_roundtrip_graph, 8), ('1Resource', create_resource_roundtrip_graph, 1), ('2Resource', create_resource_roundtrip_graph, 2), ('3Resource', create_resource_roundtrip_graph, 3), ('4Resource', create_resource_roundtrip_graph, 4), ('5Resource', create_resource_roundtrip_graph, 5), ('6Resource', create_resource_roundtrip_graph, 6), ('7Resource', create_resource_roundtrip_graph, 7), ('8Resource', create_resource_roundtrip_graph, 8), ) def testNoPadding(self, graph_fn, rank): num_partitions = [2] * rank shape = [4] * rank value = np.arange(0, np.prod(shape)).reshape(shape) for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): validate = graph_fn(sess, value, dtype, num_partitions) result = sess.run(validate) self.assertAllEqual(result, np.broadcast_to(True, shape)) @parameterized.named_parameters( ('1Tensor', create_tensor_roundtrip_graph, 1), ('2Tensor', create_tensor_roundtrip_graph, 2), ('3Tensor', create_tensor_roundtrip_graph, 3), ('4Tensor', create_tensor_roundtrip_graph, 4), ('5Tensor', create_tensor_roundtrip_graph, 5), ('6Tensor', create_tensor_roundtrip_graph, 6), ('7Tensor', create_tensor_roundtrip_graph, 7), ('8Tensor', create_tensor_roundtrip_graph, 8), ('1Resource', create_resource_roundtrip_graph, 1), ('2Resource', create_resource_roundtrip_graph, 2), ('3Resource', create_resource_roundtrip_graph, 3), ('4Resource', create_resource_roundtrip_graph, 4), ('5Resource', create_resource_roundtrip_graph, 5), ('6Resource', create_resource_roundtrip_graph, 6), ('7Resource', create_resource_roundtrip_graph, 7), ('8Resource', create_resource_roundtrip_graph, 8), ) def testPartialPadding(self, graph_fn, rank): num_partitions = [2] * rank shape = [4] * rank value = np.arange(0, np.prod(shape)).reshape(shape) paddings = [2] * rank for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): validate = graph_fn(sess, value, dtype, num_partitions, paddings) result = sess.run(validate) self.assertAllEqual(result, np.broadcast_to(True, shape)) @parameterized.named_parameters( ('1Tensor', create_tensor_roundtrip_graph, 1), ('2Tensor', create_tensor_roundtrip_graph, 2), ('3Tensor', create_tensor_roundtrip_graph, 3), ('4Tensor', create_tensor_roundtrip_graph, 4), ('5Tensor', create_tensor_roundtrip_graph, 5), ('6Tensor', create_tensor_roundtrip_graph, 6), ('7Tensor', create_tensor_roundtrip_graph, 7), ('8Tensor', create_tensor_roundtrip_graph, 8), ('1Resource', create_resource_roundtrip_graph, 1), ('2Resource', create_resource_roundtrip_graph, 2), ('3Resource', create_resource_roundtrip_graph, 3), ('4Resource', create_resource_roundtrip_graph, 4), ('5Resource', create_resource_roundtrip_graph, 5), ('6Resource', create_resource_roundtrip_graph, 6), ('7Resource', create_resource_roundtrip_graph, 7), ('8Resource', create_resource_roundtrip_graph, 8), ) def testCompletePadding(self, graph_fn, rank): num_partitions = [2] * rank shape = [4] * rank value = np.arange(0, np.prod(shape)).reshape(shape) paddings = [4] * rank for dtype in self.numeric_types: with self.session() as sess, self.device_scope(): validate = graph_fn(sess, value, dtype, num_partitions, paddings) result = sess.run(validate) self.assertAllEqual(result, np.broadcast_to(True, shape)) if __name__ == '__main__': test.main()
40.109244
80
0.616524
3,370
28,638
4.985757
0.073887
0.04928
0.051661
0.02583
0.84109
0.776039
0.740507
0.72414
0.715272
0.690989
0
0.029746
0.259271
28,638
713
81
40.165498
0.762316
0.025002
0
0.683307
0
0
0.05451
0
0
0
0
0
0.071763
1
0.057722
false
0
0.020281
0
0.092044
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
f806b6d47c2a678d423a321959cf0a078a9de28c
11,544
py
Python
tests/test_plot/test_compositor.py
alexandreMayerowitz/playground-plums
a6be79e4c30c7abcbade5581f052a4e8035a2057
[ "MIT" ]
null
null
null
tests/test_plot/test_compositor.py
alexandreMayerowitz/playground-plums
a6be79e4c30c7abcbade5581f052a4e8035a2057
[ "MIT" ]
null
null
null
tests/test_plot/test_compositor.py
alexandreMayerowitz/playground-plums
a6be79e4c30c7abcbade5581f052a4e8035a2057
[ "MIT" ]
2
2021-02-03T12:37:53.000Z
2022-03-09T03:48:12.000Z
import numpy as np import pytest from plums.commons import TileWrapper, DataPoint, RecordCollection, Record, Annotation from plums.plot.engine.color import Color from plums.plot.engine.compositor import Compositor class TestCompositor: def test_constructor(self): # Create data points records = [ Record([[[100, 100], [100, 150], [150, 150], [150, 100], [100, 100]]], ['car'], confidence=0.9), ] records_collection = RecordCollection(*records) annotation = Annotation(records_collection) tile = TileWrapper(np.zeros((100, 100, 3)), filename='test.png') tile_2 = TileWrapper(np.zeros((200, 200, 3)), filename='test_2.png') data_point = DataPoint(tile, annotation) data_point_2 = DataPoint(tile_2, annotation) # Color engine interface simple_categorical_interface = { 'name': 'Name(Main, Secondary)', 'type': 'categorical', 'schema': { 'Ship': Color(26, 188, 156, ctype='sRGB255'), 'Car': Color(241, 196, 15, ctype='sRGB255'), 'Truck': Color(41, 128, 185, ctype='sRGB255'), 'Wind-turbines': Color(236, 240, 241, ctype='sRGB255') } } # Valid datapoints data_points_1 = [data_point] data_points_2 = [data_point, data_point_2] data_points_3 = (data_point_2, ) data_points_4 = (data_point, data_point_2) data_points_5 = [data_points_1] data_points_6 = [data_points_3] data_points_7 = (data_points_2, ) data_points_8 = (data_points_4, ) # Invalid data points inv_data_points_1 = None inv_data_points_2 = ['test'] inv_data_points_3 = ('test', data_point) # Checks Compositor(data_points=data_points_1, color_engine_interface=simple_categorical_interface) Compositor(data_points=data_points_2, color_engine_interface=simple_categorical_interface) Compositor(data_points=data_points_3, color_engine_interface=simple_categorical_interface) Compositor(data_points=data_points_4, color_engine_interface=simple_categorical_interface) Compositor(data_points=data_points_5, color_engine_interface=simple_categorical_interface) Compositor(data_points=data_points_6, color_engine_interface=simple_categorical_interface) Compositor(data_points=data_points_7, color_engine_interface=simple_categorical_interface) Compositor(data_points=data_points_8, color_engine_interface=simple_categorical_interface) with pytest.raises(AttributeError): Compositor(data_points=inv_data_points_1, color_engine_interface=simple_categorical_interface) with pytest.raises(AttributeError): Compositor(data_points=inv_data_points_2, color_engine_interface=simple_categorical_interface) with pytest.raises(AttributeError): Compositor(data_points=inv_data_points_3, color_engine_interface=simple_categorical_interface) def test_add_title(self): import PIL.Image import numpy as np # Create data points records = [ Record([[[100, 100], [100, 150], [150, 150], [150, 100], [100, 100]]], ['car'], confidence=0.9), ] records_collection = RecordCollection(*records) annotation = Annotation(records_collection) tile = TileWrapper(np.zeros((100, 100, 3)), filename='test.png') data_point = DataPoint(tile, annotation) data_points = [data_point] # Color engine interface simple_categorical_interface = { 'name': 'Name(Main, Secondary)', 'type': 'categorical', 'schema': { 'Ship': Color(26, 188, 156, ctype='sRGB255'), 'Car': Color(241, 196, 15, ctype='sRGB255'), 'Truck': Color(41, 128, 185, ctype='sRGB255'), 'Wind-turbines': Color(236, 240, 241, ctype='sRGB255') } } # Parameters width, height = (300, 300) background_color = (0, 0, 0) title_size = 25 # Init compositor _compositor = Compositor(data_points=data_points, color_engine_interface=simple_categorical_interface) image = PIL.Image.fromarray(np.zeros((width, height))) # Add title final_image = _compositor._add_title(mosaic=image, title='', background_color=background_color, title_size=title_size) assert isinstance(final_image, PIL.Image.Image) assert final_image.width == width assert final_image.height == height + 2 * title_size def test_add_legend(self): import PIL.Image import numpy as np # Create data points records = [ Record([[[100, 100], [100, 150], [150, 150], [150, 100], [100, 100]]], ['car'], confidence=0.9), ] records_collection = RecordCollection(*records) annotation = Annotation(records_collection) tile = TileWrapper(np.zeros((100, 100, 3)), filename='test.png') data_point = DataPoint(tile, annotation) data_points = [data_point] # Legend simple_categorical_interface = { 'name': 'Name(Main, Secondary)', 'type': 'categorical', 'schema': { 'Ship': Color(26, 188, 156, ctype='sRGB255'), 'Car': Color(241, 196, 15, ctype='sRGB255'), 'Truck': Color(41, 128, 185, ctype='sRGB255'), 'Wind-turbines': Color(236, 240, 241, ctype='sRGB255') } } legend_config = { 'scale': 1, 'axis': 0, 'item_margins': (10, 10), 'main_axis_align': 'start', 'minor_axis_align': 'start' } # Parameters width, height = (300, 300) background_color = (0, 0, 0) # Init compositor _compositor = Compositor(data_points=data_points, color_engine_interface=simple_categorical_interface) image = PIL.Image.fromarray(np.zeros((width, height))) # Add legend final_image = _compositor._add_legend(mosaic=image, background_color=background_color, **legend_config) # Checks (vertical mode) assert isinstance(final_image, PIL.Image.Image) assert final_image.height == height assert final_image.width > width # Checks horizontal mode legend_config['axis'] = 1 final_image = _compositor._add_legend(mosaic=image, background_color=background_color, **legend_config) assert isinstance(final_image, PIL.Image.Image) assert final_image.width == width assert final_image.height > height def test_plot(self): import PIL.Image import numpy as np # Create data points records = [ Record([[[100, 100], [100, 150], [150, 150], [150, 100], [100, 100]]], ['car'], confidence=0.9, confidence_confidence=0.9, color=Color(26, 188, 156)), ] records_collection = RecordCollection(*records) annotation = Annotation(records_collection) tile = TileWrapper(np.zeros((100, 100, 3), dtype=np.uint8), filename='test.png') data_point = DataPoint(tile, annotation) data_points = [] # Legend simple_categorical_interface = { 'name': 'Name(Main, Secondary)', 'type': 'categorical', 'schema': { 'Ship': Color(26, 188, 156, ctype='sRGB255'), 'Car': Color(241, 196, 15, ctype='sRGB255'), 'Truck': Color(41, 128, 185, ctype='sRGB255'), 'Wind-turbines': Color(236, 240, 241, ctype='sRGB255') } } kwargs = { 'plot_centers': False, 'plot_confidences': True, 'zoom': 1, 'alpha': 128, 'scale': 1, 'axis': 0, 'background_color': (48, 56, 68, 255), 'item_margins': (10, 10), 'main_axis_align': 'start', 'minor_axis_align': 'start' } # Accumulates datapoints (flattened) nb_datapoints = 15 for _ in range(nb_datapoints): data_points.append(data_point) # Parameters _compositor = Compositor(data_points=data_points, color_engine_interface=simple_categorical_interface) n_cols = 10 margins = (5, 5) # Test with neither title nor legend (use AdaptiveImagePositionGenerator) final_image = _compositor.plot(n_cols=n_cols, margins=margins, title=None, center=True, **kwargs) assert isinstance(final_image, PIL.Image.Image) assert final_image.width > n_cols * (100 + 2 * margins[0]) assert final_image.height > 2 * (100 + 2 * margins[1]) # 2 rows assert final_image.height < 3 * (100 + 2 * margins[1]) # but less than 3 rows # Test with neither title nor legend (use SimpleImagePositionGenerator) final_image = _compositor.plot(n_cols=n_cols, margins=margins, title=None, center=False, **kwargs) assert isinstance(final_image, PIL.Image.Image) assert final_image.width > n_cols * (100 + 2 * margins[0]) assert final_image.height > 2 * (100 + 2 * margins[1]) # 2 rows assert final_image.height < 3 * (100 + 2 * margins[1]) # but less than 3 rows # Nested datapoints nested_data_points = [ [data_point, data_point, data_point, data_point], [data_point, data_point, data_point], [data_point, data_point, data_point, data_point], [data_point, data_point, data_point, data_point, data_point], [data_point, data_point] ] _compositor = Compositor(data_points=nested_data_points, color_engine_interface=simple_categorical_interface) final_image = _compositor.plot(n_cols=n_cols, margins=margins, title=None, center=True, **kwargs) # Check 5 cols and 5 rows (plus each tile title) painter_title_height = 70 assert isinstance(final_image, PIL.Image.Image) assert final_image.width > 5 * (100 + 2 * margins[0]) assert final_image.height > 5 * (100 + 2 * margins[1]) assert final_image.height < 5 * (100 + painter_title_height + 2 * margins[1]) # Add title final_image_with_title = _compositor.plot(n_cols=n_cols, margins=margins, title='Test', center=True, **kwargs) assert isinstance(final_image, PIL.Image.Image) assert final_image_with_title.width == final_image.width assert final_image_with_title.height > final_image.height # Add legend and title final_image_with_legend = _compositor.plot(n_cols=n_cols, margins=margins, title='Test', center=True, **kwargs) assert isinstance(final_image, PIL.Image.Image) assert final_image_with_legend.width == final_image_with_title.width assert final_image_with_legend.height == final_image_with_title.height
41.081851
109
0.598493
1,271
11,544
5.177026
0.118804
0.083587
0.039514
0.051976
0.800304
0.769149
0.760942
0.736474
0.722796
0.713374
0
0.061569
0.296518
11,544
280
110
41.228571
0.748676
0.05544
0
0.572816
0
0
0.059511
0
0
0
0
0
0.131068
1
0.019417
false
0
0.053398
0
0.07767
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
f8888bc523d67fac4d63efe48ed5f3a8fa8fb964
47
py
Python
imagepy/tools/Standard/freeline_tol.py
dada1437903138/imagepy
65d9ce088894eef587054e04018f9d34ff65084f
[ "BSD-4-Clause" ]
1,178
2017-05-25T06:59:01.000Z
2022-03-31T11:38:53.000Z
imagepy/tools/Standard/freeline_tol.py
TomisTony/imagepy
3c378ebaf72762b94f0826a410897757ebafe689
[ "BSD-4-Clause" ]
76
2017-06-10T17:01:50.000Z
2021-12-23T08:13:29.000Z
imagepy/tools/Standard/freeline_tol.py
TomisTony/imagepy
3c378ebaf72762b94f0826a410897757ebafe689
[ "BSD-4-Clause" ]
315
2017-05-25T12:59:53.000Z
2022-03-07T22:52:21.000Z
from sciapp.action import FreeLineROI as Plugin
47
47
0.87234
7
47
5.857143
1
0
0
0
0
0
0
0
0
0
0
0
0.106383
47
1
47
47
0.97619
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
f88a4ee54488af4c7ddf2739c45ae94a840024d1
365
py
Python
test_cmpa/__init__.py
jamesabel/cmpa
64eddfb9601f4df23044faf95b99fcf960161ded
[ "MIT" ]
null
null
null
test_cmpa/__init__.py
jamesabel/cmpa
64eddfb9601f4df23044faf95b99fcf960161ded
[ "MIT" ]
null
null
null
test_cmpa/__init__.py
jamesabel/cmpa
64eddfb9601f4df23044faf95b99fcf960161ded
[ "MIT" ]
null
null
null
from .cmpa_test_paths import get_test_data_root from .cmpa_test_paths import get_test_data_root_same_single_level, get_test_data_root_different_single_level from .cmpa_test_paths import get_test_data_root_different_multiple_level, get_test_data_root_same_multiple_level from .cmpa_test_paths import get_test_data_root_unmatched from .tst_util import rmdir, mkdirs
52.142857
112
0.912329
63
365
4.650794
0.285714
0.143345
0.225256
0.307167
0.778157
0.552901
0.552901
0.552901
0.552901
0.293515
0
0
0.065753
365
6
113
60.833333
0.859238
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
f8a08e6529e60016200de870df9c0335cc595a91
61
py
Python
pos_orderline_absolute_discount/models/__init__.py
nahualventure/pos-addons
3c911c28c259967fb74e311ddcc8e6ca032c005d
[ "MIT" ]
183
2016-06-14T05:10:27.000Z
2020-02-10T04:05:20.000Z
pos_orderline_absolute_discount/models/__init__.py
nahualventure/pos-addons
3c911c28c259967fb74e311ddcc8e6ca032c005d
[ "MIT" ]
518
2016-06-08T13:44:06.000Z
2020-02-17T10:27:31.000Z
pos_orderline_absolute_discount/models/__init__.py
nahualventure/pos-addons
3c911c28c259967fb74e311ddcc8e6ca032c005d
[ "MIT" ]
369
2016-06-07T12:10:33.000Z
2020-02-12T21:16:35.000Z
from . import pos_order_model from . import pos_config_model
20.333333
30
0.836066
10
61
4.7
0.6
0.425532
0.553191
0
0
0
0
0
0
0
0
0
0.131148
61
2
31
30.5
0.886792
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
6
e43d00659cd4c29f49dd34d933b28df699ff4c5d
173
py
Python
tests/bind_tests/boolean_tests/test_operation_type.py
skrat/martinez
86db48324cb50ecb52be8ab2e4278a6d5cdd562b
[ "MIT" ]
7
2020-05-07T08:13:44.000Z
2021-12-17T07:33:51.000Z
tests/bind_tests/boolean_tests/test_operation_type.py
skrat/martinez
86db48324cb50ecb52be8ab2e4278a6d5cdd562b
[ "MIT" ]
17
2019-11-29T23:17:26.000Z
2020-12-20T15:47:17.000Z
tests/bind_tests/boolean_tests/test_operation_type.py
skrat/martinez
86db48324cb50ecb52be8ab2e4278a6d5cdd562b
[ "MIT" ]
1
2020-12-17T22:44:21.000Z
2020-12-17T22:44:21.000Z
from tests.bind_tests.hints import BoundOperationType from tests.utils import all_unique def test_basic(): assert all_unique(BoundOperationType.__members__.values())
21.625
62
0.820809
22
173
6.090909
0.681818
0.134328
0
0
0
0
0
0
0
0
0
0
0.109827
173
7
63
24.714286
0.87013
0
0
0
0
0
0
0
0
0
0
0
0.25
1
0.25
true
0
0.5
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
1
0
1
0
1
0
0
6
e463cdd0b9b35e6f7ad4ab3f09adfb6cbad562f0
1,044
py
Python
graphadv/utils/top_k.py
EdisonLeeeee/graphadv
bff372768b4082af95de9e576c7083ba42773666
[ "MIT" ]
5
2020-08-01T15:54:58.000Z
2021-12-15T10:47:45.000Z
graphadv/utils/top_k.py
EdisonLeeeee/graphadv
bff372768b4082af95de9e576c7083ba42773666
[ "MIT" ]
5
2020-11-13T19:01:52.000Z
2022-02-10T02:02:34.000Z
graphadv/utils/top_k.py
EdisonLeeeee/graphadv
bff372768b4082af95de9e576c7083ba42773666
[ "MIT" ]
2
2020-10-12T08:31:06.000Z
2020-12-14T08:24:57.000Z
import numpy as np def largest_indices(array: np.ndarray, n: int) -> tuple: """Returns the n largest indices from a numpy array. Arguments: array {np.ndarray} -- data array n {int} -- number of elements to select Returns: tuple[np.ndarray, np.ndarray] -- tuple of ndarray each ndarray is index """ flat = array.ravel() indices = np.argpartition(flat, -n)[-n:] indices = indices[np.argsort(-flat[indices])] return (flat.argsort()[-n:], ) return np.unravel_index(indices, array.shape) def least_indices(array: np.ndarray, n: int) -> tuple: """Returns the n least indices from a numpy array. Arguments: array {np.ndarray} -- data array n {int} -- number of elements to select Returns: tuple[np.ndarray, np.ndarray] -- tuple of ndarray each ndarray is index """ flat = array.ravel() indices = np.argpartition(flat, n)[:n] indices = indices[np.argsort(flat[indices])] return np.unravel_index(indices, array.shape)
33.677419
57
0.633142
140
1,044
4.692857
0.242857
0.109589
0.085236
0.063927
0.913242
0.913242
0.913242
0.809741
0.809741
0.809741
0
0
0.241379
1,044
31
58
33.677419
0.829545
0.439655
0
0.333333
0
0
0
0
0
0
0
0
0
1
0.166667
false
0
0.083333
0
0.5
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
e47ef1d1e8f9ad40165d7443c7f0e4e19ef7a965
26
py
Python
morphometry/greve/__init__.py
harvard-nrg/morphometry
8a59e84c31855c612430fa10fd69758c72c20639
[ "BSD-3-Clause" ]
null
null
null
morphometry/greve/__init__.py
harvard-nrg/morphometry
8a59e84c31855c612430fa10fd69758c72c20639
[ "BSD-3-Clause" ]
null
null
null
morphometry/greve/__init__.py
harvard-nrg/morphometry
8a59e84c31855c612430fa10fd69758c72c20639
[ "BSD-3-Clause" ]
null
null
null
from . import mri_convert
13
25
0.807692
4
26
5
1
0
0
0
0
0
0
0
0
0
0
0
0.153846
26
1
26
26
0.909091
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
e4bc3f5772050c0f81da5c9ee557468e738b7532
22,233
py
Python
Yellow_Pages_Malte/unit_tests.py
Jay4C/Web-Scraping
187679bee035dad661d983b5a8382240f820c337
[ "MIT" ]
1
2022-02-28T05:05:06.000Z
2022-02-28T05:05:06.000Z
Yellow_Pages_Malte/unit_tests.py
Jay4C/Web-Scraping
187679bee035dad661d983b5a8382240f820c337
[ "MIT" ]
23
2020-03-04T22:17:32.000Z
2021-01-21T09:35:33.000Z
Yellow_Pages_Malte/unit_tests.py
Jay4C/Web-Scraping
187679bee035dad661d983b5a8382240f820c337
[ "MIT" ]
null
null
null
from bs4 import BeautifulSoup import requests import time import pymysql.cursors import unittest class UnitTestsDataMinerYellowPagesMalta(unittest.TestCase): def test_extract_email_from_one_result(self): print("test_extract_email_from_one_result") headers = { 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103' } url = "https://www.yellow.com.mt/intercontinental-hotel-malta_hotels+san-giljan/" time.sleep(3) # Request the content of a page from the url html = requests.get(url, headers=headers) # Parse the content of html_doc soup = BeautifulSoup(html.content, 'html.parser') if soup.find("a", {'data-type': 'client-website-address'}) is not None: email = "info@" + soup.find("a", {'data-type': 'client-website-address'}) \ .text \ .replace('www.', '') \ .replace("https://", "") \ .replace("http://", "") \ .split('/')[0] print("email : " + email) else: print("no email business") def test_extract_each_email_from_one_page_of_results_for_one_activity_and_one_capital(self): print("test_extract_each_email_from_one_page_of_results_for_one_activity_and_one_capital") headers = { 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103' } url = "https://www.yellow.com.mt/hotels/malta/pageno=1" time.sleep(2) # Request the content of a page from the url html = requests.get(url, headers=headers) # Parse the content of html_doc soup = BeautifulSoup(html.content, 'html.parser') if soup.find('a', {'data-type': 'view-more'}) is not None: all_single_product = soup.find_all('a', {'data-type': 'view-more'}) for single_product in all_single_product: url = 'https://www.yellow.com.mt/' + single_product.get('href') time.sleep(3) # Request the content of a page from the url html = requests.get(url, headers=headers) # Parse the content of html_doc soup = BeautifulSoup(html.content, 'html.parser') if soup.find("a", {'data-type': 'client-website-address'}) is not None: email = "info@" + soup.find("a", {'data-type': 'client-website-address'}) \ .text \ .replace('www.', '') \ .replace("https://", "") \ .replace("http://", "") \ .split('/')[0] print("email : " + email) else: print("no email business") else: print("no div class single-product") def test_extract_each_email_from_all_pages_of_results_for_one_activity_and_one_capital(self): print("test_extract_each_email_from_all_pages_of_results_for_one_activity_and_one_capital") headers = { 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103' } activity = "hotels" city = "malta" number_of_pages = 0 url_page = "https://www.yellow.com.mt/" + activity + "/" + city time.sleep(2) html_search = requests.get(url_page, headers=headers) soup_search = BeautifulSoup(html_search.content, 'html.parser') if soup_search.find("p", {"class": "lighter"}) is not None: number_of_pages_with_coma = int(soup_search.find("p", {"class": "lighter"}) .text .split("of")[1] .replace(" ", "") .replace("Results", "") ) / 60 if int(str(number_of_pages_with_coma).split(".")[1][:1]) < 5: number_of_pages += round(number_of_pages_with_coma) + 1 print('number_of_pages : ' + str(number_of_pages)) elif int(str(number_of_pages_with_coma).split(".")[1][:1]) >= 5: number_of_pages += round(number_of_pages_with_coma) print('number_of_pages : ' + str(number_of_pages)) else: print("error pages") i_1 = 0 if number_of_pages > 1: for i in range(1, number_of_pages + 1): url = url_page + "/pageno=" + str(i) print(url) time.sleep(2) # Request the content of a page from the url html = requests.get(url, headers=headers) # Parse the content of html_doc soup = BeautifulSoup(html.content, 'html.parser') if soup.find('a', {'data-type': 'view-more'}) is not None: all_single_product = soup.find_all('a', {'data-type': 'view-more'}) for single_product in all_single_product: i_1 += 1 url = 'https://www.yellow.com.mt/' + single_product.get('href') time.sleep(3) # Request the content of a page from the url html = requests.get(url, headers=headers) # Parse the content of html_doc soup = BeautifulSoup(html.content, 'html.parser') if soup.find("a", {'data-type': 'client-website-address'}) is not None: email = "info@" + soup.find("a", {'data-type': 'client-website-address'}) \ .text \ .replace('www.', '') \ .replace("https://", "") \ .replace("http://", "") \ .split('/')[0] print(str(i_1) + " email : " + email) else: print(str(i_1) + " no email business") else: print("no div class single-product") else: if soup_search.find('a', {'data-type': 'view-more'}) is not None: all_single_product = soup_search.find_all('a', {'data-type': 'view-more'}) for single_product in all_single_product: i_1 += 1 url = 'https://www.yellow.com.mt/' + single_product.get('href') time.sleep(3) # Request the content of a page from the url html = requests.get(url, headers=headers) # Parse the content of html_doc soup = BeautifulSoup(html.content, 'html.parser') if soup.find("a", {'data-type': 'client-website-address'}) is not None: email = "info@" + soup.find("a", {'data-type': 'client-website-address'}) \ .text \ .replace('www.', '') \ .replace("https://", "") \ .replace("http://", "") \ .split('/')[0] print(str(i_1) + " email : " + email) else: print(str(i_1) + " no email business") else: print("no div class single-product") def test_extract_each_email_from_all_pages_of_results_for_all_activities_and_all_capitals(self): print("test_extract_each_email_from_all_pages_of_results_for_all_activities_and_all_capitals") headers = { 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103' } activites = [ {'id': '1', 'url': 'employment'}, # Temporary employment agencies {'id': '2', 'url': 'real+estate'}, # Real estate {'id': '3', 'url': 'recruitment'}, # Recruiter {'id': '4', 'url': 'software'}, # software {'id': '5', 'url': 'hotel'}, # hotel {'id': '6', 'url': 'social'}, # social landlord {'id': '7', 'url': 'cleaning'}, # cleaning {'id': '8', 'url': 'charity'}, # charity {'id': '9', 'url': 'financial'}, # financial {'id': '10', 'url': 'restaurant'}, # restaurant {'id': '11', 'url': 'building'}, # building {'id': '12', 'url': 'hairdresser'}, # hairdresser {'id': '13', 'url': 'florist'}, # florist {'id': '14', 'url': 'locksmith'}, # locksmith {'id': '15', 'url': 'bakery'}, # bakery {'id': '16', 'url': 'insurance'}, # insurance {'id': '17', 'url': 'pharmacy'}, # pharmacy {'id': '18', 'url': 'mover'}, # mover {'id': '19', 'url': 'electricity'}, # electricity {'id': '20', 'url': 'plumbing'}, # plumbing {'id': '21', 'url': 'security'}, # security {'id': '22', 'url': 'attorney'}, # attorney {'id': '23', 'url': 'bank'}, # bank {'id': '24', 'url': 'garage'}, # garage {'id': '25', 'url': 'dentist'}, # dentist {'id': '26', 'url': 'doctor'}, # doctor {'id': '27', 'url': 'accountant'}, # accountant {'id': '28', 'url': 'grocery'}, # grocery stores {'id': '29', 'url': 'notary'}, # notary {'id': '30', 'url': 'jewellery'}, # jewellery {'id': '31', 'url': 'tailor'}, # tailor {'id': '32', 'url': 'meat'}, # butcher {'id': '33', 'url': 'library'}, # library {'id': '34', 'url': 'architect'}, # architect {'id': '36', 'url': 'cement'}, # cement {'id': '37', 'url': 'heating'}, # heating {'id': '38', 'url': 'maritime'}, # boat {'id': '39', 'url': 'cold'}, # cold {'id': '41', 'url': 'steel'}, # steel {'id': '42', 'url': 'chemical'}, # chemical {'id': '43', 'url': 'gas'}, # gas {'id': '44', 'url': 'gold'} # gold ] capitales_du_monde = [ {'id': '778', 'nom': 'malta', 'pays': 'ile de malte'}, {'id': '779', 'nom': 'gudja', 'pays': 'ile de malte'}, {'id': '780', 'nom': 'msida', 'pays': 'ile de malte'}, {'id': '781', 'nom': 'rabat', 'pays': 'ile de malte'}, {'id': '782', 'nom': 'attard', 'pays': 'ile de malte'}, {'id': '783', 'nom': 'hamrun', 'pays': 'ile de malte'}, {'id': '784', 'nom': 'naxxar', 'pays': 'ile de malte'}, {'id': '785', 'nom': 'san-gwann', 'pays': 'ile de malte'}, {'id': '786', 'nom': 'balzan', 'pays': 'ile de malte'}, {'id': '787', 'nom': 'marsa', 'pays': 'ile de malte'}, {'id': '788', 'nom': 'paola', 'pays': 'ile de malte'}, {'id': '789', 'nom': 'santa-venera', 'pays': 'ile de malte'}, {'id': '790', 'nom': 'birkirkara', 'pays': 'ile de malte'}, {'id': '791', 'nom': 'mellieha', 'pays': 'ile de malte'}, {'id': '792', 'nom': 'pembroke', 'pays': 'ile de malte'}, {'id': '793', 'nom': 'sliema', 'pays': 'ile de malte'}, {'id': '794', 'nom': 'birzebbuga', 'pays': 'ile de malte'}, {'id': '795', 'nom': 'mgarr', 'pays': 'ile de malte'}, {'id': '796', 'nom': 'pieta', 'pays': 'ile de malte'}, {'id': '797', 'nom': 'st-julians', 'pays': 'ile de malte'}, {'id': '798', 'nom': 'floriana', 'pays': 'ile de malte'}, {'id': '799', 'nom': 'mosta', 'pays': 'ile de malte'}, {'id': '800', 'nom': 'qormi', 'pays': 'ile de malte'}, {'id': '801', 'nom': 'swieqi', 'pays': 'ile de malte'}, ] try: for capitale in capitales_du_monde: for activite in activites: activity = activite.get('url') city = capitale.get('nom') number_of_pages = 0 url_page = "https://www.yellow.com.mt/?search=" + activity + "&tag=" + city time.sleep(2) html_search = requests.get(url_page, headers=headers) soup_search = BeautifulSoup(html_search.content, 'html.parser') if soup_search.find("p", {"class": "lighter"}) is not None: number_of_pages_with_coma = int(soup_search.find("p", {"class": "lighter"}) .text .split("of")[1] .replace(" ", "") .replace("Results", "") ) / 60 if int(str(number_of_pages_with_coma).split(".")[1][:1]) < 5: number_of_pages += round(number_of_pages_with_coma) + 1 print('number_of_pages : ' + str(number_of_pages)) elif int(str(number_of_pages_with_coma).split(".")[1][:1]) >= 5: number_of_pages += round(number_of_pages_with_coma) print('number_of_pages : ' + str(number_of_pages)) else: print("error pages") i_1 = 0 if number_of_pages > 1: for i in range(1, number_of_pages + 1): url = url_page + "&pageno=" + str(i) print(url) time.sleep(2) # Request the content of a page from the url html = requests.get(url, headers=headers) # Parse the content of html_doc soup = BeautifulSoup(html.content, 'html.parser') if soup.find('a', {'data-type': 'view-more'}) is not None: all_single_product = soup.find_all('a', {'data-type': 'view-more'}) for single_product in all_single_product: i_1 += 1 url = 'https://www.yellow.com.mt/' + single_product.get('href') time.sleep(3) # Request the content of a page from the url html = requests.get(url, headers=headers) # Parse the content of html_doc soup = BeautifulSoup(html.content, 'html.parser') if soup.find("a", {'data-type': 'client-website-address'}) is not None: email = "info@" + soup.find("a", {'data-type': 'client-website-address'}) \ .text \ .replace('www.', '') \ .replace("https://", "") \ .replace("http://", "") \ .split('/')[0] print(str(i_1) + " email : " + email) try: connection = pymysql.connect( host='localhost', port=3306, user='', password='', db='contacts_professionnels', charset='utf8mb4', cursorclass=pymysql.cursors.DictCursor ) with connection.cursor() as cursor: try: sql = "INSERT INTO `emails` (" \ "`id_activite`, " \ "`id_capitale_du_monde`, " \ "`email`) VALUE (%s, %s, %s)" cursor.execute(sql, ( activite.get('id'), capitale.get('id'), email)) connection.commit() print(str(i_1) + " The record is stored : " + email) connection.close() except Exception as e: print(str(i_1) + " The record already exists : " + email + " " + str(e)) connection.close() except Exception as e: print(str(i_1) + " An error with the email : " + email + " " + str(e)) else: print(str(i_1) + " no email business") else: print("no div class single-product") else: if soup_search.find('a', {'data-type': 'view-more'}) is not None: all_single_product = soup_search.find_all('a', {'data-type': 'view-more'}) for single_product in all_single_product: i_1 += 1 url = 'https://www.yellow.com.mt/' + single_product.get('href') time.sleep(3) # Request the content of a page from the url html = requests.get(url, headers=headers) # Parse the content of html_doc soup = BeautifulSoup(html.content, 'html.parser') if soup.find("a", {'data-type': 'client-website-address'}) is not None: email = "info@" + soup.find("a", {'data-type': 'client-website-address'}) \ .text \ .replace('www.', '') \ .replace("https://", "") \ .replace("http://", "") \ .split('/')[0] print(str(i_1) + " email : " + email) try: connection = pymysql.connect( host='localhost', port=3306, user='', password='', db='contacts_professionnels', charset='utf8mb4', cursorclass=pymysql.cursors.DictCursor ) with connection.cursor() as cursor: try: sql = "INSERT INTO `emails` (" \ "`id_activite`, " \ "`id_capitale_du_monde`, " \ "`email`) VALUE (%s, %s, %s)" cursor.execute(sql, ( activite.get('id'), capitale.get('id'), email)) connection.commit() print(str(i_1) + " The record is stored : " + email) connection.close() except Exception as e: print(str(i_1) + " The record already exists : " + email + " " + str(e)) connection.close() except Exception as e: print(str(i_1) + " An error with the email : " + email + " " + str(e)) else: print(str(i_1) + " no email business") else: print("no div class single-product") except Exception as e: print("error : " + str(e)) if __name__ == '__main__': unittest.main()
48.227766
119
0.388207
1,958
22,233
4.264556
0.15475
0.026826
0.043593
0.04024
0.801796
0.75497
0.747665
0.747665
0.747665
0.747665
0
0.027926
0.478163
22,233
460
120
48.332609
0.691777
0.046732
0
0.698276
0
0.011494
0.195713
0.03019
0
0
0
0
0
1
0.011494
false
0.005747
0.014368
0
0.028736
0.103448
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
e4c49d8074a53eddd6d82d83d542d0bbf29b70c6
13,007
py
Python
src/pds_doi_service/core/input/test/input_util_test.py
NASA-PDS/pds-doi-service
b994381a5757700229865e8fe905553559684e0d
[ "Apache-2.0" ]
2
2020-11-03T19:29:11.000Z
2021-09-26T01:42:41.000Z
src/pds_doi_service/core/input/test/input_util_test.py
NASA-PDS/pds-doi-service
b994381a5757700229865e8fe905553559684e0d
[ "Apache-2.0" ]
222
2020-05-07T21:05:23.000Z
2021-12-16T22:14:54.000Z
src/pds_doi_service/core/input/test/input_util_test.py
NASA-PDS/pds-doi-service
b994381a5757700229865e8fe905553559684e0d
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python import datetime import os import unittest from os.path import abspath from os.path import join from pds_doi_service.core.entities.doi import Doi from pds_doi_service.core.entities.doi import DoiStatus from pds_doi_service.core.entities.doi import ProductType from pds_doi_service.core.entities.exceptions import InputFormatException from pds_doi_service.core.input.input_util import DOIInputUtil from pds_doi_service.core.outputs.service import DOIServiceFactory from pds_doi_service.core.outputs.service import SERVICE_TYPE_OSTI from pkg_resources import resource_filename class InputUtilTestCase(unittest.TestCase): def setUp(self): self.test_dir = resource_filename(__name__, "") self.input_dir = abspath(join(self.test_dir, os.pardir, os.pardir, os.pardir, os.pardir, os.pardir, "input")) def test_parse_dois_from_input_file(self): """Test the DOIInputUtil.parse_dois_from_input_file() method""" doi_input_util = DOIInputUtil(valid_extensions=".xml") # Test with local file i_filepath = join(self.input_dir, "bundle_in_with_contributors.xml") dois = doi_input_util.parse_dois_from_input_file(i_filepath) self.assertEqual(len(dois), 1) # Test with remote file i_filepath = "https://pds-imaging.jpl.nasa.gov/data/nsyt/insight_cameras/bundle.xml" dois = doi_input_util.parse_dois_from_input_file(i_filepath) self.assertEqual(len(dois), 1) # Test with local directory i_filepath = join(self.input_dir, "draft_dir_two_files") dois = doi_input_util.parse_dois_from_input_file(i_filepath) self.assertEqual(len(dois), 2) # Test with invalid local file path (does not exist) i_filepath = "/dev/null/file/does/not/exist" with self.assertRaises(InputFormatException): doi_input_util.parse_dois_from_input_file(i_filepath) # Test with invalid remote file path (does not exist) i_filepath = "https://pds-imaging.jpl.nasa.gov/data/nsyt/insight_cameras/fake_bundle.xml" with self.assertRaises(InputFormatException): doi_input_util.parse_dois_from_input_file(i_filepath) # Test local file with invalid extension i_filepath = join(self.input_dir, "DOI_Reserved_GEO_200318.xlsx") with self.assertRaises(InputFormatException): doi_input_util.parse_dois_from_input_file(i_filepath) # Test remote file with invalid extension doi_input_util = DOIInputUtil(valid_extensions=".csv") i_filepath = "https://pds-imaging.jpl.nasa.gov/data/nsyt/insight_cameras/bundle.xml" with self.assertRaises(InputFormatException): doi_input_util.parse_dois_from_input_file(i_filepath) def test_read_xls(self): """Test the DOIInputUtil.parse_xls_file() method""" doi_input_util = DOIInputUtil() # Test single entry spreadsheet i_filepath = join(self.input_dir, "DOI_Reserved_GEO_200318.xlsx") dois = doi_input_util.parse_xls_file(i_filepath) self.assertEqual(len(dois), 1) doi = dois[0] self.assertIsInstance(doi, Doi) self.assertEqual(doi.title, "Laboratory Shocked Feldspars Bundle") self.assertEqual(doi.status, DoiStatus.Reserved) self.assertEqual(doi.pds_identifier, "urn:nasa:pds:lab_shocked_feldspars") self.assertEqual(len(doi.authors), 1) self.assertEqual(doi.product_type, ProductType.Collection) self.assertEqual(doi.product_type_specific, "PDS4 Collection") self.assertIsInstance(doi.publication_date, datetime.datetime) # Test multi entry spreadsheet i_filepath = join(self.input_dir, "DOI_Reserved_GEO_200318_with_corrected_identifier.xlsx") dois = doi_input_util.parse_xls_file(i_filepath) self.assertEqual(len(dois), 3) self.assertTrue(all([doi.title.startswith("Laboratory Shocked Feldspars") for doi in dois])) self.assertTrue(all([doi.status == DoiStatus.Reserved for doi in dois])) self.assertTrue(all([doi.pds_identifier.startswith("urn:nasa:pds:lab_shocked_feldspars") for doi in dois])) self.assertTrue(all([len(doi.authors) == 1 for doi in dois])) self.assertTrue( all([doi.product_type == doi_input_util._parse_product_type(doi.product_type_specific) for doi in dois]) ) self.assertTrue(all([isinstance(doi.publication_date, datetime.datetime) for doi in dois])) # Test with an invalid spreadsheet (insufficient columns) i_filepath = join(self.input_dir, "DOI-reserve-broken.xlsx") try: doi_input_util.parse_xls_file(i_filepath) self.fail() # should never get here except Exception as err: self.assertIsInstance(err, InputFormatException) self.assertIn("only found 5 column(s)", str(err)) # Test with an invalid spreadsheet (wrong column names) i_filepath = join(self.input_dir, "DOI_Reserved_GEO_200318_invalid_column_names.xlsx") try: doi_input_util.parse_xls_file(i_filepath) self.fail() # should never get here except Exception as err: self.assertIsInstance(err, InputFormatException) self.assertIn("Please assign the correct column names", str(err)) # Test with a valid spreadsheet with malformed column names (that parser should correct) i_filepath = join(self.input_dir, "DOI_Reserved_GEO_200318_malformed_column_names.xlsx") dois = doi_input_util.parse_xls_file(i_filepath) self.assertEqual(len(dois), 1) # Test with an invalid spreadsheet (multiple rows with errors) i_filepath = join(self.input_dir, "DOI_Reserved_GEO_200318_with_invalid_rows.xlsx") try: doi_input_util.parse_xls_file(i_filepath) self.fail() # should never get here except Exception as err: self.assertIsInstance(err, InputFormatException) self.assertIn("Failed to parse row 1", str(err)) self.assertIn("Reason: Status value Alright is invalid", str(err)) self.assertIn("Failed to parse row 2", str(err)) self.assertIn("Reason: No value provided for title column", str(err)) self.assertIn("Failed to parse row 3", str(err)) self.assertIn("Incorrect publication_date format", str(err)) def test_read_csv(self): """Test the DOIInputUtil.parse_csv_file() method""" doi_input_util = DOIInputUtil() i_filepath = join(self.input_dir, "DOI_Reserved_GEO_200318.csv") dois = doi_input_util.parse_csv_file(i_filepath) self.assertEqual(len(dois), 3) self.assertTrue(all([doi.title.startswith("Laboratory Shocked Feldspars") for doi in dois])) self.assertTrue(all([doi.status == DoiStatus.Reserved for doi in dois])) self.assertTrue(all([doi.pds_identifier.startswith("urn:nasa:pds:lab_shocked_feldspars") for doi in dois])) self.assertTrue(all([len(doi.authors) == 1 for doi in dois])) self.assertTrue(all([doi.product_type == ProductType.Collection for doi in dois])) self.assertTrue(all([isinstance(doi.publication_date, datetime.datetime) for doi in dois])) # Test on a CSV containing a PD3 style identifier i_filepath = join(self.input_dir, "DOI_Reserved_PDS3.csv") dois = doi_input_util.parse_csv_file(i_filepath) self.assertEqual(len(dois), 1) doi = dois[0] # Make sure the PDS3 identifier was saved off as expected self.assertEqual(doi.pds_identifier, "LRO-L-MRFLRO-2/3/5-BISTATIC-V3.0") # Test with an invalid spreadsheet (insufficient columns) i_filepath = join(self.input_dir, "DOI-reserve-broken.csv") try: doi_input_util.parse_csv_file(i_filepath) self.fail() # should never get here except Exception as err: self.assertIsInstance(err, InputFormatException) self.assertIn("only found 5 column(s)", str(err)) # Test with an invalid spreadsheet (wrong column names) i_filepath = join(self.input_dir, "DOI_Reserved_GEO_200318_invalid_column_names.csv") try: doi_input_util.parse_csv_file(i_filepath) self.fail() # should never get here except Exception as err: self.assertIsInstance(err, InputFormatException) self.assertIn("Please assign the correct column names", str(err)) # Test with a valid spreadsheet with malformed column names (that parser should correct) i_filepath = join(self.input_dir, "DOI_Reserved_GEO_200318_malformed_column_names.csv") dois = doi_input_util.parse_csv_file(i_filepath) self.assertEqual(len(dois), 1) # Test with an invalid spreadsheet (multiple rows with errors) i_filepath = join(self.input_dir, "DOI_Reserved_GEO_200318_with_invalid_rows.csv") try: doi_input_util.parse_csv_file(i_filepath) self.fail() # should never get here except Exception as err: self.assertIsInstance(err, InputFormatException) self.assertIn("Failed to parse row 1", str(err)) self.assertIn("Reason: Status value Alright is invalid", str(err)) self.assertIn("Failed to parse row 2", str(err)) self.assertIn("Reason: No value provided for title column", str(err)) self.assertIn("Failed to parse row 3", str(err)) self.assertIn("Incorrect publication_date format", str(err)) def test_read_xml(self): """Test the DOIInputUtil.parse_xml_file() method""" doi_input_util = DOIInputUtil() # Test with a PDS4 label i_filepath = join(self.input_dir, "bundle_in_with_contributors.xml") dois = doi_input_util.parse_xml_file(i_filepath) self.assertEqual(len(dois), 1) doi = dois[0] self.assertIsInstance(doi, Doi) # Test with an OSTI output label i_filepath = join(self.input_dir, "DOI_Release_20200727_from_reserve.xml") dois = doi_input_util.parse_xml_file(i_filepath) self.assertEqual(len(dois), 1) doi = dois[0] self.assertIsInstance(doi, Doi) # Test with an OSTI label containing a PDS3 identifier i_filepath = join(self.input_dir, "DOI_Release_PDS3.xml") dois = doi_input_util.parse_xml_file(i_filepath) self.assertEqual(len(dois), 1) doi = dois[0] self.assertIsInstance(doi, Doi) # Make sure the PDS3 identifier was saved off as expected self.assertEqual(doi.pds_identifier, "LRO-L-MRFLRO-2/3/5-BISTATIC-V3.0") # Test with a PDS4 label that contains a UTF-8 byte order marker i_filepath = join(self.input_dir, "bundle_in_with_contributors_utf-8-bom.xml") # Run a quick sanity check to ensure the input file starts with the BOM with open(i_filepath, "r") as infile: file_contents = infile.read() file_contents_bytes = file_contents.encode() self.assertTrue(file_contents_bytes.startswith(b"\xef\xbb\xbf")) # Parse the label and ensure we still get a Doi back dois = doi_input_util.parse_xml_file(i_filepath) self.assertEqual(len(dois), 1) doi = dois[0] self.assertIsInstance(doi, Doi) def test_read_json(self): """Test the DOIInputUtil.parse_json_file() method""" doi_input_util = DOIInputUtil() # Test with the appropriate JSON label for the current service if DOIServiceFactory.get_service_type() == SERVICE_TYPE_OSTI: i_filepath = join(self.input_dir, "DOI_Release_20210216_from_reserve.json") else: i_filepath = join(self.input_dir, "DOI_Release_20210615_from_reserve.json") dois = doi_input_util.parse_json_file(i_filepath) self.assertEqual(len(dois), 1) doi = dois[0] self.assertIsInstance(doi, Doi) # Test with a JSON label that contains a UTF-8 byte order marker if DOIServiceFactory.get_service_type() == SERVICE_TYPE_OSTI: i_filepath = join(self.input_dir, "DOI_Release_20210216_from_reserve_utf-8-bom.json") else: i_filepath = join(self.input_dir, "tc-4_reserve_RADARGRAM_v2.0_utf-8-bom.json") # Run a quick sanity check to ensure the input file starts with the BOM with open(i_filepath, "r") as infile: file_contents = infile.read() file_contents_bytes = file_contents.encode() self.assertTrue(file_contents_bytes.startswith(b"\xef\xbb\xbf")) # Parse the label and ensure we still get a Doi back dois = doi_input_util.parse_json_file(i_filepath) self.assertEqual(len(dois), 1) doi = dois[0] self.assertIsInstance(doi, Doi) if __name__ == "__main__": unittest.main()
42.093851
117
0.6854
1,745
13,007
4.876218
0.127794
0.057116
0.045129
0.051945
0.872018
0.828417
0.804325
0.792925
0.731578
0.722882
0
0.015131
0.222572
13,007
308
118
42.230519
0.826345
0.147382
0
0.691099
0
0.015707
0.169659
0.090044
0
0
0
0
0.371728
1
0.031414
false
0
0.068063
0
0.104712
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
e4cc5f64f6d0c91d0d6bddb2f9968822d41190ee
147
py
Python
nbaStats/__init__.py
dsaunders11/nbaStats
edb3f6ae9a12fb994b2f25887fdf7496ede01710
[ "MIT" ]
2
2021-11-23T07:53:32.000Z
2021-12-10T04:12:16.000Z
nbaStats/__init__.py
dsaunders11/nbaStats
edb3f6ae9a12fb994b2f25887fdf7496ede01710
[ "MIT" ]
null
null
null
nbaStats/__init__.py
dsaunders11/nbaStats
edb3f6ae9a12fb994b2f25887fdf7496ede01710
[ "MIT" ]
null
null
null
from .pre_process import * from .pull import * from .prediction_set import * from .train import * from .neural_net import * from .forest import *
21
29
0.748299
21
147
5.095238
0.52381
0.46729
0
0
0
0
0
0
0
0
0
0
0.170068
147
6
30
24.5
0.877049
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
e4d2eb01fe41656222c880050c3a986d67d85184
203
py
Python
colearning/players/__init__.py
A-Malone/genetic-neural-nets
e8284cc820e6f67a52b4064d7e7320eb29629791
[ "MIT" ]
null
null
null
colearning/players/__init__.py
A-Malone/genetic-neural-nets
e8284cc820e6f67a52b4064d7e7320eb29629791
[ "MIT" ]
null
null
null
colearning/players/__init__.py
A-Malone/genetic-neural-nets
e8284cc820e6f67a52b4064d7e7320eb29629791
[ "MIT" ]
null
null
null
from base_player import BasePlayer from learning_agent_player import LearningAgentPlayer, ActionQLearningPlayer from neural_net_player import NeuralNetworkPlayer from training_player import TurretPlayer
40.6
76
0.91133
23
203
7.782609
0.608696
0.268156
0
0
0
0
0
0
0
0
0
0
0.083744
203
4
77
50.75
0.962366
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
e4dab74221b6b3c9844979a8c1c4d428e9dd9d9c
101
py
Python
pymodules/run.py
mjirik/tutorials
c2ee8578ed61de2bf3becc510c41a266f70b9084
[ "MIT" ]
null
null
null
pymodules/run.py
mjirik/tutorials
c2ee8578ed61de2bf3becc510c41a266f70b9084
[ "MIT" ]
null
null
null
pymodules/run.py
mjirik/tutorials
c2ee8578ed61de2bf3becc510c41a266f70b9084
[ "MIT" ]
1
2021-12-02T08:18:47.000Z
2021-12-02T08:18:47.000Z
""" run by: python run.py """ import mymodule.moduletwo mymodule.moduletwo.print_hello_vlkoslav()
10.1
41
0.752475
13
101
5.692308
0.769231
0.459459
0
0
0
0
0
0
0
0
0
0
0.118812
101
9
42
11.222222
0.831461
0.217822
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0.5
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
1
0
6
e4e18d577c05f158e72fba5428f0d7f08b7e2e88
18,595
py
Python
train_and_eval.py
nielsleadholm/DelayLineObjectCoding
f0fc07476db6bceb0c69060a9fe0411611708967
[ "MIT" ]
null
null
null
train_and_eval.py
nielsleadholm/DelayLineObjectCoding
f0fc07476db6bceb0c69060a9fe0411611708967
[ "MIT" ]
null
null
null
train_and_eval.py
nielsleadholm/DelayLineObjectCoding
f0fc07476db6bceb0c69060a9fe0411611708967
[ "MIT" ]
null
null
null
from brian2 import * import copy import gc import numpy as np import os import pprint import random import yaml import run_simulation from generate_input_stims import (create_underlying_spike_assemblies, plot_input_raster, generate_spikes_fixed_pairs, visualize_spike_slopes) def make_directories(dir_name, seed_iter, sub_dir_list, drift_iter='NA', jitter_iter="NA", diffusion_iter="NA"): if os.path.exists(dir_name) == 0: try: os.mkdir(dir_name) except OSError: pass if os.path.exists(dir_name + "/" + str(seed_iter) + "_drift_iter_" + str(drift_iter)) == 0: try: os.mkdir(dir_name + "/" + str(seed_iter) + "_drift_iter_" + str(drift_iter)) except OSError: pass if os.path.exists(dir_name + "/" + str(seed_iter) + "_drift_iter_" + str(drift_iter) + "/jitter_iter_" + str(jitter_iter) + "_diffusion_iter_" + str(diffusion_iter)) == 0: try: os.mkdir(dir_name + "/" + str(seed_iter) + "_drift_iter_" + str(drift_iter) + "/jitter_iter_" + str(jitter_iter) + "_diffusion_iter_" + str(diffusion_iter)) except OSError: pass [make_sub_directories(dir_name + "/" + str(seed_iter) + "_drift_iter_" + str(drift_iter) + "/jitter_iter_" + str(jitter_iter) + "_diffusion_iter_" + str(diffusion_iter), sub_name) for sub_name in sub_dir_list] def make_sub_directories(upper_name, sub_name): if os.path.exists(upper_name + "/" + sub_name) == 0: try: os.mkdir(upper_name + "/" + sub_name) except OSError: pass if __name__ == '__main__': with open('config_TranslationInvariance.yaml') as f: params = yaml.load(f, Loader=yaml.FullLoader) stimuli_params = params['stimuli_params'] network_params = params['network_params'] print("\nTraining and evaluating networks\nSetup parameters:") pprint.pprint(params) for seed_iter in stimuli_params["seeds_list"]: print("\n\n==NEW SEED== : " + str(seed_iter)) [make_directories(dir_name, seed_iter, sub_dir_list=["input_stimuli"]) for dir_name in ["figures"]] for jitter_iter in stimuli_params["jitter_std_list"]: for diffusion_iter in stimuli_params["diffusion_coef_list"]: # ============================================================================= # SETUP # ============================================================================= # Clear memory and re-assign hyper-parameter values print("GC objects before collection:") print(gc.get_count()) gc.collect() print("GC objects after collection:") print(gc.get_count()) with open('config_TranslationInvariance.yaml') as f: params = yaml.load(f, Loader=yaml.FullLoader) stimuli_params = params['stimuli_params'] network_params = params['network_params'] assert len(stimuli_params["drift_coef_list"]) == 1, "Are you sure you want to iterate over multiple drifts? Long sim times!" drift_iter = stimuli_params["drift_coef_list"][0] # Set seed for both Brian and Numpy; re-set for each hyper-parameter setting, to ensure # this is kept constant seed(seed_iter) random.seed(seed_iter) print("\nCurrent drift coefficient limit: " + str(drift_iter)) [make_directories(dir_name, seed_iter, sub_dir_list=[ "untrained_spikepair_inputs", "untrained_spikepair_inputs_classifier", "untrained_alternating_inputs", "untrained_alternating_inputs_classifier", "during_spikepair_training", "spikepair_trained_spikepair_inputs", "spikepair_trained_spikepair_inputs_classifier", "spikepair_trained_alternating_inputs", "spikepair_trained_alternating_inputs_classifier"], drift_iter=drift_iter, jitter_iter=jitter_iter, diffusion_iter=diffusion_iter, ) for dir_name in ["weights", "figures", "raw_data"]] # Simplify passing the directory path needed for saving data and figures save_dir = ("/" + str(seed_iter) + "_drift_iter_" + str(drift_iter) + "/jitter_iter_" + str(jitter_iter) + "_diffusion_iter_" + str(diffusion_iter)) # Generate the underlying spike-timing slopes that will form the basis of all the # input stimuli assembly_IDs, relative_times_vertical, relative_times_horizontal, neuron_drift_coefs_dic = create_underlying_spike_assemblies(stimuli_params, drift_iter, seed_iter, diffusion_iter) # Plot spike slopes visualize_spike_slopes(minimum(3, stimuli_params["input_layer_size"]), stimuli_params, relative_times_vertical, relative_times_horizontal, neuron_drift_coefs_dic, fig_dir=save_dir) # ============================================================================= # PRE TRAINING - UPRIGHT AND INVERTED T INPUTS # ============================================================================= # Generate pre-training spike IDs; note that due to eval_bool, these will be generated # for a different total duration than the training inputs pre_training_spike_IDs, pre_training_spike_times, spike_pair_differences = generate_spikes_fixed_pairs(stimuli_params, assembly_IDs, relative_times_vertical, relative_times_horizontal, seed_iter, jitter_iter, eval_bool=True) plot_input_raster(stimuli_params, assembly_IDs, pre_training_spike_IDs, pre_training_spike_times, neuron_drift_coefs_dic, fig_dir=save_dir, eval_bool=True, input_name="pre_training") # EVALUATE the network on the spatio-temporal input before training, and initialize weights run_params = {"weight_file" : "weights/" + save_dir + "/rand", "STDP_on_bool" : False, "input_stim" : [pre_training_spike_IDs, pre_training_spike_times], "output_dir" : "/untrained_spikepair_inputs" } run_simulation.main_run(stimuli_params, network_params, run_params, seed_iter, spike_pair_differences, save_dir, initialize_weights_bool=True) # Generate pre-STDP-training EVALUATION data for the *LINEAR CLASSIFIER* (i.e. to deteremine # the benefit of STDP for the classifier) # As "number_of_eval_presentations" is used by a variety of down-stream analysis code # to e.g. appropriately extract firing rates, temporarily set this to the correct # value for this particular data-set (number_of_classifier_assessment_presentations) # This enables evaluating the classifier on more data than it is trained on number_of_presents_backup = copy.copy(stimuli_params["number_of_eval_presentations"]) stimuli_params["number_of_eval_presentations"] = copy.copy(stimuli_params["number_of_classifier_assessment_presentations"]) classifier_pre_training_spike_IDs, classifier_pre_training_spike_times, spike_pair_differences = generate_spikes_fixed_pairs(stimuli_params, assembly_IDs, relative_times_vertical, relative_times_horizontal, seed_iter, jitter_iter, eval_bool=True) plot_input_raster(stimuli_params, assembly_IDs, classifier_pre_training_spike_IDs, classifier_pre_training_spike_times, neuron_drift_coefs_dic, fig_dir=save_dir, eval_bool=True, input_name="classifier_pre_training") # EVALUATE the network on the spatio-temporal input before training run_params = {"weight_file" : "weights/" + save_dir + "/rand", "STDP_on_bool" : False, "input_stim" : [classifier_pre_training_spike_IDs, classifier_pre_training_spike_times], "output_dir" : "/untrained_spikepair_inputs_classifier" } run_simulation.main_run(stimuli_params, network_params, run_params, seed_iter, spike_pair_differences, save_dir) # Reset the number of eval presentations stimuli_params["number_of_eval_presentations"] = copy.copy(number_of_presents_backup) # ============================================================================= # PRE TRAINING - ALTERNATING NOISE AND OBJECTS INPUTS # ============================================================================= # GENERATE spikes that alternate stimuli and noise - BEFORE any STDP training number_of_presents_backup = copy.copy(stimuli_params["number_of_train_presentations"]) # We set eval_bool to False (i.e. default) to alternate stimuli and noise, but to ensure the # number of presentations is comparable, number_of_train_presentations is temporarrily set # NB for example that information theory code will always use number_of_eval_presentations stimuli_params["number_of_train_presentations"] = copy.copy(stimuli_params["number_of_eval_presentations"]) alternating_spike_IDs_pre_train, alternating_spike_times_pre_train, spike_pair_differences = generate_spikes_fixed_pairs(stimuli_params, assembly_IDs, relative_times_vertical, relative_times_horizontal, seed_iter, jitter_iter) plot_input_raster(stimuli_params, assembly_IDs, alternating_spike_IDs_pre_train, alternating_spike_times_pre_train, neuron_drift_coefs_dic, fig_dir=save_dir, eval_bool=False, input_name="alternating_pre_train") run_params = {"weight_file" : "weights/" + save_dir + "/rand", "STDP_on_bool" : False, "input_stim" : [alternating_spike_IDs_pre_train, alternating_spike_times_pre_train], "output_dir" : "/untrained_alternating_inputs" } run_simulation.main_run(stimuli_params, network_params, run_params, seed_iter, spike_pair_differences, save_dir) stimuli_params["number_of_train_presentations"] = copy.copy(number_of_presents_backup) # As above, but for EVALUATING the LINEAR CLASSIFIER on the alternating stimuli number_of_presents_backup = copy.copy(stimuli_params["number_of_train_presentations"]) number_of_presents_backup_two = copy.copy(stimuli_params["number_of_eval_presentations"]) # We set eval_bool to False to alternate stimuli and noise, but to ensure the # number of presentations is comparable, number_of_train_presentations is temporarrily set # NB for example that information theory code will always use number_of_eval_presentations # Because main_run will use number_of_eval_presentations unless STDP is active, also set this stimuli_params["number_of_train_presentations"] = copy.copy(stimuli_params["number_of_classifier_assessment_presentations"]) # Used when generating spikes stimuli_params["number_of_eval_presentations"] = copy.copy(stimuli_params["number_of_classifier_assessment_presentations"]) # Used when running simulation classifier_alternating_spike_IDs_pre_train, classifier_alternating_spike_times_pre_train, spike_pair_differences = generate_spikes_fixed_pairs(stimuli_params, assembly_IDs, relative_times_vertical, relative_times_horizontal, seed_iter, jitter_iter) plot_input_raster(stimuli_params, assembly_IDs, classifier_alternating_spike_IDs_pre_train, classifier_alternating_spike_times_pre_train, neuron_drift_coefs_dic, fig_dir=save_dir, eval_bool=False, input_name="classifier_alternating_pre_train") run_params = {"weight_file" : "weights/" + save_dir + "/rand", "STDP_on_bool" : False, "input_stim" : [classifier_alternating_spike_IDs_pre_train, classifier_alternating_spike_times_pre_train], "output_dir" : "/untrained_alternating_inputs_classifier" } run_simulation.main_run(stimuli_params, network_params, run_params, seed_iter, spike_pair_differences, save_dir) stimuli_params["number_of_train_presentations"] = copy.copy(number_of_presents_backup) stimuli_params["number_of_eval_presentations"] = copy.copy(number_of_presents_backup_two) # ============================================================================= # STDP TRAINING # ============================================================================= # GENERATE spikes for training training_spike_IDs, training_spike_times, spike_pair_differences = generate_spikes_fixed_pairs(stimuli_params, assembly_IDs, relative_times_vertical, relative_times_horizontal, seed_iter, jitter_iter) plot_input_raster(stimuli_params, assembly_IDs, training_spike_IDs, training_spike_times, neuron_drift_coefs_dic, fig_dir=save_dir, eval_bool=False, input_name="training") # TRAIN the network on spatiotemporally structured inputs run_params = {"weight_file" : "weights/" + save_dir + "/rand", "STDP_on_bool" : True, "input_stim" : [training_spike_IDs, training_spike_times], "output_dir" : "/during_spikepair_training" } run_simulation.main_run(stimuli_params, network_params, run_params, seed_iter, spike_pair_differences, save_dir, initialize_weights_bool=False) # ============================================================================= # POST TRAINING - UPRIGHT AND INVERTED INPUTS # ============================================================================= # GENERATE the evaluation spikes, iterating (in blocks) through the possible translations # eval_bool determines how translations are sampled (i.e. in blocks as opposed to in a random order) print("\nGenerating spatio-temporal patterns for *evaluation*") eval_spike_IDs, eval_spike_times, spike_pair_differences = generate_spikes_fixed_pairs(stimuli_params, assembly_IDs, relative_times_vertical, relative_times_horizontal, seed_iter, jitter_iter, eval_bool=True) plot_input_raster(stimuli_params, assembly_IDs, eval_spike_IDs, eval_spike_times, neuron_drift_coefs_dic, fig_dir=save_dir, eval_bool=True, input_name="evaluation_spikepairs") # EVALUATE the spatio-temporally trained network on spatio-temporal inputs run_params = {"weight_file" : ("weights/" + save_dir + "/during_spikepair_training/final"), "STDP_on_bool" : False, "input_stim" : [eval_spike_IDs, eval_spike_times], "output_dir" : "/spikepair_trained_spikepair_inputs" } run_simulation.main_run(stimuli_params, network_params, run_params, seed_iter, spike_pair_differences, save_dir) # GENERATE the EVALUATION spikes for the *LINEAR CLASSIFIER*, where the network has now been trained with STDP print("\nGenerating spatio-temporal patterns for *classifier evaluation*") number_of_presents_backup = copy.copy(stimuli_params["number_of_eval_presentations"]) stimuli_params["number_of_eval_presentations"] = stimuli_params["number_of_classifier_assessment_presentations"] classifier_eval_spike_IDs, classifier_eval_spike_times, spike_pair_differences = generate_spikes_fixed_pairs(stimuli_params, assembly_IDs, relative_times_vertical, relative_times_horizontal, seed_iter, jitter_iter, eval_bool=True) plot_input_raster(stimuli_params, assembly_IDs, classifier_eval_spike_IDs, classifier_eval_spike_times, neuron_drift_coefs_dic, fig_dir=save_dir, eval_bool=True, input_name="classifier_evaluation_spikepairs") # EVALUATE the spatio-temporally trained network on spatio-temporal inputs for the Linear Classifier run_params = {"weight_file" : ("weights/" + save_dir + "/during_spikepair_training/final"), "STDP_on_bool" : False, "input_stim" : [classifier_eval_spike_IDs, classifier_eval_spike_times], "output_dir" : "/spikepair_trained_spikepair_inputs_classifier" } run_simulation.main_run(stimuli_params, network_params, run_params, seed_iter, spike_pair_differences, save_dir) stimuli_params["number_of_eval_presentations"] = copy.copy(number_of_presents_backup) # ============================================================================= # POST TRAINING - ALTERNATING NOISE AND OBJECTS INPUTS # ============================================================================= # GENERATE spikes that alternate stimuli and noise - AFTER STDP training number_of_presents_backup = copy.copy(stimuli_params["number_of_train_presentations"]) stimuli_params["number_of_train_presentations"] = copy.copy(stimuli_params["number_of_eval_presentations"]) alternating_spike_IDs, alternating_spike_times, spike_pair_differences = generate_spikes_fixed_pairs(stimuli_params, assembly_IDs, relative_times_vertical, relative_times_horizontal, seed_iter, jitter_iter) plot_input_raster(stimuli_params, assembly_IDs, alternating_spike_IDs, alternating_spike_times, neuron_drift_coefs_dic, fig_dir=save_dir, eval_bool=False, input_name="alternating_post_train") run_params = {"weight_file" : ("weights/" + save_dir + "/during_spikepair_training/final"), "STDP_on_bool" : False, "input_stim" : [alternating_spike_IDs, alternating_spike_times], "output_dir" : "/spikepair_trained_alternating_inputs" } run_simulation.main_run(stimuli_params, network_params, run_params, seed_iter, spike_pair_differences, save_dir) stimuli_params["number_of_train_presentations"] = copy.copy(number_of_presents_backup) # As above, but for EVALUATING the LINEAR CLASSIFIER on the alternating stimuli number_of_presents_backup = copy.copy(stimuli_params["number_of_train_presentations"]) number_of_presents_backup_two = copy.copy(stimuli_params["number_of_eval_presentations"]) stimuli_params["number_of_train_presentations"] = copy.copy(stimuli_params["number_of_classifier_assessment_presentations"]) stimuli_params["number_of_eval_presentations"] = copy.copy(stimuli_params["number_of_classifier_assessment_presentations"]) classifier_alternating_spike_IDs, classifier_alternating_spike_times, spike_pair_differences = generate_spikes_fixed_pairs(stimuli_params, assembly_IDs, relative_times_vertical, relative_times_horizontal, seed_iter, jitter_iter) plot_input_raster(stimuli_params, assembly_IDs, classifier_alternating_spike_IDs, classifier_alternating_spike_times, neuron_drift_coefs_dic, fig_dir=save_dir, eval_bool=False, input_name="classifier_alternating_post_train") # TRAIN the network on spatiotemporally structured inputs run_params = {"weight_file" : ("weights/" + save_dir + "/during_spikepair_training/final"), "STDP_on_bool" : False, "input_stim" : [classifier_alternating_spike_IDs, classifier_alternating_spike_times], "output_dir" : "/spikepair_trained_alternating_inputs_classifier" } run_simulation.main_run(stimuli_params, network_params, run_params, seed_iter, spike_pair_differences, save_dir) stimuli_params["number_of_train_presentations"] = copy.copy(number_of_presents_backup) stimuli_params["number_of_eval_presentations"] = copy.copy(number_of_presents_backup_two)
51.796657
176
0.726432
2,288
18,595
5.458916
0.117133
0.073899
0.048679
0.053803
0.788311
0.764131
0.746277
0.743074
0.723539
0.700641
0
0.000505
0.147782
18,595
358
177
51.941341
0.787657
0.208443
0
0.454955
1
0
0.224147
0.13854
0
0
0
0
0.004505
1
0.009009
false
0.018018
0.045045
0
0.054054
0.04955
0
0
0
null
0
0
0
0
1
1
1
1
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
6
900dd3f807b2bdaa7fde30e858bfe080d3c28b66
35
py
Python
lang/py/cookbook/v2/source/cb2_17_8_sol_2.py
ch1huizong/learning
632267634a9fd84a5f5116de09ff1e2681a6cc85
[ "MIT" ]
null
null
null
lang/py/cookbook/v2/source/cb2_17_8_sol_2.py
ch1huizong/learning
632267634a9fd84a5f5116de09ff1e2681a6cc85
[ "MIT" ]
null
null
null
lang/py/cookbook/v2/source/cb2_17_8_sol_2.py
ch1huizong/learning
632267634a9fd84a5f5116de09ff1e2681a6cc85
[ "MIT" ]
null
null
null
def empty2(*args): return None
11.666667
18
0.657143
5
35
4.6
1
0
0
0
0
0
0
0
0
0
0
0.037037
0.228571
35
2
19
17.5
0.814815
0
0
0
0
0
0
0
0
0
0
0
0
1
0.5
true
0
0
0.5
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
1
0
0
0
6
9017205bac0120df4f32bea8b25fdc22c91f57fe
8,839
py
Python
src/contracts/test/test_transfer.py
xellDart/oken_nft_ip
66b9e9b99eca606b4dcf27c3c27c5b8338d8b91d
[ "MIT" ]
9
2021-02-03T09:15:20.000Z
2022-01-20T18:43:05.000Z
src/contracts/test/test_transfer.py
xellDart/oken_nft_ip
66b9e9b99eca606b4dcf27c3c27c5b8338d8b91d
[ "MIT" ]
2
2021-11-17T15:42:00.000Z
2021-12-19T18:39:36.000Z
src/contracts/test/test_transfer.py
xellDart/oken_nft_ip
66b9e9b99eca606b4dcf27c3c27c5b8338d8b91d
[ "MIT" ]
11
2021-05-17T16:42:20.000Z
2022-02-08T09:17:45.000Z
from unittest import TestCase, main from pytezos import MichelsonRuntimeError from pytezos import ContractInterface from test.tests_utils import * class TestTransfer(TestCase): @classmethod def setUpClass(cls): project_dir = dirname(dirname(__file__)) cls.nftContract = ContractInterface.create_from(path_to_michelson_contract) cls.nftContract.address = contract_address get_storage = get_storage def test_the_owner_of_a_token_can_transfer_his_token_to_someone_else(self): # GIVEN token_id_owned_by_alice = 1 name = "Land 1" description = "" position = [0, 0] isOwned = True onSale = False land = {"name": name, "description": description, "position": position, "isOwned": isOwned, 'owner': alice, "onSale": onSale, "price": None, "id": token_id_owned_by_alice} lands = {token_id_owned_by_alice: land} transfer_transaction = [{"from_": alice, "txs": [{"to_": frank, "token_id": token_id_owned_by_alice, "amount": 1}]}] storage_with_alice_owning_a_land = self.get_storage(ledger={token_id_owned_by_alice: alice}, lands=lands) # WHEN result = self.nftContract.transfer(transfer_transaction ).result( storage=storage_with_alice_owning_a_land, source=alice ) # THEN self.assertEqual(1, len(result.big_map_diff['ledger'].keys())) self.assertEqual(frank, result.big_map_diff['ledger'][1]) self.assertFalse(alice in result.big_map_diff['ledger'].keys()) def test_the_operator_of_a_token_can_transfer_it_to_someone_else(self): # GIVEN token_id_owned_by_alice = 1 name = "Land 1" description = "" position = [0, 0] isOwned = True onSale = False land = {"name": name, "description": description, "position": position, "isOwned": isOwned, 'owner': alice, "onSale": onSale, "price": None, "id": token_id_owned_by_alice} lands = {token_id_owned_by_alice: land} transfer_transaction = [{"from_": alice, "txs": [{"to_": frank, "token_id": token_id_owned_by_alice, "amount": 1}]}] storage_with_alice_owning_a_land = self.get_storage(ledger={token_id_owned_by_alice: alice}, operators={(alice, bob, 1): None}, lands=lands) # WHEN result = self.nftContract.transfer(transfer_transaction).result( storage=storage_with_alice_owning_a_land, source=bob ) # THEN self.assertEqual(1, len(result.big_map_diff['ledger'].keys())) self.assertEqual(frank, result.big_map_diff['ledger'][1]) self.assertFalse(alice in result.big_map_diff['ledger'].keys()) def test_a_token_cannot_be_transferred_if_it_does_not_exist(self): with self.assertRaises(MichelsonRuntimeError) as unexisting_token_error: # GIVEN token_id_owned_by_alice = 1 unexisting_token_id = 6789 transfer_transaction = [{"from_": alice, "txs": [{"to_": frank, "token_id": unexisting_token_id, "amount": 1}]}] storage_with_alice_owning_a_land = self.get_storage(ledger={token_id_owned_by_alice: alice}, operators={(alice, bob, 1): None}) # WHEN result = self.nftContract.transfer(transfer_transaction).result( storage=storage_with_alice_owning_a_land, source=bob ) # THEN result_error_message = str(unexisting_token_error.exception.args[0]['with']['string']) self.assertEqual("FA2_TOKEN_UNDEFINED", result_error_message) def test_two_nft_tokens_cannot_be_transferred(self): with self.assertRaises(MichelsonRuntimeError) as insufficient_balance_error: # GIVEN token_id_owned_by_alice = 1 amount_of_tokens_to_transfer = 2 transfer_transaction = [{"from_": alice, "txs": [{"to_": frank, "token_id": token_id_owned_by_alice, "amount": amount_of_tokens_to_transfer}]}] storage_with_alice_owning_a_land = self.get_storage(ledger={token_id_owned_by_alice: alice}, operators={(alice, bob, 1): None}) # WHEN result = self.nftContract.transfer(transfer_transaction).result( storage=storage_with_alice_owning_a_land, source=bob ) # THEN result_error_message = str(insufficient_balance_error.exception.args[0]['with']['string']) self.assertEqual("FA2_INSUFFICIENT_BALANCE", result_error_message) def test_a_token_cannot_be_transferred_if_it_is_owned_by_from_address(self): with self.assertRaises(MichelsonRuntimeError) as not_owned_error: # GIVEN token_id_owned_by_alice = 1 transfer_transaction = [{"from_": pascal, "txs": [{"to_": frank, "token_id": token_id_owned_by_alice, "amount": 1}]}] storage_with_alice_owning_a_land = self.get_storage(ledger={token_id_owned_by_alice: alice}, operators={(alice, bob, 1): None}) # WHEN result = self.nftContract.transfer(transfer_transaction).result( storage=storage_with_alice_owning_a_land, source=bob ) # THEN result_error_message = str(not_owned_error.exception.args[0]['with']['string']) self.assertEqual("FA2_INSUFFICIENT_BALANCE", result_error_message) def test_a_token_can_only_be_transferred_by_its_owner_or_an_operator(self): with self.assertRaises(MichelsonRuntimeError) as not_operator_error: # GIVEN token_id_owned_by_alice = 1 transfer_transaction = [{"from_": alice, "txs": [{"to_": frank, "token_id": token_id_owned_by_alice, "amount": 1}]}] storage_with_alice_owning_a_land = self.get_storage(ledger={token_id_owned_by_alice: alice}, operators={(alice, bob, 1): None}) # WHEN self.nftContract.transfer(transfer_transaction).result( storage=storage_with_alice_owning_a_land, source=frank ) # THEN result_error_message = str(not_operator_error.exception.args[0]['with']['string']) self.assertEqual("FA2_NOT_OPERATOR", result_error_message) def test_the_call_to_transfer_entrypoint_with_0_token_to_transfer_leaves_the_ledger_unchanged(self): # GIVEN token_id_owned_by_alice = 1 number_of_tokens_to_transfer = 0 transfer_transaction = [{"from_": alice, "txs": [{"to_": frank, "token_id": token_id_owned_by_alice, "amount": number_of_tokens_to_transfer}]}] storage_with_alice_owning_a_land = self.get_storage(ledger={token_id_owned_by_alice: alice}, operators={(alice, bob, 1): None}) # WHEN result = self.nftContract.transfer(transfer_transaction).result( storage=storage_with_alice_owning_a_land, source=frank ) # THEN self.assertEqual(1, len(result.big_map_diff['ledger'].keys())) self.assertEqual({token_id_owned_by_alice: alice}, result.big_map_diff['ledger']) self.assertEqual({(alice, bob, 1): None}, result.big_map_diff['operators']) if __name__ == '__main__': main()
45.797927
104
0.547347
886
8,839
5.022573
0.133183
0.053483
0.067416
0.078652
0.825843
0.78764
0.755056
0.732584
0.712584
0.669663
0
0.008016
0.36486
8,839
192
105
46.036458
0.784646
0.012558
0
0.662252
0
0
0.054101
0.005513
0
0
0
0
0.112583
1
0.05298
false
0
0.02649
0
0.092715
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
5fba676f41d506eee97d10dbb41c214352a6d899
30
py
Python
otter/__init__.py
TylerADavis/otter-grader
9f245a13022b15a20a8340140a9084c550cfba80
[ "BSD-3-Clause" ]
null
null
null
otter/__init__.py
TylerADavis/otter-grader
9f245a13022b15a20a8340140a9084c550cfba80
[ "BSD-3-Clause" ]
null
null
null
otter/__init__.py
TylerADavis/otter-grader
9f245a13022b15a20a8340140a9084c550cfba80
[ "BSD-3-Clause" ]
null
null
null
from .notebook import Notebook
30
30
0.866667
4
30
6.5
0.75
0
0
0
0
0
0
0
0
0
0
0
0.1
30
1
30
30
0.962963
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
39a05ea84399004621f15cdeb2cbff179d5c789e
36
py
Python
login.py
Pigeast/python2
8af2f0e53cf0cc769380b6b5eac7a5dd4d0271c0
[ "MIT" ]
null
null
null
login.py
Pigeast/python2
8af2f0e53cf0cc769380b6b5eac7a5dd4d0271c0
[ "MIT" ]
null
null
null
login.py
Pigeast/python2
8af2f0e53cf0cc769380b6b5eac7a5dd4d0271c0
[ "MIT" ]
null
null
null
a = 1 b = 2 c = 3 dd = 4 efg = 6666
6
10
0.444444
10
36
1.6
1
0
0
0
0
0
0
0
0
0
0
0.380952
0.416667
36
5
11
7.2
0.380952
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
1
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
6
39c73621fa3dc7686c2a9015a8aed26dd6f0eb2d
58
py
Python
data/samplers/__init__.py
czyczyyzc/GATES
53e2e45d6cd3ec3af1f9389f30bc34c9b04265fa
[ "MIT" ]
5
2020-10-20T07:18:40.000Z
2021-05-23T14:23:21.000Z
data/samplers/__init__.py
czyczyyzc/GATES
53e2e45d6cd3ec3af1f9389f30bc34c9b04265fa
[ "MIT" ]
null
null
null
data/samplers/__init__.py
czyczyyzc/GATES
53e2e45d6cd3ec3af1f9389f30bc34c9b04265fa
[ "MIT" ]
null
null
null
from .distributed_sampler import SubsetDistributedSampler
29
57
0.913793
5
58
10.4
1
0
0
0
0
0
0
0
0
0
0
0
0.068966
58
1
58
58
0.962963
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
f2f3e5613fe0ec546dced6be4253715b29bb6a95
39
py
Python
samples/src/main/resources/datasets/python/136.py
sritchie/kotlingrad
8165ed1cd77220a5347c58cded4c6f2bcf22ee30
[ "Apache-2.0" ]
11
2020-12-19T01:19:44.000Z
2021-12-25T20:43:33.000Z
src/main/resources/datasets/python/136.py
breandan/katholic
081c39f3acc73ff41f5865563debe78a36e1038f
[ "Apache-2.0" ]
null
null
null
src/main/resources/datasets/python/136.py
breandan/katholic
081c39f3acc73ff41f5865563debe78a36e1038f
[ "Apache-2.0" ]
2
2021-01-25T07:59:20.000Z
2021-08-07T07:13:49.000Z
def unaryOp10(a): return not (+-a)
13
20
0.589744
6
39
3.833333
0.833333
0
0
0
0
0
0
0
0
0
0
0.066667
0.230769
39
2
21
19.5
0.7
0
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
6
840fe2878b5d64d18106959fc66ea4b279aec7c7
283
py
Python
constraint/__init__.py
DrKwint/safety-starter-agents
cb94e2255105e74bb8986ca6487e222c8f4bd52d
[ "MIT" ]
null
null
null
constraint/__init__.py
DrKwint/safety-starter-agents
cb94e2255105e74bb8986ca6487e222c8f4bd52d
[ "MIT" ]
null
null
null
constraint/__init__.py
DrKwint/safety-starter-agents
cb94e2255105e74bb8986ca6487e222c8f4bd52d
[ "MIT" ]
null
null
null
from constraint.constraint import Constraint #from constraint.predef_constraints import CONSTRAINT_DICT from constraint.constraints.register import get_constraint from constraint.constraint_wrapper import ConstraintEnv from constraint.bench.step_monitor import ConstraintStepMonitor
47.166667
63
0.90106
32
283
7.8125
0.4375
0.28
0.192
0
0
0
0
0
0
0
0
0
0.070671
283
5
64
56.6
0.95057
0.201413
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
8411249c90bb6281c500be91c6dfd88a3419cf06
9,314
py
Python
tests/query/v2/test_case_expression.py
nevermore3/nebula-graph
6f24438289c2b20575bc6acdf607cd2a3648d30d
[ "Apache-2.0" ]
null
null
null
tests/query/v2/test_case_expression.py
nevermore3/nebula-graph
6f24438289c2b20575bc6acdf607cd2a3648d30d
[ "Apache-2.0" ]
null
null
null
tests/query/v2/test_case_expression.py
nevermore3/nebula-graph
6f24438289c2b20575bc6acdf607cd2a3648d30d
[ "Apache-2.0" ]
null
null
null
# --coding:utf-8-- # # Copyright (c) 2020 vesoft inc. All rights reserved. # # This source code is licensed under Apache 2.0 License, # attached with Common Clause Condition 1.0, found in the LICENSES directory. from tests.common.nebula_test_suite import NebulaTestSuite from tests.common.nebula_test_suite import T_NULL, T_EMPTY import pytest class TestCaseExpression(NebulaTestSuite): @classmethod def prepare(self): self.use_nba() def cleanup(): pass def test_generic_case_expression(self): stmt = 'YIELD CASE 2 + 3 WHEN 4 THEN 0 WHEN 5 THEN 1 ELSE 2 END' resp = self.execute(stmt) self.check_resp_succeeded(resp) expected_data = [[1]] self.check_out_of_order_result(resp, expected_data) stmt = 'YIELD CASE true WHEN false THEN 0 END' resp = self.execute(stmt) self.check_resp_succeeded(resp) expected_data = [[T_NULL]] self.check_out_of_order_result(resp, expected_data) stmt = 'GO FROM "Jonathon Simmons" OVER serve YIELD $$.team.name as name, \ CASE serve.end_year > 2017 WHEN true THEN "ok" ELSE "no" END' resp = self.execute(stmt) self.check_resp_succeeded(resp) expected_data = [['Spurs', 'no'], ['Magic', 'ok'], ['76ers', 'ok']] self.check_out_of_order_result(resp, expected_data) stmt = '''GO FROM "Boris Diaw" OVER serve YIELD \ $^.player.name, serve.start_year, serve.end_year, \ CASE serve.start_year > 2006 WHEN true THEN "new" ELSE "old" END, $$.team.name''' resp = self.execute(stmt) self.check_resp_succeeded(resp) expected_data = [ ["Boris Diaw", 2003, 2005, "old", "Hawks"], ["Boris Diaw", 2005, 2008, "old", "Suns"], ["Boris Diaw", 2008, 2012, "new", "Hornets"], ["Boris Diaw", 2012, 2016, "new", "Spurs"], ["Boris Diaw", 2016, 2017, "new", "Jazz"] ] self.check_out_of_order_result(resp, expected_data) stmt = '''GO FROM "Rajon Rondo" OVER serve WHERE \ CASE serve.start_year WHEN 2016 THEN true ELSE false END YIELD \ $^.player.name, serve.start_year, serve.end_year, $$.team.name''' resp = self.execute(stmt) self.check_resp_succeeded(resp) expected_data = [ ["Rajon Rondo", 2016, 2017, "Bulls"], ] self.check_out_of_order_result(resp, expected_data) stmt = 'YIELD CASE WHEN 4 > 5 THEN 0 WHEN 3+4==7 THEN 1 ELSE 2 END' resp = self.execute(stmt) self.check_resp_succeeded(resp) expected_data = [[1]] self.check_out_of_order_result(resp, expected_data) stmt = 'YIELD CASE WHEN false THEN 0 ELSE 1 END' resp = self.execute(stmt) self.check_resp_succeeded(resp) expected_data = [[1]] self.check_out_of_order_result(resp, expected_data) stmt = 'GO FROM "Tim Duncan" OVER serve YIELD $$.team.name as name, \ CASE WHEN serve.start_year < 1998 THEN "old" ELSE "young" END' resp = self.execute(stmt) self.check_resp_succeeded(resp) expected_data = [['Spurs', 'old']] self.check_out_of_order_result(resp, expected_data) # we are not able to deduce the return type of case expression in where_clause stmt = '''GO FROM "Rajon Rondo" OVER serve WHERE \ CASE WHEN serve.start_year > 2016 THEN true ELSE false END YIELD \ $^.player.name, serve.start_year, serve.end_year, $$.team.name''' resp = self.execute(stmt) self.check_resp_succeeded(resp) expected_data = [ ["Rajon Rondo", 2018, 2019, "Lakers"], ["Rajon Rondo", 2017, 2018, "Pelicans"] ] self.check_out_of_order_result(resp, expected_data) def test_conditional_case_expression(self): stmt = 'YIELD 3 > 5 ? 0 : 1' resp = self.execute(stmt) self.check_resp_succeeded(resp) expected_data = [[1]] self.check_out_of_order_result(resp, expected_data) stmt = 'YIELD true ? "yes" : "no"' resp = self.execute(stmt) self.check_resp_succeeded(resp) expected_data = [["yes"]] self.check_out_of_order_result(resp, expected_data) stmt = 'GO FROM "Tim Duncan" OVER serve YIELD $$.team.name as name, \ serve.start_year < 1998 ? "old" : "young"' resp = self.execute(stmt) self.check_resp_succeeded(resp) expected_data = [['Spurs', 'old']] self.check_out_of_order_result(resp, expected_data) stmt = '''GO FROM "Rajon Rondo" OVER serve WHERE \ serve.start_year > 2016 ? true : false YIELD \ $^.player.name, serve.start_year, serve.end_year, $$.team.name''' resp = self.execute(stmt) self.check_resp_succeeded(resp) expected_data = [ ["Rajon Rondo", 2018, 2019, "Lakers"], ["Rajon Rondo", 2017, 2018, "Pelicans"] ] self.check_out_of_order_result(resp, expected_data) def test_generic_with_conditional_case_expression(self): stmt = '''YIELD CASE 2 + 3 WHEN CASE 1 WHEN 1 \ THEN 5 ELSE 4 END THEN 0 WHEN 5 THEN 1 ELSE 2 END''' resp = self.execute(stmt) self.check_resp_succeeded(resp) expected_data = [[0]] self.check_out_of_order_result(resp, expected_data) stmt = 'YIELD CASE 2 + 3 WHEN 5 THEN CASE 1 WHEN 1 THEN 7 ELSE 4 END ELSE 2 END' resp = self.execute(stmt) self.check_resp_succeeded(resp) expected_data = [[7]] self.check_out_of_order_result(resp, expected_data) stmt = 'YIELD CASE 2 + 3 WHEN 3 THEN 7 ELSE CASE 9 WHEN 8 THEN 10 ELSE 11 END END' resp = self.execute(stmt) self.check_resp_succeeded(resp) expected_data = [[11]] self.check_out_of_order_result(resp, expected_data) stmt = 'YIELD CASE 3 > 2 ? 1 : 0 WHEN 1 THEN 5 ELSE 4 END' resp = self.execute(stmt) self.check_resp_succeeded(resp) expected_data = [[5]] self.check_out_of_order_result(resp, expected_data) stmt = 'YIELD CASE 1 WHEN true ? 1 : 0 THEN 5 ELSE 4 END' resp = self.execute(stmt) self.check_resp_succeeded(resp) expected_data = [[5]] self.check_out_of_order_result(resp, expected_data) stmt = 'YIELD CASE 1 WHEN 1 THEN 7 > 0 ? 6 : 9 ELSE 4 END' resp = self.execute(stmt) self.check_resp_succeeded(resp) expected_data = [[6]] self.check_out_of_order_result(resp, expected_data) stmt = 'YIELD CASE 1 WHEN 2 THEN 6 ELSE false ? 4 : 9 END' resp = self.execute(stmt) self.check_resp_succeeded(resp) expected_data = [[9]] self.check_out_of_order_result(resp, expected_data) stmt = '''YIELD CASE WHEN 2 > 7 THEN false ? 3 : 8 \ ELSE CASE true WHEN false THEN 9 ELSE 11 END END''' resp = self.execute(stmt) self.check_resp_succeeded(resp) expected_data = [[11]] self.check_out_of_order_result(resp, expected_data) stmt = '''YIELD CASE 3 WHEN 4 THEN 5 ELSE 6 END \ > 11 ? 7 : CASE WHEN true THEN 8 ELSE 9 END''' resp = self.execute(stmt) self.check_resp_succeeded(resp) expected_data = [[8]] self.check_out_of_order_result(resp, expected_data) stmt = '''YIELD 8 > 11 ? CASE WHEN true THEN 8 ELSE 9 END : \ CASE 14 WHEN 8+6 THEN 0 ELSE 1 END''' resp = self.execute(stmt) self.check_resp_succeeded(resp) expected_data = [[0]] self.check_out_of_order_result(resp, expected_data) stmt = '''YIELD CASE 3 WHEN 4 THEN 5 ELSE 6 END > (3 > 2 ? 8 : 9) ? \ CASE WHEN true THEN 8 ELSE 9 END : \ CASE 14 WHEN 8+6 THEN 0 ELSE 1 END''' resp = self.execute(stmt) self.check_resp_succeeded(resp) expected_data = [[0]] self.check_out_of_order_result(resp, expected_data) stmt = '''GO FROM "Jonathon Simmons" OVER serve YIELD $$.team.name as name, \ CASE serve.end_year > 2017 WHEN true THEN 2017 < 2020 ? "ok" : "no" \ ELSE CASE WHEN false THEN "good" ELSE "bad" END END''' resp = self.execute(stmt) self.check_resp_succeeded(resp) expected_data = [['Spurs', 'bad'], ['Magic', 'ok'], ['76ers', 'ok']] self.check_out_of_order_result(resp, expected_data) stmt = '''GO FROM "Boris Diaw" OVER serve YIELD \ $^.player.name, serve.start_year, serve.end_year, \ CASE serve.start_year > 2006 ? false : true \ WHEN true THEN "new" ELSE CASE WHEN serve.start_year != 2012 THEN "old" \ WHEN serve.start_year > 2009 THEN "bad" ELSE "good" END END, $$.team.name''' resp = self.execute(stmt) self.check_resp_succeeded(resp) expected_data = [ ["Boris Diaw", 2003, 2005, "new", "Hawks"], ["Boris Diaw", 2005, 2008, "new", "Suns"], ["Boris Diaw", 2008, 2012, "old", "Hornets"], ["Boris Diaw", 2012, 2016, "bad", "Spurs"], ["Boris Diaw", 2016, 2017, "old", "Jazz"] ] self.check_out_of_order_result(resp, expected_data)
41.766816
93
0.607687
1,282
9,314
4.220749
0.108424
0.08649
0.153761
0.091296
0.858991
0.800407
0.78747
0.769913
0.765293
0.743855
0
0.047584
0.280223
9,314
222
94
41.954955
0.759547
0.029633
0
0.616216
0
0.021622
0.310963
0
0
0
0
0
0
1
0.027027
false
0.005405
0.016216
0
0.048649
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
4b75dafd98c92f65209beac53ab9e17c9f261edd
21
py
Python
example_project/some_modules/third_modules/a143.py
Yuriy-Leonov/cython_imports_limit_issue
2f9e7c02798fb52185dabfe6ce3811c439ca2839
[ "MIT" ]
null
null
null
example_project/some_modules/third_modules/a143.py
Yuriy-Leonov/cython_imports_limit_issue
2f9e7c02798fb52185dabfe6ce3811c439ca2839
[ "MIT" ]
null
null
null
example_project/some_modules/third_modules/a143.py
Yuriy-Leonov/cython_imports_limit_issue
2f9e7c02798fb52185dabfe6ce3811c439ca2839
[ "MIT" ]
null
null
null
class A143: pass
7
11
0.619048
3
21
4.333333
1
0
0
0
0
0
0
0
0
0
0
0.214286
0.333333
21
2
12
10.5
0.714286
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
6
4b925eaea17d941b61f113047f464f27acd488ad
3,288
py
Python
tests/test_argc.py
pbst/angr
a67010c8ef20166b32a14feb4611fdbbfb1f9ab3
[ "BSD-2-Clause" ]
2
2019-12-20T13:42:57.000Z
2021-07-07T09:34:46.000Z
tests/test_argc.py
pbst/angr
a67010c8ef20166b32a14feb4611fdbbfb1f9ab3
[ "BSD-2-Clause" ]
2
2018-11-13T16:19:16.000Z
2018-12-10T15:45:53.000Z
tests/test_argc.py
pbst/angr
a67010c8ef20166b32a14feb4611fdbbfb1f9ab3
[ "BSD-2-Clause" ]
null
null
null
import nose import angr import logging l = logging.getLogger("angr_tests") import os test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../binaries/tests')) def test_mips(): proj = angr.Project(test_location + "/mips/argc_decide") r_addr = 0x4006f4 s = proj.factory.entry_state(args = ['aaa'], env = {"HOME": "/home/angr"}) xpl = proj.factory.simulation_manager(s).explore(find=r_addr) nose.tools.assert_equal(len(xpl.found), 1) s = proj.factory.entry_state(args = ['aaa', 'bbb'], env ={"HOME": "/home/angr"}) xpl = proj.factory.simulation_manager(s).explore(find=r_addr) nose.tools.assert_equal(len(xpl.found), 0) def test_mipsel(): proj = angr.Project(test_location + "/mipsel/argc_decide") r_addr = 0x400708 s = proj.factory.entry_state(args = ['aaa', 'bbb'], env ={"HOME": "/home/angr"}) xpl = proj.factory.simulation_manager(s).explore(find=r_addr) nose.tools.assert_equal(len(xpl.found), 1) s = proj.factory.entry_state(args = ['aaa'], env ={"HOME": "/home/angr"}) xpl = proj.factory.simulation_manager(s).explore(find=r_addr) nose.tools.assert_equal(len(xpl.found), 0) def test_i386(): proj = angr.Project(test_location + "/i386/argc_decide") r_addr = 0x80483d4 s = proj.factory.entry_state(args = ['aaa'], env ={"HOME": "/home/angr"}) xpl = proj.factory.simulation_manager(s).explore(find=r_addr) nose.tools.assert_equal(len(xpl.found), 1) s = proj.factory.entry_state(args = ['aaa', 'bbb'], env ={"HOME": "/home/angr"}) xpl = proj.factory.simulation_manager(s).explore(find=r_addr) nose.tools.assert_equal(len(xpl.found), 0) def test_amd64(): proj = angr.Project(test_location + "/x86_64/argc_decide") r_addr = 0x4004c7 s = proj.factory.entry_state(args = ['aaa'], env ={"HOME": "/home/angr"}) xpl = proj.factory.simulation_manager(s).explore(find=r_addr) nose.tools.assert_equal(len(xpl.found), 1) s = proj.factory.entry_state(args = ['aaa', 'bbb'], env ={"HOME": "/home/angr"}) xpl = proj.factory.simulation_manager(s).explore(find=r_addr) nose.tools.assert_equal(len(xpl.found), 0) def test_arm(): proj = angr.Project(test_location + "/armel/argc_decide") r_addr = 0x1040c s = proj.factory.entry_state(args = ['aaa'], env ={"HOME": "/home/angr"}) xpl = proj.factory.simulation_manager(s).explore(find=r_addr) nose.tools.assert_equal(len(xpl.found), 1) s = proj.factory.entry_state(args = ['aaa', 'bbb'], env ={"HOME": "/home/angr"}) xpl = proj.factory.simulation_manager(s).explore(find=r_addr) nose.tools.assert_equal(len(xpl.found), 0) def test_ppc32(): proj = angr.Project(test_location + "/ppc/argc_decide") r_addr = 0x10000404 s = proj.factory.entry_state(args = ['aaa'], env ={"HOME": "/home/angr"}) xpl = proj.factory.simulation_manager(s).explore(find=r_addr) nose.tools.assert_equal(len(xpl.found), 1) s = proj.factory.entry_state(args = ['aaa', 'bbb'], env ={"HOME": "/home/angr"}) xpl = proj.factory.simulation_manager(s).explore(find=r_addr) nose.tools.assert_equal(len(xpl.found), 0) if __name__ == "__main__": test_mips() test_mipsel() test_arm() test_i386() test_amd64() test_ppc32()
33.55102
102
0.667275
482
3,288
4.358921
0.13278
0.125654
0.068539
0.097097
0.810566
0.73346
0.73346
0.73346
0.73346
0.73346
0
0.026127
0.150243
3,288
97
103
33.896907
0.725841
0
0
0.537313
0
0
0.111314
0
0
0
0.015207
0
0.179104
1
0.089552
false
0
0.059701
0
0.149254
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
4bbdcb91f2416e236841f203df5340e75b99a087
155
py
Python
coders/curso_python/pacotes/pacote_v3.py
flaviogf/Cursos
2b120dbcd24a907121f58482fdcdfa01b164872c
[ "MIT" ]
2
2021-02-20T23:50:07.000Z
2021-08-15T03:04:35.000Z
coders/curso_python/pacotes/pacote_v3.py
flaviogf/Cursos
2b120dbcd24a907121f58482fdcdfa01b164872c
[ "MIT" ]
18
2019-08-07T02:33:00.000Z
2021-03-18T22:52:38.000Z
coders/curso_python/pacotes/pacote_v3.py
flaviogf/Cursos
2b120dbcd24a907121f58482fdcdfa01b164872c
[ "MIT" ]
2
2020-09-28T13:00:09.000Z
2021-12-30T12:21:08.000Z
#!/usr/local/bin/python3 from pacote1 import modulo1 from pacote2 import modulo1 as modulo_sub print(modulo1.soma(10, 10)) print(modulo_sub.sub(10, 10))
19.375
41
0.774194
26
155
4.538462
0.576923
0.220339
0
0
0
0
0
0
0
0
0
0.101449
0.109677
155
7
42
22.142857
0.753623
0.148387
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0.5
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
1
0
6
29c191ecb8ea9f8011ee395dfe31fa52073fcc5d
205
py
Python
train_chatbot.py
DarishkaAMS/Chat_Bot-First_Tryout
f73afb337cedbab1e5f74cc71434c322af8bd058
[ "MIT" ]
null
null
null
train_chatbot.py
DarishkaAMS/Chat_Bot-First_Tryout
f73afb337cedbab1e5f74cc71434c322af8bd058
[ "MIT" ]
null
null
null
train_chatbot.py
DarishkaAMS/Chat_Bot-First_Tryout
f73afb337cedbab1e5f74cc71434c322af8bd058
[ "MIT" ]
null
null
null
import random import json import pickle import numpy as np import nltk from nltk.stem import WordNetLemmatizer from tensorflow.keras.models import Sequental from tensorflow.keras.models import Sequental
18.636364
45
0.84878
29
205
6
0.517241
0.16092
0.218391
0.287356
0.45977
0.45977
0
0
0
0
0
0
0.126829
205
10
46
20.5
0.972067
0
0
0.25
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
29e88546247c0fc4f3f54d02af1e3770deaf7b86
172
py
Python
trend/templatetags/trendfilter.py
yoonputer/Team_Project2
da4b803731bf6fddc503d881db1c76b0b3effdaa
[ "Apache-2.0" ]
1
2021-11-09T20:31:55.000Z
2021-11-09T20:31:55.000Z
trend/templatetags/trendfilter.py
power3247/Team_Project2
ad15185a193e6636cfaed94b4dd8482a45fdae78
[ "Apache-2.0" ]
null
null
null
trend/templatetags/trendfilter.py
power3247/Team_Project2
ad15185a193e6636cfaed94b4dd8482a45fdae78
[ "Apache-2.0" ]
3
2021-08-11T03:34:30.000Z
2021-10-05T05:12:01.000Z
from django import template register = template.Library() @register.filter() def ranges(abc): return abc[0] @register.filter() def rangess(abc): return abc[1]
12.285714
29
0.697674
23
172
5.217391
0.608696
0.233333
0.283333
0
0
0
0
0
0
0
0
0.014085
0.174419
172
13
30
13.230769
0.830986
0
0
0.25
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.125
0.25
0.625
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
6
29eafae30046f77471e7515d1c1f0eac69d08aab
19,472
py
Python
mix_gamma_vi/core.py
IsaacBreen/MixGammaVI
89e43f6aea4bfad3a5eb5cfb5ad63981a3adc965
[ "MIT" ]
2
2020-04-28T11:17:57.000Z
2021-01-08T09:27:54.000Z
mix_gamma_vi/core.py
IsaacBreen/MixGammaVI
89e43f6aea4bfad3a5eb5cfb5ad63981a3adc965
[ "MIT" ]
null
null
null
mix_gamma_vi/core.py
IsaacBreen/MixGammaVI
89e43f6aea4bfad3a5eb5cfb5ad63981a3adc965
[ "MIT" ]
null
null
null
import tensorflow as tf import tensorflow_probability as tfp import numpy as np import pandas as pd import scipy tfd = tfp.distributions lgamma = tf.math.lgamma polygamma = tf.math.polygamma log = tf.math.log exp = tf.math.exp reduce_sum = tf.math.reduce_sum reduce_mean = tf.math.reduce_mean dtype = tf.float64 intdtype = tf.int32 npdtype = np.float64 pi_numeric = tf.cast(np.pi, dtype) e_numeric = tf.cast(np.e, dtype) @tf.function def take_after(a, i, n): if i>a.shape[0] or i<0: i = i%a.shape[0] if i+n>a.shape[0]: return tf.concat([a[i:], a[:(n-(a.shape[0]-i))]], axis=0) else: return a[i:i+n] @tf.function def to_dtype(x): return tf.cast(x, dtype) @tf.function def _mix_gamma_vi_1(x, K=1, w0=10000., wT=1., r=1e-10, s=1e-10, c=1e-10, d=1e-10, eps=1, BATCH_SIZE=250, MAX_ITERATIONS=10000, MIN_ITERATIONS=0, BATCH_SIZE_MULTIPLIER=100, MIN_WARMUP=0, MAX_WARMUP=10000, TOLERANCE=1/10000, ELBO_TICK=5, RUNNING_ELBO_SIZE=10, AHAT_STEPS=2, VERBOSE=False, RETURN_HISTORY=False, RETURN_DTYPE=tf.float64): # If return datatype is not specified, let it be the same as the input datatype for x if RETURN_DTYPE is None: RETURN_DTYPE = x.dtype # Convert arguments to TensorFlow objects N = x.shape[0] x,w0,wT,r,s,c,d,eps = [tf.cast(var, dtype) for var in [x,w0,wT,r,s,c,d,eps]] K_float = to_dtype(K) x = tf.reshape(x, (-1,1)) # Calculate the prior strength discount factor k w = w0 k=(w0/wT)**(1/MAX_ITERATIONS) # Set initial values elbo = tf.constant(0, dtype) x_mean = tf.math.reduce_mean(x) x_var = tf.math.reduce_mean( (x - x_mean)**2 ) start_means = tf.reshape(tf.linspace(tf.maximum(-1.5*x_var**0.5 + x_mean, 1e-3), 1.5*x_var**0.5 + x_mean, K) , (1,K)) start_vars = tf.fill((1,K), x_var/K_float**2) zeta = tf.cast(tf.fill((1,K), N/K_float), dtype=dtype) + w gamma = start_means*10000 lambda_ = start_vars*10000 ahat = start_means**2/start_vars sigma_sq = 1/(polygamma(to_dtype(1), ahat)*(s + N/K)) i = tf.constant(0, intdtype) # Setup data-structures to store values if RETURN_HISTORY is True if RETURN_HISTORY: zeta_history = tf.zeros((MAX_ITERATIONS,K), dtype) ahat_history = tf.zeros((MAX_ITERATIONS,K), dtype) sigma_sq_history = tf.zeros((MAX_ITERATIONS,K), dtype) gamma_history = tf.zeros((MAX_ITERATIONS,K), dtype) lambda_history = tf.zeros((MAX_ITERATIONS,K), dtype) elbo_history = tf.zeros(MAX_ITERATIONS, dtype) else: zeta_history = tf.constant(0) ahat_history = tf.constant(0) sigma_sq_history = tf.constant(0) gamma_history = tf.constant(0) lambda_history = tf.constant(0) elbo_history = tf.constant(0) running_elbo = tf.zeros(RUNNING_ELBO_SIZE*2) x_shuffled = tf.random.shuffle(x) logx = log(x) logx_shuffled = log(x_shuffled) j = tf.constant(0, intdtype) # Some counters and a flag BREAK_COUNTER = tf.constant(0) ELBO_COUNTER = tf.constant(0) CAVI_PHASE = False # Begin variational inference for i in tf.range(start=0, limit=MAX_ITERATIONS-1): # Discount the prior strength w = w/k # Resample the data if (j+1)*BATCH_SIZE>x.shape[0]: x_shuffled = tf.random.shuffle(x) logx_shuffled = log(x_shuffled) j = tf.constant(0) xb = x_shuffled[j*BATCH_SIZE:(j+1)*BATCH_SIZE] logxb = logx_shuffled[j*BATCH_SIZE:(j+1)*BATCH_SIZE] j += 1 # Compute q_{i,j} q = polygamma(to_dtype(0), zeta) - polygamma(to_dtype(0), K_float*w+N) + ahat*(polygamma(to_dtype(0), gamma) - log(lambda_)) \ - lgamma(ahat) - 1/2*sigma_sq*polygamma(to_dtype(1), ahat) + (ahat-1)*logxb - gamma/lambda_*xb q = q - tf.reshape(tf.math.reduce_max(q, 1), (-1,1)) q = tf.math.exp(q) q = q/tf.reshape(tf.reduce_sum(q, -1), (-1,1)) # Calculate and store some often-used values batchsize_correction = tf.cast(N/BATCH_SIZE, dtype) q_summed_over_data = batchsize_correction*tf.reshape(tf.reduce_sum(q, 0), (1,-1)) q_times_x_summed_over_data = batchsize_correction*tf.reshape(tf.reduce_sum(q*xb, 0), (1,-1)) q_times_log_x_summed_over_data = batchsize_correction*tf.reshape(tf.reduce_sum(q*logxb, 0), (1,-1)) # Variational updates for zeta, gamma (here called gamma) and lambda (here called lambda 2) zeta = (1-eps)*zeta + eps*(w + q_summed_over_data) gamma = (1-eps)*gamma + eps*(c + ahat*q_summed_over_data) lambda_ = (1-eps)*lambda_ + eps*(d + q_times_x_summed_over_data) sigma_sq = (1-eps)*sigma_sq + eps*1/(polygamma(to_dtype(1), ahat)*(s + N/K)) # Newton-Raphson algorithm for the variational distribution of alpha ahat_nr = ahat for _ in tf.range(AHAT_STEPS): ahat_nr = ahat_nr + ( (polygamma(to_dtype(0),gamma) - log(lambda_))*q_summed_over_data + q_times_log_x_summed_over_data + r \ - (q_summed_over_data + s)*(polygamma(to_dtype(0), ahat_nr) + 1/2*sigma_sq * polygamma(to_dtype(2), ahat_nr))) \ /( (q_summed_over_data+s)*(polygamma(to_dtype(1), ahat_nr) + 1/2*sigma_sq*polygamma(to_dtype(3), ahat_nr)) ) ahat_nr = tf.abs(ahat_nr) ahat_nr = tf.clip_by_value(ahat_nr, clip_value_min=1e-30, clip_value_max=1e+30) ahat = (1-eps)*ahat + eps*ahat_nr # Store values if RETURN_HISTORY: zeta_history = tf.tensor_scatter_nd_update(zeta_history, [[i]], zeta) ahat_history = tf.tensor_scatter_nd_update(ahat_history, [[i]], ahat) sigma_sq_history = tf.tensor_scatter_nd_update(sigma_sq_history, [[i]], sigma_sq) gamma_history = tf.tensor_scatter_nd_update(gamma_history, [[i]], gamma) lambda_history = tf.tensor_scatter_nd_update(lambda_history, [[i]], lambda_) # Calculate the ELBO every ELBO_TICK iterations if i%ELBO_TICK==0: elbo_constants = -tf.cast(K_float*lgamma(w) - lgamma(w*K_float), dtype=dtype) E_joint_log_prob = elbo_constants + reduce_sum((w+q_summed_over_data-1)*(polygamma(to_dtype(0), zeta) \ - tf.cast(polygamma(to_dtype(0), K_float*w+N), dtype=dtype)) + c*tf.cast(log(d), dtype=dtype) \ - lgamma(c) + (c-1 + ahat*q_summed_over_data)*( polygamma(to_dtype(0), gamma) - log(lambda_) ) \ - d*gamma/lambda_ + r*ahat - (lgamma(ahat) + 1/2*sigma_sq*polygamma(to_dtype(1), ahat))*(s+q_summed_over_data) \ + (ahat-1)*q_times_log_x_summed_over_data - gamma/lambda_*q_times_x_summed_over_data) entropy = reduce_sum((gamma - log(lambda_) + lgamma(gamma)) + (1-gamma)*polygamma(to_dtype(0), gamma) \ + 1/2*log(2*pi_numeric*e_numeric*sigma_sq) + lgamma(zeta) \ + zeta*polygamma(to_dtype(0), reduce_sum(zeta)) - (zeta-1)*polygamma(to_dtype(0), zeta)) \ - lgamma(reduce_sum(zeta)) - K_float*polygamma(to_dtype(0), reduce_sum(zeta)) elbo = E_joint_log_prob + entropy # Store ELBO if RETURN_HISTORY: elbo_history = tf.tensor_scatter_nd_update(elbo_history, [[ELBO_COUNTER]], [elbo]) # Update an ELBO matrix to calculate a running mean of the ELBO running_elbo = tf.tensor_scatter_nd_update(running_elbo, [[ELBO_COUNTER%(RUNNING_ELBO_SIZE*2)]], [elbo]) if BREAK_COUNTER>RUNNING_ELBO_SIZE*2 and i>MIN_WARMUP or i>MAX_WARMUP: # Calculate the graident of the running mean of the elbo elbo_mean1 = reduce_mean(take_after(running_elbo, ELBO_COUNTER%(RUNNING_ELBO_SIZE*2), RUNNING_ELBO_SIZE)) elbo_mean2 = reduce_mean(take_after(running_elbo, ELBO_COUNTER%(RUNNING_ELBO_SIZE*2)+RUNNING_ELBO_SIZE, RUNNING_ELBO_SIZE)) gradient = (elbo_mean1 - elbo_mean2)/RUNNING_ELBO_SIZE/elbo_mean1 if gradient<TOLERANCE: if BATCH_SIZE < N or not CAVI_PHASE: # Increase batch size CAVI_PHASE = True BATCH_SIZE = tf.minimum(BATCH_SIZE*BATCH_SIZE_MULTIPLIER, N) BREAK_COUNTER = tf.cast(tf.constant(RUNNING_ELBO_SIZE/2), tf.int32) eps=tf.constant(1., dtype) w = tf.constant(1., dtype) k = tf.constant(1., dtype) elif i>MIN_ITERATIONS: # Done break ELBO_COUNTER = ELBO_COUNTER + 1 BREAK_COUNTER = BREAK_COUNTER + 1 if RETURN_HISTORY: return [tf.cast(var[:i], RETURN_DTYPE) for var in \ [zeta_history, ahat_history, sigma_sq_history, gamma_history, lambda_history]] + [elbo_history[:ELBO_COUNTER],] else: return [tf.cast(var, RETURN_DTYPE) for var in [zeta, ahat, sigma_sq, gamma, lambda_, elbo]] @tf.function def _mix_gamma_vi_2(x, K=1, w0=10000., wT=1., r=1e-10, s=1e-10, xi=1e-10, tau=1e-10, eps=1, BATCH_SIZE=250, MAX_ITERATIONS=10000, MIN_ITERATIONS=0, BATCH_SIZE_MULTIPLIER=100, MIN_WARMUP=0, MAX_WARMUP=10000, TOLERANCE=1/10000, ELBO_TICK=5, RUNNING_ELBO_SIZE=10, AHAT_STEPS=2, VERBOSE=False, RETURN_HISTORY=False, RETURN_DTYPE=None): # If return datatype is not specified, let it be the same as the input datatype for x if RETURN_DTYPE is None: RETURN_DTYPE = x.dtype # Convert arguments to TensorFlow objects N = x.shape[0] x,w0,wT,r,s,xi,tau,eps = [tf.cast(var, dtype) for var in [x,w0,wT,r,s,xi,tau,eps]] K_float = to_dtype(K) x = tf.reshape(x, (-1,1)) # Calculate the prior strength discount factor k w = w0 k=(w0/wT)**(1/MAX_ITERATIONS) # Set initial values elbo = tf.constant(0, dtype) x_mean = tf.math.reduce_mean(x) x_var = tf.math.reduce_mean( (x - x_mean)**2 ) start_means = tf.reshape(tf.linspace(tf.maximum(-1.5*x_var**0.5 + x_mean, 1e-3), 1.5*x_var**0.5 + x_mean, K) , (1,K)) start_vars = tf.fill((1,K), x_var/K_float**2) zeta = tf.cast(tf.fill((1,K), N/K_float), dtype=dtype) + w gamma = tf.cast(tf.fill((1,K), 1.), dtype=dtype)*10000 lambda_ = start_means*10000 ahat = start_means**2/start_vars sigma_sq = tf.cast(tf.fill((1,K), 1e-5), dtype) i = tf.constant(0, intdtype) # Setup data-structures to store values if RETURN_HISTORY is True, otherwise set dummy values if RETURN_HISTORY: zeta_history = tf.zeros((MAX_ITERATIONS,K), dtype) ahat_history = tf.zeros((MAX_ITERATIONS,K), dtype) sigma_sq_history = tf.zeros((MAX_ITERATIONS,K), dtype) gamma_history = tf.zeros((MAX_ITERATIONS,K), dtype) lambda_history = tf.zeros((MAX_ITERATIONS,K), dtype) elbo_history = tf.zeros(MAX_ITERATIONS, dtype) else: zeta_history = tf.constant(0) ahat_history = tf.constant(0) sigma_sq_history = tf.constant(0) gamma_history = tf.constant(0) lambda_history = tf.constant(0) elbo_history = tf.constant(0) running_elbo = tf.zeros(RUNNING_ELBO_SIZE*2) x_shuffled = tf.random.shuffle(x) logx = log(x) logx_shuffled = log(x_shuffled) j = tf.constant(0, intdtype) # Some counters and a flag BREAK_COUNTER = tf.constant(0) ELBO_COUNTER = tf.constant(0) CAVI_PHASE = False # Begin variational inference for i in tf.range(start=0, limit=MAX_ITERATIONS-1): # Discount the prior strength w = w/k # Resample the data if (j+1)*BATCH_SIZE>x.shape[0]: x_shuffled = tf.random.shuffle(x) logx_shuffled = log(x_shuffled) j = tf.constant(0) xb = x_shuffled[j*BATCH_SIZE:(j+1)*BATCH_SIZE] logxb = logx_shuffled[j*BATCH_SIZE:(j+1)*BATCH_SIZE] j += 1 # Compute q_{i,j} q = polygamma(to_dtype(0), zeta) - polygamma(to_dtype(0), K_float*w+N) + 1/2*log(ahat) - sigma_sq/(4*ahat**2) \ + ahat*(polygamma(to_dtype(0), gamma) - log(lambda_) + 1) + (ahat-1)*logxb - ahat*(gamma/lambda_)*xb q = q - tf.reshape(tf.math.reduce_max(q, 1), (-1,1)) q = tf.math.exp(q) # print(q.shape) q = q/tf.reshape(tf.reduce_sum(q, -1), (-1,1)) # Calculate and store some often-used values batchsize_correction = tf.cast(N/BATCH_SIZE, dtype) q_summed_over_data = batchsize_correction*tf.reshape(tf.reduce_sum(q, 0), (1,-1)) q_times_x_summed_over_data = batchsize_correction*tf.reshape(tf.reduce_sum(q*xb, 0), (1,-1)) q_times_log_x_summed_over_data = batchsize_correction*tf.reshape(tf.reduce_sum(q*logxb, 0), (1,-1)) # Variational updates for zeta, gamma (here called gamma), lambda (here called lambda 2), and sigma_sq zeta = (1-eps)*zeta + eps*(w + q_summed_over_data) gamma = (1-eps)*gamma + eps*(xi + ahat*q_summed_over_data) lambda_ = (1-eps)*lambda_ + eps*(tau + ahat*q_times_x_summed_over_data) sigma_sq = (1-eps)*sigma_sq + eps*1/( s*polygamma(to_dtype(1), ahat) + 1/(2*ahat**2)*q_summed_over_data) # Newton-Raphson algorithm for the variational distribution of alpha ahat_nr = ahat for _ in tf.range(AHAT_STEPS): polygamma_0_ahat = polygamma(to_dtype(0), ahat_nr) polygamma_1_ahat = polygamma(to_dtype(1), ahat_nr) polygamma_2_ahat = polygamma(to_dtype(2), ahat_nr) polygamma_3_ahat = polygamma(to_dtype(3), ahat_nr) ahat_nr = ahat_nr - ( (polygamma(to_dtype(0), gamma) - log(lambda_))*q_summed_over_data \ + r + q_times_log_x_summed_over_data - q_times_x_summed_over_data*gamma/lambda_ \ + ( - sigma_sq/(2*ahat_nr**2) + 1 + log(ahat_nr) - polygamma_0_ahat \ - 1/2*sigma_sq*polygamma_2_ahat)*q_summed_over_data - s*(polygamma_0_ahat + 1/2*sigma_sq*polygamma_2_ahat)) \ /( ( 1/ahat_nr - polygamma_1_ahat - 1/2*sigma_sq*polygamma_3_ahat)*q_summed_over_data \ - s*(polygamma_1_ahat + 1/2*sigma_sq*polygamma_3_ahat)) ahat_nr = tf.abs(ahat_nr) ahat = (1-eps)*ahat + eps*ahat_nr # Store values if RETURN_HISTORY: zeta_history = tf.tensor_scatter_nd_update(zeta_history, [[i]], zeta) ahat_history = tf.tensor_scatter_nd_update(ahat_history, [[i]], ahat) sigma_sq_history = tf.tensor_scatter_nd_update(sigma_sq_history, [[i]], sigma_sq) gamma_history = tf.tensor_scatter_nd_update(gamma_history, [[i]], gamma) lambda_history = tf.tensor_scatter_nd_update(lambda_history, [[i]], lambda_) # Calculate the ELBO every ELBO_TICK iterations if i%ELBO_TICK==0: elbo_constants = -tf.cast(K_float*lgamma(w) - lgamma(w*K_float), dtype=dtype) E_joint_log_prob = elbo_constants + reduce_sum((w+q_summed_over_data-1)*(polygamma(to_dtype(0), zeta) \ - tf.cast(polygamma(to_dtype(0), K_float*w+N), dtype=dtype)) + xi*tf.cast(log(tau), dtype=dtype) - lgamma(xi) \ + (1 - xi - ahat*q_summed_over_data)*(log(lambda_) - polygamma(to_dtype(0), gamma)) \ - tau*gamma/lambda_ + (-1/2*log(2*pi_numeric) + 1/2*log(ahat) - sigma_sq/(4*ahat**2) + ahat)*q_summed_over_data \ + (ahat-1)*q_times_log_x_summed_over_data - ahat*gamma/lambda_*q_times_x_summed_over_data) entropy = reduce_sum((gamma + log(lambda_) + lgamma(gamma)) - (gamma+1)*polygamma(to_dtype(0), gamma) \ + 1/2*log(2*pi_numeric*e_numeric*sigma_sq) + lgamma(zeta) \ + zeta*polygamma(to_dtype(0), reduce_sum(zeta)) - (zeta-1)*polygamma(to_dtype(0), zeta)) \ - lgamma(reduce_sum(zeta)) - K_float*polygamma(to_dtype(0), reduce_sum(zeta)) elbo = E_joint_log_prob + entropy # Store ELBO if RETURN_HISTORY: elbo_history = tf.tensor_scatter_nd_update(elbo_history, [[ELBO_COUNTER]], [elbo]) # Update an ELBO matrix to calculate a running mean of the ELBO running_elbo = tf.tensor_scatter_nd_update(running_elbo, [[ELBO_COUNTER%(RUNNING_ELBO_SIZE*2)]], [elbo]) if BREAK_COUNTER>RUNNING_ELBO_SIZE*2 and i>MIN_WARMUP or i>MAX_WARMUP: # Calculate the graident of the running mean of the elbo elbo_mean1 = reduce_mean(take_after(running_elbo, ELBO_COUNTER%(RUNNING_ELBO_SIZE*2), RUNNING_ELBO_SIZE)) elbo_mean2 = reduce_mean(take_after(running_elbo, ELBO_COUNTER%(RUNNING_ELBO_SIZE*2)+RUNNING_ELBO_SIZE, RUNNING_ELBO_SIZE)) gradient = (elbo_mean1 - elbo_mean2)/RUNNING_ELBO_SIZE/elbo_mean1 if gradient<TOLERANCE: if BATCH_SIZE < N or not CAVI_PHASE: # Increase batch size CAVI_PHASE = True BATCH_SIZE = tf.minimum(BATCH_SIZE*BATCH_SIZE_MULTIPLIER, N) BREAK_COUNTER = tf.cast(tf.constant(RUNNING_ELBO_SIZE/2), tf.int32) eps=tf.constant(1., dtype) w = tf.constant(1., dtype) k = tf.constant(1., dtype) elif i>MIN_ITERATIONS: # Done break ELBO_COUNTER = ELBO_COUNTER + 1 BREAK_COUNTER = BREAK_COUNTER + 1 if RETURN_HISTORY: return [tf.cast(var[:i], RETURN_DTYPE) for var in \ [zeta_history, ahat_history, sigma_sq_history, gamma_history, lambda_history]] + [elbo_history[:ELBO_COUNTER],] else: return [tf.cast(var, RETURN_DTYPE) for var in [zeta, ahat, sigma_sq, gamma, lambda_, elbo]] parameter_names = ["zeta", "ahat", "sigma_sq", "gamma", "lambda_", "elbo"] class mix_gamma_vi: def __init__(self, x, K=1, parameterisation="mean-shape", **kwargs): self.parameterisation = parameterisation if parameterisation=="mean-shape": self.parameters = _mix_gamma_vi_2(x, K=K, **kwargs) elif parameterisation=="shape-rate": self.parameters = _mix_gamma_vi_1(x, K=K, **kwargs) else: stop("parameterisation parameter not recognized. Choose parameterisation=\"mean-shape\" (recommended) or parameterisation=\"shape-rate\"") def parameter_dict(self): return dict(zip(parameter_names, self.parameters)) def distribution(self): zeta, ahat, sigma_sq, gamma, lambda_, elbo = self.parameters if self.parameterisation=="mean-shape": dist = tfd.JointDistributionNamed(dict( pi = tfd.Dirichlet(zeta), alpha = tfd.Normal(ahat, sigma_sq**0.5), mu = tfd.InverseGamma(gamma, lambda_))) else: dist = tfd.JointDistributionNamed(dict( pi = tfd.Dirichlet(zeta), alpha = tfd.Normal(ahat, sigma_sq**0.5), beta = tfd.InverseGamma(gamma, lambda_))) return dist
44.969977
150
0.617348
2,860
19,472
3.946853
0.076923
0.023565
0.04961
0.036145
0.879872
0.864724
0.840539
0.822023
0.806077
0.789865
0
0.029177
0.258987
19,472
432
151
45.074074
0.753136
0.08335
0
0.697279
0
0
0.009887
0
0
0
0
0
0
1
0.02381
false
0
0.017007
0.006803
0.07483
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
d9b4fac82a9e216491d750115edb71a036885cf6
261,030
py
Python
instances/passenger_demand/pas-20210422-1717-int16e/74.py
LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure
bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11
[ "BSD-3-Clause" ]
null
null
null
instances/passenger_demand/pas-20210422-1717-int16e/74.py
LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure
bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11
[ "BSD-3-Clause" ]
null
null
null
instances/passenger_demand/pas-20210422-1717-int16e/74.py
LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure
bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11
[ "BSD-3-Clause" ]
null
null
null
""" PASSENGERS """ numPassengers = 30505 passenger_arriving = ( (8, 6, 10, 8, 6, 1, 3, 1, 4, 2, 0, 0, 0, 7, 0, 1, 5, 11, 4, 4, 1, 1, 1, 0, 2, 0), # 0 (5, 6, 3, 8, 7, 1, 4, 1, 5, 0, 1, 2, 0, 12, 8, 4, 3, 9, 6, 4, 5, 5, 1, 1, 1, 0), # 1 (12, 8, 7, 6, 3, 1, 2, 2, 1, 3, 0, 0, 0, 9, 9, 5, 4, 10, 10, 6, 2, 4, 2, 2, 2, 0), # 2 (14, 17, 8, 8, 9, 4, 1, 1, 6, 1, 1, 1, 0, 13, 11, 5, 2, 6, 5, 4, 1, 4, 5, 2, 0, 0), # 3 (11, 5, 10, 7, 9, 2, 3, 2, 3, 1, 2, 2, 0, 14, 5, 11, 3, 3, 10, 2, 3, 6, 3, 0, 1, 0), # 4 (6, 6, 14, 5, 4, 1, 4, 5, 3, 4, 1, 2, 0, 17, 6, 10, 10, 5, 7, 10, 3, 1, 1, 1, 1, 0), # 5 (13, 10, 10, 9, 8, 5, 8, 4, 3, 0, 2, 0, 0, 12, 9, 10, 6, 9, 2, 6, 2, 1, 5, 1, 0, 0), # 6 (10, 9, 11, 10, 9, 4, 4, 5, 4, 1, 2, 1, 0, 13, 9, 7, 9, 7, 8, 6, 6, 1, 3, 3, 0, 0), # 7 (17, 13, 9, 11, 12, 3, 7, 3, 2, 4, 3, 1, 0, 19, 9, 8, 14, 6, 2, 7, 2, 3, 4, 1, 0, 0), # 8 (11, 14, 14, 13, 16, 7, 5, 6, 3, 7, 1, 0, 0, 10, 12, 8, 6, 9, 7, 6, 5, 5, 5, 1, 3, 0), # 9 (16, 11, 11, 16, 12, 4, 2, 5, 8, 3, 1, 0, 0, 10, 11, 11, 8, 7, 8, 5, 0, 3, 6, 2, 1, 0), # 10 (13, 14, 12, 9, 8, 8, 5, 4, 5, 6, 1, 1, 0, 12, 12, 7, 7, 10, 12, 9, 3, 4, 2, 2, 0, 0), # 11 (17, 19, 10, 11, 11, 7, 6, 8, 4, 0, 0, 0, 0, 11, 11, 13, 10, 10, 9, 4, 6, 7, 8, 2, 1, 0), # 12 (17, 15, 9, 17, 6, 6, 2, 8, 5, 7, 3, 1, 0, 15, 5, 9, 12, 9, 9, 4, 3, 3, 6, 4, 1, 0), # 13 (19, 20, 7, 11, 12, 7, 9, 8, 6, 3, 3, 0, 0, 16, 14, 13, 10, 16, 5, 3, 6, 4, 3, 1, 1, 0), # 14 (10, 19, 9, 14, 6, 6, 8, 3, 4, 1, 3, 1, 0, 12, 13, 14, 10, 15, 5, 9, 6, 6, 6, 4, 3, 0), # 15 (20, 12, 14, 17, 13, 3, 4, 7, 7, 1, 1, 2, 0, 9, 18, 7, 5, 9, 8, 6, 6, 6, 6, 5, 5, 0), # 16 (19, 19, 11, 13, 10, 0, 5, 8, 7, 6, 2, 1, 0, 16, 22, 9, 7, 12, 7, 6, 2, 11, 4, 3, 3, 0), # 17 (20, 18, 17, 18, 9, 4, 9, 5, 6, 2, 1, 1, 0, 14, 15, 6, 13, 9, 7, 4, 3, 6, 4, 3, 0, 0), # 18 (19, 19, 12, 22, 11, 5, 3, 9, 5, 6, 2, 1, 0, 23, 14, 13, 10, 18, 7, 7, 4, 3, 5, 4, 0, 0), # 19 (22, 19, 16, 21, 14, 5, 3, 7, 6, 4, 4, 4, 0, 28, 15, 21, 3, 14, 4, 11, 2, 7, 6, 0, 0, 0), # 20 (10, 15, 13, 12, 13, 10, 5, 5, 8, 4, 3, 2, 0, 17, 12, 8, 9, 10, 15, 5, 3, 1, 4, 2, 1, 0), # 21 (10, 18, 14, 18, 11, 6, 9, 8, 6, 2, 3, 4, 0, 18, 14, 9, 7, 14, 10, 4, 5, 9, 5, 2, 2, 0), # 22 (19, 14, 9, 16, 11, 6, 4, 6, 4, 2, 1, 2, 0, 12, 18, 12, 20, 9, 9, 9, 3, 9, 3, 3, 2, 0), # 23 (10, 21, 13, 18, 18, 6, 11, 3, 5, 1, 2, 1, 0, 19, 18, 14, 10, 15, 8, 3, 1, 4, 6, 5, 0, 0), # 24 (15, 16, 24, 15, 9, 12, 7, 3, 7, 4, 5, 2, 0, 18, 14, 15, 9, 23, 7, 6, 5, 4, 3, 2, 3, 0), # 25 (12, 18, 10, 14, 9, 10, 7, 6, 3, 1, 1, 1, 0, 12, 17, 15, 13, 10, 8, 8, 3, 4, 2, 0, 2, 0), # 26 (13, 20, 12, 16, 12, 7, 8, 4, 9, 1, 5, 2, 0, 18, 8, 14, 10, 16, 9, 6, 7, 4, 3, 4, 0, 0), # 27 (20, 15, 17, 15, 11, 8, 13, 8, 5, 1, 3, 2, 0, 20, 13, 13, 10, 9, 6, 7, 4, 7, 2, 2, 2, 0), # 28 (15, 13, 12, 16, 12, 5, 5, 4, 10, 5, 1, 1, 0, 18, 19, 10, 3, 23, 9, 9, 3, 8, 4, 1, 7, 0), # 29 (12, 17, 13, 15, 11, 6, 7, 5, 4, 4, 4, 0, 0, 22, 10, 13, 8, 18, 12, 4, 5, 4, 2, 2, 1, 0), # 30 (21, 15, 13, 14, 10, 5, 5, 9, 11, 2, 2, 1, 0, 15, 11, 8, 14, 18, 6, 2, 4, 4, 3, 4, 2, 0), # 31 (19, 23, 15, 21, 9, 9, 6, 6, 10, 3, 2, 1, 0, 9, 18, 15, 13, 14, 8, 4, 5, 5, 10, 3, 3, 0), # 32 (14, 19, 20, 14, 8, 3, 9, 2, 7, 4, 2, 2, 0, 15, 8, 12, 7, 11, 6, 7, 6, 9, 3, 4, 1, 0), # 33 (18, 18, 13, 17, 6, 7, 11, 2, 6, 2, 3, 1, 0, 16, 18, 10, 15, 19, 9, 10, 5, 6, 4, 3, 0, 0), # 34 (14, 13, 13, 24, 18, 5, 8, 6, 5, 1, 3, 2, 0, 17, 14, 11, 12, 14, 7, 12, 2, 6, 3, 3, 1, 0), # 35 (7, 13, 7, 18, 10, 7, 7, 6, 3, 6, 1, 1, 0, 17, 17, 10, 7, 12, 4, 4, 4, 7, 5, 4, 2, 0), # 36 (12, 21, 11, 12, 12, 7, 7, 6, 4, 0, 4, 1, 0, 21, 7, 9, 10, 10, 7, 2, 8, 3, 9, 4, 1, 0), # 37 (18, 20, 18, 11, 5, 6, 15, 5, 12, 3, 4, 0, 0, 12, 17, 11, 7, 11, 8, 9, 2, 3, 4, 3, 1, 0), # 38 (10, 18, 13, 15, 8, 4, 8, 3, 5, 5, 7, 1, 0, 14, 9, 8, 12, 19, 5, 6, 2, 1, 3, 3, 2, 0), # 39 (14, 12, 18, 9, 8, 2, 10, 9, 11, 2, 1, 0, 0, 15, 19, 14, 8, 13, 14, 6, 2, 2, 3, 1, 0, 0), # 40 (22, 13, 19, 13, 11, 7, 9, 4, 6, 2, 0, 2, 0, 14, 11, 15, 11, 11, 13, 10, 4, 5, 4, 1, 1, 0), # 41 (12, 14, 12, 16, 7, 5, 5, 5, 7, 3, 2, 4, 0, 17, 19, 11, 15, 13, 10, 6, 0, 2, 5, 6, 2, 0), # 42 (14, 18, 13, 20, 8, 5, 5, 12, 5, 2, 2, 1, 0, 16, 18, 6, 9, 15, 10, 7, 1, 6, 7, 4, 3, 0), # 43 (17, 15, 9, 9, 12, 3, 8, 8, 12, 4, 4, 1, 0, 13, 16, 14, 9, 12, 7, 6, 1, 4, 1, 1, 0, 0), # 44 (17, 11, 14, 20, 12, 3, 10, 2, 4, 2, 2, 3, 0, 10, 8, 12, 10, 22, 5, 8, 2, 5, 6, 3, 4, 0), # 45 (24, 13, 8, 13, 12, 9, 5, 5, 6, 3, 1, 1, 0, 18, 16, 18, 6, 12, 8, 3, 6, 4, 2, 1, 1, 0), # 46 (19, 20, 21, 14, 9, 7, 2, 3, 4, 1, 0, 1, 0, 13, 8, 17, 7, 12, 7, 10, 5, 8, 3, 1, 0, 0), # 47 (17, 15, 19, 11, 24, 5, 7, 5, 8, 4, 3, 1, 0, 22, 17, 8, 8, 17, 6, 6, 2, 8, 7, 1, 0, 0), # 48 (21, 20, 14, 22, 12, 2, 4, 7, 6, 2, 3, 0, 0, 13, 20, 18, 15, 9, 10, 7, 4, 8, 7, 3, 2, 0), # 49 (18, 21, 18, 7, 19, 11, 7, 3, 4, 6, 2, 1, 0, 21, 14, 7, 12, 9, 7, 5, 6, 5, 5, 5, 0, 0), # 50 (21, 14, 10, 22, 14, 7, 6, 3, 8, 4, 3, 3, 0, 20, 11, 8, 9, 7, 5, 11, 5, 3, 4, 7, 2, 0), # 51 (17, 18, 15, 13, 9, 5, 10, 4, 7, 2, 2, 4, 0, 11, 10, 13, 13, 10, 5, 7, 5, 2, 1, 4, 2, 0), # 52 (19, 20, 17, 25, 13, 11, 4, 4, 6, 1, 5, 1, 0, 23, 16, 19, 17, 18, 10, 5, 6, 6, 2, 2, 2, 0), # 53 (17, 10, 16, 18, 15, 7, 4, 8, 7, 5, 2, 1, 0, 15, 12, 9, 3, 12, 5, 8, 6, 3, 2, 3, 3, 0), # 54 (26, 16, 19, 10, 12, 7, 2, 4, 4, 2, 1, 0, 0, 17, 17, 18, 3, 10, 10, 14, 5, 7, 1, 5, 1, 0), # 55 (22, 8, 10, 17, 15, 9, 7, 3, 10, 7, 2, 1, 0, 15, 12, 13, 9, 8, 11, 5, 3, 4, 6, 0, 1, 0), # 56 (15, 10, 17, 13, 13, 5, 5, 5, 7, 3, 1, 1, 0, 9, 15, 14, 6, 11, 12, 8, 5, 6, 6, 1, 2, 0), # 57 (16, 11, 7, 19, 9, 2, 6, 7, 2, 3, 0, 3, 0, 15, 12, 16, 8, 8, 7, 8, 6, 6, 8, 2, 0, 0), # 58 (22, 16, 14, 10, 6, 5, 2, 2, 2, 5, 1, 2, 0, 15, 16, 12, 8, 8, 8, 3, 8, 5, 8, 0, 6, 0), # 59 (22, 13, 12, 12, 13, 6, 3, 6, 5, 1, 3, 1, 0, 24, 5, 3, 7, 13, 7, 13, 1, 4, 0, 4, 1, 0), # 60 (15, 20, 16, 24, 10, 6, 4, 3, 7, 2, 2, 0, 0, 12, 10, 10, 7, 18, 8, 5, 3, 2, 3, 2, 3, 0), # 61 (20, 15, 20, 15, 8, 6, 3, 4, 8, 2, 4, 0, 0, 20, 10, 8, 9, 16, 7, 5, 2, 7, 2, 5, 1, 0), # 62 (14, 15, 10, 8, 10, 4, 6, 4, 8, 2, 2, 2, 0, 8, 9, 7, 8, 15, 10, 6, 0, 6, 5, 1, 4, 0), # 63 (16, 22, 13, 12, 22, 3, 3, 8, 3, 3, 2, 0, 0, 14, 9, 16, 15, 9, 11, 9, 5, 7, 3, 2, 3, 0), # 64 (13, 16, 9, 13, 11, 4, 14, 3, 7, 1, 3, 1, 0, 11, 14, 10, 11, 17, 16, 4, 8, 8, 5, 3, 2, 0), # 65 (12, 15, 16, 15, 20, 5, 5, 7, 9, 3, 4, 1, 0, 18, 14, 15, 4, 12, 4, 6, 0, 5, 3, 4, 1, 0), # 66 (16, 18, 11, 13, 17, 3, 7, 2, 4, 1, 3, 2, 0, 12, 9, 11, 11, 15, 5, 3, 1, 10, 4, 3, 1, 0), # 67 (13, 11, 13, 21, 8, 15, 6, 6, 4, 2, 3, 1, 0, 13, 19, 6, 16, 14, 11, 3, 5, 12, 5, 1, 0, 0), # 68 (14, 15, 19, 18, 13, 8, 5, 5, 5, 5, 1, 0, 0, 18, 10, 7, 16, 11, 9, 3, 2, 4, 5, 6, 2, 0), # 69 (15, 14, 13, 8, 10, 4, 7, 6, 4, 2, 0, 3, 0, 9, 7, 7, 10, 7, 4, 6, 3, 8, 2, 2, 0, 0), # 70 (22, 14, 13, 19, 8, 3, 4, 6, 7, 3, 0, 2, 0, 18, 10, 9, 10, 14, 3, 7, 3, 6, 2, 2, 2, 0), # 71 (14, 18, 11, 14, 9, 4, 10, 3, 3, 7, 2, 0, 0, 13, 9, 8, 3, 8, 7, 5, 5, 14, 3, 4, 0, 0), # 72 (11, 16, 14, 21, 20, 4, 7, 4, 8, 4, 2, 2, 0, 15, 11, 10, 12, 13, 8, 7, 2, 1, 7, 1, 0, 0), # 73 (9, 21, 20, 11, 18, 4, 6, 7, 5, 2, 3, 0, 0, 11, 19, 15, 16, 11, 6, 8, 5, 5, 6, 0, 2, 0), # 74 (13, 19, 12, 15, 15, 5, 4, 8, 12, 7, 4, 3, 0, 13, 10, 10, 8, 7, 7, 6, 5, 9, 3, 3, 2, 0), # 75 (13, 17, 11, 16, 16, 6, 2, 6, 3, 2, 2, 1, 0, 13, 12, 5, 9, 7, 8, 9, 5, 6, 4, 2, 4, 0), # 76 (14, 13, 11, 11, 9, 4, 4, 1, 7, 2, 3, 2, 0, 25, 14, 14, 11, 10, 2, 4, 2, 7, 4, 1, 1, 0), # 77 (7, 11, 17, 11, 12, 10, 7, 8, 7, 1, 0, 1, 0, 18, 15, 11, 5, 6, 6, 5, 3, 5, 7, 1, 0, 0), # 78 (18, 12, 16, 15, 10, 5, 6, 2, 5, 4, 1, 1, 0, 17, 15, 11, 15, 18, 6, 6, 6, 6, 1, 4, 0, 0), # 79 (16, 16, 19, 13, 9, 9, 5, 5, 12, 3, 3, 0, 0, 17, 12, 8, 7, 12, 5, 4, 5, 4, 2, 2, 2, 0), # 80 (12, 15, 14, 11, 11, 3, 5, 7, 5, 4, 1, 3, 0, 14, 9, 12, 5, 10, 13, 2, 1, 8, 2, 3, 2, 0), # 81 (14, 9, 15, 16, 8, 8, 6, 5, 5, 2, 3, 1, 0, 15, 16, 14, 8, 12, 7, 6, 2, 7, 5, 3, 1, 0), # 82 (10, 11, 18, 11, 13, 4, 4, 5, 4, 4, 1, 3, 0, 20, 13, 13, 9, 18, 6, 4, 6, 5, 5, 1, 4, 0), # 83 (15, 14, 8, 19, 16, 4, 7, 5, 3, 0, 4, 0, 0, 19, 13, 9, 10, 10, 4, 7, 3, 9, 9, 3, 2, 0), # 84 (20, 10, 8, 12, 11, 5, 4, 2, 8, 4, 1, 0, 0, 13, 20, 10, 6, 11, 9, 4, 2, 4, 6, 5, 2, 0), # 85 (17, 14, 12, 11, 12, 3, 4, 4, 8, 1, 3, 2, 0, 14, 9, 6, 9, 11, 11, 10, 5, 8, 4, 1, 1, 0), # 86 (17, 14, 14, 12, 13, 4, 6, 4, 6, 4, 0, 3, 0, 8, 7, 11, 12, 13, 2, 5, 6, 7, 3, 4, 1, 0), # 87 (12, 13, 17, 14, 12, 3, 7, 11, 7, 4, 1, 3, 0, 14, 15, 16, 9, 11, 6, 4, 4, 5, 8, 2, 1, 0), # 88 (18, 6, 18, 18, 8, 6, 3, 6, 6, 2, 4, 0, 0, 11, 22, 10, 13, 11, 4, 5, 4, 6, 3, 5, 1, 0), # 89 (18, 11, 8, 15, 20, 6, 8, 7, 4, 7, 2, 3, 0, 19, 18, 11, 5, 9, 5, 6, 2, 8, 6, 2, 0, 0), # 90 (16, 15, 11, 8, 11, 7, 4, 5, 8, 2, 2, 0, 0, 19, 15, 13, 5, 17, 4, 9, 6, 5, 4, 2, 0, 0), # 91 (14, 14, 12, 10, 10, 7, 8, 4, 2, 4, 2, 2, 0, 19, 11, 11, 9, 7, 4, 7, 5, 4, 4, 3, 0, 0), # 92 (18, 9, 13, 16, 13, 11, 4, 8, 5, 2, 2, 3, 0, 18, 22, 8, 7, 16, 6, 4, 3, 4, 5, 1, 0, 0), # 93 (19, 12, 15, 14, 12, 2, 5, 2, 6, 4, 1, 3, 0, 19, 10, 10, 10, 13, 6, 9, 3, 7, 0, 4, 0, 0), # 94 (13, 3, 9, 18, 13, 7, 9, 5, 10, 4, 3, 3, 0, 14, 15, 12, 9, 6, 5, 11, 7, 4, 3, 1, 0, 0), # 95 (19, 7, 15, 20, 15, 11, 3, 6, 5, 4, 1, 0, 0, 14, 20, 11, 10, 8, 5, 7, 3, 10, 3, 1, 0, 0), # 96 (20, 9, 12, 15, 11, 7, 2, 9, 7, 0, 5, 0, 0, 18, 7, 7, 9, 9, 5, 6, 3, 4, 4, 1, 0, 0), # 97 (12, 16, 13, 13, 7, 4, 3, 2, 6, 0, 1, 2, 0, 20, 17, 14, 8, 11, 8, 3, 6, 7, 4, 4, 1, 0), # 98 (18, 6, 13, 16, 12, 5, 4, 6, 5, 1, 2, 2, 0, 16, 16, 7, 9, 10, 7, 3, 4, 3, 5, 2, 2, 0), # 99 (15, 14, 14, 11, 15, 6, 10, 3, 6, 2, 2, 3, 0, 14, 11, 10, 9, 14, 8, 4, 3, 9, 3, 1, 2, 0), # 100 (10, 17, 11, 5, 13, 7, 7, 4, 6, 1, 0, 2, 0, 16, 9, 11, 10, 8, 5, 3, 4, 5, 5, 4, 2, 0), # 101 (24, 22, 13, 15, 10, 10, 3, 3, 4, 1, 3, 1, 0, 17, 13, 14, 0, 9, 1, 4, 4, 3, 1, 2, 1, 0), # 102 (21, 14, 9, 14, 14, 9, 5, 6, 7, 2, 3, 0, 0, 20, 9, 3, 2, 18, 2, 3, 2, 7, 6, 0, 3, 0), # 103 (16, 16, 11, 15, 11, 4, 5, 3, 7, 4, 2, 3, 0, 17, 10, 8, 6, 14, 3, 2, 7, 5, 6, 0, 1, 0), # 104 (15, 6, 16, 15, 10, 6, 6, 9, 5, 1, 2, 4, 0, 15, 12, 7, 6, 11, 3, 6, 4, 3, 7, 6, 1, 0), # 105 (16, 14, 11, 6, 11, 3, 6, 2, 9, 2, 1, 2, 0, 16, 5, 8, 6, 14, 4, 6, 5, 8, 5, 2, 1, 0), # 106 (16, 9, 17, 9, 14, 7, 7, 6, 7, 4, 1, 3, 0, 15, 13, 9, 5, 13, 2, 2, 4, 5, 6, 1, 4, 0), # 107 (16, 11, 10, 10, 15, 4, 6, 2, 5, 2, 2, 3, 0, 14, 9, 8, 10, 18, 3, 5, 4, 8, 5, 1, 3, 0), # 108 (14, 8, 12, 12, 15, 4, 6, 1, 3, 3, 4, 0, 0, 12, 12, 8, 8, 13, 6, 5, 3, 8, 2, 1, 1, 0), # 109 (19, 6, 15, 14, 7, 5, 6, 7, 6, 3, 2, 2, 0, 12, 7, 4, 6, 6, 7, 5, 3, 13, 5, 1, 2, 0), # 110 (17, 11, 12, 11, 14, 1, 4, 9, 4, 1, 2, 1, 0, 16, 5, 8, 9, 13, 4, 5, 1, 3, 4, 6, 1, 0), # 111 (19, 9, 13, 17, 16, 13, 7, 3, 3, 1, 3, 3, 0, 11, 17, 11, 7, 18, 8, 5, 2, 8, 2, 2, 0, 0), # 112 (19, 10, 12, 12, 7, 10, 4, 3, 4, 3, 0, 1, 0, 18, 14, 10, 10, 8, 9, 5, 4, 8, 4, 2, 2, 0), # 113 (17, 6, 14, 10, 13, 2, 9, 2, 11, 2, 4, 2, 0, 12, 4, 8, 10, 15, 10, 7, 4, 4, 1, 4, 2, 0), # 114 (17, 11, 14, 12, 9, 4, 3, 3, 6, 1, 1, 2, 0, 15, 17, 8, 7, 6, 4, 3, 3, 12, 4, 2, 0, 0), # 115 (12, 7, 8, 15, 15, 7, 4, 5, 4, 6, 3, 2, 0, 18, 16, 14, 8, 12, 2, 2, 3, 6, 3, 0, 4, 0), # 116 (13, 11, 14, 9, 6, 5, 5, 3, 5, 4, 2, 2, 0, 22, 14, 8, 8, 11, 8, 3, 4, 10, 0, 3, 0, 0), # 117 (13, 11, 9, 12, 6, 10, 4, 5, 6, 2, 4, 0, 0, 13, 8, 12, 7, 14, 3, 4, 2, 5, 2, 4, 1, 0), # 118 (12, 10, 10, 14, 15, 11, 5, 2, 3, 1, 1, 2, 0, 21, 10, 3, 6, 13, 6, 4, 5, 4, 6, 5, 2, 0), # 119 (17, 13, 10, 11, 18, 4, 5, 4, 3, 2, 1, 0, 0, 25, 12, 6, 7, 12, 7, 4, 0, 3, 4, 1, 2, 0), # 120 (13, 15, 12, 9, 10, 5, 4, 4, 3, 2, 2, 1, 0, 11, 12, 6, 9, 10, 1, 4, 5, 9, 5, 4, 2, 0), # 121 (21, 20, 16, 13, 12, 3, 4, 2, 6, 2, 3, 1, 0, 10, 12, 7, 3, 5, 6, 6, 5, 6, 5, 3, 0, 0), # 122 (10, 9, 11, 7, 9, 8, 5, 5, 5, 2, 2, 2, 0, 15, 17, 8, 6, 21, 7, 7, 8, 6, 5, 1, 0, 0), # 123 (14, 8, 10, 12, 11, 7, 3, 3, 3, 2, 1, 0, 0, 13, 5, 8, 7, 10, 4, 3, 1, 5, 9, 1, 1, 0), # 124 (17, 10, 12, 20, 13, 5, 2, 4, 3, 3, 2, 1, 0, 12, 6, 16, 4, 7, 5, 3, 4, 5, 5, 2, 1, 0), # 125 (15, 11, 9, 15, 9, 5, 3, 4, 3, 2, 1, 0, 0, 16, 13, 11, 6, 13, 5, 4, 5, 4, 4, 4, 1, 0), # 126 (16, 8, 14, 17, 10, 10, 1, 4, 8, 3, 1, 0, 0, 14, 11, 8, 6, 6, 6, 5, 5, 5, 2, 2, 1, 0), # 127 (16, 2, 10, 12, 9, 3, 4, 5, 5, 5, 1, 1, 0, 14, 11, 11, 4, 11, 9, 2, 3, 6, 8, 3, 0, 0), # 128 (18, 10, 8, 20, 11, 7, 3, 5, 7, 3, 4, 2, 0, 10, 15, 12, 7, 14, 9, 5, 4, 4, 10, 3, 1, 0), # 129 (12, 9, 11, 12, 13, 6, 6, 2, 7, 3, 5, 0, 0, 20, 13, 9, 5, 8, 7, 3, 3, 7, 3, 1, 0, 0), # 130 (14, 10, 13, 10, 7, 6, 3, 5, 8, 4, 3, 1, 0, 12, 12, 10, 7, 2, 6, 7, 6, 5, 5, 1, 0, 0), # 131 (10, 7, 11, 10, 12, 8, 4, 2, 4, 2, 2, 1, 0, 19, 9, 11, 6, 14, 5, 4, 4, 6, 2, 1, 1, 0), # 132 (11, 9, 15, 20, 6, 3, 2, 8, 2, 2, 2, 2, 0, 12, 9, 7, 5, 7, 3, 4, 5, 8, 6, 7, 0, 0), # 133 (9, 8, 8, 11, 8, 11, 3, 7, 6, 2, 3, 1, 0, 21, 9, 8, 9, 14, 5, 3, 1, 7, 6, 0, 0, 0), # 134 (11, 13, 6, 12, 9, 2, 3, 5, 4, 2, 3, 2, 0, 15, 14, 7, 4, 7, 7, 4, 2, 6, 2, 6, 0, 0), # 135 (6, 7, 9, 19, 12, 3, 3, 6, 6, 2, 2, 0, 0, 15, 18, 6, 9, 7, 5, 4, 3, 10, 0, 2, 1, 0), # 136 (18, 9, 13, 12, 12, 10, 2, 1, 7, 2, 0, 2, 0, 15, 14, 5, 9, 14, 5, 10, 4, 3, 4, 2, 1, 0), # 137 (15, 5, 13, 18, 12, 10, 5, 7, 3, 1, 2, 2, 0, 9, 13, 15, 7, 7, 3, 5, 3, 4, 4, 2, 0, 0), # 138 (12, 6, 8, 7, 7, 10, 2, 4, 3, 1, 1, 1, 0, 17, 9, 7, 10, 6, 1, 5, 2, 8, 4, 2, 1, 0), # 139 (13, 5, 8, 15, 9, 8, 1, 3, 5, 3, 3, 0, 0, 12, 9, 8, 9, 11, 8, 3, 4, 7, 4, 1, 2, 0), # 140 (17, 13, 10, 14, 7, 3, 4, 8, 6, 2, 3, 0, 0, 13, 11, 7, 9, 14, 2, 4, 2, 5, 3, 3, 0, 0), # 141 (9, 7, 8, 11, 9, 4, 5, 1, 12, 3, 1, 0, 0, 12, 4, 8, 6, 10, 7, 3, 4, 2, 2, 1, 1, 0), # 142 (12, 8, 13, 15, 10, 4, 3, 12, 10, 0, 2, 2, 0, 12, 12, 12, 11, 8, 5, 5, 5, 5, 5, 2, 2, 0), # 143 (12, 11, 11, 13, 12, 1, 2, 3, 8, 2, 1, 3, 0, 10, 11, 8, 6, 17, 7, 7, 7, 6, 4, 1, 0, 0), # 144 (14, 10, 9, 12, 7, 5, 4, 3, 5, 1, 3, 0, 0, 9, 8, 11, 3, 14, 4, 9, 6, 5, 5, 0, 0, 0), # 145 (17, 8, 12, 12, 13, 3, 7, 9, 7, 2, 0, 1, 0, 13, 6, 2, 5, 3, 5, 5, 1, 5, 3, 3, 2, 0), # 146 (10, 18, 9, 9, 9, 3, 2, 3, 3, 2, 1, 2, 0, 13, 7, 4, 10, 6, 4, 5, 3, 5, 1, 3, 1, 0), # 147 (16, 9, 12, 13, 10, 4, 6, 2, 3, 5, 1, 2, 0, 10, 8, 7, 4, 7, 5, 3, 4, 3, 5, 1, 2, 0), # 148 (19, 11, 13, 7, 7, 7, 2, 5, 5, 3, 0, 0, 0, 13, 6, 7, 7, 16, 6, 6, 2, 5, 4, 2, 2, 0), # 149 (13, 8, 12, 10, 8, 4, 3, 2, 8, 0, 1, 0, 0, 15, 9, 13, 9, 13, 5, 3, 5, 6, 5, 1, 1, 0), # 150 (10, 8, 9, 12, 8, 4, 1, 2, 5, 4, 1, 0, 0, 15, 11, 14, 4, 14, 5, 2, 2, 7, 2, 1, 0, 0), # 151 (13, 6, 12, 14, 7, 4, 2, 5, 7, 3, 1, 1, 0, 13, 12, 7, 6, 7, 8, 6, 1, 8, 9, 2, 0, 0), # 152 (19, 10, 9, 12, 6, 1, 6, 3, 6, 1, 1, 0, 0, 14, 9, 7, 6, 9, 5, 4, 6, 8, 5, 2, 0, 0), # 153 (12, 9, 15, 10, 9, 3, 4, 1, 2, 1, 0, 0, 0, 12, 7, 8, 9, 14, 3, 3, 3, 4, 4, 0, 1, 0), # 154 (9, 10, 12, 13, 13, 3, 6, 3, 5, 3, 1, 0, 0, 15, 9, 6, 5, 12, 4, 1, 1, 4, 4, 0, 0, 0), # 155 (15, 9, 17, 7, 16, 5, 7, 2, 1, 2, 2, 1, 0, 11, 6, 13, 7, 16, 3, 3, 5, 5, 4, 3, 0, 0), # 156 (8, 3, 12, 9, 8, 4, 6, 1, 2, 1, 1, 0, 0, 13, 13, 6, 1, 6, 3, 2, 2, 6, 8, 3, 0, 0), # 157 (17, 4, 9, 15, 11, 3, 2, 4, 6, 0, 1, 0, 0, 15, 14, 3, 6, 6, 4, 1, 3, 1, 4, 2, 0, 0), # 158 (10, 6, 8, 8, 5, 3, 2, 3, 6, 2, 1, 0, 0, 8, 5, 10, 6, 9, 11, 4, 0, 5, 4, 3, 0, 0), # 159 (12, 9, 9, 10, 9, 7, 3, 4, 8, 2, 1, 1, 0, 8, 6, 5, 6, 16, 6, 8, 5, 5, 3, 3, 3, 0), # 160 (8, 6, 7, 13, 15, 5, 5, 2, 8, 0, 1, 1, 0, 13, 6, 8, 3, 8, 3, 6, 1, 1, 1, 1, 1, 0), # 161 (11, 11, 10, 5, 13, 7, 1, 0, 4, 1, 1, 0, 0, 12, 10, 5, 4, 8, 4, 4, 1, 4, 5, 2, 3, 0), # 162 (11, 5, 11, 14, 9, 9, 3, 3, 6, 1, 3, 0, 0, 17, 23, 6, 1, 9, 2, 3, 3, 3, 3, 3, 1, 0), # 163 (13, 9, 5, 17, 9, 3, 0, 4, 10, 0, 2, 2, 0, 9, 16, 4, 2, 11, 6, 2, 7, 3, 2, 1, 0, 0), # 164 (11, 7, 10, 8, 7, 5, 2, 3, 3, 3, 1, 0, 0, 9, 9, 9, 4, 12, 3, 7, 5, 3, 2, 2, 1, 0), # 165 (7, 6, 6, 11, 6, 1, 4, 2, 3, 2, 3, 0, 0, 12, 4, 11, 6, 7, 3, 3, 3, 6, 5, 3, 1, 0), # 166 (8, 7, 10, 5, 5, 4, 4, 3, 7, 2, 0, 0, 0, 18, 10, 5, 8, 5, 3, 2, 3, 7, 4, 2, 2, 0), # 167 (10, 7, 11, 8, 9, 2, 2, 4, 4, 2, 0, 0, 0, 10, 7, 6, 5, 6, 5, 3, 4, 6, 3, 1, 1, 0), # 168 (12, 11, 7, 8, 14, 4, 3, 2, 6, 0, 2, 1, 0, 12, 10, 9, 4, 9, 5, 1, 4, 2, 0, 4, 0, 0), # 169 (9, 10, 10, 4, 3, 6, 4, 4, 5, 2, 0, 1, 0, 16, 8, 4, 5, 8, 5, 3, 5, 2, 3, 1, 1, 0), # 170 (8, 5, 11, 6, 11, 3, 4, 5, 4, 0, 1, 1, 0, 7, 5, 6, 3, 5, 2, 2, 2, 5, 5, 1, 0, 0), # 171 (4, 5, 5, 7, 7, 5, 2, 4, 6, 2, 0, 1, 0, 8, 8, 4, 5, 6, 8, 3, 4, 4, 2, 5, 0, 0), # 172 (5, 4, 6, 6, 3, 3, 0, 2, 3, 2, 2, 2, 0, 9, 9, 3, 2, 5, 4, 2, 0, 4, 6, 0, 0, 0), # 173 (7, 5, 5, 9, 5, 3, 1, 4, 1, 1, 0, 2, 0, 12, 8, 3, 3, 7, 2, 3, 0, 10, 2, 0, 1, 0), # 174 (6, 6, 5, 12, 9, 1, 1, 3, 4, 0, 0, 0, 0, 8, 4, 5, 4, 3, 4, 4, 2, 1, 3, 1, 1, 0), # 175 (11, 4, 4, 11, 8, 4, 0, 2, 1, 1, 1, 1, 0, 5, 5, 5, 5, 6, 2, 6, 2, 0, 3, 3, 0, 0), # 176 (6, 6, 6, 6, 8, 3, 2, 1, 3, 0, 0, 0, 0, 6, 3, 4, 5, 5, 5, 3, 0, 1, 3, 3, 0, 0), # 177 (11, 2, 8, 6, 7, 2, 4, 2, 1, 1, 0, 2, 0, 5, 5, 3, 1, 4, 6, 2, 2, 2, 2, 1, 0, 0), # 178 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), # 179 ) station_arriving_intensity = ( (8.033384925394829, 8.840461695509067, 8.33805316738001, 9.943468438181492, 8.887496972175379, 5.021847891259743, 6.6336569845982645, 7.445081876767077, 9.744158499468812, 6.332824024835792, 6.728424262216965, 7.836664125289878, 8.134208340125381), # 0 (8.566923443231959, 9.424097110631614, 8.888554546128244, 10.600230805242587, 9.475984539958779, 5.353573734468089, 7.07115030602191, 7.9352219566491335, 10.387592522132655, 6.75036910764344, 7.172953817529811, 8.353946657302968, 8.671666635903767), # 1 (9.09875681436757, 10.005416273425567, 9.436867656875862, 11.254380327463672, 10.062340757999591, 5.683976183219912, 7.506909612737127, 8.423400396647072, 11.028458891004078, 7.166262040032874, 7.615717038042101, 8.869172243284888, 9.206983725135505), # 2 (9.6268124690345, 10.582112803098315, 9.980817390911767, 11.903322252051318, 10.644258681603043, 6.011744996136181, 7.939205826636729, 8.907681851991212, 11.664216257473749, 7.578852317481889, 8.054957458923813, 9.380297095888738, 9.738036490006762), # 3 (10.149017837465571, 11.15188031885724, 10.518228639524859, 12.544461826212112, 11.219431366074389, 6.335569931837869, 8.366309869613534, 9.386130977911865, 12.292323272932332, 7.986489435468286, 8.48891861534492, 9.885277427767623, 10.262701812703709), # 4 (10.663300349893618, 11.712412439909741, 11.04692629400403, 13.17520429715263, 11.785551866718848, 6.654140748945943, 8.786492663560358, 9.856812429639348, 12.910238588770495, 8.387522889469862, 8.915844042475412, 10.382069451574637, 10.778856575412524), # 5 (11.167587436551466, 12.261402785463202, 11.564735245638186, 13.792954912079445, 12.34031323884167, 6.9661472060813825, 9.19802513037002, 10.317790862403982, 13.515420856378904, 8.780302174964413, 9.333977275485251, 10.868629379962893, 11.284377660319372), # 6 (11.65980652767195, 12.79654497472501, 12.069480385716217, 14.39511891819914, 12.881408537748086, 7.270279061865153, 9.599178191935335, 10.767130931436084, 14.105328727148231, 9.16317678742974, 9.74156184954443, 11.342913425585486, 11.777141949610431), # 7 (12.137885053487896, 13.31553262690256, 12.558986605527034, 14.979101562718284, 13.406530818743338, 7.565226074918224, 9.988222770149116, 11.20289729196596, 14.67742085246913, 9.53449622234364, 10.136841299822914, 11.802877801095525, 12.255026325471867), # 8 (12.599750444232136, 13.816059361203237, 13.031078796359527, 15.54230809284347, 13.913373137132655, 7.849678003861574, 10.363429786904192, 11.623154599223941, 15.229155883732279, 9.892609975183907, 10.518059161490685, 12.246478719146102, 12.71590767008986), # 9 (13.043330130137491, 14.295818796834425, 13.483581849502599, 16.08214375578126, 14.399628548221282, 8.122324607316171, 10.723070164093368, 12.025967508440338, 15.757992472328343, 10.235867541428343, 10.883458969717719, 12.671672392390324, 13.157662865650577), # 10 (13.466551541436809, 14.752504553003531, 13.914320656245145, 16.596013798738237, 14.862990107314454, 8.38185564390299, 11.065414823609466, 12.409400674845465, 16.26138926964799, 10.56261841655475, 11.231284259673998, 13.076415033481297, 13.57816879434018), # 11 (13.8673421083629, 15.183810248917917, 14.321120107876064, 17.08132346892098, 15.301150869717404, 8.626960872242991, 11.388734687345298, 12.771518753669634, 16.736804927081888, 10.871212096040916, 11.559778566529495, 13.45866285507211, 13.975302338344855), # 12 (14.243629261148602, 15.587429503784993, 14.701805095684259, 17.53547801353607, 15.711803890735363, 8.856330050957158, 11.69130067719369, 13.11038640014317, 17.181698096020693, 11.159998075364648, 11.86718542545419, 13.816372069815873, 14.346940379850777), # 13 (14.593340430026746, 15.961055936812143, 15.054200510958635, 17.95588267979007, 16.092642225673583, 9.068652938666455, 11.971383715047459, 13.424068269496395, 17.593527427855076, 11.427325850003735, 12.151748371618055, 14.147498890365696, 14.690959801044102), # 14 (14.914403045230168, 16.30238316720675, 15.376131244988068, 18.339942714889578, 16.441358929837293, 9.26261929399186, 12.227254722799401, 13.71062901695961, 17.96975157397571, 11.671544915435986, 12.411710940191071, 14.449999529374674, 15.00523748411101), # 15 (15.204744536991681, 16.609104814176213, 15.66542218906148, 18.685063366041145, 16.755647058531732, 9.436918875554335, 12.457184622342362, 13.968133297763139, 18.307829185773258, 11.891004767139194, 12.64531666634322, 14.721830199495905, 15.287650311237673), # 16 (15.46229233554412, 16.878914496927916, 15.919898234467764, 18.98864988045138, 17.033199667062142, 9.590241441974857, 12.659444335569138, 14.19464576713731, 18.605218914638375, 12.084054900591148, 12.850809085244478, 14.960947113382488, 15.536075164610265), # 17 (15.684973871120327, 17.10950583466924, 16.137384272495808, 19.248107505326846, 17.271709810733743, 9.721276751874406, 12.832304784372562, 14.388231080312417, 18.859379411961754, 12.249044811269659, 13.026431732064815, 15.165306483687544, 15.748388926414954), # 18 (15.870716573953118, 17.29857244660759, 16.315705194434525, 19.460841487874106, 17.468870544851786, 9.828714563873934, 12.974036890645431, 14.546953892518793, 19.067769329134048, 12.384323994652526, 13.170428141974206, 15.332864523064154, 15.922468478837914), # 19 (16.01744787427533, 17.44380795195034, 16.452685891572806, 19.624257075299766, 17.62237492472151, 9.91124463659443, 13.08291157628058, 14.668878858986748, 19.22784731754592, 12.488241946217535, 13.28104185014264, 15.461577444165426, 16.05619070406532), # 20 (16.123095202319785, 17.542905969904893, 16.54615125519955, 19.73575951481038, 17.729916005648143, 9.967556728656858, 13.157199763170816, 14.752070634946598, 19.337072028588036, 12.559148161442488, 13.356516391740096, 15.54940145964447, 16.147432484283325), # 21 (16.18558598831933, 17.59356011967863, 16.593926176603656, 19.79275405361254, 17.78918684293692, 9.996340598682188, 13.19517237320896, 14.794593875628664, 19.392902113651065, 12.595392135805188, 13.395095301936545, 15.594292782154383, 16.194070701678125), # 22 (16.208629381348224, 17.599557750342935, 16.599877091906723, 19.799889300411525, 17.804371289652156, 10.0, 13.199686403614942, 14.79919012345679, 19.399881975308645, 12.599667636031093, 13.399932859458785, 15.599836122542294, 16.2), # 23 (16.225619860854646, 17.59605925925926, 16.598903703703705, 19.799011111111113, 17.812972181783763, 10.0, 13.197206100217867, 14.7928, 19.398946666666667, 12.59704098765432, 13.39939932659933, 15.598538271604937, 16.2), # 24 (16.242251568338528, 17.589163237311386, 16.59698216735254, 19.797273662551444, 17.821383912951205, 10.0, 13.192318244170096, 14.78024691358025, 19.3970987654321, 12.591870141746686, 13.39834143908218, 15.595976223136716, 16.2), # 25 (16.258523230476854, 17.578975034293556, 16.594138820301787, 19.79469670781893, 17.82960618947377, 10.0, 13.185098749293955, 14.76176790123457, 19.39436197530864, 12.58424113397348, 13.396768774161368, 15.592185093735715, 16.2), # 26 (16.27443357394662, 17.5656, 16.5904, 19.7913, 17.837638717670742, 10.0, 13.175623529411766, 14.7376, 19.39076, 12.57424, 13.39469090909091, 15.587200000000003, 16.2), # 27 (16.2899813254248, 17.549143484224967, 16.585792043895747, 19.787103292181072, 17.845481203861443, 10.0, 13.163968498345842, 14.707980246913582, 19.386316543209876, 12.561952775491541, 13.39211742112483, 15.581056058527665, 16.2), # 28 (16.3051652115884, 17.52971083676269, 16.580341289437587, 19.78212633744856, 17.853133354365152, 10.0, 13.150209569918506, 14.673145679012345, 19.381055308641976, 12.547465496113398, 13.389057887517147, 15.57378838591678, 16.2), # 29 (16.319983959114396, 17.50740740740741, 16.574074074074073, 19.77638888888889, 17.860594875501178, 10.0, 13.13442265795207, 14.633333333333333, 19.375, 12.530864197530866, 13.385521885521886, 15.56543209876543, 16.2), # 30 (16.334436294679772, 17.482338545953365, 16.567016735253773, 19.76991069958848, 17.867865473588814, 10.0, 13.116683676268863, 14.588780246913581, 19.368174320987656, 12.512234915409238, 13.381518992393067, 15.556022313671699, 16.2), # 31 (16.34852094496153, 17.45460960219479, 16.55919561042524, 19.762711522633747, 17.874944854947355, 10.0, 13.097068538691198, 14.539723456790126, 19.360601975308644, 12.49166368541381, 13.377058785384712, 15.545594147233656, 16.2), # 32 (16.362236636636634, 17.424325925925924, 16.55063703703704, 19.75481111111111, 17.8818327258961, 10.0, 13.075653159041394, 14.486400000000001, 19.352306666666667, 12.469236543209878, 13.372150841750841, 15.534182716049381, 16.2), # 33 (16.375582096382097, 17.391592866941014, 16.541367352537723, 19.746229218106997, 17.888528792754347, 10.0, 13.052513451141776, 14.429046913580246, 19.343312098765438, 12.445039524462736, 13.36680473874548, 15.521823136716964, 16.2), # 34 (16.388556050874893, 17.356515775034293, 16.53141289437586, 19.736985596707818, 17.895032761841392, 10.0, 13.027725328814654, 14.367901234567903, 19.333641975308645, 12.419158664837678, 13.361030053622645, 15.508550525834478, 16.2), # 35 (16.40115722679201, 17.3192, 16.5208, 19.7271, 17.901344339476537, 10.0, 13.001364705882352, 14.303200000000002, 19.32332, 12.391680000000001, 13.354836363636364, 15.494400000000002, 16.2), # 36 (16.41338435081044, 17.27975089163237, 16.50955500685871, 19.71659218106996, 17.907463231979076, 10.0, 12.97350749616719, 14.23518024691358, 19.31236987654321, 12.362689565615, 13.348233246040657, 15.479406675811616, 16.2), # 37 (16.425236149607162, 17.238273799725654, 16.49770425240055, 19.70548189300412, 17.913389145668305, 10.0, 12.944229613491487, 14.164079012345681, 19.300815308641976, 12.332273397347967, 13.341230278089538, 15.4636056698674, 16.2), # 38 (16.436711349859177, 17.194874074074075, 16.485274074074077, 19.69378888888889, 17.919121786863524, 10.0, 12.913606971677561, 14.090133333333334, 19.288680000000003, 12.300517530864198, 13.333837037037037, 15.447032098765431, 16.2), # 39 (16.44780867824346, 17.149657064471878, 16.472290809327845, 19.6815329218107, 17.924660861884032, 10.0, 12.88171548454773, 14.013580246913584, 19.27598765432099, 12.267508001828991, 13.326063100137175, 15.429721079103798, 16.2), # 40 (16.458526861437004, 17.102728120713305, 16.458780795610426, 19.66873374485597, 17.930006077049125, 10.0, 12.848631065924312, 13.934656790123459, 19.262761975308642, 12.233330845907636, 13.317918044643973, 15.411707727480568, 16.2), # 41 (16.4688646261168, 17.054192592592596, 16.444770370370374, 19.655411111111114, 17.935157138678093, 10.0, 12.814429629629629, 13.8536, 19.24902666666667, 12.198072098765433, 13.30941144781145, 15.393027160493828, 16.2), # 42 (16.47882069895983, 17.00415582990398, 16.430285871056242, 19.641584773662554, 17.940113753090245, 10.0, 12.779187089486001, 13.770646913580249, 19.234805432098767, 12.161817796067673, 13.300552886893627, 15.373714494741657, 16.2), # 43 (16.488393806643085, 16.9527231824417, 16.4153536351166, 19.62727448559671, 17.944875626604873, 10.0, 12.742979359315743, 13.686034567901238, 19.220121975308643, 12.124653973479653, 13.291351939144532, 15.353804846822133, 16.2), # 44 (16.497582675843546, 16.900000000000002, 16.400000000000002, 19.6125, 17.949442465541274, 10.0, 12.705882352941178, 13.600000000000001, 19.205, 12.086666666666668, 13.281818181818181, 15.333333333333332, 16.2), # 45 (16.50638603323821, 16.846091632373113, 16.384251303155008, 19.59728106995885, 17.953813976218747, 10.0, 12.667971984184621, 13.512780246913582, 19.189463209876543, 12.04794191129401, 13.271961192168598, 15.312335070873344, 16.2), # 46 (16.514802605504055, 16.79110342935528, 16.36813388203018, 19.581637448559672, 17.957989864956588, 10.0, 12.629324166868395, 13.424612345679012, 19.173535308641977, 12.008565743026978, 13.261790547449806, 15.29084517604024, 16.2), # 47 (16.522831119318074, 16.735140740740743, 16.351674074074076, 19.565588888888893, 17.961969838074097, 10.0, 12.590014814814815, 13.335733333333335, 19.15724, 11.968624197530865, 13.251315824915824, 15.268898765432098, 16.2), # 48 (16.53047030135726, 16.67830891632373, 16.334898216735255, 19.549155144032923, 17.965753601890572, 10.0, 12.550119841846204, 13.246380246913581, 19.14060098765432, 11.928203310470966, 13.240546601820677, 15.246530955647007, 16.2), # 49 (16.537718878298588, 16.620713305898494, 16.31783264746228, 19.53235596707819, 17.969340862725304, 10.0, 12.50971516178488, 13.15679012345679, 19.12364197530864, 11.887389117512575, 13.22949245541838, 15.223776863283039, 16.2), # 50 (16.544575576819057, 16.56245925925926, 16.300503703703704, 19.515211111111114, 17.9727313268976, 10.0, 12.46887668845316, 13.0672, 19.10638666666667, 11.846267654320988, 13.218162962962964, 15.200671604938274, 16.2), # 51 (16.551039123595647, 16.503652126200276, 16.282937722908095, 19.497740329218107, 17.975924700726743, 10.0, 12.427680335673365, 12.977846913580246, 19.0888587654321, 11.8049249565615, 13.206567701708444, 15.177250297210794, 16.2), # 52 (16.55710824530535, 16.444397256515778, 16.26516104252401, 19.479963374485596, 17.978920690532046, 10.0, 12.386202017267813, 12.888967901234569, 19.071081975308644, 11.763447059899406, 13.194716248908842, 15.153548056698675, 16.2), # 53 (16.562781668625146, 16.384800000000002, 16.2472, 19.4619, 17.981719002632804, 10.0, 12.344517647058824, 12.800799999999999, 19.05308, 11.72192, 13.18261818181818, 15.1296, 16.2), # 54 (16.568058120232035, 16.324965706447188, 16.229080932784637, 19.443569958847736, 17.984319343348304, 10.0, 12.302703138868717, 12.71358024691358, 19.034876543209876, 11.68042981252858, 13.170283077690485, 15.10544124371285, 16.2), # 55 (16.572936326802996, 16.264999725651577, 16.210830178326475, 19.424993004115226, 17.986721418997856, 10.0, 12.26083440651981, 12.627545679012346, 19.016495308641975, 11.639062533150437, 13.157720513779774, 15.0811069044353, 16.2), # 56 (16.577415015015013, 16.205007407407408, 16.192474074074077, 19.40618888888889, 17.988924935900748, 10.0, 12.218987363834422, 12.542933333333336, 18.997960000000003, 11.597904197530866, 13.144940067340068, 15.056632098765432, 16.2), # 57 (16.581492911545087, 16.145094101508917, 16.174038957475997, 19.387177366255145, 17.99092960037628, 10.0, 12.177237924634875, 12.459980246913581, 18.979294320987655, 11.557040841335164, 13.131951315625393, 15.032051943301326, 16.2), # 58 (16.585168743070195, 16.085365157750342, 16.155551165980796, 19.367978189300413, 17.992735118743752, 10.0, 12.135662002743485, 12.378923456790124, 18.960521975308644, 11.516558500228626, 13.11876383588976, 15.007401554641062, 16.2), # 59 (16.588441236267325, 16.02592592592593, 16.137037037037036, 19.34861111111111, 17.99434119732246, 10.0, 12.094335511982571, 12.3, 18.94166666666667, 11.476543209876544, 13.105387205387206, 14.982716049382717, 16.2), # 60 (16.591309117813463, 15.966881755829906, 16.11852290809328, 19.329095884773665, 17.995747542431697, 10.0, 12.053334366174454, 12.223446913580247, 18.922752098765432, 11.437081005944217, 13.091831001371743, 14.958030544124373, 16.2), # 61 (16.593771114385607, 15.908337997256517, 16.100035116598082, 19.30945226337449, 17.996953860390775, 10.0, 12.01273447914145, 12.149501234567902, 18.903801975308642, 11.398257924096939, 13.078104801097394, 14.933380155464107, 16.2), # 62 (16.595825952660736, 15.8504, 16.0816, 19.289700000000003, 17.99795985751897, 10.0, 11.972611764705881, 12.078400000000002, 18.88484, 11.36016, 13.064218181818184, 14.9088, 16.2), # 63 (16.597472359315837, 15.793173113854596, 16.0632438957476, 19.26985884773663, 17.998765240135597, 10.0, 11.933042136690068, 12.010380246913583, 18.86588987654321, 11.322873269318702, 13.050180720788127, 14.884325194330135, 16.2), # 64 (16.5987090610279, 15.73676268861454, 16.04499314128944, 19.249948559670784, 17.999369714559947, 10.0, 11.894101508916325, 11.945679012345678, 18.846975308641976, 11.286483767718336, 13.036001995261257, 14.859990855052581, 16.2), # 65 (16.599534784473914, 15.681274074074077, 16.026874074074076, 19.22998888888889, 17.999772987111317, 10.0, 11.855865795206972, 11.884533333333335, 18.828120000000002, 11.251077530864197, 13.021691582491583, 14.835832098765435, 16.2), # 66 (16.59994825633087, 15.626812620027435, 16.00891303155007, 19.209999588477366, 17.99997476410901, 10.0, 11.81841090938433, 11.827180246913583, 18.809347654320987, 11.216740594421584, 13.007259059733137, 14.811884042066758, 16.2), # 67 (16.59966658316932, 15.573197822912517, 15.991049519890261, 19.189826784755773, 17.999804728475752, 9.99981441853376, 11.781624311727434, 11.77335016003658, 18.790540557841794, 11.183392706635466, 12.992457581664603, 14.788048035039589, 16.19980024005487), # 68 (16.597026731078905, 15.51879283154122, 15.97278148148148, 19.168453623188405, 17.99825708061002, 9.998347325102882, 11.744429090154583, 11.720158024691358, 18.770876543209877, 11.150090225127087, 12.975780542264753, 14.76355035737492, 16.198217592592595), # 69 (16.59181726009423, 15.463347935749368, 15.954029492455417, 19.14573939881911, 17.995198902606308, 9.995458009449779, 11.706656215298192, 11.667123914037496, 18.750244627343395, 11.116671239140375, 12.957038218441728, 14.738276418068494, 16.195091735253776), # 70 (16.584111457028687, 15.406896269746449, 15.93480013717421, 19.12171760601181, 17.990668926006617, 9.991193293705228, 11.668322655262381, 11.61426538637403, 18.728675537265662, 11.083136574948224, 12.936299793254179, 14.712244699540344, 16.190463820301783), # 71 (16.573982608695655, 15.349470967741935, 15.915099999999999, 19.096421739130435, 17.98470588235294, 9.985600000000002, 11.62944537815126, 11.5616, 18.706200000000003, 11.04948705882353, 12.913634449760767, 14.685473684210528, 16.184375), # 72 (16.561504001908514, 15.291105163945307, 15.894935665294923, 19.069885292538917, 17.977348503187283, 9.978724950464867, 11.590041352068948, 11.50914531321445, 18.682848742569732, 11.01572351703919, 12.889111371020142, 14.65798185449907, 16.1768664266118), # 73 (16.546748923480646, 15.231831992566043, 15.874313717421124, 19.04214176060118, 17.96863552005164, 9.970614967230606, 11.550127545119556, 11.456918884316416, 18.658652491998172, 10.9818467758681, 12.86279974009097, 14.629787692826028, 16.167979252400553), # 74 (16.52979066022544, 15.171684587813619, 15.85324074074074, 19.01322463768116, 17.95860566448802, 9.961316872427986, 11.509720925407201, 11.404938271604939, 18.63364197530864, 10.947857661583152, 12.834768740031897, 14.600909681611435, 16.157754629629633), # 75 (16.510702498956285, 15.11069608389752, 15.831723319615913, 18.98316741814278, 17.94729766803841, 9.950877488187778, 11.468838461035993, 11.353221033379059, 18.607847919524463, 10.913757000457247, 12.805087553901586, 14.571366303275333, 16.146233710562413), # 76 (16.48955772648655, 15.048899615027217, 15.809768038408777, 18.95200359634997, 17.934750262244815, 9.939343636640757, 11.427497120110047, 11.301784727937816, 18.581301051668955, 10.87954561876328, 12.7738253647587, 14.54117604023777, 16.13345764746228), # 77 (16.46642962962963, 14.98632831541219, 15.787381481481482, 18.919766666666668, 17.92100217864924, 9.926762139917695, 11.38571387073348, 11.250646913580248, 18.55403209876543, 10.845224342774147, 12.741051355661883, 14.510357374918781, 16.119467592592596), # 78 (16.441391495198904, 14.923015319261916, 15.76457023319616, 18.88649012345679, 17.906092148793675, 9.913179820149367, 11.343505681010402, 11.199825148605397, 18.52607178783722, 10.810793998762742, 12.706834709669796, 14.478928789738408, 16.104304698216733), # 79 (16.414516610007755, 14.858993760785877, 15.74134087791495, 18.852207461084273, 17.890058904220126, 9.898643499466544, 11.30088951904493, 11.149336991312301, 18.497450845907636, 10.776255413001962, 12.671244609841102, 14.446908767116696, 16.08801011659808), # 80 (16.385878260869568, 14.79429677419355, 15.7177, 18.816952173913048, 17.872941176470587, 9.8832, 11.257882352941177, 11.099200000000002, 18.4682, 10.741609411764706, 12.63435023923445, 14.414315789473685, 16.070625), # 81 (16.355549734597723, 14.728957493694413, 15.693654183813445, 18.780757756307032, 17.854777697087066, 9.866896143880508, 11.214501150803258, 11.049431732967536, 18.43834997713763, 10.706856821323866, 12.596220780908501, 14.381168339229419, 16.052190500685874), # 82 (16.323604318005607, 14.663009053497943, 15.669210013717422, 18.743657702630166, 17.835607197611555, 9.849778753238837, 11.170762880735285, 11.000049748513947, 18.40793150434385, 10.671998467952339, 12.55692541792191, 14.34748489880394, 16.03274777091907), # 83 (16.290115297906603, 14.59648458781362, 15.644374074074074, 18.70568550724638, 17.815468409586057, 9.831894650205761, 11.126684510841374, 10.95107160493827, 18.376975308641974, 10.637035177923023, 12.516533333333333, 14.313283950617285, 16.012337962962963), # 84 (16.255155961114095, 14.529417230850923, 15.61915294924554, 18.666874664519593, 17.794400064552573, 9.813290656912057, 11.08228300922564, 10.902514860539554, 18.345512117055325, 10.60196777750881, 12.47511371020143, 14.2785839770895, 15.991002229080934), # 85 (16.21879959444146, 14.46184011681933, 15.593553223593966, 18.627258668813745, 17.772440894053094, 9.794013595488494, 11.037575343992193, 10.854397073616827, 18.313572656607228, 10.566797092982599, 12.432735731584856, 14.24340346064063, 15.968781721536352), # 86 (16.18111948470209, 14.393786379928315, 15.567581481481481, 18.586871014492754, 17.749629629629634, 9.774110288065843, 10.99257848324515, 10.806735802469136, 18.28118765432099, 10.531523950617284, 12.389468580542264, 14.207760883690709, 15.945717592592594), # 87 (16.142188918709373, 14.325289154387361, 15.541244307270233, 18.54574519592056, 17.726005002824177, 9.753627556774882, 10.947309395088626, 10.75954860539552, 18.248387837219937, 10.496149176685762, 12.345381440132318, 14.171674728659784, 15.921850994513035), # 88 (16.102081183276677, 14.256381574405948, 15.51454828532236, 18.503914707461085, 17.701605745178732, 9.732612223746381, 10.901785047626733, 10.712853040695016, 18.21520393232739, 10.460673597460932, 12.30054349341367, 14.135163477967897, 15.897223079561043), # 89 (16.06086956521739, 14.187096774193549, 15.4875, 18.461413043478263, 17.676470588235297, 9.711111111111112, 10.856022408963586, 10.666666666666666, 18.18166666666667, 10.425098039215687, 12.255023923444977, 14.098245614035088, 15.871875000000001), # 90 (16.0186273513449, 14.117467887959643, 15.460106035665294, 18.41827369833602, 17.650638263535864, 9.689171040999847, 10.810038447203299, 10.621007041609511, 18.14780676726109, 10.389423328222922, 12.208891913284896, 14.060939619281399, 15.845847908093276), # 91 (15.975427828472597, 14.047528049913716, 15.432372976680384, 18.374530166398284, 17.624147502622446, 9.666838835543363, 10.763850130449988, 10.57589172382259, 18.113654961133975, 10.353650290755535, 12.162216645992086, 14.023263976126877, 15.819182956104251), # 92 (15.931344283413848, 13.977310394265235, 15.404307407407408, 18.33021594202899, 17.597037037037037, 9.644161316872427, 10.717474426807762, 10.53133827160494, 18.079241975308644, 10.31777975308642, 12.1150673046252, 13.985237166991553, 15.791921296296294), # 93 (15.886450002982048, 13.906848055223684, 15.375915912208507, 18.285364519592058, 17.569345598321632, 9.621185307117818, 10.670928304380737, 10.487364243255604, 18.044598536808415, 10.281812541488476, 12.067513072242896, 13.946877674295479, 15.764104080932785), # 94 (15.840818273990577, 13.836174166998541, 15.347205075445817, 18.240009393451423, 17.541111918018238, 9.597957628410304, 10.62422873127303, 10.443987197073618, 18.00975537265661, 10.245749482234594, 12.019623131903835, 13.908203980458689, 15.735772462277092), # 95 (15.79452238325282, 13.765321863799286, 15.318181481481483, 18.194184057971015, 17.512374727668846, 9.574525102880658, 10.577392675588754, 10.401224691358026, 17.974743209876543, 10.209591401597677, 11.971466666666668, 13.869234567901238, 15.706967592592594), # 96 (15.747635617582157, 13.694324279835394, 15.28885171467764, 18.14792200751476, 17.483172758815464, 9.550934552659655, 10.530437105432021, 10.359094284407867, 17.939592775491544, 10.173339125850616, 11.923112859590052, 13.829987919043152, 15.677730624142663), # 97 (15.700231263791975, 13.623214549316343, 15.259222359396432, 18.101256736446594, 17.453544743000084, 9.52723279987807, 10.48337898890695, 10.317613534522177, 17.904334796524918, 10.136993481266307, 11.87463089373265, 13.790482516304477, 15.648102709190674), # 98 (15.652382608695653, 13.552025806451613, 15.229300000000002, 18.054221739130437, 17.423529411764708, 9.503466666666666, 10.43623529411765, 10.276800000000001, 17.869, 10.100555294117648, 11.826089952153112, 13.750736842105264, 15.618125000000001), # 99 (15.60416293910658, 13.480791185450682, 15.19909122085048, 18.00685050993022, 17.393165496651335, 9.479682975156226, 10.389022989168232, 10.236671239140376, 17.833619112940102, 10.064025390677534, 11.777559217910095, 13.710769378865548, 15.58783864883402), # 100 (15.555645541838135, 13.409543820523034, 15.168602606310015, 17.959176543209878, 17.36249172920197, 9.455928547477518, 10.34175904216282, 10.19724481024234, 17.798222862368544, 10.027404597218862, 11.72910787406226, 13.670598609005365, 15.557284807956103), # 101 (15.506903703703706, 13.338316845878138, 15.13784074074074, 17.911233333333335, 17.331546840958605, 9.432250205761319, 10.294460421205521, 10.15853827160494, 17.762841975308643, 9.990693740014526, 11.680805103668263, 13.63024301494477, 15.526504629629631), # 102 (15.458010711516671, 13.267143395725476, 15.1068122085048, 17.86305437466452, 17.300369563463246, 9.408694772138395, 10.247144094400449, 10.120569181527207, 17.72750717878372, 9.953893645337423, 11.632720089786758, 13.589721079103796, 15.495539266117968), # 103 (15.409039852090416, 13.196056604274526, 15.075523593964334, 17.814673161567367, 17.268998628257886, 9.385309068739522, 10.199827029851722, 10.083355098308186, 17.692249199817102, 9.91700513946045, 11.584922015476401, 13.549051283902486, 15.464429869684501), # 104 (15.360064412238325, 13.125089605734766, 15.043981481481481, 17.766123188405796, 17.237472766884533, 9.362139917695474, 10.152526195663453, 10.046913580246915, 17.6570987654321, 9.880029048656501, 11.537480063795854, 13.508252111760886, 15.433217592592593), # 105 (15.311157678773782, 13.054275534315678, 15.012192455418381, 17.717437949543747, 17.205830710885177, 9.339234141137021, 10.105258559939752, 10.011262185642433, 17.622086602652033, 9.842966199198472, 11.490463417803769, 13.46734204509903, 15.401943587105624), # 106 (15.26239293851017, 12.983647524226738, 14.980163100137176, 17.66865093934514, 17.174111191801824, 9.31663856119494, 10.058041090784739, 9.976418472793783, 17.58724343850023, 9.805817417359263, 11.443941260558804, 13.426339566336967, 15.370649005486968), # 107 (15.21384347826087, 12.913238709677422, 14.947900000000002, 17.619795652173917, 17.14235294117647, 9.294400000000001, 10.010890756302521, 9.942400000000001, 17.5526, 9.768583529411766, 11.397982775119617, 13.38526315789474, 15.339375000000002), # 108 (15.16558258483927, 12.843082224877207, 14.915409739369, 17.570905582393987, 17.11059469055112, 9.272565279682976, 9.96382452459722, 9.90922432556013, 17.518187014174668, 9.731265361628877, 11.352657144544864, 13.34413130219238, 15.308162722908094), # 109 (15.117683545058746, 12.77321120403558, 14.882698902606315, 17.522014224369297, 17.078875171467768, 9.251181222374639, 9.916859363772943, 9.876909007773206, 17.484035208047555, 9.693863740283494, 11.308033551893201, 13.302962481649942, 15.277053326474624), # 110 (15.07021964573269, 12.703658781362009, 14.849774074074077, 17.47315507246377, 17.047233115468412, 9.230294650205762, 9.87001224193381, 9.845471604938272, 17.450175308641978, 9.656379491648512, 11.264181180223286, 13.261775178687461, 15.246087962962964), # 111 (15.02326417367448, 12.634458091065975, 14.816641838134434, 17.42436162104133, 17.015707254095055, 9.209952385307119, 9.823300127183934, 9.814929675354367, 17.41663804298125, 9.618813441996826, 11.221169212593775, 13.220587875724977, 15.215307784636488), # 112 (14.976806757924871, 12.565757790057525, 14.78338852520331, 17.375734211987265, 16.98428108827793, 9.190191630743222, 9.776841541850832, 9.78536411004897, 17.383540498013794, 9.581287578580367, 11.179078249844586, 13.179508698407085, 15.184710241349155), # 113 (14.930369436640104, 12.498235493640857, 14.75047308003459, 17.327663074043738, 16.952629367306123, 9.170967373647843, 9.731229133456928, 9.757138015208191, 17.351390457140898, 9.544504268660452, 11.137990939381115, 13.13905947538076, 15.154040662656056), # 114 (14.883815844806392, 12.431915517892875, 14.717915092331708, 17.280135208290847, 16.920652284621763, 9.152229619998023, 9.6864954403065, 9.730244246845935, 17.320199965870064, 9.508520524780923, 11.09784721828335, 13.099260132094162, 15.123210610656603), # 115 (14.837087797180216, 12.366701250066724, 14.685651503974197, 17.233065840426246, 16.888301642214046, 9.133934203659356, 9.64256770804463, 9.70460850063839, 17.28989014276453, 9.473269373519276, 11.05856949003437, 13.060037115979753, 15.092171615609425), # 116 (14.790127108518035, 12.302496077415555, 14.653619256841578, 17.18637019614759, 16.855529242072176, 9.116036958497425, 9.599373182316404, 9.680156472261736, 17.260382106387524, 9.438683841453006, 11.020080158117253, 13.021316874470001, 15.06087520777316), # 117 (14.742875593576338, 12.239203387192518, 14.621755292813388, 17.139963501152533, 16.82228688618535, 9.098493718377823, 9.556839108766905, 9.656813857392155, 17.231596975302296, 9.404696955159615, 10.98230162601508, 12.98302585499736, 15.02927291740644), # 118 (14.695275067111588, 12.176726566650768, 14.589996553769158, 17.09376098113873, 16.788526376542755, 9.081260317166132, 9.51489273304121, 9.634506351705832, 17.20345586807207, 9.371241741216595, 10.945156297210925, 12.945090504994296, 14.997316274767892), # 119 (14.647267343880259, 12.114969003043454, 14.55827998158842, 17.04767786180383, 16.754199515133596, 9.064292588727945, 9.473461300784406, 9.613159650878949, 17.175879903260093, 9.338251226201448, 10.908566575187866, 12.907437271893276, 14.964956810116156), # 120 (14.59879423863883, 12.053834083623727, 14.5265425181507, 17.001629368845496, 16.71925810394707, 9.047546366928849, 9.432472057641569, 9.592699450587691, 17.148790199429598, 9.305658436691674, 10.872454863428986, 12.869992603126756, 14.932146053709857), # 121 (14.549797566143766, 11.993225195644738, 14.494721105335538, 16.95553072796137, 16.683653944972374, 9.03097748563443, 9.391852249257788, 9.573051446508238, 17.122107875143822, 9.273396399264763, 10.836743565417363, 12.832682946127202, 14.898835535807633), # 122 (14.50021914115155, 11.933045726359639, 14.462752685022458, 16.90929716484911, 16.647338840198707, 9.01454177871028, 9.351529121278142, 9.554141334316773, 17.095754048966008, 9.24139814049822, 10.801355084636072, 12.795434748327075, 14.864976786668116), # 123 (14.450000778418648, 11.87319906302158, 14.430574199090993, 16.86284390520638, 16.61026459161526, 8.998195080021983, 9.311429919347711, 9.535894809689482, 17.069649839459384, 9.209596686969538, 10.766211824568192, 12.758174457158841, 14.830521336549939), # 124 (14.399084292701534, 11.813588592883713, 14.398122589420678, 16.816086174730817, 16.572383001211236, 8.98189322343513, 9.271481889111582, 9.518237568302546, 17.04371636518719, 9.177925065256215, 10.731236188696803, 12.720828520054958, 14.795420715711726), # 125 (14.347411498756685, 11.754117703199192, 14.365334797891038, 16.768939199120087, 16.53364587097583, 8.965592042815308, 9.231612276214832, 9.501095305832148, 17.017874744712667, 9.146316301935748, 10.696350580504982, 12.683323384447895, 14.759626454412127), # 126 (14.294924211340579, 11.69468978122116, 14.332147766381608, 16.72131820407184, 16.494005002898238, 8.949247372028104, 9.19174832630255, 9.484393717954474, 16.99204609659905, 9.114703423585638, 10.661477403475807, 12.645585497770107, 14.723090082909758), # 127 (14.241564245209673, 11.635208214202777, 14.29849843677192, 16.67313841528373, 16.453412198967666, 8.93281504493911, 9.151817285019812, 9.4680585003457, 16.966151539409577, 9.083019456783381, 10.626539061092359, 12.607541307454062, 14.68576313146326), # 128 (14.187273415120451, 11.575576389397186, 14.264323750941504, 16.624315058453412, 16.4118192611733, 8.916250895413912, 9.111746398011702, 9.452015348682016, 16.94011219170748, 9.051197428106473, 10.591457956837715, 12.569117260932218, 14.647597130331262), # 129 (14.131993535829388, 11.515697694057547, 14.229560650769887, 16.57476335927854, 16.36917799150434, 8.899510757318094, 9.0714629109233, 9.4361899586396, 16.913849172056, 9.019170364132412, 10.556156494194951, 12.530239805637045, 14.608543609772397), # 130 (14.07566642209295, 11.455475515437003, 14.19414607813661, 16.524398543456762, 16.32544019194999, 8.88255046451725, 9.030894069399695, 9.42050802589464, 16.887283599018378, 8.986871291438696, 10.52055707664715, 12.490835389000999, 14.568554100045299), # 131 (14.018233888667616, 11.39481324078871, 14.158016974921194, 16.47313583668574, 16.280557664499447, 8.865325850876964, 8.98996711908596, 9.404895246123317, 16.860336591157846, 8.954233236602823, 10.484582107677383, 12.450830458456547, 14.527580131408602), # 132 (13.959637750309861, 11.333614257365817, 14.121110283003175, 16.420890464663124, 16.2344822111419, 8.847792750262826, 8.948609305627183, 9.389277315001811, 16.832929267037642, 8.921189226202292, 10.448153990768738, 12.410151461436149, 14.485573234120938), # 133 (13.899819821776152, 11.271781952421478, 14.083362944262086, 16.367577653086567, 16.18716563386655, 8.829906996540425, 8.906747874668445, 9.37357992820631, 16.804982745221007, 8.887672286814597, 10.411195129404286, 12.368724845372267, 14.442484938440934), # 134 (13.838721917822966, 11.209219713208839, 14.044711900577454, 16.313112627653727, 16.138559734662593, 8.811624423575347, 8.86431007185483, 9.357728781412993, 16.77641814427117, 8.853615445017242, 10.373627927067108, 12.326477057697364, 14.398266774627231), # 135 (13.776285853206776, 11.145830926981056, 14.005094093828815, 16.25741061406225, 16.08861631551923, 8.792900865233184, 8.821223142831416, 9.341649570298044, 16.74715658275137, 8.818951727387716, 10.335374787240283, 12.283334545843907, 14.352870272938459), # 136 (13.712453442684055, 11.081518980991277, 13.964446465895698, 16.200386838009802, 16.037287178425654, 8.773692155379518, 8.77741433324329, 9.325267990537647, 16.717119179224852, 8.783614160503523, 10.296358113406889, 12.239223757244352, 14.306246963633242), # 137 (13.647166501011277, 11.016187262492654, 13.922705958657628, 16.141956525194022, 15.98452412537107, 8.753954127879942, 8.732810888735527, 9.308509737807984, 16.68622705225485, 8.747535770942156, 10.256500309050004, 12.194071139331164, 14.258348376970226), # 138 (13.58036684294491, 10.949739158738339, 13.879809513994145, 16.082034901312575, 15.930278958344665, 8.733642616600042, 8.687340054953216, 9.29130050778524, 16.654401320404595, 8.710649585281116, 10.215723777652705, 12.14780313953681, 14.20912604320803), # 139 (13.511996283241437, 10.88207805698148, 13.83569407378478, 16.020537192063113, 15.874503479335647, 8.712713455405407, 8.640929077541434, 9.273565996145594, 16.62156310223733, 8.672888630097898, 10.17395092269807, 12.100346205293746, 14.158531492605304), # 140 (13.44199663665733, 10.813107344475235, 13.790296579909057, 15.957378623143285, 15.817149490333206, 8.691122478161624, 8.593505202145272, 9.255231898565233, 16.587633516316288, 8.634185931970002, 10.131104147669182, 12.05162678403444, 14.106516255420662), # 141 (13.37030971794905, 10.742730408472745, 13.743553974246513, 15.892474420250753, 15.75816879332654, 8.668825518734284, 8.544995674409803, 9.236223910720339, 16.552533681204707, 8.594474517474925, 10.087105856049115, 12.001571323191351, 14.053031861912746), # 142 (13.29687734187308, 10.67085063622717, 13.695403198676681, 15.82573980908316, 15.697513190304846, 8.64577841098897, 8.49532773998011, 9.21646772828709, 16.516184715465837, 8.553687413190165, 10.04187845132095, 11.950106270196944, 13.998029842340188), # 143 (13.221641323185896, 10.597371414991658, 13.645781195079085, 15.757090015338171, 15.635134483257326, 8.621936988791274, 8.444428644501278, 9.195889046941678, 16.478507737662895, 8.511757645693216, 9.995344336967761, 11.897158072483679, 13.941461726961624), # 144 (13.144543476643964, 10.52219613201936, 13.594624905333262, 15.686440264713433, 15.570984474173173, 8.597257086006785, 8.39222563361839, 9.174413562360282, 16.439423866359128, 8.46861824156158, 9.947425916472632, 11.842653177484022, 13.88327904603568), # 145 (13.065525617003761, 10.445228174563427, 13.541871271318747, 15.613705782906601, 15.505014965041589, 8.57169453650109, 8.338645952976528, 9.151966970219084, 16.39885422011777, 8.424202227372753, 9.898045593318638, 11.786518032630433, 13.82343332982099), # 146 (12.98452955902176, 10.366370929877009, 13.487457234915055, 15.538801795615328, 15.437177757851764, 8.545205174139772, 8.28361684822077, 9.128474966194265, 16.356719917502065, 8.378442629704233, 9.847125770988859, 11.728679085355378, 13.761876108576189), # 147 (12.901497117454435, 10.285527785213262, 13.431319738001733, 15.461643528537275, 15.367424654592899, 8.517744832788429, 8.227065564996202, 9.103863245962012, 16.312942077075245, 8.331272475133515, 9.794588852966372, 11.669062783091313, 13.698558912559907), # 148 (12.81637010705826, 10.20260212782533, 13.37339572245831, 15.382146207370084, 15.295707457254194, 8.48926934631264, 8.168919348947906, 9.078057505198506, 16.26744181740054, 8.282624790238101, 9.740357242734255, 11.607595573270707, 13.63343327203078), # 149 (12.729090342589704, 10.117497344966367, 13.313622130164312, 15.30022505781142, 15.221977967824841, 8.459734548577998, 8.109105445720962, 9.05098343957993, 16.220140257041205, 8.232432601595482, 9.684353343775589, 11.544203903326022, 13.566450717247434), # 150 (12.63959963880524, 10.030116823889527, 13.251935902999268, 15.215795305558927, 15.146187988294043, 8.429096273450089, 8.047551100960453, 9.02256674478247, 16.170958514560464, 8.180628935783165, 9.626499559573448, 11.478814220689715, 13.49756277846851), # 151 (12.54783981046135, 9.940363951847957, 13.188273982842723, 15.128772176310271, 15.06828932065099, 8.397310354794502, 7.984183560311464, 8.992733116482306, 16.119817708521552, 8.12714681937864, 9.566718293610915, 11.411352972794255, 13.426720985952636), # 152 (12.453752672314497, 9.848142116094811, 13.12257331157419, 15.039070895763093, 14.988233766884889, 8.364332626476825, 7.918930069419071, 8.96140825035562, 16.06663895748772, 8.071919278959406, 9.504931949371066, 11.341746607072103, 13.353876869958444), # 153 (12.357280039121166, 9.75335470388324, 13.054770831073213, 14.946606689615056, 14.905973128984929, 8.330118922362647, 7.851717873928365, 8.928517842078596, 16.011343380022186, 8.014879341102965, 9.44106293033698, 11.26992157095572, 13.278981960744572), # 154 (12.258363725637818, 9.655905102466392, 12.984803483219322, 14.851294783563805, 14.821459208940315, 8.294625076317555, 7.782474219484418, 8.893987587327418, 15.953852094688205, 7.955960032386807, 9.375033639991733, 11.195804311877572, 13.201987788569642), # 155 (12.15694554662093, 9.555696699097421, 12.912608209892042, 14.753050403307, 14.734643808740238, 8.257806922207138, 7.71112635173232, 8.85774318177827, 15.894086220049003, 7.8950943793884365, 9.306766481818407, 11.119321277270117, 13.122845883692296), # 156 (12.05296731682698, 9.452632881029478, 12.838121952970909, 14.6517887745423, 14.645478730373895, 8.219620293896982, 7.637601516317151, 8.819710321107332, 15.831966874667822, 7.832215408685347, 9.236183859300079, 11.04039891456582, 13.041507776371162), # 157 (11.943489514248384, 9.344724993235614, 12.75774712624377, 14.54363133064199, 14.549889769393596, 8.177639162107376, 7.560170753484572, 8.777275123758995, 15.762659346558557, 7.76538546606583, 9.160953204062308, 10.956159302710944, 12.954377375064553), # 158 (11.811658827165445, 9.220904511359164, 12.65078050944478, 14.406363454061527, 14.424306095650605, 8.117903436811366, 7.469140421417146, 8.715541652423012, 15.658283617955432, 7.683649590557993, 9.06786709699039, 10.850180037892974, 12.840684235072311), # 159 (11.655795351846896, 9.080154765665142, 12.515073532729422, 14.237724016654177, 14.266272210154874, 8.038946073676295, 7.363589997414055, 8.632958703243755, 15.515880363565842, 7.58592904298063, 8.955615213775264, 10.720803118220555, 12.69827297422973), # 160 (11.477155287337537, 8.92339338892875, 12.352075155056495, 14.039316006010765, 14.077428998851381, 7.941723586512502, 7.244290313611002, 8.530560852975649, 15.337327627198428, 7.473053109073501, 8.825186647359532, 10.569227950252113, 12.528598471710556), # 161 (11.27699483268217, 8.751538013925183, 12.163234335384793, 13.812742409722123, 13.859417347685127, 7.827192489130329, 7.112012202143695, 8.409382678373124, 15.12450345266182, 7.3458510745763705, 8.677570490685794, 10.39665394054607, 12.333115606688533), # 162 (11.056570186925597, 8.565506273429639, 11.950000032673124, 13.559606215379095, 13.613878142601102, 7.696309295340116, 6.967526495147841, 8.2704587561906, 14.87928588376465, 7.205152225229, 8.513755836696653, 10.204280495660853, 12.113279258337407), # 163 (10.817137549112616, 8.366215800217313, 11.713821205880283, 13.281510410572508, 13.342452269544303, 7.550030518952207, 6.811604024759146, 8.114823663182511, 14.603552964315558, 7.05178584677115, 8.334731778334714, 9.993307022154886, 11.870544305830926), # 164 (10.559953118288028, 8.154584227063411, 11.45614681396507, 12.980057982893204, 13.046780614459719, 7.389312673776939, 6.6450156231133155, 7.943511976103274, 14.299182738123168, 6.8865812249425815, 8.141487408542579, 9.764932926586592, 11.606365628342832), # 165 (10.286273093496636, 7.931529186743127, 11.178425815886285, 12.656851919932002, 12.728504063292343, 7.215112273624654, 6.468532122346058, 7.757558271707324, 13.968053248996117, 6.71036764548306, 7.935011820262847, 9.520357615514403, 11.322198105046873), # 166 (9.997353673783238, 7.6979683120316595, 10.882107170602728, 12.31349520927975, 12.389263501987168, 7.028385832305694, 6.28292435459308, 7.557997126749083, 13.61204254074304, 6.523974394132343, 7.716294106438124, 9.260780495496734, 11.019496615116793), # 167 (9.694451058192634, 7.454819235704206, 10.568639837073198, 11.951590838527274, 12.030699816489188, 6.830089863630398, 6.088963151990087, 7.345863117982976, 13.233028657172568, 6.328230756630195, 7.48632336001101, 8.987400973092019, 10.69971603772634), # 168 (9.378821445769624, 7.202999590535967, 10.239472774256495, 11.572741795265413, 11.654453892743392, 6.621180881409112, 5.887419346672787, 7.122190822163432, 12.832889642093342, 6.123966018716379, 7.24608867392411, 8.701418454858675, 10.364311252049257), # 169 (9.051721035559014, 6.94342700930214, 9.896054941111416, 11.178551067084992, 11.262166616694774, 6.402615399452171, 5.679063770776885, 6.888014816044876, 12.413503539313982, 5.912009466130653, 6.996579141120026, 8.404032347355134, 10.014737137259289), # 170 (8.7144060266056, 6.677019124777921, 9.539835296596765, 10.770621641576858, 10.85547887428833, 6.175349931569918, 5.464667256438089, 6.644369676381733, 11.976748392643131, 5.693190384612782, 6.738783854541357, 8.096442057139818, 9.652448572530185), # 171 (8.368132617954185, 6.4046935697385114, 9.172262799671339, 10.350556506331834, 10.436031551469046, 5.940340991572694, 5.245000635792105, 6.392289979928433, 11.524502245889417, 5.468338059902528, 6.473691907130711, 7.779846990771154, 9.278900437035686), # 172 (8.014157008649567, 6.127367976959108, 8.79478640929394, 9.919958648940762, 10.005465534181923, 5.69854509327084, 5.02083474097464, 6.132810303439398, 11.058643142861477, 5.238281777739651, 6.202292391830685, 7.45544655480756, 8.89554760994954), # 173 (7.6537353977365505, 5.845959979214909, 8.408855084423363, 9.480431056994465, 9.565421708371947, 5.450918750474696, 4.792940404121401, 5.866965223669057, 10.581049127367942, 5.003850823863915, 5.9255744015838845, 7.124440155807469, 8.503844970445494), # 174 (7.288123984259929, 5.561387209281111, 8.015917784018413, 9.033576718083788, 9.11754095998411, 5.198418476994606, 4.562088457368093, 5.595789317371834, 10.09359824321745, 4.765874484015079, 5.644527029332911, 6.788027200329303, 8.105247397697292), # 175 (6.91857896726451, 5.274567299932917, 7.617423467037885, 8.58099861979956, 8.663464174963408, 4.942000786640907, 4.329049732850424, 5.3203171613021585, 9.598168534218628, 4.525182043932907, 5.360139368020368, 6.447407094931487, 7.701209770878679), # 176 (6.546356545795092, 4.986417883945522, 7.214821092440582, 8.124299749732613, 8.204832239254838, 4.682622193223941, 4.094595062704101, 5.0415833322144525, 9.096638044180112, 4.282602789357159, 5.073400510588858, 6.103779246172446, 7.2931869691634), # 177 (6.172712918896475, 4.697856594094126, 6.809559619185302, 7.665083095473786, 7.743286038803382, 4.421239210554052, 3.859495279064828, 4.760622406863145, 8.590884816910537, 4.0389660060276, 4.78529954998098, 5.758343060610604, 6.882633871725203), # 178 (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), # 179 ) passenger_arriving_acc = ( (8, 6, 10, 8, 6, 1, 3, 1, 4, 2, 0, 0, 0, 7, 0, 1, 5, 11, 4, 4, 1, 1, 1, 0, 2, 0), # 0 (13, 12, 13, 16, 13, 2, 7, 2, 9, 2, 1, 2, 0, 19, 8, 5, 8, 20, 10, 8, 6, 6, 2, 1, 3, 0), # 1 (25, 20, 20, 22, 16, 3, 9, 4, 10, 5, 1, 2, 0, 28, 17, 10, 12, 30, 20, 14, 8, 10, 4, 3, 5, 0), # 2 (39, 37, 28, 30, 25, 7, 10, 5, 16, 6, 2, 3, 0, 41, 28, 15, 14, 36, 25, 18, 9, 14, 9, 5, 5, 0), # 3 (50, 42, 38, 37, 34, 9, 13, 7, 19, 7, 4, 5, 0, 55, 33, 26, 17, 39, 35, 20, 12, 20, 12, 5, 6, 0), # 4 (56, 48, 52, 42, 38, 10, 17, 12, 22, 11, 5, 7, 0, 72, 39, 36, 27, 44, 42, 30, 15, 21, 13, 6, 7, 0), # 5 (69, 58, 62, 51, 46, 15, 25, 16, 25, 11, 7, 7, 0, 84, 48, 46, 33, 53, 44, 36, 17, 22, 18, 7, 7, 0), # 6 (79, 67, 73, 61, 55, 19, 29, 21, 29, 12, 9, 8, 0, 97, 57, 53, 42, 60, 52, 42, 23, 23, 21, 10, 7, 0), # 7 (96, 80, 82, 72, 67, 22, 36, 24, 31, 16, 12, 9, 0, 116, 66, 61, 56, 66, 54, 49, 25, 26, 25, 11, 7, 0), # 8 (107, 94, 96, 85, 83, 29, 41, 30, 34, 23, 13, 9, 0, 126, 78, 69, 62, 75, 61, 55, 30, 31, 30, 12, 10, 0), # 9 (123, 105, 107, 101, 95, 33, 43, 35, 42, 26, 14, 9, 0, 136, 89, 80, 70, 82, 69, 60, 30, 34, 36, 14, 11, 0), # 10 (136, 119, 119, 110, 103, 41, 48, 39, 47, 32, 15, 10, 0, 148, 101, 87, 77, 92, 81, 69, 33, 38, 38, 16, 11, 0), # 11 (153, 138, 129, 121, 114, 48, 54, 47, 51, 32, 15, 10, 0, 159, 112, 100, 87, 102, 90, 73, 39, 45, 46, 18, 12, 0), # 12 (170, 153, 138, 138, 120, 54, 56, 55, 56, 39, 18, 11, 0, 174, 117, 109, 99, 111, 99, 77, 42, 48, 52, 22, 13, 0), # 13 (189, 173, 145, 149, 132, 61, 65, 63, 62, 42, 21, 11, 0, 190, 131, 122, 109, 127, 104, 80, 48, 52, 55, 23, 14, 0), # 14 (199, 192, 154, 163, 138, 67, 73, 66, 66, 43, 24, 12, 0, 202, 144, 136, 119, 142, 109, 89, 54, 58, 61, 27, 17, 0), # 15 (219, 204, 168, 180, 151, 70, 77, 73, 73, 44, 25, 14, 0, 211, 162, 143, 124, 151, 117, 95, 60, 64, 67, 32, 22, 0), # 16 (238, 223, 179, 193, 161, 70, 82, 81, 80, 50, 27, 15, 0, 227, 184, 152, 131, 163, 124, 101, 62, 75, 71, 35, 25, 0), # 17 (258, 241, 196, 211, 170, 74, 91, 86, 86, 52, 28, 16, 0, 241, 199, 158, 144, 172, 131, 105, 65, 81, 75, 38, 25, 0), # 18 (277, 260, 208, 233, 181, 79, 94, 95, 91, 58, 30, 17, 0, 264, 213, 171, 154, 190, 138, 112, 69, 84, 80, 42, 25, 0), # 19 (299, 279, 224, 254, 195, 84, 97, 102, 97, 62, 34, 21, 0, 292, 228, 192, 157, 204, 142, 123, 71, 91, 86, 42, 25, 0), # 20 (309, 294, 237, 266, 208, 94, 102, 107, 105, 66, 37, 23, 0, 309, 240, 200, 166, 214, 157, 128, 74, 92, 90, 44, 26, 0), # 21 (319, 312, 251, 284, 219, 100, 111, 115, 111, 68, 40, 27, 0, 327, 254, 209, 173, 228, 167, 132, 79, 101, 95, 46, 28, 0), # 22 (338, 326, 260, 300, 230, 106, 115, 121, 115, 70, 41, 29, 0, 339, 272, 221, 193, 237, 176, 141, 82, 110, 98, 49, 30, 0), # 23 (348, 347, 273, 318, 248, 112, 126, 124, 120, 71, 43, 30, 0, 358, 290, 235, 203, 252, 184, 144, 83, 114, 104, 54, 30, 0), # 24 (363, 363, 297, 333, 257, 124, 133, 127, 127, 75, 48, 32, 0, 376, 304, 250, 212, 275, 191, 150, 88, 118, 107, 56, 33, 0), # 25 (375, 381, 307, 347, 266, 134, 140, 133, 130, 76, 49, 33, 0, 388, 321, 265, 225, 285, 199, 158, 91, 122, 109, 56, 35, 0), # 26 (388, 401, 319, 363, 278, 141, 148, 137, 139, 77, 54, 35, 0, 406, 329, 279, 235, 301, 208, 164, 98, 126, 112, 60, 35, 0), # 27 (408, 416, 336, 378, 289, 149, 161, 145, 144, 78, 57, 37, 0, 426, 342, 292, 245, 310, 214, 171, 102, 133, 114, 62, 37, 0), # 28 (423, 429, 348, 394, 301, 154, 166, 149, 154, 83, 58, 38, 0, 444, 361, 302, 248, 333, 223, 180, 105, 141, 118, 63, 44, 0), # 29 (435, 446, 361, 409, 312, 160, 173, 154, 158, 87, 62, 38, 0, 466, 371, 315, 256, 351, 235, 184, 110, 145, 120, 65, 45, 0), # 30 (456, 461, 374, 423, 322, 165, 178, 163, 169, 89, 64, 39, 0, 481, 382, 323, 270, 369, 241, 186, 114, 149, 123, 69, 47, 0), # 31 (475, 484, 389, 444, 331, 174, 184, 169, 179, 92, 66, 40, 0, 490, 400, 338, 283, 383, 249, 190, 119, 154, 133, 72, 50, 0), # 32 (489, 503, 409, 458, 339, 177, 193, 171, 186, 96, 68, 42, 0, 505, 408, 350, 290, 394, 255, 197, 125, 163, 136, 76, 51, 0), # 33 (507, 521, 422, 475, 345, 184, 204, 173, 192, 98, 71, 43, 0, 521, 426, 360, 305, 413, 264, 207, 130, 169, 140, 79, 51, 0), # 34 (521, 534, 435, 499, 363, 189, 212, 179, 197, 99, 74, 45, 0, 538, 440, 371, 317, 427, 271, 219, 132, 175, 143, 82, 52, 0), # 35 (528, 547, 442, 517, 373, 196, 219, 185, 200, 105, 75, 46, 0, 555, 457, 381, 324, 439, 275, 223, 136, 182, 148, 86, 54, 0), # 36 (540, 568, 453, 529, 385, 203, 226, 191, 204, 105, 79, 47, 0, 576, 464, 390, 334, 449, 282, 225, 144, 185, 157, 90, 55, 0), # 37 (558, 588, 471, 540, 390, 209, 241, 196, 216, 108, 83, 47, 0, 588, 481, 401, 341, 460, 290, 234, 146, 188, 161, 93, 56, 0), # 38 (568, 606, 484, 555, 398, 213, 249, 199, 221, 113, 90, 48, 0, 602, 490, 409, 353, 479, 295, 240, 148, 189, 164, 96, 58, 0), # 39 (582, 618, 502, 564, 406, 215, 259, 208, 232, 115, 91, 48, 0, 617, 509, 423, 361, 492, 309, 246, 150, 191, 167, 97, 58, 0), # 40 (604, 631, 521, 577, 417, 222, 268, 212, 238, 117, 91, 50, 0, 631, 520, 438, 372, 503, 322, 256, 154, 196, 171, 98, 59, 0), # 41 (616, 645, 533, 593, 424, 227, 273, 217, 245, 120, 93, 54, 0, 648, 539, 449, 387, 516, 332, 262, 154, 198, 176, 104, 61, 0), # 42 (630, 663, 546, 613, 432, 232, 278, 229, 250, 122, 95, 55, 0, 664, 557, 455, 396, 531, 342, 269, 155, 204, 183, 108, 64, 0), # 43 (647, 678, 555, 622, 444, 235, 286, 237, 262, 126, 99, 56, 0, 677, 573, 469, 405, 543, 349, 275, 156, 208, 184, 109, 64, 0), # 44 (664, 689, 569, 642, 456, 238, 296, 239, 266, 128, 101, 59, 0, 687, 581, 481, 415, 565, 354, 283, 158, 213, 190, 112, 68, 0), # 45 (688, 702, 577, 655, 468, 247, 301, 244, 272, 131, 102, 60, 0, 705, 597, 499, 421, 577, 362, 286, 164, 217, 192, 113, 69, 0), # 46 (707, 722, 598, 669, 477, 254, 303, 247, 276, 132, 102, 61, 0, 718, 605, 516, 428, 589, 369, 296, 169, 225, 195, 114, 69, 0), # 47 (724, 737, 617, 680, 501, 259, 310, 252, 284, 136, 105, 62, 0, 740, 622, 524, 436, 606, 375, 302, 171, 233, 202, 115, 69, 0), # 48 (745, 757, 631, 702, 513, 261, 314, 259, 290, 138, 108, 62, 0, 753, 642, 542, 451, 615, 385, 309, 175, 241, 209, 118, 71, 0), # 49 (763, 778, 649, 709, 532, 272, 321, 262, 294, 144, 110, 63, 0, 774, 656, 549, 463, 624, 392, 314, 181, 246, 214, 123, 71, 0), # 50 (784, 792, 659, 731, 546, 279, 327, 265, 302, 148, 113, 66, 0, 794, 667, 557, 472, 631, 397, 325, 186, 249, 218, 130, 73, 0), # 51 (801, 810, 674, 744, 555, 284, 337, 269, 309, 150, 115, 70, 0, 805, 677, 570, 485, 641, 402, 332, 191, 251, 219, 134, 75, 0), # 52 (820, 830, 691, 769, 568, 295, 341, 273, 315, 151, 120, 71, 0, 828, 693, 589, 502, 659, 412, 337, 197, 257, 221, 136, 77, 0), # 53 (837, 840, 707, 787, 583, 302, 345, 281, 322, 156, 122, 72, 0, 843, 705, 598, 505, 671, 417, 345, 203, 260, 223, 139, 80, 0), # 54 (863, 856, 726, 797, 595, 309, 347, 285, 326, 158, 123, 72, 0, 860, 722, 616, 508, 681, 427, 359, 208, 267, 224, 144, 81, 0), # 55 (885, 864, 736, 814, 610, 318, 354, 288, 336, 165, 125, 73, 0, 875, 734, 629, 517, 689, 438, 364, 211, 271, 230, 144, 82, 0), # 56 (900, 874, 753, 827, 623, 323, 359, 293, 343, 168, 126, 74, 0, 884, 749, 643, 523, 700, 450, 372, 216, 277, 236, 145, 84, 0), # 57 (916, 885, 760, 846, 632, 325, 365, 300, 345, 171, 126, 77, 0, 899, 761, 659, 531, 708, 457, 380, 222, 283, 244, 147, 84, 0), # 58 (938, 901, 774, 856, 638, 330, 367, 302, 347, 176, 127, 79, 0, 914, 777, 671, 539, 716, 465, 383, 230, 288, 252, 147, 90, 0), # 59 (960, 914, 786, 868, 651, 336, 370, 308, 352, 177, 130, 80, 0, 938, 782, 674, 546, 729, 472, 396, 231, 292, 252, 151, 91, 0), # 60 (975, 934, 802, 892, 661, 342, 374, 311, 359, 179, 132, 80, 0, 950, 792, 684, 553, 747, 480, 401, 234, 294, 255, 153, 94, 0), # 61 (995, 949, 822, 907, 669, 348, 377, 315, 367, 181, 136, 80, 0, 970, 802, 692, 562, 763, 487, 406, 236, 301, 257, 158, 95, 0), # 62 (1009, 964, 832, 915, 679, 352, 383, 319, 375, 183, 138, 82, 0, 978, 811, 699, 570, 778, 497, 412, 236, 307, 262, 159, 99, 0), # 63 (1025, 986, 845, 927, 701, 355, 386, 327, 378, 186, 140, 82, 0, 992, 820, 715, 585, 787, 508, 421, 241, 314, 265, 161, 102, 0), # 64 (1038, 1002, 854, 940, 712, 359, 400, 330, 385, 187, 143, 83, 0, 1003, 834, 725, 596, 804, 524, 425, 249, 322, 270, 164, 104, 0), # 65 (1050, 1017, 870, 955, 732, 364, 405, 337, 394, 190, 147, 84, 0, 1021, 848, 740, 600, 816, 528, 431, 249, 327, 273, 168, 105, 0), # 66 (1066, 1035, 881, 968, 749, 367, 412, 339, 398, 191, 150, 86, 0, 1033, 857, 751, 611, 831, 533, 434, 250, 337, 277, 171, 106, 0), # 67 (1079, 1046, 894, 989, 757, 382, 418, 345, 402, 193, 153, 87, 0, 1046, 876, 757, 627, 845, 544, 437, 255, 349, 282, 172, 106, 0), # 68 (1093, 1061, 913, 1007, 770, 390, 423, 350, 407, 198, 154, 87, 0, 1064, 886, 764, 643, 856, 553, 440, 257, 353, 287, 178, 108, 0), # 69 (1108, 1075, 926, 1015, 780, 394, 430, 356, 411, 200, 154, 90, 0, 1073, 893, 771, 653, 863, 557, 446, 260, 361, 289, 180, 108, 0), # 70 (1130, 1089, 939, 1034, 788, 397, 434, 362, 418, 203, 154, 92, 0, 1091, 903, 780, 663, 877, 560, 453, 263, 367, 291, 182, 110, 0), # 71 (1144, 1107, 950, 1048, 797, 401, 444, 365, 421, 210, 156, 92, 0, 1104, 912, 788, 666, 885, 567, 458, 268, 381, 294, 186, 110, 0), # 72 (1155, 1123, 964, 1069, 817, 405, 451, 369, 429, 214, 158, 94, 0, 1119, 923, 798, 678, 898, 575, 465, 270, 382, 301, 187, 110, 0), # 73 (1164, 1144, 984, 1080, 835, 409, 457, 376, 434, 216, 161, 94, 0, 1130, 942, 813, 694, 909, 581, 473, 275, 387, 307, 187, 112, 0), # 74 (1177, 1163, 996, 1095, 850, 414, 461, 384, 446, 223, 165, 97, 0, 1143, 952, 823, 702, 916, 588, 479, 280, 396, 310, 190, 114, 0), # 75 (1190, 1180, 1007, 1111, 866, 420, 463, 390, 449, 225, 167, 98, 0, 1156, 964, 828, 711, 923, 596, 488, 285, 402, 314, 192, 118, 0), # 76 (1204, 1193, 1018, 1122, 875, 424, 467, 391, 456, 227, 170, 100, 0, 1181, 978, 842, 722, 933, 598, 492, 287, 409, 318, 193, 119, 0), # 77 (1211, 1204, 1035, 1133, 887, 434, 474, 399, 463, 228, 170, 101, 0, 1199, 993, 853, 727, 939, 604, 497, 290, 414, 325, 194, 119, 0), # 78 (1229, 1216, 1051, 1148, 897, 439, 480, 401, 468, 232, 171, 102, 0, 1216, 1008, 864, 742, 957, 610, 503, 296, 420, 326, 198, 119, 0), # 79 (1245, 1232, 1070, 1161, 906, 448, 485, 406, 480, 235, 174, 102, 0, 1233, 1020, 872, 749, 969, 615, 507, 301, 424, 328, 200, 121, 0), # 80 (1257, 1247, 1084, 1172, 917, 451, 490, 413, 485, 239, 175, 105, 0, 1247, 1029, 884, 754, 979, 628, 509, 302, 432, 330, 203, 123, 0), # 81 (1271, 1256, 1099, 1188, 925, 459, 496, 418, 490, 241, 178, 106, 0, 1262, 1045, 898, 762, 991, 635, 515, 304, 439, 335, 206, 124, 0), # 82 (1281, 1267, 1117, 1199, 938, 463, 500, 423, 494, 245, 179, 109, 0, 1282, 1058, 911, 771, 1009, 641, 519, 310, 444, 340, 207, 128, 0), # 83 (1296, 1281, 1125, 1218, 954, 467, 507, 428, 497, 245, 183, 109, 0, 1301, 1071, 920, 781, 1019, 645, 526, 313, 453, 349, 210, 130, 0), # 84 (1316, 1291, 1133, 1230, 965, 472, 511, 430, 505, 249, 184, 109, 0, 1314, 1091, 930, 787, 1030, 654, 530, 315, 457, 355, 215, 132, 0), # 85 (1333, 1305, 1145, 1241, 977, 475, 515, 434, 513, 250, 187, 111, 0, 1328, 1100, 936, 796, 1041, 665, 540, 320, 465, 359, 216, 133, 0), # 86 (1350, 1319, 1159, 1253, 990, 479, 521, 438, 519, 254, 187, 114, 0, 1336, 1107, 947, 808, 1054, 667, 545, 326, 472, 362, 220, 134, 0), # 87 (1362, 1332, 1176, 1267, 1002, 482, 528, 449, 526, 258, 188, 117, 0, 1350, 1122, 963, 817, 1065, 673, 549, 330, 477, 370, 222, 135, 0), # 88 (1380, 1338, 1194, 1285, 1010, 488, 531, 455, 532, 260, 192, 117, 0, 1361, 1144, 973, 830, 1076, 677, 554, 334, 483, 373, 227, 136, 0), # 89 (1398, 1349, 1202, 1300, 1030, 494, 539, 462, 536, 267, 194, 120, 0, 1380, 1162, 984, 835, 1085, 682, 560, 336, 491, 379, 229, 136, 0), # 90 (1414, 1364, 1213, 1308, 1041, 501, 543, 467, 544, 269, 196, 120, 0, 1399, 1177, 997, 840, 1102, 686, 569, 342, 496, 383, 231, 136, 0), # 91 (1428, 1378, 1225, 1318, 1051, 508, 551, 471, 546, 273, 198, 122, 0, 1418, 1188, 1008, 849, 1109, 690, 576, 347, 500, 387, 234, 136, 0), # 92 (1446, 1387, 1238, 1334, 1064, 519, 555, 479, 551, 275, 200, 125, 0, 1436, 1210, 1016, 856, 1125, 696, 580, 350, 504, 392, 235, 136, 0), # 93 (1465, 1399, 1253, 1348, 1076, 521, 560, 481, 557, 279, 201, 128, 0, 1455, 1220, 1026, 866, 1138, 702, 589, 353, 511, 392, 239, 136, 0), # 94 (1478, 1402, 1262, 1366, 1089, 528, 569, 486, 567, 283, 204, 131, 0, 1469, 1235, 1038, 875, 1144, 707, 600, 360, 515, 395, 240, 136, 0), # 95 (1497, 1409, 1277, 1386, 1104, 539, 572, 492, 572, 287, 205, 131, 0, 1483, 1255, 1049, 885, 1152, 712, 607, 363, 525, 398, 241, 136, 0), # 96 (1517, 1418, 1289, 1401, 1115, 546, 574, 501, 579, 287, 210, 131, 0, 1501, 1262, 1056, 894, 1161, 717, 613, 366, 529, 402, 242, 136, 0), # 97 (1529, 1434, 1302, 1414, 1122, 550, 577, 503, 585, 287, 211, 133, 0, 1521, 1279, 1070, 902, 1172, 725, 616, 372, 536, 406, 246, 137, 0), # 98 (1547, 1440, 1315, 1430, 1134, 555, 581, 509, 590, 288, 213, 135, 0, 1537, 1295, 1077, 911, 1182, 732, 619, 376, 539, 411, 248, 139, 0), # 99 (1562, 1454, 1329, 1441, 1149, 561, 591, 512, 596, 290, 215, 138, 0, 1551, 1306, 1087, 920, 1196, 740, 623, 379, 548, 414, 249, 141, 0), # 100 (1572, 1471, 1340, 1446, 1162, 568, 598, 516, 602, 291, 215, 140, 0, 1567, 1315, 1098, 930, 1204, 745, 626, 383, 553, 419, 253, 143, 0), # 101 (1596, 1493, 1353, 1461, 1172, 578, 601, 519, 606, 292, 218, 141, 0, 1584, 1328, 1112, 930, 1213, 746, 630, 387, 556, 420, 255, 144, 0), # 102 (1617, 1507, 1362, 1475, 1186, 587, 606, 525, 613, 294, 221, 141, 0, 1604, 1337, 1115, 932, 1231, 748, 633, 389, 563, 426, 255, 147, 0), # 103 (1633, 1523, 1373, 1490, 1197, 591, 611, 528, 620, 298, 223, 144, 0, 1621, 1347, 1123, 938, 1245, 751, 635, 396, 568, 432, 255, 148, 0), # 104 (1648, 1529, 1389, 1505, 1207, 597, 617, 537, 625, 299, 225, 148, 0, 1636, 1359, 1130, 944, 1256, 754, 641, 400, 571, 439, 261, 149, 0), # 105 (1664, 1543, 1400, 1511, 1218, 600, 623, 539, 634, 301, 226, 150, 0, 1652, 1364, 1138, 950, 1270, 758, 647, 405, 579, 444, 263, 150, 0), # 106 (1680, 1552, 1417, 1520, 1232, 607, 630, 545, 641, 305, 227, 153, 0, 1667, 1377, 1147, 955, 1283, 760, 649, 409, 584, 450, 264, 154, 0), # 107 (1696, 1563, 1427, 1530, 1247, 611, 636, 547, 646, 307, 229, 156, 0, 1681, 1386, 1155, 965, 1301, 763, 654, 413, 592, 455, 265, 157, 0), # 108 (1710, 1571, 1439, 1542, 1262, 615, 642, 548, 649, 310, 233, 156, 0, 1693, 1398, 1163, 973, 1314, 769, 659, 416, 600, 457, 266, 158, 0), # 109 (1729, 1577, 1454, 1556, 1269, 620, 648, 555, 655, 313, 235, 158, 0, 1705, 1405, 1167, 979, 1320, 776, 664, 419, 613, 462, 267, 160, 0), # 110 (1746, 1588, 1466, 1567, 1283, 621, 652, 564, 659, 314, 237, 159, 0, 1721, 1410, 1175, 988, 1333, 780, 669, 420, 616, 466, 273, 161, 0), # 111 (1765, 1597, 1479, 1584, 1299, 634, 659, 567, 662, 315, 240, 162, 0, 1732, 1427, 1186, 995, 1351, 788, 674, 422, 624, 468, 275, 161, 0), # 112 (1784, 1607, 1491, 1596, 1306, 644, 663, 570, 666, 318, 240, 163, 0, 1750, 1441, 1196, 1005, 1359, 797, 679, 426, 632, 472, 277, 163, 0), # 113 (1801, 1613, 1505, 1606, 1319, 646, 672, 572, 677, 320, 244, 165, 0, 1762, 1445, 1204, 1015, 1374, 807, 686, 430, 636, 473, 281, 165, 0), # 114 (1818, 1624, 1519, 1618, 1328, 650, 675, 575, 683, 321, 245, 167, 0, 1777, 1462, 1212, 1022, 1380, 811, 689, 433, 648, 477, 283, 165, 0), # 115 (1830, 1631, 1527, 1633, 1343, 657, 679, 580, 687, 327, 248, 169, 0, 1795, 1478, 1226, 1030, 1392, 813, 691, 436, 654, 480, 283, 169, 0), # 116 (1843, 1642, 1541, 1642, 1349, 662, 684, 583, 692, 331, 250, 171, 0, 1817, 1492, 1234, 1038, 1403, 821, 694, 440, 664, 480, 286, 169, 0), # 117 (1856, 1653, 1550, 1654, 1355, 672, 688, 588, 698, 333, 254, 171, 0, 1830, 1500, 1246, 1045, 1417, 824, 698, 442, 669, 482, 290, 170, 0), # 118 (1868, 1663, 1560, 1668, 1370, 683, 693, 590, 701, 334, 255, 173, 0, 1851, 1510, 1249, 1051, 1430, 830, 702, 447, 673, 488, 295, 172, 0), # 119 (1885, 1676, 1570, 1679, 1388, 687, 698, 594, 704, 336, 256, 173, 0, 1876, 1522, 1255, 1058, 1442, 837, 706, 447, 676, 492, 296, 174, 0), # 120 (1898, 1691, 1582, 1688, 1398, 692, 702, 598, 707, 338, 258, 174, 0, 1887, 1534, 1261, 1067, 1452, 838, 710, 452, 685, 497, 300, 176, 0), # 121 (1919, 1711, 1598, 1701, 1410, 695, 706, 600, 713, 340, 261, 175, 0, 1897, 1546, 1268, 1070, 1457, 844, 716, 457, 691, 502, 303, 176, 0), # 122 (1929, 1720, 1609, 1708, 1419, 703, 711, 605, 718, 342, 263, 177, 0, 1912, 1563, 1276, 1076, 1478, 851, 723, 465, 697, 507, 304, 176, 0), # 123 (1943, 1728, 1619, 1720, 1430, 710, 714, 608, 721, 344, 264, 177, 0, 1925, 1568, 1284, 1083, 1488, 855, 726, 466, 702, 516, 305, 177, 0), # 124 (1960, 1738, 1631, 1740, 1443, 715, 716, 612, 724, 347, 266, 178, 0, 1937, 1574, 1300, 1087, 1495, 860, 729, 470, 707, 521, 307, 178, 0), # 125 (1975, 1749, 1640, 1755, 1452, 720, 719, 616, 727, 349, 267, 178, 0, 1953, 1587, 1311, 1093, 1508, 865, 733, 475, 711, 525, 311, 179, 0), # 126 (1991, 1757, 1654, 1772, 1462, 730, 720, 620, 735, 352, 268, 178, 0, 1967, 1598, 1319, 1099, 1514, 871, 738, 480, 716, 527, 313, 180, 0), # 127 (2007, 1759, 1664, 1784, 1471, 733, 724, 625, 740, 357, 269, 179, 0, 1981, 1609, 1330, 1103, 1525, 880, 740, 483, 722, 535, 316, 180, 0), # 128 (2025, 1769, 1672, 1804, 1482, 740, 727, 630, 747, 360, 273, 181, 0, 1991, 1624, 1342, 1110, 1539, 889, 745, 487, 726, 545, 319, 181, 0), # 129 (2037, 1778, 1683, 1816, 1495, 746, 733, 632, 754, 363, 278, 181, 0, 2011, 1637, 1351, 1115, 1547, 896, 748, 490, 733, 548, 320, 181, 0), # 130 (2051, 1788, 1696, 1826, 1502, 752, 736, 637, 762, 367, 281, 182, 0, 2023, 1649, 1361, 1122, 1549, 902, 755, 496, 738, 553, 321, 181, 0), # 131 (2061, 1795, 1707, 1836, 1514, 760, 740, 639, 766, 369, 283, 183, 0, 2042, 1658, 1372, 1128, 1563, 907, 759, 500, 744, 555, 322, 182, 0), # 132 (2072, 1804, 1722, 1856, 1520, 763, 742, 647, 768, 371, 285, 185, 0, 2054, 1667, 1379, 1133, 1570, 910, 763, 505, 752, 561, 329, 182, 0), # 133 (2081, 1812, 1730, 1867, 1528, 774, 745, 654, 774, 373, 288, 186, 0, 2075, 1676, 1387, 1142, 1584, 915, 766, 506, 759, 567, 329, 182, 0), # 134 (2092, 1825, 1736, 1879, 1537, 776, 748, 659, 778, 375, 291, 188, 0, 2090, 1690, 1394, 1146, 1591, 922, 770, 508, 765, 569, 335, 182, 0), # 135 (2098, 1832, 1745, 1898, 1549, 779, 751, 665, 784, 377, 293, 188, 0, 2105, 1708, 1400, 1155, 1598, 927, 774, 511, 775, 569, 337, 183, 0), # 136 (2116, 1841, 1758, 1910, 1561, 789, 753, 666, 791, 379, 293, 190, 0, 2120, 1722, 1405, 1164, 1612, 932, 784, 515, 778, 573, 339, 184, 0), # 137 (2131, 1846, 1771, 1928, 1573, 799, 758, 673, 794, 380, 295, 192, 0, 2129, 1735, 1420, 1171, 1619, 935, 789, 518, 782, 577, 341, 184, 0), # 138 (2143, 1852, 1779, 1935, 1580, 809, 760, 677, 797, 381, 296, 193, 0, 2146, 1744, 1427, 1181, 1625, 936, 794, 520, 790, 581, 343, 185, 0), # 139 (2156, 1857, 1787, 1950, 1589, 817, 761, 680, 802, 384, 299, 193, 0, 2158, 1753, 1435, 1190, 1636, 944, 797, 524, 797, 585, 344, 187, 0), # 140 (2173, 1870, 1797, 1964, 1596, 820, 765, 688, 808, 386, 302, 193, 0, 2171, 1764, 1442, 1199, 1650, 946, 801, 526, 802, 588, 347, 187, 0), # 141 (2182, 1877, 1805, 1975, 1605, 824, 770, 689, 820, 389, 303, 193, 0, 2183, 1768, 1450, 1205, 1660, 953, 804, 530, 804, 590, 348, 188, 0), # 142 (2194, 1885, 1818, 1990, 1615, 828, 773, 701, 830, 389, 305, 195, 0, 2195, 1780, 1462, 1216, 1668, 958, 809, 535, 809, 595, 350, 190, 0), # 143 (2206, 1896, 1829, 2003, 1627, 829, 775, 704, 838, 391, 306, 198, 0, 2205, 1791, 1470, 1222, 1685, 965, 816, 542, 815, 599, 351, 190, 0), # 144 (2220, 1906, 1838, 2015, 1634, 834, 779, 707, 843, 392, 309, 198, 0, 2214, 1799, 1481, 1225, 1699, 969, 825, 548, 820, 604, 351, 190, 0), # 145 (2237, 1914, 1850, 2027, 1647, 837, 786, 716, 850, 394, 309, 199, 0, 2227, 1805, 1483, 1230, 1702, 974, 830, 549, 825, 607, 354, 192, 0), # 146 (2247, 1932, 1859, 2036, 1656, 840, 788, 719, 853, 396, 310, 201, 0, 2240, 1812, 1487, 1240, 1708, 978, 835, 552, 830, 608, 357, 193, 0), # 147 (2263, 1941, 1871, 2049, 1666, 844, 794, 721, 856, 401, 311, 203, 0, 2250, 1820, 1494, 1244, 1715, 983, 838, 556, 833, 613, 358, 195, 0), # 148 (2282, 1952, 1884, 2056, 1673, 851, 796, 726, 861, 404, 311, 203, 0, 2263, 1826, 1501, 1251, 1731, 989, 844, 558, 838, 617, 360, 197, 0), # 149 (2295, 1960, 1896, 2066, 1681, 855, 799, 728, 869, 404, 312, 203, 0, 2278, 1835, 1514, 1260, 1744, 994, 847, 563, 844, 622, 361, 198, 0), # 150 (2305, 1968, 1905, 2078, 1689, 859, 800, 730, 874, 408, 313, 203, 0, 2293, 1846, 1528, 1264, 1758, 999, 849, 565, 851, 624, 362, 198, 0), # 151 (2318, 1974, 1917, 2092, 1696, 863, 802, 735, 881, 411, 314, 204, 0, 2306, 1858, 1535, 1270, 1765, 1007, 855, 566, 859, 633, 364, 198, 0), # 152 (2337, 1984, 1926, 2104, 1702, 864, 808, 738, 887, 412, 315, 204, 0, 2320, 1867, 1542, 1276, 1774, 1012, 859, 572, 867, 638, 366, 198, 0), # 153 (2349, 1993, 1941, 2114, 1711, 867, 812, 739, 889, 413, 315, 204, 0, 2332, 1874, 1550, 1285, 1788, 1015, 862, 575, 871, 642, 366, 199, 0), # 154 (2358, 2003, 1953, 2127, 1724, 870, 818, 742, 894, 416, 316, 204, 0, 2347, 1883, 1556, 1290, 1800, 1019, 863, 576, 875, 646, 366, 199, 0), # 155 (2373, 2012, 1970, 2134, 1740, 875, 825, 744, 895, 418, 318, 205, 0, 2358, 1889, 1569, 1297, 1816, 1022, 866, 581, 880, 650, 369, 199, 0), # 156 (2381, 2015, 1982, 2143, 1748, 879, 831, 745, 897, 419, 319, 205, 0, 2371, 1902, 1575, 1298, 1822, 1025, 868, 583, 886, 658, 372, 199, 0), # 157 (2398, 2019, 1991, 2158, 1759, 882, 833, 749, 903, 419, 320, 205, 0, 2386, 1916, 1578, 1304, 1828, 1029, 869, 586, 887, 662, 374, 199, 0), # 158 (2408, 2025, 1999, 2166, 1764, 885, 835, 752, 909, 421, 321, 205, 0, 2394, 1921, 1588, 1310, 1837, 1040, 873, 586, 892, 666, 377, 199, 0), # 159 (2420, 2034, 2008, 2176, 1773, 892, 838, 756, 917, 423, 322, 206, 0, 2402, 1927, 1593, 1316, 1853, 1046, 881, 591, 897, 669, 380, 202, 0), # 160 (2428, 2040, 2015, 2189, 1788, 897, 843, 758, 925, 423, 323, 207, 0, 2415, 1933, 1601, 1319, 1861, 1049, 887, 592, 898, 670, 381, 203, 0), # 161 (2439, 2051, 2025, 2194, 1801, 904, 844, 758, 929, 424, 324, 207, 0, 2427, 1943, 1606, 1323, 1869, 1053, 891, 593, 902, 675, 383, 206, 0), # 162 (2450, 2056, 2036, 2208, 1810, 913, 847, 761, 935, 425, 327, 207, 0, 2444, 1966, 1612, 1324, 1878, 1055, 894, 596, 905, 678, 386, 207, 0), # 163 (2463, 2065, 2041, 2225, 1819, 916, 847, 765, 945, 425, 329, 209, 0, 2453, 1982, 1616, 1326, 1889, 1061, 896, 603, 908, 680, 387, 207, 0), # 164 (2474, 2072, 2051, 2233, 1826, 921, 849, 768, 948, 428, 330, 209, 0, 2462, 1991, 1625, 1330, 1901, 1064, 903, 608, 911, 682, 389, 208, 0), # 165 (2481, 2078, 2057, 2244, 1832, 922, 853, 770, 951, 430, 333, 209, 0, 2474, 1995, 1636, 1336, 1908, 1067, 906, 611, 917, 687, 392, 209, 0), # 166 (2489, 2085, 2067, 2249, 1837, 926, 857, 773, 958, 432, 333, 209, 0, 2492, 2005, 1641, 1344, 1913, 1070, 908, 614, 924, 691, 394, 211, 0), # 167 (2499, 2092, 2078, 2257, 1846, 928, 859, 777, 962, 434, 333, 209, 0, 2502, 2012, 1647, 1349, 1919, 1075, 911, 618, 930, 694, 395, 212, 0), # 168 (2511, 2103, 2085, 2265, 1860, 932, 862, 779, 968, 434, 335, 210, 0, 2514, 2022, 1656, 1353, 1928, 1080, 912, 622, 932, 694, 399, 212, 0), # 169 (2520, 2113, 2095, 2269, 1863, 938, 866, 783, 973, 436, 335, 211, 0, 2530, 2030, 1660, 1358, 1936, 1085, 915, 627, 934, 697, 400, 213, 0), # 170 (2528, 2118, 2106, 2275, 1874, 941, 870, 788, 977, 436, 336, 212, 0, 2537, 2035, 1666, 1361, 1941, 1087, 917, 629, 939, 702, 401, 213, 0), # 171 (2532, 2123, 2111, 2282, 1881, 946, 872, 792, 983, 438, 336, 213, 0, 2545, 2043, 1670, 1366, 1947, 1095, 920, 633, 943, 704, 406, 213, 0), # 172 (2537, 2127, 2117, 2288, 1884, 949, 872, 794, 986, 440, 338, 215, 0, 2554, 2052, 1673, 1368, 1952, 1099, 922, 633, 947, 710, 406, 213, 0), # 173 (2544, 2132, 2122, 2297, 1889, 952, 873, 798, 987, 441, 338, 217, 0, 2566, 2060, 1676, 1371, 1959, 1101, 925, 633, 957, 712, 406, 214, 0), # 174 (2550, 2138, 2127, 2309, 1898, 953, 874, 801, 991, 441, 338, 217, 0, 2574, 2064, 1681, 1375, 1962, 1105, 929, 635, 958, 715, 407, 215, 0), # 175 (2561, 2142, 2131, 2320, 1906, 957, 874, 803, 992, 442, 339, 218, 0, 2579, 2069, 1686, 1380, 1968, 1107, 935, 637, 958, 718, 410, 215, 0), # 176 (2567, 2148, 2137, 2326, 1914, 960, 876, 804, 995, 442, 339, 218, 0, 2585, 2072, 1690, 1385, 1973, 1112, 938, 637, 959, 721, 413, 215, 0), # 177 (2578, 2150, 2145, 2332, 1921, 962, 880, 806, 996, 443, 339, 220, 0, 2590, 2077, 1693, 1386, 1977, 1118, 940, 639, 961, 723, 414, 215, 0), # 178 (2578, 2150, 2145, 2332, 1921, 962, 880, 806, 996, 443, 339, 220, 0, 2590, 2077, 1693, 1386, 1977, 1118, 940, 639, 961, 723, 414, 215, 0), # 179 ) passenger_arriving_rate = ( (8.033384925394829, 8.103756554216645, 6.9483776394833425, 7.45760132863612, 5.924997981450252, 2.9294112699015167, 3.3168284922991322, 3.102117448652949, 3.2480528331562706, 1.5832060062089484, 1.1214040437028276, 0.6530553437741565, 0.0, 8.134208340125381, 7.183608781515721, 5.607020218514138, 4.749618018626844, 6.496105666312541, 4.342964428114128, 3.3168284922991322, 2.0924366213582264, 2.962498990725126, 2.4858671095453735, 1.3896755278966686, 0.7367051412924223, 0.0), # 0 (8.566923443231959, 8.638755684745645, 7.407128788440204, 7.95017310393194, 6.317323026639185, 3.122918011773052, 3.535575153010955, 3.306342481937139, 3.462530840710885, 1.6875922769108604, 1.1954923029216353, 0.6961622214419141, 0.0, 8.671666635903767, 7.657784435861053, 5.9774615146081755, 5.06277683073258, 6.92506168142177, 4.628879474711995, 3.535575153010955, 2.230655722695037, 3.1586615133195926, 2.650057701310647, 1.4814257576880407, 0.7853414258859679, 0.0), # 1 (9.09875681436757, 9.171631583973436, 7.864056380729885, 8.440785245597754, 6.708227171999727, 3.3156527735449486, 3.7534548063685635, 3.5097501652696135, 3.676152963668026, 1.7915655100082188, 1.269286173007017, 0.7390976869404075, 0.0, 9.206983725135505, 8.13007455634448, 6.346430865035084, 5.374696530024655, 7.352305927336052, 4.913650231377459, 3.7534548063685635, 2.3683234096749635, 3.3541135859998636, 2.8135950818659183, 1.5728112761459772, 0.8337846894521307, 0.0), # 2 (9.6268124690345, 9.70027006950679, 8.317347825759807, 8.927491689038488, 7.096172454402028, 3.5068512477461056, 3.9696029133183646, 3.7115341049963386, 3.8880720858245827, 1.8947130793704727, 1.3424929098206355, 0.7816914246573948, 0.0, 9.738036490006762, 8.598605671231342, 6.712464549103178, 5.684139238111417, 7.7761441716491655, 5.196147746994874, 3.9696029133183646, 2.5048937483900753, 3.548086227201014, 2.97583056301283, 1.6634695651519613, 0.8818427335915264, 0.0), # 3 (10.149017837465571, 10.222556958952469, 8.765190532937382, 9.408346369659084, 7.479620910716259, 3.6957491269054237, 4.183154934806767, 3.910887907463277, 4.097441090977444, 1.996622358867072, 1.4148197692241535, 0.8237731189806353, 0.0, 10.262701812703709, 9.061504308786986, 7.074098846120767, 5.9898670766012145, 8.194882181954888, 5.475243070448588, 4.183154934806767, 2.6398208049324454, 3.7398104553581293, 3.136115456553029, 1.7530381065874767, 0.9293233599047701, 0.0), # 4 (10.663300349893618, 10.736378069917262, 9.205771911670025, 9.881403222864472, 7.8570345778125645, 3.8815821035518008, 4.393246331780179, 4.1070051790163955, 4.303412862923498, 2.096880722367466, 1.4859740070792353, 0.8651724542978865, 0.0, 10.778856575412524, 9.51689699727675, 7.429870035396177, 6.290642167102396, 8.606825725846996, 5.749807250622953, 4.393246331780179, 2.772558645394143, 3.9285172889062823, 3.2938010742881585, 1.841154382334005, 0.9760343699924785, 0.0), # 5 (11.167587436551466, 11.239619220007935, 9.637279371365155, 10.344716184059584, 8.226875492561113, 4.06358587021414, 4.59901256518501, 4.299079526001659, 4.5051402854596345, 2.195075543741104, 1.555662879247542, 0.9057191149969079, 0.0, 11.284377660319372, 9.962910264965986, 7.77831439623771, 6.5852266312233105, 9.010280570919269, 6.018711336402323, 4.59901256518501, 2.902561335867243, 4.113437746280557, 3.448238728019862, 1.9274558742730312, 1.021783565455267, 0.0), # 6 (11.65980652767195, 11.73016622683126, 10.05790032143018, 10.796339188649355, 8.587605691832056, 4.2409961194213395, 4.799589095967668, 4.486304554765035, 4.701776242382744, 2.2907941968574352, 1.6235936415907386, 0.9452427854654573, 0.0, 11.777141949610431, 10.397670640120028, 8.117968207953693, 6.872382590572304, 9.403552484765488, 6.280826376671049, 4.799589095967668, 3.029282942443814, 4.293802845916028, 3.598779729549786, 2.0115800642860364, 1.066378747893751, 0.0), # 7 (12.137885053487896, 12.205904907994013, 10.465822171272528, 11.234326172038713, 8.937687212495558, 4.413048543702297, 4.994111385074558, 4.667873871652484, 4.89247361748971, 2.3836240555859103, 1.6894735499704858, 0.9835731500912939, 0.0, 12.255026325471867, 10.81930465100423, 8.447367749852429, 7.150872166757729, 9.78494723497942, 6.535023420313477, 4.994111385074558, 3.152177531215927, 4.468843606247779, 3.744775390679572, 2.093164434254506, 1.1096277189085468, 0.0), # 8 (12.599750444232136, 12.664721081102966, 10.859232330299607, 11.656731069632603, 9.27558209142177, 4.578978835585919, 5.181714893452096, 4.842981083009976, 5.076385294577426, 2.4731524937959772, 1.7530098602484476, 1.0205398932621754, 0.0, 12.71590767008986, 11.225938825883926, 8.765049301242238, 7.41945748138793, 10.152770589154851, 6.780173516213966, 5.181714893452096, 3.270699168275656, 4.637791045710885, 3.8855770232108684, 2.1718464660599213, 1.1513382801002698, 0.0), # 9 (13.043330130137491, 13.104500563764889, 11.236318207918833, 12.061607816835945, 9.599752365480853, 4.7380226876011005, 5.361535082046684, 5.010819795183474, 5.252664157442781, 2.558966885357086, 1.8139098282862867, 1.0559726993658605, 0.0, 13.157662865650577, 11.615699693024464, 9.069549141431432, 7.676900656071258, 10.505328314885562, 7.015147713256865, 5.361535082046684, 3.3843019197150714, 4.799876182740427, 4.020535938945316, 2.247263641583767, 1.1913182330695355, 0.0), # 10 (13.466551541436809, 13.52312917358657, 11.595267213537621, 12.447010349053677, 9.908660071542968, 4.889415792276744, 5.532707411804733, 5.170583614518944, 5.420463089882663, 2.640654604138688, 1.8718807099456667, 1.0897012527901082, 0.0, 13.57816879434018, 11.986713780691188, 9.359403549728333, 7.921963812416063, 10.840926179765326, 7.238817060326522, 5.532707411804733, 3.4924398516262456, 4.954330035771484, 4.14900344968456, 2.3190534427075247, 1.229375379416961, 0.0), # 11 (13.8673421083629, 13.918492728174757, 11.934266756563387, 12.810992601690735, 10.200767246478268, 5.032393842141746, 5.694367343672649, 5.321466147362347, 5.578934975693962, 2.7178030240102293, 1.9266297610882495, 1.1215552379226759, 0.0, 13.975302338344855, 12.337107617149433, 9.633148805441246, 8.153409072030687, 11.157869951387925, 7.4500526063072865, 5.694367343672649, 3.5945670301012465, 5.100383623239134, 4.270330867230246, 2.3868533513126775, 1.26531752074316, 0.0), # 12 (14.243629261148602, 14.288477045136244, 12.251504246403549, 13.151608510152053, 10.474535927156907, 5.166192529725009, 5.845650338596845, 5.462661000059654, 5.727232698673564, 2.7899995188411624, 1.9778642375756985, 1.1513643391513229, 0.0, 14.346940379850777, 12.66500773066455, 9.889321187878492, 8.369998556523486, 11.454465397347128, 7.647725400083517, 5.845650338596845, 3.6901375212321494, 5.237267963578454, 4.383869503384019, 2.45030084928071, 1.2989524586487495, 0.0), # 13 (14.593340430026746, 14.630967942077797, 12.54516709246553, 13.466912009842552, 10.728428150449055, 5.2900475475554325, 5.9856918575237295, 5.593361778956831, 5.864509142618358, 2.856831462500934, 2.0252913952696763, 1.1789582408638082, 0.0, 14.690959801044102, 12.968540649501888, 10.12645697634838, 8.570494387502801, 11.729018285236716, 7.830706490539565, 5.9856918575237295, 3.778605391111023, 5.3642140752245275, 4.488970669947518, 2.509033418493106, 1.3300879947343454, 0.0), # 14 (14.914403045230168, 14.943851236606186, 12.813442704156724, 13.754957036167184, 10.960905953224861, 5.403194588161918, 6.1136273613997005, 5.7127620903998375, 5.989917191325237, 2.917886228858997, 2.0686184900318456, 1.2041666274478897, 0.0, 15.00523748411101, 13.245832901926784, 10.343092450159226, 8.753658686576989, 11.979834382650473, 7.997866926559773, 6.1136273613997005, 3.8594247058299413, 5.480452976612431, 4.584985678722395, 2.562688540831345, 1.3585319306005625, 0.0), # 15 (15.204744536991681, 15.225012746328195, 13.054518490884568, 14.013797524530858, 11.170431372354487, 5.504869344073363, 6.228592311171181, 5.820055540734641, 6.102609728591085, 2.972751191784799, 2.1075527777238703, 1.2268191832913256, 0.0, 15.287650311237673, 13.495011016204579, 10.53776388861935, 8.918253575354395, 12.20521945718217, 8.148077757028497, 6.228592311171181, 3.932049531480973, 5.585215686177244, 4.671265841510287, 2.6109036981769136, 1.384092067848018, 0.0), # 16 (15.46229233554412, 15.472338288850588, 13.266581862056471, 14.241487410338536, 11.355466444708094, 5.594307507818667, 6.329722167784569, 5.914435736307213, 6.201739638212791, 3.021013725147788, 2.141801514207413, 1.2467455927818742, 0.0, 15.536075164610265, 13.714201520600614, 10.709007571037066, 9.063041175443361, 12.403479276425582, 8.280210030830098, 6.329722167784569, 3.9959339341561906, 5.677733222354047, 4.747162470112846, 2.6533163724112945, 1.4065762080773265, 0.0), # 17 (15.684973871120327, 15.683713681780135, 13.447820227079841, 14.436080628995136, 11.514473207155827, 5.670744771926737, 6.416152392186281, 5.995096283463507, 6.286459803987251, 3.0622612028174157, 2.171071955344136, 1.2637755403072954, 0.0, 15.748388926414954, 13.901530943380248, 10.855359776720679, 9.186783608452245, 12.572919607974502, 8.39313479684891, 6.416152392186281, 4.050531979947669, 5.757236603577914, 4.812026876331712, 2.689564045415968, 1.4257921528891033, 0.0), # 18 (15.870716573953118, 15.857024742723624, 13.596420995362104, 14.59563111590558, 11.645913696567856, 5.733416828926462, 6.4870184453227155, 6.061230788549498, 6.355923109711349, 3.0960809986631324, 2.1950713569957014, 1.2777387102553464, 0.0, 15.922468478837914, 14.055125812808807, 10.975356784978505, 9.288242995989394, 12.711846219422698, 8.485723103969297, 6.4870184453227155, 4.095297734947473, 5.822956848283928, 4.865210371968527, 2.7192841990724212, 1.441547703883966, 0.0), # 19 (16.01744787427533, 15.990157289287811, 13.710571576310672, 14.718192806474825, 11.748249949814339, 5.781559371346751, 6.54145578814029, 6.112032857911145, 6.409282439181973, 3.1220604865543846, 2.213506975023774, 1.2884647870137858, 0.0, 16.05619070406532, 14.17311265715164, 11.067534875118868, 9.366181459663151, 12.818564878363945, 8.556846001075604, 6.54145578814029, 4.129685265247679, 5.874124974907169, 4.9060642688249425, 2.7421143152621346, 1.4536506626625285, 0.0), # 20 (16.123095202319785, 16.080997139079486, 13.78845937933296, 14.801819636107783, 11.819944003765428, 5.8144080917165, 6.578599881585408, 6.1466960978944165, 6.445690676196012, 3.139787040360623, 2.226086065290016, 1.2957834549703726, 0.0, 16.147432484283325, 14.253618004674097, 11.13043032645008, 9.419361121081867, 12.891381352392024, 8.605374537052183, 6.578599881585408, 4.153148636940357, 5.909972001882714, 4.933939878702596, 2.757691875866592, 1.461908830825408, 0.0), # 21 (16.18558598831933, 16.12743010970541, 13.82827181383638, 14.844565540209405, 11.85945789529128, 5.83119868256461, 6.59758618660448, 6.164414114845277, 6.464300704550355, 3.148848033951298, 2.232515883656091, 1.2995243985128655, 0.0, 16.194070701678125, 14.294768383641518, 11.162579418280455, 9.446544101853892, 12.92860140910071, 8.630179760783388, 6.59758618660448, 4.1651419161175784, 5.92972894764564, 4.948188513403136, 2.7656543627672763, 1.4661300099732195, 0.0), # 22 (16.208629381348224, 16.132927937814358, 13.83323090992227, 14.849916975308645, 11.869580859768103, 5.833333333333334, 6.599843201807471, 6.166329218106997, 6.466627325102881, 3.149916909007774, 2.233322143243131, 1.2999863435451913, 0.0, 16.2, 14.299849778997103, 11.166610716215654, 9.44975072702332, 12.933254650205763, 8.632860905349796, 6.599843201807471, 4.166666666666667, 5.9347904298840515, 4.949972325102882, 2.7666461819844543, 1.4666298125285782, 0.0), # 23 (16.225619860854646, 16.12972098765432, 13.832419753086421, 14.849258333333335, 11.875314787855842, 5.833333333333334, 6.598603050108934, 6.163666666666667, 6.466315555555555, 3.149260246913581, 2.2332332210998884, 1.2998781893004117, 0.0, 16.2, 14.298660082304526, 11.166166105499443, 9.44778074074074, 12.93263111111111, 8.629133333333334, 6.598603050108934, 4.166666666666667, 5.937657393927921, 4.949752777777779, 2.7664839506172845, 1.4663382716049385, 0.0), # 24 (16.242251568338528, 16.1233996342021, 13.830818472793784, 14.847955246913582, 11.880922608634137, 5.833333333333334, 6.596159122085048, 6.158436213991771, 6.465699588477367, 3.1479675354366723, 2.233056906513697, 1.2996646852613931, 0.0, 16.2, 14.296311537875322, 11.165284532568485, 9.443902606310015, 12.931399176954734, 8.62181069958848, 6.596159122085048, 4.166666666666667, 5.940461304317068, 4.949318415637862, 2.766163694558757, 1.4657636031092822, 0.0), # 25 (16.258523230476854, 16.114060448102425, 13.828449016918157, 14.846022530864197, 11.886404126315846, 5.833333333333334, 6.592549374646977, 6.150736625514405, 6.46478732510288, 3.146060283493371, 2.2327947956935614, 1.2993487578113097, 0.0, 16.2, 14.292836335924404, 11.163973978467807, 9.43818085048011, 12.92957465020576, 8.611031275720167, 6.592549374646977, 4.166666666666667, 5.943202063157923, 4.948674176954733, 2.7656898033836312, 1.46491458619113, 0.0), # 26 (16.27443357394662, 16.1018, 13.825333333333333, 14.843475, 11.891759145113827, 5.833333333333334, 6.587811764705883, 6.140666666666667, 6.463586666666666, 3.143560000000001, 2.232448484848485, 1.2989333333333337, 0.0, 16.2, 14.288266666666669, 11.162242424242425, 9.430679999999999, 12.927173333333332, 8.596933333333334, 6.587811764705883, 4.166666666666667, 5.945879572556914, 4.947825000000001, 2.765066666666667, 1.4638000000000002, 0.0), # 27 (16.2899813254248, 16.08671486053955, 13.821493369913123, 14.840327469135804, 11.896987469240962, 5.833333333333334, 6.581984249172921, 6.12832510288066, 6.462105514403292, 3.140488193872886, 2.232019570187472, 1.2984213382106389, 0.0, 16.2, 14.282634720317025, 11.160097850937358, 9.421464581618656, 12.924211028806583, 8.579655144032923, 6.581984249172921, 4.166666666666667, 5.948493734620481, 4.946775823045269, 2.764298673982625, 1.462428623685414, 0.0), # 28 (16.3051652115884, 16.0689016003658, 13.816951074531323, 14.83659475308642, 11.902088902910101, 5.833333333333334, 6.575104784959253, 6.113810699588477, 6.460351769547325, 3.1368663740283504, 2.2315096479195247, 1.2978156988263985, 0.0, 16.2, 14.27597268709038, 11.157548239597624, 9.41059912208505, 12.92070353909465, 8.559334979423868, 6.575104784959253, 4.166666666666667, 5.951044451455051, 4.945531584362141, 2.763390214906265, 1.460809236396891, 0.0), # 29 (16.319983959114396, 16.04845679012346, 13.811728395061728, 14.832291666666666, 11.907063250334119, 5.833333333333334, 6.567211328976035, 6.097222222222222, 6.458333333333333, 3.1327160493827173, 2.230920314253648, 1.297119341563786, 0.0, 16.2, 14.268312757201645, 11.15460157126824, 9.398148148148149, 12.916666666666666, 8.536111111111111, 6.567211328976035, 4.166666666666667, 5.953531625167059, 4.944097222222223, 2.7623456790123457, 1.458950617283951, 0.0), # 30 (16.334436294679772, 16.02547700045725, 13.805847279378145, 14.82743302469136, 11.911910315725876, 5.833333333333334, 6.558341838134432, 6.078658436213992, 6.456058106995885, 3.1280587288523103, 2.2302531653988447, 1.296335192805975, 0.0, 16.2, 14.259687120865724, 11.151265826994223, 9.384176186556928, 12.91211621399177, 8.510121810699589, 6.558341838134432, 4.166666666666667, 5.955955157862938, 4.942477674897121, 2.761169455875629, 1.4568615454961138, 0.0), # 31 (16.34852094496153, 16.00005880201189, 13.799329675354366, 14.82203364197531, 11.916629903298237, 5.833333333333334, 6.548534269345599, 6.058218106995886, 6.453533991769548, 3.1229159213534534, 2.229509797564119, 1.2954661789361381, 0.0, 16.2, 14.250127968297518, 11.147548987820594, 9.368747764060357, 12.907067983539095, 8.48150534979424, 6.548534269345599, 4.166666666666667, 5.958314951649118, 4.940677880658438, 2.759865935070873, 1.4545508001828993, 0.0), # 32 (16.362236636636634, 15.972298765432097, 13.792197530864199, 14.816108333333332, 11.921221817264065, 5.833333333333334, 6.537826579520697, 6.0360000000000005, 6.450768888888889, 3.1173091358024703, 2.228691806958474, 1.2945152263374486, 0.0, 16.2, 14.239667489711932, 11.143459034792368, 9.351927407407409, 12.901537777777778, 8.450400000000002, 6.537826579520697, 4.166666666666667, 5.960610908632033, 4.938702777777778, 2.75843950617284, 1.452027160493827, 0.0), # 33 (16.375582096382097, 15.942293461362596, 13.784472793781436, 14.809671913580248, 11.92568586183623, 5.833333333333334, 6.526256725570888, 6.012102880658436, 6.447770699588479, 3.111259881115685, 2.2278007897909133, 1.2934852613930805, 0.0, 16.2, 14.228337875323884, 11.139003948954567, 9.333779643347052, 12.895541399176958, 8.41694403292181, 6.526256725570888, 4.166666666666667, 5.962842930918115, 4.93655730452675, 2.7568945587562874, 1.449299405578418, 0.0), # 34 (16.388556050874893, 15.9101394604481, 13.776177411979882, 14.802739197530864, 11.930021841227594, 5.833333333333334, 6.513862664407327, 5.986625514403293, 6.4445473251028815, 3.1047896662094203, 2.226838342270441, 1.2923792104862066, 0.0, 16.2, 14.216171315348271, 11.134191711352205, 9.314368998628257, 12.889094650205763, 8.381275720164611, 6.513862664407327, 4.166666666666667, 5.965010920613797, 4.934246399176955, 2.755235482395977, 1.4463763145861912, 0.0), # 35 (16.40115722679201, 15.87593333333333, 13.767333333333335, 14.795325, 11.934229559651024, 5.833333333333334, 6.500682352941176, 5.959666666666668, 6.441106666666666, 3.097920000000001, 2.225806060606061, 1.2912000000000003, 0.0, 16.2, 14.203200000000002, 11.129030303030303, 9.29376, 12.882213333333333, 8.343533333333335, 6.500682352941176, 4.166666666666667, 5.967114779825512, 4.931775000000001, 2.753466666666667, 1.4432666666666667, 0.0), # 36 (16.41338435081044, 15.839771650663007, 13.757962505715593, 14.78744413580247, 11.938308821319383, 5.833333333333334, 6.486753748083595, 5.931325102880659, 6.437456625514404, 3.090672391403751, 2.2247055410067764, 1.2899505563176348, 0.0, 16.2, 14.18945611949398, 11.123527705033881, 9.27201717421125, 12.874913251028808, 8.303855144032923, 6.486753748083595, 4.166666666666667, 5.969154410659692, 4.929148045267491, 2.751592501143119, 1.4399792409693644, 0.0), # 37 (16.425236149607162, 15.801750983081849, 13.748086877000459, 14.77911141975309, 11.942259430445535, 5.833333333333334, 6.4721148067457435, 5.901699588477367, 6.433605102880659, 3.0830683493369926, 2.22353837968159, 1.2886338058222835, 0.0, 16.2, 14.174971864045116, 11.11769189840795, 9.249205048010975, 12.867210205761317, 8.262379423868314, 6.4721148067457435, 4.166666666666667, 5.971129715222768, 4.926370473251031, 2.7496173754000917, 1.4365228166438047, 0.0), # 38 (16.436711349859177, 15.761967901234568, 13.737728395061731, 14.770341666666667, 11.94608119124235, 5.833333333333334, 6.456803485838781, 5.8708888888888895, 6.42956, 3.0751293827160504, 2.2223061728395064, 1.2872526748971194, 0.0, 16.2, 14.159779423868311, 11.111530864197531, 9.225388148148149, 12.85912, 8.219244444444445, 6.456803485838781, 4.166666666666667, 5.973040595621175, 4.923447222222223, 2.7475456790123465, 1.4329061728395065, 0.0), # 39 (16.44780867824346, 15.720518975765888, 13.726909007773205, 14.761149691358025, 11.949773907922687, 5.833333333333334, 6.440857742273865, 5.838991769547327, 6.425329218106996, 3.0668770004572488, 2.2210105166895295, 1.2858100899253166, 0.0, 16.2, 14.143910989178481, 11.105052583447646, 9.200631001371743, 12.850658436213992, 8.174588477366258, 6.440857742273865, 4.166666666666667, 5.974886953961343, 4.920383230452676, 2.745381801554641, 1.42913808870599, 0.0), # 40 (16.458526861437004, 15.677500777320528, 13.71565066300869, 14.751550308641978, 11.953337384699417, 5.833333333333334, 6.424315532962156, 5.806106995884774, 6.420920658436214, 3.05833271147691, 2.2196530074406624, 1.2843089772900476, 0.0, 16.2, 14.12739875019052, 11.09826503720331, 9.174998134430727, 12.841841316872427, 8.128549794238685, 6.424315532962156, 4.166666666666667, 5.976668692349708, 4.9171834362139935, 2.743130132601738, 1.4252273433927756, 0.0), # 41 (16.4688646261168, 15.633009876543213, 13.70397530864198, 14.741558333333336, 11.956771425785394, 5.833333333333334, 6.4072148148148145, 5.772333333333334, 6.416342222222223, 3.049518024691359, 2.2182352413019086, 1.282752263374486, 0.0, 16.2, 14.110274897119341, 11.091176206509541, 9.148554074074074, 12.832684444444446, 8.081266666666668, 6.4072148148148145, 4.166666666666667, 5.978385712892697, 4.913852777777779, 2.740795061728396, 1.421182716049383, 0.0), # 42 (16.47882069895983, 15.587142844078647, 13.69190489254687, 14.731188580246915, 11.960075835393496, 5.833333333333334, 6.389593544743001, 5.737769547325104, 6.4116018106995885, 3.040454449016919, 2.2167588144822714, 1.281142874561805, 0.0, 16.2, 14.092571620179852, 11.083794072411356, 9.121363347050755, 12.823203621399177, 8.032877366255146, 6.389593544743001, 4.166666666666667, 5.980037917696748, 4.9103961934156395, 2.738380978509374, 1.4170129858253318, 0.0), # 43 (16.488393806643085, 15.539996250571559, 13.679461362597166, 14.720455864197532, 11.963250417736582, 5.833333333333334, 6.371489679657872, 5.702514403292183, 6.4067073251028805, 3.031163493369914, 2.2152253231907557, 1.279483737235178, 0.0, 16.2, 14.074321109586954, 11.076126615953777, 9.09349048010974, 12.813414650205761, 7.983520164609057, 6.371489679657872, 4.166666666666667, 5.981625208868291, 4.906818621399179, 2.7358922725194335, 1.4127269318701419, 0.0), # 44 (16.497582675843546, 15.491666666666667, 13.66666666666667, 14.709375000000001, 11.966294977027516, 5.833333333333334, 6.352941176470589, 5.666666666666668, 6.4016666666666655, 3.021666666666668, 2.213636363636364, 1.277777777777778, 0.0, 16.2, 14.055555555555554, 11.068181818181818, 9.065000000000001, 12.803333333333331, 7.9333333333333345, 6.352941176470589, 4.166666666666667, 5.983147488513758, 4.903125000000001, 2.733333333333334, 1.4083333333333337, 0.0), # 45 (16.50638603323821, 15.442250663008686, 13.653542752629173, 14.697960802469137, 11.969209317479164, 5.833333333333334, 6.333985992092311, 5.63032510288066, 6.396487736625514, 3.0119854778235036, 2.2119935320281, 1.2760279225727789, 0.0, 16.2, 14.036307148300564, 11.059967660140499, 9.035956433470508, 12.792975473251028, 7.882455144032924, 6.333985992092311, 4.166666666666667, 5.984604658739582, 4.899320267489713, 2.730708550525835, 1.4038409693644263, 0.0), # 46 (16.514802605504055, 15.391844810242342, 13.640111568358483, 14.686228086419753, 11.971993243304391, 5.833333333333334, 6.3146620834341975, 5.593588477366255, 6.391178436213992, 3.0021414357567453, 2.210298424574968, 1.2742370980033535, 0.0, 16.2, 14.016608078036885, 11.051492122874839, 9.006424307270233, 12.782356872427984, 7.831023868312758, 6.3146620834341975, 4.166666666666667, 5.985996621652196, 4.895409362139919, 2.728022313671697, 1.3992586191129404, 0.0), # 47 (16.522831119318074, 15.340545679012347, 13.626395061728397, 14.674191666666669, 11.974646558716064, 5.833333333333334, 6.295007407407407, 5.556555555555557, 6.385746666666667, 2.9921560493827166, 2.208552637485971, 1.272408230452675, 0.0, 16.2, 13.996490534979422, 11.042763187429854, 8.976468148148149, 12.771493333333334, 7.77917777777778, 6.295007407407407, 4.166666666666667, 5.987323279358032, 4.891397222222224, 2.7252790123456796, 1.3945950617283953, 0.0), # 48 (16.53047030135726, 15.288449839963418, 13.612415180612713, 14.661866358024692, 11.977169067927047, 5.833333333333334, 6.275059920923102, 5.519325102880659, 6.380200329218106, 2.982050827617742, 2.2067577669701133, 1.2705442463039174, 0.0, 16.2, 13.97598670934309, 11.033788834850565, 8.946152482853226, 12.760400658436213, 7.727055144032923, 6.275059920923102, 4.166666666666667, 5.9885845339635235, 4.887288786008232, 2.7224830361225427, 1.389859076360311, 0.0), # 49 (16.537718878298588, 15.235653863740286, 13.598193872885233, 14.649266975308642, 11.979560575150202, 5.833333333333334, 6.25485758089244, 5.481995884773663, 6.3745473251028795, 2.971847279378144, 2.204915409236397, 1.2686480719402533, 0.0, 16.2, 13.955128791342785, 11.024577046181985, 8.91554183813443, 12.749094650205759, 7.674794238683129, 6.25485758089244, 4.166666666666667, 5.989780287575101, 4.883088991769548, 2.7196387745770467, 1.385059442158208, 0.0), # 50 (16.544575576819057, 15.182254320987655, 13.583753086419755, 14.636408333333335, 11.981820884598399, 5.833333333333334, 6.23443834422658, 5.4446666666666665, 6.368795555555556, 2.9615669135802474, 2.2030271604938276, 1.2667226337448563, 0.0, 16.2, 13.933948971193416, 11.015135802469137, 8.88470074074074, 12.737591111111112, 7.622533333333334, 6.23443834422658, 4.166666666666667, 5.9909104422991994, 4.878802777777779, 2.716750617283951, 1.380204938271605, 0.0), # 51 (16.551039123595647, 15.128347782350252, 13.56911476909008, 14.623305246913581, 11.983949800484496, 5.833333333333334, 6.213840167836683, 5.407436213991769, 6.3629529218107, 2.9512312391403754, 2.2010946169514076, 1.2647708581008996, 0.0, 16.2, 13.912479439109894, 11.005473084757037, 8.853693717421125, 12.7259058436214, 7.570410699588477, 6.213840167836683, 4.166666666666667, 5.991974900242248, 4.874435082304528, 2.713822953818016, 1.3753043438500232, 0.0), # 52 (16.55710824530535, 15.074030818472796, 13.554300868770008, 14.609972530864198, 11.985947127021364, 5.833333333333334, 6.1931010086339064, 5.370403292181071, 6.357027325102881, 2.940861764974852, 2.1991193748181406, 1.2627956713915565, 0.0, 16.2, 13.890752385307119, 10.995596874090701, 8.822585294924554, 12.714054650205762, 7.518564609053499, 6.1931010086339064, 4.166666666666667, 5.992973563510682, 4.8699908436214, 2.710860173754002, 1.3703664380429816, 0.0), # 53 (16.562781668625146, 15.019400000000001, 13.539333333333333, 14.596425, 11.987812668421869, 5.833333333333334, 6.172258823529412, 5.333666666666667, 6.351026666666667, 2.9304800000000006, 2.19710303030303, 1.2608000000000001, 0.0, 16.2, 13.8688, 10.98551515151515, 8.791440000000001, 12.702053333333334, 7.467133333333333, 6.172258823529412, 4.166666666666667, 5.993906334210934, 4.865475000000001, 2.707866666666667, 1.3654000000000004, 0.0), # 54 (16.568058120232035, 14.964551897576587, 13.524234110653865, 14.582677469135803, 11.989546228898869, 5.833333333333334, 6.151351569434358, 5.2973251028806585, 6.344958847736625, 2.9201074531321454, 2.1950471796150812, 1.2587867703094042, 0.0, 16.2, 13.846654473403445, 10.975235898075404, 8.760322359396435, 12.68991769547325, 7.416255144032922, 6.151351569434358, 4.166666666666667, 5.994773114449434, 4.860892489711935, 2.704846822130773, 1.360413808870599, 0.0), # 55 (16.572936326802996, 14.909583081847279, 13.509025148605396, 14.56874475308642, 11.991147612665237, 5.833333333333334, 6.130417203259905, 5.261477366255145, 6.338831769547324, 2.9097656332876096, 2.1929534189632958, 1.2567589087029418, 0.0, 16.2, 13.824347995732358, 10.964767094816478, 8.729296899862828, 12.677663539094649, 7.366068312757203, 6.130417203259905, 4.166666666666667, 5.995573806332619, 4.856248251028807, 2.7018050297210796, 1.3554166438042983, 0.0), # 56 (16.577415015015013, 14.85459012345679, 13.493728395061732, 14.554641666666669, 11.99261662393383, 5.833333333333334, 6.109493681917211, 5.226222222222224, 6.332653333333334, 2.899476049382717, 2.1908233445566783, 1.254719341563786, 0.0, 16.2, 13.801912757201645, 10.95411672278339, 8.69842814814815, 12.665306666666668, 7.316711111111113, 6.109493681917211, 4.166666666666667, 5.996308311966915, 4.851547222222224, 2.6987456790123465, 1.3504172839506174, 0.0), # 57 (16.581492911545087, 14.79966959304984, 13.478365797896664, 14.540383024691359, 11.99395306691752, 5.833333333333334, 6.088618962317438, 5.191658436213992, 6.326431440329218, 2.8892602103337914, 2.1886585526042324, 1.2526709952751107, 0.0, 16.2, 13.779380948026215, 10.943292763021162, 8.667780631001373, 12.652862880658436, 7.2683218106995895, 6.088618962317438, 4.166666666666667, 5.99697653345876, 4.846794341563787, 2.695673159579333, 1.3454245084590766, 0.0), # 58 (16.585168743070195, 14.744918061271147, 13.462959304983997, 14.525983641975309, 11.995156745829167, 5.833333333333334, 6.067831001371743, 5.157884773662552, 6.320173991769548, 2.879139625057157, 2.1864606393149604, 1.2506167962200887, 0.0, 16.2, 13.756784758420972, 10.9323031965748, 8.63741887517147, 12.640347983539096, 7.221038683127573, 6.067831001371743, 4.166666666666667, 5.9975783729145835, 4.841994547325104, 2.6925918609968, 1.3404470964791952, 0.0), # 59 (16.588441236267325, 14.690432098765434, 13.44753086419753, 14.511458333333334, 11.996227464881638, 5.833333333333334, 6.0471677559912855, 5.125000000000001, 6.31388888888889, 2.8691358024691365, 2.184231200897868, 1.2485596707818931, 0.0, 16.2, 13.734156378600822, 10.921156004489339, 8.607407407407408, 12.62777777777778, 7.175000000000001, 6.0471677559912855, 4.166666666666667, 5.998113732440819, 4.837152777777779, 2.6895061728395064, 1.3354938271604941, 0.0), # 60 (16.591309117813463, 14.636308276177413, 13.432102423411067, 14.496821913580249, 11.997165028287798, 5.833333333333334, 6.026667183087227, 5.093102880658437, 6.3075840329218105, 2.8592702514860546, 2.1819718335619576, 1.246502545343698, 0.0, 16.2, 13.711527998780674, 10.909859167809786, 8.577810754458163, 12.615168065843621, 7.130344032921811, 6.026667183087227, 4.166666666666667, 5.998582514143899, 4.832273971193417, 2.6864204846822135, 1.3305734796524924, 0.0), # 61 (16.593771114385607, 14.582643164151806, 13.416695930498403, 14.482089197530867, 11.997969240260517, 5.833333333333334, 6.006367239570725, 5.062292181069959, 6.301267325102881, 2.849564481024235, 2.1796841335162327, 1.2444483462886757, 0.0, 16.2, 13.68893180917543, 10.898420667581162, 8.548693443072704, 12.602534650205762, 7.0872090534979435, 6.006367239570725, 4.166666666666667, 5.998984620130258, 4.827363065843623, 2.6833391860996807, 1.3256948331047098, 0.0), # 62 (16.595825952660736, 14.529533333333333, 13.401333333333335, 14.467275000000003, 11.998639905012647, 5.833333333333334, 5.986305882352941, 5.0326666666666675, 6.294946666666666, 2.8400400000000006, 2.1773696969696976, 1.2424000000000002, 0.0, 16.2, 13.6664, 10.886848484848487, 8.52012, 12.589893333333332, 7.045733333333335, 5.986305882352941, 4.166666666666667, 5.999319952506323, 4.822425000000002, 2.6802666666666672, 1.3208666666666669, 0.0), # 63 (16.597472359315837, 14.477075354366713, 13.386036579789668, 14.452394135802471, 11.999176826757065, 5.833333333333334, 5.966521068345034, 5.004325102880659, 6.288629958847737, 2.830718317329676, 2.1750301201313547, 1.2403604328608446, 0.0, 16.2, 13.64396476146929, 10.875150600656774, 8.492154951989026, 12.577259917695473, 7.006055144032923, 5.966521068345034, 4.166666666666667, 5.999588413378532, 4.817464711934158, 2.6772073159579337, 1.316097759487883, 0.0), # 64 (16.5987090610279, 14.425365797896662, 13.370827617741199, 14.437461419753088, 11.999579809706631, 5.833333333333334, 5.947050754458163, 4.977366255144033, 6.282325102880659, 2.8216209419295843, 2.1726669992102097, 1.238332571254382, 0.0, 16.2, 13.6216582837982, 10.863334996051048, 8.464862825788751, 12.564650205761318, 6.968312757201646, 5.947050754458163, 4.166666666666667, 5.999789904853316, 4.812487139917697, 2.67416552354824, 1.3113968907178786, 0.0), # 65 (16.599534784473914, 14.374501234567903, 13.35572839506173, 14.422491666666668, 11.99984865807421, 5.833333333333334, 5.927932897603486, 4.95188888888889, 6.27604, 2.81276938271605, 2.170281930415264, 1.2363193415637863, 0.0, 16.2, 13.599512757201648, 10.851409652076319, 8.438308148148149, 12.55208, 6.932644444444446, 5.927932897603486, 4.166666666666667, 5.999924329037105, 4.807497222222223, 2.6711456790123465, 1.3067728395061733, 0.0), # 66 (16.59994825633087, 14.324578235025148, 13.340760859625059, 14.407499691358025, 11.999983176072671, 5.833333333333334, 5.909205454692165, 4.927991769547327, 6.269782551440329, 2.8041851486053964, 2.1678765099555233, 1.23432367017223, 0.0, 16.2, 13.577560371894528, 10.839382549777614, 8.412555445816189, 12.539565102880658, 6.899188477366257, 5.909205454692165, 4.166666666666667, 5.999991588036336, 4.802499897119342, 2.6681521719250116, 1.3022343850022864, 0.0), # 67 (16.59966658316932, 14.275431337669806, 13.325874599908552, 14.39237008856683, 11.999869818983834, 5.833225077478026, 5.890812155863717, 4.905562566681908, 6.263513519280598, 2.795848176658867, 2.1654095969441007, 1.2323373362532992, 0.0, 16.19980024005487, 13.555710698786289, 10.827047984720503, 8.3875445299766, 12.527027038561195, 6.867787593354672, 5.890812155863717, 4.166589341055733, 5.999934909491917, 4.797456696188944, 2.6651749199817103, 1.29776648524271, 0.0), # 68 (16.597026731078905, 14.22556009557945, 13.310651234567901, 14.376340217391304, 11.998838053740013, 5.832369272976682, 5.872214545077291, 4.8833991769547325, 6.256958847736625, 2.7875225562817723, 2.162630090377459, 1.2302958631145768, 0.0, 16.198217592592595, 13.533254494260342, 10.813150451887294, 8.362567668845315, 12.51391769547325, 6.8367588477366255, 5.872214545077291, 4.165978052126201, 5.999419026870006, 4.792113405797102, 2.66213024691358, 1.2932327359617684, 0.0), # 69 (16.59181726009423, 14.174735607770254, 13.295024577046181, 14.359304549114333, 11.996799268404205, 5.8306838388457045, 5.853328107649096, 4.861301630848957, 6.2500815424477985, 2.7791678097850943, 2.159506369740288, 1.228189701505708, 0.0, 16.195091735253776, 13.510086716562785, 10.797531848701441, 8.337503429355282, 12.500163084895597, 6.80582228318854, 5.853328107649096, 4.164774170604074, 5.998399634202102, 4.786434849704778, 2.6590049154092363, 1.2886123279791142, 0.0), # 70 (16.584111457028687, 14.122988247267578, 13.279000114311843, 14.341288204508857, 11.993779284004411, 5.828196087994717, 5.8341613276311906, 4.8392772443225125, 6.242891845755221, 2.7707841437370564, 2.1560499655423633, 1.226020391628362, 0.0, 16.190463820301783, 13.486224307911982, 10.780249827711817, 8.312352431211167, 12.485783691510441, 6.774988142051518, 5.8341613276311906, 4.162997205710512, 5.9968896420022055, 4.780429401502953, 2.6558000228623686, 1.2839080224788708, 0.0), # 71 (16.573982608695655, 14.070348387096773, 13.262583333333334, 14.322316304347826, 11.989803921568626, 5.824933333333335, 5.81472268907563, 4.817333333333334, 6.2354, 2.762371764705883, 2.1522724082934617, 1.2237894736842108, 0.0, 16.184375, 13.461684210526316, 10.761362041467306, 8.287115294117648, 12.4708, 6.744266666666667, 5.81472268907563, 4.160666666666668, 5.994901960784313, 4.7741054347826095, 2.6525166666666666, 1.2791225806451614, 0.0), # 72 (16.561504001908514, 14.016846400283198, 13.245779721079103, 14.302413969404189, 11.984899002124855, 5.820922887771173, 5.795020676034474, 4.795477213839354, 6.227616247523244, 2.753930879259798, 2.1481852285033574, 1.2214984878749227, 0.0, 16.1768664266118, 13.436483366624147, 10.740926142516786, 8.261792637779392, 12.455232495046488, 6.713668099375096, 5.795020676034474, 4.157802062693695, 5.992449501062428, 4.76747132313473, 2.649155944215821, 1.274258763662109, 0.0), # 73 (16.546748923480646, 13.962512659852205, 13.228594764517604, 14.281606320450884, 11.979090346701094, 5.816192064217854, 5.775063772559778, 4.773716201798507, 6.219550830666057, 2.7454616939670253, 2.143799956681829, 1.219148974402169, 0.0, 16.167979252400553, 13.410638718423858, 10.718999783409142, 8.236385081901075, 12.439101661332113, 6.683202682517909, 5.775063772559778, 4.154422903012753, 5.989545173350547, 4.760535440150296, 2.645718952903521, 1.269319332713837, 0.0), # 74 (16.52979066022544, 13.90737753882915, 13.211033950617283, 14.259918478260868, 11.972403776325345, 5.810768175582992, 5.754860462703601, 4.752057613168724, 6.211213991769547, 2.7369644153957884, 2.13912812333865, 1.2167424734676198, 0.0, 16.157754629629633, 13.384167208143815, 10.695640616693249, 8.210893246187364, 12.422427983539094, 6.652880658436215, 5.754860462703601, 4.150548696844995, 5.986201888162673, 4.7533061594202906, 2.6422067901234567, 1.2643070489844683, 0.0), # 75 (16.510702498956285, 13.851471410239393, 13.193102766346595, 14.237375563607085, 11.964865112025606, 5.804678534776205, 5.734419230517997, 4.730508763907942, 6.2026159731748205, 2.728439250114312, 2.134181258983598, 1.2142805252729445, 0.0, 16.146233710562413, 13.357085778002387, 10.67090629491799, 8.185317750342936, 12.405231946349641, 6.622712269471118, 5.734419230517997, 4.146198953411575, 5.982432556012803, 4.745791854535696, 2.638620553269319, 1.259224673658127, 0.0), # 76 (16.48955772648655, 13.794824647108282, 13.174806698673981, 14.21400269726248, 11.956500174829877, 5.797950454707109, 5.7137485600550235, 4.70907696997409, 6.193767017222985, 2.7198864046908207, 2.1289708941264505, 1.2117646700198144, 0.0, 16.13345764746228, 13.329411370217956, 10.64485447063225, 8.15965921407246, 12.38753403444597, 6.592707757963726, 5.7137485600550235, 4.141393181933649, 5.9782500874149385, 4.738000899087494, 2.6349613397347964, 1.254074967918935, 0.0), # 77 (16.46642962962963, 13.737467622461173, 13.156151234567902, 14.189825, 11.94733478576616, 5.790611248285322, 5.69285693536674, 4.687769547325104, 6.184677366255142, 2.711306085693537, 2.123508559276981, 1.2091964479098987, 0.0, 16.119467592592596, 13.301160927008882, 10.617542796384903, 8.13391825708061, 12.369354732510285, 6.562877366255145, 5.69285693536674, 4.136150891632373, 5.97366739288308, 4.729941666666668, 2.6312302469135807, 1.248860692951016, 0.0), # 78 (16.441391495198904, 13.679430709323423, 13.1371418609968, 14.164867592592593, 11.93739476586245, 5.782688228420464, 5.671752840505201, 4.666593811918916, 6.1753572626124065, 2.702698499690686, 2.117805784944966, 1.2065773991448674, 0.0, 16.104304698216733, 13.27235139059354, 10.58902892472483, 8.108095499072057, 12.350714525224813, 6.533231336686482, 5.671752840505201, 4.130491591728903, 5.968697382931225, 4.721622530864199, 2.6274283721993603, 1.243584609938493, 0.0), # 79 (16.414516610007755, 13.620744280720386, 13.117784064929126, 14.139155595813204, 11.92670593614675, 5.774208708022151, 5.650444759522465, 4.645557079713459, 6.165816948635879, 2.694063853250491, 2.111874101640184, 1.2039090639263914, 0.0, 16.08801011659808, 13.242999703190304, 10.559370508200919, 8.082191559751472, 12.331633897271757, 6.503779911598843, 5.650444759522465, 4.1244347914443935, 5.963352968073375, 4.713051865271069, 2.6235568129858255, 1.23824948006549, 0.0), # 80 (16.385878260869568, 13.56143870967742, 13.098083333333335, 14.112714130434785, 11.915294117647058, 5.765200000000001, 5.628941176470589, 4.624666666666667, 6.156066666666666, 2.685402352941177, 2.1057250398724086, 1.2011929824561405, 0.0, 16.070625, 13.213122807017545, 10.528625199362043, 8.05620705882353, 12.312133333333332, 6.474533333333334, 5.628941176470589, 4.118, 5.957647058823529, 4.704238043478263, 2.619616666666667, 1.2328580645161293, 0.0), # 81 (16.355549734597723, 13.501544369219879, 13.078045153177872, 14.085568317230274, 11.903185131391377, 5.75568941726363, 5.607250575401629, 4.603929888736474, 6.146116659045877, 2.676714205330967, 2.099370130151417, 1.198430694935785, 0.0, 16.052190500685874, 13.182737644293633, 10.496850650757084, 8.030142615992899, 12.292233318091753, 6.445501844231063, 5.607250575401629, 4.111206726616879, 5.951592565695688, 4.695189439076759, 2.6156090306355746, 1.2274131244745345, 0.0), # 82 (16.323604318005607, 13.441091632373114, 13.057675011431185, 14.057743276972625, 11.890404798407703, 5.745704272722655, 5.585381440367643, 4.5833540618808115, 6.135977168114616, 2.667999616988085, 2.0928209029869853, 1.195623741566995, 0.0, 16.03274777091907, 13.151861157236944, 10.464104514934926, 8.003998850964255, 12.271954336229232, 6.416695686633136, 5.585381440367643, 4.104074480516182, 5.945202399203851, 4.6859144256575425, 2.6115350022862374, 1.2219174211248287, 0.0), # 83 (16.290115297906603, 13.380110872162485, 13.036978395061729, 14.029264130434784, 11.876978939724037, 5.735271879286694, 5.563342255420687, 4.562946502057613, 6.125658436213991, 2.659258794480756, 2.0860888888888893, 1.1927736625514405, 0.0, 16.012337962962963, 13.120510288065844, 10.430444444444445, 7.977776383442267, 12.251316872427982, 6.388125102880658, 5.563342255420687, 4.096622770919067, 5.938489469862018, 4.676421376811596, 2.607395679012346, 1.2163737156511352, 0.0), # 84 (16.255155961114095, 13.318632461613346, 13.015960791037951, 14.000155998389694, 11.862933376368382, 5.724419549865368, 5.54114150461282, 4.542714525224815, 6.115170705685108, 2.650491944377203, 2.0791856183669055, 1.1898819980907918, 0.0, 15.991002229080934, 13.088701978998708, 10.395928091834525, 7.951475833131607, 12.230341411370215, 6.35980033531474, 5.54114150461282, 4.088871107046691, 5.931466688184191, 4.666718666129899, 2.6031921582075905, 1.210784769237577, 0.0), # 85 (16.21879959444146, 13.256686773751051, 12.994627686328306, 13.970444001610309, 11.84829392936873, 5.713174597368289, 5.518787671996097, 4.522665447340345, 6.104524218869075, 2.64169927324565, 2.0721226219308098, 1.1869502883867193, 0.0, 15.968781721536352, 13.05645317225391, 10.360613109654047, 7.9250978197369495, 12.20904843773815, 6.331731626276483, 5.518787671996097, 4.080838998120206, 5.924146964684365, 4.656814667203437, 2.5989255372656612, 1.2051533430682777, 0.0), # 86 (16.18111948470209, 13.194304181600955, 12.972984567901234, 13.940153260869565, 11.833086419753089, 5.7015643347050755, 5.496289241622575, 4.5028065843621405, 6.093729218106997, 2.6328809876543215, 2.0649114300903775, 1.1839800736408925, 0.0, 15.945717592592594, 13.023780810049816, 10.324557150451888, 7.898642962962963, 12.187458436213994, 6.303929218106997, 5.496289241622575, 4.072545953360768, 5.9165432098765445, 4.646717753623189, 2.594596913580247, 1.1994821983273598, 0.0), # 87 (16.142188918709373, 13.131515058188414, 12.951036922725194, 13.90930889694042, 11.817336668549451, 5.689616074785349, 5.473654697544313, 4.483145252248133, 6.082795945739979, 2.624037294171441, 2.0575635733553868, 1.1809728940549822, 0.0, 15.921850994513035, 12.990701834604803, 10.287817866776932, 7.8721118825143215, 12.165591891479957, 6.276403353147386, 5.473654697544313, 4.064011481989534, 5.908668334274726, 4.636436298980141, 2.5902073845450393, 1.193774096198947, 0.0), # 88 (16.102081183276677, 13.068349776538785, 12.928790237768634, 13.877936030595814, 11.80107049678582, 5.677357130518723, 5.4508925238133665, 4.463688766956257, 6.07173464410913, 2.6151683993652335, 2.050090582235612, 1.1779302898306583, 0.0, 15.897223079561043, 12.957233188137238, 10.250452911178058, 7.845505198095699, 12.14346928821826, 6.24916427373876, 5.4508925238133665, 4.055255093227659, 5.90053524839291, 4.625978676865272, 2.585758047553727, 1.1880317978671624, 0.0), # 89 (16.06086956521739, 13.004838709677419, 12.906250000000002, 13.846059782608698, 11.784313725490197, 5.664814814814815, 5.428011204481793, 4.444444444444445, 6.060555555555556, 2.606274509803922, 2.04250398724083, 1.1748538011695908, 0.0, 15.871875000000001, 12.923391812865496, 10.212519936204147, 7.818823529411765, 12.121111111111112, 6.222222222222222, 5.428011204481793, 4.046296296296297, 5.892156862745098, 4.615353260869567, 2.5812500000000003, 1.1822580645161291, 0.0), # 90 (16.0186273513449, 12.941012230629672, 12.883421696387746, 13.813705273752014, 11.767092175690575, 5.652016440583244, 5.405019223601649, 4.4254196006706294, 6.049268922420364, 2.597355832055731, 2.0348153188808165, 1.17174496827345, 0.0, 15.845847908093276, 12.889194651007948, 10.174076594404081, 7.792067496167191, 12.098537844840727, 6.195587440938882, 5.405019223601649, 4.037154600416603, 5.883546087845287, 4.604568424584006, 2.5766843392775494, 1.1764556573299705, 0.0), # 91 (15.975427828472597, 12.876900712420905, 12.86031081390032, 13.780897624798712, 11.749431668414964, 5.638989320733629, 5.381925065224994, 4.406621551592746, 6.037884987044658, 2.5884125726888843, 2.027036107665348, 1.1686053313439067, 0.0, 15.819182956104251, 12.85465864478297, 10.135180538326738, 7.765237718066651, 12.075769974089315, 6.169270172229845, 5.381925065224994, 4.027849514809735, 5.874715834207482, 4.593632541599572, 2.5720621627800644, 1.1706273374928098, 0.0), # 92 (15.931344283413848, 12.812534528076466, 12.836922839506174, 13.747661956521743, 11.731358024691357, 5.625760768175583, 5.358737213403881, 4.388057613168725, 6.026413991769548, 2.5794449382716054, 2.0191778841042, 1.1654364305826295, 0.0, 15.791921296296294, 12.819800736408922, 10.095889420521, 7.738334814814815, 12.052827983539096, 6.143280658436215, 5.358737213403881, 4.018400548696845, 5.865679012345678, 4.582553985507248, 2.567384567901235, 1.1647758661887697, 0.0), # 93 (15.886450002982048, 12.74794405062171, 12.813263260173755, 13.714023389694043, 11.712897065547754, 5.612358095818728, 5.335464152190369, 4.369735101356501, 6.014866178936138, 2.5704531353721194, 2.01125217870715, 1.16223980619129, 0.0, 15.764104080932785, 12.784637868104188, 10.056260893535747, 7.711359406116356, 12.029732357872277, 6.117629141899102, 5.335464152190369, 4.008827211299091, 5.856448532773877, 4.571341129898015, 2.5626526520347515, 1.1589040046019738, 0.0), # 94 (15.840818273990577, 12.683159653081995, 12.789337562871514, 13.680007045088567, 11.694074612012159, 5.598808616572678, 5.312114365636515, 4.351661332114007, 6.003251790885536, 2.561437370558649, 2.0032705219839726, 1.1590169983715575, 0.0, 15.735772462277092, 12.749186982087132, 10.016352609919863, 7.684312111675945, 12.006503581771073, 6.09232586495961, 5.312114365636515, 3.999149011837627, 5.847037306006079, 4.560002348362857, 2.5578675125743033, 1.1530145139165453, 0.0), # 95 (15.79452238325282, 12.61821170848268, 12.765151234567902, 13.645638043478261, 11.674916485112563, 5.585139643347051, 5.288696337794377, 4.333843621399177, 5.991581069958848, 2.55239785039942, 1.9952444444444448, 1.1557695473251033, 0.0, 15.706967592592594, 12.713465020576134, 9.976222222222225, 7.657193551198258, 11.983162139917695, 6.067381069958849, 5.288696337794377, 3.9893854595336076, 5.8374582425562815, 4.5485460144927545, 2.553030246913581, 1.1471101553166074, 0.0), # 96 (15.747635617582157, 12.553130589849111, 12.740709762231369, 13.61094150563607, 11.655448505876976, 5.571378489051465, 5.265218552716011, 4.316289285169945, 5.979864258497181, 2.5433347814626543, 1.9871854765983423, 1.152498993253596, 0.0, 15.677730624142663, 12.677488925789556, 9.93592738299171, 7.630004344387961, 11.959728516994362, 6.042804999237923, 5.265218552716011, 3.9795560636081895, 5.827724252938488, 4.536980501878691, 2.5481419524462736, 1.141193689986283, 0.0), # 97 (15.700231263791975, 12.487946670206647, 12.71601863283036, 13.575942552334945, 11.635696495333388, 5.557552466595541, 5.241689494453475, 4.299005639384241, 5.968111598841639, 2.5342483703165772, 1.9791051489554419, 1.1492068763587067, 0.0, 15.648102709190674, 12.64127563994577, 9.89552574477721, 7.60274511094973, 11.936223197683278, 6.018607895137937, 5.241689494453475, 3.969680333282529, 5.817848247666694, 4.525314184111649, 2.5432037265660723, 1.1352678791096953, 0.0), # 98 (15.652382608695653, 12.422690322580646, 12.691083333333335, 13.540666304347827, 11.615686274509805, 5.543688888888889, 5.218117647058825, 4.282000000000001, 5.956333333333333, 2.5251388235294123, 1.9710149920255189, 1.1458947368421055, 0.0, 15.618125000000001, 12.604842105263158, 9.855074960127594, 7.575416470588236, 11.912666666666667, 5.9948000000000015, 5.218117647058825, 3.9597777777777776, 5.807843137254903, 4.51355543478261, 2.5382166666666675, 1.129335483870968, 0.0), # 99 (15.60416293910658, 12.357391919996457, 12.665909350708734, 13.505137882447666, 11.595443664434223, 5.529815068841132, 5.194511494584116, 4.265279682975157, 5.944539704313367, 2.516006347669384, 1.9629265363183495, 1.1425641149054624, 0.0, 15.58783864883402, 12.568205263960085, 9.814632681591746, 7.54801904300815, 11.889079408626735, 5.97139155616522, 5.194511494584116, 3.9498679063150943, 5.797721832217111, 4.501712627482556, 2.533181870141747, 1.1233992654542237, 0.0), # 100 (15.555645541838135, 12.292081835479447, 12.640502171925013, 13.469382407407409, 11.574994486134646, 5.515958319361886, 5.17087952108141, 4.248852004267642, 5.932740954122847, 2.506851149304716, 1.9548513123437101, 1.1392165507504473, 0.0, 15.557284807956103, 12.531382058254918, 9.77425656171855, 7.520553447914146, 11.865481908245695, 5.948392805974699, 5.17087952108141, 3.9399702281156324, 5.787497243067323, 4.48979413580247, 2.528100434385003, 1.1174619850435863, 0.0), # 101 (15.506903703703706, 12.22679044205496, 12.614867283950618, 13.433425000000002, 11.554364560639069, 5.5021459533607695, 5.1472302106027605, 4.2327242798353915, 5.920947325102881, 2.497673435003632, 1.9468008506113774, 1.135853584578731, 0.0, 15.526504629629631, 12.49438943036604, 9.734004253056886, 7.493020305010894, 11.841894650205761, 5.925813991769548, 5.1472302106027605, 3.93010425240055, 5.7771822803195345, 4.477808333333335, 2.522973456790124, 1.1115264038231782, 0.0), # 102 (15.458010711516671, 12.161548112748353, 12.589010173754001, 13.397290780998391, 11.533579708975497, 5.488405283747397, 5.123572047200224, 4.2169038256363365, 5.909169059594573, 2.4884734113343563, 1.9387866816311266, 1.132476756591983, 0.0, 15.495539266117968, 12.457244322511812, 9.693933408155633, 7.4654202340030675, 11.818338119189146, 5.903665355890872, 5.123572047200224, 3.920289488390998, 5.766789854487748, 4.465763593666131, 2.5178020347508006, 1.1055952829771232, 0.0), # 103 (15.409039852090416, 12.096385220584981, 12.562936328303612, 13.361004871175524, 11.512665752171923, 5.474763623431389, 5.099913514925861, 4.201397957628411, 5.897416399939034, 2.479251284865113, 1.9308203359127338, 1.129087606991874, 0.0, 15.464429869684501, 12.419963676910612, 9.654101679563668, 7.437753854595337, 11.794832799878067, 5.881957140679775, 5.099913514925861, 3.9105454453081343, 5.756332876085962, 4.4536682903918425, 2.5125872656607227, 1.099671383689544, 0.0), # 104 (15.360064412238325, 12.031332138590201, 12.536651234567902, 13.324592391304346, 11.491648511256354, 5.461248285322361, 5.076263097831727, 4.186213991769549, 5.885699588477366, 2.470007262164126, 1.922913343965976, 1.125687675980074, 0.0, 15.433217592592593, 12.382564435780811, 9.61456671982988, 7.410021786492376, 11.771399176954732, 5.860699588477368, 5.076263097831727, 3.9008916323731144, 5.745824255628177, 4.44153079710145, 2.5073302469135803, 1.093757467144564, 0.0), # 105 (15.311157678773782, 11.96641923978937, 12.510160379515318, 13.28807846215781, 11.470553807256785, 5.44788658232993, 5.052629279969876, 4.1713592440176805, 5.8740288675506775, 2.4607415497996183, 1.9150772363006283, 1.1222785037582528, 0.0, 15.401943587105624, 12.345063541340778, 9.575386181503141, 7.382224649398854, 11.748057735101355, 5.839902941624753, 5.052629279969876, 3.8913475588070923, 5.735276903628392, 4.429359487385938, 2.5020320759030636, 1.0878562945263066, 0.0), # 106 (15.26239293851017, 11.901676897207842, 12.483469250114315, 13.251488204508856, 11.449407461201215, 5.434705827363715, 5.0290205453923695, 4.156841030330743, 5.862414479500076, 2.451454354339816, 1.9073235434264675, 1.1188616305280807, 0.0, 15.370649005486968, 12.307477935808887, 9.536617717132337, 7.354363063019447, 11.724828959000153, 5.819577442463041, 5.0290205453923695, 3.8819327338312255, 5.724703730600607, 4.417162734836286, 2.496693850022863, 1.081970627018895, 0.0), # 107 (15.21384347826087, 11.83713548387097, 12.456583333333336, 13.214846739130437, 11.428235294117645, 5.421733333333335, 5.0054453781512604, 4.142666666666667, 5.850866666666667, 2.442145882352942, 1.8996637958532698, 1.1154385964912283, 0.0, 15.339375000000002, 12.26982456140351, 9.498318979266347, 7.326437647058825, 11.701733333333333, 5.799733333333334, 5.0054453781512604, 3.8726666666666674, 5.714117647058822, 4.40494891304348, 2.4913166666666675, 1.076103225806452, 0.0), # 108 (15.16558258483927, 11.772825372804107, 12.429508116140834, 13.17817918679549, 11.40706312703408, 5.408996413148403, 4.98191226229861, 4.128843468983388, 5.839395671391555, 2.4328163404072196, 1.8921095240908108, 1.112010941849365, 0.0, 15.308162722908094, 12.232120360343014, 9.460547620454054, 7.298449021221657, 11.67879134278311, 5.780380856576743, 4.98191226229861, 3.8635688665345733, 5.70353156351704, 4.392726395598498, 2.485901623228167, 1.0702568520731008, 0.0), # 109 (15.117683545058746, 11.708776937032614, 12.402249085505263, 13.141510668276972, 11.385916780978512, 5.396522379718539, 4.9584296818864715, 4.1153787532388355, 5.828011736015851, 2.423465935070874, 1.8846722586488671, 1.108580206804162, 0.0, 15.277053326474624, 12.194382274845779, 9.423361293244335, 7.27039780521262, 11.656023472031702, 5.76153025453437, 4.9584296818864715, 3.8546588426560997, 5.692958390489256, 4.380503556092325, 2.4804498171010527, 1.0644342670029652, 0.0), # 110 (15.07021964573269, 11.64502054958184, 12.374811728395064, 13.104866304347826, 11.36482207697894, 5.384338545953361, 4.935006120966905, 4.102279835390947, 5.816725102880659, 2.4140948729121283, 1.8773635300372145, 1.1051479315572885, 0.0, 15.246087962962964, 12.156627247130173, 9.386817650186073, 7.242284618736384, 11.633450205761317, 5.743191769547326, 4.935006120966905, 3.845956104252401, 5.68241103848947, 4.368288768115943, 2.474962345679013, 1.0586382317801675, 0.0), # 111 (15.02326417367448, 11.581586583477144, 12.347201531778696, 13.068271215781, 11.34380483606337, 5.372472224762486, 4.911650063591967, 4.089554031397653, 5.805546014327083, 2.404703360499207, 1.8701948687656293, 1.101715656310415, 0.0, 15.215307784636488, 12.118872219414563, 9.350974343828147, 7.214110081497619, 11.611092028654166, 5.725375643956714, 4.911650063591967, 3.837480160544633, 5.671902418031685, 4.356090405260334, 2.469440306355739, 1.0528715075888313, 0.0), # 112 (14.976806757924871, 11.51861130755273, 12.319490437669426, 13.031800658990448, 11.322854058851952, 5.3609451179335466, 4.888420770925416, 4.077235045853738, 5.794513499337931, 2.3953218946450923, 1.8631797083074313, 1.098292391533924, 0.0, 15.184710241349155, 12.081216306873161, 9.315898541537155, 7.185965683935276, 11.589026998675863, 5.708129064195233, 4.888420770925416, 3.829246512809676, 5.661427029425976, 4.343933552996817, 2.4638980875338854, 1.0471464825047938, 0.0), # 113 (14.930369436640104, 11.456715869170786, 12.292060900028826, 12.995747305532802, 11.301752911537415, 5.349730967961242, 4.865614566728464, 4.065474173003413, 5.783796819046966, 2.3861260671651134, 1.8563318232301862, 1.094921622948397, 0.0, 15.154040662656056, 12.044137852432362, 9.28165911615093, 7.1583782014953385, 11.567593638093932, 5.691663842204779, 4.865614566728464, 3.821236405686601, 5.6508764557687075, 4.331915768510935, 2.4584121800057654, 1.0415196244700715, 0.0), # 114 (14.883815844806392, 11.395922558068468, 12.264929243609757, 12.960101406218136, 11.280434856414509, 5.338800611665514, 4.84324772015325, 4.054268436185806, 5.773399988623354, 2.3771301311952313, 1.8496412030472253, 1.091605011007847, 0.0, 15.123210610656603, 12.007655121086316, 9.248206015236125, 7.131390393585693, 11.546799977246708, 5.675975810660129, 4.84324772015325, 3.8134290083325095, 5.640217428207254, 4.320033802072713, 2.452985848721952, 1.0359929598244064, 0.0), # 115 (14.837087797180216, 11.336142812561162, 12.238042919978499, 12.924799380319683, 11.25886776147603, 5.328128285467958, 4.821283854022315, 4.043586875265996, 5.763296714254843, 2.3683173433798195, 1.8430949150057288, 1.0883364263316462, 0.0, 15.092171615609425, 11.971700689648106, 9.215474575028642, 7.104952030139457, 11.526593428509686, 5.661021625372395, 4.821283854022315, 3.8058059181913984, 5.629433880738015, 4.308266460106562, 2.4476085839957, 1.0305584375055605, 0.0), # 116 (14.790127108518035, 11.277288070964257, 12.211349380701316, 12.88977764711069, 11.237019494714783, 5.317688225790165, 4.799686591158202, 4.033398530109057, 5.753460702129175, 2.359670960363252, 1.8366800263528757, 1.085109739539167, 0.0, 15.06087520777316, 11.936207134930834, 9.183400131764378, 7.079012881089755, 11.50692140425835, 5.6467579421526795, 4.799686591158202, 3.7983487327072605, 5.6185097473573915, 4.296592549036898, 2.4422698761402635, 1.0252080064512963, 0.0), # 117 (14.742875593576338, 11.21926977159314, 12.18479607734449, 12.854972625864399, 11.214857924123566, 5.3074546690537305, 4.7784195543834524, 4.023672440580065, 5.743865658434098, 2.351174238789904, 1.8303836043358468, 1.0819188212497801, 0.0, 15.02927291740644, 11.901107033747579, 9.151918021679233, 7.053522716369711, 11.487731316868196, 5.633141416812091, 4.7784195543834524, 3.791039049324093, 5.607428962061783, 4.284990875288134, 2.436959215468898, 1.0199336155993766, 0.0), # 118 (14.695275067111588, 11.161999352763203, 12.158330461474298, 12.820320735854047, 11.192350917695169, 5.297401851680244, 4.757446366520605, 4.014377646544097, 5.734485289357356, 2.3428104353041492, 1.824192716201821, 1.0787575420828581, 0.0, 14.997316274767892, 11.866332962911438, 9.120963581009105, 7.028431305912447, 11.468970578714712, 5.620128705161736, 4.757446366520605, 3.7838584654858884, 5.5961754588475845, 4.273440245284683, 2.43166609229486, 1.014727213887564, 0.0), # 119 (14.647267343880259, 11.105388252789831, 12.131899984657018, 12.785758396352872, 11.169466343422396, 5.287504010091301, 4.736730650392203, 4.005483187866229, 5.7252933010866975, 2.3345628065503625, 1.818094429197978, 1.0756197726577732, 0.0, 14.964956810116156, 11.831817499235502, 9.090472145989889, 7.003688419651086, 11.450586602173395, 5.60767646301272, 4.736730650392203, 3.7767885786366437, 5.584733171711198, 4.2619194654509585, 2.4263799969314035, 1.0095807502536214, 0.0), # 120 (14.59879423863883, 11.049347909988416, 12.105452098458917, 12.751222026634121, 11.146172069298046, 5.277735380708496, 4.716236028820784, 3.9969581044115383, 5.716263399809866, 2.326414609172919, 1.812075810571498, 1.0724993835938965, 0.0, 14.932146053709857, 11.797493219532859, 9.060379052857488, 6.979243827518756, 11.432526799619732, 5.595741346176154, 4.716236028820784, 3.769810986220354, 5.573086034649023, 4.250407342211375, 2.4210904196917835, 1.0044861736353108, 0.0), # 121 (14.549797566143766, 10.993789762674343, 12.078934254446281, 12.716648045971027, 11.122435963314915, 5.268070199953418, 4.695926124628894, 3.9887714360450994, 5.707369291714607, 2.3183490998161913, 1.8061239275695606, 1.0693902455106004, 0.0, 14.898835535807633, 11.763292700616601, 9.030619637847803, 6.955047299448573, 11.414738583429214, 5.584280010463139, 4.695926124628894, 3.762907285681013, 5.561217981657458, 4.238882681990344, 2.4157868508892566, 0.9994354329703949, 0.0), # 122 (14.50021914115155, 10.938625249163001, 12.052293904185383, 12.681972873636834, 11.098225893465804, 5.258482704247664, 4.675764560639071, 3.9808922226319887, 5.698584682988669, 2.3103495351245553, 1.8002258474393456, 1.0662862290272563, 0.0, 14.864976786668116, 11.729148519299818, 9.001129237196727, 6.931048605373665, 11.397169365977337, 5.573249111684785, 4.675764560639071, 3.7560590744626166, 5.549112946732902, 4.227324291212279, 2.4104587808370765, 0.9944204771966367, 0.0), # 123 (14.450000778418648, 10.883765807769782, 12.025478499242494, 12.647132928904785, 11.073509727743506, 5.248947130012824, 4.655714959673856, 3.9732895040372846, 5.689883279819794, 2.302399171742385, 1.794368637428032, 1.063181204763237, 0.0, 14.830521336549939, 11.694993252395603, 8.971843187140161, 6.907197515227153, 11.379766559639588, 5.562605305652198, 4.655714959673856, 3.74924795000916, 5.536754863871753, 4.215710976301596, 2.405095699848499, 0.9894332552517985, 0.0), # 124 (14.399084292701534, 10.82912287681007, 11.9984354911839, 12.612064631048113, 11.048255334140823, 5.239437713670492, 4.635740944555791, 3.965932320126061, 5.68123878839573, 2.294481266314054, 1.7885393647828007, 1.0600690433379134, 0.0, 14.795420715711726, 11.660759476717045, 8.942696823914003, 6.883443798942161, 11.36247757679146, 5.552305248176485, 4.635740944555791, 3.7424555097646373, 5.524127667070411, 4.204021543682705, 2.39968709823678, 0.9844657160736429, 0.0), # 125 (14.347411498756685, 10.774607894599258, 11.971112331575865, 12.576704399340066, 11.022430580650552, 5.229928691642264, 4.615806138107416, 3.958789710763395, 5.6726249149042225, 2.2865790754839375, 1.7827250967508306, 1.0569436153706582, 0.0, 14.759626454412127, 11.626379769077237, 8.913625483754151, 6.859737226451811, 11.345249829808445, 5.542305595068753, 4.615806138107416, 3.735663351173045, 5.511215290325276, 4.192234799780023, 2.394222466315173, 0.9795098085999328, 0.0), # 126 (14.294924211340579, 10.720132299452729, 11.943456471984673, 12.54098865305388, 10.996003335265492, 5.220394300349728, 4.595874163151275, 3.951830715814364, 5.664015365533016, 2.27867585589641, 1.7769129005793014, 1.0537987914808424, 0.0, 14.723090082909758, 11.591786706289264, 8.884564502896506, 6.836027567689229, 11.328030731066033, 5.53256300214011, 4.595874163151275, 3.728853071678377, 5.498001667632746, 4.1803295510179606, 2.388691294396935, 0.97455748176843, 0.0), # 127 (14.241564245209673, 10.665607529685879, 11.915415363976601, 12.504853811462798, 10.968941465978443, 5.210808776214481, 4.575908642509906, 3.9450243751440417, 5.655383846469858, 2.2707548641958457, 1.7710898435153934, 1.0506284422878387, 0.0, 14.68576313146326, 11.556912865166222, 8.855449217576966, 6.812264592587535, 11.310767692939717, 5.523034125201659, 4.575908642509906, 3.722006268724629, 5.484470732989221, 4.168284603820934, 2.3830830727953205, 0.9696006845168982, 0.0), # 128 (14.187273415120451, 10.610945023614088, 11.886936459117921, 12.468236293840059, 10.9412128407822, 5.201146355658116, 4.555873199005851, 3.938339728617507, 5.646704063902494, 2.2627993570266187, 1.765242992806286, 1.0474264384110183, 0.0, 14.647597130331262, 11.5216908225212, 8.82621496403143, 6.788398071079855, 11.293408127804987, 5.51367562006451, 4.555873199005851, 3.7151045397557967, 5.4706064203911, 4.156078764613354, 2.377387291823584, 0.9646313657830989, 0.0), # 129 (14.131993535829388, 10.556056219552751, 11.857967208974907, 12.431072519458905, 10.91278532766956, 5.191381275102222, 4.53573145546165, 3.9317458160998338, 5.637949724018666, 2.2547925910331035, 1.7593594156991588, 1.044186650469754, 0.0, 14.608543609772397, 11.48605315516729, 8.796797078495793, 6.764377773099309, 11.275899448037332, 5.504444142539767, 4.53573145546165, 3.7081294822158726, 5.45639266383478, 4.1436908398196355, 2.3715934417949813, 0.9596414745047956, 0.0), # 130 (14.07566642209295, 10.500852555817252, 11.828455065113841, 12.393298907592571, 10.883626794633326, 5.181487770968396, 4.515447034699847, 3.9252116774560997, 5.629094533006126, 2.2467178228596745, 1.7534261794411918, 1.0409029490834167, 0.0, 14.568554100045299, 11.449932439917582, 8.767130897205957, 6.740153468579022, 11.258189066012251, 5.49529634843854, 4.515447034699847, 3.701062693548854, 5.441813397316663, 4.131099635864191, 2.3656910130227686, 0.9546229596197504, 0.0), # 131 (14.018233888667616, 10.445245470722984, 11.798347479100995, 12.354851877514303, 10.853705109666297, 5.171440079678229, 4.49498355954298, 3.918706352551382, 5.620112197052615, 2.238558309150706, 1.7474303512795641, 1.0375692048713792, 0.0, 14.527580131408602, 11.413261253585167, 8.73715175639782, 6.715674927452117, 11.24022439410523, 5.486188893571935, 4.49498355954298, 3.693885771198735, 5.4268525548331485, 4.1182839591714355, 2.3596694958201994, 0.949567770065726, 0.0), # 132 (13.959637750309861, 10.38914640258533, 11.767591902502646, 12.315667848497343, 10.822988140761264, 5.161212437653315, 4.474304652813592, 3.9121988812507547, 5.61097642234588, 2.2302973065505736, 1.7413589984614566, 1.0341792884530125, 0.0, 14.485573234120938, 11.375972172983136, 8.706794992307282, 6.690891919651719, 11.22195284469176, 5.477078433751057, 4.474304652813592, 3.686580312609511, 5.411494070380632, 4.105222616165782, 2.3535183805005295, 0.9444678547804848, 0.0), # 133 (13.899819821776152, 10.332466789719687, 11.736135786885072, 12.275683239814924, 10.791443755911033, 5.150779081315248, 4.453373937334223, 3.9056583034192958, 5.601660915073669, 2.2219180717036497, 1.7351991882340478, 1.030727070447689, 0.0, 14.442484938440934, 11.337997774924577, 8.675995941170239, 6.6657542151109475, 11.203321830147338, 5.467921624787015, 4.453373937334223, 3.6791279152251772, 5.395721877955516, 4.091894413271643, 2.3472271573770147, 0.9393151627017899, 0.0), # 134 (13.838721917822966, 10.275118070441435, 11.703926583814546, 12.234834470740296, 10.759039823108395, 5.14011424708562, 4.432155035927415, 3.8990536589220803, 5.592139381423722, 2.213403861254311, 1.7289379878445184, 1.0272064214747805, 0.0, 14.398266774627231, 11.299270636222584, 8.64468993922259, 6.640211583762932, 11.184278762847445, 5.458675122490913, 4.432155035927415, 3.671510176489728, 5.379519911554198, 4.0782781569134325, 2.340785316762909, 0.9341016427674034, 0.0), # 135 (13.776285853206776, 10.217011683065968, 11.670911744857346, 12.193057960546685, 10.725744210346152, 5.129192171386024, 4.410611571415708, 3.892353987624185, 5.5823855275837895, 2.2047379318469296, 1.7225624645400475, 1.0236112121536591, 0.0, 14.352870272938459, 11.259723333690248, 8.612812322700236, 6.614213795540787, 11.164771055167579, 5.44929558267386, 4.410611571415708, 3.6637086938471604, 5.362872105173076, 4.064352653515563, 2.3341823489714693, 0.9288192439150881, 0.0), # 136 (13.712453442684055, 10.15805906590867, 11.63703872157975, 12.15029012850735, 10.691524785617101, 5.117987090638052, 4.388707166621645, 3.885528329390686, 5.572373059741617, 2.1959035401258813, 1.716059685567815, 1.0199353131036961, 0.0, 14.306246963633242, 11.219288444140656, 8.580298427839075, 6.587710620377642, 11.144746119483234, 5.439739661146961, 4.388707166621645, 3.6557050647414657, 5.345762392808551, 4.050096709502451, 2.3274077443159498, 0.9234599150826065, 0.0), # 137 (13.647166501011277, 10.098171657284933, 11.602254965548024, 12.106467393895517, 10.656349416914047, 5.106473241263299, 4.366405444367763, 3.8785457240866603, 5.56207568408495, 2.1868839427355393, 1.7094167181750008, 1.016172594944264, 0.0, 14.258348376970226, 11.1778985443869, 8.547083590875005, 6.560651828206616, 11.1241513681699, 5.4299640137213245, 4.366405444367763, 3.6474808866166426, 5.3281747084570235, 4.035489131298506, 2.320450993109605, 0.9180156052077213, 0.0), # 138 (13.58036684294491, 10.037260895510144, 11.566507928328454, 12.061526175984431, 10.620185972229777, 5.094624859683358, 4.343670027476608, 3.8713752115771833, 5.551467106801532, 2.1776623963202795, 1.7026206296087845, 1.0123169282947344, 0.0, 14.20912604320803, 11.135486211242075, 8.513103148043921, 6.532987188960837, 11.102934213603064, 5.419925296208056, 4.343670027476608, 3.6390177569166844, 5.3100929861148884, 4.020508725328145, 2.313301585665691, 0.912478263228195, 0.0), # 139 (13.511996283241437, 9.97523821889969, 11.529745061487317, 12.015402894047334, 10.583002319557098, 5.082416182319821, 4.320464538770717, 3.863985831727331, 5.54052103407911, 2.168222157524475, 1.6956584871163454, 1.008362183774479, 0.0, 14.158531492605304, 11.091984021519266, 8.478292435581725, 6.504666472573423, 11.08104206815822, 5.409580164418264, 4.320464538770717, 3.6302972730855863, 5.291501159778549, 4.005134298015779, 2.3059490122974635, 0.9068398380817901, 0.0), # 140 (13.44199663665733, 9.912015065768964, 11.491913816590882, 11.968033967357464, 10.544766326888803, 5.069821445594281, 4.296752601072636, 3.8563466244021805, 5.529211172105429, 2.158546482992501, 1.688517357944864, 1.00430223200287, 0.0, 14.106516255420662, 11.047324552031569, 8.442586789724318, 6.4756394489775015, 11.058422344210857, 5.398885274163053, 4.296752601072636, 3.6213010325673434, 5.272383163444402, 3.989344655785822, 2.2983827633181764, 0.9010922787062696, 0.0), # 141 (13.37030971794905, 9.84750287443335, 11.452961645205429, 11.919355815188066, 10.505445862217693, 5.056814885928333, 4.272497837204901, 3.848426629466808, 5.517511227068235, 2.1486186293687317, 1.6811843093415195, 1.0001309435992793, 0.0, 14.053031861912746, 11.001440379592072, 8.405921546707596, 6.445855888106194, 11.03502245413647, 5.3877972812535315, 4.272497837204901, 3.612010632805952, 5.252722931108846, 3.973118605062689, 2.2905923290410857, 0.8952275340393956, 0.0), # 142 (13.29687734187308, 9.781613083208239, 11.412835998897235, 11.86930485681237, 10.465008793536564, 5.043370739743566, 4.247663869990055, 3.840194886786288, 5.505394905155279, 2.1384218532975416, 1.6736464085534917, 0.9958421891830788, 0.0, 13.998029842340188, 10.954264081013864, 8.368232042767458, 6.415265559892624, 11.010789810310557, 5.376272841500803, 4.247663869990055, 3.6024076712454045, 5.232504396768282, 3.956434952270791, 2.282567199779447, 0.8892375530189309, 0.0), # 143 (13.221641323185896, 9.714257130409019, 11.37148432923257, 11.817817511503629, 10.423422988838217, 5.029463243461577, 4.222214322250639, 3.8316204362256996, 5.492835912554298, 2.1279394114233043, 1.6658907228279605, 0.99142983937364, 0.0, 13.941461726961624, 10.905728233110038, 8.329453614139801, 6.383818234269912, 10.985671825108597, 5.364268610715979, 4.222214322250639, 3.592473745329698, 5.2117114944191085, 3.9392725038345437, 2.2742968658465146, 0.8831142845826383, 0.0), # 144 (13.144543476643964, 9.64534645435108, 11.328854087777719, 11.764830198535075, 10.380656316115449, 5.015066633503958, 4.196112816809195, 3.8226723176501176, 5.479807955453042, 2.1171545603903956, 1.6579043194121055, 0.9868877647903354, 0.0, 13.88327904603568, 10.855765412693687, 8.289521597060528, 6.351463681171186, 10.959615910906084, 5.351741244710165, 4.196112816809195, 3.582190452502827, 5.190328158057724, 3.921610066178359, 2.265770817555544, 0.8768496776682801, 0.0), # 145 (13.065525617003761, 9.574792493349808, 11.284892726098956, 11.710279337179951, 10.33667664336106, 5.000155146292303, 4.169322976488264, 3.813319570924618, 5.4662847400392565, 2.1060505568431886, 1.6496742655531065, 0.9822098360525362, 0.0, 13.82343332982099, 10.804308196577896, 8.248371327765533, 6.318151670529565, 10.932569480078513, 5.338647399294466, 4.169322976488264, 3.5715393902087875, 5.16833832168053, 3.903426445726651, 2.2569785452197917, 0.870435681213619, 0.0), # 146 (12.98452955902176, 9.502506685720592, 11.239547695762546, 11.654101346711496, 10.291451838567841, 4.984703018248201, 4.141808424110385, 3.803531235914277, 5.4522399725006885, 2.094610657426059, 1.6411876284981433, 0.9773899237796149, 0.0, 13.761876108576189, 10.751289161575762, 8.205938142490716, 6.2838319722781755, 10.904479945001377, 5.324943730279988, 4.141808424110385, 3.5605021558915717, 5.145725919283921, 3.884700448903833, 2.2479095391525097, 0.8638642441564175, 0.0), # 147 (12.901497117454435, 9.428400469778822, 11.192766448334778, 11.596232646402957, 10.2449497697286, 4.968684485793251, 4.113532782498101, 3.7932763524841717, 5.437647359025082, 2.082818118783379, 1.6324314754943956, 0.9724218985909429, 0.0, 13.698558912559907, 10.69664088450037, 8.162157377471978, 6.248454356350136, 10.875294718050164, 5.310586893477841, 4.113532782498101, 3.5490603469951787, 5.1224748848643, 3.8654108821343196, 2.2385532896669558, 0.8571273154344385, 0.0), # 148 (12.81637010705826, 9.352385283839885, 11.144496435381926, 11.536609655527563, 10.197138304836129, 4.9520737853490395, 4.084459674473953, 3.7825239604993777, 5.42248060580018, 2.0706561975595257, 1.6233928737890426, 0.9672996311058923, 0.0, 13.63343327203078, 10.640295942164814, 8.116964368945213, 6.211968592678575, 10.84496121160036, 5.295533544699129, 4.084459674473953, 3.5371955609635997, 5.098569152418064, 3.845536551842522, 2.2288992870763855, 0.8502168439854443, 0.0), # 149 (12.729090342589704, 9.274372566219169, 11.09468510847026, 11.475168793358566, 10.147985311883227, 4.934845153337166, 4.054552722860481, 3.771243099824971, 5.406713419013735, 2.058108150398871, 1.614058890629265, 0.9620169919438353, 0.0, 13.566450717247434, 10.582186911382186, 8.070294453146325, 6.174324451196611, 10.81342683802747, 5.27974033975496, 4.054552722860481, 3.524889395240833, 5.0739926559416135, 3.825056264452856, 2.2189370216940523, 0.8431247787471974, 0.0), # 150 (12.63959963880524, 9.194273755232066, 11.043279919166057, 11.411846479169196, 10.097458658862696, 4.916972826179219, 4.023775550480226, 3.759402810326029, 5.390319504853488, 2.0451572339457917, 1.6044165932622414, 0.956567851724143, 0.0, 13.49756277846851, 10.522246368965572, 8.022082966311206, 6.135471701837374, 10.780639009706976, 5.263163934456441, 4.023775550480226, 3.5121234472708704, 5.048729329431348, 3.8039488263897328, 2.2086559838332116, 0.8358430686574607, 0.0), # 151 (12.54783981046135, 9.11200028919396, 10.990228319035603, 11.346579132232703, 10.045526213767326, 4.898431040296793, 3.992091780155732, 3.7469721318676275, 5.373272569507184, 2.0317867048446603, 1.5944530489351527, 0.950946081066188, 0.0, 13.426720985952636, 10.460406891728066, 7.9722652446757625, 6.09536011453398, 10.746545139014367, 5.245760984614678, 3.992091780155732, 3.4988793144977093, 5.022763106883663, 3.7821930440775686, 2.198045663807121, 0.8283636626539964, 0.0), # 152 (12.453752672314497, 9.027463606420243, 10.935477759645158, 11.27930317182232, 9.992155844589925, 4.8791940321114815, 3.9594650347095355, 3.7339201043148416, 5.355546319162572, 2.017979819739852, 1.5841553248951779, 0.945145550589342, 0.0, 13.353876869958444, 10.39660105648276, 7.920776624475889, 6.053939459219555, 10.711092638325145, 5.227488146040779, 3.9594650347095355, 3.485138594365344, 4.996077922294963, 3.759767723940774, 2.187095551929032, 0.8206785096745677, 0.0), # 153 (12.357280039121166, 8.940575145226303, 10.878975692561012, 11.209955017211293, 9.937315419323285, 4.859236038044878, 3.9258589369641825, 3.7202157675327485, 5.337114460007395, 2.0037198352757417, 1.5735104883894968, 0.9391601309129768, 0.0, 13.278981960744572, 10.330761440042743, 7.867552441947483, 6.011159505827224, 10.67422892001479, 5.208302074545848, 3.9258589369641825, 3.4708828843177697, 4.968657709661643, 3.736651672403765, 2.1757951385122025, 0.8127795586569367, 0.0), # 154 (12.258363725637818, 8.851246343927524, 10.820669569349436, 11.138471087672855, 9.880972805960209, 4.838531294518574, 3.891237109742209, 3.705828161386424, 5.317950698229401, 1.9889900080967022, 1.562505606665289, 0.9329836926564644, 0.0, 13.201987788569642, 10.262820619221108, 7.812528033326444, 5.966970024290106, 10.635901396458802, 5.188159425940994, 3.891237109742209, 3.456093781798981, 4.940486402980104, 3.712823695890952, 2.1641339138698874, 0.804658758538866, 0.0), # 155 (12.15694554662093, 8.759388640839303, 10.760506841576703, 11.06478780248025, 9.823095872493491, 4.817054037954164, 3.85556317586616, 3.690726325740946, 5.298028740016334, 1.9737735948471096, 1.5511277469697347, 0.9266101064391765, 0.0, 13.122845883692296, 10.19271117083094, 7.755638734848673, 5.921320784541328, 10.596057480032668, 5.167016856037325, 3.85556317586616, 3.440752884252974, 4.911547936246746, 3.688262600826751, 2.1521013683153405, 0.7963080582581185, 0.0), # 156 (12.05296731682698, 8.664913474277022, 10.698434960809092, 10.988841580906726, 9.76365248691593, 4.79477850477324, 3.8188007581585754, 3.6748793004613884, 5.27732229155594, 1.958053852171337, 1.5393639765500133, 0.9200332428804852, 0.0, 13.041507776371162, 10.120365671685335, 7.696819882750066, 5.87416155651401, 10.55464458311188, 5.1448310206459436, 3.8188007581585754, 3.4248417891237426, 4.881826243457965, 3.662947193635576, 2.1396869921618182, 0.7877194067524566, 0.0), # 157 (11.943489514248384, 8.56599791046598, 10.631455938536474, 10.907723497981493, 9.699926512929064, 4.7702895112293024, 3.780085376742286, 3.6571979682329148, 5.254219782186185, 1.9413463665164579, 1.5268255340103847, 0.9130132752259121, 0.0, 12.954377375064553, 10.043146027485031, 7.634127670051924, 5.824039099549372, 10.50843956437237, 5.120077155526081, 3.780085376742286, 3.407349650878073, 4.849963256464532, 3.6359078326604983, 2.126291187707295, 0.7787270827696345, 0.0), # 158 (11.811658827165445, 8.452495802079234, 10.542317091203984, 10.804772590546145, 9.61620406376707, 4.7354436714732975, 3.734570210708573, 3.6314756885095885, 5.21942787265181, 1.9209123976394986, 1.5113111828317318, 0.9041816698244146, 0.0, 12.840684235072311, 9.94599836806856, 7.556555914158659, 5.762737192918495, 10.43885574530362, 5.084065963913424, 3.734570210708573, 3.3824597653380692, 4.808102031883535, 3.6015908635153826, 2.108463418240797, 0.7684087092799304, 0.0), # 159 (11.655795351846896, 8.323475201859713, 10.429227943941186, 10.678293012490633, 9.51084814010325, 4.689385209644506, 3.6817949987070273, 3.5970661263515646, 5.171960121188613, 1.896482260745158, 1.4926025356292107, 0.893400259851713, 0.0, 12.69827297422973, 9.827402858368842, 7.463012678146054, 5.689446782235472, 10.343920242377227, 5.0358925768921905, 3.6817949987070273, 3.3495608640317895, 4.755424070051625, 3.559431004163545, 2.0858455887882372, 0.7566795638054286, 0.0), # 160 (11.477155287337537, 8.179777273184687, 10.293395962547079, 10.529487004508074, 9.38495266590092, 4.632672092132293, 3.622145156805501, 3.5544003554065204, 5.112442542399476, 1.8682632772683756, 1.4708644412265888, 0.8807689958543429, 0.0, 12.528598471710556, 9.68845895439777, 7.354322206132943, 5.6047898318051255, 10.224885084798952, 4.976160497569129, 3.622145156805501, 3.3090514943802094, 4.69247633295046, 3.509829001502692, 2.058679192509416, 0.7436161157440625, 0.0), # 161 (11.27699483268217, 8.022243179431417, 10.136028612820661, 10.359556807291593, 9.239611565123418, 4.565862285326026, 3.5560061010718473, 3.503909449322135, 5.041501150887273, 1.836462768644093, 1.4462617484476323, 0.8663878283788393, 0.0, 12.333115606688533, 9.530266112167231, 7.231308742238162, 5.509388305932278, 10.083002301774545, 4.9054732290509895, 3.5560061010718473, 3.261330203804304, 4.619805782561709, 3.4531856024305316, 2.0272057225641325, 0.7292948344937653, 0.0), # 162 (11.056570186925597, 7.851714083977169, 9.958333360560937, 10.169704661534322, 9.075918761734068, 4.489513755615068, 3.4837632475739206, 3.4460244817460834, 4.959761961254883, 1.8012880563072504, 1.418959306116109, 0.8503567079717379, 0.0, 12.113279258337407, 9.353923787689116, 7.0947965305805445, 5.40386416892175, 9.919523922509766, 4.824434274444517, 3.4837632475739206, 3.2067955397250487, 4.537959380867034, 3.3899015538447745, 1.9916666721121876, 0.71379218945247, 0.0), # 163 (10.817137549112616, 7.669031150199204, 9.761517671566903, 9.961132807929381, 8.894968179696201, 4.404184469388787, 3.405802012379573, 3.3811765263260463, 4.867850988105186, 1.762946461692788, 1.3891219630557858, 0.8327755851795738, 0.0, 11.870544305830926, 9.160531436975312, 6.945609815278928, 5.288839385078362, 9.735701976210372, 4.733647136856465, 3.405802012379573, 3.1458460495634197, 4.447484089848101, 3.320377602643128, 1.9523035343133808, 0.6971846500181095, 0.0), # 164 (10.559953118288028, 7.475035541474793, 9.546789011637559, 9.735043487169904, 8.697853742973145, 4.310432393036548, 3.3225078115566578, 3.3097966567096977, 4.766394246041056, 1.7216453062356458, 1.35691456809043, 0.8137444105488828, 0.0, 11.606365628342832, 8.951188516037709, 6.7845728404521495, 5.164935918706936, 9.532788492082112, 4.633715319393577, 3.3225078115566578, 3.078880280740391, 4.348926871486572, 3.245014495723302, 1.909357802327512, 0.6795486855886177, 0.0), # 165 (10.286273093496636, 7.270568421181199, 9.315354846571905, 9.492638939949002, 8.485669375528229, 4.208815492947715, 3.234266061173029, 3.2323159465447184, 4.656017749665372, 1.6775919113707654, 1.322501970043808, 0.7933631346262003, 0.0, 11.322198105046873, 8.726994480888202, 6.612509850219039, 5.0327757341122945, 9.312035499330744, 4.525242325162606, 3.234266061173029, 3.0062967806769394, 4.242834687764114, 3.1642129799830014, 1.8630709693143812, 0.6609607655619273, 0.0), # 166 (9.997353673783238, 7.056470952695688, 9.06842264216894, 9.235121406959813, 8.259509001324778, 4.099891735511655, 3.14146217729654, 3.1491654694787847, 4.537347513581013, 1.6309935985330861, 1.2860490177396875, 0.7717317079580612, 0.0, 11.019496615116793, 8.489048787538673, 6.430245088698436, 4.892980795599257, 9.074695027162026, 4.408831657270299, 3.14146217729654, 2.928494096794039, 4.129754500662389, 3.0783738023199385, 1.8136845284337881, 0.6414973593359717, 0.0), # 167 (9.694451058192634, 6.833584299395522, 8.807199864227664, 8.963693128895455, 8.020466544326124, 3.9842190871177325, 3.0444815759950434, 3.0607762991595733, 4.411009552390856, 1.5820576891575493, 1.247720560001835, 0.7489500810910016, 0.0, 10.69971603772634, 8.238450892001017, 6.2386028000091756, 4.746173067472647, 8.822019104781711, 4.285086818823403, 3.0444815759950434, 2.8458707765126663, 4.010233272163062, 2.987897709631819, 1.7614399728455332, 0.6212349363086839, 0.0), # 168 (9.378821445769624, 6.602749624657969, 8.53289397854708, 8.67955634644906, 7.769635928495594, 3.8623555141553156, 2.9437096733363934, 2.9675795092347634, 4.277629880697781, 1.5309915046790952, 1.2076814456540184, 0.7251182045715564, 0.0, 10.364311252049257, 7.976300250287119, 6.038407228270092, 4.592974514037284, 8.555259761395561, 4.154611312928669, 2.9437096733363934, 2.7588253672537966, 3.884817964247797, 2.8931854488163538, 1.706578795709416, 0.6002499658779973, 0.0), # 169 (9.051721035559014, 6.3648080918602945, 8.24671245092618, 8.383913300313743, 7.508111077796515, 3.7348589830137664, 2.8395318853884426, 2.870006173352032, 4.137834513104661, 1.4780023665326634, 1.1660965235200045, 0.7003360289462612, 0.0, 10.014737137259289, 7.7036963184088725, 5.830482617600023, 4.43400709959799, 8.275669026209322, 4.018008642692845, 2.8395318853884426, 2.6677564164384044, 3.7540555388982577, 2.7946377667712485, 1.649342490185236, 0.5786189174418451, 0.0), # 170 (8.7144060266056, 6.12060086437976, 7.949862747163971, 8.077966231182643, 7.23698591619222, 3.602287460082452, 2.7323336282190445, 2.7684873651590554, 3.992249464214377, 1.4232975961531957, 1.1231306424235596, 0.6747035047616515, 0.0, 9.652448572530185, 7.421738552378166, 5.615653212117798, 4.269892788459586, 7.984498928428754, 3.8758823112226777, 2.7323336282190445, 2.5730624714874657, 3.61849295809611, 2.692655410394215, 1.5899725494327943, 0.5564182603981601, 0.0), # 171 (8.368132617954185, 5.870969105593635, 7.643552333059449, 7.762917379748876, 6.9573543676460305, 3.4651989117507385, 2.6225003178960526, 2.663454158303514, 3.8415007486298056, 1.3670845149756323, 1.0789486511884518, 0.648320582564263, 0.0, 9.278900437035686, 7.1315264082068905, 5.3947432559422595, 4.101253544926896, 7.683001497259611, 3.7288358216249198, 2.6225003178960526, 2.475142079821956, 3.4786771838230153, 2.587639126582959, 1.52871046661189, 0.5337244641448761, 0.0), # 172 (8.014157008649567, 5.616753978879182, 7.328988674411616, 7.439968986705571, 6.6703103561212815, 3.3241513044079904, 2.51041737048732, 2.5553376264330825, 3.6862143809538255, 1.309570444434913, 1.0337153986384477, 0.62128721290063, 0.0, 8.89554760994954, 6.83415934190693, 5.168576993192238, 3.9287113333047383, 7.372428761907651, 3.5774726770063157, 2.51041737048732, 2.37439378886285, 3.3351551780606408, 2.479989662235191, 1.4657977348823235, 0.5106139980799257, 0.0), # 173 (7.6537353977365505, 5.358796647613667, 7.00737923701947, 7.110323292745849, 6.376947805581297, 3.179702604443573, 2.3964702020607005, 2.4445688431954404, 3.527016375789314, 1.250962705965979, 0.9875957335973142, 0.5937033463172892, 0.0, 8.503844970445494, 6.53073680949018, 4.93797866798657, 3.7528881178979363, 7.054032751578628, 3.4223963804736166, 2.3964702020607005, 2.2712161460311235, 3.1884739027906486, 2.370107764248617, 1.401475847403894, 0.4871633316012425, 0.0), # 174 (7.288123984259929, 5.097938275174352, 6.679931486682011, 6.7751825385628415, 6.078360639989406, 3.0324107782468537, 2.2810442286840464, 2.331578882238264, 3.36453274773915, 1.19146862100377, 0.9407545048888186, 0.5656689333607753, 0.0, 8.105247397697292, 6.222358266968527, 4.703772524444093, 3.574405863011309, 6.7290654954783, 3.26421043513357, 2.2810442286840464, 2.1660076987477526, 3.039180319994703, 2.2583941795209475, 1.3359862973364023, 0.46344893410675936, 0.0), # 175 (6.91857896726451, 4.835020024938507, 6.347852889198238, 6.435748964849671, 5.775642783308939, 2.882833792207196, 2.164524866425212, 2.216798817209233, 3.199389511406209, 1.131295510983227, 0.8933565613367281, 0.537283924577624, 0.0, 7.701209770878679, 5.910123170353863, 4.46678280668364, 3.39388653294968, 6.398779022812418, 3.103518344092926, 2.164524866425212, 2.0591669944337117, 2.8878213916544695, 2.1452496549498905, 1.2695705778396478, 0.4395472749944098, 0.0), # 176 (6.546356545795092, 4.570883060283395, 6.012350910367152, 6.093224812299459, 5.469888159503225, 2.731529612713966, 2.0472975313520503, 2.100659721756022, 3.0322126813933705, 1.07065069733929, 0.8455667517648098, 0.5086482705143706, 0.0, 7.2931869691634, 5.595130975658075, 4.227833758824048, 3.211952092017869, 6.064425362786741, 2.9409236104584306, 2.0472975313520503, 1.9510925805099755, 2.7349440797516125, 2.0310749374331536, 1.2024701820734305, 0.4155348236621269, 0.0), # 177 (6.172712918896475, 4.306368544586282, 5.6746330159877525, 5.74881232160534, 5.162190692535588, 2.5790562061565305, 1.929747639532414, 1.9835926695263104, 2.863628272303512, 1.0097415015069002, 0.7975499249968301, 0.4798619217175504, 0.0, 6.882633871725203, 5.278481138893053, 3.98774962498415, 3.0292245045207, 5.727256544607024, 2.7770297373368344, 1.929747639532414, 1.8421830043975218, 2.581095346267794, 1.916270773868447, 1.1349266031975505, 0.3914880495078438, 0.0), # 178 (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), # 179 ) passenger_allighting_rate = ( (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 0 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 1 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 2 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 3 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 4 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 5 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 6 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 7 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 8 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 9 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 10 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 11 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 12 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 13 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 14 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 15 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 16 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 17 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 18 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 19 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 20 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 21 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 22 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 23 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 24 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 25 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 26 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 27 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 28 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 29 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 30 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 31 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 32 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 33 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 34 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 35 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 36 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 37 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 38 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 39 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 40 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 41 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 42 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 43 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 44 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 45 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 46 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 47 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 48 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 49 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 50 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 51 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 52 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 53 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 54 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 55 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 56 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 57 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 58 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 59 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 60 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 61 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 62 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 63 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 64 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 65 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 66 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 67 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 68 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 69 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 70 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 71 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 72 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 73 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 74 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 75 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 76 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 77 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 78 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 79 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 80 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 81 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 82 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 83 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 84 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 85 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 86 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 87 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 88 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 89 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 90 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 91 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 92 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 93 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 94 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 95 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 96 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 97 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 98 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 99 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 100 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 101 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 102 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 103 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 104 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 105 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 106 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 107 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 108 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 109 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 110 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 111 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 112 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 113 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 114 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 115 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 116 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 117 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 118 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 119 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 120 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 121 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 122 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 123 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 124 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 125 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 126 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 127 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 128 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 129 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 130 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 131 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 132 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 133 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 134 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 135 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 136 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 137 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 138 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 139 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 140 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 141 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 142 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 143 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 144 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 145 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 146 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 147 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 148 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 149 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 150 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 151 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 152 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 153 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 154 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 155 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 156 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 157 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 158 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 159 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 160 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 161 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 162 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 163 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 164 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 165 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 166 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 167 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 168 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 169 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 170 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 171 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 172 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 173 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 174 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 175 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 176 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 177 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 178 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 179 ) """ parameters for reproducibiliy. More information: https://numpy.org/doc/stable/reference/random/parallel.html """ #initial entropy entropy = 8991598675325360468762009371570610170 #index for seed sequence child child_seed_index = ( 1, # 0 73, # 1 )
279.176471
491
0.771965
32,987
261,030
6.108315
0.230485
0.353756
0.339463
0.643192
0.365731
0.360064
0.35922
0.359185
0.359185
0.359185
0
0.851542
0.094755
261,030
934
492
279.475375
0.001181
0.015366
0
0.200873
0
0
0
0
0
0
0
0
0
1
0
false
0.005459
0
0
0
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
1
0
0
0
0
1
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
d9b81b3a08dca46c6d17d3a2e91064b2c847e2cb
5,434
py
Python
training code/paviac/mdcpe/testcode/logitsmulti.py
littlejgogo/MDCPE-co-training-method-for-hyperspectral-image-classification
b7d367abd97ada77adc45a1120149cf247f9713c
[ "Apache-2.0" ]
4
2018-12-08T08:15:23.000Z
2020-10-07T10:00:22.000Z
training code/paviac/mdcpe/testcode/logitsmulti.py
littlejgogo/MDCPE-co-training-method-for-hyperspectral-image-classification
b7d367abd97ada77adc45a1120149cf247f9713c
[ "Apache-2.0" ]
null
null
null
training code/paviac/mdcpe/testcode/logitsmulti.py
littlejgogo/MDCPE-co-training-method-for-hyperspectral-image-classification
b7d367abd97ada77adc45a1120149cf247f9713c
[ "Apache-2.0" ]
6
2019-01-11T17:01:49.000Z
2022-02-05T04:48:59.000Z
# import tensorflow as tf # import cnn_indices # # data = cnn_indices.read_data_sets() # import final_index # import numpy as np # saver = tf.train.import_meta_graph('/home/asdf/Documents/juyan/paper/paviac/mdcpe/contrastive model/5/CNN/' # 'CNN0511.ckpt.meta') # batch_size = 2000 # prediction = np.zeros((1, 9), dtype=np.int32) # true_label = np.zeros((1, 9), dtype=np.int32) # cnnlogits = np.zeros((1, 9), dtype=np.float64) # with tf.Session() as sess: # saver.restore(sess, '/home/asdf/Documents/juyan/paper/paviac/mdcpe/contrastive model/5/CNN/' # 'CNN0511.ckpt') # y = sess.graph.get_tensor_by_name('Softmax:0') # X = sess.graph.get_operation_by_name('X').outputs[0] # keep_prob = sess.graph.get_operation_by_name('keep_prob').outputs[0] # proba = sess.graph.get_tensor_by_name('Add_1:0') # for index in range((data.test._num_examples // batch_size) + 1): # batch, Y = data.test.next_batch_test(batch_size) # cnn_logits, pre_pro = sess.run([proba, y], feed_dict={X: batch, keep_prob: 1.0}) # # prediction = np.concatenate((prediction, pre_pro), axis=0) # true_label = np.concatenate((true_label, Y), axis=0) # cnnlogits = np.concatenate((cnnlogits, cnn_logits), axis=0) # # predict_label = np.argmax(prediction[1:], 1) + 1 # true_label = np.argmax(true_label[1:], 1) + 1 # # prediction = prediction[1:] # cnnlogits = cnnlogits[1:] # rnnlogtis = np.load("/home/asdf/Documents/juyan/paper/paviac/mdcpe/contrastive model/5/RNN/logits.npy") # # norm_rnn = np.zeros((cnnlogits.shape[0], cnnlogits.shape[1]), dtype=np.float32) # norm_cnn = np.zeros((cnnlogits.shape[0], cnnlogits.shape[1]), dtype=np.float32) # max_cnn = np.amax(cnnlogits, axis=1) # min_cnn = np.amin(cnnlogits, axis=1) # substract_cnn = [x-y for x, y in zip(max_cnn, min_cnn)] # max_rnn = np.amax(rnnlogtis, axis=1) # min_rnn = np.amin(rnnlogtis, axis=1) # substract_rnn = [x-y for x, y in zip(max_rnn, min_rnn)] # for i in range(cnnlogits.shape[0]): # for j in range(cnnlogits.shape[1]): # norm_cnn[i][j] = (cnnlogits[i][j] - min_cnn[i]) / substract_cnn[i] # norm_rnn[i][j] = (rnnlogtis[i][j] - min_rnn[i]) / substract_rnn[i] # # # alllogits = [x * y for x, y in zip(norm_cnn, norm_rnn)] # # predict_label = np.argmax(alllogits, 1) + 1 # # every_class, confusion_mat = final_index.test_data_index(true_label, predict_label, 9) # np.savez('/home/asdf/Documents/juyan/paper/paviac/mdcpe/contrastive model/5/zhibiao0511.npz', # every_class=every_class, confusion_mat=confusion_mat) # print("ok") # # # zhibiao = np.load('/home/asdf/Documents/juyan/paper/data/salinas/0418_15each_class/zhibiao0421_cnnco.npz') # # every_class = zhibiao['every_class'] # # confusion_mat = zhibiao['confusion_mat'] # import tensorflow as tf import cnn_indices data = cnn_indices.read_data_sets() import final_index import numpy as np saver = tf.train.import_meta_graph('/home/asdf/Documents/juyan/paper/paviac/cnn/model/' 'CNN0511.ckpt.meta') batch_size = data.valid._num_examples prediction = np.zeros((1, 9), dtype=np.int32) true_label = np.zeros((1, 9), dtype=np.int32) cnnlogits = np.zeros((1, 9), dtype=np.float64) with tf.Session() as sess: saver.restore(sess, '/home/asdf/Documents/juyan/paper/paviac/cnn/model/' 'CNN0511.ckpt') y = sess.graph.get_tensor_by_name('Softmax:0') X = sess.graph.get_operation_by_name('X').outputs[0] keep_prob = sess.graph.get_operation_by_name('keep_prob').outputs[0] proba = sess.graph.get_tensor_by_name('Add_1:0') batch, Y = data.valid.next_batch_test(batch_size) cnn_logits, pre_pro = sess.run([proba, y], feed_dict={X: batch, keep_prob: 1.0}) # prediction = np.concatenate((prediction, pre_pro), axis=0) true_label = np.concatenate((true_label, Y), axis=0) cnnlogits = np.concatenate((cnnlogits, cnn_logits), axis=0) # predict_label = np.argmax(prediction[1:], 1) + 1 true_label = np.argmax(true_label[1:], 1) + 1 # prediction = prediction[1:] cnnlogits = cnnlogits[1:] rnnlogtis = np.load("/home/asdf/Documents/juyan/paper/paviac/mdcpe/contrastive model/0/logits.npy") norm_rnn = np.zeros((cnnlogits.shape[0], cnnlogits.shape[1]), dtype=np.float32) norm_cnn = np.zeros((cnnlogits.shape[0], cnnlogits.shape[1]), dtype=np.float32) max_cnn = np.amax(cnnlogits, axis=1) min_cnn = np.amin(cnnlogits, axis=1) substract_cnn = [x-y for x, y in zip(max_cnn, min_cnn)] max_rnn = np.amax(rnnlogtis, axis=1) min_rnn = np.amin(rnnlogtis, axis=1) substract_rnn = [x-y for x, y in zip(max_rnn, min_rnn)] for i in range(cnnlogits.shape[0]): for j in range(cnnlogits.shape[1]): norm_cnn[i][j] = (cnnlogits[i][j] - min_cnn[i]) / substract_cnn[i] norm_rnn[i][j] = (rnnlogtis[i][j] - min_rnn[i]) / substract_rnn[i] alllogits = [x * y for x, y in zip(norm_cnn, norm_rnn)] predict_label = np.argmax(alllogits, 1) + 1 every_class, confusion_mat = final_index.test_data_index(true_label, predict_label, 9) np.savez('/home/asdf/Documents/juyan/paper/paviac/mdcpe/contrastive model/0/zhibiao0511.npz', every_class=every_class, confusion_mat=confusion_mat) print("ok") # zhibiao = np.load('/home/asdf/Documents/juyan/paper/data/salinas/0418_15each_class/zhibiao0421_cnnco.npz') # every_class = zhibiao['every_class'] # confusion_mat = zhibiao['confusion_mat']
46.050847
110
0.689915
851
5,434
4.218566
0.128085
0.030084
0.047354
0.061281
0.972145
0.964903
0.964903
0.964903
0.964903
0.964903
0
0.032223
0.149061
5,434
117
111
46.444444
0.744161
0.556496
0
0
0
0.046512
0.13436
0.101412
0
0
0
0
0
1
0
false
0
0.116279
0
0.116279
0.023256
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
d9d47eeaf0aa807edc7f45d6bfc5eed81eca028b
44,687
py
Python
src/tests/api/test_checkin.py
hansegucker/pretix
1d32d7a2d213834781385052d1d92b392bf1386a
[ "Apache-2.0" ]
null
null
null
src/tests/api/test_checkin.py
hansegucker/pretix
1d32d7a2d213834781385052d1d92b392bf1386a
[ "Apache-2.0" ]
27
2021-11-11T10:43:18.000Z
2022-03-05T11:07:31.000Z
src/tests/api/test_checkin.py
thegcat/pretix
451d3fce0575d85a0ea93fd64aa0631feaced967
[ "Apache-2.0" ]
1
2021-08-04T13:34:09.000Z
2021-08-04T13:34:09.000Z
# # This file is part of pretix (Community Edition). # # Copyright (C) 2014-2020 Raphael Michel and contributors # Copyright (C) 2020-2021 rami.io GmbH and contributors # # This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General # Public License as published by the Free Software Foundation in version 3 of the License. # # ADDITIONAL TERMS APPLY: Pursuant to Section 7 of the GNU Affero General Public License, additional terms are # applicable granting you additional permissions and placing additional restrictions on your usage of this software. # Please refer to the pretix LICENSE file to obtain the full terms applicable to this work. If you did not receive # this file, see <https://pretix.eu/about/en/license>. # # This program 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 Affero General Public License for more # details. # # You should have received a copy of the GNU Affero General Public License along with this program. If not, see # <https://www.gnu.org/licenses/>. # import datetime import time from decimal import Decimal from unittest import mock # deprecated: from django.utils.http import urlquote # use urlib instead from urllib.parse import quote as urlquote import pytest from django.core.files.base import ContentFile from django.utils.timezone import now from django_countries.fields import Country from django_scopes import scopes_disabled from i18nfield.strings import LazyI18nString from pytz import UTC from pretix.api.serializers.item import QuestionSerializer from pretix.base.models import ( Checkin, CheckinList, InvoiceAddress, Order, OrderPosition, ) @pytest.fixture def item(event): return event.items.create(name="Budget Ticket", default_price=23) @pytest.fixture def item_on_wrong_event(event2): return event2.items.create(name="Budget Ticket", default_price=23) @pytest.fixture def other_item(event): return event.items.create(name="Budget Ticket", default_price=23) @pytest.fixture def order(event, item, other_item, taxrule): testtime = datetime.datetime(2017, 12, 1, 10, 0, 0, tzinfo=UTC) with mock.patch('django.utils.timezone.now') as mock_now: mock_now.return_value = testtime o = Order.objects.create( code='FOO', event=event, email='dummy@dummy.test', status=Order.STATUS_PAID, secret="k24fiuwvu8kxz3y1", datetime=datetime.datetime(2017, 12, 1, 10, 0, 0, tzinfo=UTC), expires=datetime.datetime(2017, 12, 10, 10, 0, 0, tzinfo=UTC), total=46, locale='en' ) InvoiceAddress.objects.create(order=o, company="Sample company", country=Country('NZ')) OrderPosition.objects.create( order=o, positionid=1, item=item, variation=None, price=Decimal("23"), attendee_name_parts={'full_name': "Peter"}, secret="z3fsn8jyufm5kpk768q69gkbyr5f4h6w", pseudonymization_id="ABCDEFGHKL", ) OrderPosition.objects.create( order=o, positionid=2, item=other_item, variation=None, price=Decimal("23"), attendee_name_parts={'full_name': "Michael"}, secret="sf4HZG73fU6kwddgjg2QOusFbYZwVKpK", pseudonymization_id="BACDEFGHKL", ) return o TEST_ORDERPOSITION1_RES = { "id": 1, "require_attention": False, "order__status": "p", "order": "FOO", "positionid": 1, "item": 1, "variation": None, "price": "23.00", "attendee_name": "Peter", "attendee_name_parts": {'full_name': "Peter"}, "attendee_email": None, "voucher": None, "tax_rate": "0.00", "tax_value": "0.00", "tax_rule": None, "secret": "z3fsn8jyufm5kpk768q69gkbyr5f4h6w", "addon_to": None, "checkins": [], "downloads": [], "answers": [], "seat": None, "company": None, "street": None, "zipcode": None, "city": None, "country": None, "state": None, "subevent": None, "pseudonymization_id": "ABCDEFGHKL", } TEST_ORDERPOSITION2_RES = { "id": 2, "require_attention": False, "order__status": "p", "order": "FOO", "positionid": 2, "item": 1, "variation": None, "price": "23.00", "attendee_name": "Michael", "attendee_name_parts": {'full_name': "Michael"}, "attendee_email": None, "voucher": None, "tax_rate": "0.00", "tax_value": "0.00", "tax_rule": None, "secret": "sf4HZG73fU6kwddgjg2QOusFbYZwVKpK", "addon_to": None, "checkins": [], "downloads": [], "answers": [], "seat": None, "company": None, "street": None, "zipcode": None, "city": None, "country": None, "state": None, "subevent": None, "pseudonymization_id": "BACDEFGHKL", } TEST_LIST_RES = { "name": "Default", "all_products": False, "limit_products": [], "position_count": 0, "checkin_count": 0, "include_pending": False, "allow_multiple_entries": False, "allow_entry_after_exit": True, "subevent": None, "exit_all_at": None, "rules": {} } @pytest.fixture def clist(event, item): c = event.checkin_lists.create(name="Default", all_products=False) c.limit_products.add(item) return c @pytest.fixture def clist_all(event, item): c = event.checkin_lists.create(name="Default", all_products=True) return c @pytest.mark.django_db def test_list_list(token_client, organizer, event, clist, item, subevent): res = dict(TEST_LIST_RES) res["id"] = clist.pk res["limit_products"] = [item.pk] res["auto_checkin_sales_channels"] = [] resp = token_client.get('/api/v1/organizers/{}/events/{}/checkinlists/'.format(organizer.slug, event.slug)) assert resp.status_code == 200 assert [res] == resp.data['results'] clist.subevent = subevent clist.save() res["subevent"] = subevent.pk resp = token_client.get( '/api/v1/organizers/{}/events/{}/checkinlists/?subevent={}'.format(organizer.slug, event.slug, subevent.pk)) assert [res] == resp.data['results'] resp = token_client.get( '/api/v1/organizers/{}/events/{}/checkinlists/?subevent_match={}'.format(organizer.slug, event.slug, subevent.pk)) assert [res] == resp.data['results'] with scopes_disabled(): se2 = event.subevents.create(name="Foobar", date_from=datetime.datetime(2017, 12, 27, 10, 0, 0, tzinfo=UTC)) resp = token_client.get( '/api/v1/organizers/{}/events/{}/checkinlists/?subevent={}'.format(organizer.slug, event.slug, se2.pk)) assert [] == resp.data['results'] resp = token_client.get( '/api/v1/organizers/{}/events/{}/checkinlists/?subevent_match={}'.format(organizer.slug, event.slug, se2.pk)) assert [] == resp.data['results'] clist.subevent = None clist.save() res["subevent"] = None resp = token_client.get( '/api/v1/organizers/{}/events/{}/checkinlists/?subevent_match={}'.format(organizer.slug, event.slug, se2.pk)) assert [res] == resp.data['results'] @pytest.mark.django_db def test_list_detail(token_client, organizer, event, clist, item): res = dict(TEST_LIST_RES) res["id"] = clist.pk res["limit_products"] = [item.pk] res["auto_checkin_sales_channels"] = [] resp = token_client.get('/api/v1/organizers/{}/events/{}/checkinlists/{}/'.format(organizer.slug, event.slug, clist.pk)) assert resp.status_code == 200 assert res == resp.data @pytest.mark.django_db def test_list_create(token_client, organizer, event, item, item_on_wrong_event): resp = token_client.post( '/api/v1/organizers/{}/events/{}/checkinlists/'.format(organizer.slug, event.slug), { "name": "VIP", "limit_products": [item.pk], "all_products": False, "subevent": None, "rules": {"==": [0, 1]} }, format='json' ) assert resp.status_code == 201 with scopes_disabled(): cl = CheckinList.objects.get(pk=resp.data['id']) assert cl.name == "VIP" assert cl.limit_products.count() == 1 assert not cl.all_products assert cl.rules == {"==": [0, 1]} resp = token_client.post( '/api/v1/organizers/{}/events/{}/checkinlists/'.format(organizer.slug, event.slug), { "name": "VIP", "limit_products": [item.pk], "all_products": False, "subevent": None, "auto_checkin_sales_channels": [ "web" ] }, format='json' ) assert resp.status_code == 201 with scopes_disabled(): cl = CheckinList.objects.get(pk=resp.data['id']) assert cl.name == "VIP" assert cl.limit_products.count() == 1 assert not cl.all_products assert "web" in cl.auto_checkin_sales_channels resp = token_client.post( '/api/v1/organizers/{}/events/{}/checkinlists/'.format(organizer.slug, event.slug), { "name": "VIP", "limit_products": [item_on_wrong_event.pk], "all_products": True, "subevent": None }, format='json' ) assert resp.status_code == 400 assert resp.content.decode() == '{"non_field_errors":["One or more items do not belong to this event."]}' @pytest.mark.django_db def test_list_create_with_subevent(token_client, organizer, event, event3, item, subevent, subevent2): resp = token_client.post( '/api/v1/organizers/{}/events/{}/checkinlists/'.format(organizer.slug, event.slug), { "name": "VIP", "limit_products": [item.pk], "all_products": True, "subevent": subevent.pk }, format='json' ) assert resp.status_code == 201 resp = token_client.post( '/api/v1/organizers/{}/events/{}/checkinlists/'.format(organizer.slug, event.slug), { "name": "VIP", "limit_products": [item.pk], "all_products": True, "subevent": subevent.pk, "auto_checkin_sales_channels": [ "web" ] }, format='json' ) assert resp.status_code == 201 with scopes_disabled(): cl = CheckinList.objects.get(pk=resp.data['id']) assert "web" in cl.auto_checkin_sales_channels resp = token_client.post( '/api/v1/organizers/{}/events/{}/checkinlists/'.format(organizer.slug, event.slug), { "name": "VIP", "limit_products": [item.pk], "all_products": True, "subevent": None }, format='json' ) assert resp.status_code == 201 resp = token_client.post( '/api/v1/organizers/{}/events/{}/checkinlists/'.format(organizer.slug, event.slug), { "name": "VIP", "limit_products": [], "all_products": True, "subevent": subevent2.pk }, format='json' ) assert resp.status_code == 400 assert resp.content.decode() == '{"non_field_errors":["The subevent does not belong to this event."]}' resp = token_client.post( '/api/v1/organizers/{}/events/{}/checkinlists/'.format(organizer.slug, event3.slug), { "name": "VIP", "limit_products": [], "all_products": True, "subevent": subevent2.pk }, format='json' ) assert resp.status_code == 400 assert resp.content.decode() == '{"non_field_errors":["The subevent does not belong to this event."]}' @pytest.mark.django_db def test_list_update(token_client, organizer, event, clist): resp = token_client.patch( '/api/v1/organizers/{}/events/{}/checkinlists/{}/'.format(organizer.slug, event.slug, clist.pk), { "name": "VIP", }, format='json' ) assert resp.status_code == 200 with scopes_disabled(): cl = CheckinList.objects.get(pk=resp.data['id']) assert cl.name == "VIP" resp = token_client.patch( '/api/v1/organizers/{}/events/{}/checkinlists/{}/'.format(organizer.slug, event.slug, clist.pk), { "auto_checkin_sales_channels": [ "web" ], }, format='json' ) assert resp.status_code == 200 with scopes_disabled(): cl = CheckinList.objects.get(pk=resp.data['id']) assert "web" in cl.auto_checkin_sales_channels @pytest.mark.django_db def test_list_all_items_positions(token_client, organizer, event, clist, clist_all, item, other_item, order): with scopes_disabled(): p1 = dict(TEST_ORDERPOSITION1_RES) p1["id"] = order.positions.first().pk p1["item"] = item.pk p2 = dict(TEST_ORDERPOSITION2_RES) p2["id"] = order.positions.last().pk p2["item"] = other_item.pk # All items resp = token_client.get('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/?ordering=positionid'.format( organizer.slug, event.slug, clist_all.pk )) assert resp.status_code == 200 assert [p1, p2] == resp.data['results'] # Check-ins on other list ignored with scopes_disabled(): order.positions.first().checkins.create(list=clist) resp = token_client.get('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/?ordering=positionid'.format( organizer.slug, event.slug, clist_all.pk )) assert resp.status_code == 200 assert [p1, p2] == resp.data['results'] resp = token_client.get('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/?has_checkin=1'.format( organizer.slug, event.slug, clist_all.pk )) assert resp.status_code == 200 assert [] == resp.data['results'] # Only checked in with scopes_disabled(): c = order.positions.first().checkins.create(list=clist_all) p1['checkins'] = [ { 'id': c.pk, 'list': clist_all.pk, 'datetime': c.datetime.isoformat().replace('+00:00', 'Z'), 'auto_checked_in': False, 'device': None, 'gate': None, 'type': 'entry', } ] resp = token_client.get('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/?has_checkin=1'.format( organizer.slug, event.slug, clist_all.pk )) assert resp.status_code == 200 assert [p1] == resp.data['results'] # Only not checked in resp = token_client.get('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/?has_checkin=0'.format( organizer.slug, event.slug, clist_all.pk )) assert resp.status_code == 200 assert [p2] == resp.data['results'] # Order by checkin resp = token_client.get( '/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/?ordering=-last_checked_in'.format( organizer.slug, event.slug, clist_all.pk )) assert resp.status_code == 200 assert [p1, p2] == resp.data['results'] resp = token_client.get( '/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/?ordering=last_checked_in'.format( organizer.slug, event.slug, clist_all.pk )) assert resp.status_code == 200 assert [p2, p1] == resp.data['results'] # Order by checkin date time.sleep(1) with scopes_disabled(): c = order.positions.last().checkins.create(list=clist_all) p2['checkins'] = [ { 'id': c.pk, 'list': clist_all.pk, 'datetime': c.datetime.isoformat().replace('+00:00', 'Z'), 'auto_checked_in': False, 'device': None, 'gate': None, 'type': 'entry', } ] resp = token_client.get( '/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/?ordering=-last_checked_in'.format( organizer.slug, event.slug, clist_all.pk )) assert resp.status_code == 200 assert [p2, p1] == resp.data['results'] # Order by attendee_name resp = token_client.get('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/?ordering=-attendee_name'.format( organizer.slug, event.slug, clist_all.pk )) assert resp.status_code == 200 assert [p1, p2] == resp.data['results'] resp = token_client.get('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/?ordering=attendee_name'.format( organizer.slug, event.slug, clist_all.pk )) assert resp.status_code == 200 assert [p2, p1] == resp.data['results'] # Paid only order.status = Order.STATUS_PENDING order.save() resp = token_client.get('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/'.format( organizer.slug, event.slug, clist_all.pk )) assert resp.status_code == 200 assert [] == resp.data['results'] resp = token_client.get('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/?ignore_status=true'.format( organizer.slug, event.slug, clist_all.pk )) assert resp.status_code == 200 p1['order__status'] = 'n' p2['order__status'] = 'n' assert [p2, p1] == resp.data['results'] @pytest.mark.django_db def test_list_all_items_positions_by_subevent(token_client, organizer, event, clist, clist_all, item, other_item, order, subevent): with scopes_disabled(): se2 = event.subevents.create(name="Foobar", date_from=datetime.datetime(2017, 12, 27, 10, 0, 0, tzinfo=UTC)) pfirst = order.positions.first() pfirst.subevent = se2 pfirst.save() p1 = dict(TEST_ORDERPOSITION1_RES) p1["id"] = pfirst.pk p1["subevent"] = se2.pk p1["item"] = item.pk plast = order.positions.last() plast.subevent = subevent plast.save() p2 = dict(TEST_ORDERPOSITION2_RES) p2["id"] = plast.pk p2["item"] = other_item.pk p2["subevent"] = subevent.pk resp = token_client.get('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/?ordering=positionid'.format( organizer.slug, event.slug, clist_all.pk )) assert resp.status_code == 200 assert [p1, p2] == resp.data['results'] clist_all.subevent = subevent clist_all.save() resp = token_client.get('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/?ordering=positionid'.format( organizer.slug, event.slug, clist_all.pk )) assert resp.status_code == 200 assert [p2] == resp.data['results'] @pytest.mark.django_db def test_list_limited_items_positions(token_client, organizer, event, clist, item, order): p1 = dict(TEST_ORDERPOSITION1_RES) with scopes_disabled(): p1["id"] = order.positions.first().pk p1["item"] = item.pk # All items resp = token_client.get('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/?ordering=positionid'.format( organizer.slug, event.slug, clist.pk )) assert resp.status_code == 200 assert [p1] == resp.data['results'] @pytest.mark.django_db def test_list_limited_items_position_detail(token_client, organizer, event, clist, item, order): p1 = dict(TEST_ORDERPOSITION1_RES) with scopes_disabled(): p1["id"] = order.positions.first().pk p1["item"] = item.pk # All items resp = token_client.get('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/'.format( organizer.slug, event.slug, clist.pk, p1["id"] )) assert resp.status_code == 200 assert p1 == resp.data @pytest.mark.django_db def test_status(token_client, organizer, event, clist_all, item, other_item, order): with scopes_disabled(): op = order.positions.first() var1 = item.variations.create(value="XS") var2 = item.variations.create(value="S") op.variation = var1 op.save() Checkin.objects.create(position=op, list=clist_all) resp = token_client.get('/api/v1/organizers/{}/events/{}/checkinlists/{}/status/'.format( organizer.slug, event.slug, clist_all.pk, )) assert resp.status_code == 200 assert resp.data['checkin_count'] == 1 assert resp.data['position_count'] == 2 assert resp.data['inside_count'] == 1 assert resp.data['items'] == [ { 'name': str(item.name), 'id': item.pk, 'checkin_count': 1, 'admission': False, 'position_count': 1, 'variations': [ { 'id': var1.pk, 'value': 'XS', 'checkin_count': 1, 'position_count': 1, }, { 'id': var2.pk, 'value': 'S', 'checkin_count': 0, 'position_count': 0, }, ] }, { 'name': other_item.name, 'id': other_item.pk, 'checkin_count': 0, 'admission': False, 'position_count': 1, 'variations': [] } ] @pytest.mark.django_db def test_custom_datetime(token_client, organizer, clist, event, order): dt = now() - datetime.timedelta(days=1) dt = dt.replace(microsecond=0) with scopes_disabled(): p = order.positions.first().pk resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p ), { 'datetime': dt.isoformat() }, format='json') assert resp.status_code == 201 assert resp.data['status'] == 'ok' with scopes_disabled(): assert Checkin.objects.last().datetime == dt @pytest.mark.django_db def test_name_fallback(token_client, organizer, clist, event, order): order.invoice_address.name_parts = {'_legacy': 'Paul'} order.invoice_address.save() with scopes_disabled(): op = order.positions.first() op.attendee_name_cached = None op.attendee_name_parts = {} op.save() resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, op.pk ), {}, format='json') assert resp.status_code == 201 assert resp.data['status'] == 'ok' assert resp.data['position']['attendee_name'] == 'Paul' assert resp.data['position']['attendee_name_parts'] == {'_legacy': 'Paul'} @pytest.mark.django_db def test_by_secret(token_client, organizer, clist, event, order): with scopes_disabled(): p = order.positions.first() resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.secret ), {}, format='json') assert resp.status_code == 201 assert resp.data['status'] == 'ok' @pytest.mark.django_db def test_by_secret_special_chars(token_client, organizer, clist, event, order): with scopes_disabled(): p = order.positions.first() p.secret = "abc+-/==" p.save() resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, urlquote(p.secret, safe='') ), {}, format='json') assert resp.status_code == 201 assert resp.data['status'] == 'ok' @pytest.mark.django_db def test_by_secret_special_chars_space_fallback(token_client, organizer, clist, event, order): with scopes_disabled(): p = order.positions.first() p.secret = "foo bar" p.save() resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, "foo+bar" ), {}, format='json') assert resp.status_code == 201 assert resp.data['status'] == 'ok' @pytest.mark.django_db def test_only_once(token_client, organizer, clist, event, order): with scopes_disabled(): p = order.positions.first() resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {}, format='json') assert resp.status_code == 201 assert resp.data['status'] == 'ok' resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {}, format='json') assert resp.status_code == 400 assert resp.data['status'] == 'error' assert resp.data['reason'] == 'already_redeemed' @pytest.mark.django_db def test_reupload_same_nonce(token_client, organizer, clist, event, order): with scopes_disabled(): p = order.positions.first() resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {'nonce': 'foobar'}, format='json') assert resp.status_code == 201 assert resp.data['status'] == 'ok' resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {'nonce': 'foobar'}, format='json') assert resp.status_code == 201 assert resp.data['status'] == 'ok' @pytest.mark.django_db def test_allow_multiple(token_client, organizer, clist, event, order): clist.allow_multiple_entries = True clist.save() with scopes_disabled(): p = order.positions.first() resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {}, format='json') assert resp.status_code == 201 assert resp.data['status'] == 'ok' resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {}, format='json') assert resp.status_code == 201 assert resp.data['status'] == 'ok' with scopes_disabled(): assert p.checkins.count() == 2 @pytest.mark.django_db def test_allow_multiple_reupload_same_nonce(token_client, organizer, clist, event, order): clist.allow_multiple_entries = True clist.save() with scopes_disabled(): p = order.positions.first() resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {'nonce': 'foobar'}, format='json') assert resp.status_code == 201 assert resp.data['status'] == 'ok' resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {'nonce': 'foobar'}, format='json') assert resp.status_code == 201 assert resp.data['status'] == 'ok' with scopes_disabled(): assert p.checkins.count() == 1 @pytest.mark.django_db def test_multiple_different_list(token_client, organizer, clist, clist_all, event, order): with scopes_disabled(): p = order.positions.first() resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {'nonce': 'foobar'}, format='json') assert resp.status_code == 201 assert resp.data['status'] == 'ok' resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist_all.pk, p.pk ), {'nonce': 'baz'}, format='json') assert resp.status_code == 201 assert resp.data['status'] == 'ok' @pytest.mark.django_db def test_forced_multiple(token_client, organizer, clist, event, order): with scopes_disabled(): p = order.positions.first() resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {}, format='json') assert resp.status_code == 201 assert resp.data['status'] == 'ok' resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {'force': True}, format='json') assert resp.status_code == 201 assert resp.data['status'] == 'ok' @pytest.mark.django_db def test_require_product(token_client, organizer, clist, event, order): with scopes_disabled(): clist.limit_products.clear() p = order.positions.first() resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {}, format='json') assert resp.status_code == 400 assert resp.data['status'] == 'error' assert resp.data['reason'] == 'product' @pytest.mark.django_db def test_require_paid(token_client, organizer, clist, event, order): with scopes_disabled(): p = order.positions.first() order.status = Order.STATUS_CANCELED order.save() resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {}, format='json') assert resp.status_code == 400 assert resp.data['status'] == 'error' assert resp.data['reason'] == 'unpaid' resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {'canceled_supported': True}, format='json') assert resp.status_code == 400 assert resp.data['status'] == 'error' assert resp.data['reason'] == 'canceled' order.status = Order.STATUS_PENDING order.save() resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {}, format='json') assert resp.status_code == 400 assert resp.data['status'] == 'error' assert resp.data['reason'] == 'unpaid' resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {'ignore_unpaid': True}, format='json') assert resp.status_code == 400 assert resp.data['status'] == 'error' assert resp.data['reason'] == 'unpaid' clist.include_pending = True clist.save() resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {}, format='json') assert resp.status_code == 400 assert resp.data['status'] == 'error' assert resp.data['reason'] == 'unpaid' resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {'ignore_unpaid': True}, format='json') assert resp.status_code == 201 assert resp.data['status'] == 'ok' @pytest.fixture def question(event, item): q = event.questions.create(question=LazyI18nString('Size'), type='C', required=True, ask_during_checkin=True) a1 = q.options.create(answer=LazyI18nString("M")) a2 = q.options.create(answer=LazyI18nString("L")) q.items.add(item) return q, a1, a2 @pytest.mark.django_db def test_question_number(token_client, organizer, clist, event, order, question): with scopes_disabled(): p = order.positions.first() question[0].options.all().delete() question[0].type = 'N' question[0].save() resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {}, format='json') assert resp.status_code == 400 assert resp.data['status'] == 'incomplete' with scopes_disabled(): assert resp.data['questions'] == [QuestionSerializer(question[0]).data] resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {'answers': {question[0].pk: "3.24"}}, format='json') assert resp.status_code == 201 assert resp.data['status'] == 'ok' with scopes_disabled(): assert order.positions.first().answers.get(question=question[0]).answer == '3.24' @pytest.mark.django_db def test_question_choice(token_client, organizer, clist, event, order, question): with scopes_disabled(): p = order.positions.first() resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {}, format='json') assert resp.status_code == 400 assert resp.data['status'] == 'incomplete' with scopes_disabled(): assert resp.data['questions'] == [QuestionSerializer(question[0]).data] resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {'answers': {question[0].pk: str(question[1].pk)}}, format='json') assert resp.status_code == 201 assert resp.data['status'] == 'ok' with scopes_disabled(): assert order.positions.first().answers.get(question=question[0]).answer == 'M' assert list(order.positions.first().answers.get(question=question[0]).options.all()) == [question[1]] @pytest.mark.django_db def test_question_choice_identifier(token_client, organizer, clist, event, order, question): with scopes_disabled(): p = order.positions.first() resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {}, format='json') assert resp.status_code == 400 assert resp.data['status'] == 'incomplete' with scopes_disabled(): assert resp.data['questions'] == [QuestionSerializer(question[0]).data] resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {'answers': {question[0].pk: str(question[1].identifier)}}, format='json') assert resp.status_code == 201 assert resp.data['status'] == 'ok' with scopes_disabled(): assert order.positions.first().answers.get(question=question[0]).answer == 'M' assert list(order.positions.first().answers.get(question=question[0]).options.all()) == [question[1]] @pytest.mark.django_db def test_question_invalid(token_client, organizer, clist, event, order, question): with scopes_disabled(): p = order.positions.first() resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {'answers': {question[0].pk: "A"}}, format='json') assert resp.status_code == 400 assert resp.data['status'] == 'incomplete' with scopes_disabled(): assert resp.data['questions'] == [QuestionSerializer(question[0]).data] @pytest.mark.django_db def test_question_required(token_client, organizer, clist, event, order, question): with scopes_disabled(): p = order.positions.first() question[0].required = True question[0].save() resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {}, format='json') assert resp.status_code == 400 assert resp.data['status'] == 'incomplete' with scopes_disabled(): assert resp.data['questions'] == [QuestionSerializer(question[0]).data] resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {'answers': {question[0].pk: ""}}, format='json') assert resp.status_code == 400 assert resp.data['status'] == 'incomplete' with scopes_disabled(): assert resp.data['questions'] == [QuestionSerializer(question[0]).data] @pytest.mark.django_db def test_question_optional(token_client, organizer, clist, event, order, question): with scopes_disabled(): p = order.positions.first() question[0].required = False question[0].save() resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {}, format='json') assert resp.status_code == 400 assert resp.data['status'] == 'incomplete' with scopes_disabled(): assert resp.data['questions'] == [QuestionSerializer(question[0]).data] resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {'answers': {question[0].pk: ""}}, format='json') assert resp.status_code == 201 assert resp.data['status'] == 'ok' @pytest.mark.django_db def test_question_multiple_choice(token_client, organizer, clist, event, order, question): with scopes_disabled(): p = order.positions.first() question[0].type = 'M' question[0].save() resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {}, format='json') assert resp.status_code == 400 assert resp.data['status'] == 'incomplete' with scopes_disabled(): assert resp.data['questions'] == [QuestionSerializer(question[0]).data] resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {'answers': {question[0].pk: "{},{}".format(question[1].pk, question[2].pk)}}, format='json') assert resp.status_code == 201 assert resp.data['status'] == 'ok' with scopes_disabled(): assert order.positions.first().answers.get(question=question[0]).answer == 'M, L' assert set(order.positions.first().answers.get(question=question[0]).options.all()) == {question[1], question[2]} @pytest.mark.django_db def test_question_upload(token_client, organizer, clist, event, order, question): r = token_client.post( '/api/v1/upload', data={ 'media_type': 'image/png', 'file': ContentFile('file.png', 'invalid png content') }, format='upload', HTTP_CONTENT_DISPOSITION='attachment; filename="file.png"', ) assert r.status_code == 201 file_id_png = r.data['id'] with scopes_disabled(): p = order.positions.first() question[0].type = 'F' question[0].save() resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {}, format='json') assert resp.status_code == 400 assert resp.data['status'] == 'incomplete' with scopes_disabled(): assert resp.data['questions'] == [QuestionSerializer(question[0]).data] resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {'answers': {question[0].pk: "invalid"}}, format='json') assert resp.status_code == 400 assert resp.data['status'] == 'incomplete' resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, p.pk ), {'answers': {question[0].pk: file_id_png}}, format='json') assert resp.status_code == 201 assert resp.data['status'] == 'ok' with scopes_disabled(): assert order.positions.first().answers.get(question=question[0]).answer.startswith('file://') assert order.positions.first().answers.get(question=question[0]).file @pytest.mark.django_db def test_store_failed(token_client, organizer, clist, event, order): with scopes_disabled(): p = order.positions.first() resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/failed_checkins/'.format( organizer.slug, event.slug, clist.pk, ), { 'raw_barcode': '123456', 'error_reason': 'invalid' }, format='json') assert resp.status_code == 201 with scopes_disabled(): assert Checkin.all.filter(successful=False).exists() resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/failed_checkins/'.format( organizer.slug, event.slug, clist.pk, ), { 'raw_barcode': '123456', 'position': p.pk, 'error_reason': 'unpaid' }, format='json') assert resp.status_code == 201 with scopes_disabled(): assert p.all_checkins.filter(successful=False).count() == 1 resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/failed_checkins/'.format( organizer.slug, event.slug, clist.pk, ), { 'position': p.pk, 'error_reason': 'unpaid' }, format='json') assert resp.status_code == 400 resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/failed_checkins/'.format( organizer.slug, event.slug, clist.pk, ), { 'raw_barcode': '123456', 'error_reason': 'unknown' }, format='json') assert resp.status_code == 400 @pytest.mark.django_db def test_redeem_unknown(token_client, organizer, clist, event, order): resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, 'unknown_secret' ), { 'force': True }, format='json') assert resp.status_code == 404 assert resp.data["status"] == "error" assert resp.data["reason"] == "invalid" with scopes_disabled(): assert not Checkin.objects.last() @pytest.mark.django_db def test_redeem_unknown_revoked(token_client, organizer, clist, event, order): with scopes_disabled(): p = order.positions.first() event.revoked_secrets.create(position=p, secret='revoked_secret') resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, 'revoked_secret' ), { }, format='json') assert resp.status_code == 400 assert resp.data["status"] == "error" assert resp.data["reason"] == "revoked" with scopes_disabled(): assert not Checkin.objects.last() @pytest.mark.django_db def test_redeem_unknown_revoked_force(token_client, organizer, clist, event, order): with scopes_disabled(): p = order.positions.first() event.revoked_secrets.create(position=p, secret='revoked_secret') resp = token_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, 'revoked_secret' ), { 'force': True }, format='json') assert resp.status_code == 201 assert resp.data["status"] == "ok" with scopes_disabled(): assert Checkin.objects.last().forced @pytest.mark.django_db def test_redeem_unknown_legacy_device_bug(device, device_client, organizer, clist, event, order): device.software_brand = "pretixSCAN" device.software_version = "1.11.1" device.save() resp = device_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, 'unknown_secret' ), { 'force': True }, format='json') print(resp.data) assert resp.status_code == 400 assert resp.data["status"] == "error" assert resp.data["reason"] == "already_redeemed" with scopes_disabled(): assert not Checkin.objects.last() device.software_brand = "pretixSCAN" device.software_version = "1.11.2" device.save() resp = device_client.post('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/{}/redeem/'.format( organizer.slug, event.slug, clist.pk, 'unknown_secret' ), { 'force': True }, format='json') assert resp.status_code == 404 assert resp.data["status"] == "error" assert resp.data["reason"] == "invalid" with scopes_disabled(): assert not Checkin.objects.last()
37.270225
131
0.631929
5,360
44,687
5.141791
0.077052
0.056604
0.045174
0.063244
0.847605
0.833708
0.809978
0.78135
0.76992
0.747134
0
0.019016
0.203325
44,687
1,198
132
37.301336
0.755119
0.03077
0
0.699609
0
0
0.219881
0.13508
0
0
0
0
0.201566
1
0.042074
false
0
0.013699
0.002935
0.062622
0.000978
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
8a0d94d0139553ebf6bd1d478b7e6e242e1deadf
2,744
py
Python
oscar/lib/python2.7/site-packages/phonenumbers/data/region_US.py
AMuratTuran/mkn
557086426773ced10d82c969304bd349414a601e
[ "BSD-3-Clause" ]
4
2018-10-19T04:36:20.000Z
2020-02-13T16:14:09.000Z
oscar/lib/python2.7/site-packages/phonenumbers/data/region_US.py
AMuratTuran/mkn
557086426773ced10d82c969304bd349414a601e
[ "BSD-3-Clause" ]
null
null
null
oscar/lib/python2.7/site-packages/phonenumbers/data/region_US.py
AMuratTuran/mkn
557086426773ced10d82c969304bd349414a601e
[ "BSD-3-Clause" ]
null
null
null
"""Auto-generated file, do not edit by hand. US metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_US = PhoneMetadata(id='US', country_code=1, international_prefix='011', general_desc=PhoneNumberDesc(national_number_pattern='[2-9]\\d{9}', possible_length=(10,), possible_length_local_only=(7,)), fixed_line=PhoneNumberDesc(national_number_pattern='(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[0135]|3[0-24679]|4[67]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[0235]|58|6[39]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[013-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[16]|5[017]|6[0-279]|78|8[012])|7(?:0[1-46-8]|1[02-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[02-59]|8[156])|8(?:0[1-68]|1[02-8]|28|3[0-258]|4[3578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[014678]|4[0179]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}', example_number='2015550123', possible_length=(10,), possible_length_local_only=(7,)), mobile=PhoneNumberDesc(national_number_pattern='(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[0135]|3[0-24679]|4[67]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[0235]|58|6[39]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[013-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[16]|5[017]|6[0-279]|78|8[012])|7(?:0[1-46-8]|1[02-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[02-59]|8[156])|8(?:0[1-68]|1[02-8]|28|3[0-258]|4[3578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[014678]|4[0179]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}', example_number='2015550123', possible_length=(10,), possible_length_local_only=(7,)), toll_free=PhoneNumberDesc(national_number_pattern='8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', example_number='8002345678', possible_length=(10,)), premium_rate=PhoneNumberDesc(national_number_pattern='900[2-9]\\d{6}', example_number='9002345678', possible_length=(10,)), personal_number=PhoneNumberDesc(national_number_pattern='5(?:(?:00|22|33|44|66|77|88)[2-9]|21[23])\\d{6}', example_number='5002345678', possible_length=(10,)), national_prefix='1', national_prefix_for_parsing='1', number_format=[NumberFormat(pattern='(\\d{3})(\\d{4})', format='\\1-\\2', national_prefix_optional_when_formatting=True), NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{4})', format='(\\1) \\2-\\3', national_prefix_optional_when_formatting=True)], intl_number_format=[NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{4})', format='\\1-\\2-\\3')], main_country_for_code=True, mobile_number_portable_region=True)
152.444444
735
0.646137
576
2,744
2.970486
0.232639
0.014027
0.018703
0.023378
0.675628
0.645821
0.579193
0.547049
0.52367
0.52367
0
0.290053
0.040087
2,744
17
736
161.411765
0.359529
0.019315
0
0
1
0.266667
0.537058
0.489013
0
0
0
0
0
1
0
false
0
0.066667
0
0.066667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
1
1
0
0
0
1
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
8a156e54845aa0f45233db3d98e24bc4f47a6d85
187
py
Python
apps/employees/admin.py
wis-software/office-manager
0342d2cf9b3e4779f3e3d2a4faba6768e95047b1
[ "MIT" ]
7
2017-09-28T11:20:43.000Z
2020-01-18T23:23:52.000Z
apps/employees/admin.py
wis-software/office-manager
0342d2cf9b3e4779f3e3d2a4faba6768e95047b1
[ "MIT" ]
1
2019-03-12T18:16:12.000Z
2019-03-12T20:17:40.000Z
apps/employees/admin.py
wis-software/office-manager
0342d2cf9b3e4779f3e3d2a4faba6768e95047b1
[ "MIT" ]
7
2017-09-27T11:12:25.000Z
2019-04-04T13:24:01.000Z
from django.contrib import admin from apps.employees import models admin.site.register(models.Specialization) admin.site.register(models.Position) admin.site.register(models.Employee)
20.777778
42
0.834225
25
187
6.24
0.52
0.173077
0.326923
0.442308
0
0
0
0
0
0
0
0
0.074866
187
8
43
23.375
0.901734
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.4
0
0.4
0
1
0
0
null
0
1
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
1
0
1
0
0
0
0
6
8a16293f7869601cb9a0001961342236a8e78c7a
41
py
Python
handlers/gender_person_in_photo/__init__.py
AleksZavg/funny-telegram-bot
ba670567e39a2e49e20651f06f2611734f73b741
[ "MIT" ]
2
2021-09-29T15:14:33.000Z
2022-02-07T18:10:59.000Z
handlers/gender_person_in_photo/__init__.py
alekszavg/funny-telegram-bot
ba670567e39a2e49e20651f06f2611734f73b741
[ "MIT" ]
null
null
null
handlers/gender_person_in_photo/__init__.py
alekszavg/funny-telegram-bot
ba670567e39a2e49e20651f06f2611734f73b741
[ "MIT" ]
null
null
null
from . import gender_person_in_photo_func
41
41
0.902439
7
41
4.714286
1
0
0
0
0
0
0
0
0
0
0
0
0.073171
41
1
41
41
0.868421
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
8a1ddaef806b947add6a4cccc80a306a6df723b7
9,830
py
Python
hs_core/tests/api/views/test_share_resource.py
tommac7/hydroshare
87c4543a55f98103d2614bf4c47f7904c3f9c029
[ "BSD-3-Clause" ]
null
null
null
hs_core/tests/api/views/test_share_resource.py
tommac7/hydroshare
87c4543a55f98103d2614bf4c47f7904c3f9c029
[ "BSD-3-Clause" ]
null
null
null
hs_core/tests/api/views/test_share_resource.py
tommac7/hydroshare
87c4543a55f98103d2614bf4c47f7904c3f9c029
[ "BSD-3-Clause" ]
null
null
null
import json from django.test import TestCase, RequestFactory from django.contrib.auth.models import Group from django.core.urlresolvers import reverse from rest_framework import status from rest_framework.exceptions import PermissionDenied from hs_core import hydroshare from hs_core.views import share_resource_with_user, share_resource_with_group from hs_core.testing import MockIRODSTestCaseMixin class TestShareResource(MockIRODSTestCaseMixin, TestCase): def setUp(self): super(TestShareResource, self).setUp() self.group, _ = Group.objects.get_or_create(name='Hydroshare Author') self.owner = hydroshare.create_account( 'john@gmail.com', username='john', first_name='John', last_name='Clarson', superuser=False, password='jhmypassword', groups=[] ) self.user = hydroshare.create_account( 'lisa@gmail.com', username='lisaZ', first_name='Lisa', last_name='Ziggler', superuser=False, password='lzmypassword', groups=[] ) # crate a group for testing group access to resource self.test_group = self.owner.uaccess.create_group( title='Test Group', description="This is to test group access to resource", purpose="Testing group access to resource") self.gen_res = hydroshare.create_resource( resource_type='GenericResource', owner=self.owner, title='Generic Resource Share Resource Testing' ) self.factory = RequestFactory() def test_share_resource_with_user(self): # here we are testing the share_resource_with_user view function # test share resource with self.user with view permission # test self.user has no view permission self.assertNotIn(self.user, self.gen_res.raccess.view_users) self._check_share_with_user(privilege='view') # test self.user has now view permission self.assertIn(self.user, self.gen_res.raccess.view_users) # test share resource with self.user with edit permission # test self.user has no edit permission self.assertNotIn(self.user, self.gen_res.raccess.edit_users) self._check_share_with_user(privilege='edit') # test self.user has now edit permission self.assertIn(self.user, self.gen_res.raccess.edit_users) # test share resource with self.user with owner permission # test self.user has no owner permission self.assertNotIn(self.user, self.gen_res.raccess.owners) self._check_share_with_user(privilege='owner') # test self.user has now owner permission self.assertIn(self.user, self.gen_res.raccess.owners) # clean up hydroshare.delete_resource(self.gen_res.short_id) def test_share_resource_with_user_bad_requests(self): # here we are testing the share_resource_with_user view function with bad requests bad_privilege = 'bad' url_params = {'shortkey': self.gen_res.short_id, 'privilege': bad_privilege, 'user_id': self.user.id} url = reverse('share_resource_with_user', kwargs=url_params) request = self.factory.post(url, data={}) request.user = self.owner # make it a ajax request request.META['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' response = share_resource_with_user(request, shortkey=self.gen_res.short_id, privilege=bad_privilege, user_id=self.user.id) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) response_data = json.loads(response.content) self.assertEqual(response_data['status'], 'error') url_params = {'shortkey': self.gen_res.short_id, 'privilege': 'view', 'user_id': self.user.id} url = reverse('share_resource_with_user', kwargs=url_params) request = self.factory.post(url, data={}) # user does not have permission to grant himself access to resource request.user = self.user # make it a ajax request request.META['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' with self.assertRaises(PermissionDenied): share_resource_with_user(request, shortkey=self.gen_res.short_id, privilege='view', user_id=self.user.id) # clean up hydroshare.delete_resource(self.gen_res.short_id) def test_share_resource_with_group(self): # here we are testing the share_resource_with_group view function # test share resource with self.test_group with view permission # test self.test_group has no view permission self.assertNotIn(self.test_group, self.gen_res.raccess.view_groups) self._check_share_with_group(privilege='view') self.gen_res.raccess.refresh_from_db() # test self.test_group has now view permission self.assertIn(self.test_group, self.gen_res.raccess.view_groups) # test share resource with self.test_group with edit permission # test self.test_group has no edit permission self.assertNotIn(self.test_group, self.gen_res.raccess.edit_groups) self._check_share_with_group(privilege='edit') self.gen_res.raccess.refresh_from_db() # test self.test_group has now edit permission self.assertIn(self.test_group, self.gen_res.raccess.edit_groups) # clean up hydroshare.delete_resource(self.gen_res.short_id) def test_share_resource_with_group_bad_requests(self): # here we are testing the share_resource_with_group view function with bad requests bad_privilege = 'bad' url_params = {'shortkey': self.gen_res.short_id, 'privilege': bad_privilege, 'group_id': self.test_group.id} url = reverse('share_resource_with_group', kwargs=url_params) request = self.factory.post(url, data={}) request.user = self.owner # make it a ajax request request.META['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' response = share_resource_with_group(request, shortkey=self.gen_res.short_id, privilege=bad_privilege, group_id=self.test_group.id) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) response_data = json.loads(response.content) self.assertEqual(response_data['status'], 'error') # test group can't be given ownership access url_params = {'shortkey': self.gen_res.short_id, 'privilege': 'owner', 'group_id': self.test_group.id} url = reverse('share_resource_with_group', kwargs=url_params) request = self.factory.post(url, data={}) request.user = self.owner # make it a ajax request request.META['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' response = share_resource_with_group(request, shortkey=self.gen_res.short_id, privilege='owner', group_id=self.test_group.id) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) response_data = json.loads(response.content) self.assertEqual(response_data['status'], 'error') url_params = {'shortkey': self.gen_res.short_id, 'privilege': 'view', 'group_id': self.test_group.id} url = reverse('share_resource_with_group', kwargs=url_params) request = self.factory.post(url, data={}) # user does not have permission to grant test_group access to resource request.user = self.user # make it a ajax request request.META['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' with self.assertRaises(PermissionDenied): share_resource_with_group(request, shortkey=self.gen_res.short_id, privilege='view', group_id=self.test_group.id) # clean up hydroshare.delete_resource(self.gen_res.short_id) def _check_share_with_user(self, privilege): url_params = {'shortkey': self.gen_res.short_id, 'privilege': privilege, 'user_id': self.user.id} url = reverse('share_resource_with_user', kwargs=url_params) request = self.factory.post(url, data={}) request.user = self.owner # make it a ajax request request.META['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' response = share_resource_with_user(request, shortkey=self.gen_res.short_id, privilege=privilege, user_id=self.user.id) self.assertEqual(response.status_code, status.HTTP_200_OK) response_data = json.loads(response.content) self.assertEqual(response_data['status'], 'success') self.gen_res.raccess.refresh_from_db() def _check_share_with_group(self, privilege): url_params = {'shortkey': self.gen_res.short_id, 'privilege': privilege, 'group_id': self.test_group.id} url = reverse('share_resource_with_group', kwargs=url_params) request = self.factory.post(url, data={}) request.user = self.owner # make it a ajax request request.META['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' response = share_resource_with_group(request, shortkey=self.gen_res.short_id, privilege=privilege, group_id=self.test_group.id) self.assertEqual(response.status_code, status.HTTP_200_OK) response_data = json.loads(response.content) self.assertEqual(response_data['status'], 'success') self.gen_res.raccess.refresh_from_db()
46.587678
98
0.663276
1,215
9,830
5.120165
0.11358
0.037132
0.053046
0.043401
0.826234
0.811445
0.779617
0.733162
0.704549
0.649896
0
0.002025
0.246389
9,830
210
99
46.809524
0.837743
0.144354
0
0.531034
0
0
0.111867
0.038085
0
0
0
0
0.151724
1
0.048276
false
0.013793
0.062069
0
0.117241
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
8a5a8d9f64793da95462f03d3b0dfa39805ec1d2
301
py
Python
Python/main.py
wurui1994/test
027cef75f98dbb252b322113dacd4a9a6997d84f
[ "MIT" ]
27
2017-12-19T09:15:36.000Z
2021-07-30T13:02:00.000Z
Python/main.py
wurui1994/test
027cef75f98dbb252b322113dacd4a9a6997d84f
[ "MIT" ]
null
null
null
Python/main.py
wurui1994/test
027cef75f98dbb252b322113dacd4a9a6997d84f
[ "MIT" ]
29
2018-04-10T13:25:54.000Z
2021-12-24T01:51:03.000Z
# [callable(getattr(__builtins__, attr)) for attr in dir(__builtins__)] # [(attr,type(getattr(__builtins__, attr))) for attr in dir(__builtins__)] # print('hello'*100) class Test: def __repr__(self): return "test" def __str__(self): return "test2" t = Test() print(t)
25.083333
74
0.641196
38
301
4.447368
0.526316
0.213018
0.224852
0.260355
0.461538
0.461538
0.461538
0.461538
0
0
0
0.016807
0.209302
301
12
75
25.083333
0.693277
0.534884
0
0
0
0
0.065693
0
0
0
0
0
0
1
0.285714
false
0
0
0.285714
0.714286
0.142857
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
6
8aa76f293d5693ea81a36cc3f0028a4aa189ed96
19,241
py
Python
tests/compiler/push_down/test_push_down_div.py
CCD-HRI/congregation
a552856b03a64a4295792184107c4e529ca3f4ae
[ "MIT" ]
3
2020-10-05T16:30:15.000Z
2021-01-22T13:38:02.000Z
tests/compiler/push_down/test_push_down_div.py
CCD-HRI/congregation
a552856b03a64a4295792184107c4e529ca3f4ae
[ "MIT" ]
null
null
null
tests/compiler/push_down/test_push_down_div.py
CCD-HRI/congregation
a552856b03a64a4295792184107c4e529ca3f4ae
[ "MIT" ]
1
2021-02-19T12:40:57.000Z
2021-02-19T12:40:57.000Z
from congregation.lang import * from congregation.dag import Dag from congregation.comp import PushDown from tests.utils import create_cols, compare_to_expected import pytest """ Tests for correct propagation of the following relation-level and column-level attributes after the PushDown() phase of the compiler has been run: - DAG node order - node.requires_mpc() attribute - relation-level stored_with sets - column-level plaintext sets - column-level trust_with sets """ @pytest.mark.parametrize("party_data, expected", [ ( [ { "col_names": ["a", "b"], "stored_with": {1}, "plaintext_sets": [{1}, {1}], "trust_with_sets": [{1}, {1}] }, { "col_names": ["c", "d"], "stored_with": {2}, "plaintext_sets": [{2}, {2}], "trust_with_sets": [{2}, {2}] } ], { "node_order": [Create, Divide, Create, Divide, Concat, Collect], "requires_mpc": [False, False, False, False, True, False], "ownership_data":[ { "stored_with": [{1}], "plaintext_sets": [{1}, {1}], "trust_with_sets": [{1}, {1}] }, { "stored_with": [{1}], "plaintext_sets": [{1}, {1}], "trust_with_sets": [{1}, {1}] }, { "stored_with": [{2}], "plaintext_sets": [{2}, {2}], "trust_with_sets": [{2}, {2}] }, { "stored_with": [{2}], "plaintext_sets": [{2}, {2}], "trust_with_sets": [{2}, {2}] }, { "stored_with": [{1}, {2}], "plaintext_sets": [set(), set()], "trust_with_sets": [set(), set()] }, { "stored_with": [{1}, {2}], "plaintext_sets": [{1, 2}, {1, 2}], "trust_with_sets": [{1, 2}, {1, 2}] } ] } ), ( [ { "col_names": ["a", "b"], "stored_with": {1}, "plaintext_sets": [set(), set()], "trust_with_sets": [set(), set()] }, { "col_names": ["c", "d"], "stored_with": {2}, "plaintext_sets": [set(), set()], "trust_with_sets": [set(), set()] } ], { "node_order": [Create, Divide, Create, Divide, Concat, Collect], "requires_mpc": [False, False, False, False, True, False], "ownership_data": [ { "stored_with": [{1}], "plaintext_sets": [{1}, {1}], "trust_with_sets": [{1}, {1}] }, { "stored_with": [{1}], "plaintext_sets": [{1}, {1}], "trust_with_sets": [{1}, {1}] }, { "stored_with": [{2}], "plaintext_sets": [{2}, {2}], "trust_with_sets": [{2}, {2}] }, { "stored_with": [{2}], "plaintext_sets": [{2}, {2}], "trust_with_sets": [{2}, {2}] }, { "stored_with": [{1}, {2}], "plaintext_sets": [set(), set()], "trust_with_sets": [set(), set()] }, { "stored_with": [{1}, {2}], "plaintext_sets": [{1, 2}, {1, 2}], "trust_with_sets": [{1, 2}, {1, 2}] } ] } ), ( [ { "col_names": ["a", "b"], "stored_with": {1}, "plaintext_sets": [{1}, {1}], "trust_with_sets": [{1}, {1, 2}] }, { "col_names": ["c", "d"], "stored_with": {2}, "plaintext_sets": [{2}, {2}], "trust_with_sets": [{2}, {2}] } ], { "node_order": [Create, Divide, Create, Divide, Concat, Collect], "requires_mpc": [False, False, False, False, True, False], "ownership_data": [ { "stored_with": [{1}], "plaintext_sets": [{1}, {1}], "trust_with_sets": [{1}, {1, 2}] }, { "stored_with": [{1}], "plaintext_sets": [{1}, {1}], "trust_with_sets": [{1}, {1, 2}] }, { "stored_with": [{2}], "plaintext_sets": [{2}, {2}], "trust_with_sets": [{2}, {2}] }, { "stored_with": [{2}], "plaintext_sets": [{2}, {2}], "trust_with_sets": [{2}, {2}] }, { "stored_with": [{1}, {2}], "plaintext_sets": [set(), set()], "trust_with_sets": [set(), {2}] }, { "stored_with": [{1}, {2}], "plaintext_sets": [{1, 2}, {1, 2}], "trust_with_sets": [{1, 2}, {1, 2}] } ] } ), ( [ { "col_names": ["a", "b"], "stored_with": {1}, "plaintext_sets": [{1}, {1}], "trust_with_sets": [{1, 2}, {1}] }, { "col_names": ["c", "d"], "stored_with": {2}, "plaintext_sets": [{2}, {2}], "trust_with_sets": [{2}, {2}] } ], { "node_order": [Create, Divide, Create, Divide, Concat, Collect], "requires_mpc": [False, False, False, False, True, False], "ownership_data": [ { "stored_with": [{1}], "plaintext_sets": [{1}, {1}], "trust_with_sets": [{1, 2}, {1}] }, { "stored_with": [{1}], "plaintext_sets": [{1}, {1}], "trust_with_sets": [{1}, {1}] }, { "stored_with": [{2}], "plaintext_sets": [{2}, {2}], "trust_with_sets": [{2}, {2}] }, { "stored_with": [{2}], "plaintext_sets": [{2}, {2}], "trust_with_sets": [{2}, {2}] }, { "stored_with": [{1}, {2}], "plaintext_sets": [set(), set()], "trust_with_sets": [set(), set()] }, { "stored_with": [{1}, {2}], "plaintext_sets": [{1, 2}, {1, 2}], "trust_with_sets": [{1, 2}, {1, 2}] } ] } ), ( [ { "col_names": ["a", "b"], "stored_with": {1, 2}, "plaintext_sets": [set(), set()], "trust_with_sets": [set(), set()] }, { "col_names": ["c", "d"], "stored_with": {1, 2}, "plaintext_sets": [set(), set()], "trust_with_sets": [set(), set()] } ], { "node_order": [Create, Create, Concat, Divide, Collect], "requires_mpc": [True, True, True, True, False], "ownership_data": [ { "stored_with": [{1, 2}], "plaintext_sets": [set(), set()], "trust_with_sets": [set(), set()] }, { "stored_with": [{1, 2}], "plaintext_sets": [set(), set()], "trust_with_sets": [set(), set()] }, { "stored_with": [{1, 2}], "plaintext_sets": [set(), set()], "trust_with_sets": [set(), set()] }, { "stored_with": [{1, 2}], "plaintext_sets": [set(), set()], "trust_with_sets": [set(), set()] }, { "stored_with": [{1}, {2}], "plaintext_sets": [{1, 2}, {1, 2}], "trust_with_sets": [{1, 2}, {1, 2}] } ] } ) ]) def test_divide_target_existing(party_data, expected): cols_in_one = create_cols(party_data[0]) cols_in_two = create_cols(party_data[1]) rel_one = create("in1", cols_in_one, party_data[0]["stored_with"]) rel_two = create("in2", cols_in_two, party_data[1]["stored_with"]) cc = concat([rel_one, rel_two], "concat", party_data[0]["col_names"]) p = divide(cc, "div", party_data[0]["col_names"][0], [party_data[0]["col_names"][1], 10]) collect(p, {1, 2}) d = Dag({rel_one, rel_two}) pd = PushDown() pd.rewrite(d) compare_to_expected(d, expected) @pytest.mark.parametrize("party_data, expected", [ ( [ { "col_names": ["a", "b"], "stored_with": {1}, "plaintext_sets": [{1}, {1}], "trust_with_sets": [{1}, {1}] }, { "col_names": ["c", "d"], "stored_with": {2}, "plaintext_sets": [{2}, {2}], "trust_with_sets": [{2}, {2}] } ], { "node_order": [Create, Divide, Create, Divide, Concat, Collect], "requires_mpc": [False, False, False, False, True, False], "ownership_data":[ { "stored_with": [{1}], "plaintext_sets": [{1}, {1}], "trust_with_sets": [{1}, {1}] }, { "stored_with": [{1}], "plaintext_sets": [{1}, {1}, {1}], "trust_with_sets": [{1}, {1}, {1}] }, { "stored_with": [{2}], "plaintext_sets": [{2}, {2}], "trust_with_sets": [{2}, {2}] }, { "stored_with": [{2}], "plaintext_sets": [{2}, {2}, {2}], "trust_with_sets": [{2}, {2}, {2}] }, { "stored_with": [{1}, {2}], "plaintext_sets": [set(), set(), set()], "trust_with_sets": [set(), set(), set()] }, { "stored_with": [{1}, {2}], "plaintext_sets": [{1, 2}, {1, 2}, {1, 2}], "trust_with_sets": [{1, 2}, {1, 2}, {1, 2}] } ] } ), ( [ { "col_names": ["a", "b"], "stored_with": {1}, "plaintext_sets": [set(), set()], "trust_with_sets": [set(), set()] }, { "col_names": ["c", "d"], "stored_with": {2}, "plaintext_sets": [set(), set()], "trust_with_sets": [set(), set()] } ], { "node_order": [Create, Divide, Create, Divide, Concat, Collect], "requires_mpc": [False, False, False, False, True, False], "ownership_data": [ { "stored_with": [{1}], "plaintext_sets": [{1}, {1}], "trust_with_sets": [{1}, {1}] }, { "stored_with": [{1}], "plaintext_sets": [{1}, {1}, {1}], "trust_with_sets": [{1}, {1}, {1}] }, { "stored_with": [{2}], "plaintext_sets": [{2}, {2}], "trust_with_sets": [{2}, {2}] }, { "stored_with": [{2}], "plaintext_sets": [{2}, {2}, {2}], "trust_with_sets": [{2}, {2}, {2}] }, { "stored_with": [{1}, {2}], "plaintext_sets": [set(), set(), set()], "trust_with_sets": [set(), set(), set()] }, { "stored_with": [{1}, {2}], "plaintext_sets": [{1, 2}, {1, 2}, {1, 2}], "trust_with_sets": [{1, 2}, {1, 2}, {1, 2}] } ] } ), ( [ { "col_names": ["a", "b"], "stored_with": {1}, "plaintext_sets": [{1}, {1}], "trust_with_sets": [{1}, {1, 2}] }, { "col_names": ["c", "d"], "stored_with": {2}, "plaintext_sets": [{2}, {2}], "trust_with_sets": [{2}, {2}] } ], { "node_order": [Create, Divide, Create, Divide, Concat, Collect], "requires_mpc": [False, False, False, False, True, False], "ownership_data": [ { "stored_with": [{1}], "plaintext_sets": [{1}, {1}], "trust_with_sets": [{1}, {1, 2}] }, { "stored_with": [{1}], "plaintext_sets": [{1}, {1}, {1}], "trust_with_sets": [{1}, {1, 2}, {1}] }, { "stored_with": [{2}], "plaintext_sets": [{2}, {2}], "trust_with_sets": [{2}, {2}] }, { "stored_with": [{2}], "plaintext_sets": [{2}, {2}, {2}], "trust_with_sets": [{2}, {2}, {2}] }, { "stored_with": [{1}, {2}], "plaintext_sets": [set(), set(), set()], "trust_with_sets": [set(), {2}, set()] }, { "stored_with": [{1}, {2}], "plaintext_sets": [{1, 2}, {1, 2}, {1, 2}], "trust_with_sets": [{1, 2}, {1, 2}, {1, 2}] } ] } ), ( [ { "col_names": ["a", "b"], "stored_with": {1}, "plaintext_sets": [{1}, {1}], "trust_with_sets": [{1, 2}, {1}] }, { "col_names": ["c", "d"], "stored_with": {2}, "plaintext_sets": [{2}, {2}], "trust_with_sets": [{2}, {2}] } ], { "node_order": [Create, Divide, Create, Divide, Concat, Collect], "requires_mpc": [False, False, False, False, True, False], "ownership_data": [ { "stored_with": [{1}], "plaintext_sets": [{1}, {1}], "trust_with_sets": [{1, 2}, {1}] }, { "stored_with": [{1}], "plaintext_sets": [{1}, {1}, {1}], "trust_with_sets": [{1, 2}, {1}, {1}] }, { "stored_with": [{2}], "plaintext_sets": [{2}, {2}], "trust_with_sets": [{2}, {2}] }, { "stored_with": [{2}], "plaintext_sets": [{2}, {2}, {2}], "trust_with_sets": [{2}, {2}, {2}] }, { "stored_with": [{1}, {2}], "plaintext_sets": [set(), set(), set()], "trust_with_sets": [{2}, set(), set()] }, { "stored_with": [{1}, {2}], "plaintext_sets": [{1, 2}, {1, 2}, {1, 2}], "trust_with_sets": [{1, 2}, {1, 2}, {1, 2}] } ] } ), ( [ { "col_names": ["a", "b"], "stored_with": {1, 2}, "plaintext_sets": [set(), set()], "trust_with_sets": [set(), set()] }, { "col_names": ["c", "d"], "stored_with": {1, 2}, "plaintext_sets": [set(), set()], "trust_with_sets": [set(), set()] } ], { "node_order": [Create, Create, Concat, Divide, Collect], "requires_mpc": [True, True, True, True, False], "ownership_data": [ { "stored_with": [{1, 2}], "plaintext_sets": [set(), set()], "trust_with_sets": [set(), set()] }, { "stored_with": [{1, 2}], "plaintext_sets": [set(), set()], "trust_with_sets": [set(), set()] }, { "stored_with": [{1, 2}], "plaintext_sets": [set(), set()], "trust_with_sets": [set(), set()] }, { "stored_with": [{1, 2}], "plaintext_sets": [set(), set(), set()], "trust_with_sets": [set(), set(), set()] }, { "stored_with": [{1}, {2}], "plaintext_sets": [{1, 2}, {1, 2}, {1, 2}], "trust_with_sets": [{1, 2}, {1, 2}, {1, 2}] } ] } ) ]) def test_divide_target_new(party_data, expected): cols_in_one = create_cols(party_data[0]) cols_in_two = create_cols(party_data[1]) rel_one = create("in1", cols_in_one, party_data[0]["stored_with"]) rel_two = create("in2", cols_in_two, party_data[1]["stored_with"]) cc = concat([rel_one, rel_two], "concat", party_data[0]["col_names"]) p = divide(cc, "div", "m", [party_data[0]["col_names"][0], party_data[0]["col_names"][1]]) collect(p, {1, 2}) d = Dag({rel_one, rel_two}) pd = PushDown() pd.rewrite(d) compare_to_expected(d, expected)
33.75614
94
0.327218
1,594
19,241
3.675031
0.050188
0.031751
0.175316
0.076477
0.932742
0.932742
0.932742
0.9324
0.925572
0.925572
0
0.045144
0.491139
19,241
569
95
33.815466
0.553161
0
0
0.59116
0
0
0.20446
0
0
0
0
0
0
1
0.003683
false
0
0.009208
0
0.012891
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
8abb457767f2ee43eb1245effcb9cf75c27ca6e4
117
py
Python
malwareconfig/komand_malwareconfig/actions/__init__.py
killstrelok/insightconnect-plugins
911358925f4233ab273dbd8172e8b7b9188ebc01
[ "MIT" ]
1
2020-03-18T09:14:55.000Z
2020-03-18T09:14:55.000Z
malwareconfig/komand_malwareconfig/actions/__init__.py
killstrelok/insightconnect-plugins
911358925f4233ab273dbd8172e8b7b9188ebc01
[ "MIT" ]
1
2021-02-23T23:57:37.000Z
2021-02-23T23:57:37.000Z
malwareconfig/komand_malwareconfig/actions/__init__.py
killstrelok/insightconnect-plugins
911358925f4233ab273dbd8172e8b7b9188ebc01
[ "MIT" ]
null
null
null
# GENERATED BY KOMAND SDK - DO NOT EDIT from .search.action import Search from .view_config.action import ViewConfig
29.25
42
0.803419
18
117
5.166667
0.777778
0.258065
0
0
0
0
0
0
0
0
0
0
0.145299
117
3
43
39
0.93
0.316239
0
0
1
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
6
8ac2e2a3bae0a9aed3025f15891b136d46503f25
48
py
Python
deepSI/exp_design/__init__.py
GerbenBeintema/deepSI
580711210398064bb7f01e41d08b7a248a88b35b
[ "BSD-3-Clause" ]
12
2021-03-23T20:30:29.000Z
2022-03-01T12:22:41.000Z
deepSI/exp_design/__init__.py
csutakbalazs/deepSI
895030225937fb5fcbd4fc0eaba6c306ec0b5820
[ "BSD-3-Clause" ]
2
2022-01-12T14:05:13.000Z
2022-03-01T10:18:34.000Z
deepSI/exp_design/__init__.py
csutakbalazs/deepSI
895030225937fb5fcbd4fc0eaba6c306ec0b5820
[ "BSD-3-Clause" ]
7
2021-05-26T15:26:31.000Z
2022-02-03T00:43:31.000Z
from deepSI.exp_design.first import var_addive
16
46
0.854167
8
48
4.875
1
0
0
0
0
0
0
0
0
0
0
0
0.104167
48
3
46
16
0.906977
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
76ee074f3c71002d79cc08e264f610d33e8fe720
35,817
py
Python
tests/jstests/24_wallet_coins_send.py
xmonader/pytfchain
ef28238eeaedda1dd5ea8055ea6dc2ca6baa263c
[ "Apache-2.0" ]
null
null
null
tests/jstests/24_wallet_coins_send.py
xmonader/pytfchain
ef28238eeaedda1dd5ea8055ea6dc2ca6baa263c
[ "Apache-2.0" ]
null
null
null
tests/jstests/24_wallet_coins_send.py
xmonader/pytfchain
ef28238eeaedda1dd5ea8055ea6dc2ca6baa263c
[ "Apache-2.0" ]
null
null
null
from Jumpscale import j import pytest from Jumpscale.clients.blockchain.tfchain.stub.ExplorerClientStub import TFChainExplorerGetClientStub def main(self): """ to run: js_shell 'j.clients.tfchain.test(name="wallet_coins_send")' """ # create a tfchain client for devnet c = j.clients.tfchain.new("mydevclient", network_type="DEV") # or simply `c = j.tfchain.clients.mydevclient`, should the client already exist # (we replace internal client logic with custom logic as to ensure we can test without requiring an active network) explorer_client = TFChainExplorerGetClientStub() explorer_client.hash_add('014ad318772a09de75fb62f084a33188a7f6fb5e7b68c0ed85a5f90fe11246386b7e6fe97a5a6a', '{"hashtype":"unlockhash","block":{"minerpayoutids":null,"transactions":null,"rawblock":{"parentid":"0000000000000000000000000000000000000000000000000000000000000000","timestamp":0,"pobsindexes":{"BlockHeight":0,"TransactionIndex":0,"OutputIndex":0},"minerpayouts":null,"transactions":null},"blockid":"0000000000000000000000000000000000000000000000000000000000000000","difficulty":"0","estimatedactivebs":"0","height":0,"maturitytimestamp":0,"target":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"totalcoins":"0","arbitrarydatatotalsize":0,"minerpayoutcount":0,"transactioncount":0,"coininputcount":0,"coinoutputcount":0,"blockstakeinputcount":0,"blockstakeoutputcount":0,"minerfeecount":0,"arbitrarydatacount":0},"blocks":null,"transaction":{"id":"0000000000000000000000000000000000000000000000000000000000000000","height":0,"parent":"0000000000000000000000000000000000000000000000000000000000000000","rawtransaction":{"version":0,"data":{"coininputs":[],"minerfees":null}},"coininputoutputs":null,"coinoutputids":null,"coinoutputunlockhashes":null,"blockstakeinputoutputs":null,"blockstakeoutputids":null,"blockstakeunlockhashes":null,"unconfirmed":false},"transactions":[{"id":"066c03b5cf6db18edd6013591ae6292e8a04f1cc18fc6f0a0f3946d40bb087b3","height":3628,"parent":"761af2728b6f07bbccf4ddaf330c0bb1465246f6fe25fbfb9989129b69fbd899","rawtransaction":{"version":1,"data":{"coininputs":[{"parentid":"670045cf43421b21577c27613569b65ba0cec613ae5437ee15dc0eea95241cbc","fulfillment":{"type":1,"data":{"publickey":"ed25519:bdea9aff09bcdc66529f6e2ef1bb763a3bab83ce542e8673d97aeaed0581ad97","signature":"e5a47b166eb6724ca7a72b5ddaeff287ebdde09751ed10e8850d320744afc5f45e59aa66e2cc4dc45ff593a0eea696c4e780b81636a1ce748c7149a9ee0ba807"}}},{"parentid":"1d686b8dfe44dfbfea55f327a52d9701a52938cb2c829f709dfb8059bc0e5f87","fulfillment":{"type":1,"data":{"publickey":"ed25519:64ae81a176302ea9ea47ec673f105da7a25e52bdf0cbb5b63d49fc2c69ed2eaa","signature":"5ce7a10373214d269837e9c176ec806469d2b80f200f9ee961c63553b6ee200f88958293a571889f26b2b52664f3c9ff2441eaf8ed61830b51d640003b06fb00"}}}],"coinoutputs":[{"value":"501000000000","condition":{"type":1,"data":{"unlockhash":"0186cea43fa0d303a6379ae76dd79f014698956fb982751549e3ff3844b23fa9551c1725470f55"}}},{"value":"198000000000","condition":{"type":1,"data":{"unlockhash":"014ad318772a09de75fb62f084a33188a7f6fb5e7b68c0ed85a5f90fe11246386b7e6fe97a5a6a"}}}],"minerfees":["1000000000"]}},"coininputoutputs":[{"value":"200000000000","condition":{"type":1,"data":{"unlockhash":"018f5a43327fb865843808ddf549f1b1c06376e07195423778751056be626841f42dcf25a593fd"}},"unlockhash":"018f5a43327fb865843808ddf549f1b1c06376e07195423778751056be626841f42dcf25a593fd"},{"value":"500000000000","condition":{"type":1,"data":{"unlockhash":"014ad318772a09de75fb62f084a33188a7f6fb5e7b68c0ed85a5f90fe11246386b7e6fe97a5a6a"}},"unlockhash":"014ad318772a09de75fb62f084a33188a7f6fb5e7b68c0ed85a5f90fe11246386b7e6fe97a5a6a"}],"coinoutputids":["4b43906584620e8a13d98a917d424fb154dd1222a72b886a887c416b2a9120f5","19d4e81d057b4c93a7763f3dfe878f6a37d6111a3808b93afff4b369de0f5376"],"coinoutputunlockhashes":["0186cea43fa0d303a6379ae76dd79f014698956fb982751549e3ff3844b23fa9551c1725470f55","014ad318772a09de75fb62f084a33188a7f6fb5e7b68c0ed85a5f90fe11246386b7e6fe97a5a6a"],"blockstakeinputoutputs":null,"blockstakeoutputids":null,"blockstakeunlockhashes":null,"unconfirmed":false},{"id":"0b5d7509e467b943af12db2d73ddb78a5ec8cfdf64c3c6ecacb2de4af68bdc4d","height":33,"parent":"40e281daee6f113b788d64b8247381c36fe4885233a7475c9be2cce852e1696e","rawtransaction":{"version":1,"data":{"coininputs":[{"parentid":"a3c8f44d64c0636018a929d2caeec09fb9698bfdcbfa3a8225585a51e09ee563","fulfillment":{"type":1,"data":{"publickey":"ed25519:d285f92d6d449d9abb27f4c6cf82713cec0696d62b8c123f1627e054dc6d7780","signature":"e5b69be3b385f0a33f7978e0d6af30cf37c975bbb99d0f3d06f199cd579d3e6854f6cb398c88082e438c89d11d04de0e7d3b2876e250d4ba8ae457f88547f605"}}}],"coinoutputs":[{"value":"1000000000000","condition":{"type":1,"data":{"unlockhash":"014ad318772a09de75fb62f084a33188a7f6fb5e7b68c0ed85a5f90fe11246386b7e6fe97a5a6a"}}},{"value":"99998999000000000","condition":{"type":1,"data":{"unlockhash":"01f68299b26a89efdb4351a61c3a062321d23edbc1399c8499947c1313375609adbbcd3977363c"}}}],"minerfees":["1000000000"]}},"coininputoutputs":[{"value":"100000000000000000","condition":{"type":1,"data":{"unlockhash":"015a080a9259b9d4aaa550e2156f49b1a79a64c7ea463d810d4493e8242e6791584fbdac553e6f"}},"unlockhash":"015a080a9259b9d4aaa550e2156f49b1a79a64c7ea463d810d4493e8242e6791584fbdac553e6f"}],"coinoutputids":["75f297550acfa48490c21490f82c3c308326c16f950e17ef3a286486065a51b8","6d157a1eb23cadde122192869bc51e2a0fe44a2d8aba898cbdda8b7218a0f8cb"],"coinoutputunlockhashes":["014ad318772a09de75fb62f084a33188a7f6fb5e7b68c0ed85a5f90fe11246386b7e6fe97a5a6a","01f68299b26a89efdb4351a61c3a062321d23edbc1399c8499947c1313375609adbbcd3977363c"],"blockstakeinputoutputs":null,"blockstakeoutputids":null,"blockstakeunlockhashes":null,"unconfirmed":false},{"id":"1b144b89c4b65cc67416e27286e802c50f78bc7326b4b0e5f6f967f99cc39419","height":200,"parent":"68e3886c9a4c59dea8c7a0eb138ede0e83716b995fd8ebfa5dfc766bfb349565","rawtransaction":{"version":1,"data":{"coininputs":[{"parentid":"6d157a1eb23cadde122192869bc51e2a0fe44a2d8aba898cbdda8b7218a0f8cb","fulfillment":{"type":1,"data":{"publickey":"ed25519:00bde9571b30e1742c41fcca8c730183402d967df5b17b5f4ced22c677806614","signature":"05c72055d4cca6d8620fd7453c89ac8deaf92c38e366604dc6405cb097321b74e2e5f7ece15b440f4af5721b8aa6ea1f57f4fce44d2a2c6c0fb7a1e068a0480d"}}}],"coinoutputs":[{"value":"500000000000","condition":{"type":1,"data":{"unlockhash":"014ad318772a09de75fb62f084a33188a7f6fb5e7b68c0ed85a5f90fe11246386b7e6fe97a5a6a"}}},{"value":"99998498000000000","condition":{"type":1,"data":{"unlockhash":"0161fbcf58efaeba8813150e88fc33405b3a77d51277a2cdf3f4d2ab770de287c7af9d456c4e68"}}}],"minerfees":["1000000000"]}},"coininputoutputs":[{"value":"99998999000000000","condition":{"type":1,"data":{"unlockhash":"01f68299b26a89efdb4351a61c3a062321d23edbc1399c8499947c1313375609adbbcd3977363c"}},"unlockhash":"01f68299b26a89efdb4351a61c3a062321d23edbc1399c8499947c1313375609adbbcd3977363c"}],"coinoutputids":["1d686b8dfe44dfbfea55f327a52d9701a52938cb2c829f709dfb8059bc0e5f87","e27ed8bbe45177fafdfd7d21394ff483b8bde24f551dd927a046a0b7c37ec228"],"coinoutputunlockhashes":["014ad318772a09de75fb62f084a33188a7f6fb5e7b68c0ed85a5f90fe11246386b7e6fe97a5a6a","0161fbcf58efaeba8813150e88fc33405b3a77d51277a2cdf3f4d2ab770de287c7af9d456c4e68"],"blockstakeinputoutputs":null,"blockstakeoutputids":null,"blockstakeunlockhashes":null,"unconfirmed":false},{"id":"5ab2604c7d54dd9ea39d829724e46deb8bbf2889d8627a3bb3b57907c6f4dff4","height":1433,"parent":"6b9fdad35096c5a84dcdb6e3e9ec2a8c7562f567e05b1207a7f9330ed51582bb","rawtransaction":{"version":1,"data":{"coininputs":[{"parentid":"e27ed8bbe45177fafdfd7d21394ff483b8bde24f551dd927a046a0b7c37ec228","fulfillment":{"type":1,"data":{"publickey":"ed25519:41e84f3b0f6a06dd7e45ded4d0e227869725355b73906b82d9e3ffc0b6b01416","signature":"47a4d1a6aeb7403ea5c2cbcc26f84bb1964aadcb8765696db4a623694991f794663b860898db53401dd4324477c43f9fff177b74909201a03e131c2cd885cc0d"}}}],"coinoutputs":[{"value":"500000000000","condition":{"type":1,"data":{"unlockhash":"014ad318772a09de75fb62f084a33188a7f6fb5e7b68c0ed85a5f90fe11246386b7e6fe97a5a6a"}}},{"value":"99997997000000000","condition":{"type":1,"data":{"unlockhash":"0137f6f647a3c8019f6ae215ed09902c308efbf555b3520d2112d2b18cb577e40804d6fc5fafd2"}}}],"minerfees":["1000000000"]}},"coininputoutputs":[{"value":"99998498000000000","condition":{"type":1,"data":{"unlockhash":"0161fbcf58efaeba8813150e88fc33405b3a77d51277a2cdf3f4d2ab770de287c7af9d456c4e68"}},"unlockhash":"0161fbcf58efaeba8813150e88fc33405b3a77d51277a2cdf3f4d2ab770de287c7af9d456c4e68"}],"coinoutputids":["b90422bad2dffde79f0a46bd0a41055cf7974b080e115d76f69891ca31d31f11","f386312779f382f16fa836038b3d25536b928ba88ae1afa1f8c0e8dc25c0ba16"],"coinoutputunlockhashes":["014ad318772a09de75fb62f084a33188a7f6fb5e7b68c0ed85a5f90fe11246386b7e6fe97a5a6a","0137f6f647a3c8019f6ae215ed09902c308efbf555b3520d2112d2b18cb577e40804d6fc5fafd2"],"blockstakeinputoutputs":null,"blockstakeoutputids":null,"blockstakeunlockhashes":null,"unconfirmed":false},{"id":"81d81b413fc8af3e528478e639d5a6e999e5e96611593cd2458b4d2d7abc3880","height":1433,"parent":"6b9fdad35096c5a84dcdb6e3e9ec2a8c7562f567e05b1207a7f9330ed51582bb","rawtransaction":{"version":1,"data":{"coininputs":[{"parentid":"f386312779f382f16fa836038b3d25536b928ba88ae1afa1f8c0e8dc25c0ba16","fulfillment":{"type":1,"data":{"publickey":"ed25519:4e42a2fcfc0963d6fa7bb718fd088d9b6544331e8562d2743e730cdfbedeb55a","signature":"4abae694cf6a6408eca6f034ea2ec6930b9a73303c3e70d3444cf36a9966b0c4cc1b65168c23640affb5bdeae539ea583d42da52c58d21f59b71c288b3faef0e"}}}],"coinoutputs":[{"value":"2000000000000","condition":{"type":1,"data":{"unlockhash":"014ad318772a09de75fb62f084a33188a7f6fb5e7b68c0ed85a5f90fe11246386b7e6fe97a5a6a"}}},{"value":"99995996000000000","condition":{"type":1,"data":{"unlockhash":"0173f82c3ee74286c33fee8d883a7e9e759c6230b9e4e956ef233d7202bde69da45054270eef99"}}}],"minerfees":["1000000000"],"arbitrarydata":"Zm9vYmFy"}},"coininputoutputs":[{"value":"99997997000000000","condition":{"type":1,"data":{"unlockhash":"0137f6f647a3c8019f6ae215ed09902c308efbf555b3520d2112d2b18cb577e40804d6fc5fafd2"}},"unlockhash":"0137f6f647a3c8019f6ae215ed09902c308efbf555b3520d2112d2b18cb577e40804d6fc5fafd2"}],"coinoutputids":["d1f74e90eba8095e78f08a6284c7b76d4cda86b06ac742062d6e0e02dc4607eb","1edccdb04100ffd05d97431b6798533fa57dc7ed1ea58c75f0f445fb64442d6e"],"coinoutputunlockhashes":["014ad318772a09de75fb62f084a33188a7f6fb5e7b68c0ed85a5f90fe11246386b7e6fe97a5a6a","0173f82c3ee74286c33fee8d883a7e9e759c6230b9e4e956ef233d7202bde69da45054270eef99"],"blockstakeinputoutputs":null,"blockstakeoutputids":null,"blockstakeunlockhashes":null,"unconfirmed":false}],"multisigaddresses":["039e16ed27b2dfa3a5bbb1fa2b5f240ba7ff694b34a52bfc5bed6d4c3b14b763c011d7503ccb3a"],"unconfirmed":false}') explorer_client.hash_add('018f5a43327fb865843808ddf549f1b1c06376e07195423778751056be626841f42dcf25a593fd', '{"hashtype":"unlockhash","block":{"minerpayoutids":null,"transactions":null,"rawblock":{"parentid":"0000000000000000000000000000000000000000000000000000000000000000","timestamp":0,"pobsindexes":{"BlockHeight":0,"TransactionIndex":0,"OutputIndex":0},"minerpayouts":null,"transactions":null},"blockid":"0000000000000000000000000000000000000000000000000000000000000000","difficulty":"0","estimatedactivebs":"0","height":0,"maturitytimestamp":0,"target":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"totalcoins":"0","arbitrarydatatotalsize":0,"minerpayoutcount":0,"transactioncount":0,"coininputcount":0,"coinoutputcount":0,"blockstakeinputcount":0,"blockstakeoutputcount":0,"minerfeecount":0,"arbitrarydatacount":0},"blocks":null,"transaction":{"id":"0000000000000000000000000000000000000000000000000000000000000000","height":0,"parent":"0000000000000000000000000000000000000000000000000000000000000000","rawtransaction":{"version":0,"data":{"coininputs":[],"minerfees":null}},"coininputoutputs":null,"coinoutputids":null,"coinoutputunlockhashes":null,"blockstakeinputoutputs":null,"blockstakeoutputids":null,"blockstakeunlockhashes":null,"unconfirmed":false},"transactions":[{"id":"066c03b5cf6db18edd6013591ae6292e8a04f1cc18fc6f0a0f3946d40bb087b3","height":3628,"parent":"761af2728b6f07bbccf4ddaf330c0bb1465246f6fe25fbfb9989129b69fbd899","rawtransaction":{"version":1,"data":{"coininputs":[{"parentid":"670045cf43421b21577c27613569b65ba0cec613ae5437ee15dc0eea95241cbc","fulfillment":{"type":1,"data":{"publickey":"ed25519:bdea9aff09bcdc66529f6e2ef1bb763a3bab83ce542e8673d97aeaed0581ad97","signature":"e5a47b166eb6724ca7a72b5ddaeff287ebdde09751ed10e8850d320744afc5f45e59aa66e2cc4dc45ff593a0eea696c4e780b81636a1ce748c7149a9ee0ba807"}}},{"parentid":"1d686b8dfe44dfbfea55f327a52d9701a52938cb2c829f709dfb8059bc0e5f87","fulfillment":{"type":1,"data":{"publickey":"ed25519:64ae81a176302ea9ea47ec673f105da7a25e52bdf0cbb5b63d49fc2c69ed2eaa","signature":"5ce7a10373214d269837e9c176ec806469d2b80f200f9ee961c63553b6ee200f88958293a571889f26b2b52664f3c9ff2441eaf8ed61830b51d640003b06fb00"}}}],"coinoutputs":[{"value":"501000000000","condition":{"type":1,"data":{"unlockhash":"0186cea43fa0d303a6379ae76dd79f014698956fb982751549e3ff3844b23fa9551c1725470f55"}}},{"value":"198000000000","condition":{"type":1,"data":{"unlockhash":"014ad318772a09de75fb62f084a33188a7f6fb5e7b68c0ed85a5f90fe11246386b7e6fe97a5a6a"}}}],"minerfees":["1000000000"]}},"coininputoutputs":[{"value":"200000000000","condition":{"type":1,"data":{"unlockhash":"018f5a43327fb865843808ddf549f1b1c06376e07195423778751056be626841f42dcf25a593fd"}},"unlockhash":"018f5a43327fb865843808ddf549f1b1c06376e07195423778751056be626841f42dcf25a593fd"},{"value":"500000000000","condition":{"type":1,"data":{"unlockhash":"014ad318772a09de75fb62f084a33188a7f6fb5e7b68c0ed85a5f90fe11246386b7e6fe97a5a6a"}},"unlockhash":"014ad318772a09de75fb62f084a33188a7f6fb5e7b68c0ed85a5f90fe11246386b7e6fe97a5a6a"}],"coinoutputids":["4b43906584620e8a13d98a917d424fb154dd1222a72b886a887c416b2a9120f5","19d4e81d057b4c93a7763f3dfe878f6a37d6111a3808b93afff4b369de0f5376"],"coinoutputunlockhashes":["0186cea43fa0d303a6379ae76dd79f014698956fb982751549e3ff3844b23fa9551c1725470f55","014ad318772a09de75fb62f084a33188a7f6fb5e7b68c0ed85a5f90fe11246386b7e6fe97a5a6a"],"blockstakeinputoutputs":null,"blockstakeoutputids":null,"blockstakeunlockhashes":null,"unconfirmed":false},{"id":"d0d290dccddaf086708e4163eacd420bfbaa7acb77deea97c6a8792a139f6e7e","height":3583,"parent":"ca746d80740ff45f6e7f0d6c8b6278b35b1040b4e21baaf41bd03cd3a7a176be","rawtransaction":{"version":1,"data":{"coininputs":[{"parentid":"1edccdb04100ffd05d97431b6798533fa57dc7ed1ea58c75f0f445fb64442d6e","fulfillment":{"type":1,"data":{"publickey":"ed25519:7469d51063cdb690cc8025db7d28faadc71ff69f7c372779bf3a1e801a923e02","signature":"6f38467bb4ca23900e424d5ac2066a09b61fe9d9ae84a4231755063f591d04711f0a5ab11b60b42c2c32a8e7f73fc1cc1cb0073b036bc417ed504a8ef5f25402"}}}],"coinoutputs":[{"value":"200000000000","condition":{"type":1,"data":{"unlockhash":"018f5a43327fb865843808ddf549f1b1c06376e07195423778751056be626841f42dcf25a593fd"}}},{"value":"99995795000000000","condition":{"type":1,"data":{"unlockhash":"01f706dcbb9f0cb1e97d891ada3a133f68612ebff948c5bbae7851108a65dab7782907eecd86be"}}}],"minerfees":["1000000000"]}},"coininputoutputs":[{"value":"99995996000000000","condition":{"type":1,"data":{"unlockhash":"0173f82c3ee74286c33fee8d883a7e9e759c6230b9e4e956ef233d7202bde69da45054270eef99"}},"unlockhash":"0173f82c3ee74286c33fee8d883a7e9e759c6230b9e4e956ef233d7202bde69da45054270eef99"}],"coinoutputids":["670045cf43421b21577c27613569b65ba0cec613ae5437ee15dc0eea95241cbc","984555e190d58dc752aad81b0a6cf6194fa5bf89b8614efcd9604d138a8953bc"],"coinoutputunlockhashes":["018f5a43327fb865843808ddf549f1b1c06376e07195423778751056be626841f42dcf25a593fd","01f706dcbb9f0cb1e97d891ada3a133f68612ebff948c5bbae7851108a65dab7782907eecd86be"],"blockstakeinputoutputs":null,"blockstakeoutputids":null,"blockstakeunlockhashes":null,"unconfirmed":false}],"multisigaddresses":null,"unconfirmed":false}') explorer_client.chain_info = '{"blockid":"552e410481cce1358ffcd4687f4199dd2181c799d55da26178e55643355bbd2e","difficulty":"27801","estimatedactivebs":"59","height":3644,"maturitytimestamp":1549012510,"target":[0,2,91,116,78,165,130,72,116,162,127,4,125,67,108,16,140,247,132,198,107,159,114,177,44,25,18,162,38,157,169,245],"totalcoins":"0","arbitrarydatatotalsize":6,"minerpayoutcount":3650,"transactioncount":3652,"coininputcount":12,"coinoutputcount":15,"blockstakeinputcount":3644,"blockstakeoutputcount":3645,"minerfeecount":7,"arbitrarydatacount":1}' explorer_client.hash_add('552e410481cce1358ffcd4687f4199dd2181c799d55da26178e55643355bbd2e', '{"hashtype":"blockid","block":{"minerpayoutids":["468db689f752414702ef3a5aa06238f03a4539434a61624b3b8a0fb5dc38a211"],"transactions":[{"id":"2396f8e57bbb9b22bd1d749d5de3fd532ea6886e9660a556a13571d701d83e27","height":3644,"parent":"552e410481cce1358ffcd4687f4199dd2181c799d55da26178e55643355bbd2e","rawtransaction":{"version":1,"data":{"coininputs":null,"blockstakeinputs":[{"parentid":"ff5a002ec356b7cb24fbee9f076f239fb8c72d5a8a448cee92ee6d29a87aef52","fulfillment":{"type":1,"data":{"publickey":"ed25519:d285f92d6d449d9abb27f4c6cf82713cec0696d62b8c123f1627e054dc6d7780","signature":"7bec94dfb87640726c6a14de2110599db0f81cf9fa456249e7bf79b0c74b79517edde25c4ee87f181880af44fe6ee054ff20b74eda2144fe07fa5bfb9d884208"}}}],"blockstakeoutputs":[{"value":"3000","condition":{"type":1,"data":{"unlockhash":"015a080a9259b9d4aaa550e2156f49b1a79a64c7ea463d810d4493e8242e6791584fbdac553e6f"}}}],"minerfees":null}},"coininputoutputs":null,"coinoutputids":null,"coinoutputunlockhashes":null,"blockstakeinputoutputs":[{"value":"3000","condition":{"type":1,"data":{"unlockhash":"015a080a9259b9d4aaa550e2156f49b1a79a64c7ea463d810d4493e8242e6791584fbdac553e6f"}},"unlockhash":"015a080a9259b9d4aaa550e2156f49b1a79a64c7ea463d810d4493e8242e6791584fbdac553e6f"}],"blockstakeoutputids":["f683e7319659c61f54e93546bc41b57c5bffe79de26c06ec7371034465804c81"],"blockstakeunlockhashes":["015a080a9259b9d4aaa550e2156f49b1a79a64c7ea463d810d4493e8242e6791584fbdac553e6f"],"unconfirmed":false}],"rawblock":{"parentid":"47db4274551b0372564f8d1ab89c596428f00e460c0b416327e53983c8765198","timestamp":1549012665,"pobsindexes":{"BlockHeight":3643,"TransactionIndex":0,"OutputIndex":0},"minerpayouts":[{"value":"10000000000","unlockhash":"015a080a9259b9d4aaa550e2156f49b1a79a64c7ea463d810d4493e8242e6791584fbdac553e6f"}],"transactions":[{"version":1,"data":{"coininputs":null,"blockstakeinputs":[{"parentid":"ff5a002ec356b7cb24fbee9f076f239fb8c72d5a8a448cee92ee6d29a87aef52","fulfillment":{"type":1,"data":{"publickey":"ed25519:d285f92d6d449d9abb27f4c6cf82713cec0696d62b8c123f1627e054dc6d7780","signature":"7bec94dfb87640726c6a14de2110599db0f81cf9fa456249e7bf79b0c74b79517edde25c4ee87f181880af44fe6ee054ff20b74eda2144fe07fa5bfb9d884208"}}}],"blockstakeoutputs":[{"value":"3000","condition":{"type":1,"data":{"unlockhash":"015a080a9259b9d4aaa550e2156f49b1a79a64c7ea463d810d4493e8242e6791584fbdac553e6f"}}}],"minerfees":null}}]},"blockid":"552e410481cce1358ffcd4687f4199dd2181c799d55da26178e55643355bbd2e","difficulty":"27801","estimatedactivebs":"59","height":3644,"maturitytimestamp":1549012510,"target":[0,2,91,116,78,165,130,72,116,162,127,4,125,67,108,16,140,247,132,198,107,159,114,177,44,25,18,162,38,157,169,245],"totalcoins":"0","arbitrarydatatotalsize":6,"minerpayoutcount":3650,"transactioncount":3652,"coininputcount":12,"coinoutputcount":15,"blockstakeinputcount":3644,"blockstakeoutputcount":3645,"minerfeecount":7,"arbitrarydatacount":1},"blocks":null,"transaction":{"id":"0000000000000000000000000000000000000000000000000000000000000000","height":0,"parent":"0000000000000000000000000000000000000000000000000000000000000000","rawtransaction":{"version":0,"data":{"coininputs":[],"minerfees":null}},"coininputoutputs":null,"coinoutputids":null,"coinoutputunlockhashes":null,"blockstakeinputoutputs":null,"blockstakeoutputids":null,"blockstakeunlockhashes":null,"unconfirmed":false},"transactions":null,"multisigaddresses":null,"unconfirmed":false}') explorer_client.hash_add('039e16ed27b2dfa3a5bbb1fa2b5f240ba7ff694b34a52bfc5bed6d4c3b14b763c011d7503ccb3a', '{"hashtype":"unlockhash","block":{"minerpayoutids":null,"transactions":null,"rawblock":{"parentid":"0000000000000000000000000000000000000000000000000000000000000000","timestamp":0,"pobsindexes":{"BlockHeight":0,"TransactionIndex":0,"OutputIndex":0},"minerpayouts":null,"transactions":null},"blockid":"0000000000000000000000000000000000000000000000000000000000000000","difficulty":"0","estimatedactivebs":"0","height":0,"maturitytimestamp":0,"target":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"totalcoins":"0","arbitrarydatatotalsize":0,"minerpayoutcount":0,"transactioncount":0,"coininputcount":0,"coinoutputcount":0,"blockstakeinputcount":0,"blockstakeoutputcount":0,"minerfeecount":0,"arbitrarydatacount":0},"blocks":null,"transaction":{"id":"0000000000000000000000000000000000000000000000000000000000000000","height":0,"parent":"0000000000000000000000000000000000000000000000000000000000000000","rawtransaction":{"version":0,"data":{"coininputs":[],"minerfees":null}},"coininputoutputs":null,"coinoutputids":null,"coinoutputunlockhashes":null,"blockstakeinputoutputs":null,"blockstakeoutputids":null,"blockstakeunlockhashes":null,"unconfirmed":false},"transactions":[{"id":"4c70a0406f36cf354edf87642df3f34568fd0a89c052a81d11cc6e4f8fbf685e","height":45,"parent":"f7b78b17d581ff9e58ffbcce1701d4dcadb0781590ca68e839def0dc98b0360a","rawtransaction":{"version":1,"data":{"coininputs":[{"parentid":"7d4a100fc3bc08b2bdd1284c17260dd2bd6b55fd6c1429dbbd683bf362d92b50","fulfillment":{"type":1,"data":{"publickey":"ed25519:d285f92d6d449d9abb27f4c6cf82713cec0696d62b8c123f1627e054dc6d7780","signature":"c34b8ca1ab08930bc68d61026af504d62d8a8bbda9b79ae01a387560fba22d39b12021e16566732b742ea686f997b3c19c807523797cdc0d74a4d25123691004"}}},{"parentid":"83503f9cea00d562e0460eace93159a4c4dd00df4703c96947e81885b46da04c","fulfillment":{"type":1,"data":{"publickey":"ed25519:d285f92d6d449d9abb27f4c6cf82713cec0696d62b8c123f1627e054dc6d7780","signature":"f6eea681a259baf14433ac55b4293b22ca2056810ee8fed2129039224d14558f54ca58c6d96e9885cb20ecdf7e64ba81d1a83c6e9a42bf9464287fa6359d360c"}}},{"parentid":"578aa43de72b42b4f4547c5ddc7f61736b1cac206e1789bc89fcd9333cf3d1f3","fulfillment":{"type":1,"data":{"publickey":"ed25519:d285f92d6d449d9abb27f4c6cf82713cec0696d62b8c123f1627e054dc6d7780","signature":"a0521d14dfe4a0c9b8b57ed361d738b48b6a8346097246effe0b4ee67b6fecbc3a90e4671ddc0b164f6c2839df249bb5998f10216a4a674ba8d24b8ad6bdf808"}}},{"parentid":"5a1454762e6895431e1b9e4e435e4d0ad60a3881843ac46b88e220771055ca87","fulfillment":{"type":1,"data":{"publickey":"ed25519:d285f92d6d449d9abb27f4c6cf82713cec0696d62b8c123f1627e054dc6d7780","signature":"900e7868780e67bcb68af3ec6976e84289850d0db59210d4689b1c0e2deb3164b9e93eb9ee5a38850f2319463b0845163e1eee443d7b645c59485c2aa0837707"}}},{"parentid":"c04ebebe17a1759457eecaf4d5d33f5ddbe8d154b0be1606f05bc8fd02ab9cd4","fulfillment":{"type":1,"data":{"publickey":"ed25519:d285f92d6d449d9abb27f4c6cf82713cec0696d62b8c123f1627e054dc6d7780","signature":"e992b1cd3347b5362e820166d5929de7c682130c7143fc4c9ff3156f5d44110753687697a0154a2043290b3f022e2537f3e3a6807caf9150f8c255d74e386d0a"}}}],"coinoutputs":[{"value":"42000000000","condition":{"type":4,"data":{"unlockhashes":["01ffd7c884aa869056bfb832d957bb71a0005fee13c19046cebec84b3a5047ee8829eab070374b","014ad318772a09de75fb62f084a33188a7f6fb5e7b68c0ed85a5f90fe11246386b7e6fe97a5a6a"],"minimumsignaturecount":1}}},{"value":"7000000000","condition":{"type":1,"data":{"unlockhash":"01972837ee396f22f96846a0c700f9cf7c8fa83ab4110da91a1c7d02f94f28ff03e45f1470df82"}}}],"minerfees":["1000000000"]}},"coininputoutputs":[{"value":"10000000000","condition":{"type":1,"data":{"unlockhash":"015a080a9259b9d4aaa550e2156f49b1a79a64c7ea463d810d4493e8242e6791584fbdac553e6f"}},"unlockhash":"015a080a9259b9d4aaa550e2156f49b1a79a64c7ea463d810d4493e8242e6791584fbdac553e6f"},{"value":"10000000000","condition":{"type":1,"data":{"unlockhash":"015a080a9259b9d4aaa550e2156f49b1a79a64c7ea463d810d4493e8242e6791584fbdac553e6f"}},"unlockhash":"015a080a9259b9d4aaa550e2156f49b1a79a64c7ea463d810d4493e8242e6791584fbdac553e6f"},{"value":"10000000000","condition":{"type":1,"data":{"unlockhash":"015a080a9259b9d4aaa550e2156f49b1a79a64c7ea463d810d4493e8242e6791584fbdac553e6f"}},"unlockhash":"015a080a9259b9d4aaa550e2156f49b1a79a64c7ea463d810d4493e8242e6791584fbdac553e6f"},{"value":"10000000000","condition":{"type":1,"data":{"unlockhash":"015a080a9259b9d4aaa550e2156f49b1a79a64c7ea463d810d4493e8242e6791584fbdac553e6f"}},"unlockhash":"015a080a9259b9d4aaa550e2156f49b1a79a64c7ea463d810d4493e8242e6791584fbdac553e6f"},{"value":"10000000000","condition":{"type":1,"data":{"unlockhash":"015a080a9259b9d4aaa550e2156f49b1a79a64c7ea463d810d4493e8242e6791584fbdac553e6f"}},"unlockhash":"015a080a9259b9d4aaa550e2156f49b1a79a64c7ea463d810d4493e8242e6791584fbdac553e6f"}],"coinoutputids":["29152fe03a2c8782fcbd670579686088c52be83fa3870f5f0788073d97fb5fb2","0fc9b16bb180cd8f8a7144d65e6c8fca66994a4ccaee42e324289d4039ab2841"],"coinoutputunlockhashes":["039e16ed27b2dfa3a5bbb1fa2b5f240ba7ff694b34a52bfc5bed6d4c3b14b763c011d7503ccb3a","01972837ee396f22f96846a0c700f9cf7c8fa83ab4110da91a1c7d02f94f28ff03e45f1470df82"],"blockstakeinputoutputs":null,"blockstakeoutputids":null,"blockstakeunlockhashes":null,"unconfirmed":false}],"multisigaddresses":null,"unconfirmed":false}') c._explorer_get = explorer_client.explorer_get c._explorer_post = explorer_client.explorer_post # the devnet genesis seed is the seed of the wallet, # which receives all block stakes and coins in the genesis block of the tfchain devnet DEVNET_GENESIS_SEED="image orchard airport business cost work mountain obscure flee alpha alert salmon damage engage trumpet route marble subway immune short tide young cycle attract" # create a new devnet wallet w = c.wallets.new("mywallet", seed=DEVNET_GENESIS_SEED) # we create a new wallet using an existing seed, # such that our seed is used and not a new randomly generated seed # a tfchain (JS) wallet uses the underlying tfchain client for all its # interaction with the tfchain network assert w.network_type == "DEV" # getting the balance of a wallet is as easy as getting the 'balance' property balance = w.balance # the available and locked tokens can be easily checked assert balance.available == '3698 TFT' assert balance.locked == 0 # (1) sending coins to a personal wallet on the used tfchain network can be done as follows: result = w.coins_send( recipient="015a080a9259b9d4aaa550e2156f49b1a79a64c7ea463d810d4493e8242e6791584fbdac553e6f", amount="108.24" # the amount of TFT to send ) assert result.submitted # it is expected the transaction is submitted # validate the transaction is as expected expected_transaction = {'version': 1, 'data': {'coininputs': [{'parentid': '19d4e81d057b4c93a7763f3dfe878f6a37d6111a3808b93afff4b369de0f5376', 'fulfillment': {'type': 1, 'data': {'publickey': 'ed25519:64ae81a176302ea9ea47ec673f105da7a25e52bdf0cbb5b63d49fc2c69ed2eaa', 'signature': '781c886bd135ee068c407fc80c639530579e422dc4e006383eb9fa3b25a1091f3d31836b52254a8fb0f4ab031effff9ba5cc77949215e06ac6b7c934bd9d470c'}}}], 'coinoutputs': [{'value': '108240000000', 'condition': {'type': 1, 'data': {'unlockhash': '015a080a9259b9d4aaa550e2156f49b1a79a64c7ea463d810d4493e8242e6791584fbdac553e6f'}}}, {'value': '88760000000', 'condition': {'type': 1, 'data': {'unlockhash': '014ad318772a09de75fb62f084a33188a7f6fb5e7b68c0ed85a5f90fe11246386b7e6fe97a5a6a'}}}], 'minerfees': ['1000000000']}} assert result.transaction.json() == expected_transaction # ensure the transaction is posted and as expected there as well txn = explorer_client.posted_transaction_get(result.transaction.id) assert txn.json() == expected_transaction # (2) sending coins to a personal wallet with a lock and data is possible as well result = w.coins_send( recipient="015a080a9259b9d4aaa550e2156f49b1a79a64c7ea463d810d4493e8242e6791584fbdac553e6f", amount=200, # the amount of TFT to send lock='07/12/2020 14:35', # a lock can be a timestamp, data-time str, duration str, or block height data='maximum 83 bytes can be used as optional data' ) assert result.submitted # it is expected the transaction is submitted # validate the transaction is as expected expected_transaction = {'version': 1, 'data': {'coininputs': [{'parentid': 'b90422bad2dffde79f0a46bd0a41055cf7974b080e115d76f69891ca31d31f11', 'fulfillment': {'type': 1, 'data': {'publickey': 'ed25519:64ae81a176302ea9ea47ec673f105da7a25e52bdf0cbb5b63d49fc2c69ed2eaa', 'signature': '5d628e0ac977bff00e6163b9df86ce60d376bc91f08fd917372a5a6c35dfba4c8663acc88f1c618791e05a179aec9b65077e988b650a23d5c2a343cca3c7d50f'}}}], 'coinoutputs': [{'value': '200000000000', 'condition': {'type': 3, 'data': {'locktime': 1607348100, 'condition': {'type': 1, 'data': {'unlockhash': '015a080a9259b9d4aaa550e2156f49b1a79a64c7ea463d810d4493e8242e6791584fbdac553e6f'}}}}}, {'value': '299000000000', 'condition': {'type': 1, 'data': {'unlockhash': '014ad318772a09de75fb62f084a33188a7f6fb5e7b68c0ed85a5f90fe11246386b7e6fe97a5a6a'}}}], 'minerfees': ['1000000000'], 'arbitrarydata': 'bWF4aW11bSA4MyBieXRlcyBjYW4gYmUgdXNlZCBhcyBvcHRpb25hbCBkYXRh'}} assert result.transaction.json() == expected_transaction # ensure the transaction is posted and as expected there as well txn = explorer_client.posted_transaction_get(result.transaction.id) assert txn.json() == expected_transaction # (3) one can also send to full multi-sig wallet result = w.coins_send( recipient=["015a080a9259b9d4aaa550e2156f49b1a79a64c7ea463d810d4493e8242e6791584fbdac553e6f", "010d22cf70053432d70ea08c6940c9e84c4c89e67ad24c3ff9f0444dd2d03bf77c91b3e02c30a1"], amount="50 TFT", # the amount of TFT to send lock=1550665225, # a lock can be a timestamp, data-time str, duration str, or block height data=b'binary data can be added as well' ) assert result.submitted # it is expected the transaction is submitted # validate the transaction is as expected expected_transaction = {'version': 1, 'data': {'coininputs': [{'parentid': '19d4e81d057b4c93a7763f3dfe878f6a37d6111a3808b93afff4b369de0f5376', 'fulfillment': {'type': 1, 'data': {'publickey': 'ed25519:64ae81a176302ea9ea47ec673f105da7a25e52bdf0cbb5b63d49fc2c69ed2eaa', 'signature': '5d51a67cfd93e1960553c8281a27a047c6b505800efb3106014baf4eea59188c43c993bac4af0a1b789a8054872a07b3137982c584dce42d8477700c4ae77a0a'}}}], 'coinoutputs': [{'value': '50000000000', 'condition': {'type': 3, 'data': {'locktime': 1550665225, 'condition': {'type': 4, 'data': {'minimumsignaturecount': 2, 'unlockhashes': ['015a080a9259b9d4aaa550e2156f49b1a79a64c7ea463d810d4493e8242e6791584fbdac553e6f', '010d22cf70053432d70ea08c6940c9e84c4c89e67ad24c3ff9f0444dd2d03bf77c91b3e02c30a1']}}}}}, {'value': '147000000000', 'condition': {'type': 1, 'data': {'unlockhash': '014ad318772a09de75fb62f084a33188a7f6fb5e7b68c0ed85a5f90fe11246386b7e6fe97a5a6a'}}}], 'minerfees': ['1000000000'], 'arbitrarydata': 'YmluYXJ5IGRhdGEgY2FuIGJlIGFkZGVkIGFzIHdlbGw='}} assert result.transaction.json() == expected_transaction # ensure the transaction is posted and as expected there as well txn = explorer_client.posted_transaction_get(result.transaction.id) assert txn.json() == expected_transaction # (4) one can also send to a x-out-of-n multisig wallet result = w.coins_send( recipient=(1, ["015a080a9259b9d4aaa550e2156f49b1a79a64c7ea463d810d4493e8242e6791584fbdac553e6f", "010d22cf70053432d70ea08c6940c9e84c4c89e67ad24c3ff9f0444dd2d03bf77c91b3e02c30a1"]), amount='300.0', # the amount of TFT to send lock=35000, # a lock can be a timestamp, data-time str, duration str, or block height data=bytearray(b'binary data can be added as well') ) assert result.submitted # it is expected the transaction is submitted # validate the transaction is as expected expected_transaction = {'version': 1, 'data': {'coininputs': [{'parentid': 'b90422bad2dffde79f0a46bd0a41055cf7974b080e115d76f69891ca31d31f11', 'fulfillment': {'type': 1, 'data': {'publickey': 'ed25519:64ae81a176302ea9ea47ec673f105da7a25e52bdf0cbb5b63d49fc2c69ed2eaa', 'signature': '027d44a7d16fa29c0ae9bfdbfbd18bf029864b14c4a0444b6d2e16145175e1df2c446ff77105731a76bbd40e8bc9e36439949e1f8311d997b4bb3273ed2b7e03'}}}], 'coinoutputs': [{'value': '300000000000', 'condition': {'type': 3, 'data': {'locktime': 35000, 'condition': {'type': 4, 'data': {'minimumsignaturecount': 1, 'unlockhashes': ['015a080a9259b9d4aaa550e2156f49b1a79a64c7ea463d810d4493e8242e6791584fbdac553e6f', '010d22cf70053432d70ea08c6940c9e84c4c89e67ad24c3ff9f0444dd2d03bf77c91b3e02c30a1']}}}}}, {'value': '199000000000', 'condition': {'type': 1, 'data': {'unlockhash': '014ad318772a09de75fb62f084a33188a7f6fb5e7b68c0ed85a5f90fe11246386b7e6fe97a5a6a'}}}], 'minerfees': ['1000000000'], 'arbitrarydata': 'YmluYXJ5IGRhdGEgY2FuIGJlIGFkZGVkIGFzIHdlbGw='}} assert result.transaction.json() == expected_transaction # ensure the transaction is posted and as expected there as well txn = explorer_client.posted_transaction_get(result.transaction.id) assert txn.json() == expected_transaction # ensure we have the multi-sig wallet that we think we have mw = w.balance.wallets['039e16ed27b2dfa3a5bbb1fa2b5f240ba7ff694b34a52bfc5bed6d4c3b14b763c011d7503ccb3a'] assert mw.owners == ['01ffd7c884aa869056bfb832d957bb71a0005fee13c19046cebec84b3a5047ee8829eab070374b', '014ad318772a09de75fb62f084a33188a7f6fb5e7b68c0ed85a5f90fe11246386b7e6fe97a5a6a'] assert mw.signature_count == 1 assert mw.available == '42 TFT' assert mw.unconfirmed == '0 TFT' assert mw.locked == '0 TFT' # (5) spending from a multi-sig wallet can be done as follows result = w.coins_send( recipient="015a080a9259b9d4aaa550e2156f49b1a79a64c7ea463d810d4493e8242e6791584fbdac553e6f", amount=20, # the amount of TFT to send lock=None, # a lock can be a timestamp, data-time str, duration str, or block height data='some data', source="039e16ed27b2dfa3a5bbb1fa2b5f240ba7ff694b34a52bfc5bed6d4c3b14b763c011d7503ccb3a", ) assert result.submitted # it is expected the transaction is submitted, as it is a 1-of-2 signature wallet # validate the transaction is as expected expected_transaction = {'version': 1, 'data': {'coininputs': [{'parentid': '29152fe03a2c8782fcbd670579686088c52be83fa3870f5f0788073d97fb5fb2', 'fulfillment': {'type': 3, 'data': {'pairs': [{'publickey': 'ed25519:64ae81a176302ea9ea47ec673f105da7a25e52bdf0cbb5b63d49fc2c69ed2eaa', 'signature': 'c8efb66be71f7b991148bb479620d93dc909ea6982d640f304655969a7f22265134bd46f7e33868bbbe8a4a2451a68c18ae8380b45bb524c46cc76b1bac0780b'}]}}}], 'coinoutputs': [{'value': '20000000000', 'condition': {'type': 1, 'data': {'unlockhash': '015a080a9259b9d4aaa550e2156f49b1a79a64c7ea463d810d4493e8242e6791584fbdac553e6f'}}}, {'value': '21000000000', 'condition': {'type': 4, 'data': {'minimumsignaturecount': 1, 'unlockhashes': ['01ffd7c884aa869056bfb832d957bb71a0005fee13c19046cebec84b3a5047ee8829eab070374b', '014ad318772a09de75fb62f084a33188a7f6fb5e7b68c0ed85a5f90fe11246386b7e6fe97a5a6a']}}}], 'minerfees': ['1000000000'], 'arbitrarydata': 'c29tZSBkYXRh'}} assert result.transaction.json() == expected_transaction # ensure the transaction is posted and as expected there as well txn = explorer_client.posted_transaction_get(result.transaction.id) assert txn.json() == expected_transaction
267.291045
10,198
0.827512
2,304
35,817
12.836372
0.175781
0.006289
0.009129
0.011767
0.632933
0.622823
0.600947
0.572071
0.500423
0.472358
0
0.351095
0.040093
35,817
133
10,199
269.300752
0.509118
0.066672
0
0.35443
0
0.075949
0.885819
0.843053
0
0
0
0
0.291139
1
0.012658
false
0
0.037975
0
0.050633
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
1
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
0a0a00c1ec8cdd17a696e7480bb482b6e7f94549
40
py
Python
Hello.py
Ivl6/MB215Lab1
a4ad7ac7692f1583de83c773fed56998f7f7a0ed
[ "MIT" ]
null
null
null
Hello.py
Ivl6/MB215Lab1
a4ad7ac7692f1583de83c773fed56998f7f7a0ed
[ "MIT" ]
null
null
null
Hello.py
Ivl6/MB215Lab1
a4ad7ac7692f1583de83c773fed56998f7f7a0ed
[ "MIT" ]
null
null
null
print("Hello World from Ian van Loenen")
40
40
0.775
7
40
4.428571
1
0
0
0
0
0
0
0
0
0
0
0
0.125
40
1
40
40
0.885714
0
0
0
0
0
0.756098
0
0
0
0
0
0
1
0
true
0
0
0
0
1
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
6
0a4368b72147642fb1eaa4baf650ef234ca83e73
10,690
py
Python
python/GafferUITest/LinearContainerTest.py
ddesmond/gaffer
4f25df88103b7893df75865ea919fb035f92bac0
[ "BSD-3-Clause" ]
561
2016-10-18T04:30:48.000Z
2022-03-30T06:52:04.000Z
python/GafferUITest/LinearContainerTest.py
ddesmond/gaffer
4f25df88103b7893df75865ea919fb035f92bac0
[ "BSD-3-Clause" ]
1,828
2016-10-14T19:01:46.000Z
2022-03-30T16:07:19.000Z
python/GafferUITest/LinearContainerTest.py
ddesmond/gaffer
4f25df88103b7893df75865ea919fb035f92bac0
[ "BSD-3-Clause" ]
120
2016-10-18T15:19:13.000Z
2021-12-20T16:28:23.000Z
########################################################################## # # Copyright (c) 2011-2012, John Haddon. All rights reserved. # Copyright (c) 2012-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above # copyright notice, this list of conditions and the following # disclaimer. # # * Redistributions in binary form must reproduce the above # copyright notice, this list of conditions and the following # disclaimer in the documentation and/or other materials provided with # the distribution. # # * Neither the name of John Haddon nor the names of # any other contributors to this software may be used to endorse or # promote products derived from this software without specific prior # written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ########################################################################## import unittest import imath import IECore import Gaffer import GafferUI import GafferUITest class LinearContainerTest( GafferUITest.TestCase ) : def testConstruction( self ) : c = GafferUI.LinearContainer() self.assertEqual( c.getName(), "LinearContainer" ) self.assertEqual( c.getOrientation(), GafferUI.LinearContainer.Orientation.X ) self.assertEqual( c.getAlignment(), GafferUI.LinearContainer.Alignment.Centre ) self.assertEqual( c.getSpacing(), 0 ) self.assertEqual( c.getDirection(), GafferUI.LinearContainer.Direction.Increasing ) c = GafferUI.LinearContainer( name="a" ) self.assertEqual( c.getName(), "a" ) self.assertEqual( c.getOrientation(), GafferUI.LinearContainer.Orientation.X ) self.assertEqual( c.getAlignment(), GafferUI.LinearContainer.Alignment.Centre ) self.assertEqual( c.getSpacing(), 0 ) self.assertEqual( c.getDirection(), GafferUI.LinearContainer.Direction.Increasing ) c = GafferUI.LinearContainer( spacing=10 ) self.assertEqual( c.getName(), "LinearContainer" ) self.assertEqual( c.getOrientation(), GafferUI.LinearContainer.Orientation.X ) self.assertEqual( c.getAlignment(), GafferUI.LinearContainer.Alignment.Centre ) self.assertEqual( c.getSpacing(), 10 ) self.assertEqual( c.getDirection(), GafferUI.LinearContainer.Direction.Increasing ) c = GafferUI.LinearContainer( orientation=GafferUI.LinearContainer.Orientation.Y ) self.assertEqual( c.getName(), "LinearContainer" ) self.assertEqual( c.getOrientation(), GafferUI.LinearContainer.Orientation.Y ) self.assertEqual( c.getAlignment(), GafferUI.LinearContainer.Alignment.Centre ) self.assertEqual( c.getSpacing(), 0 ) self.assertEqual( c.getDirection(), GafferUI.LinearContainer.Direction.Increasing ) c = GafferUI.LinearContainer( alignment=GafferUI.LinearContainer.Alignment.Min ) self.assertEqual( c.getName(), "LinearContainer" ) self.assertEqual( c.getOrientation(), GafferUI.LinearContainer.Orientation.X ) self.assertEqual( c.getAlignment(), GafferUI.LinearContainer.Alignment.Min ) self.assertEqual( c.getSpacing(), 0 ) self.assertEqual( c.getDirection(), GafferUI.LinearContainer.Direction.Increasing ) c = GafferUI.LinearContainer( direction=GafferUI.LinearContainer.Direction.Decreasing ) self.assertEqual( c.getName(), "LinearContainer" ) self.assertEqual( c.getOrientation(), GafferUI.LinearContainer.Orientation.X ) self.assertEqual( c.getAlignment(), GafferUI.LinearContainer.Alignment.Centre ) self.assertEqual( c.getSpacing(), 0 ) self.assertEqual( c.getDirection(), GafferUI.LinearContainer.Direction.Decreasing ) self.assertTrue( c.bound().isEmpty() ) def testHorizontalCentred( self ) : twoByFour = GafferUI.SpacerGadget( imath.Box3f( imath.V3f( -1, -2, 0 ), imath.V3f( 1, 2, 0 ) ) ) fourByFour = GafferUI.SpacerGadget( imath.Box3f( imath.V3f( -2, -2, 0 ), imath.V3f( 2, 2, 0 ) ) ) fourByTwo = GafferUI.SpacerGadget( imath.Box3f( imath.V3f( -2, -1, 0 ), imath.V3f( 2, 1, 0 ) ) ) c = GafferUI.LinearContainer() c["c1"] = twoByFour self.assertEqual( c.bound(), imath.Box3f( imath.V3f( -1, -2, 0 ), imath.V3f( 1, 2, 0 ) ) ) self.assertEqual( twoByFour.getTransform(), imath.M44f().translate( imath.V3f( 0 ) ) ) c["c2"] = fourByFour self.assertEqual( c.bound(), imath.Box3f( imath.V3f( -3, -2, 0 ), imath.V3f( 3, 2, 0 ) ) ) self.assertEqual( twoByFour.getTransform(), imath.M44f().translate( imath.V3f( -2, 0, 0 ) ) ) self.assertEqual( fourByFour.getTransform(), imath.M44f().translate( imath.V3f( 1, 0, 0 ) ) ) c["c3"] = fourByTwo self.assertEqual( c.bound(), imath.Box3f( imath.V3f( -5, -2, 0 ), imath.V3f( 5, 2, 0 ) ) ) self.assertEqual( twoByFour.getTransform(), imath.M44f().translate( imath.V3f( -4, 0, 0 ) ) ) self.assertEqual( fourByFour.getTransform(), imath.M44f().translate( imath.V3f( -1, 0, 0 ) ) ) self.assertEqual( fourByTwo.getTransform(), imath.M44f().translate( imath.V3f( 3, 0, 0 ) ) ) def testVerticalMin( self ) : twoByFour = GafferUI.SpacerGadget( imath.Box3f( imath.V3f( -1, -2, 0 ), imath.V3f( 1, 2, 0 ) ) ) fourByFour = GafferUI.SpacerGadget( imath.Box3f( imath.V3f( -2, -2, 0 ), imath.V3f( 2, 2, 0 ) ) ) fourByTwo = GafferUI.SpacerGadget( imath.Box3f( imath.V3f( -2, -1, 0 ), imath.V3f( 2, 1, 0 ) ) ) c = GafferUI.LinearContainer( orientation=GafferUI.LinearContainer.Orientation.Y, alignment=GafferUI.LinearContainer.Alignment.Min) c["c1"] = twoByFour self.assertEqual( c.bound(), imath.Box3f( imath.V3f( -1, -2, 0 ), imath.V3f( 1, 2, 0 ) ) ) self.assertEqual( twoByFour.getTransform(), imath.M44f().translate( imath.V3f( 0 ) ) ) c["c2"] = fourByFour self.assertEqual( c.bound(), imath.Box3f( imath.V3f( -2, -4, 0 ), imath.V3f( 2, 4, 0 ) ) ) self.assertEqual( twoByFour.getTransform(), imath.M44f().translate( imath.V3f( -1, -2, 0 ) ) ) self.assertEqual( fourByFour.getTransform(), imath.M44f().translate( imath.V3f( 0, 2, 0 ) ) ) c["c3"] = fourByTwo self.assertEqual( c.bound(), imath.Box3f( imath.V3f( -2, -5, 0 ), imath.V3f( 2, 5, 0 ) ) ) self.assertEqual( twoByFour.getTransform(), imath.M44f().translate( imath.V3f( -1, -3, 0 ) ) ) self.assertEqual( fourByFour.getTransform(), imath.M44f().translate( imath.V3f( 0, 1, 0 ) ) ) self.assertEqual( fourByTwo.getTransform(), imath.M44f().translate( imath.V3f( 0, 4, 0 ) ) ) def testPadding( self ) : twoByFour = GafferUI.SpacerGadget( imath.Box3f( imath.V3f( -1, -2, 0 ), imath.V3f( 1, 2, 0 ) ) ) c = GafferUI.LinearContainer( orientation=GafferUI.LinearContainer.Orientation.Y ) c.addChild( twoByFour ) self.assertEqual( c.bound(), imath.Box3f( imath.V3f( -1, -2, 0 ), imath.V3f( 1, 2, 0 ) ) ) self.assertEqual( c.getPadding(), imath.Box3f( imath.V3f( 0 ), imath.V3f( 0 ) ) ) c.setPadding( imath.Box3f( imath.V3f( -1, -2, -3 ), imath.V3f( 1, 2, 3 ) ) ) self.assertEqual( c.getPadding(), imath.Box3f( imath.V3f( -1, -2, -3 ), imath.V3f( 1, 2, 3 ) ) ) self.assertEqual( c.bound(), imath.Box3f( imath.V3f( -2, -4, -3 ), imath.V3f( 2, 4, 3 ) ) ) def testDirection( self ) : first = GafferUI.SpacerGadget( imath.Box3f( imath.V3f( -1, -2, 0 ), imath.V3f( 1, 2, 0 ) ) ) second = GafferUI.SpacerGadget( imath.Box3f( imath.V3f( -1, -2, 0 ), imath.V3f( 1, 2, 0 ) ) ) c = GafferUI.LinearContainer( orientation=GafferUI.LinearContainer.Orientation.Y ) c["c1"] = first c["c2"] = second self.assertEqual( c.bound(), imath.Box3f( imath.V3f( -1, -4, 0 ), imath.V3f( 1, 4, 0 ) ) ) self.assertEqual( first.getTransform(), imath.M44f().translate( imath.V3f( 0, -2, 0 ) ) ) self.assertEqual( second.getTransform(), imath.M44f().translate( imath.V3f( 0, 2, 0 ) ) ) c.setDirection( GafferUI.LinearContainer.Direction.Decreasing ) self.assertEqual( c.bound(), imath.Box3f( imath.V3f( -1, -4, 0 ), imath.V3f( 1, 4, 0 ) ) ) self.assertEqual( first.getTransform(), imath.M44f().translate( imath.V3f( 0, 2, 0 ) ) ) self.assertEqual( second.getTransform(), imath.M44f().translate( imath.V3f( 0, -2, 0 ) ) ) def testDirectionAndSpacing( self ) : c = GafferUI.LinearContainer( orientation = GafferUI.LinearContainer.Orientation.Y ) c["g1"] = GafferUI.SpacerGadget( imath.Box3f( imath.V3f( -1, -1, 0 ), imath.V3f( 1, 1, 0 ) ) ) c["g2"] = GafferUI.SpacerGadget( imath.Box3f( imath.V3f( -1, -1, 0 ), imath.V3f( 1, 1, 0 ) ) ) self.assertEqual( c.bound(), imath.Box3f( imath.V3f( -1, -2, 0 ), imath.V3f( 1, 2, 0 ) ) ) c.setSpacing( 2 ) self.assertEqual( c.bound(), imath.Box3f( imath.V3f( -1, -3, 0 ), imath.V3f( 1, 3, 0 ) ) ) c.setDirection( GafferUI.LinearContainer.Direction.Decreasing ) self.assertEqual( c.bound(), imath.Box3f( imath.V3f( -1, -3, 0 ), imath.V3f( 1, 3, 0 ) ) ) def testChildVisibility( self ) : g1 = GafferUI.SpacerGadget( imath.Box3f( imath.V3f( 0 ), imath.V3f( 1, 1, 0 ) ) ) g2 = GafferUI.SpacerGadget( imath.Box3f( imath.V3f( 0 ), imath.V3f( 2, 1, 0 ) ) ) g3 = GafferUI.SpacerGadget( imath.Box3f( imath.V3f( 0 ), imath.V3f( 5, 1, 0 ) ) ) c = GafferUI.LinearContainer( spacing = 1 ) c.addChild( g1 ) self.assertEqual( c.bound(), imath.Box3f( imath.V3f( -0.5, -0.5, 0 ), imath.V3f( 0.5, 0.5, 0 ) ) ) c.addChild( g2 ) self.assertEqual( c.bound(), imath.Box3f( imath.V3f( -2, -0.5, 0 ), imath.V3f( 2, 0.5, 0 ) ) ) g2.setVisible( False ) # should be as if the child didn't exist self.assertEqual( c.bound(), imath.Box3f( imath.V3f( -0.5, -0.5, 0 ), imath.V3f( 0.5, 0.5, 0 ) ) ) g2.setVisible( True ) self.assertEqual( c.bound(), imath.Box3f( imath.V3f( -2, -0.5, 0 ), imath.V3f( 2, 0.5, 0 ) ) ) c.addChild( g3 ) self.assertEqual( c.bound(), imath.Box3f( imath.V3f( -5, -0.5, 0 ), imath.V3f( 5, 0.5, 0 ) ) ) g1.setVisible( False ) self.assertEqual( c.bound(), imath.Box3f( imath.V3f( -4, -0.5, 0 ), imath.V3f( 4, 0.5, 0 ) ) ) if __name__ == "__main__": unittest.main()
49.036697
133
0.677549
1,395
10,690
5.18638
0.146953
0.097305
0.112785
0.089565
0.773324
0.739876
0.734762
0.72094
0.703801
0.662336
0
0.051764
0.154256
10,690
217
134
49.262673
0.748479
0.157905
0
0.465116
0
0
0.011909
0
0
0
0
0
0.527132
1
0.054264
false
0
0.046512
0
0.108527
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
6
6a71da8deeb30e3f524a0b1f7c0ca0f8b6f637e0
82
py
Python
src/wishlist/__init__.py
Zeebrow/wish
9a0efeb70e1646ed12cac03b2419cbeca10e3c1c
[ "MIT" ]
null
null
null
src/wishlist/__init__.py
Zeebrow/wish
9a0efeb70e1646ed12cac03b2419cbeca10e3c1c
[ "MIT" ]
3
2021-09-26T11:33:24.000Z
2021-10-16T01:39:19.000Z
src/wishlist/__init__.py
Zeebrow/wish
9a0efeb70e1646ed12cac03b2419cbeca10e3c1c
[ "MIT" ]
null
null
null
from .wish.wish import Wish from .wish.utils import get_wishes, check_prj_readme
27.333333
53
0.817073
14
82
4.571429
0.642857
0.25
0
0
0
0
0
0
0
0
0
0
0.121951
82
2
54
41
0.888889
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
6a8bff0af77b6a1db5b96a8cf8716ddd504b4f49
24
py
Python
common_utils/cv_viewer/__init__.py
cm107/common_utils
4b911efe9f8cdec16ecb2a983e16f772be05076c
[ "MIT" ]
1
2020-03-08T05:05:58.000Z
2020-03-08T05:05:58.000Z
common_utils/cv_viewer/__init__.py
cm107/common_utils
4b911efe9f8cdec16ecb2a983e16f772be05076c
[ "MIT" ]
1
2021-02-18T13:36:07.000Z
2021-02-18T13:36:07.000Z
streamer/cv_viewer/__init__.py
cm107/streamer
9c8a2bfaeba7c7af9e98f4ad10a2f8d70232ec25
[ "MIT" ]
null
null
null
from .cv_viewer import *
24
24
0.791667
4
24
4.5
1
0
0
0
0
0
0
0
0
0
0
0
0.125
24
1
24
24
0.857143
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
6abe43f5ae1af482cd8d0bd5bfcc53a2edb439a9
185
py
Python
src/genres/admin.py
kostinbrodorg/open-library
bbceb953b2d78d7eb0f2c64b81c6deac13d73531
[ "MIT" ]
null
null
null
src/genres/admin.py
kostinbrodorg/open-library
bbceb953b2d78d7eb0f2c64b81c6deac13d73531
[ "MIT" ]
null
null
null
src/genres/admin.py
kostinbrodorg/open-library
bbceb953b2d78d7eb0f2c64b81c6deac13d73531
[ "MIT" ]
null
null
null
from django.contrib import admin from genres.models import Genres class AdminGenres(admin.ModelAdmin): pass admin.site.register(Genres, AdminGenres) # Register your models here.
18.5
40
0.794595
24
185
6.125
0.625
0
0
0
0
0
0
0
0
0
0
0
0.135135
185
9
41
20.555556
0.91875
0.140541
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.2
0.4
0
0.6
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
1
0
0
6
0a72dcff39d83e6688de6f0b173b4db3499607a9
4,254
py
Python
tests/test_torch.py
globophobe/fracdiff
799ed3d751bd204fad345f654aab907c34a54764
[ "BSD-3-Clause" ]
1
2021-05-30T14:15:04.000Z
2021-05-30T14:15:04.000Z
tests/test_torch.py
globophobe/fracdiff
799ed3d751bd204fad345f654aab907c34a54764
[ "BSD-3-Clause" ]
null
null
null
tests/test_torch.py
globophobe/fracdiff
799ed3d751bd204fad345f654aab907c34a54764
[ "BSD-3-Clause" ]
null
null
null
import numpy as np import pytest import torch from torch.testing import assert_close import fracdiff from fracdiff.torch import Fracdiff from fracdiff.torch import fdiff class TestTorchFracdiff: @pytest.mark.parametrize("d", [0.1, 0.5, 1]) @pytest.mark.parametrize("mode", ["same", "valid"]) def test_torch_fdiff(self, d, mode): torch.manual_seed(42) input = torch.randn(10, 100) if mode == "same": numpy_mode = "full" elif mode == "valid": numpy_mode = "valid" result = fdiff(input, d, mode=mode) expect = torch.from_numpy(fracdiff.fdiff(input, d, mode=numpy_mode)) assert_close(result, expect, check_stride=False) result = Fracdiff(d, mode=mode)(input) expect = torch.from_numpy(fracdiff.fdiff(input, d, mode=numpy_mode)) assert_close(result, expect, check_stride=False) @pytest.mark.parametrize("d", [0.1, 0.5, 1]) @pytest.mark.parametrize("mode", ["same", "valid"]) def test_torch_fdiff_int(self, d, mode): torch.manual_seed(42) input = torch.randint(5, size=(10, 100)) if mode == "same": numpy_mode = "full" elif mode == "valid": numpy_mode = "valid" result = fdiff(input, d, mode=mode) expect = torch.from_numpy(fracdiff.fdiff(np.array(input), d, mode=numpy_mode)) assert_close(result, expect, check_stride=False, check_dtype=False) result = Fracdiff(d, mode=mode)(input) expect = torch.from_numpy(fracdiff.fdiff(np.array(input), d, mode=numpy_mode)) assert_close(result, expect, check_stride=False, check_dtype=False) @pytest.mark.parametrize("d", [0.1, 0.5, 1]) @pytest.mark.parametrize("mode", ["same", "valid"]) def test_torch_prepend_append(self, d, mode): torch.manual_seed(42) input = torch.randn(10, 100) prepend = torch.randn(10, 50) append = torch.randn(10, 50) if mode == "same": numpy_mode = "full" elif mode == "valid": numpy_mode = "valid" expect = torch.from_numpy( fracdiff.fdiff(input, d, mode=numpy_mode, prepend=prepend, append=append) ) result = fdiff(input, d, mode=mode, prepend=prepend, append=append) assert_close(result, expect, check_stride=False) expect = torch.from_numpy( fracdiff.fdiff(input, d, mode=numpy_mode, prepend=prepend, append=append) ) result = Fracdiff(d, mode=mode)(input, prepend=prepend, append=append) assert_close(result, expect, check_stride=False) @pytest.mark.parametrize("d", [0.1, 0.5, 1]) @pytest.mark.parametrize("mode", ["same", "valid"]) def test_torch_prepend_append_dim0(self, d, mode): torch.manual_seed(42) input = torch.randn(10, 100) prepend = 1 append = 2 if mode == "same": numpy_mode = "full" elif mode == "valid": numpy_mode = "valid" expect = torch.from_numpy( fracdiff.fdiff(input, d, mode=numpy_mode, prepend=prepend, append=append) ) result = fdiff(input, d, mode=mode, prepend=prepend, append=append) assert_close(result, expect, check_stride=False, check_dtype=False) expect = torch.from_numpy( fracdiff.fdiff(input, d, mode=numpy_mode, prepend=prepend, append=append) ) result = Fracdiff(d, mode=mode)(input, prepend=prepend, append=append) assert_close(result, expect, check_stride=False, check_dtype=False) def test_repr(self): m = Fracdiff(0.1, dim=-1, window=10, mode="same") result = repr(m) expect = "Fracdiff(0.1, dim=-1, window=10, mode='same')" assert result == expect def test_invalid_n(self): with pytest.raises(ValueError): input = torch.empty(10, 100) _ = fdiff(input, -1) def test_invalid_mode(self): with pytest.raises(ValueError): input = torch.empty(10, 100) _ = fdiff(input, 0.5, mode="invalid") def test_invalid_dim(self): with pytest.raises(ValueError): input = torch.empty(10, 100) _ = fdiff(input, 0.5, dim=0)
35.157025
86
0.61166
547
4,254
4.627057
0.111517
0.03951
0.047412
0.059265
0.890952
0.890952
0.864085
0.864085
0.864085
0.826156
0
0.028752
0.255994
4,254
120
87
35.45
0.770932
0
0
0.670103
0
0
0.043253
0
0
0
0
0
0.103093
1
0.082474
false
0
0.072165
0
0.164948
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
0a99413080e43b08d7b38bd17702ac7f6c0e4be1
32
py
Python
src/ml_helper/__init__.py
bjoern-hempel/pytorch-classification
8a4bd6aef488360b88234b008d1d7308469bc5d8
[ "MIT" ]
null
null
null
src/ml_helper/__init__.py
bjoern-hempel/pytorch-classification
8a4bd6aef488360b88234b008d1d7308469bc5d8
[ "MIT" ]
null
null
null
src/ml_helper/__init__.py
bjoern-hempel/pytorch-classification
8a4bd6aef488360b88234b008d1d7308469bc5d8
[ "MIT" ]
null
null
null
# __init__.py from .ml import *
10.666667
17
0.6875
5
32
3.6
1
0
0
0
0
0
0
0
0
0
0
0
0.1875
32
2
18
16
0.692308
0.34375
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
0ada180d1eb3546a38d78ee5849b411444244242
19,461
py
Python
tests/ignite/contrib/handlers/test_tensorboard_logger.py
sherry0219/ignite
a4617c6d24f5c095de4e99ba82f6e130350fa2a2
[ "BSD-3-Clause" ]
1
2020-09-18T05:16:23.000Z
2020-09-18T05:16:23.000Z
tests/ignite/contrib/handlers/test_tensorboard_logger.py
ANUBHAVNATANI/ignite
e96203f05a5d2da9226169fbab13d56ece675e41
[ "BSD-3-Clause" ]
null
null
null
tests/ignite/contrib/handlers/test_tensorboard_logger.py
ANUBHAVNATANI/ignite
e96203f05a5d2da9226169fbab13d56ece675e41
[ "BSD-3-Clause" ]
null
null
null
import os import tempfile import shutil import math import pytest from mock import MagicMock, call, ANY, Mock import torch from ignite.engine import Engine, Events, State from ignite.contrib.handlers.tensorboard_logger import * @pytest.fixture def dirname(): path = tempfile.mkdtemp() yield path shutil.rmtree(path) def test_optimizer_params_handler_wrong_setup(): with pytest.raises(TypeError): OptimizerParamsHandler(optimizer=None) optimizer = MagicMock(spec=torch.optim.Optimizer) handler = OptimizerParamsHandler(optimizer=optimizer) mock_logger = MagicMock() mock_engine = MagicMock() with pytest.raises(RuntimeError, match="Handler 'OptimizerParamsHandler' works only with TensorboardLogger"): handler(mock_engine, mock_logger, Events.ITERATION_STARTED) def test_optimizer_params(): optimizer = torch.optim.SGD([torch.Tensor(0)], lr=0.01) wrapper = OptimizerParamsHandler(optimizer=optimizer, param_name="lr") mock_logger = MagicMock(spec=TensorboardLogger) mock_logger.writer = MagicMock() mock_engine = MagicMock() mock_engine.state = State() mock_engine.state.iteration = 123 wrapper(mock_engine, mock_logger, Events.ITERATION_STARTED) mock_logger.writer.add_scalar.assert_called_once_with("lr/group_0", 0.01, 123) wrapper = OptimizerParamsHandler(optimizer, param_name="lr", tag="generator") mock_logger = MagicMock(spec=TensorboardLogger) mock_logger.writer = MagicMock() wrapper(mock_engine, mock_logger, Events.ITERATION_STARTED) mock_logger.writer.add_scalar.assert_called_once_with("generator/lr/group_0", 0.01, 123) def test_output_handler_with_wrong_logger_type(): wrapper = OutputHandler("tag", output_transform=lambda x: x) mock_logger = MagicMock() mock_engine = MagicMock() with pytest.raises(RuntimeError, match="Handler 'OutputHandler' works only with TensorboardLogger"): wrapper(mock_engine, mock_logger, Events.ITERATION_STARTED) def test_output_handler_output_transform(dirname): wrapper = OutputHandler("tag", output_transform=lambda x: x) mock_logger = MagicMock(spec=TensorboardLogger) mock_logger.writer = MagicMock() mock_engine = MagicMock() mock_engine.state = State() mock_engine.state.output = 12345 mock_engine.state.iteration = 123 wrapper(mock_engine, mock_logger, Events.ITERATION_STARTED) mock_logger.writer.add_scalar.assert_called_once_with("tag/output", 12345, 123) wrapper = OutputHandler("another_tag", output_transform=lambda x: {"loss": x}) mock_logger = MagicMock(spec=TensorboardLogger) mock_logger.writer = MagicMock() wrapper(mock_engine, mock_logger, Events.ITERATION_STARTED) mock_logger.writer.add_scalar.assert_called_once_with("another_tag/loss", 12345, 123) def test_output_handler_metric_names(dirname): wrapper = OutputHandler("tag", metric_names=["a", "b"]) mock_logger = MagicMock(spec=TensorboardLogger) mock_logger.writer = MagicMock() mock_engine = MagicMock() mock_engine.state = State(metrics={"a": 12.23, "b": 23.45}) mock_engine.state.iteration = 5 wrapper(mock_engine, mock_logger, Events.ITERATION_STARTED) assert mock_logger.writer.add_scalar.call_count == 2 mock_logger.writer.add_scalar.assert_has_calls([ call("tag/a", 12.23, 5), call("tag/b", 23.45, 5), ], any_order=True) wrapper = OutputHandler("tag", metric_names=["a", ]) mock_engine = MagicMock() mock_engine.state = State(metrics={"a": torch.Tensor([0.0, 1.0, 2.0, 3.0])}) mock_engine.state.iteration = 5 mock_logger = MagicMock(spec=TensorboardLogger) mock_logger.writer = MagicMock() wrapper(mock_engine, mock_logger, Events.ITERATION_STARTED) assert mock_logger.writer.add_scalar.call_count == 4 mock_logger.writer.add_scalar.assert_has_calls([ call("tag/a/0", 0.0, 5), call("tag/a/1", 1.0, 5), call("tag/a/2", 2.0, 5), call("tag/a/3", 3.0, 5), ], any_order=True) wrapper = OutputHandler("tag", metric_names=["a", "c"]) mock_engine = MagicMock() mock_engine.state = State(metrics={"a": 55.56, "c": "Some text"}) mock_engine.state.iteration = 7 mock_logger = MagicMock(spec=TensorboardLogger) mock_logger.writer = MagicMock() with pytest.warns(UserWarning): wrapper(mock_engine, mock_logger, Events.ITERATION_STARTED) assert mock_logger.writer.add_scalar.call_count == 1 mock_logger.writer.add_scalar.assert_has_calls([ call("tag/a", 55.56, 7), ], any_order=True) def test_output_handler_both(dirname): wrapper = OutputHandler("tag", metric_names=["a", "b"], output_transform=lambda x: {"loss": x}) mock_logger = MagicMock(spec=TensorboardLogger) mock_logger.writer = MagicMock() mock_engine = MagicMock() mock_engine.state = State(metrics={"a": 12.23, "b": 23.45}) mock_engine.state.epoch = 5 mock_engine.state.output = 12345 wrapper(mock_engine, mock_logger, Events.EPOCH_STARTED) assert mock_logger.writer.add_scalar.call_count == 3 mock_logger.writer.add_scalar.assert_has_calls([ call("tag/a", 12.23, 5), call("tag/b", 23.45, 5), call("tag/loss", 12345, 5) ], any_order=True) def test_output_handler_with_wrong_global_step_transform_output(): def global_step_transform(*args, **kwargs): return 'a' wrapper = OutputHandler("tag", output_transform=lambda x: {"loss": x}, global_step_transform=global_step_transform) mock_logger = MagicMock(spec=TensorboardLogger) mock_logger.writer = MagicMock() mock_engine = MagicMock() mock_engine.state = State() mock_engine.state.epoch = 5 mock_engine.state.output = 12345 with pytest.raises(TypeError, match="global_step must be int"): wrapper(mock_engine, mock_logger, Events.EPOCH_STARTED) def test_output_handler_with_global_step_transform(): def global_step_transform(*args, **kwargs): return 10 wrapper = OutputHandler("tag", output_transform=lambda x: {"loss": x}, global_step_transform=global_step_transform) mock_logger = MagicMock(spec=TensorboardLogger) mock_logger.writer = MagicMock() mock_engine = MagicMock() mock_engine.state = State() mock_engine.state.epoch = 5 mock_engine.state.output = 12345 wrapper(mock_engine, mock_logger, Events.EPOCH_STARTED) assert mock_logger.writer.add_scalar.call_count == 1 mock_logger.writer.add_scalar.assert_has_calls([call("tag/loss", 12345, 10)]) def test_weights_scalar_handler_wrong_setup(): with pytest.raises(TypeError, match="Argument model should be of type torch.nn.Module"): WeightsScalarHandler(None) model = MagicMock(spec=torch.nn.Module) with pytest.raises(TypeError, match="Argument reduction should be callable"): WeightsScalarHandler(model, reduction=123) with pytest.raises(ValueError, match="Output of the reduction function should be a scalar"): WeightsScalarHandler(model, reduction=lambda x: x) wrapper = WeightsScalarHandler(model) mock_logger = MagicMock() mock_engine = MagicMock() with pytest.raises(RuntimeError, match="Handler 'WeightsScalarHandler' works only with TensorboardLogger"): wrapper(mock_engine, mock_logger, Events.ITERATION_STARTED) def test_weights_scalar_handler(dummy_model_factory): model = dummy_model_factory(with_grads=True, with_frozen_layer=False) wrapper = WeightsScalarHandler(model) mock_logger = MagicMock(spec=TensorboardLogger) mock_logger.writer = MagicMock() mock_engine = MagicMock() mock_engine.state = State() mock_engine.state.epoch = 5 wrapper(mock_engine, mock_logger, Events.EPOCH_STARTED) assert mock_logger.writer.add_scalar.call_count == 4 mock_logger.writer.add_scalar.assert_has_calls([ call("weights_norm/fc1/weight", 0.0, 5), call("weights_norm/fc1/bias", 0.0, 5), call("weights_norm/fc2/weight", 12.0, 5), call("weights_norm/fc2/bias", math.sqrt(12.0), 5), ], any_order=True) def test_weights_scalar_handler_frozen_layers(dummy_model_factory): model = dummy_model_factory(with_grads=True, with_frozen_layer=True) wrapper = WeightsScalarHandler(model) mock_logger = MagicMock(spec=TensorboardLogger) mock_logger.writer = MagicMock() mock_engine = MagicMock() mock_engine.state = State() mock_engine.state.epoch = 5 wrapper(mock_engine, mock_logger, Events.EPOCH_STARTED) mock_logger.writer.add_scalar.assert_has_calls([ call("weights_norm/fc2/weight", 12.0, 5), call("weights_norm/fc2/bias", math.sqrt(12.0), 5), ], any_order=True) with pytest.raises(AssertionError): mock_logger.writer.add_scalar.assert_has_calls([ call("weights_norm/fc1/weight", 12.0, 5), call("weights_norm/fc1/bias", math.sqrt(12.0), 5), ], any_order=True) assert mock_logger.writer.add_scalar.call_count == 2 def test_weights_hist_handler_wrong_setup(): with pytest.raises(TypeError, match="Argument model should be of type torch.nn.Module"): WeightsHistHandler(None) model = MagicMock(spec=torch.nn.Module) wrapper = WeightsHistHandler(model) mock_logger = MagicMock() mock_engine = MagicMock() with pytest.raises(RuntimeError, match="Handler 'WeightsHistHandler' works only with TensorboardLogger"): wrapper(mock_engine, mock_logger, Events.ITERATION_STARTED) def test_weights_hist_handler(dummy_model_factory): model = dummy_model_factory(with_grads=True, with_frozen_layer=False) wrapper = WeightsHistHandler(model) mock_logger = MagicMock(spec=TensorboardLogger) mock_logger.writer = MagicMock() mock_engine = MagicMock() mock_engine.state = State() mock_engine.state.epoch = 5 wrapper(mock_engine, mock_logger, Events.EPOCH_STARTED) assert mock_logger.writer.add_histogram.call_count == 4 mock_logger.writer.add_histogram.assert_has_calls([ call(tag="weights/fc1/weight", values=ANY, global_step=5), call(tag="weights/fc1/bias", values=ANY, global_step=5), call(tag="weights/fc2/weight", values=ANY, global_step=5), call(tag="weights/fc2/bias", values=ANY, global_step=5), ], any_order=True) def test_weights_hist_handler_frozen_layers(dummy_model_factory): model = dummy_model_factory(with_grads=True, with_frozen_layer=True) wrapper = WeightsHistHandler(model) mock_logger = MagicMock(spec=TensorboardLogger) mock_logger.writer = MagicMock() mock_engine = MagicMock() mock_engine.state = State() mock_engine.state.epoch = 5 wrapper(mock_engine, mock_logger, Events.EPOCH_STARTED) mock_logger.writer.add_histogram.assert_has_calls([ call(tag="weights/fc2/weight", values=ANY, global_step=5), call(tag="weights/fc2/bias", values=ANY, global_step=5), ], any_order=True) with pytest.raises(AssertionError): mock_logger.writer.add_histogram.assert_has_calls([ call(tag="weights/fc1/weight", values=ANY, global_step=5), call(tag="weights/fc1/bias", values=ANY, global_step=5), ], any_order=True) assert mock_logger.writer.add_histogram.call_count == 2 def test_grads_scalar_handler_wrong_setup(): with pytest.raises(TypeError, match="Argument model should be of type torch.nn.Module"): GradsScalarHandler(None) model = MagicMock(spec=torch.nn.Module) with pytest.raises(TypeError, match="Argument reduction should be callable"): GradsScalarHandler(model, reduction=123) wrapper = GradsScalarHandler(model) mock_logger = MagicMock() mock_engine = MagicMock() with pytest.raises(RuntimeError, match="Handler 'GradsScalarHandler' works only with TensorboardLogger"): wrapper(mock_engine, mock_logger, Events.ITERATION_STARTED) def test_grads_scalar_handler(dummy_model_factory, norm_mock): model = dummy_model_factory(with_grads=True, with_frozen_layer=False) wrapper = GradsScalarHandler(model, reduction=norm_mock) mock_logger = MagicMock(spec=TensorboardLogger) mock_logger.writer = MagicMock() mock_engine = MagicMock() mock_engine.state = State() mock_engine.state.epoch = 5 norm_mock.reset_mock() wrapper(mock_engine, mock_logger, Events.EPOCH_STARTED) mock_logger.writer.add_scalar.assert_has_calls([ call("grads_norm/fc1/weight", ANY, 5), call("grads_norm/fc1/bias", ANY, 5), call("grads_norm/fc2/weight", ANY, 5), call("grads_norm/fc2/bias", ANY, 5), ], any_order=True) assert mock_logger.writer.add_scalar.call_count == 4 assert norm_mock.call_count == 4 def test_grads_scalar_handler_frozen_layers(dummy_model_factory, norm_mock): model = dummy_model_factory(with_grads=True, with_frozen_layer=True) wrapper = GradsScalarHandler(model, reduction=norm_mock) mock_logger = MagicMock(spec=TensorboardLogger) mock_logger.writer = MagicMock() mock_engine = MagicMock() mock_engine.state = State() mock_engine.state.epoch = 5 norm_mock.reset_mock() wrapper(mock_engine, mock_logger, Events.EPOCH_STARTED) mock_logger.writer.add_scalar.assert_has_calls([ call("grads_norm/fc2/weight", ANY, 5), call("grads_norm/fc2/bias", ANY, 5), ], any_order=True) with pytest.raises(AssertionError): mock_logger.writer.add_scalar.assert_has_calls([ call("grads_norm/fc1/weight", ANY, 5), call("grads_norm/fc1/bias", ANY, 5), ], any_order=True) assert mock_logger.writer.add_scalar.call_count == 2 assert norm_mock.call_count == 2 def test_grads_hist_handler_wrong_setup(): with pytest.raises(TypeError, match="Argument model should be of type torch.nn.Module"): GradsHistHandler(None) model = MagicMock(spec=torch.nn.Module) wrapper = GradsHistHandler(model) mock_logger = MagicMock() mock_engine = MagicMock() with pytest.raises(RuntimeError, match="Handler 'GradsHistHandler' works only with TensorboardLogger"): wrapper(mock_engine, mock_logger, Events.ITERATION_STARTED) def test_grads_hist_handler(dummy_model_factory): model = dummy_model_factory(with_grads=True, with_frozen_layer=False) wrapper = GradsHistHandler(model) mock_logger = MagicMock(spec=TensorboardLogger) mock_logger.writer = MagicMock() mock_engine = MagicMock() mock_engine.state = State() mock_engine.state.epoch = 5 wrapper(mock_engine, mock_logger, Events.EPOCH_STARTED) assert mock_logger.writer.add_histogram.call_count == 4 mock_logger.writer.add_histogram.assert_has_calls([ call(tag="grads/fc1/weight", values=ANY, global_step=5), call(tag="grads/fc1/bias", values=ANY, global_step=5), call(tag="grads/fc2/weight", values=ANY, global_step=5), call(tag="grads/fc2/bias", values=ANY, global_step=5), ], any_order=True) def test_grads_hist_frozen_layers(dummy_model_factory): model = dummy_model_factory(with_grads=True, with_frozen_layer=True) wrapper = GradsHistHandler(model) mock_logger = MagicMock(spec=TensorboardLogger) mock_logger.writer = MagicMock() mock_engine = MagicMock() mock_engine.state = State() mock_engine.state.epoch = 5 wrapper(mock_engine, mock_logger, Events.EPOCH_STARTED) assert mock_logger.writer.add_histogram.call_count == 2 mock_logger.writer.add_histogram.assert_has_calls([ call(tag="grads/fc2/weight", values=ANY, global_step=5), call(tag="grads/fc2/bias", values=ANY, global_step=5), ], any_order=True) with pytest.raises(AssertionError): mock_logger.writer.add_histogram.assert_has_calls([ call(tag="grads/fc1/weight", values=ANY, global_step=5), call(tag="grads/fc1/bias", values=ANY, global_step=5), ], any_order=True) def test_integration(dirname): n_epochs = 5 data = list(range(50)) losses = torch.rand(n_epochs * len(data)) losses_iter = iter(losses) def update_fn(engine, batch): return next(losses_iter) trainer = Engine(update_fn) tb_logger = TensorboardLogger(log_dir=dirname) def dummy_handler(engine, logger, event_name): global_step = engine.state.get_event_attrib_value(event_name) logger.writer.add_scalar("test_value", global_step, global_step) tb_logger.attach(trainer, log_handler=dummy_handler, event_name=Events.EPOCH_COMPLETED) trainer.run(data, max_epochs=n_epochs) tb_logger.close() # Check if event files are present written_files = os.listdir(dirname) written_files = [f for f in written_files if "tfevents" in f] assert len(written_files) > 0 def test_integration_as_context_manager(dirname): n_epochs = 5 data = list(range(50)) losses = torch.rand(n_epochs * len(data)) losses_iter = iter(losses) def update_fn(engine, batch): return next(losses_iter) with TensorboardLogger(log_dir=dirname) as tb_logger: trainer = Engine(update_fn) def dummy_handler(engine, logger, event_name): global_step = engine.state.get_event_attrib_value(event_name) logger.writer.add_scalar("test_value", global_step, global_step) tb_logger.attach(trainer, log_handler=dummy_handler, event_name=Events.EPOCH_COMPLETED) trainer.run(data, max_epochs=n_epochs) # Check if event files are present written_files = os.listdir(dirname) written_files = [f for f in written_files if "tfevents" in f] assert len(written_files) > 0 @pytest.fixture def no_site_packages(): import sys tensorboardX_module = sys.modules['tensorboardX'] del sys.modules['tensorboardX'] prev_path = list(sys.path) sys.path = [p for p in sys.path if "site-packages" not in p] yield "no_site_packages" sys.path = prev_path sys.modules['tensorboardX'] = tensorboardX_module def test_no_tensorboardX(dirname, no_site_packages): with pytest.raises(RuntimeError, match=r"This contrib module requires tensorboardX to be installed"): TensorboardLogger(log_dir=dirname) @pytest.fixture def mock_tb_module(): import sys import types module_name = 'tensorboardX' tb_module = types.ModuleType(module_name) prev_tb_module = sys.modules[module_name] sys.modules[module_name] = tb_module yield tb_module sys.modules[module_name] = prev_tb_module def test_init_tb1p6(mock_tb_module): def side_effect_v1p6(*args, **kwargs): if 'logdir' in kwargs: raise TypeError("type object got multiple values for keyword argument 'logdir'") mock_tb_module.SummaryWriter = Mock(name='tensorboardX.SummaryWriter', side_effect=side_effect_v1p6) with pytest.warns(DeprecationWarning, match=r'tensorboardX version < 1.7 will not be supported'): TensorboardLogger(log_dir=None) def test_init_typeerror_exception(mock_tb_module): def side_effect(*args, **kwargs): raise TypeError("a problem") mock_tb_module.SummaryWriter = Mock(name='tensorboardX.SummaryWriter', side_effect=side_effect) with pytest.raises(TypeError, match=r'a problem'): TensorboardLogger(log_dir=None)
33.553448
119
0.718565
2,539
19,461
5.251674
0.087436
0.074996
0.062397
0.048448
0.826909
0.800285
0.779886
0.758587
0.742463
0.722214
0
0.017456
0.172807
19,461
579
120
33.611399
0.810846
0.00334
0
0.696742
0
0
0.096478
0.01846
0
0
0
0
0.105263
1
0.090226
false
0
0.030075
0.010025
0.130326
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
0af400e0090461c6b9311c218b93fe9739354f7e
51,574
py
Python
urbansprawl/osm/overpass.py
welegent2010/urban-sprawl
b26bdf7889fdba1382259be7c14e7e0d8f535cd9
[ "MIT" ]
55
2018-01-12T10:45:41.000Z
2022-01-25T16:07:42.000Z
urbansprawl/osm/overpass.py
welegent2010/urban-sprawl
b26bdf7889fdba1382259be7c14e7e0d8f535cd9
[ "MIT" ]
21
2018-06-08T21:12:53.000Z
2019-03-26T10:29:15.000Z
urbansprawl/osm/overpass.py
welegent2010/urban-sprawl
b26bdf7889fdba1382259be7c14e7e0d8f535cd9
[ "MIT" ]
20
2018-06-11T21:35:38.000Z
2022-03-29T08:39:06.000Z
################################################################################################### # Repository: https://github.com/lgervasoni/urbansprawl # MIT License ################################################################################################### import time import geopandas as gpd from shapely.geometry import Point from shapely.geometry import Polygon from shapely.geometry import MultiPolygon from osmnx import log import logging as lg import osmnx as ox ####################################################################### ### Buildings ####################################################################### def create_buildings_gdf_from_input(date="", polygon=None, place=None, which_result=1, point=None, address=None, distance=None, north=None, south=None, east=None, west=None): """ Retrieve OSM buildings according to input data Queries data for input region (polygon, place, point/address and distance around, or bounding box coordinates) Updates the used polygon/bounding box to determine the region of interest Parameters ---------- date : string query the database at a certain timestamp polygon : shapely Polygon or MultiPolygon geographic shape to fetch the landuse footprints within place : string or dict query string or structured query dict to geocode/download which_result : int result number to retrieve from geocode/download when using query string point : tuple the (lat, lon) central point around which to construct the graph address : string the address to geocode and use as the central point around which to construct the graph distance : int retain only those nodes within this many meters of the center of the graph north : float northern latitude of bounding box south : float southern latitude of bounding box east : float eastern longitude of bounding box west : float western longitude of bounding box Returns ---------- [ geopandas.GeoDataFrame, shapely.Polygon, float, float, float, float ] retrieved buildings, region of interest polygon, and region of interest bounding box """ ########################## ### Osmnx query: Buildings ########################## if (not polygon is None): # Polygon log("Input type: Polygon") # If input geo data frame, extract polygon shape if ( type(polygon) is gpd.GeoDataFrame ): assert( polygon.shape[0] == 1 ) polygon = polygon.geometry[0] df_osm_built = buildings_from_polygon(date, polygon) elif ( all( [point,distance] ) ): # Point + distance log("Input type: Point") df_osm_built = buildings_from_point(date, point, distance=distance) # Get bounding box west, south, east, north = df_osm_built.total_bounds elif ( all( [address,distance] ) ): # Address log("Input type: Address") df_osm_built = buildings_from_address(date, address, distance=distance) # Get bounding box west, south, east, north = df_osm_built.total_bounds elif (place): # Place log("Input type: Place") if (which_result is None): which_result = 1 df_osm_built = buildings_from_place(date, place, which_result=which_result) # Get encompassing polygon poly_gdf = ox.gdf_from_place(place, which_result=which_result) polygon = poly_gdf.geometry[0] elif ( all( [north,south,east,west] ) ): # Bounding box log("Input type: Bounding box") # Create points in specific order p1 = (east,north) p2 = (west,north) p3 = (west,south) p4 = (east,south) polygon = Polygon( [p1,p2,p3,p4] ) df_osm_built = buildings_from_polygon(date, polygon) else: log("Error: Must provide at least one input") return return df_osm_built, polygon, north, south, east, west def osm_bldg_download(date="", polygon=None, north=None, south=None, east=None, west=None, timeout=180, memory=None, max_query_area_size=50*1000*50*1000): """ Download OpenStreetMap building footprint data. Parameters ---------- date : string query the database at a certain timestamp polygon : shapely Polygon or MultiPolygon geographic shape to fetch the building footprints within north : float northern latitude of bounding box south : float southern latitude of bounding box east : float eastern longitude of bounding box west : float western longitude of bounding box timeout : int the timeout interval for requests and to pass to API memory : int server memory allocation size for the query, in bytes. If none, server will use its default allocation size max_query_area_size : float max area for any part of the geometry, in the units the geometry is in: any polygon bigger will get divided up for multiple queries to API (default is 50,000 * 50,000 units (ie, 50km x 50km in area, if units are meters)) Returns ------- list list of response_json dicts """ # check if we're querying by polygon or by bounding box based on which # argument(s) where passed into this function by_poly = polygon is not None by_bbox = not (north is None or south is None or east is None or west is None) if not (by_poly or by_bbox): raise ValueError('You must pass a polygon or north, south, east, and west') response_jsons = [] # pass server memory allocation in bytes for the query to the API # if None, pass nothing so the server will use its default allocation size # otherwise, define the query's maxsize parameter value as whatever the # caller passed in if memory is None: maxsize = '' else: maxsize = '[maxsize:{}]'.format(memory) # define the query to send the API if by_bbox: # turn bbox into a polygon and project to local UTM polygon = Polygon([(west, south), (east, south), (east, north), (west, north)]) geometry_proj, crs_proj = ox.project_geometry(polygon) # subdivide it if it exceeds the max area size (in meters), then project # back to lat-long geometry_proj_consolidated_subdivided = ox.consolidate_subdivide_geometry(geometry_proj, max_query_area_size=max_query_area_size) geometry, _ = ox.project_geometry(geometry_proj_consolidated_subdivided, crs=crs_proj, to_latlong=True) log('Requesting building footprints data within bounding box from API in {:,} request(s)'.format(len(geometry))) start_time = time.time() # loop through each polygon rectangle in the geometry (there will only # be one if original bbox didn't exceed max area size) for poly in geometry: # represent bbox as south,west,north,east and round lat-longs to 8 # decimal places (ie, within 1 mm) so URL strings aren't different # due to float rounding issues (for consistent caching) west, south, east, north = poly.bounds query_template = (date+'[out:json][timeout:{timeout}]{maxsize};((way["building"]({south:.8f},' '{west:.8f},{north:.8f},{east:.8f});(._;>;););(relation["building"]' '({south:.8f},{west:.8f},{north:.8f},{east:.8f});(._;>;);););out;') query_str = query_template.format(north=north, south=south, east=east, west=west, timeout=timeout, maxsize=maxsize) response_json = ox.overpass_request(data={'data':query_str}, timeout=timeout) response_jsons.append(response_json) msg = ('Got all building footprints data within bounding box from ' 'API in {:,} request(s) and {:,.2f} seconds') log(msg.format(len(geometry), time.time()-start_time)) elif by_poly: # project to utm, divide polygon up into sub-polygons if area exceeds a # max size (in meters), project back to lat-long, then get a list of polygon(s) exterior coordinates geometry_proj, crs_proj = ox.project_geometry(polygon) geometry_proj_consolidated_subdivided = ox.consolidate_subdivide_geometry(geometry_proj, max_query_area_size=max_query_area_size) geometry, _ = ox.project_geometry(geometry_proj_consolidated_subdivided, crs=crs_proj, to_latlong=True) polygon_coord_strs = ox.get_polygons_coordinates(geometry) log('Requesting building footprints data within polygon from API in {:,} request(s)'.format(len(polygon_coord_strs))) start_time = time.time() # pass each polygon exterior coordinates in the list to the API, one at # a time for polygon_coord_str in polygon_coord_strs: query_template = (date+'[out:json][timeout:{timeout}]{maxsize};(way' '(poly:"{polygon}")["building"];(._;>;);relation' '(poly:"{polygon}")["building"];(._;>;););out;') query_str = query_template.format(polygon=polygon_coord_str, timeout=timeout, maxsize=maxsize) response_json = ox.overpass_request(data={'data':query_str}, timeout=timeout) response_jsons.append(response_json) msg = ('Got all building footprints data within polygon from API in ' '{:,} request(s) and {:,.2f} seconds') log(msg.format(len(polygon_coord_strs), time.time()-start_time)) return response_jsons def create_buildings_gdf(date="", polygon=None, north=None, south=None, east=None, west=None, retain_invalid=False): """ Get building footprint data from OSM then assemble it into a GeoDataFrame. Parameters ---------- date : string query the database at a certain timestamp polygon : shapely Polygon or MultiPolygon geographic shape to fetch the building footprints within north : float northern latitude of bounding box south : float southern latitude of bounding box east : float eastern longitude of bounding box west : float western longitude of bounding box retain_invalid : bool if False discard any building footprints with an invalid geometry Returns ------- GeoDataFrame """ responses = osm_bldg_download(date, polygon, north, south, east, west) vertices = {} for response in responses: for result in response['elements']: if 'type' in result and result['type']=='node': vertices[result['id']] = {'lat' : result['lat'], 'lon' : result['lon']} buildings = {} for response in responses: for result in response['elements']: if 'type' in result and result['type']=='way': nodes = result['nodes'] try: polygon = Polygon([(vertices[node]['lon'], vertices[node]['lat']) for node in nodes]) except Exception: log('Polygon has invalid geometry: {}'.format(nodes)) building = {'nodes' : nodes, 'geometry' : polygon} if 'tags' in result: for tag in result['tags']: building[tag] = result['tags'][tag] buildings[result['id']] = building gdf = gpd.GeoDataFrame(buildings).T gdf.crs = {'init':'epsg:4326'} if not retain_invalid: # drop all invalid geometries gdf = gdf[gdf['geometry'].is_valid] return gdf def buildings_from_point(date, point, distance, retain_invalid=False): """ Get building footprints within some distance north, south, east, and west of a lat-long point. Parameters ---------- date : string query the database at a certain timestamp point : tuple a lat-long point distance : numeric distance in meters retain_invalid : bool if False discard any building footprints with an invalid geometry Returns ------- GeoDataFrame """ bbox = ox.bbox_from_point(point=point, distance=distance) north, south, east, west = bbox return create_buildings_gdf(date=date, north=north, south=south, east=east, west=west, retain_invalid=retain_invalid) def buildings_from_address(date, address, distance, retain_invalid=False): """ Get building footprints within some distance north, south, east, and west of an address. Parameters ---------- date : string query the database at a certain timestamp address : string the address to geocode to a lat-long point distance : numeric distance in meters retain_invalid : bool if False discard any building footprints with an invalid geometry Returns ------- GeoDataFrame """ # geocode the address string to a (lat, lon) point point = ox.geocode(query=address) # get buildings within distance of this point return buildings_from_point(date, point, distance, retain_invalid=retain_invalid) def buildings_from_polygon(date, polygon, retain_invalid=False): """ Get building footprints within some polygon. Parameters ---------- date : string query the database at a certain timestamp polygon : Polygon retain_invalid : bool if False discard any building footprints with an invalid geometry Returns ------- GeoDataFrame """ return create_buildings_gdf(date=date, polygon=polygon, retain_invalid=retain_invalid) def buildings_from_place(date, place, which_result=1, retain_invalid=False): """ Get building footprints within the boundaries of some place. Parameters ---------- date : string query the database at a certain timestamp place : string the query to geocode to get geojson boundary polygon which_result : int result number to retrieve from geocode/download when using query string retain_invalid : bool if False discard any building footprints with an invalid geometry Returns ------- GeoDataFrame """ city = ox.gdf_from_place(place, which_result=which_result) polygon = city['geometry'].iloc[0] return create_buildings_gdf(date=date, polygon=polygon, retain_invalid=retain_invalid) ####################################################################### ### Street network graph ####################################################################### def retrieve_route_graph(city_ref, date="", polygon=None, north=None, south=None, east=None, west=None, force_crs=None): """ Retrieves street network graph for given `city_ref` Loads the data if stored locally Otherwise, it retrieves the graph from OpenStreetMap using the osmnx package Input polygon or bounding box coordinates determine the region of interest Parameters ---------- city_ref : string name of the city date : string query the database at a certain timestamp polygon : shapely.Polygon polygon shape of input city north : float northern latitude of bounding box south : float southern latitude of bounding box east : float eastern longitude of bounding box west : float western longitude of bounding box force_crs : dict graph will be projected to input crs Returns ---------- networkx.multidigraph projected graph """ try: G = ox.load_graphml(city_ref+'_network.graphml') log( "Found graph for `"+city_ref+"` stored locally" ) except: try: if (not polygon is None): G = graph_from_polygon(polygon, network_type='drive_service', date=date) elif ( all( [north,south,east,west] ) ): G = graph_from_bbox(north, south, east, west, network_type='drive_service', date=date) else: # No inputs log("Need an input to retrieve graph") assert(False) # Set graph name G.graph['name'] = str(city_ref) + '_street_network' if not city_ref is None else 'street_network' # Project graph G = ox.project_graph(G, to_crs=force_crs) # Save street network as GraphML file ox.save_graphml(G, filename=city_ref+'_network.graphml') log( "Graph for `"+city_ref+"` has been retrieved and stored" ) except Exception as e: log( "Osmnx graph could not be retrieved."+str(e), level=lg.ERROR ) return None return G def graph_from_polygon(polygon, network_type='all_private', simplify=True, retain_all=False, truncate_by_edge=False, name='unnamed', timeout=180, memory=None, date="", max_query_area_size=50*1000*50*1000, clean_periphery=True, infrastructure='way["highway"]'): """ Create a networkx graph from OSM data within the spatial boundaries of the passed-in shapely polygon. Parameters ---------- polygon : shapely Polygon or MultiPolygon the shape to get network data within. coordinates should be in units of latitude-longitude degrees. network_type : string what type of street network to get simplify : bool if true, simplify the graph topology retain_all : bool if True, return the entire graph even if it is not connected truncate_by_edge : bool if True retain node if it's outside bbox but at least one of node's neighbors are within bbox name : string the name of the graph timeout : int the timeout interval for requests and to pass to API memory : int server memory allocation size for the query, in bytes. If none, server will use its default allocation size date : string query the database at a certain timestamp max_query_area_size : float max size for any part of the geometry, in square degrees: any polygon bigger will get divided up for multiple queries to API clean_periphery : bool if True (and simplify=True), buffer 0.5km to get a graph larger than requested, then simplify, then truncate it to requested spatial extent infrastructure : string download infrastructure of given type (default is streets (ie, 'way["highway"]') but other infrastructures may be selected like power grids (ie, 'way["power"~"line"]')) Returns ------- networkx multidigraph """ # verify that the geometry is valid and is a shapely Polygon/MultiPolygon # before proceeding if not polygon.is_valid: raise ValueError('Shape does not have a valid geometry') if not isinstance(polygon, (Polygon, MultiPolygon)): raise ValueError('Geometry must be a shapely Polygon or MultiPolygon') if clean_periphery and simplify: # create a new buffered polygon 0.5km around the desired one buffer_dist = 500 polygon_utm, crs_utm = ox.project_geometry(geometry=polygon) polygon_proj_buff = polygon_utm.buffer(buffer_dist) polygon_buffered, _ = ox.project_geometry(geometry=polygon_proj_buff, crs=crs_utm, to_latlong=True) # get the network data from OSM, create the buffered graph, then # truncate it to the buffered polygon response_jsons = osm_net_download(polygon=polygon_buffered, network_type=network_type, timeout=timeout, memory=memory, max_query_area_size=max_query_area_size, infrastructure=infrastructure) G_buffered = ox.create_graph(response_jsons, name=name, retain_all=True, network_type=network_type) G_buffered = ox.truncate_graph_polygon(G_buffered, polygon_buffered, retain_all=True, truncate_by_edge=truncate_by_edge) # simplify the graph topology G_buffered = ox.simplify_graph(G_buffered) # truncate graph by polygon to return the graph within the polygon that # caller wants. don't simplify again - this allows us to retain # intersections along the street that may now only connect 2 street # segments in the network, but in reality also connect to an # intersection just outside the polygon G = ox.truncate_graph_polygon(G_buffered, polygon, retain_all=retain_all, truncate_by_edge=truncate_by_edge) # count how many street segments in buffered graph emanate from each # intersection in un-buffered graph, to retain true counts for each # intersection, even if some of its neighbors are outside the polygon G.graph['streets_per_node'] = ox.count_streets_per_node(G_buffered, nodes=G.nodes()) else: # download a list of API responses for the polygon/multipolygon response_jsons = osm_net_download(polygon=polygon, network_type=network_type, timeout=timeout, memory=memory, max_query_area_size=max_query_area_size, infrastructure=infrastructure) # create the graph from the downloaded data G = ox.create_graph(response_jsons, name=name, retain_all=True, network_type=network_type) # truncate the graph to the extent of the polygon G = ox.truncate_graph_polygon(G, polygon, retain_all=retain_all, truncate_by_edge=truncate_by_edge) # simplify the graph topology as the last step. don't truncate after # simplifying or you may have simplified out to an endpoint beyond the # truncation distance, in which case you will then strip out your entire # edge if simplify: G = ox.simplify_graph(G) log('graph_from_polygon() returning graph with {:,} nodes and {:,} edges'.format(len(list(G.nodes())), len(list(G.edges())))) return G def graph_from_bbox(north, south, east, west, network_type='all_private', simplify=True, retain_all=False, truncate_by_edge=False, name='unnamed', timeout=180, memory=None, date="", max_query_area_size=50*1000*50*1000, clean_periphery=True, infrastructure='way["highway"]'): """ Create a networkx graph from OSM data within some bounding box. Parameters ---------- north : float northern latitude of bounding box south : float southern latitude of bounding box east : float eastern longitude of bounding box west : float western longitude of bounding box network_type : string what type of street network to get simplify : bool if true, simplify the graph topology retain_all : bool if True, return the entire graph even if it is not connected truncate_by_edge : bool if True retain node if it's outside bbox but at least one of node's neighbors are within bbox name : string the name of the graph timeout : int the timeout interval for requests and to pass to API memory : int server memory allocation size for the query, in bytes. If none, server will use its default allocation size date : string query the database at a certain timestamp max_query_area_size : float max size for any part of the geometry, in square degrees: any polygon bigger will get divided up for multiple queries to API clean_periphery : bool if True (and simplify=True), buffer 0.5km to get a graph larger than requested, then simplify, then truncate it to requested spatial extent infrastructure : string download infrastructure of given type (default is streets (ie, 'way["highway"]') but other infrastructures may be selected like power grids (ie, 'way["power"~"line"]')) Returns ------- networkx multidigraph """ if clean_periphery and simplify: # create a new buffered bbox 0.5km around the desired one buffer_dist = 500 polygon = Polygon([(west, north), (west, south), (east, south), (east, north)]) polygon_utm, crs_utm = ox.project_geometry(geometry=polygon) polygon_proj_buff = polygon_utm.buffer(buffer_dist) polygon_buff, _ = ox.project_geometry(geometry=polygon_proj_buff, crs=crs_utm, to_latlong=True) west_buffered, south_buffered, east_buffered, north_buffered = polygon_buff.bounds # get the network data from OSM then create the graph response_jsons = osm_net_download(north=north_buffered, south=south_buffered, east=east_buffered, west=west_buffered, network_type=network_type, timeout=timeout, memory=memory, date=date, max_query_area_size=max_query_area_size, infrastructure=infrastructure) G_buffered = ox.create_graph(response_jsons, name=name, retain_all=retain_all, network_type=network_type) G = ox.truncate_graph_bbox(G_buffered, north, south, east, west, retain_all=True, truncate_by_edge=truncate_by_edge) # simplify the graph topology G_buffered = ox.simplify_graph(G_buffered) # truncate graph by desired bbox to return the graph within the bbox # caller wants G = ox.truncate_graph_bbox(G_buffered, north, south, east, west, retain_all=retain_all, truncate_by_edge=truncate_by_edge) # count how many street segments in buffered graph emanate from each # intersection in un-buffered graph, to retain true counts for each # intersection, even if some of its neighbors are outside the bbox G.graph['streets_per_node'] = ox.count_streets_per_node(G_buffered, nodes=G.nodes()) else: # get the network data from OSM response_jsons = osm_net_download(north=north, south=south, east=east, west=west, network_type=network_type, timeout=timeout, memory=memory, date=date, max_query_area_size=max_query_area_size, infrastructure=infrastructure) # create the graph, then truncate to the bounding box G = ox.create_graph(response_jsons, name=name, retain_all=retain_all, network_type=network_type) G = ox.truncate_graph_bbox(G, north, south, east, west, retain_all=retain_all, truncate_by_edge=truncate_by_edge) # simplify the graph topology as the last step. don't truncate after # simplifying or you may have simplified out to an endpoint # beyond the truncation distance, in which case you will then strip out # your entire edge if simplify: G = ox.simplify_graph(G) log('graph_from_bbox() returning graph with {:,} nodes and {:,} edges'.format(len(list(G.nodes())), len(list(G.edges())))) return G def osm_net_download(polygon=None, north=None, south=None, east=None, west=None, network_type='all_private', timeout=180, memory=None, date="", max_query_area_size=50*1000*50*1000, infrastructure='way["highway"]'): """ Download OSM ways and nodes within some bounding box from the Overpass API. Parameters ---------- polygon : shapely Polygon or MultiPolygon geographic shape to fetch the street network within north : float northern latitude of bounding box south : float southern latitude of bounding box east : float eastern longitude of bounding box west : float western longitude of bounding box network_type : string {'walk', 'bike', 'drive', 'drive_service', 'all', 'all_private'} what type of street network to get timeout : int the timeout interval for requests and to pass to API memory : int server memory allocation size for the query, in bytes. If none, server will use its default allocation size date : string query the database at a certain timestamp max_query_area_size : float max area for any part of the geometry, in the units the geometry is in: any polygon bigger will get divided up for multiple queries to API (default is 50,000 * 50,000 units [ie, 50km x 50km in area, if units are meters]) infrastructure : string download infrastructure of given type. default is streets, ie, 'way["highway"]') but other infrastructures may be selected like power grids, ie, 'way["power"~"line"]' Returns ------- response_jsons : list """ # check if we're querying by polygon or by bounding box based on which # argument(s) where passed into this function by_poly = polygon is not None by_bbox = not (north is None or south is None or east is None or west is None) if not (by_poly or by_bbox): raise ValueError('You must pass a polygon or north, south, east, and west') # create a filter to exclude certain kinds of ways based on the requested # network_type osm_filter = ox.get_osm_filter(network_type) response_jsons = [] # pass server memory allocation in bytes for the query to the API # if None, pass nothing so the server will use its default allocation size # otherwise, define the query's maxsize parameter value as whatever the # caller passed in if memory is None: maxsize = '' else: maxsize = '[maxsize:{}]'.format(memory) # define the query to send the API # specifying way["highway"] means that all ways returned must have a highway # key. the {filters} then remove ways by key/value. the '>' makes it recurse # so we get ways and way nodes. maxsize is in bytes. if by_bbox: # turn bbox into a polygon and project to local UTM polygon = Polygon([(west, south), (east, south), (east, north), (west, north)]) geometry_proj, crs_proj = ox.project_geometry(polygon) # subdivide it if it exceeds the max area size (in meters), then project # back to lat-long geometry_proj_consolidated_subdivided = ox.consolidate_subdivide_geometry(geometry_proj, max_query_area_size=max_query_area_size) geometry, _ = ox.project_geometry(geometry_proj_consolidated_subdivided, crs=crs_proj, to_latlong=True) log('Requesting network data within bounding box from API in {:,} request(s)'.format(len(geometry))) start_time = time.time() # loop through each polygon rectangle in the geometry (there will only # be one if original bbox didn't exceed max area size) for poly in geometry: # represent bbox as south,west,north,east and round lat-longs to 8 # decimal places (ie, within 1 mm) so URL strings aren't different # due to float rounding issues (for consistent caching) west, south, east, north = poly.bounds query_template = date+'[out:json][timeout:{timeout}]{maxsize};({infrastructure}{filters}({south:.8f},{west:.8f},{north:.8f},{east:.8f});>;);out;' query_str = query_template.format(north=north, south=south, east=east, west=west, infrastructure=infrastructure, filters=osm_filter, timeout=timeout, maxsize=maxsize) response_json = ox.overpass_request(data={'data':query_str}, timeout=timeout) response_jsons.append(response_json) log('Got all network data within bounding box from API in {:,} request(s) and {:,.2f} seconds'.format(len(geometry), time.time()-start_time)) elif by_poly: # project to utm, divide polygon up into sub-polygons if area exceeds a # max size (in meters), project back to lat-long, then get a list of # polygon(s) exterior coordinates geometry_proj, crs_proj = ox.project_geometry(polygon) geometry_proj_consolidated_subdivided = ox.consolidate_subdivide_geometry(geometry_proj, max_query_area_size=max_query_area_size) geometry, _ = ox.project_geometry(geometry_proj_consolidated_subdivided, crs=crs_proj, to_latlong=True) polygon_coord_strs = ox.get_polygons_coordinates(geometry) log('Requesting network data within polygon from API in {:,} request(s)'.format(len(polygon_coord_strs))) start_time = time.time() # pass each polygon exterior coordinates in the list to the API, one at # a time for polygon_coord_str in polygon_coord_strs: query_template = date+'[out:json][timeout:{timeout}]{maxsize};({infrastructure}{filters}(poly:"{polygon}");>;);out;' query_str = query_template.format(polygon=polygon_coord_str, infrastructure=infrastructure, filters=osm_filter, timeout=timeout, maxsize=maxsize) response_json = ox.overpass_request(data={'data':query_str}, timeout=timeout) response_jsons.append(response_json) log('Got all network data within polygon from API in {:,} request(s) and {:,.2f} seconds'.format(len(polygon_coord_strs), time.time()-start_time)) return response_jsons ####################################################################### ### Land use ####################################################################### def osm_landuse_download(date="", polygon=None, north=None, south=None, east=None, west=None, timeout=180, memory=None, max_query_area_size=50*1000*50*1000): """ Download OpenStreetMap landuse footprint data. Parameters ---------- date : string query the database at a certain timestamp polygon : shapely Polygon or MultiPolygon geographic shape to fetch the landuse footprints within north : float northern latitude of bounding box south : float southern latitude of bounding box east : float eastern longitude of bounding box west : float western longitude of bounding box timeout : int the timeout interval for requests and to pass to API memory : int server memory allocation size for the query, in bytes. If none, server will use its default allocation size max_query_area_size : float max area for any part of the geometry, in the units the geometry is in: any polygon bigger will get divided up for multiple queries to API (default is 50,000 * 50,000 units (ie, 50km x 50km in area, if units are meters)) Returns ------- list list of response_json dicts """ # check if we're querying by polygon or by bounding box based on which # argument(s) where passed into this function by_poly = polygon is not None by_bbox = not (north is None or south is None or east is None or west is None) if not (by_poly or by_bbox): raise ValueError('You must pass a polygon or north, south, east, and west') response_jsons = [] # pass server memory allocation in bytes for the query to the API # if None, pass nothing so the server will use its default allocation size # otherwise, define the query's maxsize parameter value as whatever the # caller passed in if memory is None: maxsize = '' else: maxsize = '[maxsize:{}]'.format(memory) # define the query to send the API if by_bbox: # turn bbox into a polygon and project to local UTM polygon = Polygon([(west, south), (east, south), (east, north), (west, north)]) geometry_proj, crs_proj = ox.project_geometry(polygon) # subdivide it if it exceeds the max area size (in meters), then project # back to lat-long geometry_proj_consolidated_subdivided = ox.consolidate_subdivide_geometry(geometry_proj, max_query_area_size=max_query_area_size) geometry, _ = ox.project_geometry(geometry_proj_consolidated_subdivided, crs=crs_proj, to_latlong=True) log('Requesting landuse footprints data within bounding box from API in {:,} request(s)'.format(len(geometry))) start_time = time.time() # loop through each polygon rectangle in the geometry (there will only # be one if original bbox didn't exceed max area size) for poly in geometry: # represent bbox as south,west,north,east and round lat-longs to 8 # decimal places (ie, within 1 mm) so URL strings aren't different # due to float rounding issues (for consistent caching) west, south, east, north = poly.bounds query_template = (date+'[out:json][timeout:{timeout}]{maxsize};((way["landuse"]({south:.8f},' '{west:.8f},{north:.8f},{east:.8f});(._;>;););(relation["landuse"]' '({south:.8f},{west:.8f},{north:.8f},{east:.8f});(._;>;);););out;') query_str = query_template.format(north=north, south=south, east=east, west=west, timeout=timeout, maxsize=maxsize) response_json = ox.overpass_request(data={'data':query_str}, timeout=timeout) response_jsons.append(response_json) msg = ('Got all landuse footprints data within bounding box from ' 'API in {:,} request(s) and {:,.2f} seconds') log(msg.format(len(geometry), time.time()-start_time)) elif by_poly: # project to utm, divide polygon up into sub-polygons if area exceeds a # max size (in meters), project back to lat-long, then get a list of polygon(s) exterior coordinates geometry_proj, crs_proj = ox.project_geometry(polygon) geometry_proj_consolidated_subdivided = ox.consolidate_subdivide_geometry(geometry_proj, max_query_area_size=max_query_area_size) geometry, _ = ox.project_geometry(geometry_proj_consolidated_subdivided, crs=crs_proj, to_latlong=True) polygon_coord_strs = ox.get_polygons_coordinates(geometry) log('Requesting landuse footprints data within polygon from API in {:,} request(s)'.format(len(polygon_coord_strs))) start_time = time.time() # pass each polygon exterior coordinates in the list to the API, one at # a time for polygon_coord_str in polygon_coord_strs: query_template = (date+'[out:json][timeout:{timeout}]{maxsize};(way' '(poly:"{polygon}")["landuse"];(._;>;);relation' '(poly:"{polygon}")["landuse"];(._;>;););out;') query_str = query_template.format(polygon=polygon_coord_str, timeout=timeout, maxsize=maxsize) response_json = ox.overpass_request(data={'data':query_str}, timeout=timeout) response_jsons.append(response_json) msg = ('Got all landuse footprints data within polygon from API in ' '{:,} request(s) and {:,.2f} seconds') log(msg.format(len(polygon_coord_strs), time.time()-start_time)) return response_jsons def create_landuse_gdf(date="", polygon=None, north=None, south=None, east=None, west=None, retain_invalid=False): """ Get landuse footprint data from OSM then assemble it into a GeoDataFrame. Parameters ---------- date : string query the database at a certain timestamp polygon : shapely Polygon or MultiPolygon geographic shape to fetch the landuse footprints within north : float northern latitude of bounding box south : float southern latitude of bounding box east : float eastern longitude of bounding box west : float western longitude of bounding box retain_invalid : bool if False discard any landuse footprints with an invalid geometry Returns ------- GeoDataFrame """ responses = osm_landuse_download(date, polygon, north, south, east, west) vertices = {} for response in responses: for result in response['elements']: if 'type' in result and result['type']=='node': vertices[result['id']] = {'lat' : result['lat'], 'lon' : result['lon']} landuses = {} for response in responses: for result in response['elements']: if 'type' in result and result['type']=='way': nodes = result['nodes'] try: polygon = Polygon([(vertices[node]['lon'], vertices[node]['lat']) for node in nodes]) except Exception: log('Polygon has invalid geometry: {}'.format(nodes)) landuse = {'nodes' : nodes, 'geometry' : polygon} if 'tags' in result: for tag in result['tags']: landuse[tag] = result['tags'][tag] landuses[result['id']] = landuse gdf = gpd.GeoDataFrame(landuses).T gdf.crs = {'init':'epsg:4326'} if not retain_invalid: # drop all invalid geometries gdf = gdf[gdf['geometry'].is_valid] return gdf ####################################################################### ### Points of interest ####################################################################### def osm_pois_download(date="", polygon=None, north=None, south=None, east=None, west=None, timeout=180, memory=None, max_query_area_size=50*1000*50*1000): """ Download OpenStreetMap POIs footprint data. Parameters ---------- date : string query the database at a certain timestamp polygon : shapely Polygon or MultiPolygon geographic shape to fetch the POIs footprints within north : float northern latitude of bounding box south : float southern latitude of bounding box east : float eastern longitude of bounding box west : float western longitude of bounding box timeout : int the timeout interval for requests and to pass to API memory : int server memory allocation size for the query, in bytes. If none, server will use its default allocation size max_query_area_size : float max area for any part of the geometry, in the units the geometry is in: any polygon bigger will get divided up for multiple queries to API (default is 50,000 * 50,000 units (ie, 50km x 50km in area, if units are meters)) Returns ------- list list of response_json dicts """ # check if we're querying by polygon or by bounding box based on which # argument(s) where passed into this function by_poly = polygon is not None by_bbox = not (north is None or south is None or east is None or west is None) if not (by_poly or by_bbox): raise ValueError('You must pass a polygon or north, south, east, and west') response_jsons = [] # pass server memory allocation in bytes for the query to the API # if None, pass nothing so the server will use its default allocation size # otherwise, define the query's maxsize parameter value as whatever the # caller passed in if memory is None: maxsize = '' else: maxsize = '[maxsize:{}]'.format(memory) # define the query to send the API if by_bbox: # turn bbox into a polygon and project to local UTM polygon = Polygon([(west, south), (east, south), (east, north), (west, north)]) geometry_proj, crs_proj = ox.project_geometry(polygon) # subdivide it if it exceeds the max area size (in meters), then project # back to lat-long geometry_proj_consolidated_subdivided = ox.consolidate_subdivide_geometry(geometry_proj, max_query_area_size=max_query_area_size) geometry, _ = ox.project_geometry(geometry_proj_consolidated_subdivided, crs=crs_proj, to_latlong=True) log('Requesting POIs footprints data within bounding box from API in {:,} request(s)'.format(len(geometry))) start_time = time.time() # loop through each polygon rectangle in the geometry (there will only # be one if original bbox didn't exceed max area size) for poly in geometry: # represent bbox as south,west,north,east and round lat-longs to 8 # decimal places (ie, within 1 mm) so URL strings aren't different # due to float rounding issues (for consistent caching) west, south, east, north = poly.bounds query_template = (date+'[out:json][timeout:{timeout}]{maxsize};((node["amenity"]({south:.8f},' '{west:.8f},{north:.8f},{east:.8f}););(node["leisure"]({south:.8f},' '{west:.8f},{north:.8f},{east:.8f}););(node["office"]({south:.8f},' '{west:.8f},{north:.8f},{east:.8f}););(node["shop"]({south:.8f},' '{west:.8f},{north:.8f},{east:.8f}););(node["sport"]({south:.8f},' '{west:.8f},{north:.8f},{east:.8f}););(node["building"]({south:.8f},' '{west:.8f},{north:.8f},{east:.8f});););out;') query_str = query_template.format(north=north, south=south, east=east, west=west, timeout=timeout, maxsize=maxsize) response_json = ox.overpass_request(data={'data':query_str}, timeout=timeout) response_jsons.append(response_json) msg = ('Got all POIs footprints data within bounding box from ' 'API in {:,} request(s) and {:,.2f} seconds') log(msg.format(len(geometry), time.time()-start_time)) elif by_poly: # project to utm, divide polygon up into sub-polygons if area exceeds a # max size (in meters), project back to lat-long, then get a list of polygon(s) exterior coordinates geometry_proj, crs_proj = ox.project_geometry(polygon) geometry_proj_consolidated_subdivided = ox.consolidate_subdivide_geometry(geometry_proj, max_query_area_size=max_query_area_size) geometry, _ = ox.project_geometry(geometry_proj_consolidated_subdivided, crs=crs_proj, to_latlong=True) polygon_coord_strs = ox.get_polygons_coordinates(geometry) log('Requesting POIs footprints data within polygon from API in {:,} request(s)'.format(len(polygon_coord_strs))) start_time = time.time() # pass each polygon exterior coordinates in the list to the API, one at # a time for polygon_coord_str in polygon_coord_strs: query_template = (date+'[out:json][timeout:{timeout}]{maxsize};(' '(node["amenity"](poly:"{polygon}"););' '(node["leisure"](poly:"{polygon}"););' '(node["office"](poly:"{polygon}"););' '(node["shop"](poly:"{polygon}"););' '(node["sport"](poly:"{polygon}"););' '(node["building"](poly:"{polygon}");););out;') query_str = query_template.format(polygon=polygon_coord_str, timeout=timeout, maxsize=maxsize) response_json = ox.overpass_request(data={'data':query_str}, timeout=timeout) response_jsons.append(response_json) msg = ('Got all POIs footprints data within polygon from API in ' '{:,} request(s) and {:,.2f} seconds') log(msg.format(len(polygon_coord_strs), time.time()-start_time)) return response_jsons def create_pois_gdf(date="", polygon=None, north=None, south=None, east=None, west=None, retain_invalid=False): """ Get POIs footprint data from OSM then assemble it into a GeoDataFrame. Parameters ---------- date : string query the database at a certain timestamp polygon : shapely Polygon or MultiPolygon geographic shape to fetch the POIs footprints within north : float northern latitude of bounding box south : float southern latitude of bounding box east : float eastern longitude of bounding box west : float western longitude of bounding box retain_invalid : bool if False discard any POIs footprints with an invalid geometry Returns ------- GeoDataFrame """ responses = osm_pois_download(date, polygon, north, south, east, west) vertices = {} for response in responses: for result in response['elements']: if 'type' in result and result['type']=='node': point = Point( result['lon'], result['lat'] ) POI = {'geometry' : point} if 'tags' in result: for tag in result['tags']: POI[tag] = result['tags'][tag] vertices[result['id']] = POI gdf = gpd.GeoDataFrame(vertices).T gdf.crs = {'init':'epsg:4326'} if not retain_invalid: try: # drop all invalid geometries gdf = gdf[gdf['geometry'].is_valid] except: # Empty data frame # Create a one-row data frame with null information (avoid later Spatial-Join crash) if (polygon is not None): # Polygon given point = polygon.centroid else: # Bounding box point = Point( (east+west)/2. , (north+south)/2. ) data = {"geometry":[point], "osm_id":[0]} gdf = gpd.GeoDataFrame(data, crs={'init': 'epsg:4326'}) return gdf ####################################################################### ### OSM Building parts ####################################################################### def osm_bldg_part_download(date="", polygon=None, north=None, south=None, east=None, west=None, timeout=180, memory=None, max_query_area_size=50*1000*50*1000): """ Download OpenStreetMap building parts footprint data. Parameters ---------- date : string query the database at a certain timestamp polygon : shapely Polygon or MultiPolygon geographic shape to fetch the building footprints within north : float northern latitude of bounding box south : float southern latitude of bounding box east : float eastern longitude of bounding box west : float western longitude of bounding box timeout : int the timeout interval for requests and to pass to API memory : int server memory allocation size for the query, in bytes. If none, server will use its default allocation size max_query_area_size : float max area for any part of the geometry, in the units the geometry is in: any polygon bigger will get divided up for multiple queries to API (default is 50,000 * 50,000 units (ie, 50km x 50km in area, if units are meters)) Returns ------- list list of response_json dicts """ # check if we're querying by polygon or by bounding box based on which # argument(s) where passed into this function by_poly = polygon is not None by_bbox = not (north is None or south is None or east is None or west is None) if not (by_poly or by_bbox): raise ValueError('You must pass a polygon or north, south, east, and west') response_jsons = [] # pass server memory allocation in bytes for the query to the API # if None, pass nothing so the server will use its default allocation size # otherwise, define the query's maxsize parameter value as whatever the # caller passed in if memory is None: maxsize = '' else: maxsize = '[maxsize:{}]'.format(memory) # define the query to send the API if by_bbox: # turn bbox into a polygon and project to local UTM polygon = Polygon([(west, south), (east, south), (east, north), (west, north)]) geometry_proj, crs_proj = ox.project_geometry(polygon) # subdivide it if it exceeds the max area size (in meters), then project # back to lat-long geometry_proj_consolidated_subdivided = ox.consolidate_subdivide_geometry(geometry_proj, max_query_area_size=max_query_area_size) geometry, _ = ox.project_geometry(geometry_proj_consolidated_subdivided, crs=crs_proj, to_latlong=True) log('Requesting building part footprints data within bounding box from API in {:,} request(s)'.format(len(geometry))) start_time = time.time() # loop through each polygon rectangle in the geometry (there will only # be one if original bbox didn't exceed max area size) for poly in geometry: # represent bbox as south,west,north,east and round lat-longs to 8 # decimal places (ie, within 1 mm) so URL strings aren't different # due to float rounding issues (for consistent caching) west, south, east, north = poly.bounds query_template = (date+'[out:json][timeout:{timeout}]{maxsize};((way["building:part"]({south:.8f},' '{west:.8f},{north:.8f},{east:.8f});(._;>;););(relation["building:part"]' '({south:.8f},{west:.8f},{north:.8f},{east:.8f});(._;>;);););out;') query_str = query_template.format(north=north, south=south, east=east, west=west, timeout=timeout, maxsize=maxsize) response_json = ox.overpass_request(data={'data':query_str}, timeout=timeout) response_jsons.append(response_json) msg = ('Got all building part footprints data within bounding box from ' 'API in {:,} request(s) and {:,.2f} seconds') log(msg.format(len(geometry), time.time()-start_time)) elif by_poly: # project to utm, divide polygon up into sub-polygons if area exceeds a # max size (in meters), project back to lat-long, then get a list of polygon(s) exterior coordinates geometry_proj, crs_proj = ox.project_geometry(polygon) geometry_proj_consolidated_subdivided = ox.consolidate_subdivide_geometry(geometry_proj, max_query_area_size=max_query_area_size) geometry, _ = ox.project_geometry(geometry_proj_consolidated_subdivided, crs=crs_proj, to_latlong=True) polygon_coord_strs = ox.get_polygons_coordinates(geometry) log('Requesting building part footprints data within polygon from API in {:,} request(s)'.format(len(polygon_coord_strs))) start_time = time.time() # pass each polygon exterior coordinates in the list to the API, one at # a time for polygon_coord_str in polygon_coord_strs: query_template = (date+'[out:json][timeout:{timeout}]{maxsize};(way' '(poly:"{polygon}")["building:part"];(._;>;);relation' '(poly:"{polygon}")["building:part"];(._;>;););out;') query_str = query_template.format(polygon=polygon_coord_str, timeout=timeout, maxsize=maxsize) response_json = ox.overpass_request(data={'data':query_str}, timeout=timeout) response_jsons.append(response_json) msg = ('Got all building part footprints data within polygon from API in ' '{:,} request(s) and {:,.2f} seconds') log(msg.format(len(polygon_coord_strs), time.time()-start_time)) return response_jsons def create_building_parts_gdf(date="", polygon=None, north=None, south=None, east=None, west=None, retain_invalid=False): """ Get building footprint data from OSM then assemble it into a GeoDataFrame. If no building parts are retrieved, a default (null-data) point located at the centroid of the region of interest is created Parameters ---------- date : string query the database at a certain timestamp polygon : shapely Polygon or MultiPolygon geographic shape to fetch the building footprints within north : float northern latitude of bounding box south : float southern latitude of bounding box east : float eastern longitude of bounding box west : float western longitude of bounding box retain_invalid : bool if False discard any building footprints with an invalid geometry Returns ------- GeoDataFrame """ responses = osm_bldg_part_download(date, polygon, north, south, east, west) vertices = {} for response in responses: for result in response['elements']: if 'type' in result and result['type']=='node': vertices[result['id']] = {'lat' : result['lat'], 'lon' : result['lon']} buildings = {} for response in responses: for result in response['elements']: if 'type' in result and result['type']=='way': nodes = result['nodes'] try: polygon = Polygon([(vertices[node]['lon'], vertices[node]['lat']) for node in nodes]) except Exception: log('Polygon has invalid geometry: {}'.format(nodes)) building = {'nodes' : nodes, 'geometry' : polygon} if 'tags' in result: for tag in result['tags']: building[tag] = result['tags'][tag] buildings[result['id']] = building gdf = gpd.GeoDataFrame(buildings).T gdf.crs = {'init':'epsg:4326'} if not retain_invalid: try: # drop all invalid geometries gdf = gdf[gdf['geometry'].is_valid] except: # Empty data frame # Create a one-row data frame with null information (avoid later Spatial-Join crash) if (polygon is not None): # Polygon given point = polygon.centroid else: # Bounding box point = Point( (east+west)/2. , (north+south)/2. ) # Data as records data = {"geometry":[point], "osm_id":[0], "building:part":["yes"], "height":[""]} gdf = gpd.GeoDataFrame(data, crs={'init': 'epsg:4326'}) return gdf
40.229329
174
0.715264
7,380
51,574
4.87981
0.062195
0.023214
0.017327
0.01866
0.873629
0.867687
0.849749
0.838225
0.826285
0.810235
0
0.007161
0.165994
51,574
1,282
175
40.229329
0.830098
0.447377
0
0.644269
0
0.023715
0.19006
0.068895
0
0
0
0
0.003953
1
0.033597
false
0.029644
0.01581
0
0.08498
0.031621
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
0af90170eecb6acfb4a67574662a0f848b6127e6
11,275
py
Python
amgut/test/test_add_sample.py
zoechallacombe/american-gut-web
800f0045b98764b4ecfe5f442a03ca8938769eb5
[ "BSD-3-Clause" ]
null
null
null
amgut/test/test_add_sample.py
zoechallacombe/american-gut-web
800f0045b98764b4ecfe5f442a03ca8938769eb5
[ "BSD-3-Clause" ]
null
null
null
amgut/test/test_add_sample.py
zoechallacombe/american-gut-web
800f0045b98764b4ecfe5f442a03ca8938769eb5
[ "BSD-3-Clause" ]
null
null
null
from unittest import main import datetime from amgut.test.tornado_test_base import TestHandlerBase from amgut.connections import ag_data from tornado import escape from amgut.lib.util import rollback import urllib.parse as parse class TestAddSample(TestHandlerBase): def test_get_not_authed(self): response = self.get( '/authed/add_sample_human/?participant_name=REMOVED-0') self.assertEqual(response.code, 200) # Make sure logged out URL self.assertTrue( response.effective_url.endswith( '/?next=%2Fauthed%2Fadd_sample_human%2F%3F' 'participant_name%3DREMOVED-0')) def test_get_human(self): self.mock_login( ag_data.ut_get_supplied_kit_id( 'd8592c74-9694-2135-e040-8a80115d6401')) response = self.get( '/authed/add_sample_human/?participant_name=REMOVED-0') self.assertEqual(response.code, 200) # Make sure proper name in place self.assertIn( b'<input type="hidden" name="participant_name" ' b'value="REMOVED-0"/>', response.body) # Spot check sample locations self.assertIn(b'Left hand', response.body) self.assertIn(b'Stool', response.body) self.assertIn(b'Ear wax', response.body) # Make sure proper form setup used self.assertIn(b'action="/authed/add_sample_human/"', response.body) def test_get_animal(self): self.mock_login( ag_data.ut_get_supplied_kit_id( 'd8592c74-8710-2135-e040-8a80115d6401')) response = self.get( '/authed/add_sample_animal/?participant_name=REMOVED-0') self.assertEqual(response.code, 200) # Make sure proper name in place self.assertIn( b'<input type="hidden" name="participant_name" ' b'value="REMOVED-0"/>', response.body) # Spot check sample locations self.assertIn(b'Fur', response.body) self.assertIn(b'Ears', response.body) # Make sure proper form setup used self.assertIn(b'action="/authed/add_sample_animal/"', response.body) def test_get_general(self): self.mock_login( ag_data.ut_get_supplied_kit_id( 'd8592c74-9694-2135-e040-8a80115d6401')) response = self.get( '/authed/add_sample_general/?participant_name=environmental') self.assertEqual(response.code, 200) # Make sure proper name in place self.assertIn( b'<input type="hidden" name="participant_name" ' b'value="environmental"/>', response.body) # Spot check sample locations self.assertIn(b'Animal Habitat', response.body) self.assertIn(b'Indoor Surface', response.body) self.assertIn(b'Biofilm', response.body) # Make sure proper form setup used self.assertIn(b'action="/authed/add_sample_general/"', response.body) def test_get_no_participant(self): self.mock_login( ag_data.ut_get_supplied_kit_id( 'd8592c74-9694-2135-e040-8a80115d6401')) response = self.get('/authed/add_sample_general/') self.assertEqual(response.code, 200) self.assertTrue( response.effective_url.endswith('/authed/add_sample_overview/')) response = self.get('/authed/add_sample_human/') self.assertEqual(response.code, 200) self.assertTrue( response.effective_url.endswith('/authed/add_sample_overview/')) response = self.get('/authed/add_sample_animal/') self.assertEqual(response.code, 200) self.assertTrue( response.effective_url.endswith('/authed/add_sample_overview/')) def test_post_not_authed(self): response = self.post('/authed/add_sample_human/', {'participant_name': 'REMOVED-0'}) self.assertEqual(response.code, 403) @rollback def test_post_human(self): ag_login_id = 'd8592c74-9694-2135-e040-8a80115d6401' self.mock_login(ag_data.ut_get_supplied_kit_id(ag_login_id)) # make sure barcode properly removed self.assertIn('000005628', ag_data.getAvailableBarcodes(ag_login_id)) # Run test names = ag_data.ut_get_participant_names_from_ag_login_id(ag_login_id) response = self.post('/authed/add_sample_human/', {'participant_name': names[0], 'barcode': b'000005628', 'sample_site': b'Stool', 'sample_date': '12/13/2014', 'sample_time': '11:12 PM', 'notes': 'TESTING TORNADO LOGGING HUMAN'}) self.assertEqual(response.code, 200) self.assertTrue( response.effective_url.endswith('/authed/portal/')) obs = ag_data.getAGBarcodeDetails('000005628') exp = { 'status': '', 'ag_kit_barcode_id': 'db447092-620e-54d8-e040-8a80115d3637', 'ag_kit_id': 'db447092-6209-54d8-e040-8a80115d3637', 'barcode': '000005628', 'site_sampled': 'Stool', 'environment_sampled': None, 'sample_date': datetime.date(2014, 12, 13), 'sample_time': datetime.time(23, 12), 'notes': 'TESTING TORNADO LOGGING HUMAN', 'overloaded': None, 'withdrawn': None, 'other': None, 'moldy': None, 'refunded': None, 'date_of_last_email': None, } # only look at those fields, that are not subject to scrubbing self.assertEqual({k: obs[k] for k in exp}, exp) def test_post_animal(self): barcode = '000001015' ag_login_id = ag_data.ut_get_ag_login_id_from_barcode(barcode) self.mock_login(ag_data.ut_get_supplied_kit_id(ag_login_id)) # make sure barcode properly removed self.assertIn('000001015', ag_data.getAvailableBarcodes(ag_login_id)) @rollback def test_post_general(self): self.mock_login( ag_data.ut_get_supplied_kit_id( 'd8592c74-9694-2135-e040-8a80115d6401')) # make sure barcode properly removed self.assertIn('000005628', ag_data.getAvailableBarcodes( 'd8592c74-9694-2135-e040-8a80115d6401')) # Run test response = self.post('/authed/add_sample_general/', {'participant_name': 'environmental', 'barcode': '000005628', 'sample_site': 'Biofilm', 'sample_date': '12/11/2014', 'sample_time': '10:12 PM', 'notes': 'TESTING TORNADO LOGGING GENERAL'}) self.assertEqual(response.code, 200) self.assertTrue( response.effective_url.endswith('/authed/portal/')) obs = ag_data.getAGBarcodeDetails('000005628') exp = { 'status': '', 'ag_kit_barcode_id': 'db447092-620e-54d8-e040-8a80115d3637', 'ag_kit_id': 'db447092-6209-54d8-e040-8a80115d3637', 'barcode': '000005628', 'site_sampled': None, 'environment_sampled': 'Biofilm', 'sample_date': datetime.date(2014, 12, 11), 'sample_time': datetime.time(22, 12), 'notes': 'TESTING TORNADO LOGGING GENERAL', 'overloaded': None, 'withdrawn': None, 'other': None, 'moldy': None, 'refunded': None, 'date_of_last_email': None } # only look at those fields, that are not subject to scrubbing self.assertEqual({k: obs[k] for k in exp}, exp) @rollback def test_post_bad_data(self): ag_login_id = 'd8592c74-9694-2135-e040-8a80115d6401' self.mock_login(ag_data.ut_get_supplied_kit_id(ag_login_id)) # Malformed date # make sure barcode properly removed self.assertIn('000005628', ag_data.getAvailableBarcodes(ag_login_id)) # Run test names = ag_data.ut_get_participant_names_from_ag_login_id(ag_login_id) response = self.post('/authed/add_sample_general/', {'participant_name': names[0], 'barcode': '000005628', 'sample_site': 'Biofilm', 'sample_date': '98/98/1998', 'sample_time': '10:12 PM', 'notes': 'TESTING TORNADO LOGGING GENERAL'}) self.assertEqual(response.code, 200) self.assertTrue( response.effective_url.endswith('/authed/add_sample_general/')) # Malformed Time # make sure barcode properly removed self.assertIn('000005628', ag_data.getAvailableBarcodes( ag_login_id)) # Run test response = self.post('/authed/add_sample_general/', {'participant_name': names[0][0], 'barcode': '000005628', 'sample_site': 'Biofilm', 'sample_date': '12/12/2014', 'sample_time': '10:98 PM', 'notes': 'TESTING TORNADO LOGGING GENERAL'}) self.assertEqual(response.code, 200) self.assertTrue( response.effective_url.endswith('/authed/add_sample_general/')) # Missing data # make sure barcode properly removed self.assertIn('000005628', ag_data.getAvailableBarcodes(ag_login_id)) # Run test response = self.post('/authed/add_sample_general/', {'participant_name': names[0][0], 'barcode': '000005628', 'sample_site': 'Biofilm', 'sample_date': '12/12/2014', 'sample_time': '', 'notes': 'TESTING TORNADO LOGGING GENERAL'}) self.assertEqual(response.code, 200) self.assertTrue( response.effective_url.endswith('/authed/add_sample_general/')) # Non-owned barcode barcode = '000001015' ag_login_id = ag_data.ut_get_ag_login_id_from_barcode(barcode) name = \ ag_data.ut_get_participant_names_from_ag_login_id(ag_login_id)[0] response = self.post('/authed/add_sample_general/', {'participant_name': escape.url_escape(name), 'barcode': barcode, 'sample_site': 'Biofilm', 'sample_date': '12/12/2014', 'sample_time': '10:12 PM', 'notes': 'TESTING TORNADO LOGGING GENERAL'}) self.assertEqual(response.code, 200) self.assertTrue( response.effective_url.endswith('/authed/add_sample_general/')) self.assertIn(barcode, ag_data.getAvailableBarcodes(ag_login_id)) if __name__ == '__main__': main()
42.070896
78
0.576053
1,203
11,275
5.166251
0.133832
0.034755
0.057924
0.060821
0.864521
0.81078
0.778922
0.770394
0.756235
0.725986
0
0.080756
0.314678
11,275
267
79
42.228464
0.723567
0.065455
0
0.650943
0
0
0.269293
0.130174
0
0
0
0
0.221698
1
0.04717
false
0
0.033019
0
0.084906
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
7c2679e8531b842b7dc0c5dbba921a2b5ca647bb
226
py
Python
rulm/models/n_gram/__init__.py
IlyaGusev/rulm
4e78a495eba6cd6ea1fea839463c8145ed7051f2
[ "Apache-2.0" ]
null
null
null
rulm/models/n_gram/__init__.py
IlyaGusev/rulm
4e78a495eba6cd6ea1fea839463c8145ed7051f2
[ "Apache-2.0" ]
null
null
null
rulm/models/n_gram/__init__.py
IlyaGusev/rulm
4e78a495eba6cd6ea1fea839463c8145ed7051f2
[ "Apache-2.0" ]
null
null
null
from rulm.models.n_gram.n_gram_container import NGramContainer, DictNGramContainer, TrieNGramContainer from rulm.models.n_gram.predictions_cache import PredictionsCache from rulm.models.n_gram.n_gram import NGramLanguageModel
56.5
102
0.889381
30
226
6.466667
0.466667
0.128866
0.216495
0.231959
0.345361
0.247423
0.247423
0
0
0
0
0
0.061947
226
3
103
75.333333
0.915094
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
7c607de0d4f4dff91534c8049883590e1beb1e44
12,560
py
Python
mqbench/fusion_method.py
PannenetsF/MQBench
4336493ded0bf2bb9f11377e9105b14ec6191c09
[ "Apache-2.0" ]
179
2021-09-22T08:44:51.000Z
2022-03-31T08:09:43.000Z
mqbench/fusion_method.py
PannenetsF/MQBench
4336493ded0bf2bb9f11377e9105b14ec6191c09
[ "Apache-2.0" ]
46
2021-09-29T03:04:30.000Z
2022-03-31T11:53:23.000Z
mqbench/fusion_method.py
PannenetsF/MQBench
4336493ded0bf2bb9f11377e9105b14ec6191c09
[ "Apache-2.0" ]
42
2021-09-24T16:08:26.000Z
2022-03-30T10:21:34.000Z
import torch import torch.nn.intrinsic.qat as nniqat from torch.nn.utils.fusion import fuse_conv_bn_eval, fuse_linear_bn_eval from torch.quantization.fx.utils import _parent_name import mqbench.nn.intrinsic as qnni import mqbench.nn.intrinsic.qat as qnniqat import mqbench.nn.qat as qnnqat from mqbench.utils.registry import register_convert_function from mqbench.fuser_method_mappings import fuse_deconv_bn_eval from mqbench.quantization.default_bias_fake_quant import bias_fake_quantizer @register_convert_function(qnni.LinearBn1d) def convert_qnni_linearbn(model, fused_node): modules = dict(model.named_modules()) fused_module = modules[fused_node.target] fused_linear = fuse_linear_bn_eval(fused_module[0], fused_module[1]) linear_parent_name, linear_name = _parent_name(fused_node.target) setattr(modules[linear_parent_name], linear_name, fused_linear) @register_convert_function(qnniqat.LinearBn1d) def convert_qnniqat_linearbn(model, fused_node): modules = dict(model.named_modules()) fused_module = modules[fused_node.target] # Create a Linear from FusedModule. linear = torch.nn.Linear(fused_module.in_features, fused_module.out_features, fused_module.bias is not None) linear.weight = fused_module.weight if fused_module.bias is not None: linear.bias = fused_module.bias # Merge Linear + BN fused_linear = fuse_linear_bn_eval(linear.eval(), fused_module.bn) # We need nn.qat.linear here to export weight quantize node. linear.qconfig = fused_module.qconfig linear = torch.nn.qat.Linear.from_float(linear) # Attach weight fake quantize params. linear.weight_fake_quant = fused_module.weight_fake_quant linear_parent_name, linear_name = _parent_name(fused_node.target) setattr(modules[linear_parent_name], linear_name, fused_linear) @register_convert_function(qnniqat.ConvFreezebn2d) @register_convert_function(nniqat.ConvBn2d) def convert_nniqat_convbn(model, fused_node): modules = dict(model.named_modules()) fused_module = modules[fused_node.target] # Create a Conv2d from FusedModule. conv = torch.nn.Conv2d(fused_module.in_channels, fused_module.out_channels, fused_module.kernel_size, fused_module.stride, fused_module.padding, fused_module.dilation, fused_module.groups, fused_module.bias is not None, fused_module.padding_mode) conv.weight = fused_module.weight if fused_module.bias is not None: conv.bias = fused_module.bias fused_conv = fuse_conv_bn_eval(conv.eval(), fused_module.bn) # We need nn.qat.conv here to export weight quantize node. fused_conv.qconfig = fused_module.qconfig fused_conv = torch.nn.qat.Conv2d.from_float(fused_conv) # Attach weight fake quantize params. fused_conv.weight_fake_quant = fused_module.weight_fake_quant conv_parent_name, conv_name = _parent_name(fused_node.target) setattr(modules[conv_parent_name], conv_name, fused_conv) @register_convert_function(qnniqat.ConvFreezebnReLU2d) @register_convert_function(nniqat.ConvBnReLU2d) def convert_nniqat_convbnrelu(model, fused_node): convert_nniqat_convbn(model, fused_node) modules = dict(model.named_modules()) fused_module = modules[fused_node.target] # We need to Insert Relu after Merged conv. conv_parent_name, conv_name = _parent_name(fused_node.target) relu_name = 'relu' # Maybe has another name, but we cannot know for now. if not hasattr(modules[conv_parent_name], relu_name): setattr(modules[conv_parent_name], relu_name, torch.nn.ReLU(inplace=True).train(fused_module.training)) # Update modules. modules = dict(model.named_modules()) graph = model.graph nodes = list(model.graph.nodes) with graph.inserting_after(fused_node): relu_node_name = relu_name if conv_parent_name == "" else "{}.{}".format(conv_parent_name, relu_name) assert relu_node_name in modules and isinstance(modules[relu_node_name], torch.nn.ReLU) inserted_node = graph.create_node("call_module", relu_node_name, (fused_node,), {}) for _node in nodes: for i, _arg in enumerate(_node.args): if _arg == fused_node: _tmp = list(_node.args) _tmp[i] = inserted_node _node.args = tuple(_tmp) model.recompile() model.graph.lint() @register_convert_function(qnni.ConvTransposeFreezebn2d) @register_convert_function(qnni.ConvTransposeBn2d) def convert_qnni_deconvbn(model, fused_node): modules = dict(model.named_modules()) fused_module = modules[fused_node.target] fused_module_deconv = fused_module[0] fused_module_bn = fused_module[1] # Create a ConvTranspose2d from FusedModule. deconv = torch.nn.ConvTranspose2d(fused_module_deconv.in_channels, fused_module_deconv.out_channels, fused_module_deconv.kernel_size, stride=fused_module_deconv.stride, padding=fused_module_deconv.padding, output_padding=fused_module_deconv.output_padding, groups=fused_module_deconv.groups, bias=fused_module_deconv.bias is not None, dilation=fused_module_deconv.dilation, padding_mode=fused_module_deconv.padding_mode) deconv.weight = fused_module_deconv.weight if fused_module_deconv.bias is not None: deconv.bias = fused_module_deconv.bias fused_deconv = fuse_deconv_bn_eval(deconv.eval(), fused_module_bn) deconv_parent_name, deconv_name = _parent_name(fused_node.target) setattr(modules[deconv_parent_name], deconv_name, fused_deconv) @register_convert_function(qnniqat.ConvTransposeFreezebn2d) @register_convert_function(qnniqat.ConvTransposeBn2d) def convert_qnniqat_deconvbn(model, fused_node): modules = dict(model.named_modules()) fused_module = modules[fused_node.target] # Create a ConvTranspose2d from FusedModule. deconv = torch.nn.ConvTranspose2d(fused_module.in_channels, fused_module.out_channels, fused_module.kernel_size, stride=fused_module.stride, padding=fused_module.padding, output_padding=fused_module.output_padding, groups=fused_module.groups, bias=fused_module.bias is not None, dilation=fused_module.dilation, padding_mode=fused_module.padding_mode) deconv.weight = fused_module.weight if fused_module.bias is not None: deconv.bias = fused_module.bias fused_deconv = fuse_deconv_bn_eval(deconv.eval(), fused_module.bn) # We need nn.qat.conv here to export weight quantize node. fused_deconv.qconfig = fused_module.qconfig fused_deconv = qnnqat.ConvTranspose2d.from_float(fused_deconv) # Attach weight fake quantize params. fused_deconv.weight_fake_quant = fused_module.weight_fake_quant deconv_parent_name, deconv_name = _parent_name(fused_node.target) setattr(modules[deconv_parent_name], deconv_name, fused_deconv) @register_convert_function(qnni.ConvTransposeFreezebnReLU2d) @register_convert_function(qnni.ConvTransposeBnReLU2d) def convert_qnni_deconvbnrelu(model, fused_node): convert_qnni_deconvbn(model, fused_node) modules = dict(model.named_modules()) fused_module = modules[fused_node.target] deconv_parent_name, deconv_name = _parent_name(fused_node.target) relu_name = 'relu' if not hasattr(modules[deconv_parent_name], relu_name): setattr(modules[deconv_parent_name], relu_name, torch.nn.ReLU(inplace=True).train(fused_module.training)) # Update modules. modules = dict(model.named_modules()) graph = model.graph nodes = list(model.graph.nodes) with graph.inserting_after(fused_node): relu_node_name = relu_name if deconv_parent_name == "" else "{}.{}".format(deconv_parent_name, relu_name) assert relu_node_name in modules and isinstance(modules[relu_node_name], torch.nn.ReLU) inserted_node = graph.create_node("call_module", relu_node_name, (fused_node,), {}) for _node in nodes: for i, _arg in enumerate(_node.args): if _arg == fused_node: _tmp = list(_node.args) _tmp[i] = inserted_node _node.args = tuple(_tmp) model.recompile() model.graph.lint() @register_convert_function(qnniqat.ConvTransposeFreezebnReLU2d) @register_convert_function(qnniqat.ConvTransposeBnReLU2d) def convert_qnniqat_deconvbnrelu(model, fused_node): convert_qnniqat_deconvbn(model, fused_node) modules = dict(model.named_modules()) fused_module = modules[fused_node.target] deconv_parent_name, deconv_name = _parent_name(fused_node.target) relu_name = 'relu' if not hasattr(modules[deconv_parent_name], relu_name): setattr(modules[deconv_parent_name], relu_name, torch.nn.ReLU(inplace=True).train(fused_module.training)) # Update modules. modules = dict(model.named_modules()) graph = model.graph nodes = list(model.graph.nodes) with graph.inserting_after(fused_node): relu_node_name = relu_name if deconv_parent_name == "" else "{}.{}".format(deconv_parent_name, relu_name) assert relu_node_name in modules and isinstance(modules[relu_node_name], torch.nn.ReLU) inserted_node = graph.create_node("call_module", relu_node_name, (fused_node,), {}) for _node in nodes: for i, _arg in enumerate(_node.args): if _arg == fused_node: _tmp = list(_node.args) _tmp[i] = inserted_node _node.args = tuple(_tmp) model.recompile() model.graph.lint() @register_convert_function(qnniqat.ConvBn2d) def convert_qnniqat_convbn(model, fused_node): modules = dict(model.named_modules()) fused_module = modules[fused_node.target] # Create a Conv2d from FusedModule. conv = torch.nn.Conv2d(fused_module.in_channels, fused_module.out_channels, fused_module.kernel_size, fused_module.stride, fused_module.padding, fused_module.dilation, fused_module.groups, fused_module.bias is not None, fused_module.padding_mode) conv.weight = fused_module.weight if fused_module.bias is not None: conv.bias = fused_module.bias fused_conv = fuse_conv_bn_eval(conv.eval(), fused_module.bn) # We need nn.qat.conv here to export weight quantize node. fused_conv.qconfig = fused_module.qconfig fused_conv = qnnqat.Conv2d.from_float(fused_conv) # Attach weight fake quantize params. fused_conv.weight_fake_quant = fused_module.weight_fake_quant if hasattr(fused_module, 'bias_fake_quant'): fused_conv.bias_fake_quant = fused_module.bias_fake_quant else: fused_conv.bias_fake_quant = bias_fake_quantizer() fused_conv.bias_fake_quant.set_quant_type('param') conv_parent_name, conv_name = _parent_name(fused_node.target) setattr(modules[conv_parent_name], conv_name, fused_conv) @register_convert_function(qnniqat.ConvBnReLU2d) def convert_qnniqat_convbnrelu(model, fused_node): convert_qnniqat_convbn(model, fused_node) modules = dict(model.named_modules()) fused_module = modules[fused_node.target] # We need to Insert Relu after Merged conv. conv_parent_name, conv_name = _parent_name(fused_node.target) relu_name = 'relu' # Maybe has another name, but we cannot know for now. if not hasattr(modules[conv_parent_name], relu_name): setattr(modules[conv_parent_name], relu_name, torch.nn.ReLU(inplace=True).train(fused_module.training)) # Update modules. modules = dict(model.named_modules()) graph = model.graph nodes = list(model.graph.nodes) with graph.inserting_after(fused_node): relu_node_name = relu_name if conv_parent_name == "" else "{}.{}".format(conv_parent_name, relu_name) assert relu_node_name in modules and isinstance(modules[relu_node_name], torch.nn.ReLU) inserted_node = graph.create_node("call_module", relu_node_name, (fused_node,), {}) for _node in nodes: for i, _arg in enumerate(_node.args): if _arg == fused_node: _tmp = list(_node.args) _tmp[i] = inserted_node _node.args = tuple(_tmp) model.recompile() model.graph.lint()
50.24
160
0.72285
1,645
12,560
5.179939
0.082675
0.117474
0.035207
0.034503
0.821265
0.756015
0.73536
0.719634
0.70027
0.70027
0
0.003053
0.191561
12,560
250
161
50.24
0.836124
0.066162
0
0.628019
0
0
0.008542
0
0
0
0
0
0.019324
1
0.048309
false
0
0.048309
0
0.096618
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
7c671555ed43095390d33df626672f3e3092f81c
152
py
Python
main.py
dlavery/cam-api
ab4b0f83b5a7bd80778881540b19dfd64f3f0a05
[ "MIT" ]
null
null
null
main.py
dlavery/cam-api
ab4b0f83b5a7bd80778881540b19dfd64f3f0a05
[ "MIT" ]
null
null
null
main.py
dlavery/cam-api
ab4b0f83b5a7bd80778881540b19dfd64f3f0a05
[ "MIT" ]
null
null
null
from app import app from app import mongo from app import runPort import routes if __name__ == '__main__': app.run(port=int(runPort), debug=False)
19
43
0.75
24
152
4.416667
0.583333
0.198113
0.367925
0
0
0
0
0
0
0
0
0
0.164474
152
7
44
21.714286
0.834646
0
0
0
0
0
0.052632
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
7ca2ab48dbfe368b6017e0b3df9d31ba45d032a8
643
py
Python
lib/hachoir/parser/image/__init__.py
0x20Man/Watcher3
4656b42bc5879a3741bb95f534b7c6612a25264d
[ "Apache-2.0" ]
320
2017-03-28T23:33:45.000Z
2022-02-17T08:45:01.000Z
lib/hachoir/parser/image/__init__.py
0x20Man/Watcher3
4656b42bc5879a3741bb95f534b7c6612a25264d
[ "Apache-2.0" ]
300
2017-03-28T19:22:54.000Z
2021-12-01T01:11:55.000Z
lib/hachoir/parser/image/__init__.py
0x20Man/Watcher3
4656b42bc5879a3741bb95f534b7c6612a25264d
[ "Apache-2.0" ]
90
2017-03-29T16:12:43.000Z
2022-03-01T06:23:48.000Z
from hachoir.parser.image.bmp import BmpFile # noqa from hachoir.parser.image.gif import GifFile # noqa from hachoir.parser.image.ico import IcoFile # noqa from hachoir.parser.image.jpeg import JpegFile # noqa from hachoir.parser.image.pcx import PcxFile # noqa from hachoir.parser.image.psd import PsdFile # noqa from hachoir.parser.image.png import PngFile # noqa from hachoir.parser.image.tga import TargaFile # noqa from hachoir.parser.image.tiff import TiffFile # noqa from hachoir.parser.image.wmf import WMF_File # noqa from hachoir.parser.image.xcf import XcfFile # noqa from hachoir.parser.image.cr2 import CR2File # noqa
49.461538
54
0.794712
97
643
5.257732
0.309278
0.258824
0.4
0.517647
0.560784
0
0
0
0
0
0
0.003578
0.130638
643
12
55
53.583333
0.908766
0.091757
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
1
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
1
0
1
0
0
6
7cd91cd2b1fc442475061bf39f25a20dae2bdf47
105
py
Python
app/deploy/__init__.py
spark8103/deploy
7a99c5fcb11a93429814d2a519dca5ea3f99ea3a
[ "MIT" ]
2
2017-11-10T18:06:36.000Z
2018-01-25T13:53:10.000Z
app/deploy/__init__.py
spark8103/deploy
7a99c5fcb11a93429814d2a519dca5ea3f99ea3a
[ "MIT" ]
null
null
null
app/deploy/__init__.py
spark8103/deploy
7a99c5fcb11a93429814d2a519dca5ea3f99ea3a
[ "MIT" ]
null
null
null
# coding: utf-8 from flask import Blueprint deploy = Blueprint('deploy', __name__) from . import views
15
38
0.742857
14
105
5.285714
0.714286
0.405405
0
0
0
0
0
0
0
0
0
0.011364
0.161905
105
6
39
17.5
0.829545
0.12381
0
0
0
0
0.066667
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0.666667
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
1
0
6
7ce02ae620bd9d311c204a136295ffa718aacd22
9,305
py
Python
toolbox/imgCombine.py
neelabh17/MAVI-Face
5dbf105b51a8b90203cd144f2fe671770d38eb81
[ "MIT" ]
6
2020-05-04T08:21:05.000Z
2020-07-03T13:32:56.000Z
toolbox/imgCombine.py
neelabh17/MAVI-Face
5dbf105b51a8b90203cd144f2fe671770d38eb81
[ "MIT" ]
4
2020-04-30T00:57:54.000Z
2020-06-06T09:46:03.000Z
toolbox/imgCombine.py
neelabh17/MAVI-Face
5dbf105b51a8b90203cd144f2fe671770d38eb81
[ "MIT" ]
3
2020-05-04T08:21:10.000Z
2020-07-12T13:36:45.000Z
import os from os.path import join from toolbox.pickleOpers import loadup,save import cv2 import matplotlib.pyplot as plt from improveDataset import * from widerface_evaluate.bbox import bbox_overlaps import pickle from toolbox.makedir import make import numpy as np def getFPbbox(dets,gt=None): ''' mode 0 for exact mode in dets : x1, y1, x2, y2 for pred box mode 1 for relative mode in dets: x1, y1, w, h for gts ''' new_annot=np.array([]).reshape(0,20) faltuAnnot=np.array([-1.0]*16).reshape(1,16) if(dets.shape[0]==0): return dets if(gt.shape[0]==0): return dets gt=gt.astype(float) _gt = gt.copy() _gt[:, 2] = _gt[:, 2] + _gt[:, 0] _gt[:, 3] = _gt[:, 3] + _gt[:, 1] dets=dets.astype(float) print(_gt.shape,dets.shape) over=(bbox_overlaps(dets[:,:4],_gt[:,:4])) maxer=np.max(over,axis=1) newdets=np.array([]).reshape(0,dets.shape[1]) # print(maxer.shape) # print(maxer) print(newdets.shape) for i,b in enumerate(dets): if(maxer[i]<=0.15): newdets=np.concatenate((newdets,b.copy().reshape(1,-1)),axis=0) return newdets def getFNbbox(dets,gt=None): ''' mode 0 for exact mode in dets : x1, y1, x2, y2 for pred box mode 1 for relative mode in dets: x1, y1, w, h for gts ''' if(gt.shape[0]==0): return gt if(dets.shape[0]==0): return gt gt=gt.astype(float) _gt = gt.copy() _gt[:, 2] = _gt[:, 2] + _gt[:, 0] _gt[:, 3] = _gt[:, 3] + _gt[:, 1] dets=dets.astype(float) print(_gt.shape,dets.shape) over=(bbox_overlaps(dets[:,:4],_gt[:,:4])) over=over.T maxer=np.max(over,axis=1) newdets=np.array([]).reshape(0,gt.shape[1]) # print(maxer.shape) # print(maxer) print(newdets.shape) for i,b in enumerate(gt): if(maxer[i]<=0.15): newdets=np.concatenate((newdets,b.copy().reshape(1,-1)),axis=0) return newdets def putbbox(img_raw,dets,mode=0,gt=None): ''' mode 0 for exact mode in dets : x1, y1, x2, y2 for pred box mode 1 for relative mode in dets: x1, y1, w, h for gts ''' for i,b in enumerate(dets): text = "{:.4f}".format(b[4]) b = list(map(int, b)) if(mode==1): if(b[2]*b[3]>=225): cv2.rectangle(img_raw, (b[0], b[1]), (b[2]+b[0], b[3]+b[1]), (0, 255, 0), 2) cx = b[0] cy = b[1] + 12 # cv2.putText(img_raw, text, (cx, cy), # cv2.FONT_HERSHEY_DUPLEX, 0.5, (255, 255, 255)) if(mode==0): if((b[2]-b[0])*(b[3]-b[1])>=225): cv2.rectangle(img_raw, (b[0], b[1]), (b[2], b[3]), (0, 0, 255), 2) return img_raw def test(): a=loadup(join("data","widerface","val","label.pickle")) netBase=getNet("Resnet50_Final") netFTFinal=getNet("new_1xOhem_shuffle_true_scheduler_e2_epoch_22") netFT=getNet("SingleSamplingOhemAdamLRe3_epoch_32") for i,fileName in enumerate(a): c,b=os.path.split(fileName) # if(os.path.isfile("C:\\Users\\neela\Desktop\Chetan\MAVI-Face\data\widerface\\train\extraAnno.pickle")): # presaved=loadup("C:\\Users\\neela\\Desktop\Chetan\MAVI-Face\data\widerface\\train\extraAnno.pickle") # else: # presaved={} print(fileName) print("{}th file".format(i)) tp=join(join("data","widerface","val","images"),c,b) #adding gtboxes font = cv2.FONT_HERSHEY_SIMPLEX # org org = (50, 50) # org2 = (50, 50+c.shape[0]//2) # fontScale fontScale = 1 # Blue color in BGR color = (255, 0, 0) color2 = (0, 0, 255) # Line thickness of 2 px thickness = 2 gtannoimg=putbbox(cv2.imread(tp),a[fileName],mode=1) gtannoimg=cv2.putText(gtannoimg, 'Ground Truth', org, font, fontScale, color, thickness, cv2.LINE_AA) #adding base detsBase=infer(netBase,cv2.imread(tp)) imgBase=putbbox(cv2.imread(tp),detsBase,mode=0,gt=detsBase) imgBase=cv2.putText(imgBase, 'Baseline', org, font, fontScale, color, thickness, cv2.LINE_AA) #adding FT detsFT=infer(netFT,cv2.imread(tp)) imgFT=putbbox(cv2.imread(tp),detsFT,mode=0,gt=detsFT) imgFT=cv2.putText(imgFT, 'Fine Tuned', org, font, fontScale, color, thickness, cv2.LINE_AA) #adding FTfinal detsFTFinal=infer(netFTFinal,cv2.imread(tp)) imgFTFinal=putbbox(cv2.imread(tp),detsFTFinal,mode=0,gt=detsFTFinal) imgFTFinal=cv2.putText(imgFTFinal, 'Fine Tuned FInal', org, font, fontScale, color, thickness, cv2.LINE_AA) aim=np.concatenate((imgFTFinal,imgFT),axis=1) bim=np.concatenate((imgBase,gtannoimg),axis=1) final=np.concatenate((aim,bim),axis=0) folder="test/0.055" make(folder) cv2.imwrite(f"{folder}/{i}.jpg",final) def testex(): # testing excptional cases a=loadup(join("data","widerface","val","label.pickle")) netBase=getNet("Resnet50_Final") netFTFinal=getNet("new_1xOhem_shuffle_true_scheduler_e2_epoch_22") netFT=getNet("SingleSamplingOhemAdamLRe3_epoch_32") for i,fileName in enumerate(a): c,b=os.path.split(fileName) # if(os.path.isfile("C:\\Users\\neela\Desktop\Chetan\MAVI-Face\data\widerface\\train\extraAnno.pickle")): # presaved=loadup("C:\\Users\\neela\\Desktop\Chetan\MAVI-Face\data\widerface\\train\extraAnno.pickle") # else: # presaved={} print(fileName) print("{}th file".format(i)) tp=join(join("data","widerface","val","images"),c,b) #adding gtboxes font = cv2.FONT_HERSHEY_SIMPLEX # org org = (50, 50) # org2 = (50, 50+c.shape[0]//2) # fontScale fontScale = 1 # Blue color in BGR color = (255, 0, 0) color2 = (0, 0, 255) # Line thickness of 2 px currImg=cv2.imread(tp) thickness = 2 gtanno=a[fileName][np.where(np.multiply(a[fileName][:,2],a[fileName][:,3])>=225)[0]] gtannoimg=putbbox(currImg.copy(),gtanno,mode=1) gtannoimg=cv2.putText(gtannoimg, 'Ground Truth', org, font, fontScale, color, thickness, cv2.LINE_AA) #adding base detsBase=infer(netBase,currImg.copy()) detsBaseex=getFNbbox(detsBase,gtanno) if(detsBaseex.shape[0]>0): imgBase=putbbox(currImg.copy(),detsBaseex,mode=1,gt=detsBase) imgBase=cv2.putText(imgBase, 'Baseline', org, font, fontScale, color, thickness, cv2.LINE_AA) folder="test/Baseline/FN" make(folder) print("Writing a file") cv2.imwrite(f"{folder}/{i}.jpg",np.concatenate((imgBase,gtannoimg),axis=1)) detsBaseex=getFPbbox(detsBase,gtanno) if(detsBaseex.shape[0]>0): imgBase=putbbox(currImg.copy(),detsBaseex,mode=0,gt=detsBase) imgBase=cv2.putText(imgBase, 'Baseline', org, font, fontScale, color, thickness, cv2.LINE_AA) folder="test/Baseline/FP" make(folder) print("Writing a file") cv2.imwrite(f"{folder}/{i}.jpg",np.concatenate((imgBase,gtannoimg),axis=1)) #adding FT detsFT=infer(netFT,currImg.copy()) detsFTex=getFNbbox(detsFT,gtanno) if(detsFTex.shape[0]>0): imgFT=putbbox(currImg.copy(),detsFTex,mode=1,gt=detsFT) imgFT=cv2.putText(imgFT, 'FTline', org, font, fontScale, color, thickness, cv2.LINE_AA) folder="test/FTline/FN" make(folder) print("Writing a file") cv2.imwrite(f"{folder}/{i}.jpg",np.concatenate((imgFT,gtannoimg),axis=1)) detsFTex=getFPbbox(detsFT,gtanno) if(detsFTex.shape[0]>0): imgFT=putbbox(currImg.copy(),detsFTex,mode=0,gt=detsFT) imgFT=cv2.putText(imgFT, 'FTline', org, font, fontScale, color, thickness, cv2.LINE_AA) folder="test/FTline/FP" make(folder) print("Writing a file") cv2.imwrite(f"{folder}/{i}.jpg",np.concatenate((imgFT,gtannoimg),axis=1)) #adding FTFinal detsFTFinal=infer(netFTFinal,currImg.copy()) detsFTFinalex=getFNbbox(detsFTFinal,gtanno) if(detsFTFinalex.shape[0]>0): imgFTFinal=putbbox(currImg.copy(),detsFTFinalex,mode=1,gt=detsFTFinal) imgFTFinal=cv2.putText(imgFTFinal, 'FTFinalline', org, font, fontScale, color, thickness, cv2.LINE_AA) folder="test/FTFinalline/FN" make(folder) print("Writing a file") cv2.imwrite(f"{folder}/{i}.jpg",np.concatenate((imgFTFinal,gtannoimg),axis=1)) detsFTFinalex=getFPbbox(detsFTFinal,gtanno) if(detsFTFinalex.shape[0]>0): imgFTFinal=putbbox(currImg.copy(),detsFTFinalex,mode=0,gt=detsFTFinal) imgFTFinal=cv2.putText(imgFTFinal, 'FTFinalline', org, font, fontScale, color, thickness, cv2.LINE_AA) folder="test/FTFinalline/FP" make(folder) print("Writing a file") cv2.imwrite(f"{folder}/{i}.jpg",np.concatenate((imgFTFinal,gtannoimg),axis=1))
38.135246
116
0.592907
1,243
9,305
4.386163
0.151247
0.005503
0.032282
0.04237
0.80099
0.77788
0.750183
0.750183
0.725422
0.716068
0
0.040589
0.248039
9,305
243
117
38.292181
0.738602
0.135841
0
0.583333
0
0
0.091058
0.020123
0
0
0
0
0
1
0.029762
false
0
0.059524
0
0.130952
0.083333
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
7ce4264556871624a4f0316d28dad55de951dbee
8,268
py
Python
tests/emm/services/test_evg_cli_service.py
zamj/evg-module-manager
e6029edce023071847ef2ea25af89c31219f41f6
[ "Apache-2.0" ]
null
null
null
tests/emm/services/test_evg_cli_service.py
zamj/evg-module-manager
e6029edce023071847ef2ea25af89c31219f41f6
[ "Apache-2.0" ]
null
null
null
tests/emm/services/test_evg_cli_service.py
zamj/evg-module-manager
e6029edce023071847ef2ea25af89c31219f41f6
[ "Apache-2.0" ]
null
null
null
"""Unit tests for evg_cli_service.py.""" from pathlib import Path from unittest.mock import MagicMock, patch import pytest import emm.services.evg_cli_service as under_test NAMESPACE = "emm.services.evg_cli_service" def ns(local_path: str) -> str: return f"{NAMESPACE}.{local_path}" @pytest.fixture() def emm_options(): emm_options = MagicMock(evg_project="my-evergreen-project") return emm_options @pytest.fixture() def evg_cli(): evg_cli = MagicMock() return evg_cli @pytest.fixture() def evg_cli_service(emm_options, evg_cli): evg_cli_service = under_test.EvgCliService(emm_options, evg_cli) return evg_cli_service class TestCreatePatch: def test_create_patch_should_fail_on_bad_output(self, evg_cli_service, evg_cli): evg_cli.__getitem__.return_value.return_value = "invalid output" with pytest.raises(ValueError): evg_cli_service.create_patch([]) def test_create_patch_should_return_patch_id_and_build_url(self, evg_cli_service, evg_cli): patch_id = "my_patch_id" build_url = "http://my.build/url.html" evg_cli.__getitem__.return_value.return_value = f""" ID : {patch_id} Created : 2021-10-06 00:28:57.034 +0000 UTC Description : test Build : {build_url} Status : created """ patch_details = evg_cli_service.create_patch([]) assert patch_details.patch_id == patch_id assert patch_details.patch_url == build_url def test_create_patch_should_use_evg_cli_to_create_patch_for_project( self, evg_cli_service, evg_cli, emm_options ): patch_id = "my_patch_id" build_url = "http://my.build/url.html" evg_cli.__getitem__.return_value.return_value = f""" ID : {patch_id} Created : 2021-10-06 00:28:57.034 +0000 UTC Description : test Build : {build_url} Status : created """ evg_cli_service.create_patch([]) evg_cli.__getitem__.assert_called_with( ["patch", "--project", emm_options.evg_project, "--skip_confirm"] ) def test_create_patch_should_include_extra_args(self, evg_cli_service, evg_cli, emm_options): patch_id = "my_patch_id" build_url = "http://my.build/url.html" evg_cli.__getitem__.return_value.return_value = f""" ID : {patch_id} Created : 2021-10-06 00:28:57.034 +0000 UTC Description : test Build : {build_url} Status : created """ extra_args = ["-u", "-d", "hello world"] evg_cli_service.create_patch(extra_args) evg_cli.__getitem__.assert_called_with( [ "patch", "--project", emm_options.evg_project, "--skip_confirm", "-u", "-d", "hello world", ] ) class TestAddModuleToPatch: @patch(ns("local.cwd")) def test_add_modules_should_call_out_to_evg_cli(self, cwd_patch, evg_cli_service, evg_cli): patch_id = "my_patch_id" module = "my module" directory = Path("path/to/module") evg_cli_service.add_module_to_patch(patch_id, module, directory, []) evg_cli.__getitem__.assert_called_with( ["patch-set-module", "--module", module, "--patch", patch_id, "--skip_confirm"] ) cwd_patch.assert_called_with(directory) @patch(ns("local.cwd")) def test_add_modules_should_include_extra_args(self, cwd_patch, evg_cli_service, evg_cli): patch_id = "my_patch_id" module = "my module" directory = Path("path/to/module") extra_args = ["-u", "-d", "hello world", "--large", "--preserve-commits"] evg_cli_service.add_module_to_patch(patch_id, module, directory, extra_args) evg_cli.__getitem__.assert_called_with( [ "patch-set-module", "--module", module, "--patch", patch_id, "--skip_confirm", "--uncommitted", "--large", "--preserve-commits", ] ) cwd_patch.assert_called_with(directory) class TestFinalizePatch: def test_finalize_patch_should_call_out_to_evg_cli(self, evg_cli_service, evg_cli): patch_id = "my_patch_id" evg_cli_service.finalize_patch(patch_id) evg_cli.__getitem__.assert_called_with(["finalize-patch", "--id", patch_id]) class TestCreateCqPatch: def test_create_cq_patch_should_fail_on_bad_output(self, evg_cli_service, evg_cli): evg_cli.__getitem__.return_value.return_value = "invalid output" with pytest.raises(ValueError): evg_cli_service.create_cq_patch([]) def test_create_cq_patch_should_return_patch_id_and_build_url(self, evg_cli_service, evg_cli): patch_id = "my_patch_id" build_url = "http://my.build/url.html" evg_cli.__getitem__.return_value.return_value = f""" ID : {patch_id} Created : 2021-10-06 00:28:57.034 +0000 UTC Description : test Build : {build_url} Status : created """ patch_details = evg_cli_service.create_cq_patch([]) assert patch_details.patch_id == patch_id assert patch_details.patch_url == build_url def test_create_cq_patch_should_use_evg_cli_to_create_patch_for_project( self, evg_cli_service, evg_cli, emm_options ): patch_id = "my_patch_id" build_url = "http://my.build/url.html" evg_cli.__getitem__.return_value.return_value = f""" ID : {patch_id} Created : 2021-10-06 00:28:57.034 +0000 UTC Description : test Build : {build_url} Status : created """ evg_cli_service.create_cq_patch([]) evg_cli.__getitem__.assert_called_with( ["commit-queue", "merge", "--project", emm_options.evg_project, "--pause"] ) def test_create_cq_patch_should_use_use_extra_args_if_present( self, evg_cli_service, evg_cli, emm_options ): patch_id = "my_patch_id" build_url = "http://my.build/url.html" evg_cli.__getitem__.return_value.return_value = f""" ID : {patch_id} Created : 2021-10-06 00:28:57.034 +0000 UTC Description : test Build : {build_url} Status : created """ evg_cli_service.create_cq_patch(["--large"]) evg_cli.__getitem__.assert_called_with( ["commit-queue", "merge", "--project", emm_options.evg_project, "--pause", "--large"] ) class TestAddModuleToCqPatch: @patch(ns("local.cwd")) def test_add_modules_should_call_out_to_evg_cli(self, cwd_patch, evg_cli_service, evg_cli): patch_id = "my_patch_id" module = "my module" directory = Path("path/to/module") evg_cli_service.add_module_to_cq_patch(patch_id, module, directory, []) evg_cli.__getitem__.assert_called_with( ["commit-queue", "set-module", "--module", module, "--id", patch_id, "--skip_confirm"] ) cwd_patch.assert_called_with(directory) @patch(ns("local.cwd")) def test_add_modules_should_use_extra_args_if_present( self, cwd_patch, evg_cli_service, evg_cli ): patch_id = "my_patch_id" module = "my module" directory = Path("path/to/module") evg_cli_service.add_module_to_cq_patch(patch_id, module, directory, ["--large"]) evg_cli.__getitem__.assert_called_with( [ "commit-queue", "set-module", "--module", module, "--id", patch_id, "--skip_confirm", "--large", ] ) cwd_patch.assert_called_with(directory) class TestFinalizeCqPatch: def test_finalize_patch_should_call_out_to_evg_cli(self, evg_cli_service, evg_cli): patch_id = "my_patch_id" evg_cli_service.finalize_cq_patch(patch_id) evg_cli.__getitem__.assert_called_with(["commit-queue", "merge", "--resume", patch_id])
31.92278
98
0.624093
1,038
8,268
4.5
0.103083
0.098908
0.094626
0.047955
0.868122
0.824663
0.79833
0.774352
0.774352
0.747377
0
0.020778
0.26657
8,268
258
99
32.046512
0.749505
0.004112
0
0.605
0
0
0.246597
0.00632
0
0
0
0
0.09
1
0.09
false
0
0.02
0.005
0.16
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
6b318e428c2b86068ecd71cf62d9ae38c4a35379
68
py
Python
utils/time.py
arveduil/network-monitoring
c9478f9f9c9e69aba910217c7d0916c23ab9f99b
[ "BSD-2-Clause" ]
null
null
null
utils/time.py
arveduil/network-monitoring
c9478f9f9c9e69aba910217c7d0916c23ab9f99b
[ "BSD-2-Clause" ]
null
null
null
utils/time.py
arveduil/network-monitoring
c9478f9f9c9e69aba910217c7d0916c23ab9f99b
[ "BSD-2-Clause" ]
null
null
null
import datetime def get_now(): return datetime.datetime.now()
11.333333
34
0.720588
9
68
5.333333
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.176471
68
5
35
13.6
0.857143
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
true
0
0.333333
0.333333
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
1
1
0
0
0
6
6b33293e32093cc298a434a006e4e043e18b9c6d
5,847
py
Python
tests/base/test_builder_control.py
mrb1778/MrBuilder
c11a6ce263d7f53f388794f2794a8fcfb0bb3145
[ "MIT" ]
1
2019-06-15T02:34:16.000Z
2019-06-15T02:34:16.000Z
tests/base/test_builder_control.py
mrb1778/MrBuilder
c11a6ce263d7f53f388794f2794a8fcfb0bb3145
[ "MIT" ]
null
null
null
tests/base/test_builder_control.py
mrb1778/MrBuilder
c11a6ce263d7f53f388794f2794a8fcfb0bb3145
[ "MIT" ]
null
null
null
from base.test_bootstrap import TestBuilderBase class TestBuilderControl: class Base(TestBuilderBase.Base): @classmethod def setUpClass(cls) -> None: super().setUpClass() cls.input_shape = [32, 32, 3] cls.base_params = { "outputSize": 50 } def test_model_build_with_if_keep(self): model_definition = { "name": "testModelTemplateSimple", "properties": {"initialDropoutRate": 0.3, "dropoutRate": 0.4}, "templates": [ {"name": "template1", "type": "Conv2D", "strides": 2} ], "layers": [ {"template": "template1", "size": 64}, {"type": "Conv2D", "size": 64, "strides": 2, "if": True}, {"type": "Conv2D", "size": 64, "strides": 2} ] } self.get_builder().build(model_definition) model_builder = self.get_builder().get(model_definition["name"]) model = model_builder(self.input_shape) self.assertEqual(4, self.get_num_layers(model), "number of layers is not correct") self.assertEqual(self.get_stride(model, 1), model_definition["templates"][0]["strides"], "template field is not correct") self.assertEqual(self.get_type(model, 1), self.get_type(model, 2), "wrong template type") def test_model_build_with_if_remove(self): model_definition = { "name": "testModelTemplateSimple", "properties": {"initialDropoutRate": 0.3, "dropoutRate": 0.4}, "templates": [ {"name": "template1", "type": "Conv2D", "strides": 2} ], "layers": [ {"template": "template1", "size": 64}, {"type": "Conv2D", "size": 64, "strides": 2, "if": False}, {"type": "Conv2D", "size": 64, "strides": 2} ] } self.get_builder().build(model_definition) model_builder = self.get_builder().get(model_definition["name"]) model = model_builder(self.input_shape) self.assertEqual(3, self.get_num_layers(model), "number of layers is not correct") self.assertEqual(self.get_stride(model, 1), model_definition["templates"][0]["strides"], "template field is not correct") self.assertEqual(self.get_type(model, 1), self.get_type(model, 2), "wrong template type") def test_model_build_with_if_with_expression(self): model_definition = { "name": "testModelTemplateSimple", "properties": {"initialDropoutRate": 0.3, "dropoutRate": 0.4, "keep1St": True}, "templates": [ {"name": "template1", "type": "Conv2D", "strides": 20} ], "layers": [ {"template": "template1", "size": 32, "if": "{{keep1St}}"}, {"type": "Conv2D", "size": 16, "strides": 2, "if": "{{2 > 1}}"}, {"type": "Conv2D", "size": 256, "strides": 17, "if": "{{2 < 1}}"}, {"type": "Conv2D", "size": 512, "strides": 30, "if": "{{2 < 1}}"}, {"type": "Conv2D", "size": 128, "strides": 2} ] } self.get_builder().build(model_definition) model_builder = self.get_builder().get(model_definition["name"]) model = model_builder(self.input_shape) self.assertEqual(4, self.get_num_layers(model), "number of layers is not correct") self.assertEqual(self.get_stride(model, 1), model_definition["templates"][0]["strides"], "template field is not correct") self.assertEqual(self.get_type(model, 1), self.get_type(model, 2), "wrong template type") # def test_model_build_with_repeat_count(self): # model_definition = { # "name": "testModelTemplateSimple", # "properties": {"initialDropoutRate": 0.3, "dropoutRate": 0.4}, # "templates": [ # {"name": "template1", "type": "Conv2D", "strides": 2} # ], # "layers": [ # {"template": "template1", "size": 64}, # {"type": "Conv2D", "size": 64, "strides": 2, "repeat": 2, "repeat-count": "i"}, # {"type": "Conv2D", "size": 64, "strides": 2} # ] # } # self.get_builder().build(model_definition) # model_builder = self.get_builder().get(model_definition["name"]) # model = model_builder(self.input_shape) # # self.assertEqual(5, # self.get_num_layers(model), # "number of layers is not correct") # # self.assertEqual(self.get_strides(model, 1)[0], # model_definition["templates"][0]["strides"], # "template field is not correct") # # self.assertEqual(self.get_type(model, 1), # self.get_type(model, 2), # "wrong template type")
43.962406
101
0.455447
506
5,847
5.104743
0.146245
0.065041
0.054201
0.049555
0.859466
0.859466
0.814557
0.814557
0.814557
0.814557
0
0.035335
0.404652
5,847
132
102
44.295455
0.706693
0.191038
0
0.666667
0
0
0.197405
0.014678
0
0
0
0
0.103448
1
0.045977
false
0
0.011494
0
0.08046
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
6b42542b61a2f86a999e8be2665ff6dbf2b6ab62
551
py
Python
rastervision/data/__init__.py
carderne/raster-vision
915fbcd3263d8f2193e65c2cd0eb53e050a47a01
[ "Apache-2.0" ]
4
2019-03-11T12:38:15.000Z
2021-04-06T14:57:52.000Z
rastervision/data/__init__.py
carderne/raster-vision
915fbcd3263d8f2193e65c2cd0eb53e050a47a01
[ "Apache-2.0" ]
null
null
null
rastervision/data/__init__.py
carderne/raster-vision
915fbcd3263d8f2193e65c2cd0eb53e050a47a01
[ "Apache-2.0" ]
1
2021-02-25T18:23:27.000Z
2021-02-25T18:23:27.000Z
# flake8: noqa from rastervision.data.activate_mixin import * from rastervision.data.raster_transformer import * from rastervision.data.raster_source import * from rastervision.data.crs_transformer import * from rastervision.data.label import * from rastervision.data.vector_source import * from rastervision.data.label_source import * from rastervision.data.label_store import * from rastervision.data.scene import * from rastervision.data.scene_config import * from rastervision.data.dataset import * from rastervision.data.dataset_config import *
36.733333
50
0.836661
71
551
6.366197
0.253521
0.424779
0.530973
0.632743
0.776549
0.163717
0
0
0
0
0
0.002004
0.094374
551
14
51
39.357143
0.903808
0.021779
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
1
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
1
0
1
0
0
6
86506c402e88f284db3a0370891b2ba93e2c0e96
255
py
Python
photomosaic/__init__.py
rjvanvoorhis/mosaicfy
df74bc11d256a51cdf3e1d5af17562648b8d02be
[ "MIT" ]
null
null
null
photomosaic/__init__.py
rjvanvoorhis/mosaicfy
df74bc11d256a51cdf3e1d5af17562648b8d02be
[ "MIT" ]
null
null
null
photomosaic/__init__.py
rjvanvoorhis/mosaicfy
df74bc11d256a51cdf3e1d5af17562648b8d02be
[ "MIT" ]
null
null
null
from photomosaic.version_info import * from photomosaic.api import * from photomosaic import gif_splitter from photomosaic import image_splitter from photomosaic import mosaic_maker from photomosaic import tile_processor from photomosaic import utilities
31.875
38
0.87451
33
255
6.606061
0.424242
0.481651
0.481651
0.266055
0
0
0
0
0
0
0
0
0.109804
255
7
39
36.428571
0.960352
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
1
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
1
0
1
0
0
0
0
6
86682c96f99167b830de020f4c0fbf1308e89ced
38,080
py
Python
instances/passenger_demand/pas-20210421-2109-int16e/18.py
LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure
bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11
[ "BSD-3-Clause" ]
null
null
null
instances/passenger_demand/pas-20210421-2109-int16e/18.py
LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure
bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11
[ "BSD-3-Clause" ]
null
null
null
instances/passenger_demand/pas-20210421-2109-int16e/18.py
LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure
bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11
[ "BSD-3-Clause" ]
null
null
null
""" PASSENGERS """ numPassengers = 3607 passenger_arriving = ( (5, 9, 8, 5, 2, 0, 4, 11, 3, 3, 2, 0), # 0 (4, 14, 9, 5, 2, 0, 10, 8, 1, 6, 3, 0), # 1 (4, 6, 10, 5, 5, 0, 8, 7, 6, 8, 3, 0), # 2 (9, 11, 12, 0, 4, 0, 5, 14, 6, 4, 1, 0), # 3 (4, 9, 13, 4, 1, 0, 2, 10, 7, 8, 1, 0), # 4 (1, 10, 4, 1, 0, 0, 9, 9, 4, 7, 0, 0), # 5 (7, 4, 5, 3, 3, 0, 7, 6, 4, 3, 1, 0), # 6 (5, 15, 4, 4, 0, 0, 11, 6, 5, 6, 5, 0), # 7 (3, 5, 7, 5, 4, 0, 4, 11, 6, 5, 1, 0), # 8 (4, 8, 10, 6, 2, 0, 9, 6, 7, 3, 2, 0), # 9 (4, 11, 8, 5, 5, 0, 6, 7, 11, 6, 3, 0), # 10 (7, 8, 11, 5, 2, 0, 6, 16, 9, 5, 2, 0), # 11 (1, 12, 13, 2, 3, 0, 8, 8, 4, 3, 3, 0), # 12 (5, 6, 9, 5, 4, 0, 4, 3, 7, 7, 4, 0), # 13 (4, 16, 11, 10, 7, 0, 9, 5, 9, 4, 1, 0), # 14 (4, 10, 7, 3, 3, 0, 4, 10, 7, 5, 5, 0), # 15 (2, 7, 7, 1, 0, 0, 7, 8, 5, 4, 2, 0), # 16 (6, 8, 10, 6, 4, 0, 8, 8, 8, 7, 1, 0), # 17 (2, 9, 8, 4, 7, 0, 7, 11, 5, 3, 1, 0), # 18 (4, 12, 4, 4, 0, 0, 6, 12, 8, 6, 3, 0), # 19 (4, 4, 9, 2, 3, 0, 5, 8, 2, 7, 3, 0), # 20 (8, 10, 11, 8, 2, 0, 6, 12, 6, 6, 3, 0), # 21 (1, 7, 9, 5, 2, 0, 4, 8, 4, 4, 1, 0), # 22 (3, 9, 11, 4, 5, 0, 14, 7, 10, 5, 2, 0), # 23 (3, 8, 4, 3, 7, 0, 11, 8, 3, 7, 1, 0), # 24 (6, 12, 13, 5, 1, 0, 8, 11, 8, 3, 4, 0), # 25 (7, 8, 8, 7, 3, 0, 11, 14, 10, 8, 1, 0), # 26 (3, 7, 10, 9, 4, 0, 7, 9, 8, 2, 3, 0), # 27 (4, 10, 11, 5, 1, 0, 6, 8, 6, 2, 5, 0), # 28 (8, 11, 7, 3, 3, 0, 6, 12, 7, 7, 7, 0), # 29 (12, 14, 4, 0, 0, 0, 3, 10, 7, 5, 0, 0), # 30 (9, 15, 8, 5, 0, 0, 10, 12, 10, 4, 3, 0), # 31 (6, 15, 8, 5, 4, 0, 4, 12, 6, 6, 2, 0), # 32 (4, 12, 9, 2, 2, 0, 10, 12, 6, 6, 2, 0), # 33 (4, 13, 8, 2, 0, 0, 7, 11, 4, 6, 5, 0), # 34 (0, 16, 9, 1, 2, 0, 6, 18, 6, 12, 2, 0), # 35 (4, 13, 6, 2, 1, 0, 5, 11, 4, 4, 6, 0), # 36 (5, 10, 3, 3, 4, 0, 8, 10, 4, 10, 3, 0), # 37 (6, 9, 10, 5, 4, 0, 4, 10, 10, 8, 3, 0), # 38 (5, 10, 12, 5, 3, 0, 12, 7, 9, 4, 7, 0), # 39 (6, 13, 8, 6, 0, 0, 6, 14, 7, 7, 2, 0), # 40 (4, 4, 10, 1, 0, 0, 8, 8, 5, 5, 1, 0), # 41 (6, 9, 12, 7, 4, 0, 3, 12, 9, 7, 3, 0), # 42 (9, 12, 11, 4, 0, 0, 6, 13, 5, 6, 3, 0), # 43 (3, 9, 7, 4, 2, 0, 7, 8, 2, 4, 2, 0), # 44 (6, 10, 8, 9, 4, 0, 3, 12, 5, 2, 3, 0), # 45 (12, 8, 7, 7, 3, 0, 8, 9, 2, 6, 1, 0), # 46 (1, 8, 8, 9, 1, 0, 5, 5, 9, 7, 5, 0), # 47 (6, 11, 7, 6, 2, 0, 7, 10, 4, 3, 1, 0), # 48 (4, 8, 6, 7, 4, 0, 8, 11, 5, 2, 6, 0), # 49 (6, 13, 6, 3, 1, 0, 8, 10, 10, 3, 4, 0), # 50 (8, 9, 4, 6, 3, 0, 6, 6, 9, 6, 3, 0), # 51 (3, 10, 10, 2, 6, 0, 4, 17, 9, 3, 4, 0), # 52 (6, 14, 5, 6, 1, 0, 9, 14, 5, 2, 1, 0), # 53 (4, 12, 9, 7, 2, 0, 9, 12, 7, 3, 3, 0), # 54 (7, 11, 6, 3, 0, 0, 4, 7, 9, 4, 4, 0), # 55 (5, 11, 9, 3, 4, 0, 5, 9, 8, 2, 2, 0), # 56 (6, 6, 7, 4, 0, 0, 4, 12, 11, 8, 3, 0), # 57 (5, 12, 8, 5, 0, 0, 5, 10, 5, 1, 6, 0), # 58 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), # 59 ) station_arriving_intensity = ( (4.239442493415277, 10.874337121212122, 12.79077763496144, 10.138043478260869, 11.428846153846154, 7.610869565217392), # 0 (4.27923521607648, 10.995266557940518, 12.859864860039991, 10.194503019323673, 11.51450641025641, 7.608275422705315), # 1 (4.318573563554774, 11.114402244668911, 12.927312196515281, 10.249719806763286, 11.598358974358975, 7.60560193236715), # 2 (4.357424143985952, 11.231615625000002, 12.993070372750644, 10.303646739130434, 11.680326923076926, 7.60284945652174), # 3 (4.395753565505805, 11.346778142536477, 13.057090117109396, 10.356236714975847, 11.760333333333335, 7.600018357487922), # 4 (4.433528436250122, 11.459761240881035, 13.11932215795487, 10.407442632850241, 11.838301282051281, 7.597108997584541), # 5 (4.470715364354698, 11.570436363636365, 13.179717223650389, 10.457217391304349, 11.914153846153846, 7.594121739130435), # 6 (4.507280957955322, 11.678674954405162, 13.238226042559269, 10.50551388888889, 11.987814102564105, 7.591056944444445), # 7 (4.543191825187787, 11.784348456790122, 13.294799343044847, 10.552285024154589, 12.059205128205129, 7.587914975845411), # 8 (4.578414574187884, 11.88732831439394, 13.34938785347044, 10.597483695652175, 12.12825, 7.584696195652175), # 9 (4.612915813091406, 11.987485970819305, 13.401942302199371, 10.64106280193237, 12.194871794871796, 7.581400966183574), # 10 (4.646662150034143, 12.084692869668913, 13.452413417594972, 10.682975241545895, 12.25899358974359, 7.578029649758455), # 11 (4.679620193151888, 12.178820454545454, 13.500751928020566, 10.723173913043478, 12.320538461538462, 7.574582608695652), # 12 (4.71175655058043, 12.26974016905163, 13.546908561839473, 10.761611714975846, 12.37942948717949, 7.5710602053140095), # 13 (4.743037830455566, 12.357323456790127, 13.590834047415022, 10.798241545893719, 12.435589743589743, 7.567462801932367), # 14 (4.773430640913081, 12.441441761363635, 13.632479113110538, 10.833016304347826, 12.488942307692309, 7.563790760869566), # 15 (4.802901590088772, 12.521966526374861, 13.671794487289347, 10.86588888888889, 12.539410256410257, 7.560044444444445), # 16 (4.831417286118428, 12.598769195426486, 13.708730898314768, 10.896812198067634, 12.586916666666667, 7.556224214975846), # 17 (4.8589443371378405, 12.671721212121213, 13.74323907455013, 10.925739130434785, 12.631384615384619, 7.552330434782609), # 18 (4.8854493512828014, 12.740694020061728, 13.775269744358756, 10.952622584541063, 12.67273717948718, 7.5483634661835755), # 19 (4.910898936689104, 12.805559062850728, 13.804773636103969, 10.9774154589372, 12.710897435897436, 7.544323671497584), # 20 (4.935259701492538, 12.866187784090906, 13.831701478149103, 11.000070652173914, 12.74578846153846, 7.540211413043479), # 21 (4.958498253828894, 12.922451627384962, 13.856003998857469, 11.020541062801932, 12.777333333333331, 7.5360270531400975), # 22 (4.980581201833967, 12.97422203633558, 13.877631926592404, 11.038779589371982, 12.805455128205129, 7.531770954106282), # 23 (5.001475153643547, 13.021370454545455, 13.896535989717222, 11.054739130434783, 12.830076923076923, 7.52744347826087), # 24 (5.0211467173934246, 13.063768325617284, 13.91266691659526, 11.068372584541065, 12.851121794871794, 7.523044987922706), # 25 (5.039562501219393, 13.101287093153758, 13.925975435589832, 11.079632850241545, 12.86851282051282, 7.518575845410628), # 26 (5.056689113257243, 13.133798200757575, 13.936412275064265, 11.088472826086958, 12.88217307692308, 7.514036413043479), # 27 (5.072493161642767, 13.161173092031426, 13.943928163381893, 11.09484541062802, 12.89202564102564, 7.509427053140097), # 28 (5.086941254511755, 13.183283210578004, 13.948473828906026, 11.09870350241546, 12.89799358974359, 7.504748128019324), # 29 (5.1000000000000005, 13.200000000000001, 13.950000000000001, 11.100000000000001, 12.9, 7.5), # 30 (5.112219245524297, 13.213886079545453, 13.948855917874395, 11.099765849673204, 12.89926985815603, 7.4934020156588375), # 31 (5.124174680306906, 13.227588636363638, 13.945456038647343, 11.099067973856208, 12.897095035460993, 7.483239613526571), # 32 (5.135871675191815, 13.241105965909092, 13.93984891304348, 11.097913235294119, 12.893498936170213, 7.469612293853072), # 33 (5.147315601023018, 13.254436363636366, 13.93208309178744, 11.096308496732028, 12.888504964539008, 7.452619556888223), # 34 (5.158511828644501, 13.267578124999998, 13.922207125603865, 11.094260620915033, 12.882136524822696, 7.432360902881893), # 35 (5.169465728900256, 13.280529545454549, 13.91026956521739, 11.091776470588236, 12.874417021276598, 7.408935832083959), # 36 (5.180182672634271, 13.293288920454547, 13.896318961352657, 11.088862908496733, 12.865369858156027, 7.382443844744294), # 37 (5.190668030690537, 13.305854545454546, 13.8804038647343, 11.08552679738562, 12.855018439716313, 7.352984441112776), # 38 (5.200927173913044, 13.318224715909091, 13.862572826086955, 11.081775, 12.843386170212765, 7.32065712143928), # 39 (5.21096547314578, 13.330397727272729, 13.842874396135267, 11.077614379084968, 12.830496453900707, 7.285561385973679), # 40 (5.220788299232737, 13.342371874999998, 13.821357125603866, 11.073051797385622, 12.816372695035462, 7.247796734965852), # 41 (5.230401023017903, 13.354145454545458, 13.798069565217393, 11.068094117647059, 12.801038297872342, 7.207462668665667), # 42 (5.239809015345269, 13.365716761363636, 13.773060265700483, 11.06274820261438, 12.784516666666667, 7.164658687323005), # 43 (5.249017647058824, 13.377084090909092, 13.746377777777779, 11.05702091503268, 12.76683120567376, 7.119484291187739), # 44 (5.258032289002557, 13.388245738636364, 13.718070652173916, 11.050919117647059, 12.748005319148938, 7.072038980509745), # 45 (5.266858312020461, 13.399200000000002, 13.688187439613529, 11.044449673202614, 12.72806241134752, 7.022422255538898), # 46 (5.275501086956522, 13.409945170454547, 13.656776690821255, 11.037619444444445, 12.707025886524825, 6.970733616525071), # 47 (5.283965984654732, 13.420479545454548, 13.623886956521739, 11.030435294117646, 12.68491914893617, 6.9170725637181425), # 48 (5.292258375959079, 13.430801420454543, 13.589566787439615, 11.022904084967323, 12.66176560283688, 6.861538597367982), # 49 (5.300383631713555, 13.440909090909088, 13.553864734299518, 11.015032679738564, 12.63758865248227, 6.804231217724471), # 50 (5.308347122762149, 13.450800852272728, 13.516829347826087, 11.006827941176471, 12.612411702127659, 6.7452499250374816), # 51 (5.316154219948849, 13.460475, 13.47850917874396, 10.998296732026144, 12.58625815602837, 6.684694219556889), # 52 (5.3238102941176475, 13.469929829545457, 13.438952777777779, 10.98944591503268, 12.559151418439718, 6.622663601532567), # 53 (5.331320716112533, 13.479163636363635, 13.398208695652173, 10.980282352941177, 12.531114893617023, 6.559257571214393), # 54 (5.338690856777493, 13.488174715909091, 13.356325483091787, 10.970812908496733, 12.502171985815604, 6.494575628852241), # 55 (5.3459260869565215, 13.496961363636363, 13.313351690821257, 10.961044444444445, 12.472346099290782, 6.428717274695986), # 56 (5.353031777493607, 13.505521875000003, 13.269335869565218, 10.950983823529413, 12.441660638297872, 6.361782008995502), # 57 (5.360013299232737, 13.513854545454544, 13.224326570048309, 10.940637908496733, 12.410139007092198, 6.293869332000667), # 58 (0.0, 0.0, 0.0, 0.0, 0.0, 0.0), # 59 ) passenger_arriving_acc = ( (5, 9, 8, 5, 2, 0, 4, 11, 3, 3, 2, 0), # 0 (9, 23, 17, 10, 4, 0, 14, 19, 4, 9, 5, 0), # 1 (13, 29, 27, 15, 9, 0, 22, 26, 10, 17, 8, 0), # 2 (22, 40, 39, 15, 13, 0, 27, 40, 16, 21, 9, 0), # 3 (26, 49, 52, 19, 14, 0, 29, 50, 23, 29, 10, 0), # 4 (27, 59, 56, 20, 14, 0, 38, 59, 27, 36, 10, 0), # 5 (34, 63, 61, 23, 17, 0, 45, 65, 31, 39, 11, 0), # 6 (39, 78, 65, 27, 17, 0, 56, 71, 36, 45, 16, 0), # 7 (42, 83, 72, 32, 21, 0, 60, 82, 42, 50, 17, 0), # 8 (46, 91, 82, 38, 23, 0, 69, 88, 49, 53, 19, 0), # 9 (50, 102, 90, 43, 28, 0, 75, 95, 60, 59, 22, 0), # 10 (57, 110, 101, 48, 30, 0, 81, 111, 69, 64, 24, 0), # 11 (58, 122, 114, 50, 33, 0, 89, 119, 73, 67, 27, 0), # 12 (63, 128, 123, 55, 37, 0, 93, 122, 80, 74, 31, 0), # 13 (67, 144, 134, 65, 44, 0, 102, 127, 89, 78, 32, 0), # 14 (71, 154, 141, 68, 47, 0, 106, 137, 96, 83, 37, 0), # 15 (73, 161, 148, 69, 47, 0, 113, 145, 101, 87, 39, 0), # 16 (79, 169, 158, 75, 51, 0, 121, 153, 109, 94, 40, 0), # 17 (81, 178, 166, 79, 58, 0, 128, 164, 114, 97, 41, 0), # 18 (85, 190, 170, 83, 58, 0, 134, 176, 122, 103, 44, 0), # 19 (89, 194, 179, 85, 61, 0, 139, 184, 124, 110, 47, 0), # 20 (97, 204, 190, 93, 63, 0, 145, 196, 130, 116, 50, 0), # 21 (98, 211, 199, 98, 65, 0, 149, 204, 134, 120, 51, 0), # 22 (101, 220, 210, 102, 70, 0, 163, 211, 144, 125, 53, 0), # 23 (104, 228, 214, 105, 77, 0, 174, 219, 147, 132, 54, 0), # 24 (110, 240, 227, 110, 78, 0, 182, 230, 155, 135, 58, 0), # 25 (117, 248, 235, 117, 81, 0, 193, 244, 165, 143, 59, 0), # 26 (120, 255, 245, 126, 85, 0, 200, 253, 173, 145, 62, 0), # 27 (124, 265, 256, 131, 86, 0, 206, 261, 179, 147, 67, 0), # 28 (132, 276, 263, 134, 89, 0, 212, 273, 186, 154, 74, 0), # 29 (144, 290, 267, 134, 89, 0, 215, 283, 193, 159, 74, 0), # 30 (153, 305, 275, 139, 89, 0, 225, 295, 203, 163, 77, 0), # 31 (159, 320, 283, 144, 93, 0, 229, 307, 209, 169, 79, 0), # 32 (163, 332, 292, 146, 95, 0, 239, 319, 215, 175, 81, 0), # 33 (167, 345, 300, 148, 95, 0, 246, 330, 219, 181, 86, 0), # 34 (167, 361, 309, 149, 97, 0, 252, 348, 225, 193, 88, 0), # 35 (171, 374, 315, 151, 98, 0, 257, 359, 229, 197, 94, 0), # 36 (176, 384, 318, 154, 102, 0, 265, 369, 233, 207, 97, 0), # 37 (182, 393, 328, 159, 106, 0, 269, 379, 243, 215, 100, 0), # 38 (187, 403, 340, 164, 109, 0, 281, 386, 252, 219, 107, 0), # 39 (193, 416, 348, 170, 109, 0, 287, 400, 259, 226, 109, 0), # 40 (197, 420, 358, 171, 109, 0, 295, 408, 264, 231, 110, 0), # 41 (203, 429, 370, 178, 113, 0, 298, 420, 273, 238, 113, 0), # 42 (212, 441, 381, 182, 113, 0, 304, 433, 278, 244, 116, 0), # 43 (215, 450, 388, 186, 115, 0, 311, 441, 280, 248, 118, 0), # 44 (221, 460, 396, 195, 119, 0, 314, 453, 285, 250, 121, 0), # 45 (233, 468, 403, 202, 122, 0, 322, 462, 287, 256, 122, 0), # 46 (234, 476, 411, 211, 123, 0, 327, 467, 296, 263, 127, 0), # 47 (240, 487, 418, 217, 125, 0, 334, 477, 300, 266, 128, 0), # 48 (244, 495, 424, 224, 129, 0, 342, 488, 305, 268, 134, 0), # 49 (250, 508, 430, 227, 130, 0, 350, 498, 315, 271, 138, 0), # 50 (258, 517, 434, 233, 133, 0, 356, 504, 324, 277, 141, 0), # 51 (261, 527, 444, 235, 139, 0, 360, 521, 333, 280, 145, 0), # 52 (267, 541, 449, 241, 140, 0, 369, 535, 338, 282, 146, 0), # 53 (271, 553, 458, 248, 142, 0, 378, 547, 345, 285, 149, 0), # 54 (278, 564, 464, 251, 142, 0, 382, 554, 354, 289, 153, 0), # 55 (283, 575, 473, 254, 146, 0, 387, 563, 362, 291, 155, 0), # 56 (289, 581, 480, 258, 146, 0, 391, 575, 373, 299, 158, 0), # 57 (294, 593, 488, 263, 146, 0, 396, 585, 378, 300, 164, 0), # 58 (294, 593, 488, 263, 146, 0, 396, 585, 378, 300, 164, 0), # 59 ) passenger_arriving_rate = ( (4.239442493415277, 8.699469696969697, 7.674466580976864, 4.055217391304347, 2.2857692307692306, 0.0, 7.610869565217392, 9.143076923076922, 6.082826086956521, 5.1163110539845755, 2.174867424242424, 0.0), # 0 (4.27923521607648, 8.796213246352414, 7.715918916023995, 4.077801207729468, 2.3029012820512818, 0.0, 7.608275422705315, 9.211605128205127, 6.116701811594203, 5.1439459440159965, 2.1990533115881035, 0.0), # 1 (4.318573563554774, 8.891521795735128, 7.7563873179091685, 4.099887922705314, 2.3196717948717946, 0.0, 7.60560193236715, 9.278687179487179, 6.1498318840579715, 5.170924878606112, 2.222880448933782, 0.0), # 2 (4.357424143985952, 8.9852925, 7.795842223650386, 4.121458695652173, 2.336065384615385, 0.0, 7.60284945652174, 9.34426153846154, 6.18218804347826, 5.197228149100257, 2.246323125, 0.0), # 3 (4.395753565505805, 9.07742251402918, 7.834254070265637, 4.142494685990338, 2.352066666666667, 0.0, 7.600018357487922, 9.408266666666668, 6.213742028985508, 5.222836046843758, 2.269355628507295, 0.0), # 4 (4.433528436250122, 9.167808992704828, 7.8715932947729215, 4.1629770531400965, 2.367660256410256, 0.0, 7.597108997584541, 9.470641025641024, 6.244465579710145, 5.247728863181948, 2.291952248176207, 0.0), # 5 (4.470715364354698, 9.25634909090909, 7.907830334190233, 4.182886956521739, 2.382830769230769, 0.0, 7.594121739130435, 9.531323076923076, 6.274330434782609, 5.271886889460156, 2.3140872727272725, 0.0), # 6 (4.507280957955322, 9.34293996352413, 7.942935625535561, 4.2022055555555555, 2.397562820512821, 0.0, 7.591056944444445, 9.590251282051284, 6.303308333333334, 5.295290417023708, 2.3357349908810323, 0.0), # 7 (4.543191825187787, 9.427478765432097, 7.976879605826908, 4.220914009661835, 2.4118410256410256, 0.0, 7.587914975845411, 9.647364102564103, 6.3313710144927535, 5.317919737217938, 2.3568696913580243, 0.0), # 8 (4.578414574187884, 9.509862651515151, 8.009632712082263, 4.23899347826087, 2.4256499999999996, 0.0, 7.584696195652175, 9.702599999999999, 6.358490217391305, 5.339755141388175, 2.377465662878788, 0.0), # 9 (4.612915813091406, 9.589988776655444, 8.041165381319622, 4.256425120772947, 2.438974358974359, 0.0, 7.581400966183574, 9.755897435897436, 6.384637681159421, 5.360776920879748, 2.397497194163861, 0.0), # 10 (4.646662150034143, 9.66775429573513, 8.071448050556983, 4.273190096618357, 2.4517987179487175, 0.0, 7.578029649758455, 9.80719487179487, 6.409785144927537, 5.380965367037988, 2.4169385739337823, 0.0), # 11 (4.679620193151888, 9.743056363636363, 8.100451156812339, 4.289269565217391, 2.4641076923076923, 0.0, 7.574582608695652, 9.85643076923077, 6.433904347826087, 5.400300771208226, 2.4357640909090907, 0.0), # 12 (4.71175655058043, 9.815792135241303, 8.128145137103683, 4.304644685990338, 2.475885897435898, 0.0, 7.5710602053140095, 9.903543589743592, 6.456967028985507, 5.418763424735789, 2.4539480338103257, 0.0), # 13 (4.743037830455566, 9.8858587654321, 8.154500428449014, 4.3192966183574875, 2.4871179487179482, 0.0, 7.567462801932367, 9.948471794871793, 6.478944927536231, 5.4363336189660085, 2.471464691358025, 0.0), # 14 (4.773430640913081, 9.953153409090907, 8.179487467866322, 4.33320652173913, 2.4977884615384616, 0.0, 7.563790760869566, 9.991153846153846, 6.499809782608695, 5.452991645244214, 2.488288352272727, 0.0), # 15 (4.802901590088772, 10.017573221099887, 8.203076692373608, 4.346355555555555, 2.507882051282051, 0.0, 7.560044444444445, 10.031528205128204, 6.519533333333333, 5.468717794915738, 2.504393305274972, 0.0), # 16 (4.831417286118428, 10.079015356341188, 8.22523853898886, 4.358724879227053, 2.517383333333333, 0.0, 7.556224214975846, 10.069533333333332, 6.538087318840581, 5.483492359325907, 2.519753839085297, 0.0), # 17 (4.8589443371378405, 10.13737696969697, 8.245943444730077, 4.370295652173914, 2.5262769230769235, 0.0, 7.552330434782609, 10.105107692307694, 6.55544347826087, 5.4972956298200515, 2.5343442424242424, 0.0), # 18 (4.8854493512828014, 10.192555216049382, 8.265161846615253, 4.381049033816424, 2.534547435897436, 0.0, 7.5483634661835755, 10.138189743589743, 6.571573550724637, 5.510107897743501, 2.5481388040123454, 0.0), # 19 (4.910898936689104, 10.244447250280581, 8.282864181662381, 4.3909661835748794, 2.542179487179487, 0.0, 7.544323671497584, 10.168717948717948, 6.58644927536232, 5.5219094544415865, 2.5611118125701453, 0.0), # 20 (4.935259701492538, 10.292950227272724, 8.299020886889462, 4.400028260869565, 2.5491576923076917, 0.0, 7.540211413043479, 10.196630769230767, 6.600042391304348, 5.53268059125964, 2.573237556818181, 0.0), # 21 (4.958498253828894, 10.337961301907969, 8.313602399314481, 4.408216425120773, 2.555466666666666, 0.0, 7.5360270531400975, 10.221866666666664, 6.6123246376811595, 5.542401599542987, 2.584490325476992, 0.0), # 22 (4.980581201833967, 10.379377629068463, 8.326579155955441, 4.415511835748792, 2.5610910256410255, 0.0, 7.531770954106282, 10.244364102564102, 6.623267753623189, 5.551052770636961, 2.5948444072671157, 0.0), # 23 (5.001475153643547, 10.417096363636363, 8.337921593830332, 4.421895652173912, 2.5660153846153846, 0.0, 7.52744347826087, 10.264061538461538, 6.632843478260869, 5.558614395886888, 2.6042740909090907, 0.0), # 24 (5.0211467173934246, 10.451014660493826, 8.347600149957156, 4.427349033816426, 2.5702243589743587, 0.0, 7.523044987922706, 10.280897435897435, 6.641023550724639, 5.565066766638103, 2.6127536651234564, 0.0), # 25 (5.039562501219393, 10.481029674523006, 8.355585261353898, 4.431853140096617, 2.5737025641025637, 0.0, 7.518575845410628, 10.294810256410255, 6.647779710144927, 5.570390174235932, 2.6202574186307515, 0.0), # 26 (5.056689113257243, 10.507038560606059, 8.361847365038559, 4.435389130434783, 2.5764346153846156, 0.0, 7.514036413043479, 10.305738461538462, 6.653083695652175, 5.574564910025706, 2.6267596401515148, 0.0), # 27 (5.072493161642767, 10.52893847362514, 8.366356898029135, 4.437938164251207, 2.578405128205128, 0.0, 7.509427053140097, 10.313620512820512, 6.656907246376812, 5.5775712653527565, 2.632234618406285, 0.0), # 28 (5.086941254511755, 10.546626568462402, 8.369084297343615, 4.439481400966184, 2.579598717948718, 0.0, 7.504748128019324, 10.318394871794872, 6.659222101449276, 5.57938953156241, 2.6366566421156006, 0.0), # 29 (5.1000000000000005, 10.56, 8.370000000000001, 4.44, 2.58, 0.0, 7.5, 10.32, 6.660000000000001, 5.58, 2.64, 0.0), # 30 (5.112219245524297, 10.571108863636361, 8.369313550724637, 4.439906339869282, 2.5798539716312057, 0.0, 7.4934020156588375, 10.319415886524823, 6.659859509803923, 5.579542367149758, 2.6427772159090903, 0.0), # 31 (5.124174680306906, 10.582070909090909, 8.367273623188405, 4.439627189542483, 2.5794190070921985, 0.0, 7.483239613526571, 10.317676028368794, 6.659440784313724, 5.578182415458937, 2.6455177272727273, 0.0), # 32 (5.135871675191815, 10.592884772727274, 8.363909347826088, 4.439165294117647, 2.5786997872340423, 0.0, 7.469612293853072, 10.314799148936169, 6.658747941176471, 5.575939565217392, 2.6482211931818185, 0.0), # 33 (5.147315601023018, 10.603549090909091, 8.359249855072465, 4.438523398692811, 2.5777009929078014, 0.0, 7.452619556888223, 10.310803971631206, 6.657785098039217, 5.572833236714976, 2.6508872727272728, 0.0), # 34 (5.158511828644501, 10.614062499999998, 8.353324275362318, 4.437704248366013, 2.576427304964539, 0.0, 7.432360902881893, 10.305709219858157, 6.65655637254902, 5.568882850241546, 2.6535156249999994, 0.0), # 35 (5.169465728900256, 10.624423636363638, 8.346161739130434, 4.436710588235294, 2.5748834042553193, 0.0, 7.408935832083959, 10.299533617021277, 6.655065882352941, 5.564107826086956, 2.6561059090909094, 0.0), # 36 (5.180182672634271, 10.634631136363637, 8.337791376811595, 4.435545163398693, 2.573073971631205, 0.0, 7.382443844744294, 10.29229588652482, 6.65331774509804, 5.558527584541062, 2.6586577840909094, 0.0), # 37 (5.190668030690537, 10.644683636363636, 8.32824231884058, 4.4342107189542475, 2.5710036879432625, 0.0, 7.352984441112776, 10.28401475177305, 6.651316078431372, 5.5521615458937195, 2.661170909090909, 0.0), # 38 (5.200927173913044, 10.654579772727272, 8.317543695652173, 4.43271, 2.568677234042553, 0.0, 7.32065712143928, 10.274708936170212, 6.649065, 5.545029130434782, 2.663644943181818, 0.0), # 39 (5.21096547314578, 10.664318181818182, 8.305724637681159, 4.431045751633987, 2.566099290780141, 0.0, 7.285561385973679, 10.264397163120565, 6.646568627450981, 5.537149758454106, 2.6660795454545454, 0.0), # 40 (5.220788299232737, 10.673897499999997, 8.29281427536232, 4.429220718954248, 2.563274539007092, 0.0, 7.247796734965852, 10.253098156028368, 6.643831078431373, 5.5285428502415455, 2.6684743749999993, 0.0), # 41 (5.230401023017903, 10.683316363636365, 8.278841739130435, 4.427237647058823, 2.560207659574468, 0.0, 7.207462668665667, 10.240830638297872, 6.640856470588235, 5.519227826086957, 2.6708290909090913, 0.0), # 42 (5.239809015345269, 10.692573409090908, 8.26383615942029, 4.4250992810457515, 2.556903333333333, 0.0, 7.164658687323005, 10.227613333333332, 6.637648921568627, 5.509224106280192, 2.673143352272727, 0.0), # 43 (5.249017647058824, 10.701667272727272, 8.247826666666667, 4.422808366013072, 2.5533662411347517, 0.0, 7.119484291187739, 10.213464964539007, 6.634212549019608, 5.498551111111111, 2.675416818181818, 0.0), # 44 (5.258032289002557, 10.71059659090909, 8.23084239130435, 4.420367647058823, 2.5496010638297872, 0.0, 7.072038980509745, 10.198404255319149, 6.630551470588235, 5.487228260869566, 2.6776491477272724, 0.0), # 45 (5.266858312020461, 10.71936, 8.212912463768117, 4.417779869281045, 2.5456124822695037, 0.0, 7.022422255538898, 10.182449929078015, 6.626669803921568, 5.475274975845411, 2.67984, 0.0), # 46 (5.275501086956522, 10.727956136363636, 8.194066014492753, 4.415047777777778, 2.5414051773049646, 0.0, 6.970733616525071, 10.165620709219858, 6.6225716666666665, 5.462710676328501, 2.681989034090909, 0.0), # 47 (5.283965984654732, 10.736383636363637, 8.174332173913044, 4.412174117647059, 2.536983829787234, 0.0, 6.9170725637181425, 10.147935319148935, 6.618261176470588, 5.449554782608695, 2.6840959090909093, 0.0), # 48 (5.292258375959079, 10.744641136363633, 8.15374007246377, 4.409161633986929, 2.5323531205673757, 0.0, 6.861538597367982, 10.129412482269503, 6.613742450980394, 5.435826714975845, 2.6861602840909082, 0.0), # 49 (5.300383631713555, 10.752727272727268, 8.13231884057971, 4.406013071895425, 2.527517730496454, 0.0, 6.804231217724471, 10.110070921985816, 6.6090196078431385, 5.421545893719807, 2.688181818181817, 0.0), # 50 (5.308347122762149, 10.760640681818181, 8.110097608695652, 4.4027311764705885, 2.5224823404255314, 0.0, 6.7452499250374816, 10.089929361702126, 6.604096764705883, 5.406731739130435, 2.6901601704545453, 0.0), # 51 (5.316154219948849, 10.768379999999999, 8.087105507246376, 4.399318692810457, 2.517251631205674, 0.0, 6.684694219556889, 10.069006524822695, 6.5989780392156865, 5.391403671497584, 2.6920949999999997, 0.0), # 52 (5.3238102941176475, 10.775943863636364, 8.063371666666667, 4.395778366013072, 2.5118302836879436, 0.0, 6.622663601532567, 10.047321134751774, 6.593667549019608, 5.375581111111111, 2.693985965909091, 0.0), # 53 (5.331320716112533, 10.783330909090907, 8.038925217391304, 4.392112941176471, 2.5062229787234043, 0.0, 6.559257571214393, 10.024891914893617, 6.5881694117647065, 5.359283478260869, 2.6958327272727267, 0.0), # 54 (5.338690856777493, 10.790539772727271, 8.013795289855072, 4.388325163398693, 2.5004343971631204, 0.0, 6.494575628852241, 10.001737588652482, 6.58248774509804, 5.342530193236715, 2.697634943181818, 0.0), # 55 (5.3459260869565215, 10.79756909090909, 7.988011014492754, 4.384417777777777, 2.494469219858156, 0.0, 6.428717274695986, 9.977876879432625, 6.576626666666667, 5.325340676328502, 2.6993922727272723, 0.0), # 56 (5.353031777493607, 10.804417500000001, 7.96160152173913, 4.380393529411765, 2.4883321276595742, 0.0, 6.361782008995502, 9.953328510638297, 6.570590294117648, 5.307734347826087, 2.7011043750000003, 0.0), # 57 (5.360013299232737, 10.811083636363634, 7.934595942028984, 4.376255163398692, 2.4820278014184396, 0.0, 6.293869332000667, 9.928111205673758, 6.564382745098039, 5.289730628019323, 2.7027709090909084, 0.0), # 58 (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), # 59 ) passenger_allighting_rate = ( (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 0 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 1 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 2 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 3 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 4 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 5 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 6 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 7 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 8 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 9 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 10 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 11 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 12 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 13 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 14 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 15 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 16 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 17 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 18 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 19 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 20 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 21 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 22 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 23 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 24 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 25 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 26 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 27 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 28 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 29 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 30 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 31 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 32 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 33 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 34 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 35 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 36 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 37 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 38 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 39 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 40 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 41 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 42 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 43 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 44 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 45 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 46 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 47 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 48 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 49 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 50 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 51 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 52 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 53 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 54 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 55 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 56 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 57 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 58 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 59 ) """ parameters for reproducibiliy. More information: https://numpy.org/doc/stable/reference/random/parallel.html """ #initial entropy entropy = 258194110137029475889902652135037600173 #index for seed sequence child child_seed_index = ( 1, # 0 17, # 1 )
113.671642
214
0.730462
5,147
38,080
5.402176
0.23198
0.310735
0.245999
0.466103
0.326488
0.325625
0.325625
0.325625
0.325625
0.325625
0
0.820056
0.11854
38,080
334
215
114.011976
0.008312
0.031801
0
0.202532
0
0
0
0
0
0
0
0
0
1
0
false
0.015823
0
0
0
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
1
0
0
0
0
1
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
8696a344e8d2537b56d813c5422255a2c60a36ec
211
py
Python
easygraph/utils/__init__.py
coreturn/Easy-Graph
ee46d84250c4d4cf22271ca13449b15fad88ad7b
[ "BSD-3-Clause" ]
41
2020-09-26T13:44:07.000Z
2022-03-19T08:57:45.000Z
easygraph/utils/__init__.py
coreturn/Easy-Graph
ee46d84250c4d4cf22271ca13449b15fad88ad7b
[ "BSD-3-Clause" ]
14
2020-09-26T03:29:08.000Z
2022-03-29T02:47:17.000Z
easygraph/utils/__init__.py
coreturn/Easy-Graph
ee46d84250c4d4cf22271ca13449b15fad88ad7b
[ "BSD-3-Clause" ]
8
2020-09-27T08:10:56.000Z
2022-03-29T08:48:16.000Z
from easygraph.utils.decorators import * from easygraph.utils.mapped_queue import * from easygraph.utils.convert_to_matrix import * from easygraph.utils.alias import * from easygraph.utils.index_of_node import *
42.2
47
0.838863
30
211
5.733333
0.466667
0.377907
0.523256
0.55814
0
0
0
0
0
0
0
0
0.090047
211
5
48
42.2
0.895833
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
1
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
1
0
1
0
0
0
0
6
86bd305bfe818381c3f6cfdb3f32764452ac955b
25
py
Python
app/discover/__init__.py
fariszr/app
932134c2123714cf1d1b7090998fbdf27344cce0
[ "MIT" ]
5
2021-01-13T16:50:46.000Z
2021-11-29T04:01:46.000Z
app/discover/__init__.py
fariszr/app
932134c2123714cf1d1b7090998fbdf27344cce0
[ "MIT" ]
1
2021-02-08T21:04:06.000Z
2021-02-08T21:04:06.000Z
app/discover/__init__.py
fariszr/app
932134c2123714cf1d1b7090998fbdf27344cce0
[ "MIT" ]
4
2021-02-08T23:04:33.000Z
2022-01-05T12:02:34.000Z
from .views import index
12.5
24
0.8
4
25
5
1
0
0
0
0
0
0
0
0
0
0
0
0.16
25
1
25
25
0.952381
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
8100ae3b84d4fc81558de45baf6eba37ecfb550d
29
py
Python
bern2/__init__.py
dmis-lab/BERN2
0eaf635672b6c952984e16a165ce7e7f7805c675
[ "BSD-2-Clause" ]
53
2022-01-06T15:31:35.000Z
2022-03-30T06:07:45.000Z
bern2/__init__.py
dmis-lab/BERN2
0eaf635672b6c952984e16a165ce7e7f7805c675
[ "BSD-2-Clause" ]
15
2022-01-11T16:26:49.000Z
2022-03-31T04:56:11.000Z
bern2/__init__.py
dmis-lab/BERN2
0eaf635672b6c952984e16a165ce7e7f7805c675
[ "BSD-2-Clause" ]
8
2022-01-18T12:38:25.000Z
2022-03-29T10:34:59.000Z
from bern2.bern2 import BERN2
29
29
0.862069
5
29
5
0.6
0
0
0
0
0
0
0
0
0
0
0.115385
0.103448
29
1
29
29
0.846154
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
8107dfe239652363a0a251ff2d9f75feb23f1b06
3,121
py
Python
apps/pet/views.py
glenjasper/cobija-web
9a623daae9fba1b423b8fd690a25139ed8d06d7c
[ "MIT" ]
null
null
null
apps/pet/views.py
glenjasper/cobija-web
9a623daae9fba1b423b8fd690a25139ed8d06d7c
[ "MIT" ]
null
null
null
apps/pet/views.py
glenjasper/cobija-web
9a623daae9fba1b423b8fd690a25139ed8d06d7c
[ "MIT" ]
null
null
null
from django.shortcuts import render from django.views.generic import ( ListView, ) from .models import ( Pet, PetPhoto ) from pprint import pprint class PetsToAdoptView(ListView): template_name = "pet/to_adopt.html" context_object_name = "context_petstoadopt_simple" def get_queryset(self): _query = PetPhoto.objects.all().filter(pet__adopted = False, pet__status = True).order_by('pet__name') dict_one_photo = {} for petphoto in _query: if petphoto.pet.pk not in dict_one_photo: dict_one_photo.update({petphoto.pet.pk: petphoto}) return dict_one_photo def get_context_data(self, **kwargs): context = super(PetsToAdoptView, self).get_context_data(**kwargs) # Pets Type context _query = Pet.objects.all().filter(adopted = False, status = True).order_by('typepet__name') dict_typepet = [] for pet in _query: if pet.typepet.name not in dict_typepet: dict_typepet.append(pet.typepet.name) context['context_typepet'] = dict_typepet # All pets photo _query = PetPhoto.objects.all().filter(pet__adopted = False, pet__status = True).order_by('pet__name') dict_pets = {} for petphoto in _query: pk = petphoto.pet.pk if pk not in dict_pets: dict_pets.update({pk: [petphoto]}) else: current = dict_pets[pk].copy() current.append(petphoto) dict_pets.update({pk: current}) context['context_petstoadopt'] = dict_pets return context class PetsAdopted(ListView): template_name = "pet/adopted.html" context_object_name = "context_petsadopted_simple" def get_queryset(self): _query = PetPhoto.objects.all().filter(pet__adopted = True, pet__status = True).order_by('pet__name', 'pk') dict_one_photo = {} for petphoto in _query: if petphoto.pet.pk not in dict_one_photo: dict_one_photo.update({petphoto.pet.pk: petphoto}) return dict_one_photo def get_context_data(self, **kwargs): context = super(PetsAdopted, self).get_context_data(**kwargs) # Pets Type context _query = Pet.objects.all().filter(adopted = True, status = True).order_by('typepet__name') dict_typepet = [] for pet in _query: if pet.typepet.name not in dict_typepet: dict_typepet.append(pet.typepet.name) context['context_typepet'] = dict_typepet # All pets photo _query = PetPhoto.objects.all().filter(pet__adopted = True, pet__status = True).order_by('pet__name', 'pk') dict_pets = {} for petphoto in _query: pk = petphoto.pet.pk if pk not in dict_pets: dict_pets.update({pk: [petphoto]}) else: current = dict_pets[pk].copy() current.append(petphoto) dict_pets.update({pk: current}) context['context_petsadopted'] = dict_pets return context
33.202128
115
0.619673
375
3,121
4.872
0.154667
0.052545
0.052545
0.055829
0.817734
0.787083
0.787083
0.787083
0.787083
0.787083
0
0
0.280359
3,121
93
116
33.55914
0.813446
0.020827
0
0.695652
0
0
0.07178
0.017044
0
0
0
0
0
1
0.057971
false
0
0.057971
0
0.26087
0.014493
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
813542ecf51b7eaebec9cc679b6cb197167bc60c
841
py
Python
deepracer_follow_the_leader_ws/build/deepracer_interfaces_pkg/rosidl_generator_py/deepracer_interfaces_pkg/msg/__init__.py
amitjain-3/working_add
ddd3b10d854477e86bf7a8558b3d447ec03a8a5f
[ "Apache-2.0" ]
1
2022-03-11T20:15:27.000Z
2022-03-11T20:15:27.000Z
deepracer_follow_the_leader_ws/install/deepracer_interfaces_pkg/lib/python3.8/site-packages/deepracer_interfaces_pkg/msg/__init__.py
amitjain-3/working_add
ddd3b10d854477e86bf7a8558b3d447ec03a8a5f
[ "Apache-2.0" ]
null
null
null
deepracer_follow_the_leader_ws/install/deepracer_interfaces_pkg/lib/python3.8/site-packages/deepracer_interfaces_pkg/msg/__init__.py
amitjain-3/working_add
ddd3b10d854477e86bf7a8558b3d447ec03a8a5f
[ "Apache-2.0" ]
null
null
null
from deepracer_interfaces_pkg.msg._camera_msg import CameraMsg # noqa: F401 from deepracer_interfaces_pkg.msg._detection_delta_msg import DetectionDeltaMsg # noqa: F401 from deepracer_interfaces_pkg.msg._evo_sensor_msg import EvoSensorMsg # noqa: F401 from deepracer_interfaces_pkg.msg._infer_results import InferResults # noqa: F401 from deepracer_interfaces_pkg.msg._infer_results_array import InferResultsArray # noqa: F401 from deepracer_interfaces_pkg.msg._network_connection_status import NetworkConnectionStatus # noqa: F401 from deepracer_interfaces_pkg.msg._servo_ctrl_msg import ServoCtrlMsg # noqa: F401 from deepracer_interfaces_pkg.msg._software_update_pct_msg import SoftwareUpdatePctMsg # noqa: F401 from deepracer_interfaces_pkg.msg._usb_file_system_notification_msg import USBFileSystemNotificationMsg # noqa: F401
84.1
117
0.871581
109
841
6.302752
0.33945
0.170306
0.30131
0.340611
0.508006
0.465793
0.465793
0.142649
0.142649
0
0
0.035111
0.085612
841
9
118
93.444444
0.858257
0.116528
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
81438c55f8201782f5ab782373944f4013b05db9
45
py
Python
Test.py
ItsPapermunoz/PAPER-ERP
2cf85a51f166a1ed139d333554ec62fb87b774c9
[ "MIT" ]
null
null
null
Test.py
ItsPapermunoz/PAPER-ERP
2cf85a51f166a1ed139d333554ec62fb87b774c9
[ "MIT" ]
null
null
null
Test.py
ItsPapermunoz/PAPER-ERP
2cf85a51f166a1ed139d333554ec62fb87b774c9
[ "MIT" ]
null
null
null
x = 15 / 100 y = 949 z = x * y print(z)
9
13
0.422222
10
45
1.9
0.7
0
0
0
0
0
0
0
0
0
0
0.307692
0.422222
45
5
14
9
0.423077
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.25
1
1
1
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
6
d48ff126297390c87ccdf42a63dbf7f030243882
35
py
Python
src/segmentation/lightning_seg/__init__.py
JonasFrey96/RPOSE
7da77499ab777ce7ee37b731541982870da8d40b
[ "BSD-3-Clause" ]
null
null
null
src/segmentation/lightning_seg/__init__.py
JonasFrey96/RPOSE
7da77499ab777ce7ee37b731541982870da8d40b
[ "BSD-3-Clause" ]
null
null
null
src/segmentation/lightning_seg/__init__.py
JonasFrey96/RPOSE
7da77499ab777ce7ee37b731541982870da8d40b
[ "BSD-3-Clause" ]
null
null
null
from .lightning_seg import Network
17.5
34
0.857143
5
35
5.8
1
0
0
0
0
0
0
0
0
0
0
0
0.114286
35
1
35
35
0.935484
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
d4c27a22e98d54708f3f55177f5e8ce8c1f29c2e
56,876
py
Python
tests/milvus_python_test/test_config.py
RifeWang/milvus
3f300cb155447cefa374b711bdfe0d7b43446cd8
[ "Apache-2.0" ]
1
2020-09-23T02:25:42.000Z
2020-09-23T02:25:42.000Z
tests/milvus_python_test/test_config.py
RifeWang/milvus
3f300cb155447cefa374b711bdfe0d7b43446cd8
[ "Apache-2.0" ]
null
null
null
tests/milvus_python_test/test_config.py
RifeWang/milvus
3f300cb155447cefa374b711bdfe0d7b43446cd8
[ "Apache-2.0" ]
null
null
null
import time import random import pdb import threading import logging from multiprocessing import Pool, Process import pytest from utils import * import ujson dim = 128 index_file_size = 10 CONFIG_TIMEOUT = 80 nprobe = 1 top_k = 1 tag = "1970_01_01" nb = 6000 class TestCacheConfig: """ ****************************************************************** The following cases are used to test `get_config` function ****************************************************************** """ @pytest.fixture(scope="function", autouse=True) def skip_http_check(self, args): if args["handler"] == "HTTP": pytest.skip("skip in http mode") @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def reset_configs(self, connect): ''' reset configs so the tests are stable ''' relpy = connect.set_config("cache", "cache_size", '4GB') config_value = connect.get_config("cache", "cache_size") assert config_value == '4GB' #relpy = connect.set_config("cache", "insert_buffer_size", '2GB') #config_value = connect.get_config("cache", "insert_buffer_size") #assert config_value == '1073741824' @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_cache_size_invalid_parent_key(self, connect, collection): ''' target: get invalid parent key method: call get_config without parent_key: cache expected: status not ok ''' invalid_configs = ["Cache_config", "cache config", "cache_Config", "cacheconfig"] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config(config, "cache_size") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_cache_size_invalid_child_key(self, connect, collection): ''' target: get invalid child key method: call get_config without child_key: cache_size expected: status not ok ''' invalid_configs = ["Cpu_cache_size", "cpu cache_size", "cpucachecapacity"] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config("cache", config) @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_cache_size_valid(self, connect, collection): ''' target: get cache_size method: call get_config correctly expected: status ok ''' config_value = connect.get_config("cache", "cache_size") assert config_value @pytest.mark.level(2) def test_get_insert_buffer_size_invalid_parent_key(self, connect, collection): ''' target: get invalid parent key method: call get_config without parent_key: cache expected: status not ok ''' invalid_configs = ["Cache_config", "cache config", "cache_Config", "cacheconfig"] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config(config, "insert_buffer_size") @pytest.mark.level(2) def test_get_insert_buffer_size_invalid_child_key(self, connect, collection): ''' target: get invalid child key method: call get_config without child_key: insert_buffer_size expected: status not ok ''' invalid_configs = ["Insert_buffer size", "insert buffer_size", "insertbuffersize"] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config("cache", config) @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_insert_buffer_size_valid(self, connect, collection): ''' target: get insert_buffer_size method: call get_config correctly expected: status ok ''' config_value = connect.get_config("cache", "insert_buffer_size") assert config_value @pytest.mark.level(2) def test_get_preload_collection_invalid_child_key(self, connect, collection): ''' target: get invalid child key method: call get_config without child_key: preload_collection expected: status not ok ''' invalid_configs = ["preloadtable", "preload collection "] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config("cache", config) @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_preload_collection_valid(self, connect, collection): ''' target: get preload_collection method: call get_config correctly expected: status ok ''' config_value = connect.get_config("cache", "preload_collection") assert config_value == '' """ ****************************************************************** The following cases are used to test `set_config` function ****************************************************************** """ def get_memory_available(self, connect): info = connect._cmd("get_system_info") mem_info = ujson.loads(info) mem_total = int(mem_info["memory_total"]) mem_used = int(mem_info["memory_used"]) logging.getLogger().info(mem_total) logging.getLogger().info(mem_used) mem_available = mem_total - mem_used return int(mem_available / 1024 / 1024 / 1024) def get_memory_total(self, connect): info = connect._cmd("get_system_info") mem_info = ujson.loads(info) mem_total = int(mem_info["memory_total"]) return int(mem_total / 1024 / 1024 / 1024) @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_cache_size_invalid_parent_key(self, connect, collection): ''' target: set invalid parent key method: call set_config without parent_key: cache expected: status not ok ''' self.reset_configs(connect) invalid_configs = ["Cache_config", "cache config", "cache_Config", "cacheconfig"] for config in invalid_configs: with pytest.raises(Exception) as e: relpy = connect.set_config(config, "cache_size", '4294967296') @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_cache_invalid_child_key(self, connect, collection): ''' target: set invalid child key method: call set_config with invalid child_key expected: status not ok ''' self.reset_configs(connect) invalid_configs = ["abc", 1] for config in invalid_configs: with pytest.raises(Exception) as e: relpy = connect.set_config("cache", config, '4294967296') @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_cache_size_valid(self, connect, collection): ''' target: set cache_size method: call set_config correctly expected: status ok, set successfully ''' self.reset_configs(connect) relpy = connect.set_config("cache", "cache_size", '2147483648') config_value = connect.get_config("cache", "cache_size") assert config_value == '2GB' @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.level(2) def test_set_cache_size_valid_multiple_times(self, connect, collection): ''' target: set cache_size method: call set_config correctly and repeatedly expected: status ok ''' self.reset_configs(connect) for i in range(20): relpy = connect.set_config("cache", "cache_size", '4294967296') config_value = connect.get_config("cache", "cache_size") assert config_value == '4294967296' for i in range(20): relpy = connect.set_config("cache", "cache_size", '2147483648') config_value = connect.get_config("cache", "cache_size") assert config_value == '2147483648' @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.level(2) def test_set_insert_buffer_size_invalid_parent_key(self, connect, collection): ''' target: set invalid parent key method: call set_config without parent_key: cache expected: status not ok ''' self.reset_configs(connect) invalid_configs = ["Cache_config", "cache config", "cache_Config", "cacheconfig"] for config in invalid_configs: with pytest.raises(Exception) as e: relpy = connect.set_config(config, "insert_buffer_size", '1073741824') @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_insert_buffer_size_valid(self, connect, collection): ''' target: set insert_buffer_size method: call get_config correctly expected: status ok, set successfully ''' self.reset_configs(connect) relpy = connect.set_config("cache", "insert_buffer_size", '2GB') @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.level(2) def test_set_insert_buffer_size_valid_multiple_times(self, connect, collection): ''' target: set insert_buffer_size method: call get_config correctly and repeatedly expected: status ok ''' self.reset_configs(connect) for i in range(20): with pytest.raises(Exception) as e: relpy = connect.set_config("cache", "insert_buffer_size", '1GB') for i in range(20): with pytest.raises(Exception) as e: relpy = connect.set_config("cache", "insert_buffer_size", '2GB') @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_cache_out_of_memory_value_A(self, connect, collection): ''' target: set cache_size / insert_buffer_size to be out-of-memory method: call set_config with child values bigger than current system memory expected: status not ok (cache_size + insert_buffer_size < system memory) ''' self.reset_configs(connect) mem_total = self.get_memory_total(connect) logging.getLogger().info(mem_total) with pytest.raises(Exception) as e: relpy = connect.set_config("cache", "cache_size", str(int(mem_total + 1)+'')) class TestGPUConfig: """ ****************************************************************** The following cases are used to test `get_config` function ****************************************************************** """ @pytest.fixture(scope="function", autouse=True) def skip_http_check(self, args): if args["handler"] == "HTTP": pytest.skip("skip in http mode") @pytest.mark.level(2) def test_get_gpu_search_threshold_invalid_parent_key(self, connect, collection): ''' target: get invalid parent key method: call get_config without parent_key: gpu expected: status not ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") invalid_configs = ["Engine_config", "engine config"] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config(config, "gpu_search_threshold") @pytest.mark.level(2) def test_get_gpu_search_threshold_invalid_child_key(self, connect, collection): ''' target: get invalid child key method: call get_config without child_key: gpu_search_threshold expected: status not ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") invalid_configs = ["Gpu_search threshold", "gpusearchthreshold"] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config("gpu", config) @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_gpu_search_threshold_valid(self, connect, collection): ''' target: get gpu_search_threshold method: call get_config correctly expected: status ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") config_value = connect.get_config("gpu", "gpu_search_threshold") assert config_value """ ****************************************************************** The following cases are used to test `set_config` function ****************************************************************** """ @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_gpu_invalid_child_key(self, connect, collection): ''' target: set invalid child key method: call set_config with invalid child_key expected: status not ok ''' invalid_configs = ["abc", 1] for config in invalid_configs: with pytest.raises(Exception) as e: relpy = connect.set_config("gpu", config, 1000) @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_gpu_search_threshold_invalid_parent_key(self, connect, collection): ''' target: set invalid parent key method: call set_config without parent_key: gpu expected: status not ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") invalid_configs = ["Engine_config", "engine config"] for config in invalid_configs: with pytest.raises(Exception) as e: relpy = connect.set_config(config, "gpu_search_threshold", 1000) @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_gpu_search_threshold_valid(self, connect, collection): ''' target: set gpu_search_threshold method: call set_config correctly expected: status ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") relpy = connect.set_config("gpu", "gpu_search_threshold", 2000) config_value = connect.get_config("gpu", "gpu_search_threshold") assert config_value == '2000' @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_gpu_invalid_values(self, connect, collection): ''' target: set gpu method: call set_config with invalid child values expected: status not ok ''' for i in [-1, "1000\n", "1000\t", "1000.0", 1000.35]: with pytest.raises(Exception) as e: relpy = connect.set_config("gpu", "use_blas_threshold", i) if str(connect._cmd("mode")) == "GPU": with pytest.raises(Exception) as e: relpy = connect.set_config("gpu", "gpu_search_threshold", i) @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def reset_configs(self, connect): ''' reset configs so the tests are stable ''' relpy = connect.set_config("gpu", "cache_size", 1) config_value = connect.get_config("gpu", "cache_size") assert config_value == '1' #follows can not be changed #relpy = connect.set_config("gpu", "enable", "true") #config_value = connect.get_config("gpu", "enable") #assert config_value == "true" #relpy = connect.set_config("gpu", "search_devices", "gpu0") #config_value = connect.get_config("gpu", "search_devices") #assert config_value == 'gpu0' #relpy = connect.set_config("gpu", "build_index_devices", "gpu0") #config_value = connect.get_config("gpu", "build_index_devices") #assert config_value == 'gpu0' @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_gpu_enable_invalid_parent_key(self, connect, collection): ''' target: get invalid parent key method: call get_config without parent_key: gpu expected: status not ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") invalid_configs = ["Gpu_resource_config", "gpu resource config", \ "gpu_resource"] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config(config, "enable") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_gpu_enable_invalid_child_key(self, connect, collection): ''' target: get invalid child key method: call get_config without child_key: enable expected: status not ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") invalid_configs = ["Enab_le", "enab_le ", "disable", "true"] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config("gpu", config) @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_gpu_enable_valid(self, connect, collection): ''' target: get enable status method: call get_config correctly expected: status ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") config_value = connect.get_config("gpu", "enable") assert config_value == "true" or config_value == "false" @pytest.mark.level(2) def test_get_cache_size_invalid_parent_key(self, connect, collection): ''' target: get invalid parent key method: call get_config without parent_key: gpu expected: status not ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") invalid_configs = ["Gpu_resource_config", "gpu resource config", \ "gpu_resource"] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config(config, "cache_size") @pytest.mark.level(2) def test_get_cache_size_invalid_child_key(self, connect, collection): ''' target: get invalid child key method: call get_config without child_key: cache_size expected: status not ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") invalid_configs = ["Cache_capacity", "cachecapacity"] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config("gpu", config) @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_cache_size_valid(self, connect, collection): ''' target: get cache_size method: call get_config correctly expected: status ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") config_value = connect.get_config("gpu", "cache_size") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_search_devices_invalid_parent_key(self, connect, collection): ''' target: get invalid parent key method: call get_config without parent_key: gpu expected: status not ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") invalid_configs = ["Gpu_resource_config", "gpu resource config", \ "gpu_resource"] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config(config, "search_devices") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_search_devices_invalid_child_key(self, connect, collection): ''' target: get invalid child key method: call get_config without child_key: search_devices expected: status not ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") invalid_configs = ["Search_resources"] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config("gpu", config) @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_search_devices_valid(self, connect, collection): ''' target: get search_devices method: call get_config correctly expected: status ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") config_value = connect.get_config("gpu", "search_devices") logging.getLogger().info(config_value) @pytest.mark.level(2) def test_get_build_index_devices_invalid_parent_key(self, connect, collection): ''' target: get invalid parent key method: call get_config without parent_key: gpu expected: status not ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") invalid_configs = ["Gpu_resource_config", "gpu resource config", \ "gpu_resource"] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config(config, "build_index_devices") @pytest.mark.level(2) def test_get_build_index_devices_invalid_child_key(self, connect, collection): ''' target: get invalid child key method: call get_config without child_key: build_index_devices expected: status not ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") invalid_configs = ["Build_index_resources"] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config("gpu", config) @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_build_index_devices_valid(self, connect, collection): ''' target: get build_index_devices method: call get_config correctly expected: status ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") config_value = connect.get_config("gpu", "build_index_devices") logging.getLogger().info(config_value) assert config_value """ ****************************************************************** The following cases are used to test `set_config` function ****************************************************************** """ @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_gpu_enable_invalid_parent_key(self, connect, collection): ''' target: set invalid parent key method: call set_config without parent_key: gpu expected: status not ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") invalid_configs = ["Gpu_resource_config", "gpu resource config", \ "gpu_resource"] for config in invalid_configs: with pytest.raises(Exception) as e: relpy = connect.set_config(config, "enable", "true") @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_gpu_invalid_child_key(self, connect, collection): ''' target: set invalid child key method: call set_config with invalid child_key expected: status not ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") invalid_configs = ["Gpu_resource_config", "gpu resource config", \ "gpu_resource"] for config in invalid_configs: with pytest.raises(Exception) as e: relpy = connect.set_config("gpu", config, "true") @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_gpu_enable_invalid_values(self, connect, collection): ''' target: set "enable" param method: call set_config with invalid child values expected: status not ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") for i in [-1, -2, 100]: with pytest.raises(Exception) as e: relpy = connect.set_config("gpu", "enable", i) @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_gpu_enable_valid(self, connect, collection): ''' target: set "enable" param method: call set_config correctly expected: status ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") valid_configs = ["off", "False", "0", "nO", "on", "True", 1, "yES"] for config in valid_configs: with pytest.raises(Exception) as e: relpy = connect.set_config("gpu", "enable", config) @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_cache_size_invalid_parent_key(self, connect, collection): ''' target: set invalid parent key method: call set_config without parent_key: gpu expected: status not ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") invalid_configs = ["Gpu_resource_config", "gpu resource config", \ "gpu_resource"] for config in invalid_configs: with pytest.raises(Exception) as e: relpy = connect.set_config(config, "cache_size", 2) @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_cache_size_valid(self, connect, collection): ''' target: set cache_size method: call set_config correctly expected: status ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") relpy = connect.set_config("gpu", "cache_size", 2) @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_cache_size_invalid_values(self, connect, collection): ''' target: set cache_size method: call set_config with invalid child values expected: status not ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") self.reset_configs(connect) for i in [-1, "1\n", "1\t"]: logging.getLogger().info(i) with pytest.raises(Exception) as e: relpy = connect.set_config("gpu", "cache_size", i) @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_search_devices_invalid_parent_key(self, connect, collection): ''' target: set invalid parent key method: call set_config without parent_key: gpu expected: status not ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") invalid_configs = ["Gpu_resource_config", "gpu resource config", \ "gpu_resource"] for config in invalid_configs: with pytest.raises(Exception) as e: relpy = connect.set_config(config, "search_devices", "gpu0") @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_search_devices_valid(self, connect, collection): ''' target: set search_devices method: call set_config correctly expected: status ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") with pytest.raises(Exception) as e: relpy = connect.set_config("gpu", "search_devices", "gpu0") @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_search_devices_invalid_values(self, connect, collection): ''' target: set search_devices method: call set_config with invalid child values expected: status not ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") for i in [-1, "10", "gpu-1", "gpu0, gpu1", "gpu22,gpu44","gpu10000","gpu 0","-gpu0"]: with pytest.raises(Exception) as e: relpy = connect.set_config("gpu", "search_devices", i) @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_build_index_devices_invalid_parent_key(self, connect, collection): ''' target: set invalid parent key method: call set_config without parent_key: gpu expected: status not ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") invalid_configs = ["Gpu_resource_config", "gpu resource config", \ "gpu_resource"] for config in invalid_configs: with pytest.raises(Exception) as e: relpy = connect.set_config(config, "build_index_devices", "gpu0") @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_build_index_devices_valid(self, connect, collection): ''' target: set build_index_devices method: call set_config correctly expected: status ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") with pytest.raises(Exception) as e: relpy = connect.set_config("gpu", "build_index_devices", "gpu0") @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_build_index_devices_invalid_values(self, connect, collection): ''' target: set build_index_devices method: call set_config with invalid child values expected: status not ok ''' if str(connect._cmd("mode")) == "CPU": pytest.skip("Only support GPU mode") for i in [-1, "10", "gpu-1", "gpu0, gpu1", "gpu22,gpu44","gpu10000","gpu 0","-gpu0"]: with pytest.raises(Exception) as e: relpy = connect.set_config("gpu", "build_index_devices", i) self.reset_configs(connect) class TestNetworkConfig: """ ****************************************************************** The following cases are used to test `get_config` function ****************************************************************** """ @pytest.fixture(scope="function", autouse=True) def skip_http_check(self, args): if args["handler"] == "HTTP": pytest.skip("skip in http mode") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_address_invalid_child_key(self, connect, collection): ''' target: get invalid child key method: call get_config without child_key: address expected: status not ok ''' invalid_configs = ["Address", "addresses", "address "] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config("network", config) @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_address_valid(self, connect, collection): ''' target: get address method: call get_config correctly expected: status ok ''' config_value = connect.get_config("network", "bind.address") @pytest.mark.level(2) def test_get_port_invalid_child_key(self, connect, collection): ''' target: get invalid child key method: call get_config without child_key: port expected: status not ok ''' invalid_configs = ["Port", "PORT", "port "] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config("network", config) @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_port_valid(self, connect, collection): ''' target: get port method: call get_config correctly expected: status ok ''' config_value = connect.get_config("network", "http.port") assert config_value @pytest.mark.level(2) def test_get_http_port_invalid_child_key(self, connect, collection): ''' target: get invalid child key method: call get_config without child_key: http.port expected: status not ok ''' invalid_configs = ["webport", "Web_port", "http port "] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config("network", config) @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_http_port_valid(self, connect, collection): ''' target: get http.port method: call get_config correctly expected: status ok ''' config_value = connect.get_config("network", "http.port") assert config_value """ ****************************************************************** The following cases are used to test `set_config` function ****************************************************************** """ def gen_valid_timezones(self): timezones = [] for i in range(0, 13): timezones.append("UTC+" + str(i)) timezones.append("UTC-" + str(i)) timezones.extend(["UTC+13", "UTC+14"]) return timezones @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_network_invalid_child_key(self, connect, collection): ''' target: set invalid child key method: call set_config with invalid child_key expected: status not ok ''' with pytest.raises(Exception) as e: relpy = connect.set_config("network", "child_key", 19530) @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_address_valid(self, connect, collection): ''' target: set address method: call set_config correctly expected: status ok, set successfully ''' relpy = connect.set_config("network", "bind.address", '0.0.0.0') @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") def test_set_port_valid(self, connect, collection): ''' target: set port method: call set_config correctly expected: status ok, set successfully ''' for valid_port in [1025, 65534, 12345, "19530"]: relpy = connect.set_config("network", "http.port", valid_port) @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") def test_set_port_invalid(self, connect, collection): ''' target: set port method: call set_config with port number out of range(1024, 65535) expected: status not ok ''' for invalid_port in [1024, 65535, "0", "True", "100000"]: logging.getLogger().info(invalid_port) with pytest.raises(Exception) as e: relpy = connect.set_config("network", "http.port", invalid_port) @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") def test_set_http_port_valid(self, connect, collection): ''' target: set http.port method: call set_config correctly expected: status ok, set successfully ''' for valid_http_port in [1025, 65534, "12345", 19121]: relpy = connect.set_config("network", "http.port", valid_http_port) @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") def test_set_http_port_invalid(self, connect, collection): ''' target: set http.port method: call set_config with http.port number out of range(1024, 65535) expected: status not ok ''' for invalid_http_port in [1024, 65535, "0", "True", "1000000"]: with pytest.raises(Exception) as e: relpy = connect.set_config("network", "http.port", invalid_http_port) class TestGeneralConfig: """ ****************************************************************** The following cases are used to test `get_config` function ****************************************************************** """ @pytest.fixture(scope="function", autouse=True) def skip_http_check(self, args): if args["handler"] == "HTTP": pytest.skip("skip in http mode") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_meta_uri_invalid_child_key(self, connect, collection): ''' target: get invalid child key method: call get_config without child_key: meta_uri expected: status not ok ''' invalid_configs = ["backend_Url", "backend-url", "meta uri "] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config("general", config) @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_meta_uri_valid(self, connect, collection): ''' target: get meta_uri method: call get_config correctly expected: status ok ''' config_value = connect.get_config("general", "meta_uri") assert config_value @pytest.mark.level(2) def test_get_timezone_invalid_child_key(self, connect, collection): ''' target: get invalid child key method: call get_config without child_key: timezone expected: status not ok ''' invalid_configs = ["time", "time_zone "] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config("general", config) @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_timezone_valid(self, connect, collection): ''' target: get timezone method: call get_config correctly expected: status ok ''' config_value = connect.get_config("general", "timezone") assert "UTC" in config_value """ ****************************************************************** The following cases are used to test `set_config` function ****************************************************************** """ @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") def test_set_timezone_invalid(self, connect, collection): ''' target: set timezone method: call set_config with invalid timezone expected: status not ok ''' for invalid_timezone in ["utc++8", "UTC++8"]: logging.getLogger().info(invalid_timezone) with pytest.raises(Exception) as e: relpy = connect.set_config("general", "timezone", invalid_timezone) @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_general_invalid_child_key(self, connect, collection): ''' target: set invalid child key method: call set_config with invalid child_key expected: status not ok ''' with pytest.raises(Exception) as e: relpy = connect.set_config("general", "child_key", 1) @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_meta_uri_valid(self, connect, collection): ''' target: set meta_uri method: call set_config correctly expected: status ok, set successfully ''' relpy = connect.set_config("general", "meta_uri", 'sqlite://:@:/') class TestStorageConfig: """ ****************************************************************** The following cases are used to test `get_config` function ****************************************************************** """ @pytest.fixture(scope="function", autouse=True) def skip_http_check(self, args): if args["handler"] == "HTTP": pytest.skip("skip in http mode") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_path_invalid_child_key(self, connect, collection): ''' target: get invalid child key method: call get_config without child_key: path expected: status not ok ''' invalid_configs = ["Primary_path", "primarypath", "pa_th "] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config("storage", config) @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_path_valid(self, connect, collection): ''' target: get path method: call get_config correctly expected: status ok ''' config_value = connect.get_config("storage", "path") assert config_value @pytest.mark.level(2) def test_get_auto_flush_interval_invalid_child_key(self, connect, collection): ''' target: get invalid child key method: call get_config without child_key: auto_flush_interval expected: status not ok ''' invalid_configs = ["autoFlushInterval", "auto_flush", "auto_flush interval "] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config("storage", config) @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_auto_flush_interval_valid(self, connect, collection): ''' target: get auto_flush_interval method: call get_config correctly expected: status ok ''' config_value = connect.get_config("storage", "auto_flush_interval") """ ****************************************************************** The following cases are used to test `set_config` function ****************************************************************** """ @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_storage_invalid_child_key(self, connect, collection): ''' target: set invalid child key method: call set_config with invalid child_key expected: status not ok ''' with pytest.raises(Exception) as e: relpy = connect.set_config("storage", "child_key", "") @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_path_valid(self, connect, collection): ''' target: set path method: call set_config correctly expected: status ok, set successfully ''' relpy = connect.set_config("storage", "path", '/var/lib/milvus') @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") def test_set_auto_flush_interval_valid(self, connect, collection): ''' target: set auto_flush_interval method: call set_config correctly expected: status ok, set successfully ''' for valid_auto_flush_interval in [2, 1]: logging.getLogger().info(valid_auto_flush_interval) relpy = connect.set_config("storage", "auto_flush_interval", valid_auto_flush_interval) config_value = connect.get_config("storage", "auto_flush_interval") assert config_value == str(valid_auto_flush_interval) @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") def test_set_auto_flush_interval_invalid(self, connect, collection): ''' target: set auto_flush_interval method: call set_config with invalid auto_flush_interval expected: status not ok ''' for invalid_auto_flush_interval in [-1, "1.5", "invalid", "1+2"]: with pytest.raises(Exception) as e: relpy = connect.set_config("storage", "auto_flush_interval", invalid_auto_flush_interval) class TestMetricConfig: """ ****************************************************************** The following cases are used to test `get_config` function ****************************************************************** """ @pytest.fixture(scope="function", autouse=True) def skip_http_check(self, args): if args["handler"] == "HTTP": pytest.skip("skip in http mode") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_enable_invalid_child_key(self, connect, collection): ''' target: get invalid child key method: call get_config without child_key: enable expected: status not ok ''' invalid_configs = ["enablemonitor", "Enable_monitor", "en able "] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config("metric", config) @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_enable_valid(self, connect, collection): ''' target: get enable method: call get_config correctly expected: status ok ''' config_value = connect.get_config("metric", "enable") assert config_value @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_address_invalid_child_key(self, connect, collection): ''' target: get invalid child key method: call get_config without child_key: address expected: status not ok ''' invalid_configs = ["Add ress", "addresses", "add ress "] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config("metric", config) @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_address_valid(self, connect, collection): ''' target: get address method: call get_config correctly expected: status ok ''' config_value = connect.get_config("metric", "address") assert config_value @pytest.mark.level(2) def test_get_port_invalid_child_key(self, connect, collection): ''' target: get invalid child key method: call get_config without child_key: port expected: status not ok ''' invalid_configs = ["Po_rt", "PO_RT", "po_rt "] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config("metric", config) @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_port_valid(self, connect, collection): ''' target: get port method: call get_config correctly expected: status ok ''' config_value = connect.get_config("metric", "port") assert config_value """ ****************************************************************** The following cases are used to test `set_config` function ****************************************************************** """ @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_metric_invalid_child_key(self, connect, collection): ''' target: set invalid child key method: call set_config with invalid child_key expected: status not ok ''' with pytest.raises(Exception) as e: relpy = connect.set_config("metric", "child_key", 19530) @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") def test_set_enable_valid(self, connect, collection): ''' target: set enable method: call set_config correctly expected: status ok, set successfully ''' for valid_enable in ["false", "true"]: relpy = connect.set_config("metric", "enable", valid_enable) @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_address_valid(self, connect, collection): ''' target: set address method: call set_config correctly expected: status ok, set successfully ''' relpy = connect.set_config("metric", "address", '127.0.0.1') @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") def test_set_port_valid(self, connect, collection): ''' target: set port method: call set_config correctly expected: status ok, set successfully ''' for valid_port in [1025, 65534, "19530", "9091"]: relpy = connect.set_config("metric", "port", valid_port) @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") def test_set_port_invalid(self, connect, collection): ''' target: set port method: call set_config with port number out of range(1024, 65535), or same as http.port number expected: status not ok ''' for invalid_port in [1024, 65535, "0", "True", "100000"]: with pytest.raises(Exception) as e: relpy = connect.set_config("metric", "port", invalid_port) class TestWALConfig: """ ****************************************************************** The following cases are used to test `get_config` function ****************************************************************** """ @pytest.fixture(scope="function", autouse=True) def skip_http_check(self, args): if args["handler"] == "HTTP": pytest.skip("skip in http mode") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_enable_invalid_child_key(self, connect, collection): ''' target: get invalid child key method: call get_config without child_key: enable expected: status not ok ''' invalid_configs = ["enabled", "Enab_le", "enable_"] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config("wal", config) @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_enable_valid(self, connect, collection): ''' target: get enable method: call get_config correctly expected: status ok ''' config_value = connect.get_config("wal", "enable") assert config_value @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_recovery_error_ignore_invalid_child_key(self, connect, collection): ''' target: get invalid child key method: call get_config without child_key: recovery_error_ignore expected: status not ok ''' invalid_configs = ["recovery-error-ignore", "Recovery error_ignore", "recoveryxerror_ignore "] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config("wal", config) @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_recovery_error_ignore_valid(self, connect, collection): ''' target: get recovery_error_ignore method: call get_config correctly expected: status ok ''' config_value = connect.get_config("wal", "recovery_error_ignore") assert config_value @pytest.mark.level(2) def test_get_buffer_size_invalid_child_key(self, connect, collection): ''' target: get invalid child key method: call get_config without child_key: buffer_size expected: status not ok ''' invalid_configs = ["buffersize", "Buffer size", "buffer size "] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config("wal", config) @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_buffer_size_valid(self, connect, collection): ''' target: get buffer_size method: call get_config correctly expected: status ok ''' config_value = connect.get_config("wal", "buffer_size") assert config_value @pytest.mark.level(2) def test_get_wal_path_invalid_child_key(self, connect, collection): ''' target: get invalid child key method: call get_config without child_key: wal_path expected: status not ok ''' invalid_configs = ["wal", "Wal_path", "wal_path "] for config in invalid_configs: with pytest.raises(Exception) as e: config_value = connect.get_config("wal", config) @pytest.mark.timeout(CONFIG_TIMEOUT) def test_get_wal_path_valid(self, connect, collection): ''' target: get wal_path method: call get_config correctly expected: status ok ''' config_value = connect.get_config("wal", "path") assert config_value """ ****************************************************************** The following cases are used to test `set_config` function ****************************************************************** """ @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_wal_invalid_child_key(self, connect, collection): ''' target: set invalid child key method: call set_config with invalid child_key expected: status not ok ''' with pytest.raises(Exception) as e: relpy = connect.set_config("wal", "child_key", 256) @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") def test_set_enable_valid(self, connect, collection): ''' target: set enable method: call set_config correctly expected: status ok, set successfully ''' for valid_enable in ["false", "true"]: relpy = connect.set_config("wal", "enable", valid_enable) @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") def test_set_recovery_error_ignore_valid(self, connect, collection): ''' target: set recovery_error_ignore method: call set_config correctly expected: status ok, set successfully ''' for valid_recovery_error_ignore in ["false", "true"]: relpy = connect.set_config("wal", "recovery_error_ignore", valid_recovery_error_ignore) @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") def test_set_buffer_size_valid_A(self, connect, collection): ''' target: set buffer_size method: call set_config correctly expected: status ok, set successfully ''' for valid_buffer_size in ["64MB", "128MB", "4096MB", "1000MB", "256MB"]: relpy = connect.set_config("wal", "buffer_size", valid_buffer_size) @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.") @pytest.mark.timeout(CONFIG_TIMEOUT) def test_set_wal_path_valid(self, connect, collection, args): ''' target: set wal_path method: call set_config correctly expected: status ok, set successfully ''' relpy = connect.set_config("wal", "path", "/var/lib/milvus/wal")
40.309001
105
0.612156
6,677
56,876
5.007638
0.03879
0.041273
0.062178
0.079136
0.924602
0.907764
0.887367
0.869422
0.843103
0.834819
0
0.010664
0.254747
56,876
1,410
106
40.337589
0.778163
0.206203
0
0.679083
0
0
0.176644
0.00267
0
0
0
0
0.035817
1
0.159026
false
0
0.012894
0
0.186246
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
07b550efd9e401e34556fbcb9cfb2e316f60de3d
148
py
Python
upbit_wrapper/__init__.py
beomsu317/upbit_wrapper
54b92a51276d130dd679bde39975eeb32a3ac4a3
[ "MIT" ]
1
2021-02-25T18:49:22.000Z
2021-02-25T18:49:22.000Z
upbit_wrapper/__init__.py
beomsu317/upbit_wrapper
54b92a51276d130dd679bde39975eeb32a3ac4a3
[ "MIT" ]
null
null
null
upbit_wrapper/__init__.py
beomsu317/upbit_wrapper
54b92a51276d130dd679bde39975eeb32a3ac4a3
[ "MIT" ]
null
null
null
""" Package """ from upbit_wrapper.upbit import Upbit from upbit_wrapper.upbit_websocket import UpbitWebSocket __all__ = ['Upbit','UpbitWebSocket']
21.142857
56
0.797297
17
148
6.529412
0.470588
0.162162
0.288288
0.378378
0
0
0
0
0
0
0
0
0.094595
148
7
57
21.142857
0.828358
0.047297
0
0
0
0
0.141791
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
6
07bd76a8ed8d6d190b8f42e4ad406843467a5322
944
py
Python
smart_selects/urls.py
johtso/django-smart-selects
d1c310240db056e211f8667c4e0658d44421c449
[ "BSD-3-Clause" ]
null
null
null
smart_selects/urls.py
johtso/django-smart-selects
d1c310240db056e211f8667c4e0658d44421c449
[ "BSD-3-Clause" ]
null
null
null
smart_selects/urls.py
johtso/django-smart-selects
d1c310240db056e211f8667c4e0658d44421c449
[ "BSD-3-Clause" ]
null
null
null
from smart_selects import views try: from django.conf.urls.defaults import url except ImportError: from django.conf.urls import url urlpatterns = [ url(r'^all/(?P<app>[\w\-]+)/(?P<model>[\w\-]+)/(?P<field>[\w\-]+)/(?P<foreign_key_app_name>[\w\-]+)/(?P<foreign_key_model_name>[\w\-]+)/(?P<foreign_key_field_name>[\w\-]+)/(?P<value>[\w\-]+)/$', views.filterchain_all, name='chained_filter_all'), url(r'^filter/(?P<app>[\w\-]+)/(?P<model>[\w\-]+)/(?P<field>[\w\-]+)/(?P<foreign_key_app_name>[\w\-]+)/(?P<foreign_key_model_name>[\w\-]+)/(?P<foreign_key_field_name>[\w\-]+)/(?P<value>[\w\-]+)/$', views.filterchain, name='chained_filter'), url(r'^filter/(?P<app>[\w\-]+)/(?P<model>[\w\-]+)/(?P<manager>[\w\-]+)/(?P<field>[\w\-]+)/(?P<foreign_key_app_name>[\w\-]+)/(?P<foreign_key_model_name>[\w\-]+)/(?P<foreign_key_field_name>[\w\-]+)/(?P<value>[\w\-]+)/$', views.filterchain, name='chained_filter'), ]
62.933333
222
0.587924
141
944
3.702128
0.205674
0.072797
0.155172
0.206897
0.699234
0.699234
0.699234
0.699234
0.699234
0.699234
0
0
0.077331
944
14
223
67.428571
0.599311
0
0
0.153846
0
0.230769
0.668432
0.619703
0
0
0
0
0
1
0
false
0
0.307692
0
0.307692
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
1
1
1
null
0
0
0
0
0
0
0
0
1
0
0
0
0
6
07d4a1e8fa2bc8f58f0e64e257ed47c16ffe481a
242
py
Python
release/stubs.min/System/Windows/Controls/__init___parts/ItemContainerTemplateSelector.py
htlcnn/ironpython-stubs
780d829e2104b2789d5f4d6f32b0ec9f2930ca03
[ "MIT" ]
182
2017-06-27T02:26:15.000Z
2022-03-30T18:53:43.000Z
release/stubs.min/System/Windows/Controls/__init___parts/ItemContainerTemplateSelector.py
htlcnn/ironpython-stubs
780d829e2104b2789d5f4d6f32b0ec9f2930ca03
[ "MIT" ]
28
2017-06-27T13:38:23.000Z
2022-03-15T11:19:44.000Z
release/stubs.min/System/Windows/Controls/__init___parts/ItemContainerTemplateSelector.py
htlcnn/ironpython-stubs
780d829e2104b2789d5f4d6f32b0ec9f2930ca03
[ "MIT" ]
67
2017-06-28T09:43:59.000Z
2022-03-20T21:17:10.000Z
class ItemContainerTemplateSelector(object): # no doc def SelectTemplate(self,item,parentItemsControl): """ SelectTemplate(self: ItemContainerTemplateSelector,item: object,parentItemsControl: ItemsControl) -> DataTemplate """ pass
40.333333
124
0.789256
19
242
10.052632
0.684211
0.188482
0
0
0
0
0
0
0
0
0
0
0.11157
242
5
125
48.4
0.888372
0.504132
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0.333333
0
0
0.666667
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
6
ed41d00dce1ee437878103b47c2e1d8d1ed81d49
36
py
Python
pyqt_bounding_box/__init__.py
yjg30737/pyqt-selection-box
9d67631b1c63e16c8b4f8da700c8288834c0fc8d
[ "MIT" ]
1
2022-01-10T15:08:54.000Z
2022-01-10T15:08:54.000Z
pyqt_bounding_box/__init__.py
yjg30737/pyqt-selection-box
9d67631b1c63e16c8b4f8da700c8288834c0fc8d
[ "MIT" ]
null
null
null
pyqt_bounding_box/__init__.py
yjg30737/pyqt-selection-box
9d67631b1c63e16c8b4f8da700c8288834c0fc8d
[ "MIT" ]
1
2022-01-10T15:09:00.000Z
2022-01-10T15:09:00.000Z
from .boundingBox import BoundingBox
36
36
0.888889
4
36
8
0.75
0
0
0
0
0
0
0
0
0
0
0
0.083333
36
1
36
36
0.969697
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
ed59dcce2b61ffcd37fc4be33bb30e1fdf55f928
38
py
Python
livedoor/__init__.py
rinatz/livedoor-news-dataset
20b2818f57bfd59e3a1bc51cc2ed1b9fd771b873
[ "MIT" ]
null
null
null
livedoor/__init__.py
rinatz/livedoor-news-dataset
20b2818f57bfd59e3a1bc51cc2ed1b9fd771b873
[ "MIT" ]
null
null
null
livedoor/__init__.py
rinatz/livedoor-news-dataset
20b2818f57bfd59e3a1bc51cc2ed1b9fd771b873
[ "MIT" ]
null
null
null
from livedoor.model import load_model
19
37
0.868421
6
38
5.333333
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.105263
38
1
38
38
0.941176
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
9c26b84591210f3a64412afdbbed8f24caf55e29
13,732
py
Python
tests/test_graph.py
venaturum/piso
54fd20443efb84d7a9982c92caf492b12206eaef
[ "MIT" ]
5
2021-10-10T04:17:17.000Z
2022-03-01T06:23:25.000Z
tests/test_graph.py
venaturum/piso
54fd20443efb84d7a9982c92caf492b12206eaef
[ "MIT" ]
35
2021-10-09T13:22:04.000Z
2022-01-29T08:38:15.000Z
tests/test_graph.py
staircase-dev/piso
2e6ac861f7166195e2fe67e2665c29e36b4ff12e
[ "MIT" ]
null
null
null
import numpy as np import pandas as pd import pytest import piso import piso.graph as piso_graph from piso import register_accessors register_accessors() def get_accessor_method(self, function): return { piso_graph.adjacency_matrix: self.piso.adjacency_matrix, }[function] def get_package_method(function): return { piso_graph.adjacency_matrix: piso.adjacency_matrix, }[function] def perform_op(*args, how, function, **kwargs): # how = "supplied, accessor, or package" if how == "accessor": self, *args = args return get_accessor_method(self, function)(*args, **kwargs) elif how == "package": return get_package_method(function)(*args, **kwargs) else: return function(*args, **kwargs) def map_to_dates(obj, date_type): def make_date(x): ts = pd.to_datetime(x, unit="d", origin="2021-09-30") if date_type == "numpy": return ts.to_numpy() if date_type == "datetime": return ts.to_pydatetime() if date_type == "timedelta": return ts - pd.Timestamp("2021-10-1") return ts if isinstance(obj, (pd.IntervalIndex, pd.arrays.IntervalArray)): return obj.from_arrays( obj.left.map(make_date), obj.right.map(make_date), obj.closed, ) elif isinstance(obj, list): return [make_date(x) for x in obj] @pytest.mark.parametrize( "closed", ["left", "right", "neither"], ) @pytest.mark.parametrize( "interval_index", [True, False], ) @pytest.mark.parametrize( "include_index", [True, False], ) @pytest.mark.parametrize( "date_type", ["timestamp", "numpy", "datetime", "timedelta", None], ) @pytest.mark.parametrize( "how", ["supplied", "accessor", "package"], ) def test_adjacency_matrix_intersects_1( closed, interval_index, include_index, date_type, how ): interval_array = pd.arrays.IntervalArray.from_tuples( [(0, 4), (3, 6), (5, 7), (8, 9), (9, 10)], closed=closed, ) if interval_index: interval_array = pd.IntervalIndex(interval_array) if date_type: interval_array = map_to_dates(interval_array, date_type) expected = np.array( [ [False, True, False, False, False], [True, False, True, False, False], [False, True, False, False, False], [False, False, False, False, False], [False, False, False, False, False], ] ) result = perform_op( interval_array, how=how, function=piso_graph.adjacency_matrix, edges="intersect", include_index=include_index, ) if include_index: expected = pd.DataFrame(expected, columns=interval_array, index=interval_array) pd.testing.assert_frame_equal(result, expected) else: assert np.array_equal(result, expected) @pytest.mark.parametrize( "interval_index", [True, False], ) @pytest.mark.parametrize( "include_index", [True, False], ) @pytest.mark.parametrize( "date_type", ["timestamp", "numpy", "datetime", "timedelta", None], ) @pytest.mark.parametrize( "how", ["supplied", "accessor", "package"], ) def test_adjacency_matrix_intersects_2(interval_index, include_index, date_type, how): interval_array = pd.arrays.IntervalArray.from_tuples( [(0, 4), (3, 6), (5, 7), (8, 9), (9, 10)], closed="both", ) if interval_index: interval_array = pd.IntervalIndex(interval_array) if date_type: interval_array = map_to_dates(interval_array, date_type) expected = np.array( [ [False, True, False, False, False], [True, False, True, False, False], [False, True, False, False, False], [False, False, False, False, True], [False, False, False, True, False], ] ) result = perform_op( interval_array, how=how, function=piso_graph.adjacency_matrix, edges="intersect", include_index=include_index, ) if include_index: expected = pd.DataFrame(expected, columns=interval_array, index=interval_array) pd.testing.assert_frame_equal(result, expected) else: assert np.array_equal(result, expected) @pytest.mark.parametrize( "closed", ["left", "right", "neither"], ) @pytest.mark.parametrize( "interval_index", [True, False], ) @pytest.mark.parametrize( "include_index", [True, False], ) @pytest.mark.parametrize( "date_type", ["timestamp", "numpy", "datetime", "timedelta", None], ) @pytest.mark.parametrize( "how", ["supplied", "accessor", "package"], ) def test_adjacency_matrix_disjoint_1( closed, interval_index, include_index, date_type, how ): interval_array = pd.arrays.IntervalArray.from_tuples( [(0, 4), (3, 6), (5, 7), (8, 9), (9, 10)], closed=closed, ) if interval_index: interval_array = pd.IntervalIndex(interval_array) if date_type: interval_array = map_to_dates(interval_array, date_type) expected = np.array( [ [False, False, True, True, True], [False, False, False, True, True], [True, False, False, True, True], [True, True, True, False, True], [True, True, True, True, False], ] ) result = perform_op( interval_array, how=how, function=piso_graph.adjacency_matrix, edges="disjoint", include_index=include_index, ) if include_index: expected = pd.DataFrame(expected, columns=interval_array, index=interval_array) pd.testing.assert_frame_equal(result, expected) else: assert np.array_equal(result, expected) @pytest.mark.parametrize( "interval_index", [True, False], ) @pytest.mark.parametrize( "include_index", [True, False], ) @pytest.mark.parametrize( "date_type", ["timestamp", "numpy", "datetime", "timedelta", None], ) @pytest.mark.parametrize( "how", ["supplied", "accessor", "package"], ) def test_adjacency_matrix_disjoint_2(interval_index, include_index, date_type, how): interval_array = pd.arrays.IntervalArray.from_tuples( [(0, 4), (3, 6), (5, 7), (8, 9), (9, 10)], closed="both", ) if interval_index: interval_array = pd.IntervalIndex(interval_array) if date_type: interval_array = map_to_dates(interval_array, date_type) expected = np.array( [ [False, False, True, True, True], [False, False, False, True, True], [True, False, False, True, True], [True, True, True, False, False], [True, True, True, False, False], ] ) result = perform_op( interval_array, how=how, function=piso_graph.adjacency_matrix, edges="disjoint", include_index=include_index, ) if include_index: expected = pd.DataFrame(expected, columns=interval_array, index=interval_array) pd.testing.assert_frame_equal(result, expected) else: assert np.array_equal(result, expected) @pytest.mark.parametrize( "closed", ["left", "right", "both", "neither"], ) @pytest.mark.parametrize( "how", ["supplied", "accessor", "package"], ) def test_adjacency_matrix_edges_exception(closed, how): interval_array = pd.arrays.IntervalArray.from_tuples( [(0, 4), (3, 6), (5, 7), (8, 9), (9, 10)], closed=closed, ) with pytest.raises(ValueError): perform_op( interval_array, how=how, function=piso_graph.adjacency_matrix, edges="not_an_option", ) # ---------------- SET OF SETS -------------------- def make_interval_list(interval_index, closed): klass = pd.IntervalIndex if interval_index else pd.arrays.IntervalArray ii1 = klass.from_tuples([(0, 3), (2, 8), (11, 15)], closed=closed) ii2 = klass.from_tuples([(3, 5), (7, 12), (16, 20)], closed=closed) ii3 = klass.from_tuples([(9, 11), (25, 26)], closed=closed) ii4 = klass.from_tuples([(23, 24)], closed=closed) return [ii1, ii2, ii3, ii4] @pytest.mark.parametrize( "closed", ["left", "right", "neither"], ) @pytest.mark.parametrize( "interval_index", [True, False], ) @pytest.mark.parametrize( "include_index", [True, False], ) @pytest.mark.parametrize( "date_type", ["timestamp", "numpy", "datetime", "timedelta", None], ) @pytest.mark.parametrize( "how", ["supplied", "accessor", "package"], ) def test_adjacency_matrix_set_of_sets_intersects_1( closed, interval_index, include_index, date_type, how ): interval_list = make_interval_list(interval_index, closed) if date_type: interval_list = [map_to_dates(i, date_type) for i in interval_list] expected = np.array( [ [False, True, False, False], [True, False, True, False], [False, True, False, False], [False, False, False, False], ] ) result = perform_op( *interval_list, how=how, function=piso_graph.adjacency_matrix, edges="intersect", include_index=include_index, ) if include_index: expected = pd.DataFrame(expected, columns=range(4), index=range(4)) pd.testing.assert_frame_equal(result, expected) else: assert np.array_equal(result, expected) @pytest.mark.parametrize( "interval_index", [True, False], ) @pytest.mark.parametrize( "include_index", [True, False], ) @pytest.mark.parametrize( "date_type", ["timestamp", "numpy", "datetime", "timedelta", None], ) @pytest.mark.parametrize( "how", ["supplied", "accessor", "package"], ) def test_adjacency_matrix_set_of_sets_intersects_2( interval_index, include_index, date_type, how ): interval_list = make_interval_list(interval_index, closed="both") if date_type: interval_list = [map_to_dates(i, date_type) for i in interval_list] expected = np.array( [ [False, True, True, False], [True, False, True, False], [True, True, False, False], [False, False, False, False], ] ) result = perform_op( *interval_list, how=how, function=piso_graph.adjacency_matrix, edges="intersect", include_index=include_index, ) if include_index: expected = pd.DataFrame(expected, columns=range(4), index=range(4)) pd.testing.assert_frame_equal(result, expected) else: assert np.array_equal(result, expected) @pytest.mark.parametrize( "closed", ["left", "right", "neither"], ) @pytest.mark.parametrize( "interval_index", [True, False], ) @pytest.mark.parametrize( "include_index", [True, False], ) @pytest.mark.parametrize( "date_type", ["timestamp", "numpy", "datetime", "timedelta", None], ) @pytest.mark.parametrize( "how", ["supplied", "accessor", "package"], ) def test_adjacency_matrix_set_of_sets_disjoint_1( closed, interval_index, include_index, date_type, how ): interval_list = make_interval_list(interval_index, closed=closed) if date_type: interval_list = [map_to_dates(i, date_type) for i in interval_list] expected = np.array( [ [False, False, True, True], [False, False, False, True], [True, False, False, True], [True, True, True, False], ] ) result = perform_op( *interval_list, how=how, function=piso_graph.adjacency_matrix, edges="disjoint", include_index=include_index, ) if include_index: expected = pd.DataFrame(expected, columns=range(4), index=range(4)) pd.testing.assert_frame_equal(result, expected) else: assert np.array_equal(result, expected) @pytest.mark.parametrize( "interval_index", [True, False], ) @pytest.mark.parametrize( "include_index", [True, False], ) @pytest.mark.parametrize( "date_type", ["timestamp", "numpy", "datetime", "timedelta", None], ) @pytest.mark.parametrize( "how", ["supplied", "accessor", "package"], ) def test_adjacency_matrix_set_of_sets_disjoint_2( interval_index, include_index, date_type, how ): interval_list = make_interval_list(interval_index, closed="both") if date_type: interval_list = [map_to_dates(i, date_type) for i in interval_list] expected = np.array( [ [False, False, False, True], [False, False, False, True], [False, False, False, True], [True, True, True, False], ] ) result = perform_op( *interval_list, how=how, function=piso_graph.adjacency_matrix, edges="disjoint", include_index=include_index, ) if include_index: expected = pd.DataFrame(expected, columns=range(4), index=range(4)) pd.testing.assert_frame_equal(result, expected) else: assert np.array_equal(result, expected) @pytest.mark.parametrize( "closed", ["left", "right", "both", "neither"], ) @pytest.mark.parametrize( "how", ["supplied", "accessor", "package"], ) def test_adjacency_matrix_set_of_sets_edges_exception(closed, how): interval_list = make_interval_list(interval_index=True, closed=closed) with pytest.raises(ValueError): perform_op( *interval_list, how=how, function=piso_graph.adjacency_matrix, edges="not_an_option", )
26.458574
87
0.615424
1,569
13,732
5.173996
0.078394
0.07391
0.103474
0.049273
0.886056
0.864868
0.850086
0.843927
0.835427
0.818428
0
0.011807
0.247524
13,732
518
88
26.509653
0.773831
0.006408
0
0.68709
0
0
0.080859
0
0
0
0
0
0.035011
1
0.035011
false
0
0.013129
0.004376
0.074398
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
9c5f3d8c730182e6d4226e5d2b0b136ff6c29d49
17
py
Python
Chapter-9 Regression/untitled0.py
jaiswalIT02/pythonprograms
bc94e52121202b04c3e9112d9786f93ed6707f7a
[ "MIT" ]
null
null
null
Chapter-9 Regression/untitled0.py
jaiswalIT02/pythonprograms
bc94e52121202b04c3e9112d9786f93ed6707f7a
[ "MIT" ]
null
null
null
Chapter-9 Regression/untitled0.py
jaiswalIT02/pythonprograms
bc94e52121202b04c3e9112d9786f93ed6707f7a
[ "MIT" ]
null
null
null
x=2+3 print("x")
5.666667
10
0.529412
5
17
1.8
0.8
0
0
0
0
0
0
0
0
0
0
0.133333
0.117647
17
2
11
8.5
0.466667
0
0
0
0
0
0.058824
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
6
92da48ab0c6ea13a1a37bc8bac2434a564a82526
19,849
py
Python
src/apify_client/clients/resource_clients/dataset.py
apifytech/apify-client-python
ebefbae724fcb11621ce666a3229206fe03ab486
[ "Apache-2.0" ]
5
2021-09-20T08:07:21.000Z
2022-02-23T13:15:05.000Z
src/apify_client/clients/resource_clients/dataset.py
apifytech/apify-client-python
ebefbae724fcb11621ce666a3229206fe03ab486
[ "Apache-2.0" ]
33
2020-11-08T23:24:08.000Z
2021-09-20T08:42:44.000Z
src/apify_client/clients/resource_clients/dataset.py
apify/apify-client-python
ebefbae724fcb11621ce666a3229206fe03ab486
[ "Apache-2.0" ]
null
null
null
import io from typing import Any, Dict, Generator, List, Optional, cast from ..._types import JSONSerializable from ..._utils import ListPage from ..base import ResourceClient class DatasetClient(ResourceClient): """Sub-client for manipulating a single dataset.""" def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the DatasetClient.""" resource_path = kwargs.pop('resource_path', 'datasets') super().__init__(*args, resource_path=resource_path, **kwargs) def get(self) -> Optional[Dict]: """Retrieve the dataset. https://docs.apify.com/api/v2#/reference/datasets/dataset/get-dataset Returns: dict, optional: The retrieved dataset, or None, if it does not exist """ return self._get() def update(self, *, name: Optional[str] = None) -> Dict: """Update the dataset with specified fields. https://docs.apify.com/api/v2#/reference/datasets/dataset/update-dataset Args: name (str, optional): The new name for the dataset Returns: dict: The updated dataset """ updated_fields = {} if name is not None: updated_fields['name'] = name return self._update(updated_fields) def delete(self) -> None: """Delete the dataset. https://docs.apify.com/api/v2#/reference/datasets/dataset/delete-dataset """ return self._delete() def list_items( self, *, offset: Optional[int] = None, limit: Optional[int] = None, clean: Optional[bool] = None, desc: Optional[bool] = None, fields: Optional[List[str]] = None, omit: Optional[List[str]] = None, unwind: Optional[str] = None, skip_empty: Optional[bool] = None, skip_hidden: Optional[bool] = None, ) -> ListPage: """List the items of the dataset. https://docs.apify.com/api/v2#/reference/datasets/item-collection/get-items Args: offset (int, optional): Number of items that should be skipped at the start. The default value is 0 limit (int, optional): Maximum number of items to return. By default there is no limit. desc (bool, optional): By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to True. clean (bool, optional): If True, returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The clean parameter is just a shortcut for skip_hidden=True and skip_empty=True parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the limit value. fields (list of str, optional): A list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the fields parameter. You can use this feature to effectively fix the output format. omit (list of str, optional): A list of fields which should be omitted from the items. unwind (str, optional): Name of a field which should be unwound. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object, then the item gets preserved as it is. Note that the unwound items ignore the desc parameter. skip_empty (bool, optional): If True, then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. skip_hidden (bool, optional): If True, then hidden fields are skipped from the output, i.e. fields starting with the # character. Returns: ListPage: A page of the list of dataset items according to the specified filters. """ request_params = self._params( offset=offset, limit=limit, desc=desc, clean=clean, fields=fields, omit=omit, unwind=unwind, skipEmpty=skip_empty, skipHidden=skip_hidden, ) response = self.http_client.call( url=self._url('items'), method='GET', params=request_params, ) data = response.json() return ListPage({ 'items': data, 'total': int(response.headers['x-apify-pagination-total']), 'offset': int(response.headers['x-apify-pagination-offset']), 'count': len(data), # because x-apify-pagination-count returns invalid values when hidden/empty items are skipped 'limit': int(response.headers['x-apify-pagination-limit']), # API returns 999999999999 when no limit is used 'desc': bool(response.headers['x-apify-pagination-desc']), }) def iterate_items( self, *, offset: int = 0, limit: Optional[int] = None, clean: Optional[bool] = None, desc: Optional[bool] = None, fields: Optional[List[str]] = None, omit: Optional[List[str]] = None, unwind: Optional[str] = None, skip_empty: Optional[bool] = None, skip_hidden: Optional[bool] = None, ) -> Generator: """Iterate over the items in the dataset. https://docs.apify.com/api/v2#/reference/datasets/item-collection/get-items Args: offset (int, optional): Number of items that should be skipped at the start. The default value is 0 limit (int, optional): Maximum number of items to return. By default there is no limit. desc (bool, optional): By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to True. clean (bool, optional): If True, returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The clean parameter is just a shortcut for skip_hidden=True and skip_empty=True parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the limit value. fields (list of str, optional): A list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the fields parameter. You can use this feature to effectively fix the output format. omit (list of str, optional): A list of fields which should be omitted from the items. unwind (str, optional): Name of a field which should be unwound. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object, then the item gets preserved as it is. Note that the unwound items ignore the desc parameter. skip_empty (bool, optional): If True, then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. skip_hidden (bool, optional): If True, then hidden fields are skipped from the output, i.e. fields starting with the # character. Yields: dict: An item from the dataset """ cache_size = 1000 first_item = offset # If there is no limit, set last_item to None until we get the total from the first API response if limit is None: last_item = None else: last_item = offset + limit current_offset = first_item while last_item is None or current_offset < last_item: if last_item is None: current_limit = cache_size else: current_limit = min(cache_size, last_item - current_offset) current_items_page = self.list_items( offset=current_offset, limit=current_limit, clean=clean, desc=desc, fields=fields, omit=omit, unwind=unwind, skip_empty=skip_empty, skip_hidden=skip_hidden, ) current_offset += current_items_page.count if last_item is None or current_items_page.total < last_item: last_item = current_items_page.total yield from current_items_page.items def download_items( self, *, item_format: str = 'json', offset: Optional[int] = None, limit: Optional[int] = None, desc: Optional[bool] = None, clean: Optional[bool] = None, bom: Optional[bool] = None, delimiter: Optional[str] = None, fields: Optional[List[str]] = None, omit: Optional[List[str]] = None, unwind: Optional[str] = None, skip_empty: Optional[bool] = None, skip_header_row: Optional[bool] = None, skip_hidden: Optional[bool] = None, xml_root: Optional[str] = None, xml_row: Optional[str] = None, ) -> bytes: """Download the items in the dataset as raw bytes. https://docs.apify.com/api/v2#/reference/datasets/item-collection/get-items Args: item_format (str): Format of the results, possible values are: json, jsonl, csv, html, xlsx, xml and rss. The default value is json. offset (int, optional): Number of items that should be skipped at the start. The default value is 0 limit (int, optional): Maximum number of items to return. By default there is no limit. desc (bool, optional): By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to True. clean (bool, optional): If True, returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The clean parameter is just a shortcut for skip_hidden=True and skip_empty=True parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the limit value. bom (bool, optional): All text responses are encoded in UTF-8 encoding. By default, csv files are prefixed with the UTF-8 Byte Order Mark (BOM), while json, jsonl, xml, html and rss files are not. If you want to override this default behavior, specify bom=True query parameter to include the BOM or bom=False to skip it. delimiter (str, optional): A delimiter character for CSV files. The default delimiter is a simple comma (,). fields (list of str, optional): A list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the fields parameter. You can use this feature to effectively fix the output format. omit (list of str, optional): A list of fields which should be omitted from the items. unwind (str, optional): Name of a field which should be unwound. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object, then the item gets preserved as it is. Note that the unwound items ignore the desc parameter. skip_empty (bool, optional): If True, then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. skip_header_row (bool, optional): If True, then header row in the csv format is skipped. skip_hidden (bool, optional): If True, then hidden fields are skipped from the output, i.e. fields starting with the # character. xml_root (str, optional): Overrides default root element name of xml output. By default the root element is items. xml_row (str, optional): Overrides default element name that wraps each page or page function result object in xml output. By default the element name is item. Returns: bytes: The dataset items as raw bytes """ request_params = self._params( format=item_format, offset=offset, limit=limit, desc=desc, clean=clean, bom=bom, delimiter=delimiter, fields=fields, omit=omit, unwind=unwind, skipEmpty=skip_empty, skipHeaderRow=skip_header_row, skipHidden=skip_hidden, xmlRoot=xml_root, xmlRow=xml_row, ) response = self.http_client.call( url=self._url('items'), method='GET', params=request_params, parse_response=False, ) return response.content def stream_items( self, *, item_format: str = 'json', offset: Optional[int] = None, limit: Optional[int] = None, desc: Optional[bool] = None, clean: Optional[bool] = None, bom: Optional[bool] = None, delimiter: Optional[str] = None, fields: Optional[List[str]] = None, omit: Optional[List[str]] = None, unwind: Optional[str] = None, skip_empty: Optional[bool] = None, skip_header_row: Optional[bool] = None, skip_hidden: Optional[bool] = None, xml_root: Optional[str] = None, xml_row: Optional[str] = None, ) -> io.IOBase: """Retrieve the items in the dataset as a file-like object. https://docs.apify.com/api/v2#/reference/datasets/item-collection/get-items Args: item_format (str): Format of the results, possible values are: json, jsonl, csv, html, xlsx, xml and rss. The default value is json. offset (int, optional): Number of items that should be skipped at the start. The default value is 0 limit (int, optional): Maximum number of items to return. By default there is no limit. desc (bool, optional): By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to True. clean (bool, optional): If True, returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The clean parameter is just a shortcut for skip_hidden=True and skip_empty=True parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the limit value. bom (bool, optional): All text responses are encoded in UTF-8 encoding. By default, csv files are prefixed with the UTF-8 Byte Order Mark (BOM), while json, jsonl, xml, html and rss files are not. If you want to override this default behavior, specify bom=True query parameter to include the BOM or bom=False to skip it. delimiter (str, optional): A delimiter character for CSV files. The default delimiter is a simple comma (,). fields (list of str, optional): A list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the fields parameter. You can use this feature to effectively fix the output format. omit (list of str, optional): A list of fields which should be omitted from the items. unwind (str, optional): Name of a field which should be unwound. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object, then the item gets preserved as it is. Note that the unwound items ignore the desc parameter. skip_empty (bool, optional): If True, then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. skip_header_row (bool, optional): If True, then header row in the csv format is skipped. skip_hidden (bool, optional): If True, then hidden fields are skipped from the output, i.e. fields starting with the # character. xml_root (str, optional): Overrides default root element name of xml output. By default the root element is items. xml_row (str, optional): Overrides default element name that wraps each page or page function result object in xml output. By default the element name is item. Returns: io.IOBase: The dataset items as a file-like object """ request_params = self._params( format=item_format, offset=offset, limit=limit, desc=desc, clean=clean, bom=bom, delimiter=delimiter, fields=fields, omit=omit, unwind=unwind, skipEmpty=skip_empty, skipHeaderRow=skip_header_row, skipHidden=skip_hidden, xmlRoot=xml_root, xmlRow=xml_row, ) response = self.http_client.call( url=self._url('items'), method='GET', params=request_params, stream=True, parse_response=False, ) response.raw.decode_content = True # response.raw is the raw urllib3 response, which subclasses IOBase return cast(io.IOBase, response.raw) def push_items(self, items: JSONSerializable) -> None: """Push items to the dataset. https://docs.apify.com/api/v2#/reference/datasets/item-collection/put-items Args: items: The items which to push in the dataset. Either a stringified JSON, a dictionary, or a list of strings or dictionaries. """ data = None json = None if isinstance(items, str): data = items else: json = items self.http_client.call( url=self._url('items'), method='POST', headers={'content-type': 'application/json; charset=utf-8'}, params=self._params(), data=data, json=json, )
50.250633
147
0.625472
2,633
19,849
4.660463
0.104444
0.008964
0.026078
0.020536
0.819086
0.806943
0.788689
0.788689
0.783718
0.772716
0
0.00254
0.30591
19,849
394
148
50.378173
0.888147
0.596252
0
0.603015
0
0
0.034237
0.013986
0
0
0
0
0
1
0.045226
false
0
0.025126
0
0.105528
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
92e6cd3e19cb867e9ad447f2f7dbe63368129b71
36,595
py
Python
tests/python/contrib/test_ethosu/test_encode_constants.py
LEA0317/incubator-tvm
de21c8f2ef507587fdcc99b851404de5aeeb5a16
[ "Apache-2.0" ]
null
null
null
tests/python/contrib/test_ethosu/test_encode_constants.py
LEA0317/incubator-tvm
de21c8f2ef507587fdcc99b851404de5aeeb5a16
[ "Apache-2.0" ]
null
null
null
tests/python/contrib/test_ethosu/test_encode_constants.py
LEA0317/incubator-tvm
de21c8f2ef507587fdcc99b851404de5aeeb5a16
[ "Apache-2.0" ]
null
null
null
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. import pytest import numpy as np pytest.importorskip("ethosu.vela") import tvm from tvm import relay from tvm.script import tir as T from tvm.relay.testing import run_opt_pass from tvm.relay.backend.contrib.ethosu.tir.compiler import _lower_to_tir from tvm.relay.backend.contrib.ethosu.tir.scheduler import OperatorCompute from tvm.relay.backend.contrib.ethosu.tir.scheduler import copy_constants from tvm.relay.backend.contrib.ethosu import tir_to_cs_translator from .infra import make_ethosu_conv2d, make_ethosu_binary_elementwise # fmt: off @tvm.script.ir_module class WeightStreamOnlyU55: @T.prim_func def main(placeholder: T.Buffer[(8192,), "int8"], ethosu_write: T.Buffer[(2048,), "int8"]) -> None: # function attr dict T.func_attr({"from_legacy_te_schedule": True, "global_symbol": "main", "tir.noalias": True}) buffer = T.buffer_decl([128], "uint8") buffer_1 = T.buffer_decl([32], "uint8") buffer_2 = T.buffer_decl([112], "uint8") buffer_3 = T.buffer_decl([32], "uint8") buffer_4 = T.buffer_decl([112], "uint8") buffer_5 = T.buffer_decl([32], "uint8") buffer_6 = T.buffer_decl([112], "uint8") buffer_7 = T.buffer_decl([32], "uint8") T.preflattened_buffer(placeholder, [1, 16, 16, 32], "int8", data=placeholder.data) T.preflattened_buffer(ethosu_write, [1, 16, 16, 8], "int8", data=ethosu_write.data) # body p1_global = T.allocate([128], "uint8", "global", annotations={"disable_lower_builtin":True}) p2_global = T.allocate([32], "uint8", "global", annotations={"disable_lower_builtin":True}) p1_global_1 = T.buffer_decl([112], dtype="uint8", data=p1_global.data) p2_global_1 = T.buffer_decl([32], dtype="uint8", data=p2_global.data) T.evaluate(T.call_extern("ethosu_copy", buffer[0], 128, p1_global[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_1[0], 32, p2_global[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 16, 32, 16, 0, 16, placeholder[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 512, 32, 1, "int8", 16, 16, 2, 16, 0, 16, ethosu_write[0], 0, 0, 0, T.float32(0.25), 14, "NHWC", 128, 8, 1, 1, 1, 1, 1, 1, 1, p1_global[0], 128, T.int8(-1), T.int8(-1), 12, p2_global[0], 32, T.int8(-1), T.int8(-1), 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_2[0], 112, p1_global_1[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_3[0], 32, p2_global_1[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 16, 32, 16, 0, 16, placeholder[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 512, 32, 1, "int8", 16, 16, 2, 16, 0, 16, ethosu_write[2], 0, 0, 0, T.float32(0.25), 14, "NHWC", 128, 8, 1, 1, 1, 1, 1, 1, 1, p1_global_1[0], 112, T.int8(-1), T.int8(-1), 12, p2_global_1[0], 32, T.int8(-1), T.int8(-1), 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_4[0], 112, p1_global_1[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_5[0], 32, p2_global_1[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 16, 32, 16, 0, 16, placeholder[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 512, 32, 1, "int8", 16, 16, 2, 16, 0, 16, ethosu_write[4], 0, 0, 0, T.float32(0.25), 14, "NHWC", 128, 8, 1, 1, 1, 1, 1, 1, 1, p1_global_1[0], 112, T.int8(-1), T.int8(-1), 12, p2_global_1[0], 32, T.int8(-1), T.int8(-1), 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_6[0], 112, p1_global_1[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_7[0], 32, p2_global_1[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 16, 32, 16, 0, 16, placeholder[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 512, 32, 1, "int8", 16, 16, 2, 16, 0, 16, ethosu_write[6], 0, 0, 0, T.float32(0.25), 14, "NHWC", 128, 8, 1, 1, 1, 1, 1, 1, 1, p1_global_1[0], 112, T.int8(-1), T.int8(-1), 12, p2_global_1[0], 32, T.int8(-1), T.int8(-1), 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle")) __tvm_meta__ = None @tvm.script.ir_module class WeightStreamOnlyU65: @T.prim_func def main(placeholder: T.Buffer[(8192,), "int8"], ethosu_write: T.Buffer[(2048,), "int8"]) -> None: # function attr dict T.func_attr({"from_legacy_te_schedule": True, "global_symbol": "main", "tir.noalias": True}) # buffer definition buffer_encoded = T.buffer_decl([160], dtype="uint8") buffer_encoded_1 = T.buffer_decl([32], dtype="uint8") buffer_encoded_2 = T.buffer_decl([160], dtype="uint8") buffer_encoded_3 = T.buffer_decl([32], dtype="uint8") buffer_encoded_4 = T.buffer_decl([176], dtype="uint8") buffer_encoded_5 = T.buffer_decl([32], dtype="uint8") buffer_encoded_6 = T.buffer_decl([160], dtype="uint8") buffer_encoded_7 = T.buffer_decl([32], dtype="uint8") T.preflattened_buffer(placeholder, [1, 16, 16, 32], dtype="int8", data=placeholder.data) T.preflattened_buffer(ethosu_write, [1, 16, 16, 8], dtype="int8", data=ethosu_write.data) # body placeholder_global = T.allocate([176], "uint8", "global", annotations={"disable_lower_builtin":True}) placeholder_global_1 = T.buffer_decl([160], dtype="uint8", data=placeholder_global.data) placeholder_global_2 = T.buffer_decl([160], dtype="uint8", data=placeholder_global.data) placeholder_global_3 = T.buffer_decl([160], dtype="uint8", data=placeholder_global.data) placeholder_d_global = T.allocate([32], "uint8", "global", annotations={"disable_lower_builtin":True}) placeholder_d_global_1 = T.buffer_decl([32], dtype="uint8", data=placeholder_d_global.data) placeholder_d_global_2 = T.buffer_decl([32], dtype="uint8", data=placeholder_d_global.data) placeholder_d_global_3 = T.buffer_decl([32], dtype="uint8", data=placeholder_d_global.data) T.evaluate(T.call_extern("ethosu_copy", buffer_encoded[0], 160, placeholder_global_1[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_encoded_1[0], 32, placeholder_d_global[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 16, 32, 16, 0, 16, placeholder[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 512, 32, 1, "int8", 16, 16, 2, 16, 0, 16, ethosu_write[0], 0, 0, 0, T.float32(0.25), 14, "NHWC", 128, 8, 1, 1, 1, 1, 1, 1, 1, placeholder_global_1[0], 80, placeholder_global_1[80], 80, 12, placeholder_d_global[0], 16, placeholder_d_global[16], 16, 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_encoded_2[0], 160, placeholder_global_2[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_encoded_3[0], 32, placeholder_d_global_1[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 16, 32, 16, 0, 16, placeholder[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 512, 32, 1, "int8", 16, 16, 2, 16, 0, 16, ethosu_write[2], 0, 0, 0, T.float32(0.25), 14, "NHWC", 128, 8, 1, 1, 1, 1, 1, 1, 1, placeholder_global_2[0], 80, placeholder_global_2[80], 80, 12, placeholder_d_global_1[0], 16, placeholder_d_global_1[16], 16, 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_encoded_4[0], 176, placeholder_global[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_encoded_5[0], 32, placeholder_d_global_2[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 16, 32, 16, 0, 16, placeholder[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 512, 32, 1, "int8", 16, 16, 2, 16, 0, 16, ethosu_write[4], 0, 0, 0, T.float32(0.25), 14, "NHWC", 128, 8, 1, 1, 1, 1, 1, 1, 1, placeholder_global[0], 96, placeholder_global[96], 80, 12, placeholder_d_global_2[0], 16, placeholder_d_global_2[16], 16, 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_encoded_6[0], 160, placeholder_global_3[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_encoded_7[0], 32, placeholder_d_global_3[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 16, 32, 16, 0, 16, placeholder[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 512, 32, 1, "int8", 16, 16, 2, 16, 0, 16, ethosu_write[6], 0, 0, 0, T.float32(0.25), 14, "NHWC", 128, 8, 1, 1, 1, 1, 1, 1, 1, placeholder_global_3[0], 80, placeholder_global_3[80], 80, 12, placeholder_d_global_3[0], 16, placeholder_d_global_3[16], 16, 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle")) __tvm_meta__ = None # fmt: on @pytest.mark.parametrize( "accelerator, reference_mod, reference_const_sizes", [ ( "ethos-u55-128", WeightStreamOnlyU55, [128, 32, 112, 32, 112, 32, 112, 32], ), ( "ethos-u65-512", WeightStreamOnlyU65, [160, 32, 160, 32, 176, 32, 160, 32], ), ], ) def test_weight_stream_only(accelerator, reference_mod, reference_const_sizes): def _planner(cached_func, const_dict, sch): weights = cached_func.inputs[1] bias = cached_func.inputs[2] out = cached_func.outputs[0] conv_compute = OperatorCompute.from_output(out) co = conv_compute.split(sch, 3, 2) cache_weights = sch.cache_read(weights, "global", [conv_compute.op]) cache_bias = sch.cache_read(bias, "global", [conv_compute.op]) sch[cache_weights].compute_at(sch[out], co) sch[cache_bias].compute_at(sch[out], co) def _get_func(): ifm = relay.var("ifm", shape=(1, 16, 16, 32), dtype="int8") conv = make_ethosu_conv2d( ifm, 32, 8, (1, 1), (0, 0), (1, 1), (1, 1), ) func = relay.Function(relay.analysis.free_vars(conv), conv) func = run_opt_pass(func, relay.transform.InferType()) return func config = { "accelerator_config": accelerator, } with tvm.transform.PassContext(config={"relay.ext.ethos-u.options": config}): func = _get_func() mod, consts = _lower_to_tir(func, cascader=_planner) script = mod.script(show_meta=True) test_mod = tvm.script.from_source(script) tvm.ir.assert_structural_equal(test_mod["main"], reference_mod["main"], True) test_const_size = [value.size for value in list(consts.values())] assert reference_const_sizes == test_const_size # fmt: off @tvm.script.ir_module class RereadWeightsU55: @T.prim_func def main(placeholder: T.Buffer[(8192,), "int8"], ethosu_write: T.Buffer[(2048,), "int8"]) -> None: # function attr dict T.func_attr({"from_legacy_te_schedule": True, "global_symbol": "main", "tir.noalias": True}) buffer = T.buffer_decl([304], "uint8") buffer_1 = T.buffer_decl([80], "uint8") T.preflattened_buffer(placeholder, [1, 16, 16, 32], "int8", data=placeholder.data) T.preflattened_buffer(ethosu_write, [1, 16, 16, 8], "int8", data=ethosu_write.data) # body placeholder_global = T.allocate([304], "uint8", "global", annotations={"disable_lower_builtin":True}) placeholder_d_global = T.allocate([80], "uint8", "global", annotations={"disable_lower_builtin":True}) T.evaluate(T.call_extern("ethosu_copy", buffer[0], 304, placeholder_global[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_1[0], 80, placeholder_d_global[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 8, 32, 16, 0, 8, placeholder[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 512, 32, 1, "int8", 16, 8, 8, 16, 0, 8, ethosu_write[0], 0, 0, 0, T.float32(0.25), 14, "NHWC", 128, 8, 1, 1, 1, 1, 1, 1, 1, placeholder_global[0], 304, T.int8(-1), T.int8(-1), 12, placeholder_d_global[0], 80, T.int8(-1), T.int8(-1), 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer[0], 304, placeholder_global[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_1[0], 80, placeholder_d_global[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 8, 32, 16, 0, 8, placeholder[256], 0, 0, 0, T.float32(0.5), 10, "NHWC", 512, 32, 1, "int8", 16, 8, 8, 16, 0, 8, ethosu_write[64], 0, 0, 0, T.float32(0.25), 14, "NHWC", 128, 8, 1, 1, 1, 1, 1, 1, 1, placeholder_global[0], 304, T.int8(-1), T.int8(-1), 12, placeholder_d_global[0], 80, T.int8(-1), T.int8(-1), 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle")) __tvm_meta__ = None @tvm.script.ir_module class RereadWeightsU65: @T.prim_func def main(placeholder: T.Buffer[(8192,), "int8"], ethosu_write: T.Buffer[(2048,), "int8"]) -> None: # function attr dict T.func_attr({"from_legacy_te_schedule": True, "global_symbol": "main", "tir.noalias": True}) # buffer definition placeholder_encoded = T.buffer_decl([368], dtype="uint8") placeholder_encoded_1 = T.buffer_decl([96], dtype="uint8") T.preflattened_buffer(placeholder, [1, 16, 16, 32], dtype="int8", data=placeholder.data) T.preflattened_buffer(ethosu_write, [1, 16, 16, 8], dtype="int8", data=ethosu_write.data) # body placeholder_global = T.allocate([368], "uint8", "global", annotations={"disable_lower_builtin":True}) placeholder_global_1 = T.buffer_decl([368], dtype="uint8", data=placeholder_global.data) placeholder_d_global = T.allocate([96], "uint8", "global", annotations={"disable_lower_builtin":True}) placeholder_d_global_1 = T.buffer_decl([96], dtype="uint8", data=placeholder_d_global.data) T.evaluate(T.call_extern("ethosu_copy", placeholder_encoded[0], 368, placeholder_global[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", placeholder_encoded_1[0], 96, placeholder_d_global[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 8, 32, 16, 0, 8, placeholder[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 512, 32, 1, "int8", 16, 8, 8, 16, 0, 8, ethosu_write[0], 0, 0, 0, T.float32(0.25), 14, "NHWC", 128, 8, 1, 1, 1, 1, 1, 1, 1, placeholder_global[0], 192, placeholder_global[192], 176, 12, placeholder_d_global[0], 48, placeholder_d_global[48], 48, 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", placeholder_encoded[0], 368, placeholder_global_1[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", placeholder_encoded_1[0], 96, placeholder_d_global_1[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 8, 32, 16, 0, 8, placeholder[256], 0, 0, 0, T.float32(0.5), 10, "NHWC", 512, 32, 1, "int8", 16, 8, 8, 16, 0, 8, ethosu_write[64], 0, 0, 0, T.float32(0.25), 14, "NHWC", 128, 8, 1, 1, 1, 1, 1, 1, 1, placeholder_global_1[0], 192, placeholder_global_1[192], 176, 12, placeholder_d_global_1[0], 48, placeholder_d_global_1[48], 48, 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle")) __tvm_meta__ = None # fmt: on @pytest.mark.parametrize( "accelerator, reference_mod, reference_const_sizes", [ ( "ethos-u55-128", RereadWeightsU55, [304, 80], ), ( "ethos-u65-512", RereadWeightsU65, [368, 96], ), ], ) def test_re_read_weights(accelerator, reference_mod, reference_const_sizes): def _cascader(cached_func, const_dict, sch): weights = cached_func.inputs[1] bias = cached_func.inputs[2] out = cached_func.outputs[0] conv_compute = OperatorCompute.from_output(out) co = conv_compute.split(sch, 2, 8) cache_weights = sch.cache_read(weights, "global", [conv_compute.op]) cache_bias = sch.cache_read(bias, "global", [conv_compute.op]) sch[cache_weights].compute_at(sch[out], co) sch[cache_bias].compute_at(sch[out], co) def _get_func(): ifm = relay.var("ifm", shape=(1, 16, 16, 32), dtype="int8") conv = make_ethosu_conv2d( ifm, 32, 8, (1, 1), (0, 0), (1, 1), (1, 1), ) func = relay.Function(relay.analysis.free_vars(conv), conv) func = run_opt_pass(func, relay.transform.InferType()) return func config = { "accelerator_config": accelerator, } with tvm.transform.PassContext(config={"relay.ext.ethos-u.options": config}): func = _get_func() mod, consts = _lower_to_tir(func, cascader=_cascader) script = mod.script(show_meta=True) test_mod = tvm.script.from_source(script) tvm.ir.assert_structural_equal(test_mod["main"], reference_mod["main"], True) test_const_size = [value.size for value in list(consts.values())] assert reference_const_sizes == test_const_size # fmt: off @tvm.script.ir_module class DirectReadOnlyU55: @T.prim_func def main(placeholder: T.Buffer[(8192,), "int8"], ethosu_write: T.Buffer[(2048,), "int8"]) -> None: # function attr dict T.func_attr({"from_legacy_te_schedule": True, "global_symbol": "main", "tir.noalias": True}) buffer = T.buffer_decl([592], "uint8") buffer_1 = T.buffer_decl([160], "uint8") buffer_2 = T.buffer_decl([160], "uint8") buffer_3 = T.buffer_decl([80], "uint8") T.preflattened_buffer(placeholder, [1, 16, 16, 32], "int8", data=placeholder.data) T.preflattened_buffer(ethosu_write, [1, 16, 16, 8], "int8", data=ethosu_write.data) # body ethosu_write_1 = T.allocate([4096], "int8", "global", annotations={"disable_lower_builtin":True}) T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 16, 32, 16, 0, 16, placeholder[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 512, 32, 1, "int8", 16, 16, 16, 16, 0, 16, ethosu_write_1[0], 0, 0, 0, T.float32(0.25), 14, "NHWC", 256, 16, 1, 1, 1, 1, 1, 1, 1, buffer[0], 592, T.int8(-1), T.int8(-1), 12, buffer_1[0], 160, T.int8(-1), T.int8(-1), 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle")) T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 16, 16, 16, 0, 16, ethosu_write_1[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 256, 16, 1, "int8", 16, 16, 8, 16, 0, 16, ethosu_write[0], 0, 0, 0, T.float32(0.25), 14, "NHWC", 128, 8, 1, 1, 1, 1, 1, 1, 1, buffer_2[0], 160, T.int8(-1), T.int8(-1), 12, buffer_3[0], 80, T.int8(-1), T.int8(-1), 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle")) __tvm_meta__ = None @tvm.script.ir_module class DirectReadOnlyU65: @T.prim_func def main(placeholder: T.Buffer[(8192,), "int8"], ethosu_write: T.Buffer[(2048,), "int8"]) -> None: # function attr dict T.func_attr({"from_legacy_te_schedule": True, "global_symbol": "main", "tir.noalias": True}) # buffer definition placeholder_encoded = T.buffer_decl([608], dtype="uint8") placeholder_encoded_1 = T.buffer_decl([160], dtype="uint8") placeholder_encoded_2 = T.buffer_decl([208], dtype="uint8") placeholder_encoded_3 = T.buffer_decl([96], dtype="uint8") T.preflattened_buffer(placeholder, [1, 16, 16, 32], dtype="int8", data=placeholder.data) T.preflattened_buffer(ethosu_write, [1, 16, 16, 8], dtype="int8", data=ethosu_write.data) # body ethosu_write_2 = T.allocate([4096], "int8", "global", annotations={"disable_lower_builtin":True}) T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 16, 32, 16, 0, 16, placeholder[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 512, 32, 1, "int8", 16, 16, 16, 16, 0, 16, ethosu_write_2[0], 0, 0, 0, T.float32(0.25), 14, "NHWC", 256, 16, 1, 1, 1, 1, 1, 1, 1, placeholder_encoded[0], 304, placeholder_encoded[304], 304, 12, placeholder_encoded_1[0], 80, placeholder_encoded_1[80], 80, 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle")) T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 16, 16, 16, 0, 16, ethosu_write_2[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 256, 16, 1, "int8", 16, 16, 8, 16, 0, 16, ethosu_write[0], 0, 0, 0, T.float32(0.25), 14, "NHWC", 128, 8, 1, 1, 1, 1, 1, 1, 1, placeholder_encoded_2[0], 112, placeholder_encoded_2[112], 96, 12, placeholder_encoded_3[0], 48, placeholder_encoded_3[48], 48, 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle")) __tvm_meta__ = None # fmt: on @pytest.mark.parametrize( "accelerator, reference_mod, reference_const_sizes", [ ( "ethos-u55-128", DirectReadOnlyU55, [592, 160, 160, 80], ), ( "ethos-u65-512", DirectReadOnlyU65, [608, 160, 208, 96], ), ], ) def test_direct_read_only(accelerator, reference_mod, reference_const_sizes): def _get_func(): ifm = relay.var("ifm", shape=(1, 16, 16, 32), dtype="int8") conv1 = make_ethosu_conv2d( ifm, 32, 16, (1, 1), (0, 0), (1, 1), (1, 1), ) conv2 = make_ethosu_conv2d( conv1, 16, 8, (1, 1), (0, 0), (1, 1), (1, 1), ) func = relay.Function(relay.analysis.free_vars(conv2), conv2) func = run_opt_pass(func, relay.transform.InferType()) return func config = { "accelerator_config": accelerator, } with tvm.transform.PassContext(config={"relay.ext.ethos-u.options": config}): func = _get_func() mod, consts = _lower_to_tir(func) script = mod.script(show_meta=True) test_mod = tvm.script.from_source(script) tvm.ir.assert_structural_equal(test_mod["main"], reference_mod["main"], True) test_const_size = [value.size for value in list(consts.values())] assert reference_const_sizes == test_const_size # fmt: off @tvm.script.ir_module class MixedReadU55: @T.prim_func def main(placeholder: T.Buffer[(8192,), "int8"], ethosu_write: T.Buffer[(2048,), "int8"]) -> None: # function attr dict T.func_attr({"from_legacy_te_schedule": True, "global_symbol": "main", "tir.noalias": True}) buffer = T.buffer_decl([592], "uint8") buffer_1 = T.buffer_decl([160], "uint8") buffer_2 = T.buffer_decl([80], "uint8") buffer_3 = T.buffer_decl([32], "uint8") buffer_4 = T.buffer_decl([80], "uint8") buffer_5 = T.buffer_decl([32], "uint8") buffer_6 = T.buffer_decl([80], "uint8") buffer_7 = T.buffer_decl([32], "uint8") buffer_8 = T.buffer_decl([80], "uint8") buffer_9 = T.buffer_decl([32], "uint8") T.preflattened_buffer(placeholder, [1, 16, 16, 32], "int8", data=placeholder.data) T.preflattened_buffer(ethosu_write, [1, 16, 16, 8], "int8", data=ethosu_write.data) # body ethosu_write_1 = T.allocate([4096], "int8", "global", annotations={"disable_lower_builtin":True}) placeholder_global = T.allocate([80], "uint8", "global", annotations={"disable_lower_builtin":True}) placeholder_d_global = T.allocate([32], "uint8", "global", annotations={"disable_lower_builtin":True}) T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 16, 32, 16, 0, 16, placeholder[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 512, 32, 1, "int8", 16, 16, 16, 16, 0, 16, ethosu_write_1[0], 0, 0, 0, T.float32(0.25), 14, "NHWC", 256, 16, 1, 1, 1, 1, 1, 1, 1, buffer[0], 592, T.int8(-1), T.int8(-1), 12, buffer_1[0], 160, T.int8(-1), T.int8(-1), 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_2[0], 80, placeholder_global[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_3[0], 32, placeholder_d_global[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 16, 16, 16, 0, 16, ethosu_write_1[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 256, 16, 1, "int8", 16, 16, 2, 16, 0, 16, ethosu_write[0], 0, 0, 0, T.float32(0.25), 14, "NHWC", 128, 8, 1, 1, 1, 1, 1, 1, 1, placeholder_global[0], 80, T.int8(-1), T.int8(-1), 12, placeholder_d_global[0], 32, T.int8(-1), T.int8(-1), 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_4[0], 80, placeholder_global[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_5[0], 32, placeholder_d_global[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 16, 16, 16, 0, 16, ethosu_write_1[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 256, 16, 1, "int8", 16, 16, 2, 16, 0, 16, ethosu_write[2], 0, 0, 0, T.float32(0.25), 14, "NHWC", 128, 8, 1, 1, 1, 1, 1, 1, 1, placeholder_global[0], 80, T.int8(-1), T.int8(-1), 12, placeholder_d_global[0], 32, T.int8(-1), T.int8(-1), 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_6[0], 80, placeholder_global[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_7[0], 32, placeholder_d_global[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 16, 16, 16, 0, 16, ethosu_write_1[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 256, 16, 1, "int8", 16, 16, 2, 16, 0, 16, ethosu_write[4], 0, 0, 0, T.float32(0.25), 14, "NHWC", 128, 8, 1, 1, 1, 1, 1, 1, 1, placeholder_global[0], 80, T.int8(-1), T.int8(-1), 12, placeholder_d_global[0], 32, T.int8(-1), T.int8(-1), 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_8[0], 80, placeholder_global[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_9[0], 32, placeholder_d_global[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 16, 16, 16, 0, 16, ethosu_write_1[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 256, 16, 1, "int8", 16, 16, 2, 16, 0, 16, ethosu_write[6], 0, 0, 0, T.float32(0.25), 14, "NHWC", 128, 8, 1, 1, 1, 1, 1, 1, 1, placeholder_global[0], 80, T.int8(-1), T.int8(-1), 12, placeholder_d_global[0], 32, T.int8(-1), T.int8(-1), 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle")) __tvm_meta__ = None @tvm.script.ir_module class MixedReadU65: @T.prim_func def main(placeholder: T.Buffer[(8192,), "int8"], ethosu_write: T.Buffer[(2048,), "int8"]) -> None: # function attr dict T.func_attr({"from_legacy_te_schedule": True, "global_symbol": "main", "tir.noalias": True}) # buffer definition buffer_encoded = T.buffer_decl([96], dtype="uint8") buffer_encoded_1 = T.buffer_decl([32], dtype="uint8") buffer_encoded_2 = T.buffer_decl([96], dtype="uint8") buffer_encoded_3 = T.buffer_decl([32], dtype="uint8") buffer_encoded_4 = T.buffer_decl([96], dtype="uint8") buffer_encoded_5 = T.buffer_decl([32], dtype="uint8") buffer_encoded_6 = T.buffer_decl([96], dtype="uint8") buffer_encoded_7 = T.buffer_decl([32], dtype="uint8") placeholder_encoded = T.buffer_decl([608], dtype="uint8") placeholder_encoded_1 = T.buffer_decl([160], dtype="uint8") T.preflattened_buffer(placeholder, [1, 16, 16, 32], dtype="int8", data=placeholder.data) T.preflattened_buffer(ethosu_write, [1, 16, 16, 8], dtype="int8", data=ethosu_write.data) # body ethosu_write_2 = T.allocate([4096], "int8", "global", annotations={"disable_lower_builtin":True}) placeholder_global = T.allocate([96], "uint8", "global", annotations={"disable_lower_builtin":True}) placeholder_global_1 = T.buffer_decl([96], dtype="uint8", data=placeholder_global.data) placeholder_global_2 = T.buffer_decl([96], dtype="uint8", data=placeholder_global.data) placeholder_global_3 = T.buffer_decl([96], dtype="uint8", data=placeholder_global.data) placeholder_d_global = T.allocate([32], "uint8", "global", annotations={"disable_lower_builtin":True}) placeholder_d_global_1 = T.buffer_decl([32], dtype="uint8", data=placeholder_d_global.data) placeholder_d_global_2 = T.buffer_decl([32], dtype="uint8", data=placeholder_d_global.data) placeholder_d_global_3 = T.buffer_decl([32], dtype="uint8", data=placeholder_d_global.data) T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 16, 32, 16, 0, 16, placeholder[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 512, 32, 1, "int8", 16, 16, 16, 16, 0, 16, ethosu_write_2[0], 0, 0, 0, T.float32(0.25), 14, "NHWC", 256, 16, 1, 1, 1, 1, 1, 1, 1, placeholder_encoded[0], 304, placeholder_encoded[304], 304, 12, placeholder_encoded_1[0], 80, placeholder_encoded_1[80], 80, 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_encoded[0], 96, placeholder_global[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_encoded_1[0], 32, placeholder_d_global[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 16, 16, 16, 0, 16, ethosu_write_2[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 256, 16, 1, "int8", 16, 16, 2, 16, 0, 16, ethosu_write[0], 0, 0, 0, T.float32(0.25), 14, "NHWC", 128, 8, 1, 1, 1, 1, 1, 1, 1, placeholder_global[0], 48, placeholder_global[48], 48, 12, placeholder_d_global[0], 16, placeholder_d_global[16], 16, 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_encoded_2[0], 96, placeholder_global_1[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_encoded_3[0], 32, placeholder_d_global_1[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 16, 16, 16, 0, 16, ethosu_write_2[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 256, 16, 1, "int8", 16, 16, 2, 16, 0, 16, ethosu_write[2], 0, 0, 0, T.float32(0.25), 14, "NHWC", 128, 8, 1, 1, 1, 1, 1, 1, 1, placeholder_global_1[0], 48, placeholder_global_1[48], 48, 12, placeholder_d_global_1[0], 16, placeholder_d_global_1[16], 16, 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_encoded_4[0], 96, placeholder_global_2[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_encoded_5[0], 32, placeholder_d_global_2[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 16, 16, 16, 0, 16, ethosu_write_2[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 256, 16, 1, "int8", 16, 16, 2, 16, 0, 16, ethosu_write[4], 0, 0, 0, T.float32(0.25), 14, "NHWC", 128, 8, 1, 1, 1, 1, 1, 1, 1, placeholder_global_2[0], 48, placeholder_global_2[48], 48, 12, placeholder_d_global_2[0], 16, placeholder_d_global_2[16], 16, 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_encoded_6[0], 96, placeholder_global_3[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_copy", buffer_encoded_7[0], 32, placeholder_d_global_3[0], dtype="handle")) T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 16, 16, 16, 0, 16, ethosu_write_2[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 256, 16, 1, "int8", 16, 16, 2, 16, 0, 16, ethosu_write[6], 0, 0, 0, T.float32(0.25), 14, "NHWC", 128, 8, 1, 1, 1, 1, 1, 1, 1, placeholder_global_3[0], 48, placeholder_global_3[48], 48, 12, placeholder_d_global_3[0], 16, placeholder_d_global_3[16], 16, 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle")) __tvm_meta__ = None # fmt: on @pytest.mark.parametrize( "accelerator, reference_mod, reference_const_sizes", [ ( "ethos-u55-128", MixedReadU55, [592, 160, 80, 32, 80, 32, 80, 32, 80, 32], ), ( "ethos-u65-512", MixedReadU65, [608, 160, 96, 32, 96, 32, 96, 32, 96, 32], ), ], ) def test_mixed_read(accelerator, reference_mod, reference_const_sizes): def _planner(cached_func, const_dict, sch): weight = cached_func.inputs[4] scale_bias = cached_func.inputs[5] out = cached_func.outputs[0] conv_compute = OperatorCompute.from_output(out) co = conv_compute.split(sch, 3, 2) cache_weight = sch.cache_read(weight, "global", [conv_compute.op]) cache_scale_bias = sch.cache_read(scale_bias, "global", [conv_compute.op]) sch[cache_weight].compute_at(sch[out], co) sch[cache_scale_bias].compute_at(sch[out], co) def _get_func(): ifm = relay.var("ifm", shape=(1, 16, 16, 32), dtype="int8") conv1 = make_ethosu_conv2d( ifm, 32, 16, (1, 1), (0, 0), (1, 1), (1, 1), ) conv2 = make_ethosu_conv2d( conv1, 16, 8, (1, 1), (0, 0), (1, 1), (1, 1), ) func = relay.Function(relay.analysis.free_vars(conv2), conv2) func = run_opt_pass(func, relay.transform.InferType()) return func config = { "accelerator_config": accelerator, } with tvm.transform.PassContext(config={"relay.ext.ethos-u.options": config}): func = _get_func() mod, consts = _lower_to_tir(func, cascader=_planner) script = mod.script(show_meta=True) test_mod = tvm.script.from_source(script) tvm.ir.assert_structural_equal(test_mod["main"], reference_mod["main"], True) test_const_size = [value.size for value in list(consts.values())] assert reference_const_sizes == test_const_size def test_constant_as_input(): """Test to check that constants specified as inputs aren't interpreted as an encoded constant.""" def get_graph(): dtype = "uint8" ifm = relay.var("ifm", shape=(1, 16, 16, 32), dtype=dtype) conv1 = make_ethosu_conv2d( ifm, 32, 16, (1, 1), (0, 0), (1, 1), (1, 1), ) scalar = relay.const(np.ones((1, 1, 1, 1), dtype=dtype), dtype=dtype) add1 = make_ethosu_binary_elementwise( conv1, scalar, ifm_channels=32, ifm2_channels=1, operator_type="ADD", ofm_dtype=dtype ) func = relay.Function(relay.analysis.free_vars(add1), add1) func = run_opt_pass(func, relay.transform.InferType()) return func tir_mod, params = _lower_to_tir(get_graph(), copy_constants()) # Check tile address for the scalar constant input hasn't been # overwritten. extern_calls = tir_mod["main"].body.body.body.body.body binary_elementwise = extern_calls[-1].value args = binary_elementwise.args reason = "Tile address overwritten" assert args[26] == 0, reason assert args[27] == 0, reason assert args[28] == 0, reason # More generally, check compiles successfully to make sure # nothing else was overrwritten. # With Target Hooks the TIR module needs a target attached # and lowered via make unpacked API. tir_mod["main"] = tir_mod["main"].with_attr("target", tvm.target.Target("ethos-u")) tir_mod = tvm.tir.transform.MakeUnpackedAPI()(tir_mod) tir_to_cs_translator.translate(tir_mod, params) if __name__ == "__main__": pytest.main([__file__])
64.314587
457
0.625085
5,787
36,595
3.761707
0.052186
0.027838
0.022877
0.02058
0.875465
0.868115
0.85562
0.844228
0.836511
0.829253
0
0.118657
0.19489
36,595
568
458
64.427817
0.620202
0.039104
0
0.584582
0
0
0.110725
0.020054
0
0
0
0
0.023555
1
0.044968
false
0.021413
0.025696
0
0.115632
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
92e9bea9c44df40ce385a1f83f971c05803120bb
125
py
Python
qtask/utils/utils.py
LinkTsang/qtask-legacy-python
9b264b8e33313e4d3615472d59a2a39948eeeaa1
[ "MIT" ]
null
null
null
qtask/utils/utils.py
LinkTsang/qtask-legacy-python
9b264b8e33313e4d3615472d59a2a39948eeeaa1
[ "MIT" ]
null
null
null
qtask/utils/utils.py
LinkTsang/qtask-legacy-python
9b264b8e33313e4d3615472d59a2a39948eeeaa1
[ "MIT" ]
null
null
null
import os from qtask.config import config def setup_data_dirs(): os.makedirs(config["QTASK_DATA_DIR"], exist_ok=True)
15.625
56
0.76
20
125
4.5
0.7
0
0
0
0
0
0
0
0
0
0
0
0.136
125
7
57
17.857143
0.833333
0
0
0
0
0
0.112
0
0
0
0
0
0
1
0.25
true
0
0.5
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
1
0
1
0
1
0
0
6
131e717daa6006fa73e4b74197a35f185dbaafb2
6,820
py
Python
test/test_mutualinfo.py
dglmoore/pyinform
e2f3d4b3e0353b9cfa0f9111227336a2634980d9
[ "MIT" ]
null
null
null
test/test_mutualinfo.py
dglmoore/pyinform
e2f3d4b3e0353b9cfa0f9111227336a2634980d9
[ "MIT" ]
null
null
null
test/test_mutualinfo.py
dglmoore/pyinform
e2f3d4b3e0353b9cfa0f9111227336a2634980d9
[ "MIT" ]
null
null
null
# Copyright 2016 ELIFE. All rights reserved. # Use of this source code is governed by a MIT # license that can be found in the LICENSE file. import unittest from pyinform.error import InformError from pyinform.mutualinfo import * class TestMutualInfo(unittest.TestCase): def test_mutual_info_empty(self): with self.assertRaises(ValueError): mutual_info([], []) with self.assertRaises(ValueError): mutual_info([1,2,3], []) with self.assertRaises(ValueError): mutual_info([], [1,2,3]) def test_mutual_info_dimensions(self): with self.assertRaises(ValueError): mutual_info([[1]], [1]) with self.assertRaises(ValueError): mutual_info([1], [[1]]) def test_mutual_info_size(self): with self.assertRaises(ValueError): mutual_info([1,2,3], [1,2]) with self.assertRaises(ValueError): mutual_info([1,2], [1,2,3]) def test_mutual_info_invalid_base(self): with self.assertRaises(InformError): mutual_info([0,0,1], [0,0,1], bx=1) with self.assertRaises(InformError): mutual_info([0,0,1], [0,0,1], by=1) def test_mutual_info_negative_states(self): with self.assertRaises(InformError): mutual_info([-1,0,0], [0,0,1]) with self.assertRaises(InformError): mutual_info([1,0,0], [0,0,-1]) def test_mutual_info_bad_states(self): with self.assertRaises(InformError): mutual_info([0,2,0], [0,0,1], bx=2) with self.assertRaises(InformError): mutual_info([0,1,0], [0,0,2], by=2) def test_mutual_info(self): self.assertAlmostEqual(1.000000, mutual_info([0,0,0,0,1,1,1,1], [1,1,1,1,0,0,0,0]), places=6) self.assertAlmostEqual(0.991076, mutual_info([0,0,1,1,1,1,0,0,0], [1,1,0,0,0,0,1,1,1]), places=6) self.assertAlmostEqual(0.072780, mutual_info([1,1,0,1,0,1,1,1,0], [1,1,0,0,0,1,0,1,1]), places=6) self.assertAlmostEqual(0.000000, mutual_info([0,0,0,0,0,0,0,0,0], [1,1,1,0,0,0,1,1,1], bx=2), places=6) self.assertAlmostEqual(0.072780, mutual_info([1,1,1,1,0,0,0,0,1], [1,1,1,0,0,0,1,1,1]), places=6) self.assertAlmostEqual(1.000000, mutual_info([0,1,0,1,0,1,0,1], [0,2,0,2,0,2,0,2]), places=6) self.assertAlmostEqual(0.666667, mutual_info([0,0,0,0,0,0,1,1,1,1,1,1], [0,0,0,0,1,1,1,1,2,2,2,2]), places=6) self.assertAlmostEqual(0.473851, mutual_info([0,0,1,1,2,1,1,0,0], [0,0,0,1,1,1,0,0,0]), places=6) self.assertAlmostEqual(0.251629, mutual_info([0,1,0,0,1,0,0,1,0], [1,0,0,1,0,0,1,0,0]), places=6) self.assertAlmostEqual(0.954434, mutual_info([1,0,0,1,0,0,1,0], [2,0,1,2,0,1,2,0]), places=6) def test_mutual_info_2D(self): xs = np.random.randint(0,5,20) ys = np.random.randint(0,5,20) expect = mutual_info(xs, ys, b=5) us = np.copy(np.reshape(xs, (4,5))) vs = np.copy(np.reshape(ys, (4,5))) got = mutual_info(us, vs, b=5) self.assertAlmostEqual(expect, got) class TestLocalMutualInfo(unittest.TestCase): def test_mutual_info_empty(self): with self.assertRaises(ValueError): mutual_info([], [], local=True) with self.assertRaises(ValueError): mutual_info([1,2,3], [], local=True) with self.assertRaises(ValueError): mutual_info([], [1,2,3], local=True) def test_mutual_info_dimensions(self): with self.assertRaises(ValueError): mutual_info([[1]], [1], local=True) with self.assertRaises(ValueError): mutual_info([1], [[1]], local=True) def test_mutual_info_size(self): with self.assertRaises(ValueError): mutual_info([1,2,3], [1,2], local=True) with self.assertRaises(ValueError): mutual_info([1,2], [1,2,3], local=True) def test_mutual_info_invalid_base(self): with self.assertRaises(InformError): mutual_info([0,0,1], [0,0,1], bx=1, local=True) with self.assertRaises(InformError): mutual_info([0,0,1], [0,0,1], by=1, local=True) def test_mutual_info_negative_states(self): with self.assertRaises(InformError): mutual_info([-1,0,0], [0,0,1], local=True) with self.assertRaises(InformError): mutual_info([1,0,0], [0,0,-1], local=True) def test_mutual_info_bad_states(self): with self.assertRaises(InformError): mutual_info([0,2,0], [0,0,1], bx=2, local=True) with self.assertRaises(InformError): mutual_info([0,1,0], [0,0,2], by=2, local=True) def test_mutual_info_base_2(self): self.assertAlmostEqual(1.000000, mutual_info([0,0,0,0,1,1,1,1], [1,1,1,1,0,0,0,0], local=True).mean(), places=6) self.assertAlmostEqual(0.991076, mutual_info([0,0,1,1,1,1,0,0,0], [1,1,0,0,0,0,1,1,1], local=True).mean(), places=6) self.assertAlmostEqual(0.072780, mutual_info([1,1,0,1,0,1,1,1,0], [1,1,0,0,0,1,0,1,1], local=True).mean(), places=6) self.assertAlmostEqual(0.000000, mutual_info([0,0,0,0,0,0,0,0,0], [1,1,1,0,0,0,1,1,1], bx=2, local=True).mean(), places=6) self.assertAlmostEqual(0.072780, mutual_info([1,1,1,1,0,0,0,0,1], [1,1,1,0,0,0,1,1,1], local=True).mean(), places=6) self.assertAlmostEqual(1.000000, mutual_info([0,1,0,1,0,1,0,1], [0,2,0,2,0,2,0,2], local=True).mean(), places=6) self.assertAlmostEqual(0.666667, mutual_info([0,0,0,0,0,0,1,1,1,1,1,1], [0,0,0,0,1,1,1,1,2,2,2,2], local=True).mean(), places=6) self.assertAlmostEqual(0.473851, mutual_info([0,0,1,1,2,1,1,0,0], [0,0,0,1,1,1,0,0,0], local=True).mean(), places=6) self.assertAlmostEqual(0.251629, mutual_info([0,1,0,0,1,0,0,1,0], [1,0,0,1,0,0,1,0,0], local=True).mean(), places=6) self.assertAlmostEqual(0.954434, mutual_info([1,0,0,1,0,0,1,0], [2,0,1,2,0,1,2,0], local=True).mean(), places=6) def test_mutual_info_2D(self): xs = np.random.randint(0,5,20) ys = np.random.randint(0,5,20) expect = mutual_info(xs, ys, b=5, local=True) self.assertEqual(xs.shape, expect.shape) us = np.copy(np.reshape(xs, (4,5))) vs = np.copy(np.reshape(ys, (4,5))) got = mutual_info(us, vs, b=5, local=True) self.assertTrue(us.shape, got.shape) self.assertTrue((expect == np.reshape(got,expect.shape)).all()) if __name__ == "__main__": unittest.main()
36.276596
111
0.579179
1,132
6,820
3.390459
0.080389
0.067744
0.054716
0.03752
0.895779
0.889005
0.878843
0.876498
0.865555
0.829338
0
0.129793
0.235191
6,820
187
112
36.470588
0.60602
0.019648
0
0.519084
0
0
0.001197
0
0
0
0
0
0.381679
1
0.122137
false
0
0.022901
0
0.160305
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
136d28bb7b4938f02a7f83328174b40c390edaab
8,826
py
Python
backend/tests/test_field_partner.py
hack4impact-uiuc/kiva-portfolio-tool
c516d28e4f6c4cef0fe63488dc3fd6904ba7ccea
[ "MIT" ]
5
2019-02-16T05:20:28.000Z
2019-03-09T18:32:30.000Z
backend/tests/test_field_partner.py
hack4impact-uiuc/kiva-portfolio-tool
c516d28e4f6c4cef0fe63488dc3fd6904ba7ccea
[ "MIT" ]
110
2019-02-14T06:28:49.000Z
2019-06-19T06:14:44.000Z
backend/tests/test_field_partner.py
hack4impact-uiuc/kiva-portfolio-tool
c516d28e4f6c4cef0fe63488dc3fd6904ba7ccea
[ "MIT" ]
1
2021-02-09T14:43:02.000Z
2021-02-09T14:43:02.000Z
from api.models import db, FieldPartner, PortfolioManager import time, uuid # client passed from client - look into pytest for more info about fixtures # test client api: http://flask.pocoo.org/docs/1.0/api/#test-client def test_index(client): rs = client.get("/") assert rs.status_code == 200 # create a Portfolio Manager for testing def create_pm(): helper_portfolio_manager = PortfolioManager({"email": "hello", "name": "Tim"}) return helper_portfolio_manager # create Field Partner and test whether it returns a field parnter def create_fp(helper_portfolio_manager): temp_field_partner = FieldPartner( { "email": "test@gmail.com", "org_name": "hack4impact", "pm_id": helper_portfolio_manager.id, "app_status": "Complete", "due_date": 1559354885971, } ) return temp_field_partner def test_get_field_partner(client): rs = client.get("/field_partners") assert rs.status_code == 200 ret_dict = rs.json # gives you a dictionary assert ret_dict["success"] == True assert ret_dict["result"]["field_partner"] == [] helper_portfolio_manager = create_pm() db.session.add(helper_portfolio_manager) db.session.commit() temp_field_partner = create_fp(helper_portfolio_manager) db.session.add(temp_field_partner) db.session.commit() rs = client.get("/field_partners") ret_dict = rs.json assert len(ret_dict["result"]["field_partner"]) == 1 assert ret_dict["result"]["field_partner"][0]["email"] == "test@gmail.com" assert ret_dict["result"]["field_partner"][0]["org_name"] == "hack4impact" assert ( ret_dict["result"]["field_partner"][0]["pm_id"] == helper_portfolio_manager.id ) assert ret_dict["result"]["field_partner"][0]["app_status"] == "Complete" assert ret_dict["result"]["field_partner"][0]["due_date"] == 1559354885971 def test_get_fp_by_id(client): db.session.query(FieldPartner).delete() db.session.query(PortfolioManager).delete() helper_portfolio_manager = create_pm() db.session.add(helper_portfolio_manager) db.session.commit() temp_field_partner = create_fp(helper_portfolio_manager) db.session.add(temp_field_partner) db.session.commit() url = "/field_partner/" + temp_field_partner.id rs = client.get(url) assert rs.status_code == 200 ret_dict = rs.json # gives you a dictionary assert ret_dict["success"] == True assert len(ret_dict["result"]["field_partner"]) == 8 assert ret_dict["result"]["field_partner"]["email"] == "test@gmail.com" assert ret_dict["result"]["field_partner"]["org_name"] == "hack4impact" assert ret_dict["result"]["field_partner"]["pm_id"] == helper_portfolio_manager.id assert ret_dict["result"]["field_partner"]["app_status"] == "Complete" assert ret_dict["result"]["field_partner"]["due_date"] == 1559354885971 def test_get_fp_by_org_name(client): db.session.query(FieldPartner).delete() db.session.query(PortfolioManager).delete() helper_portfolio_manager = create_pm() db.session.add(helper_portfolio_manager) db.session.commit() temp_field_partner = create_fp(helper_portfolio_manager) db.session.add(temp_field_partner) db.session.commit() url = "/field_partners?org_name=" + temp_field_partner.org_name rs = client.get(url) assert rs.status_code == 200 ret_dict = rs.json # gives you a dictionary assert ret_dict["success"] == True assert len(ret_dict["result"]) == 1 assert ret_dict["result"]["field_partner"][0]["org_name"] == "hack4impact" def test_get_fp_by_email(client): db.session.query(FieldPartner).delete() db.session.query(PortfolioManager).delete() helper_portfolio_manager = create_pm() db.session.add(helper_portfolio_manager) db.session.commit() temp_field_partner = create_fp(helper_portfolio_manager) db.session.add(temp_field_partner) db.session.commit() url = "/field_partners?email=" + temp_field_partner.email rs = client.get(url) assert rs.status_code == 200 ret_dict = rs.json # gives you a dictionary assert ret_dict["success"] == True assert len(ret_dict["result"]["field_partner"]) == 1 assert ret_dict["result"]["field_partner"][0]["email"] == "test@gmail.com" assert ret_dict["result"]["field_partner"][0]["org_name"] == "hack4impact" assert ( ret_dict["result"]["field_partner"][0]["pm_id"] == helper_portfolio_manager.id ) assert ret_dict["result"]["field_partner"][0]["app_status"] == "Complete" assert ret_dict["result"]["field_partner"][0]["due_date"] == 1559354885971 def test_get_fp_by_pm(client): helper_portfolio_manager = create_pm() db.session.add(helper_portfolio_manager) db.session.commit() temp_field_partner = create_fp(helper_portfolio_manager) db.session.add(temp_field_partner) db.session.commit() temp_field_partner1 = create_fp(helper_portfolio_manager) db.session.add(temp_field_partner1) db.session.commit() url = "/field_partners?pm_id=" + helper_portfolio_manager.id rs = client.get(url) assert rs.status_code == 200 ret_dict = rs.json # gives you a dictionary assert ret_dict["success"] == True assert len(ret_dict["result"]["field_partner"]) == 2 assert ret_dict["result"]["field_partner"][0]["email"] == "test@gmail.com" assert ret_dict["result"]["field_partner"][0]["org_name"] == "hack4impact" assert ( ret_dict["result"]["field_partner"][0]["pm_id"] == helper_portfolio_manager.id ) assert ret_dict["result"]["field_partner"][0]["app_status"] == "Complete" assert ret_dict["result"]["field_partner"][0]["due_date"] == 1559354885971 assert ret_dict["result"]["field_partner"][1]["email"] == "test@gmail.com" assert ret_dict["result"]["field_partner"][1]["org_name"] == "hack4impact" assert ( ret_dict["result"]["field_partner"][1]["pm_id"] == helper_portfolio_manager.id ) assert ret_dict["result"]["field_partner"][1]["app_status"] == "Complete" assert ret_dict["result"]["field_partner"][1]["due_date"] == 1559354885971 def test_new_fp(client): db.session.query(FieldPartner).delete() db.session.query(PortfolioManager).delete() rs = client.post("/field_partners") assert rs.status_code == 400 ret_dict = rs.json # gives you a dictionary assert ret_dict["success"] == False pm = create_pm() db.session.add(pm) db.session.commit() name = str(uuid.uuid4()) rs = client.post( "/field_partners", content_type="multipart/form-data", data={ "email": "santa", "org_name": name, "pm_id": pm.id, "app_status": "New Partner", "due_date": 1559354885979, }, ) assert rs.status_code == 200 ret_dict = rs.json # gives you a dictionary assert ret_dict["success"] == True assert len(ret_dict["result"]["field_partner"]) == 8 assert ret_dict["result"]["field_partner"]["email"] == "santa" assert ret_dict["result"]["field_partner"]["org_name"] == name assert ret_dict["result"]["field_partner"]["pm_id"] == pm.id assert ret_dict["result"]["field_partner"]["app_status"] == "New Partner" # Tests for if not all fields are provided rs = client.post( "/field_partners", content_type="multipart/form-data", data={"email": "santa", "org_name": "Kiva"}, ) assert rs.status_code == 400 ret_dict = rs.json # gives you a dictionary assert ret_dict["success"] == False assert ret_dict["message"] == "No PM ID provided for new FP" def test_fp_update_app_status(client): helper_portfolio_manager = create_pm() db.session.add(helper_portfolio_manager) db.session.commit() temp_field_partner = create_fp(helper_portfolio_manager) db.session.add(temp_field_partner) db.session.commit() url = "/field_partner/" + temp_field_partner.id rs = client.put( url, content_type="multipart/form-data", data={"app_status": "In Process"} ) assert rs.status_code == 200 ret_dict = rs.json # gives you a dictionary assert ret_dict["success"] == True assert len(ret_dict["result"]["field_partner"]) == 8 assert ret_dict["result"]["field_partner"]["email"] == "test@gmail.com" assert ret_dict["result"]["field_partner"]["org_name"] == "hack4impact" assert ret_dict["result"]["field_partner"]["app_status"] == "In Process"
35.304
87
0.656243
1,131
8,826
4.852343
0.099912
0.135569
0.104227
0.131195
0.838739
0.808127
0.777515
0.770955
0.749636
0.715561
0
0.022917
0.199071
8,826
249
88
35.445783
0.75343
0.055518
0
0.634409
0
0
0.215834
0.008549
0
0
0
0
0.327957
1
0.053763
false
0
0.010753
0
0.075269
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
137277aace3275037c1710dd88912d1f42ac7603
49
py
Python
gravy/forms/__init__.py
greenbender/django-gravy
cbdf33db31c73797ca704a89707b6bba48fb3cb9
[ "BSD-3-Clause" ]
6
2018-04-02T22:00:57.000Z
2021-12-17T00:33:12.000Z
gravy/forms/__init__.py
greenbender/django-gravy
cbdf33db31c73797ca704a89707b6bba48fb3cb9
[ "BSD-3-Clause" ]
null
null
null
gravy/forms/__init__.py
greenbender/django-gravy
cbdf33db31c73797ca704a89707b6bba48fb3cb9
[ "BSD-3-Clause" ]
null
null
null
from django.forms import * from .fields import *
16.333333
26
0.755102
7
49
5.285714
0.714286
0
0
0
0
0
0
0
0
0
0
0
0.163265
49
2
27
24.5
0.902439
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
13af7328c36c4e64ade5fc715be64d03e9cf810e
9,383
py
Python
gym_framework/mujoco_envs/pick_and_place_env/tests/pick_and_place_mocap_tests.py
Yucheng-Tang/SimulationFrameworkPublic
3a65cbc0f18ac4b04f8aef7e6e2f9ad9790179c6
[ "MIT" ]
3
2020-11-16T09:01:56.000Z
2021-12-21T09:24:45.000Z
gym_framework/mujoco_envs/pick_and_place_env/tests/pick_and_place_mocap_tests.py
Yucheng-Tang/SimulationFrameworkPublic
3a65cbc0f18ac4b04f8aef7e6e2f9ad9790179c6
[ "MIT" ]
null
null
null
gym_framework/mujoco_envs/pick_and_place_env/tests/pick_and_place_mocap_tests.py
Yucheng-Tang/SimulationFrameworkPublic
3a65cbc0f18ac4b04f8aef7e6e2f9ad9790179c6
[ "MIT" ]
8
2020-11-24T15:59:01.000Z
2022-02-18T15:15:26.000Z
import numpy as np from unittest import TestCase from gym_framework.mujoco_envs.pick_and_place_env.pick_and_place_env import PickAndPlaceMocapCtrl from gym_framework.utils.helper import has_collision def rndmGripperAction(): mean = -1 std = 0.0 eps = np.random.randn() return np.tanh(mean + eps * std) class TestReachEnvMocapCtrl(TestCase): def setUp(self) -> None: self.env = PickAndPlaceMocapCtrl(render=1, max_steps=12000, nsubsteps=3, random_env=False) self.sim = self.env.sim def testRndActions(self): for i in range(10000): action = self.env.action_space.sample() state, reward, done, _ = self.env.step(action) if done: self.env.reset() def testPickAndPlace(self): des_pos = self.sim.data.get_body_xpos('box').copy() while not np.allclose(self.sim.data.get_body_xpos('tcp'), des_pos, atol=1e-2): action = des_pos - self.sim.data.get_body_xpos('tcp') obs, r, done, _ = self.env.step(np.concatenate([action, [1]])) for _ in range(2000): action = np.array([0, 0, 0]) obs, r, done, _ = self.env.step(np.concatenate([action, [-1]])) des_pos = self.sim.data.get_body_xpos('goal').copy() while not np.allclose(self.sim.data.get_body_xpos('tcp'), des_pos, atol=1e-2): action = des_pos - self.sim.data.get_body_xpos('tcp') obs, r, done, _ = self.env.step(np.concatenate([action, [-1]])) while True: action = np.array([0, 0, 0]) obs, r, done, _ = self.env.step(np.concatenate([action, [-1]])) def testPickRandomAction(self): np.random.seed(123) des_pos = self.sim.data.get_body_xpos('box').copy() while not np.allclose(self.sim.data.get_body_xpos('tcp'), des_pos, atol=1e-2): action = des_pos - self.sim.data.get_body_xpos('tcp') self.env.step(np.concatenate([action, [1]])) for _ in range(50): action = np.array([0, 0, 0]) self.env.step(np.concatenate([action, [-1]])) action = np.array([0, 0, 1]) for _ in range(400): self.env.step(np.concatenate([action[:3], [-1]])) action = np.array([0, 0, 0.0]) for _ in range(200): self.env.step(np.concatenate([action[:3], [-1]])) action = np.array([0, 0.5, 0.0]) for _ in range(20): self.env.step(np.concatenate([action[:3], [-1]])) action = np.array([0, 0, 0.0]) for _ in range(500): self.env.step(np.concatenate([action[:3], [-1]])) for _ in range(5000): action = self.env.action_space.sample() gripper_act = -1 # rndmGripperAction() self.env.step(np.concatenate([action[:3], [gripper_act]])) def testPickAndPlaceRepeat(self): for _ in range(10): des_pos = self.sim.data.get_body_xpos('box').copy() while not np.allclose(self.sim.data.get_body_xpos('tcp'), des_pos, atol=1e-2): action = des_pos - self.sim.data.get_body_xpos('tcp') self.env.step(np.concatenate([action, [1]])) for __ in range(300): action = np.array([0, 0, 0]) self.env.step(np.concatenate([action, [-1]])) des_pos = self.sim.data.get_body_xpos('goal').copy() while not np.allclose(self.sim.data.get_body_xpos('tcp'), des_pos, atol=1e-2): action = des_pos - self.sim.data.get_body_xpos('tcp') self.env.step(np.concatenate([action, [-1]])) for __ in range(300): action = np.array([0, 0, 0]) self.env.step(np.concatenate([action, [0.04]])) def testWorkspace(self): """ Tests whether the gripper can reach the table top. It should not work since the z-axis is constrained such that the robot can not touch the table top. """ init_pos = self.sim.data.get_body_xpos('tcp').copy() for _ in range(500): action = [0, 0, 0] self.env.step(np.concatenate([action, [1]])) des_pos = np.array([0.5, 0, -0.5]) # Arbitrary position below workspace constrains for _ in range(500): action = des_pos - self.sim.data.get_body_xpos('tcp') self.env.step(np.concatenate([action, [1]])) des_pos = init_pos while not np.allclose(self.sim.data.get_body_xpos('tcp'), des_pos, atol=1e-1): action = des_pos - self.sim.data.get_body_xpos('tcp') print(des_pos, self.sim.data.get_body_xpos('tcp')) self.env.step(np.concatenate([action, [1]])) des_pos = np.array([0.5, 0, 1]) # Arbitrary position above workspace constrains for _ in range(500): action = des_pos - self.sim.data.get_body_xpos('tcp') self.env.step(np.concatenate([action, [1]])) des_pos = init_pos while not np.allclose(self.sim.data.get_body_xpos('tcp'), des_pos, atol=1e-2): action = des_pos - self.sim.data.get_body_xpos('tcp') self.env.step(np.concatenate([action, [1]])) des_pos = init_pos.copy() des_pos[0] += 1 # Arbitrary position in front workspace constrains for _ in range(500): action = des_pos - self.sim.data.get_body_xpos('tcp') self.env.step(np.concatenate([action, [1]])) des_pos = init_pos while not np.allclose(self.sim.data.get_body_xpos('tcp'), des_pos, atol=1e-2): action = des_pos - self.sim.data.get_body_xpos('tcp') self.env.step(np.concatenate([action, [1]])) des_pos = init_pos.copy() des_pos[0] -= 1 # Arbitrary position behind workspace constrains for _ in range(500): action = des_pos - self.sim.data.get_body_xpos('tcp') self.env.step(np.concatenate([action, [1]])) des_pos = init_pos while not np.allclose(self.sim.data.get_body_xpos('tcp'), des_pos, atol=1e-2): action = des_pos - self.sim.data.get_body_xpos('tcp') self.env.step(np.concatenate([action, [1]])) des_pos = init_pos.copy() des_pos[1] -= 1 # Arbitrary position left of workspace constrains for _ in range(500): action = des_pos - self.sim.data.get_body_xpos('tcp') self.env.step(np.concatenate([action, [1]])) des_pos = init_pos while not np.allclose(self.sim.data.get_body_xpos('tcp'), des_pos, atol=1e-2): action = des_pos - self.sim.data.get_body_xpos('tcp') self.env.step(np.concatenate([action, [1]])) des_pos = init_pos.copy() des_pos[1] += 1 # Arbitrary position right of workspace constrains for _ in range(500): action = des_pos - self.sim.data.get_body_xpos('tcp') self.env.step(np.concatenate([action, [1]])) des_pos = init_pos while not np.allclose(self.sim.data.get_body_xpos('tcp'), des_pos, atol=1e-2): action = des_pos - self.sim.data.get_body_xpos('tcp') self.env.step(np.concatenate([action, [1]])) def testTerminationCond(self): des_pos = self.sim.data.get_body_xpos('box').copy() while not np.allclose(self.sim.data.get_body_xpos('tcp'), des_pos, atol=1e-2): action = des_pos - self.sim.data.get_body_xpos('tcp') self.env.step(np.concatenate([action, [1]])) for _ in range(500): action = np.array([0, 0, 0]) self.env.step(np.concatenate([action, [-1]])) des_pos = self.sim.data.get_site_xpos('goal:site1').copy() while not np.allclose(self.sim.data.get_body_xpos('tcp'), des_pos, atol=1e-4): action = des_pos - self.sim.data.get_body_xpos('tcp') self.env.step(np.concatenate([action, [-1]])) self.assertTrue(self.env._termination() is True) def testVelocity(self): for _ in range(1000): action = np.array([1, 1, 1]) self.env.step(np.concatenate([action, [1]])) def testObservationBounds(self): for i in range(10000): action = self.env.action_space.sample() state, reward, done, _ = self.env.step(action) self.assertTrue((-1 <= state).all()) self.assertTrue((state <= 1).all()) if done: self.env.reset() def testPushBox(self): des_pos = self.sim.data.get_body_xpos('box').copy() des_pos[2] -= 0.3 for _ in range(500): action = np.array([0, 0, 0]) self.env.step(np.concatenate([action, [-1]])) while not np.allclose(self.sim.data.get_body_xpos('tcp'), des_pos, atol=1e-2): action = des_pos - self.sim.data.get_body_xpos('tcp') self.env.step(np.concatenate([action, [-1]])) def testPushBoxSide(self): des_pos = self.sim.data.get_body_xpos('box').copy() des_pos[2] -= 0.3 des_pos[1] -= 0.01 for _ in range(500): action = np.array([0, 0, 0]) self.env.step(np.concatenate([action, [-1]])) while not np.allclose(self.sim.data.get_body_xpos('tcp'), des_pos, atol=1e-2): action = des_pos - self.sim.data.get_body_xpos('tcp') self.env.step(np.concatenate([action, [-1]]))
41.888393
118
0.582649
1,338
9,383
3.923767
0.107623
0.074286
0.098476
0.125333
0.804381
0.798476
0.781905
0.776
0.756571
0.756571
0
0.034014
0.263668
9,383
223
119
42.076233
0.725865
0.048599
0
0.683616
0
0
0.01686
0
0
0
0
0
0.016949
1
0.067797
false
0
0.022599
0
0.101695
0.00565
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
13da80fc229fe7f1fba4e9f072d4800dd7e61764
164
py
Python
slurmqueen/__init__.py
vuphan314/slurmqueen
5d6552ae64c1d7ed5b86ad976d5a2781ebf01176
[ "MIT" ]
1
2018-11-12T22:51:00.000Z
2018-11-12T22:51:00.000Z
slurmqueen/__init__.py
vuphan314/slurmqueen
5d6552ae64c1d7ed5b86ad976d5a2781ebf01176
[ "MIT" ]
9
2020-03-24T16:25:39.000Z
2021-03-06T22:13:59.000Z
slurmqueen/__init__.py
vuphan314/slurmqueen
5d6552ae64c1d7ed5b86ad976d5a2781ebf01176
[ "MIT" ]
6
2018-12-04T16:41:57.000Z
2021-04-07T21:06:45.000Z
from slurmqueen.dashboard import SlurmServer from slurmqueen.experiment import Experiment from slurmqueen.slurm_experiment import SlurmExperiment, ExperimentConfig
41
73
0.896341
17
164
8.588235
0.529412
0.287671
0
0
0
0
0
0
0
0
0
0
0.079268
164
3
74
54.666667
0.966887
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
b91ad61a05474bea91e22424370c50d0e77ee941
35,850
py
Python
nbgrader/tests/apps/test_api.py
mkzia/nbgrader
49d2d1f7c222109df8891a33d60f48134ec28724
[ "BSD-3-Clause" ]
null
null
null
nbgrader/tests/apps/test_api.py
mkzia/nbgrader
49d2d1f7c222109df8891a33d60f48134ec28724
[ "BSD-3-Clause" ]
2
2019-06-01T19:15:14.000Z
2019-06-03T06:17:15.000Z
nbgrader/tests/apps/test_api.py
mkzia/nbgrader
49d2d1f7c222109df8891a33d60f48134ec28724
[ "BSD-3-Clause" ]
2
2019-05-31T08:53:48.000Z
2019-05-31T09:42:26.000Z
import pytest import sys import os import shutil import filecmp from os.path import join from traitlets.config import Config from datetime import datetime from ...apps.api import NbGraderAPI from ...coursedir import CourseDirectory from ...utils import rmtree, get_username, parse_utc from .. import run_nbgrader from .base import BaseTestApp from .conftest import notwindows, windows @pytest.fixture def api(request, course_dir, db, exchange, cache): config = Config() config.CourseDirectory.course_id = "abc101" config.Exchange.root = exchange config.Exchange.cache = cache config.CourseDirectory.root = course_dir config.CourseDirectory.db_url = db coursedir = CourseDirectory(config=config) api = NbGraderAPI(coursedir, config=config) return api class TestNbGraderAPI(BaseTestApp): if sys.platform == 'win32': tz = "Coordinated Universal Time" else: tz = "UTC" def test_get_source_assignments(self, api, course_dir): assert api.get_source_assignments() == set([]) self._empty_notebook(join(course_dir, "source", "ps1", "problem1.ipynb")) self._empty_notebook(join(course_dir, "source", "ps2", "problem1.ipynb")) self._make_file(join(course_dir, "source", "blah")) assert api.get_source_assignments() == {"ps1", "ps2"} @notwindows def test_get_released_assignments(self, api, exchange, course_dir): assert api.get_released_assignments() == set([]) self._copy_file(join("files", "test.ipynb"), join(course_dir, "release", "ps1", "p1.ipynb")) run_nbgrader(["release_assignment", "ps1", "--course", "abc101", "--Exchange.root={}".format(exchange)]) assert api.get_released_assignments() == {"ps1"} api.course_id = None assert api.get_released_assignments() == set([]) @windows def test_get_released_assignments_windows(self, api, exchange, course_dir): assert api.get_released_assignments() == set([]) api.course_id = 'abc101' assert api.get_released_assignments() == set([]) def test_get_submitted_students(self, api, course_dir): assert api.get_submitted_students("ps1") == set([]) self._empty_notebook(join(course_dir, "submitted", "foo", "ps1", "problem1.ipynb")) self._empty_notebook(join(course_dir, "submitted", "bar", "ps1", "problem1.ipynb")) self._make_file(join(course_dir, "submitted", "blah")) assert api.get_submitted_students("ps1") == {"foo", "bar"} assert api.get_submitted_students("*") == {"foo", "bar"} def test_get_submitted_timestamp(self, api, course_dir): assert api.get_submitted_timestamp("ps1", "foo") is None self._empty_notebook(join(course_dir, "submitted", "foo", "ps1", "problem1.ipynb")) assert api.get_submitted_timestamp("ps1", "foo") is None timestamp = datetime.now() self._make_file(join(course_dir, "submitted", "foo", "ps1", "timestamp.txt"), contents=timestamp.isoformat()) assert api.get_submitted_timestamp("ps1", "foo") == timestamp def test_get_autograded_students(self, api, course_dir, db): self._empty_notebook(join(course_dir, "source", "ps1", "problem1.ipynb")) run_nbgrader(["generate_assignment", "ps1", "--db", db]) # submitted and autograded exist, but not in the database self._empty_notebook(join(course_dir, "submitted", "foo", "ps1", "problem1.ipynb")) timestamp = datetime.now() self._make_file(join(course_dir, "submitted", "foo", "ps1", "timestamp.txt"), contents=timestamp.isoformat()) self._empty_notebook(join(course_dir, "autograded", "foo", "ps1", "problem1.ipynb")) self._make_file(join(course_dir, "submitted", "foo", "ps1", "timestamp.txt"), contents=timestamp.isoformat()) assert api.get_autograded_students("ps1") == set([]) # run autograde so things are consistent run_nbgrader(["autograde", "ps1", "--no-execute", "--force", "--db", db]) assert api.get_autograded_students("ps1") == {"foo"} # updated submission timestamp = datetime.now() self._make_file(join(course_dir, "submitted", "foo", "ps1", "timestamp.txt"), contents=timestamp.isoformat()) assert api.get_autograded_students("ps1") == set([]) def test_get_autograded_students_no_timestamps(self, api, course_dir, db): self._empty_notebook(join(course_dir, "source", "ps1", "problem1.ipynb")) run_nbgrader(["generate_assignment", "ps1", "--db", db]) # submitted and autograded exist, but not in the database self._empty_notebook(join(course_dir, "submitted", "foo", "ps1", "problem1.ipynb")) self._empty_notebook(join(course_dir, "autograded", "foo", "ps1", "problem1.ipynb")) assert api.get_autograded_students("ps1") == set([]) # run autograde so things are consistent run_nbgrader(["autograde", "ps1", "--no-execute", "--force", "--db", db]) assert api.get_autograded_students("ps1") == {"foo"} # updated submission timestamp = datetime.now() self._make_file(join(course_dir, "submitted", "foo", "ps1", "timestamp.txt"), contents=timestamp.isoformat()) assert api.get_autograded_students("ps1") == set([]) def test_get_assignment(self, api, course_dir, db, exchange): keys = set([ 'average_code_score', 'average_score', 'average_written_score', 'duedate', 'name', 'num_submissions', 'release_path', 'releaseable', 'source_path', 'status', 'id', 'max_code_score', 'max_score', 'max_written_score', 'display_duedate', 'duedate_timezone', 'duedate_notimezone', 'max_task_score', 'average_task_score']) default = { "average_code_score": 0, "average_score": 0, "average_written_score": 0, "average_task_score": 0, "duedate": None, "display_duedate": None, "duedate_timezone": "+0000", "duedate_notimezone": None, "name": "ps1", "num_submissions": 0, "release_path": None, "releaseable": True if sys.platform != 'win32' else False, "source_path": join("source", "ps1"), "status": "draft", "id": None, "max_code_score": 0, "max_score": 0, "max_written_score": 0, "max_task_score": 0 } # check that return value is None when there is no assignment a = api.get_assignment("ps1") assert a is None # check the values when the source assignment exists, but hasn't been # released yet self._copy_file(join("files", "test.ipynb"), join(course_dir, "source", "ps1", "p1.ipynb")) a = api.get_assignment("ps1") assert set(a.keys()) == keys target = default.copy() assert a == target # check that it is not releasable if the course id isn't set api.course_id = None a = api.get_assignment("ps1") assert set(a.keys()) == keys target = default.copy() target["releaseable"] = False assert a == target # check the values once the student version of the assignment has been created api.course_id = "abc101" run_nbgrader(["generate_assignment", "ps1", "--db", db]) a = api.get_assignment("ps1") assert set(a.keys()) == keys target = default.copy() target["release_path"] = join("release", "ps1") target["id"] = a["id"] target["max_code_score"] = 5 target["max_score"] = 6 target["max_written_score"] = 1 target["max_task_score"] = 1 assert a == target # check that timestamps are handled correctly with api.gradebook as gb: assignment = gb.find_assignment("ps1") assignment.duedate = parse_utc("2017-07-05 12:22:08 UTC") gb.db.commit() a = api.get_assignment("ps1") default["duedate"] = "2017-07-05T12:22:08" default["display_duedate"] = "2017-07-05 12:22:08 {}".format(self.tz) default["duedate_notimezone"] = "2017-07-05T12:22:08" assert a["duedate"] == default["duedate"] assert a["display_duedate"] == default["display_duedate"] assert a["duedate_notimezone"] == default["duedate_notimezone"] assert a["duedate_timezone"] == default["duedate_timezone"] # check the values once the assignment has been released and unreleased if sys.platform != "win32": run_nbgrader(["release_assignment", "ps1", "--course", "abc101", "--Exchange.root={}".format(exchange)]) a = api.get_assignment("ps1") assert set(a.keys()) == keys target = default.copy() target["release_path"] = join("release", "ps1") target["id"] = a["id"] target["max_code_score"] = 5 target["max_score"] = 6 target["max_written_score"] = 1 target["max_task_score"] = 1 target["releaseable"] = True target["status"] = "released" assert a == target run_nbgrader(["list", "ps1", "--course", "abc101", "--Exchange.root={}".format(exchange), "--remove"]) a = api.get_assignment("ps1") assert set(a.keys()) == keys target = default.copy() target["release_path"] = join("release", "ps1") target["id"] = a["id"] target["max_code_score"] = 5 target["max_score"] = 6 target["max_written_score"] = 1 target["max_task_score"] = 1 assert a == target # check the values once there are submissions as well self._empty_notebook(join(course_dir, "submitted", "foo", "ps1", "problem1.ipynb")) self._empty_notebook(join(course_dir, "submitted", "bar", "ps1", "problem1.ipynb")) a = api.get_assignment("ps1") assert set(a.keys()) == keys target = default.copy() target["release_path"] = join("release", "ps1") target["id"] = a["id"] target["max_code_score"] = 5 target["max_score"] = 6 target["max_written_score"] = 1 target["max_task_score"] = 1 target["num_submissions"] = 2 assert a == target def test_get_assignments(self, api, course_dir): assert api.get_assignments() == [] self._empty_notebook(join(course_dir, "source", "ps1", "problem1.ipynb")) self._empty_notebook(join(course_dir, "source", "ps2", "problem1.ipynb")) a = api.get_assignments() assert len(a) == 2 assert a[0] == api.get_assignment("ps1") assert a[1] == api.get_assignment("ps2") def test_get_notebooks(self, api, course_dir, db): keys = set([ 'average_code_score', 'average_score', 'average_written_score', 'name', 'id', 'max_code_score', 'max_score', 'max_written_score', 'max_task_score', 'average_task_score', 'needs_manual_grade', 'num_submissions']) default = { "name": "p1", "id": None, "average_code_score": 0, "max_code_score": 0, "average_score": 0, "max_score": 0, "average_written_score": 0, "max_written_score": 0, "average_task_score": 0, "max_task_score": 0, "needs_manual_grade": False, "num_submissions": 0 } # check that return value is None when there is no assignment n = api.get_notebooks("ps1") assert n == [] # check values before nbgrader generate_assignment is run self._copy_file(join("files", "test.ipynb"), join(course_dir, "source", "ps1", "p1.ipynb")) n1, = api.get_notebooks("ps1") assert set(n1.keys()) == keys assert n1 == default.copy() # add it to the database (but don't assign yet) with api.gradebook as gb: gb.update_or_create_assignment("ps1") n1, = api.get_notebooks("ps1") assert set(n1.keys()) == keys assert n1 == default.copy() # check values after nbgrader generate_assignment is run run_nbgrader(["generate_assignment", "ps1", "--db", db, "--force"]) n1, = api.get_notebooks("ps1") assert set(n1.keys()) == keys target = default.copy() target["id"] = n1["id"] target["max_code_score"] = 5 target["max_score"] = 6 target["max_written_score"] = 1 assert n1 == target def test_get_submission(self, api, course_dir, db): keys = set([ "id", "name", "student", "last_name", "first_name", "score", "max_score", "code_score", "max_code_score", "written_score", "max_written_score", "task_score", "max_task_score", "needs_manual_grade", "autograded", "timestamp", "submitted", "display_timestamp"]) default = { "id": None, "name": "ps1", "student": "foo", "last_name": None, "first_name": None, "score": 0, "max_score": 0, "code_score": 0, "max_code_score": 0, "written_score": 0, "max_written_score": 0, "task_score": 0, "max_task_score": 0, "needs_manual_grade": False, "autograded": False, "timestamp": None, "display_timestamp": None, "submitted": False } s = api.get_submission("ps1", "foo") assert s == default.copy() self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "source", "ps1", "p1.ipynb")) run_nbgrader(["generate_assignment", "ps1", "--db", db]) self._copy_file(join("files", "submitted-changed.ipynb"), join(course_dir, "submitted", "foo", "ps1", "p1.ipynb")) self._make_file(join(course_dir, "submitted", "foo", "ps1", "timestamp.txt"), contents="2017-07-05T12:32:56.123456") s = api.get_submission("ps1", "foo") assert set(s.keys()) == keys target = default.copy() target["submitted"] = True target["timestamp"] = "2017-07-05T12:32:56.123456" target["display_timestamp"] = "2017-07-05 12:32:56 {}".format(self.tz) assert s == target run_nbgrader(["autograde", "ps1", "--no-execute", "--force", "--db", db]) s = api.get_submission("ps1", "foo") target = default.copy() target["id"] = s["id"] target["autograded"] = True target["submitted"] = True target["timestamp"] = "2017-07-05T12:32:56.123456" target["display_timestamp"] = "2017-07-05 12:32:56 {}".format(self.tz) target["code_score"] = 2 target["max_code_score"] = 5 target["score"] = 2 target["max_score"] = 7 target["written_score"] = 0 target["max_written_score"] = 2 target["needs_manual_grade"] = True assert s == target def test_get_submission_no_timestamp(self, api, course_dir, db): keys = set([ "id", "name", "student", "last_name", "first_name", "score", "max_score", "code_score", "max_code_score", "written_score", "max_written_score", "task_score", "max_task_score", "needs_manual_grade", "autograded", "timestamp", "submitted", "display_timestamp"]) default = { "id": None, "name": "ps1", "student": "foo", "last_name": None, "first_name": None, "score": 0, "max_score": 0, "code_score": 0, "max_code_score": 0, "written_score": 0, "max_written_score": 0, "task_score": 0, "max_task_score": 0, "needs_manual_grade": False, "autograded": False, "timestamp": None, "display_timestamp": None, "submitted": False } s = api.get_submission("ps1", "foo") assert s == default.copy() self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "source", "ps1", "p1.ipynb")) run_nbgrader(["generate_assignment", "ps1", "--db", db]) self._copy_file(join("files", "submitted-changed.ipynb"), join(course_dir, "submitted", "foo", "ps1", "p1.ipynb")) s = api.get_submission("ps1", "foo") assert set(s.keys()) == keys target = default.copy() target["submitted"] = True assert s == target run_nbgrader(["autograde", "ps1", "--no-execute", "--force", "--db", db]) s = api.get_submission("ps1", "foo") target = default.copy() target["id"] = s["id"] target["autograded"] = True target["submitted"] = True target["code_score"] = 2 target["max_code_score"] = 5 target["score"] = 2 target["max_score"] = 7 target["written_score"] = 0 target["max_written_score"] = 2 target["needs_manual_grade"] = True assert s == target def test_get_submissions(self, api, course_dir, db): assert api.get_submissions("ps1") == [] self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "source", "ps1", "p1.ipynb")) run_nbgrader(["generate_assignment", "ps1", "--db", db]) self._copy_file(join("files", "submitted-changed.ipynb"), join(course_dir, "submitted", "foo", "ps1", "p1.ipynb")) timestamp = datetime.now() self._make_file(join(course_dir, "submitted", "foo", "ps1", "timestamp.txt"), contents=timestamp.isoformat()) s1, = api.get_submissions("ps1") assert s1 == api.get_submission("ps1", "foo") run_nbgrader(["autograde", "ps1", "--no-execute", "--force", "--db", db]) s1, = api.get_submissions("ps1") assert s1 == api.get_submission("ps1", "foo") def test_filter_existing_notebooks(self, api, course_dir, db): self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "source", "ps1", "p1.ipynb")) self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "source", "ps1", "p2.ipynb")) run_nbgrader(["generate_assignment", "ps1", "--db", db]) self._copy_file(join("files", "submitted-changed.ipynb"), join(course_dir, "submitted", "foo", "ps1", "p1.ipynb")) run_nbgrader(["autograde", "ps1", "--no-execute", "--force", "--db", db]) with api.gradebook as gb: notebooks = gb.notebook_submissions("p1", "ps1") s = api._filter_existing_notebooks("ps1", notebooks) assert s == notebooks notebooks = gb.notebook_submissions("p2", "ps1") s = api._filter_existing_notebooks("ps1", notebooks) assert s == [] @notwindows def test_filter_existing_notebooks_strict(self, api, course_dir, db): api.config.ExchangeSubmit.strict = True self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "source", "ps1", "p1.ipynb")) self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "source", "ps1", "p2.ipynb")) run_nbgrader(["generate_assignment", "ps1", "--db", db]) self._copy_file(join("files", "submitted-changed.ipynb"), join(course_dir, "submitted", "foo", "ps1", "p1.ipynb")) run_nbgrader(["autograde", "ps1", "--no-execute", "--force", "--db", db]) with api.gradebook as gb: notebooks = gb.notebook_submissions("p1", "ps1") s = api._filter_existing_notebooks("ps1", notebooks) assert s == notebooks notebooks = gb.notebook_submissions("p2", "ps1") s = api._filter_existing_notebooks("ps1", notebooks) assert s == notebooks def test_get_notebook_submission_indices(self, api, course_dir, db): self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "source", "ps1", "p1.ipynb")) run_nbgrader(["generate_assignment", "ps1", "--db", db]) self._copy_file(join("files", "submitted-changed.ipynb"), join(course_dir, "submitted", "foo", "ps1", "p1.ipynb")) self._copy_file(join("files", "submitted-changed.ipynb"), join(course_dir, "submitted", "bar", "ps1", "p1.ipynb")) run_nbgrader(["autograde", "ps1", "--no-execute", "--force", "--db", db]) with api.gradebook as gb: notebooks = gb.notebook_submissions("p1", "ps1") notebooks.sort(key=lambda x: x.id) idx = api.get_notebook_submission_indices("ps1", "p1") assert idx[notebooks[0].id] == 0 assert idx[notebooks[1].id] == 1 def test_get_notebook_submissions(self, api, course_dir, db): assert api.get_notebook_submissions("ps1", "p1") == [] self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "source", "ps1", "p1.ipynb")) run_nbgrader(["generate_assignment", "ps1", "--db", db]) self._copy_file(join("files", "submitted-changed.ipynb"), join(course_dir, "submitted", "foo", "ps1", "p1.ipynb")) self._copy_file(join("files", "submitted-changed.ipynb"), join(course_dir, "submitted", "bar", "ps1", "p1.ipynb")) run_nbgrader(["autograde", "ps1", "--no-execute", "--force", "--db", db]) self._copy_file(join("files", "submitted-changed.ipynb"), join(course_dir, "submitted", "baz", "ps1", "p1.ipynb")) s = api.get_notebook_submissions("ps1", "p1") assert len(s) == 2 with api.gradebook as gb: notebooks = gb.notebook_submissions("p1", "ps1") notebooks.sort(key=lambda x: x.id) notebooks = [x.to_dict() for x in notebooks] for i in range(2): notebooks[i]["index"] = i assert s[i] == notebooks[i] def test_get_student(self, api, course_dir, db): assert api.get_student("foo") is None self._copy_file(join("files", "submitted-changed.ipynb"), join(course_dir, "submitted", "foo", "ps1", "p1.ipynb")) assert api.get_student("foo") == { "id": "foo", "last_name": None, "first_name": None, "email": None, "lms_user_id": None, "max_score": 0, "score": 0 } rmtree(join(course_dir, "submitted", "foo")) with api.gradebook as gb: gb.add_student("foo") assert api.get_student("foo") == { "id": "foo", "last_name": None, "first_name": None, "email": None, "lms_user_id": None, "max_score": 0, "score": 0 } gb.update_or_create_student("foo", last_name="Foo", first_name="A", email="a.foo@email.com", lms_user_id="230") assert api.get_student("foo") == { "id": "foo", "last_name": "Foo", "first_name": "A", "email": "a.foo@email.com", "lms_user_id": "230", "max_score": 0, "score": 0 } self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "source", "ps1", "p1.ipynb")) run_nbgrader(["generate_assignment", "ps1", "--db", db]) self._copy_file(join("files", "submitted-changed.ipynb"), join(course_dir, "submitted", "foo", "ps1", "p1.ipynb")) run_nbgrader(["autograde", "ps1", "--no-execute", "--force", "--db", db]) assert api.get_student("foo") == { "id": "foo", "last_name": "Foo", "first_name": "A", "email": "a.foo@email.com", "lms_user_id": "230", "max_score": 7, "score": 2 } def test_get_students(self, api, course_dir): assert api.get_students() == [] with api.gradebook as gb: gb.update_or_create_student("foo", last_name="Foo", first_name="A", email="a.foo@email.com", lms_user_id=None) s1 = { "id": "foo", "last_name": "Foo", "first_name": "A", "email": "a.foo@email.com", "lms_user_id": None, "max_score": 0, "score": 0 } assert api.get_students() == [s1] self._copy_file(join("files", "submitted-changed.ipynb"), join(course_dir, "submitted", "bar", "ps1", "p1.ipynb")) s2 = { "id": "bar", "last_name": None, "first_name": None, "email": None, "lms_user_id": None, "max_score": 0, "score": 0 } assert api.get_students() == [s1, s2] def test_get_student_submissions(self, api, course_dir, db): assert api.get_student_submissions("foo") == [] self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "source", "ps1", "p1.ipynb")) run_nbgrader(["generate_assignment", "ps1", "--db", db]) self._copy_file(join("files", "submitted-changed.ipynb"), join(course_dir, "submitted", "foo", "ps1", "p1.ipynb")) timestamp = datetime.now() self._make_file(join(course_dir, "submitted", "foo", "ps1", "timestamp.txt"), contents=timestamp.isoformat()) run_nbgrader(["autograde", "ps1", "--no-execute", "--force", "--db", db]) assert api.get_student_submissions("foo") == [api.get_submission("ps1", "foo")] def test_get_student_notebook_submissions(self, api, course_dir, db): assert api.get_student_notebook_submissions("foo", "ps1") == [] self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "source", "ps1", "p1.ipynb")) self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "source", "ps1", "p2.ipynb")) run_nbgrader(["generate_assignment", "ps1", "--db", db]) self._copy_file(join("files", "submitted-changed.ipynb"), join(course_dir, "submitted", "foo", "ps1", "p1.ipynb")) run_nbgrader(["autograde", "ps1", "--no-execute", "--force", "--db", db]) s_p1, s_p2 = api.get_student_notebook_submissions("foo", "ps1") p1, = api.get_notebook_submissions("ps1", "p1") del p1["index"] assert s_p1 == p1 assert s_p2 == { "id": None, "name": "p2", "student": "foo", "last_name": None, "first_name": None, "score": 0, "max_score": 7, "code_score": 0, "max_code_score": 5, "written_score": 0, "max_written_score": 2, "task_score": 0, "max_task_score": 0, "needs_manual_grade": False, "failed_tests": False, "flagged": False } def test_deprecation(self, api, course_dir, db): self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "source", "ps1", "p1.ipynb")) result = api.generate_assignment("ps1") assert result["success"] assert os.path.exists(join(course_dir, "release", "ps1", "p1.ipynb")) os.makedirs(join(course_dir, "source", "ps2")) result = api.assign("ps2") assert not result["success"] def test_generate_assignment(self, api, course_dir, db): self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "source", "ps1", "p1.ipynb")) result = api.generate_assignment("ps1") assert result["success"] assert os.path.exists(join(course_dir, "release", "ps1", "p1.ipynb")) os.makedirs(join(course_dir, "source", "ps2")) result = api.generate_assignment("ps2") assert not result["success"] @notwindows def test_release_deprecated(self, api, course_dir, db, exchange): self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "source", "ps1", "p1.ipynb")) result = api.generate_assignment("ps1") result = api.release("ps1") assert result["success"] assert os.path.exists(join(exchange, "abc101", "outbound", "ps1", "p1.ipynb")) @notwindows def test_release_and_unrelease(self, api, course_dir, db, exchange): self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "source", "ps1", "p1.ipynb")) result = api.generate_assignment("ps1") result = api.release_assignment("ps1") assert result["success"] assert os.path.exists(join(exchange, "abc101", "outbound", "ps1", "p1.ipynb")) result = api.release_assignment("ps1") assert not result["success"] result = api.unrelease("ps1") assert result["success"] assert not os.path.exists(join(exchange, "abc101", "outbound", "ps1", "p1.ipynb")) @notwindows def test_collect(self, api, course_dir, db, exchange): self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "source", "ps1", "p1.ipynb")) result = api.generate_assignment("ps1") result = api.release_assignment("ps1") result = api.collect("ps1") assert result["success"] assert "No submissions" in result["log"] run_nbgrader(["fetch_assignment", "ps1", "--course", "abc101", "--Exchange.root={}".format(exchange)]) run_nbgrader(["submit", "ps1", "--course", "abc101", "--Exchange.root={}".format(exchange)]) username = get_username() result = api.collect("ps1") assert result["success"] assert "Collecting submission" in result["log"] assert os.path.exists(join(course_dir, "submitted", username, "ps1", "p1.ipynb")) run_nbgrader(["submit", "ps1", "--course", "abc101", "--Exchange.root={}".format(exchange)]) result = api.collect("ps1") assert result["success"] assert "Updating submission" in result["log"] assert os.path.exists(join(course_dir, "submitted", username, "ps1", "p1.ipynb")) @notwindows def test_autograde(self, api, course_dir, db): self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "source", "ps1", "p1.ipynb")) api.generate_assignment("ps1") result = api.autograde("ps1", "foo") assert not result["success"] assert "No notebooks were matched" in result["log"] self._copy_file(join("files", "submitted-changed.ipynb"), join(course_dir, "submitted", "foo", "ps1", "p1.ipynb")) result = api.autograde("ps1", "foo") assert result["success"] assert os.path.exists(join(course_dir, "autograded", "foo", "ps1", "p1.ipynb")) result = api.autograde("ps1", "foo") assert result["success"] def test_generate_feedback(self, api, course_dir, db): self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "source", "ps1", "p1.ipynb")) api.generate_assignment("ps1") self._copy_file(join("files", "submitted-changed.ipynb"), join(course_dir, "submitted", "foo", "ps1", "p1.ipynb")) api.autograde("ps1", "foo") result = api.generate_feedback("ps1", "foo") assert result["success"] assert os.path.exists(join(course_dir, "feedback", "foo", "ps1", "p1.html")) # should not work for an empty submission os.makedirs(join(course_dir, "submitted", "foo", "ps2")) result = api.generate_feedback("ps2", "foo") assert not result["success"] self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "source", "ps2", "p2.ipynb")) api.generate_assignment("ps2") self._copy_file(join("files", "submitted-changed.ipynb"), join(course_dir, "submitted", "foo", "ps2", "p2.ipynb")) api.autograde("ps2", "foo") result = api.generate_feedback("ps2", "foo") assert result["success"] @notwindows def test_release_feedback(self, api, course_dir, db, exchange): self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "source", "ps1", "p1.ipynb")) api.generate_assignment("ps1") self._copy_file(join("files", "submitted-changed.ipynb"), join(course_dir, "submitted", "foo", "ps1", "p1.ipynb")) self._copy_file(join("files", "timestamp.txt"), join(course_dir, "submitted", "foo", "ps1", "timestamp.txt")) api.autograde("ps1", "foo") api.generate_feedback("ps1", "foo") result = api.release_feedback("ps1", "foo") assert result["success"] assert os.path.isdir(join(exchange, "abc101", "feedback")) assert os.path.exists(join(exchange, "abc101", "feedback", "65f5ff7800d0926ae6869e70f4da0b27.html")) # add another assignment self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "source", "ps2", "p2.ipynb")) api.generate_assignment("ps2") self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "submitted", "foo", "ps2", "p2.ipynb")) self._copy_file(join("files", "timestamp.txt"), join(course_dir, "submitted", "foo", "ps2", "timestamp.txt")) api.autograde("ps2", "foo") api.generate_feedback("ps2", "foo") api.release_feedback("ps2", "foo") assert result["success"] assert os.path.exists(join(exchange, "abc101", "feedback", "a7efd7718119cc393418ad9a185b5b3b.html")) @notwindows def test_fetch_feedback(self, api, course_dir, db, cache): self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "source", "ps1", "p1.ipynb")) api.generate_assignment("ps1") timestamp = open(os.path.join(os.path.dirname(__file__), "files", "timestamp.txt")).read() cachepath = join(cache, "abc101", "foo+ps1+{}".format(timestamp)) self._copy_file(join("files", "submitted-changed.ipynb"), join(cachepath, "p1.ipynb")) self._copy_file(join("files", "timestamp.txt"), join(cachepath, "timestamp.txt")) self._copy_file(join("files", "submitted-changed.ipynb"), join(course_dir, "submitted", "foo", "ps1", "p1.ipynb")) self._copy_file(join("files", "timestamp.txt"), join(course_dir, "submitted", "foo", "ps1", "timestamp.txt")) api.autograde("ps1", "foo") api.generate_feedback("ps1", "foo") api.release_feedback("ps1", "foo") result = api.fetch_feedback("ps1", "foo") assert result["success"] assert os.path.isdir(join("ps1", "feedback")) assert os.path.exists(join("ps1", "feedback", timestamp, "p1.html")) # add another assignment self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "source", "ps2", "ps2.ipynb")) api.generate_assignment("ps2") cachepath = join(cache, "abc101", "foo+ps2+{}".format(timestamp)) self._copy_file(join("files", "submitted-changed.ipynb"), join(cachepath, "ps2.ipynb")) self._copy_file(join("files", "timestamp.txt"), join(cachepath, "timestamp.txt")) self._copy_file(join("files", "submitted-unchanged.ipynb"), join(course_dir, "submitted", "foo", "ps2", "p2.ipynb")) self._copy_file(join("files", "timestamp.txt"), join(course_dir, "submitted", "foo", "ps2", "timestamp.txt")) api.autograde("ps2", "foo") api.generate_feedback("ps2", "foo") api.release_feedback("ps2", "foo") api.fetch_feedback("ps2", "foo") assert result["success"] assert os.path.exists(join("ps2", "feedback", timestamp, "ps2.html"))
45.037688
124
0.590042
4,208
35,850
4.826996
0.060361
0.053614
0.056961
0.045687
0.844919
0.800955
0.757139
0.73208
0.710664
0.693383
0
0.025854
0.242594
35,850
795
125
45.09434
0.722204
0.027392
0
0.690909
0
0
0.256538
0.040675
0
0
0
0
0.181818
1
0.04697
false
0
0.021212
0
0.071212
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
b954ad8bb05dfe2f26072b4f88e4f32938add566
1,448
py
Python
storm_control/test/test_hal_tcp_sp.py
shiwei23/STORM6
669067503ebd164b575ce529fcc4a9a3f576b3d7
[ "MIT" ]
47
2015-02-11T16:05:54.000Z
2022-03-26T14:13:12.000Z
storm_control/test/test_hal_tcp_sp.py
shiwei23/STORM6
669067503ebd164b575ce529fcc4a9a3f576b3d7
[ "MIT" ]
110
2015-01-30T03:53:41.000Z
2021-11-03T15:58:44.000Z
storm_control/test/test_hal_tcp_sp.py
shiwei23/STORM6
669067503ebd164b575ce529fcc4a9a3f576b3d7
[ "MIT" ]
61
2015-01-09T18:31:27.000Z
2021-12-21T13:07:51.000Z
#!/usr/bin/env python """ Test setting parameters. """ from storm_control.test.hal.standardHalTest import halTest def test_hal_tcp_sp_1(): halTest(config_xml = "none_tcp_config.xml", class_name = "SetParameters1", test_module = "storm_control.test.hal.tcp_tests") def test_hal_tcp_sp_2(): halTest(config_xml = "none_tcp_config.xml", class_name = "SetParameters2", test_module = "storm_control.test.hal.tcp_tests") def test_hal_tcp_sp_3(): halTest(config_xml = "none_tcp_config.xml", class_name = "SetParameters3", test_module = "storm_control.test.hal.tcp_tests") def test_hal_tcp_sp_4(): halTest(config_xml = "none_tcp_config.xml", class_name = "SetParameters4", test_module = "storm_control.test.hal.tcp_tests") def test_hal_tcp_sp_5(): halTest(config_xml = "none_tcp_config.xml", class_name = "SetParameters5", test_module = "storm_control.test.hal.tcp_tests") def test_hal_tcp_sp_6(): halTest(config_xml = "none_tcp_config.xml", class_name = "SetParameters6", test_module = "storm_control.test.hal.tcp_tests") def test_hal_tcp_sp_7(): halTest(config_xml = "none_tcp_config.xml", class_name = "SetParameters7", test_module = "storm_control.test.hal.tcp_tests") if (__name__ == "__main__"): test_hal_tcp_sp_7()
24.542373
61
0.660221
191
1,448
4.534031
0.209424
0.12933
0.17321
0.17552
0.767898
0.734411
0.734411
0.734411
0.691686
0.360277
0
0.013393
0.226519
1,448
58
62
24.965517
0.759821
0.031077
0
0.451613
0
0
0.3319
0.160573
0
0
0
0
0
1
0.225806
true
0
0.032258
0
0.258065
0
0
0
0
null
0
0
1
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
0
0
0
0
6