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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
52af16f4cd532ef2b8c44114828d251a9e48640b
| 77
|
py
|
Python
|
django_walletpass/tests/__init__.py
|
Develatio/django-passbook
|
38de7dd55709c8c090511cb9f7a2e59417ab2fb9
|
[
"MIT",
"BSD-3-Clause"
] | 7
|
2020-03-31T00:02:00.000Z
|
2021-07-11T19:10:49.000Z
|
django_walletpass/tests/__init__.py
|
Develatio/django-passbook
|
38de7dd55709c8c090511cb9f7a2e59417ab2fb9
|
[
"MIT",
"BSD-3-Clause"
] | 4
|
2019-06-08T09:43:17.000Z
|
2020-11-16T23:06:43.000Z
|
django_walletpass/tests/__init__.py
|
Develatio/django-passbook
|
38de7dd55709c8c090511cb9f7a2e59417ab2fb9
|
[
"MIT",
"BSD-3-Clause"
] | 6
|
2020-01-21T12:08:07.000Z
|
2022-03-31T17:40:31.000Z
|
# pylint: disable=wildcard-import
from django_walletpass.tests.main import *
| 25.666667
| 42
| 0.818182
| 10
| 77
| 6.2
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.090909
| 77
| 2
| 43
| 38.5
| 0.885714
| 0.402597
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 1
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
|
0
| 6
|
52ca53402550c3d329f3fd614d012905378e77b1
| 88
|
py
|
Python
|
unicodedata_reader/__init__.py
|
kojiishi/unicode-data-parser
|
5938f0c763d31cca06e10426958097ea7bcf7f66
|
[
"Apache-2.0"
] | 2
|
2021-08-30T12:12:33.000Z
|
2021-11-25T14:17:38.000Z
|
unicodedata_reader/__init__.py
|
kojiishi/unicode-data-parser
|
5938f0c763d31cca06e10426958097ea7bcf7f66
|
[
"Apache-2.0"
] | 4
|
2021-11-03T22:20:40.000Z
|
2021-12-15T22:25:31.000Z
|
unicodedata_reader/__init__.py
|
kojiishi/unicodedata-reader
|
0ff8360da75a51e5a348ec2bfe9922e9a48353e1
|
[
"Apache-2.0"
] | null | null | null |
from .entry import *
from .reader import *
from .compressor import *
from .cli import *
| 17.6
| 25
| 0.727273
| 12
| 88
| 5.333333
| 0.5
| 0.46875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.181818
| 88
| 4
| 26
| 22
| 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
|
eae5c2cc557d96ef2d2c7992f664a231d08a0e21
| 3,026
|
py
|
Python
|
insights/parsers/ceph_log.py
|
lhuett/insights-core
|
1c84eeffc037f85e2bbf60c9a302c83aa1a50cf8
|
[
"Apache-2.0"
] | 121
|
2017-05-30T20:23:25.000Z
|
2022-03-23T12:52:15.000Z
|
insights/parsers/ceph_log.py
|
lhuett/insights-core
|
1c84eeffc037f85e2bbf60c9a302c83aa1a50cf8
|
[
"Apache-2.0"
] | 1,977
|
2017-05-26T14:36:03.000Z
|
2022-03-31T10:38:53.000Z
|
insights/parsers/ceph_log.py
|
lhuett/insights-core
|
1c84eeffc037f85e2bbf60c9a302c83aa1a50cf8
|
[
"Apache-2.0"
] | 244
|
2017-05-30T20:22:57.000Z
|
2022-03-26T10:09:39.000Z
|
"""
CephLog - file ``/var/log/ceph/ceph.log``
=========================================
"""
from insights import LogFileOutput, parser
from insights.specs import Specs
@parser(Specs.ceph_log)
class CephLog(LogFileOutput):
"""
Parse the ``/var/log/ceph/ceph.log`` file.
Provide access to ceph logs using the LogFileOutput parser class.
Sample log lines::
2017-05-31 13:01:44.034376 mon.0 192.xx.xx.xx:6789/0 742585 : cluster [INF] pgmap v5133969: 320 pgs: 3 active+clean+scrubbing+deep, 317 active+clean; 898 GB data, 1828 GB used, 48447 GB / 50275 GB avail; 2027 kB/s rd, 20215 kB/s wr, 711 op/s
2017-05-31 13:01:45.041760 mon.0 192.xx.xx.xx:6789/0 742586 : cluster [INF] pgmap v5133970: 320 pgs: 3 active+clean+scrubbing+deep, 317 active+clean; 898 GB data, 1828 GB used, 48447 GB / 50275 GB avail; 1606 kB/s rd, 17354 kB/s wr, 718 op/s
2017-05-31 13:01:46.933829 osd.22 192.xx.xx.xx:6814/42154 172581 : cluster [WRN] 44 slow requests, 2 included below; oldest blocked for > 49.982746 secs
2017-05-31 13:01:46.933946 osd.22 192.xx.xx.xx:6814/42154 172582 : cluster [WRN] slow request 30.602517 seconds old, received at 2017-05-31 13:01:06.330484: osd_op(client.3395798.0:2855671 1.54392173 gnocchi_06c8214c-afae-4e64-8a4a-a466c4f257dc_1244160000.0_median_86400.0_v3 [write 26253~9] snapc 0=[] ondisk+write+known_if_redirected e487) currently waiting for subops from 23
2017-05-31 13:01:46.933955 osd.22 192.xx.xx.xx:6814/42154 172583 : cluster [WRN] slow request 30.530961 seconds old, received at 2017-05-31 13:01:06.402041: osd_op(client.324182.0:46141816 1.e637a4b3 measure [omap-rm-keys 0~107] snapc 0=[] ondisk+write+skiprwlocks+known_if_redirected e487) currently waiting for subops from 23
2017-05-31 13:01:47.050539 mon.0 192.xx.xx.xx:6789/0 742589 : cluster [INF] pgmap v5133971: 320 pgs: 3 active+clean+scrubbing+deep, 317 active+clean; 898 GB data, 1828 GB used, 48447 GB / 50275 GB avail; 1597 kB/s rd, 7259 kB/s wr, 398 op/s
2017-05-31 13:01:48.057187 mon.0 192.xx.xx.xx:6789/0 742590 : cluster [INF] pgmap v5133972: 320 pgs: 3 active+clean+scrubbing+deep, 317 active+clean; 898 GB data, 1828 GB used, 48447 GB / 50275 GB avail; 2373 kB/s rd, 5138 kB/s wr, 354 op/s
2017-05-31 13:01:49.064950 mon.0 192.xx.xx.xx:6789/0 742598 : cluster [INF] pgmap v5133973: 320 pgs: 3 active+clean+scrubbing+deep, 317 active+clean; 898 GB data, 1828 GB used, 48447 GB / 50275 GB avail; 4187 kB/s rd, 10266 kB/s wr, 714 op/s
2017-05-31 13:01:50.069437 mon.0 192.xx.xx.xx:6789/0 742599 : cluster [INF] pgmap v5133974: 320 pgs: 3 active+clean+scrubbing+deep, 317 active+clean; 898 GB data, 1828 GB used, 48447 GB / 50275 GB avail; 470 MB/s rd, 11461 kB/s wr, 786 op/s
Examples:
>>> len(ceph_log.get("[WRN] slow request")) == 2
True
>>> from datetime import datetime
>>> len(list(ceph_log.get_after(datetime(2017, 5, 31, 13, 1, 46))))
7
"""
pass
| 79.631579
| 388
| 0.685724
| 548
| 3,026
| 3.759124
| 0.324818
| 0.034951
| 0.042718
| 0.053398
| 0.512621
| 0.467961
| 0.459223
| 0.422816
| 0.336893
| 0.336893
| 0
| 0.310081
| 0.180436
| 3,026
| 37
| 389
| 81.783784
| 0.520565
| 0.90813
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.2
| 0.4
| 0
| 0.6
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
|
0
| 6
|
eafddb3a312a88defe824ac9ec3553df794b98a2
| 323
|
py
|
Python
|
back/service/handler.py
|
PHIKN1GHT/secp_2020
|
d77e91251d7237f0a47a362e480e536a17993726
|
[
"MIT"
] | null | null | null |
back/service/handler.py
|
PHIKN1GHT/secp_2020
|
d77e91251d7237f0a47a362e480e536a17993726
|
[
"MIT"
] | null | null | null |
back/service/handler.py
|
PHIKN1GHT/secp_2020
|
d77e91251d7237f0a47a362e480e536a17993726
|
[
"MIT"
] | null | null | null |
from server import app
from flask import render_template
'''
@app.errorhandler(404)
def internal_error(error):
#return render_template('404.html'), 404
return render_template('404.html'), 404
@app.errorhandler(500)
def internal_error(error):
db.session.rollback()
return render_template('500.html'), 500'''
| 26.916667
| 46
| 0.739938
| 44
| 323
| 5.295455
| 0.409091
| 0.240343
| 0.257511
| 0.180258
| 0.257511
| 0.257511
| 0
| 0
| 0
| 0
| 0
| 0.085106
| 0.126935
| 323
| 12
| 46
| 26.916667
| 0.741135
| 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
| 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
|
dc1d6de27387b94aa9208635cc90be409d328c19
| 208
|
py
|
Python
|
mpas_analysis/shared/regions/__init__.py
|
ytakano3/MPAS-Analysis
|
fbb1f5189782b9abe9ff368f7c96484fd4832937
|
[
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | 43
|
2016-08-31T22:59:54.000Z
|
2022-01-13T06:46:04.000Z
|
mpas_analysis/shared/regions/__init__.py
|
ytakano3/MPAS-Analysis
|
fbb1f5189782b9abe9ff368f7c96484fd4832937
|
[
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | 764
|
2016-07-01T20:15:22.000Z
|
2022-03-14T19:03:17.000Z
|
mpas_analysis/shared/regions/__init__.py
|
ytakano3/MPAS-Analysis
|
fbb1f5189782b9abe9ff368f7c96484fd4832937
|
[
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | 35
|
2016-06-22T20:36:18.000Z
|
2021-12-29T15:25:15.000Z
|
from mpas_analysis.shared.regions.compute_region_masks_subtask \
import ComputeRegionMasksSubtask, get_feature_list
from mpas_analysis.shared.regions.compute_region_masks \
import ComputeRegionMasks
| 34.666667
| 64
| 0.860577
| 24
| 208
| 7.083333
| 0.625
| 0.094118
| 0.188235
| 0.258824
| 0.552941
| 0.552941
| 0.552941
| 0.552941
| 0
| 0
| 0
| 0
| 0.096154
| 208
| 5
| 65
| 41.6
| 0.904255
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 1
| 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
|
f4ad4f2b4778ef94968305db873d8508f0890835
| 53
|
py
|
Python
|
examples/example_get_exe.py
|
juancarlospaco/thatlib
|
37403983c228521b992ad592231957a1c7af01f2
|
[
"MIT"
] | 31
|
2021-05-12T16:54:34.000Z
|
2022-02-17T12:36:52.000Z
|
examples/example_get_exe.py
|
juancarlospaco/thatlib
|
37403983c228521b992ad592231957a1c7af01f2
|
[
"MIT"
] | 1
|
2021-07-23T02:58:07.000Z
|
2021-09-03T21:53:29.000Z
|
examples/example_get_exe.py
|
juancarlospaco/thatlib
|
37403983c228521b992ad592231957a1c7af01f2
|
[
"MIT"
] | 1
|
2021-05-12T22:12:20.000Z
|
2021-05-12T22:12:20.000Z
|
from thatlib import get_exe
print(get_exe("python"))
| 17.666667
| 27
| 0.792453
| 9
| 53
| 4.444444
| 0.777778
| 0.3
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.09434
| 53
| 2
| 28
| 26.5
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0.113208
| 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
|
f4d670cb18640b0cdc3fd7542edb248bd386cfe0
| 2,530
|
py
|
Python
|
pirates/leveleditor/worldData/pirateerMap.py
|
Willy5s/Pirates-Online-Rewritten
|
7434cf98d9b7c837d57c181e5dabd02ddf98acb7
|
[
"BSD-3-Clause"
] | 81
|
2018-04-08T18:14:24.000Z
|
2022-01-11T07:22:15.000Z
|
pirates/leveleditor/worldData/pirateerMap.py
|
Willy5s/Pirates-Online-Rewritten
|
7434cf98d9b7c837d57c181e5dabd02ddf98acb7
|
[
"BSD-3-Clause"
] | 4
|
2018-09-13T20:41:22.000Z
|
2022-01-08T06:57:00.000Z
|
pirates/leveleditor/worldData/pirateerMap.py
|
Willy5s/Pirates-Online-Rewritten
|
7434cf98d9b7c837d57c181e5dabd02ddf98acb7
|
[
"BSD-3-Clause"
] | 26
|
2018-05-26T12:49:27.000Z
|
2021-09-11T09:11:59.000Z
|
from pandac.PandaModules import Point3, VBase3
objectStruct = {'Objects': {'1151689157.98hreister': {'Type': 'Region','Name': 'default','Objects': {'1151689233.71hreister': {'Type': 'Island','File': 'pirateerCove1','Hpr': VBase3(0.0, 0.0, 0.0),'Pos': Point3(1779.297, -699.482, 0.0),'Scale': VBase3(1.0, 1.0, 1.0),'Visual': {'Model': 'models/islands/pvpcove_zero'}},'1151689243.57hreister': {'Type': 'Island','File': 'pirateerCove0','Hpr': VBase3(0.0, 0.0, 0.0),'Pos': Point3(-1834.8, -673.045, 0.0),'Scale': VBase3(1.0, 1.0, 1.0),'Visual': {'Model': 'models/islands/pvpcove_zero'}},'1151689665.9hreister': {'Type': 'Ship Spawn Node','Flagship': False,'Hpr': VBase3(-131.111, 0.0, 0.0),'Level': '2','Pos': Point3(2026.39, -743.076, 0.0),'Scale': VBase3(1.0, 1.0, 1.0),'Spawnables': 'Merchant','Team': '0'},'1151689729.21hreister': {'Type': 'Ship Spawn Node','Flagship': False,'Hpr': VBase3(-129.146, 0.0, 0.0),'Level': '2','Pos': Point3(-1606.538, -707.017, 0.0),'Scale': VBase3(1.0, 1.0, 1.0),'Spawnables': 'Merchant','Team': '0'},'1154027786.73hreister': {'Type': 'Ship Spawn Node','Flagship': False,'Hpr': Point3(90.0, 0.0, 0.0),'Level': '1','Pos': Point3(-1635.0, -108.0, -10.0),'Scale': VBase3(1.0, 1.0, 1.0),'Spawnables': 'Interceptor','Team': '0','Visual': {}},'1154027853.04hreister': {'Type': 'Ship Spawn Node','Flagship': False,'Hpr': VBase3(98.233, 0.0, 0.0),'Level': '1','Pos': Point3(2058.161, -1137.117, 0.0),'Scale': VBase3(1.0, 1.0, 1.0),'Spawnables': 'Interceptor','Team': '0'},'1161214367.89jubutler': {'Type': 'Ship Spawn Node','Flagship': False,'Hpr': VBase3(-84.652, 0.0, 0.0),'Level': '1','Pos': Point3(-1584.656, -1113.676, 0.0),'Scale': VBase3(1.0, 1.0, 1.0),'Spawnables': 'Interceptor','Team': '0'}},'Visual': {}}},'Layers': {},'ObjectIds': {'1151689157.98hreister': '["Objects"]["1151689157.98hreister"]','1151689233.71hreister': '["Objects"]["1151689157.98hreister"]["Objects"]["1151689233.71hreister"]','1151689243.57hreister': '["Objects"]["1151689157.98hreister"]["Objects"]["1151689243.57hreister"]','1151689665.9hreister': '["Objects"]["1151689157.98hreister"]["Objects"]["1151689665.9hreister"]','1151689729.21hreister': '["Objects"]["1151689157.98hreister"]["Objects"]["1151689729.21hreister"]','1154027786.73hreister': '["Objects"]["1151689157.98hreister"]["Objects"]["1154027786.73hreister"]','1154027853.04hreister': '["Objects"]["1151689157.98hreister"]["Objects"]["1154027853.04hreister"]','1161214367.89jubutler': '["Objects"]["1151689157.98hreister"]["Objects"]["1161214367.89jubutler"]'}}
| 1,265
| 2,483
| 0.659684
| 342
| 2,530
| 4.874269
| 0.269006
| 0.038392
| 0.034193
| 0.033593
| 0.40252
| 0.40192
| 0.40192
| 0.382124
| 0.231554
| 0.231554
| 0
| 0.252403
| 0.05415
| 2,530
| 2
| 2,483
| 1,265
| 0.444212
| 0
| 0
| 0
| 0
| 0
| 0.565389
| 0.350454
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 6
|
760849408b06ca45bc43661640857a70332eefdc
| 194
|
py
|
Python
|
pyguymer3/hostname.py
|
Guymer/PyGuymer3
|
c2e2788a8b65854fa1e84d6ba5017fb2544fc195
|
[
"Apache-2.0"
] | 9
|
2019-05-14T08:45:53.000Z
|
2021-11-23T09:38:56.000Z
|
pyguymer3/hostname.py
|
Guymer/PyGuymer3
|
c2e2788a8b65854fa1e84d6ba5017fb2544fc195
|
[
"Apache-2.0"
] | 2
|
2019-11-19T17:23:11.000Z
|
2020-10-11T12:43:35.000Z
|
pyguymer3/hostname.py
|
Guymer/PyGuymer3
|
c2e2788a8b65854fa1e84d6ba5017fb2544fc195
|
[
"Apache-2.0"
] | 2
|
2019-11-17T10:13:51.000Z
|
2020-05-26T19:35:33.000Z
|
def hostname():
# Import standard modules ...
import socket
# Get (potentially fully-qualified) hostname and return the first part ...
return socket.gethostname().split(".")[0]
| 27.714286
| 78
| 0.670103
| 22
| 194
| 5.909091
| 0.818182
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006452
| 0.201031
| 194
| 6
| 79
| 32.333333
| 0.832258
| 0.515464
| 0
| 0
| 0
| 0
| 0.010989
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| true
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 6
|
52482e1438132e3c12be4e394e24558d35ecf833
| 39,204
|
py
|
Python
|
mealpy/evolutionary_based/DE.py
|
rishavpramanik/mealpy
|
d4a4d5810f15837764e4ee61517350fef3dc92b3
|
[
"MIT"
] | null | null | null |
mealpy/evolutionary_based/DE.py
|
rishavpramanik/mealpy
|
d4a4d5810f15837764e4ee61517350fef3dc92b3
|
[
"MIT"
] | null | null | null |
mealpy/evolutionary_based/DE.py
|
rishavpramanik/mealpy
|
d4a4d5810f15837764e4ee61517350fef3dc92b3
|
[
"MIT"
] | null | null | null |
# !/usr/bin/env python
# Created by "Thieu" at 09:48, 16/03/2020 ----------%
# Email: nguyenthieu2102@gmail.com %
# Github: https://github.com/thieu1995 %
# --------------------------------------------------%
import numpy as np
from mealpy.optimizer import Optimizer
from scipy.stats import cauchy
from copy import deepcopy
class BaseDE(Optimizer):
"""
The original version of: Differential Evolution (DE)
Links:
1. https://doi.org/10.1016/j.swevo.2018.10.006
Hyper-parameters should fine tuned in approximate range to get faster convergence toward the global optimum:
+ wf (float): [0.5, 0.95], weighting factor, default = 0.8
+ cr (float): [0.5, 0.95], crossover rate, default = 0.9
+ strategy (int): [0, 5], there are lots of variant version of DE algorithm,
+ 0: DE/current-to-rand/1/bin
+ 1: DE/best/1/bin
+ 2: DE/best/2/bin
+ 3: DE/rand/2/bin
+ 4: DE/current-to-best/1/bin
+ 5: DE/current-to-rand/1/bin
Examples
~~~~~~~~
>>> import numpy as np
>>> from mealpy.evolutionary_based.DE import BaseDE
>>>
>>> def fitness_function(solution):
>>> return np.sum(solution**2)
>>>
>>> problem_dict1 = {
>>> "fit_func": fitness_function,
>>> "lb": [-10, -15, -4, -2, -8],
>>> "ub": [10, 15, 12, 8, 20],
>>> "minmax": "min",
>>> }
>>>
>>> epoch = 1000
>>> pop_size = 50
>>> wf = 0.7
>>> cr = 0.9
>>> strategy = 0
>>> model = BaseDE(problem_dict1, epoch, pop_size, wf, cr, strategy)
>>> best_position, best_fitness = model.solve()
>>> print(f"Solution: {best_position}, Fitness: {best_fitness}")
References
~~~~~~~~~~
[1] Mohamed, A.W., Hadi, A.A. and Jambi, K.M., 2019. Novel mutation strategy for enhancing SHADE and
LSHADE algorithms for global numerical optimization. Swarm and Evolutionary Computation, 50, p.100455.
"""
def __init__(self, problem, epoch=10000, pop_size=100, wf=0.8, cr=0.9, strategy=0, **kwargs):
"""
Args:
problem (dict): The problem dictionary
epoch (int): maximum number of iterations, default = 10000
pop_size (int): number of population size, default = 100
wf (float): weighting factor, default = 0.8
cr (float): crossover rate, default = 0.9
strategy (int): Different variants of DE, default = 0
"""
super().__init__(problem, kwargs)
self.epoch = self.validator.check_int("epoch", epoch, [1, 100000])
self.pop_size = self.validator.check_int("pop_size", pop_size, [10, 10000])
self.wf = self.validator.check_float("wf", wf, (0, 1.0))
self.cr = self.validator.check_float("cr", cr, (0, 1.0))
self.strategy = self.validator.check_int("strategy", strategy, [0, 5])
self.nfe_per_epoch = self.pop_size
self.sort_flag = False
def _mutation__(self, current_pos, new_pos):
pos_new = np.where(np.random.uniform(0, 1, self.problem.n_dims) < self.cr, current_pos, new_pos)
return self.amend_position(pos_new, self.problem.lb, self.problem.ub)
def evolve(self, epoch):
"""
The main operations (equations) of algorithm. Inherit from Optimizer class
Args:
epoch (int): The current iteration
"""
pop = []
if self.strategy == 0:
# Choose 3 random element and different to i
for idx in range(0, self.pop_size):
idx_list = np.random.choice(list(set(range(0, self.pop_size)) - {idx}), 3, replace=False)
pos_new = self.pop[idx_list[0]][self.ID_POS] + self.wf * \
(self.pop[idx_list[1]][self.ID_POS] - self.pop[idx_list[2]][self.ID_POS])
pos_new = self._mutation__(self.pop[idx][self.ID_POS], pos_new)
pop.append([pos_new, None])
elif self.strategy == 1:
for idx in range(0, self.pop_size):
idx_list = np.random.choice(list(set(range(0, self.pop_size)) - {idx}), 2, replace=False)
pos_new = self.g_best[self.ID_POS] + self.wf * (self.pop[idx_list[0]][self.ID_POS] - self.pop[idx_list[1]][self.ID_POS])
pos_new = self._mutation__(self.pop[idx][self.ID_POS], pos_new)
pop.append([pos_new, None])
elif self.strategy == 2:
for idx in range(0, self.pop_size):
idx_list = np.random.choice(list(set(range(0, self.pop_size)) - {idx}), 4, replace=False)
pos_new = self.g_best[self.ID_POS] + self.wf * (self.pop[idx_list[0]][self.ID_POS] - self.pop[idx_list[1]][self.ID_POS]) + \
self.wf * (self.pop[idx_list[2]][self.ID_POS] - self.pop[idx_list[3]][self.ID_POS])
pos_new = self._mutation__(self.pop[idx][self.ID_POS], pos_new)
pop.append([pos_new, None])
elif self.strategy == 3:
for idx in range(0, self.pop_size):
idx_list = np.random.choice(list(set(range(0, self.pop_size)) - {idx}), 5, replace=False)
pos_new = self.pop[idx_list[0]][self.ID_POS] + self.wf * \
(self.pop[idx_list[1]][self.ID_POS] - self.pop[idx_list[2]][self.ID_POS]) + \
self.wf * (self.pop[idx_list[3]][self.ID_POS] - self.pop[idx_list[4]][self.ID_POS])
pos_new = self._mutation__(self.pop[idx][self.ID_POS], pos_new)
pop.append([pos_new, None])
elif self.strategy == 4:
for idx in range(0, self.pop_size):
idx_list = np.random.choice(list(set(range(0, self.pop_size)) - {idx}), 2, replace=False)
pos_new = self.pop[idx][self.ID_POS] + self.wf * (self.g_best[self.ID_POS] - self.pop[idx][self.ID_POS]) + \
self.wf * (self.pop[idx_list[0]][self.ID_POS] - self.pop[idx_list[1]][self.ID_POS])
pos_new = self._mutation__(self.pop[idx][self.ID_POS], pos_new)
pop.append([pos_new, None])
else:
for idx in range(0, self.pop_size):
idx_list = np.random.choice(list(set(range(0, self.pop_size)) - {idx}), 3, replace=False)
pos_new = self.pop[idx][self.ID_POS] + self.wf * (self.pop[idx_list[0]][self.ID_POS] - self.pop[idx][self.ID_POS]) + \
self.wf * (self.pop[idx_list[1]][self.ID_POS] - self.pop[idx_list[2]][self.ID_POS])
pos_new = self._mutation__(self.pop[idx][self.ID_POS], pos_new)
pop.append([pos_new, None])
pop = self.update_target_wrapper_population(pop)
# create new pop by comparing fitness of corresponding each member in pop and children
self.pop = self.greedy_selection_population(self.pop, pop)
class JADE(Optimizer):
"""
The variant version of: Differential Evolution (JADE)
Links:
1. https://doi.org/10.1109/TEVC.2009.2014613
Hyper-parameters should fine tuned in approximate range to get faster convergence toward the global optimum:
+ miu_f (float): [0.4, 0.6], initial adaptive f, default = 0.5
+ miu_cr (float): [0.4, 0.6], initial adaptive cr, default = 0.5
+ pt (float): [0.05, 0.2], The percent of top best agents (p in the paper), default = 0.1
+ ap (float): [0.05, 0.2], The Adaptation Parameter control value of f and cr (c in the paper), default=0.1
Examples
~~~~~~~~
>>> import numpy as np
>>> from mealpy.evolutionary_based.DE import JADE
>>>
>>> def fitness_function(solution):
>>> return np.sum(solution**2)
>>>
>>> problem_dict1 = {
>>> "fit_func": fitness_function,
>>> "lb": [-10, -15, -4, -2, -8],
>>> "ub": [10, 15, 12, 8, 20],
>>> "minmax": "min",
>>> }
>>>
>>> epoch = 1000
>>> pop_size = 50
>>> miu_f = 0.5
>>> miu_cr = 0.5
>>> pt = 0.1
>>> ap = 0.1
>>> model = JADE(problem_dict1, epoch, pop_size, miu_f, miu_cr, pt, ap)
>>> best_position, best_fitness = model.solve()
>>> print(f"Solution: {best_position}, Fitness: {best_fitness}")
References
~~~~~~~~~~
[1] Zhang, J. and Sanderson, A.C., 2009. JADE: adaptive differential evolution with optional
external archive. IEEE Transactions on evolutionary computation, 13(5), pp.945-958.
"""
def __init__(self, problem, epoch=10000, pop_size=100, miu_f=0.5, miu_cr=0.5, pt=0.1, ap=0.1, **kwargs):
"""
Args:
problem (dict): The problem dictionary
epoch (int): maximum number of iterations, default = 10000
pop_size (int): number of population size, default = 100
miu_f (float): initial adaptive f, default = 0.5
miu_cr (float): initial adaptive cr, default = 0.5
pt (float): The percent of top best agents (p in the paper), default = 0.1
ap (float): The Adaptation Parameter control value of f and cr (c in the paper), default=0.1
"""
super().__init__(problem, kwargs)
self.epoch = self.validator.check_int("epoch", epoch, [1, 100000])
self.pop_size = self.validator.check_int("pop_size", pop_size, [10, 10000])
# the initial f, location is changed then that f is good
self.miu_f = self.validator.check_float("miu_f", miu_f, (0, 1.0))
# the initial cr,
self.miu_cr = self.validator.check_float("miu_cr", miu_cr, (0, 1.0))
# np.random.uniform(0.05, 0.2) # the x_best is select from the top 100p % solutions
self.pt = self.validator.check_float("pt", pt, (0, 1.0))
# np.random.uniform(1/20, 1/5) # the adaptation parameter control value of f and cr
self.ap = self.validator.check_float("ap", ap, (0, 1.0))
self.nfe_per_epoch = self.pop_size
self.sort_flag = False
## Dynamic variable, changing in run time
self.dyn_miu_cr = self.miu_cr
self.dyn_miu_f = self.miu_f
self.dyn_pop_archive = list()
### Survivor Selection
def lehmer_mean(self, list_objects):
temp = sum(list_objects)
return 0 if temp == 0 else sum(list_objects ** 2) / temp
def evolve(self, epoch):
"""
The main operations (equations) of algorithm. Inherit from Optimizer class
Args:
epoch (int): The current iteration
"""
list_f = list()
list_cr = list()
temp_f = list()
temp_cr = list()
pop_sorted = self.get_sorted_strim_population(self.pop)
pop = []
for idx in range(0, self.pop_size):
## Calculate adaptive parameter cr and f
cr = np.random.normal(self.dyn_miu_cr, 0.1)
cr = np.clip(cr, 0, 1)
while True:
f = cauchy.rvs(self.dyn_miu_f, 0.1)
if f < 0:
continue
elif f > 1:
f = 1
break
temp_f.append(f)
temp_cr.append(cr)
top = int(self.pop_size * self.pt)
x_best = pop_sorted[np.random.randint(0, top)]
x_r1 = self.pop[np.random.choice(list(set(range(0, self.pop_size)) - {idx}))]
new_pop = self.pop + self.dyn_pop_archive
while True:
x_r2 = new_pop[np.random.randint(0, len(new_pop))]
if np.any(x_r2[self.ID_POS] - x_r1[self.ID_POS]) and np.any(x_r2[self.ID_POS] - self.pop[idx][self.ID_POS]):
break
x_new = self.pop[idx][self.ID_POS] + f * (x_best[self.ID_POS] - self.pop[idx][self.ID_POS]) + f * (x_r1[self.ID_POS] - x_r2[self.ID_POS])
pos_new = np.where(np.random.uniform(0, 1, self.problem.n_dims) < cr, x_new, self.pop[idx][self.ID_POS])
j_rand = np.random.randint(0, self.problem.n_dims)
pos_new[j_rand] = x_new[j_rand]
pos_new = self.amend_position(pos_new, self.problem.lb, self.problem.ub)
pop.append([pos_new, None])
pop = self.update_target_wrapper_population(pop)
for idx in range(0, self.pop_size):
if self.compare_agent(pop[idx], self.pop[idx]):
self.dyn_pop_archive.append(deepcopy(self.pop[idx]))
list_cr.append(temp_cr[idx])
list_f.append(temp_f[idx])
self.pop[idx] = deepcopy(pop[idx])
# Randomly remove solution
temp = len(self.dyn_pop_archive) - self.pop_size
if temp > 0:
idx_list = np.random.choice(range(0, len(self.dyn_pop_archive)), temp, replace=False)
archive_pop_new = []
for idx, solution in enumerate(self.dyn_pop_archive):
if idx not in idx_list:
archive_pop_new.append(solution)
self.dyn_pop_archive = deepcopy(archive_pop_new)
# Update miu_cr and miu_f
if len(list_cr) == 0:
self.dyn_miu_cr = (1 - self.ap) * self.dyn_miu_cr + self.ap * 0.5
else:
self.dyn_miu_cr = (1 - self.ap) * self.dyn_miu_cr + self.ap * np.mean(np.array(list_cr))
if len(list_f) == 0:
self.dyn_miu_f = (1 - self.ap) * self.dyn_miu_f + self.ap * 0.5
else:
self.dyn_miu_f = (1 - self.ap) * self.dyn_miu_f + self.ap * self.lehmer_mean(np.array(list_f))
return pop
class SADE(Optimizer):
"""
The original version of: Self-Adaptive Differential Evolution (SADE)
Links:
1. https://doi.org/10.1109/CEC.2005.1554904
Examples
~~~~~~~~
>>> import numpy as np
>>> from mealpy.evolutionary_based.DE import SADE
>>>
>>> def fitness_function(solution):
>>> return np.sum(solution**2)
>>>
>>> problem_dict1 = {
>>> "fit_func": fitness_function,
>>> "lb": [-10, -15, -4, -2, -8],
>>> "ub": [10, 15, 12, 8, 20],
>>> "minmax": "min",
>>> }
>>>
>>> epoch = 1000
>>> pop_size = 50
>>> model = SADE(problem_dict1, epoch, pop_size)
>>> best_position, best_fitness = model.solve()
>>> print(f"Solution: {best_position}, Fitness: {best_fitness}")
References
~~~~~~~~~~
[1] Qin, A.K. and Suganthan, P.N., 2005, September. Self-adaptive differential evolution algorithm for
numerical optimization. In 2005 IEEE congress on evolutionary computation (Vol. 2, pp. 1785-1791). IEEE.
"""
def __init__(self, problem, epoch=10000, pop_size=100, **kwargs):
"""
Args:
problem (dict): The problem dictionary
epoch (int): maximum number of iterations, default = 10000
pop_size (int): number of population size, default = 100
"""
super().__init__(problem, kwargs)
self.epoch = self.validator.check_int("epoch", epoch, [1, 100000])
self.pop_size = self.validator.check_int("pop_size", pop_size, [10, 10000])
self.nfe_per_epoch = self.pop_size
self.sort_flag = False
self.loop_probability = 50
self.loop_cr = 5
self.ns1 = self.ns2 = self.nf1 = self.nf2 = 0
self.crm = 0.5
self.p1 = 0.5
# Dynamic variable
self.dyn_list_cr = list()
def evolve(self, epoch):
"""
The main operations (equations) of algorithm. Inherit from Optimizer class
Args:
epoch (int): The current iteration
"""
pop = []
list_probability = []
list_cr = []
for idx in range(0, self.pop_size):
## Calculate adaptive parameter cr and f
cr = np.random.normal(self.crm, 0.1)
cr = np.clip(cr, 0, 1)
list_cr.append(cr)
while True:
f = np.random.normal(0.5, 0.3)
if f < 0:
continue
elif f > 1:
f = 1
break
id1, id2, id3 = np.random.choice(list(set(range(0, self.pop_size)) - {idx}), 3, replace=False)
if np.random.rand() < self.p1:
x_new = self.pop[id1][self.ID_POS] + f * (self.pop[id2][self.ID_POS] - self.pop[id3][self.ID_POS])
pos_new = np.where(np.random.uniform(0, 1, self.problem.n_dims) < cr, x_new, self.pop[idx][self.ID_POS])
j_rand = np.random.randint(0, self.problem.n_dims)
pos_new[j_rand] = x_new[j_rand]
pos_new = self.amend_position(pos_new, self.problem.lb, self.problem.ub)
pop.append([pos_new, None])
list_probability.append(True)
else:
x_new = self.pop[idx][self.ID_POS] + f * (self.g_best[self.ID_POS] - self.pop[idx][self.ID_POS]) + \
f * (self.pop[id1][self.ID_POS] - self.pop[id2][self.ID_POS])
pos_new = np.where(np.random.uniform(0, 1, self.problem.n_dims) < cr, x_new, self.pop[idx][self.ID_POS])
j_rand = np.random.randint(0, self.problem.n_dims)
pos_new[j_rand] = x_new[j_rand]
pos_new = self.amend_position(pos_new, self.problem.lb, self.problem.ub)
pop.append([pos_new, None])
list_probability.append(False)
pop = self.update_target_wrapper_population(pop)
for idx in range(0, self.pop_size):
if list_probability[idx]:
if self.compare_agent(pop[idx], self.pop[idx]):
self.ns1 += 1
self.pop[idx] = deepcopy(pop[idx])
else:
self.nf1 += 1
else:
if self.compare_agent(pop[idx], self.pop[idx]):
self.ns2 += 1
self.dyn_list_cr.append(list_cr[idx])
self.pop[idx] = deepcopy(pop[idx])
else:
self.nf2 += 1
# Update cr and p1
if (epoch + 1) / self.loop_cr == 0:
self.crm = np.mean(self.dyn_list_cr)
self.dyn_list_cr = list()
if (epoch + 1) / self.loop_probability == 0:
self.p1 = self.ns1 * (self.ns2 + self.nf2) / (self.ns2 * (self.ns1 + self.nf1) + self.ns1 * (self.ns2 + self.nf2))
self.ns1 = self.ns2 = self.nf1 = self.nf2 = 0
class SHADE(Optimizer):
"""
The variant version of: Success-History Adaptation Differential Evolution (SHADE)
Links:
1. https://doi.org/10.1109/CEC.2013.6557555
Hyper-parameters should fine tuned in approximate range to get faster convergence toward the global optimum:
+ miu_f (float): [0.4, 0.6], initial weighting factor, default = 0.5
+ miu_cr (float): [0.4, 0.6], initial cross-over probability, default = 0.5
Examples
~~~~~~~~
>>> import numpy as np
>>> from mealpy.evolutionary_based.DE import SHADE
>>>
>>> def fitness_function(solution):
>>> return np.sum(solution**2)
>>>
>>> problem_dict1 = {
>>> "fit_func": fitness_function,
>>> "lb": [-10, -15, -4, -2, -8],
>>> "ub": [10, 15, 12, 8, 20],
>>> "minmax": "min",
>>> }
>>>
>>> epoch = 1000
>>> pop_size = 50
>>> miu_f = 0.5
>>> miu_cr = 0.5
>>> model = SHADE(problem_dict1, epoch, pop_size, miu_f, miu_cr)
>>> best_position, best_fitness = model.solve()
>>> print(f"Solution: {best_position}, Fitness: {best_fitness}")
References
~~~~~~~~~~
[1] Tanabe, R. and Fukunaga, A., 2013, June. Success-history based parameter adaptation for
differential evolution. In 2013 IEEE congress on evolutionary computation (pp. 71-78). IEEE.
"""
def __init__(self, problem, epoch=750, pop_size=100, miu_f=0.5, miu_cr=0.5, **kwargs):
"""
Args:
problem (dict): The problem dictionary
epoch (int): maximum number of iterations, default = 10000
pop_size (int): number of population size, default = 100
miu_f (float): initial weighting factor, default = 0.5
miu_cr (float): initial cross-over probability, default = 0.5
"""
super().__init__(problem, kwargs)
self.epoch = self.validator.check_int("epoch", epoch, [1, 100000])
self.pop_size = self.validator.check_int("pop_size", pop_size, [10, 10000])
# the initial f, location is changed then that f is good
self.miu_f = self.validator.check_float("miu_f", miu_f, (0, 1.0))
# the initial cr,
self.miu_cr = self.validator.check_float("miu_cr", miu_cr, (0, 1.0))
self.nfe_per_epoch = self.pop_size
self.sort_flag = False
# Dynamic variable
self.dyn_miu_f = miu_f * np.ones(self.pop_size) # list the initial f,
self.dyn_miu_cr = miu_cr * np.ones(self.pop_size) # list the initial cr,
self.dyn_pop_archive = list()
self.k_counter = 0
### Survivor Selection
def weighted_lehmer_mean(self, list_objects, list_weights):
up = list_weights * list_objects ** 2
down = list_weights * list_objects
return sum(up) / sum(down)
def evolve(self, epoch):
"""
The main operations (equations) of algorithm. Inherit from Optimizer class
Args:
epoch (int): The current iteration
"""
list_f = list()
list_cr = list()
list_f_index = list()
list_cr_index = list()
list_f_new = np.ones(self.pop_size)
list_cr_new = np.ones(self.pop_size)
pop_old = deepcopy(self.pop)
pop_sorted = self.get_sorted_strim_population(self.pop)
pop = []
for idx in range(0, self.pop_size):
## Calculate adaptive parameter cr and f
idx_rand = np.random.randint(0, self.pop_size)
cr = np.random.normal(self.dyn_miu_cr[idx_rand], 0.1)
cr = np.clip(cr, 0, 1)
while True:
f = cauchy.rvs(self.dyn_miu_f[idx_rand], 0.1)
if f < 0:
continue
elif f > 1:
f = 1
break
list_cr_new[idx] = cr
list_f_new[idx] = f
p = np.random.uniform(2 / self.pop_size, 0.2)
top = int(self.pop_size * p)
x_best = pop_sorted[np.random.randint(0, top)]
x_r1 = self.pop[np.random.choice(list(set(range(0, self.pop_size)) - {idx}))]
new_pop = self.pop + self.dyn_pop_archive
while True:
x_r2 = new_pop[np.random.randint(0, len(new_pop))]
if np.any(x_r2[self.ID_POS] - x_r1[self.ID_POS]) and np.any(x_r2[self.ID_POS] - self.pop[idx][self.ID_POS]):
break
x_new = self.pop[idx][self.ID_POS] + f * (x_best[self.ID_POS] - self.pop[idx][self.ID_POS]) + f * (x_r1[self.ID_POS] - x_r2[self.ID_POS])
pos_new = np.where(np.random.uniform(0, 1, self.problem.n_dims) < cr, x_new, self.pop[idx][self.ID_POS])
j_rand = np.random.randint(0, self.problem.n_dims)
pos_new[j_rand] = x_new[j_rand]
pos_new = self.amend_position(pos_new, self.problem.lb, self.problem.ub)
pop.append([pos_new, None])
pop = self.update_target_wrapper_population(pop)
for i in range(0, self.pop_size):
if self.compare_agent(pop[i], self.pop[i]):
list_cr.append(list_cr_new[i])
list_f.append(list_f_new[i])
list_f_index.append(i)
list_cr_index.append(i)
self.pop[i] = deepcopy(pop[i])
self.dyn_pop_archive.append(deepcopy(pop[i]))
# Randomly remove solution
temp = len(self.dyn_pop_archive) - self.pop_size
if temp > 0:
idx_list = np.random.choice(range(0, len(self.dyn_pop_archive)), temp, replace=False)
archive_pop_new = []
for idx, solution in enumerate(self.dyn_pop_archive):
if idx not in idx_list:
archive_pop_new.append(solution)
self.dyn_pop_archive = deepcopy(archive_pop_new)
# Update miu_cr and miu_f
if len(list_f) != 0 and len(list_cr) != 0:
# Eq.13, 14, 10
list_fit_old = np.ones(len(list_cr_index))
list_fit_new = np.ones(len(list_cr_index))
idx_increase = 0
for i in range(0, self.pop_size):
if i in list_cr_index:
list_fit_old[idx_increase] = pop_old[i][self.ID_TAR][self.ID_FIT]
list_fit_new[idx_increase] = self.pop[i][self.ID_TAR][self.ID_FIT]
idx_increase += 1
temp = sum(abs(list_fit_new - list_fit_old))
if temp == 0:
list_weights = 1.0 / len(list_fit_new) * np.ones(len(list_fit_new))
else:
list_weights = abs(list_fit_new - list_fit_old) / temp
self.dyn_miu_cr[self.k_counter] = sum(list_weights * np.array(list_cr))
self.dyn_miu_f[self.k_counter] = self.weighted_lehmer_mean(np.array(list_f), list_weights)
self.k_counter += 1
if self.k_counter >= self.pop_size:
self.k_counter = 0
class L_SHADE(Optimizer):
"""
The original version of: Linear Population Size Reduction Success-History Adaptation Differential Evolution (LSHADE)
Links:
1. https://metahack.org/CEC2014-Tanabe-Fukunaga.pdf
Hyper-parameters should fine tuned in approximate range to get faster convergence toward the global optimum:
+ miu_f (float): [0.4, 0.6], initial weighting factor, default = 0.5
+ miu_cr (float): [0.4, 0.6], initial cross-over probability, default = 0.5
Examples
~~~~~~~~
>>> import numpy as np
>>> from mealpy.evolutionary_based.DE import L_SHADE
>>>
>>> def fitness_function(solution):
>>> return np.sum(solution**2)
>>>
>>> problem_dict1 = {
>>> "fit_func": fitness_function,
>>> "lb": [-10, -15, -4, -2, -8],
>>> "ub": [10, 15, 12, 8, 20],
>>> "minmax": "min",
>>> }
>>>
>>> epoch = 1000
>>> pop_size = 50
>>> miu_f = 0.5
>>> miu_cr = 0.5
>>> model = L_SHADE(problem_dict1, epoch, pop_size, miu_f, miu_cr)
>>> best_position, best_fitness = model.solve()
>>> print(f"Solution: {best_position}, Fitness: {best_fitness}")
References
~~~~~~~~~~
[1] Tanabe, R. and Fukunaga, A.S., 2014, July. Improving the search performance of SHADE using
linear population size reduction. In 2014 IEEE congress on evolutionary computation (CEC) (pp. 1658-1665). IEEE.
"""
def __init__(self, problem, epoch=750, pop_size=100, miu_f=0.5, miu_cr=0.5, **kwargs):
"""
Args:
problem (dict): The problem dictionary
epoch (int): maximum number of iterations, default = 10000
pop_size (int): number of population size, default = 100
miu_f (float): initial weighting factor, default = 0.5
miu_cr (float): initial cross-over probability, default = 0.5
"""
super().__init__(problem, kwargs)
self.epoch = self.validator.check_int("epoch", epoch, [1, 100000])
self.pop_size = self.validator.check_int("pop_size", pop_size, [10, 10000])
# the initial f, location is changed then that f is good
self.miu_f = self.validator.check_float("miu_f", miu_f, (0, 1.0))
# the initial cr,
self.miu_cr = self.validator.check_float("miu_cr", miu_cr, (0, 1.0))
self.nfe_per_epoch = self.pop_size
self.sort_flag = False
# Dynamic variable
self.dyn_miu_f = self.miu_f * np.ones(self.pop_size) # list the initial f,
self.dyn_miu_cr = self.miu_cr * np.ones(self.pop_size) # list the initial cr,
self.dyn_pop_archive = list()
self.dyn_pop_size = self.pop_size
self.k_counter = 0
self.n_min = int(self.pop_size / 5)
### Survivor Selection
def weighted_lehmer_mean(self, list_objects, list_weights):
up = sum(list_weights * list_objects ** 2)
down = sum(list_weights * list_objects)
return up / down if down != 0 else 0.5
def evolve(self, epoch):
"""
The main operations (equations) of algorithm. Inherit from Optimizer class
Args:
epoch (int): The current iteration
"""
list_f = list()
list_cr = list()
list_f_index = list()
list_cr_index = list()
list_f_new = np.ones(self.pop_size)
list_cr_new = np.ones(self.pop_size)
pop_old = deepcopy(self.pop)
pop_sorted = self.get_sorted_strim_population(self.pop)
pop = []
for idx in range(0, self.pop_size):
## Calculate adaptive parameter cr and f
idx_rand = np.random.randint(0, self.pop_size)
cr = np.random.normal(self.dyn_miu_cr[idx_rand], 0.1)
cr = np.clip(cr, 0, 1)
while True:
f = cauchy.rvs(self.dyn_miu_f[idx_rand], 0.1)
if f < 0:
continue
elif f > 1:
f = 1
break
list_cr_new[idx] = cr
list_f_new[idx] = f
p = np.random.uniform(0.15, 0.2)
top = int(self.dyn_pop_size * p)
x_best = pop_sorted[np.random.randint(0, top)]
x_r1 = self.pop[np.random.choice(list(set(range(0, self.dyn_pop_size)) - {idx}))]
new_pop = self.pop + self.dyn_pop_archive
while True:
x_r2 = new_pop[np.random.randint(0, len(new_pop))]
if np.any(x_r2[self.ID_POS] - x_r1[self.ID_POS]) and np.any(x_r2[self.ID_POS] - self.pop[idx][self.ID_POS]):
break
x_new = self.pop[idx][self.ID_POS] + f * (x_best[self.ID_POS] - self.pop[idx][self.ID_POS]) + f * (x_r1[self.ID_POS] - x_r2[self.ID_POS])
pos_new = np.where(np.random.uniform(0, 1, self.problem.n_dims) < cr, x_new, self.pop[idx][self.ID_POS])
j_rand = np.random.randint(0, self.problem.n_dims)
pos_new[j_rand] = x_new[j_rand]
pos_new = self.amend_position(pos_new, self.problem.lb, self.problem.ub)
pop.append([pos_new, None])
pop = self.update_target_wrapper_population(pop)
for i in range(0, self.pop_size):
if self.compare_agent(pop[i], self.pop[i]):
list_cr.append(list_cr_new[i])
list_f.append(list_f_new[i])
list_f_index.append(i)
list_cr_index.append(i)
self.pop[i] = deepcopy(pop[i])
self.dyn_pop_archive.append(deepcopy(self.pop[i]))
# Randomly remove solution
temp = len(self.dyn_pop_archive) - self.pop_size
if temp > 0:
idx_list = np.random.choice(range(0, len(self.dyn_pop_archive)), temp, replace=False)
archive_pop_new = []
for idx, solution in enumerate(self.dyn_pop_archive):
if idx not in idx_list:
archive_pop_new.append(solution)
self.dyn_pop_archive = deepcopy(archive_pop_new)
# Update miu_cr and miu_f
if len(list_f) != 0 and len(list_cr) != 0:
# Eq.13, 14, 10
list_fit_old = np.ones(len(list_cr_index))
list_fit_new = np.ones(len(list_cr_index))
idx_increase = 0
for i in range(0, self.dyn_pop_size):
if i in list_cr_index:
list_fit_old[idx_increase] = pop_old[i][self.ID_TAR][self.ID_FIT]
list_fit_new[idx_increase] = self.pop[i][self.ID_TAR][self.ID_FIT]
idx_increase += 1
total_fit = sum(np.abs(list_fit_new - list_fit_old))
list_weights = 0 if total_fit == 0 else np.abs(list_fit_new - list_fit_old) / total_fit
self.dyn_miu_cr[self.k_counter] = sum(list_weights * np.array(list_cr))
self.dyn_miu_f[self.k_counter] = self.weighted_lehmer_mean(np.array(list_f), list_weights)
self.k_counter += 1
if self.k_counter >= self.dyn_pop_size:
self.k_counter = 0
# Linear Population Size Reduction
self.dyn_pop_size = round(self.pop_size + epoch * ((self.n_min - self.pop_size) / self.epoch))
class SAP_DE(Optimizer):
"""
The original version of: Differential Evolution with Self-Adaptive Populations (SAP_DE)
Links:
1. https://doi.org/10.1007/s00500-005-0537-1
Hyper-parameters should fine tuned in approximate range to get faster convergence toward the global optimum:
+ branch (str): ["ABS" or "REL"], gaussian (absolute) or uniform (relative) method
Examples
~~~~~~~~
>>> import numpy as np
>>> from mealpy.evolutionary_based.DE import SAP_DE
>>>
>>> def fitness_function(solution):
>>> return np.sum(solution**2)
>>>
>>> problem_dict1 = {
>>> "fit_func": fitness_function,
>>> "lb": [-10, -15, -4, -2, -8],
>>> "ub": [10, 15, 12, 8, 20],
>>> "minmax": "min",
>>> }
>>>
>>> epoch = 1000
>>> pop_size = 50
>>> branch = "ABS"
>>> model = SAP_DE(problem_dict1, epoch, pop_size, branch)
>>> best_position, best_fitness = model.solve()
>>> print(f"Solution: {best_position}, Fitness: {best_fitness}")
References
~~~~~~~~~~
[1] Teo, J., 2006. Exploring dynamic self-adaptive populations in differential evolution. Soft Computing, 10(8), pp.673-686.
"""
ID_CR = 2
ID_MR = 3
ID_PS = 4
def __init__(self, problem, epoch=750, pop_size=100, branch="ABS", **kwargs):
"""
Args:
problem (dict): The problem dictionary
epoch (int): maximum number of iterations, default = 10000
pop_size (int): number of population size, default = 100
branch (str): gaussian (absolute) or uniform (relative) method
"""
super().__init__(problem, kwargs)
self.epoch = self.validator.check_int("epoch", epoch, [1, 100000])
self.pop_size = self.validator.check_int("pop_size", pop_size, [10, 10000])
self.branch = self.validator.check_str("branch", branch, ["ABS", "REL"])
self.fixed_pop_size = self.pop_size
self.nfe_per_epoch = self.pop_size
self.sort_flag = False
def create_solution(self, lb=None, ub=None):
"""
To get the position, fitness wrapper, target and obj list
+ A[self.ID_POS] --> Return: position
+ A[self.ID_TAR] --> Return: [target, [obj1, obj2, ...]]
+ A[self.ID_TAR][self.ID_FIT] --> Return: target
+ A[self.ID_TAR][self.ID_OBJ] --> Return: [obj1, obj2, ...]
Returns:
list: solution with format [position, target, crossover_rate, mutation_rate, pop_size]
"""
position = self.generate_position(lb, ub)
position = self.amend_position(position, lb, ub)
target = self.get_target_wrapper(position)
crossover_rate = np.random.uniform(0, 1)
mutation_rate = np.random.uniform(0, 1)
if self.branch == "ABS":
pop_size = int(10 * self.problem.n_dims + np.random.normal(0, 1))
else: # elif self.branch == "REL":
pop_size = int(10 * self.problem.n_dims + np.random.uniform(-0.5, 0.5))
return [position, target, crossover_rate, mutation_rate, pop_size]
def edit_to_range(self, var=None, lower=0, upper=1, func_value=None):
while var <= lower or var >= upper:
if var <= lower:
var += func_value()
if var >= upper:
var -= func_value()
return var
def evolve(self, epoch):
"""
The main operations (equations) of algorithm. Inherit from Optimizer class
Args:
epoch (int): The current iteration
"""
pop = []
for idx in range(0, self.pop_size):
# Choose 3 random element and different to idx
idxs = np.random.choice(list(set(range(0, self.pop_size)) - {idx}), 3, replace=False)
j = np.random.randint(0, self.pop_size)
self.F = np.random.uniform(0, 1)
## Crossover
if np.random.uniform(0, 1) < self.pop[idx][self.ID_CR] or idx == j:
pos_new = self.pop[idxs[0]][self.ID_POS] + self.F * (self.pop[idxs[1]][self.ID_POS] - self.pop[idxs[2]][self.ID_POS])
cr_new = self.pop[idxs[0]][self.ID_CR] + self.F * (self.pop[idxs[1]][self.ID_CR] - self.pop[idxs[2]][self.ID_CR])
mr_new = self.pop[idxs[0]][self.ID_MR] + self.F * (self.pop[idxs[1]][self.ID_MR] - self.pop[idxs[2]][self.ID_MR])
if self.branch == "ABS":
ps_new = self.pop[idxs[0]][self.ID_PS] + int(self.F * (self.pop[idxs[1]][self.ID_PS] - self.pop[idxs[2]][self.ID_PS]))
else: # elif self.branch == "REL":
ps_new = self.pop[idxs[0]][self.ID_PS] + self.F * (self.pop[idxs[1]][self.ID_PS] - self.pop[idxs[2]][self.ID_PS])
pos_new = self.amend_position(pos_new, self.problem.lb, self.problem.ub)
cr_new = self.edit_to_range(cr_new, 0, 1, np.random.random)
mr_new = self.edit_to_range(mr_new, 0, 1, np.random.random)
pop.append([pos_new, None, cr_new, mr_new, ps_new])
else:
pop.append(deepcopy(self.pop[idx]))
## Mutation
if np.random.uniform(0, 1) < self.pop[idxs[0]][self.ID_MR]:
pos_new = self.pop[idx][self.ID_POS] + np.random.normal(0, self.pop[idxs[0]][self.ID_MR])
cr_new = np.random.normal(0, 1)
mr_new = np.random.normal(0, 1)
if self.branch == "ABS":
ps_new = self.pop[idx][self.ID_PS] + int(np.random.normal(0.5, 1))
else: # elif self.branch == "REL":
ps_new = self.pop[idx][self.ID_PS] + np.random.normal(0, self.pop[idxs[0]][self.ID_MR])
pos_new = self.amend_position(pos_new, self.problem.lb, self.problem.ub)
pop.append([pos_new, None, cr_new, mr_new, ps_new])
pop = self.update_target_wrapper_population(pop)
# Calculate new population size
total = sum([pop[i][self.ID_PS] for i in range(0, self.pop_size)])
if self.branch == "ABS":
m_new = int(total / self.pop_size)
else: # elif self.branch == "REL":
m_new = int(self.pop_size + total)
if m_new <= 4:
m_new = self.fixed_pop_size + int(np.random.uniform(0, 4))
elif m_new > 4 * self.fixed_pop_size:
m_new = self.fixed_pop_size - int(np.random.uniform(0, 4))
## Change population by population size
if m_new <= self.pop_size:
self.pop = pop[:m_new]
else:
pop_sorted = self.get_sorted_strim_population(pop)
self.pop = pop + pop_sorted[:m_new - self.pop_size]
self.pop_size = len(self.pop)
| 44
| 149
| 0.569763
| 5,563
| 39,204
| 3.823477
| 0.069567
| 0.055947
| 0.032581
| 0.021721
| 0.839492
| 0.797978
| 0.7685
| 0.72976
| 0.701222
| 0.676916
| 0
| 0.0376
| 0.293108
| 39,204
| 890
| 150
| 44.049438
| 0.72991
| 0.299842
| 0
| 0.636364
| 0
| 0
| 0.005957
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.038961
| false
| 0
| 0.008658
| 0
| 0.082251
| 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
|
5250a8f188395b5f8c73fdfddf229b45c7a3d3f6
| 174
|
py
|
Python
|
aluno/admin.py
|
latreta/dvestagio
|
d18f7c7184748c7b88e335ae9ffd2bdcc197d14f
|
[
"MIT"
] | null | null | null |
aluno/admin.py
|
latreta/dvestagio
|
d18f7c7184748c7b88e335ae9ffd2bdcc197d14f
|
[
"MIT"
] | null | null | null |
aluno/admin.py
|
latreta/dvestagio
|
d18f7c7184748c7b88e335ae9ffd2bdcc197d14f
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import Aluno
# Register your models here.
admin.site.register(Aluno, UserAdmin)
| 29
| 47
| 0.821839
| 25
| 174
| 5.72
| 0.52
| 0.13986
| 0.237762
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.109195
| 174
| 6
| 48
| 29
| 0.922581
| 0.149425
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.75
| 0
| 0.75
| 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
|
5262e576a63823ae200e3245888f42016621ac5d
| 487
|
py
|
Python
|
redbrick/common/constants.py
|
dereklukacs/redbrick-sdk
|
4cf93444c1d808694c1601334f9e039e616dfd3d
|
[
"MIT"
] | 1
|
2020-11-26T04:25:15.000Z
|
2020-11-26T04:25:15.000Z
|
redbrick/common/constants.py
|
redbrick-ai/redbrick-sdk
|
4cf93444c1d808694c1601334f9e039e616dfd3d
|
[
"MIT"
] | 33
|
2021-02-04T17:51:53.000Z
|
2022-03-17T07:28:36.000Z
|
redbrick/common/constants.py
|
dereklukacs/redbrick-sdk
|
4cf93444c1d808694c1601334f9e039e616dfd3d
|
[
"MIT"
] | 1
|
2021-06-09T10:06:35.000Z
|
2021-06-09T10:06:35.000Z
|
"""Constants."""
MAX_CONCURRENCY = 30
MAX_RETRY_ATTEMPTS = 5
DEFAULT_URL = "https://api.redbrickai.com"
ORG_API_HAS_CHANGED = (
"this api has changed recently, try running help(redbrick.get_org)"
+ " or visiting https://redbrick-sdk.readthedocs.io/en/stable/#redbrick.get_org"
)
PROJECT_API_HAS_CHANGED = (
"this api has changed recently, try running help(redbrick.get_project)"
+ " or visiting https://redbrick-sdk.readthedocs.io/en/stable/#redbrick.get_project"
)
| 27.055556
| 88
| 0.737166
| 68
| 487
| 5.073529
| 0.455882
| 0.069565
| 0.150725
| 0.098551
| 0.701449
| 0.701449
| 0.701449
| 0.701449
| 0.701449
| 0.701449
| 0
| 0.007109
| 0.13347
| 487
| 17
| 89
| 28.647059
| 0.810427
| 0.020534
| 0
| 0
| 0
| 0
| 0.670913
| 0.101911
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 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
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
527f2c2e7e0c7dddde7b68daa613de9b412ddef9
| 59,101
|
py
|
Python
|
azure-iot-device/tests/iothub/shared_client_tests.py
|
askpatrickw/azure-iot-sdk-python
|
3c5bc5bd857697b95fc3a57c07d2b9e7af2563a6
|
[
"MIT"
] | null | null | null |
azure-iot-device/tests/iothub/shared_client_tests.py
|
askpatrickw/azure-iot-sdk-python
|
3c5bc5bd857697b95fc3a57c07d2b9e7af2563a6
|
[
"MIT"
] | null | null | null |
azure-iot-device/tests/iothub/shared_client_tests.py
|
askpatrickw/azure-iot-sdk-python
|
3c5bc5bd857697b95fc3a57c07d2b9e7af2563a6
|
[
"MIT"
] | null | null | null |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""This module contains tests that are shared between sync/async clients
i.e. tests for things defined in abstract clients"""
import pytest
import logging
import os
import io
import six
import socks
from azure.iot.device.common import auth
from azure.iot.device.common.auth import sastoken as st
from azure.iot.device.common.auth import connection_string as cs
from azure.iot.device.iothub.pipeline import IoTHubPipelineConfig
from azure.iot.device.common.pipeline.config import DEFAULT_KEEPALIVE
from azure.iot.device.iothub.abstract_clients import (
RECEIVE_TYPE_NONE_SET,
RECEIVE_TYPE_HANDLER,
RECEIVE_TYPE_API,
)
from azure.iot.device.iothub import edge_hsm
from azure.iot.device import ProxyOptions
from azure.iot.device import exceptions as client_exceptions
logging.basicConfig(level=logging.DEBUG)
################################
# SHARED DEVICE + MODULE TESTS #
################################
class SharedIoTHubClientInstantiationTests(object):
@pytest.mark.it(
"Stores the MQTTPipeline from the 'mqtt_pipeline' parameter in the '_mqtt_pipeline' attribute"
)
def test_mqtt_pipeline_attribute(self, client_class, mqtt_pipeline, http_pipeline):
client = client_class(mqtt_pipeline, http_pipeline)
assert client._mqtt_pipeline is mqtt_pipeline
@pytest.mark.it(
"Stores the HTTPPipeline from the 'http_pipeline' parameter in the '_http_pipeline' attribute"
)
def test_sets_http_pipeline_attribute(self, client_class, mqtt_pipeline, http_pipeline):
client = client_class(mqtt_pipeline, http_pipeline)
assert client._http_pipeline is http_pipeline
@pytest.mark.it("Sets on_connected handler in the MQTTPipeline")
def test_sets_on_connected_handler_in_pipeline(
self, client_class, mqtt_pipeline, http_pipeline
):
client = client_class(mqtt_pipeline, http_pipeline)
assert client._mqtt_pipeline.on_connected is not None
assert client._mqtt_pipeline.on_connected == client._on_connected
@pytest.mark.it("Sets on_disconnected handler in the MQTTPipeline")
def test_sets_on_disconnected_handler_in_pipeline(
self, client_class, mqtt_pipeline, http_pipeline
):
client = client_class(mqtt_pipeline, http_pipeline)
assert client._mqtt_pipeline.on_disconnected is not None
assert client._mqtt_pipeline.on_disconnected == client._on_disconnected
@pytest.mark.it("Sets on_method_request_received handler in the MQTTPipeline")
def test_sets_on_method_request_received_handler_in_pipleline(
self, client_class, mqtt_pipeline, http_pipeline
):
client = client_class(mqtt_pipeline, http_pipeline)
assert client._mqtt_pipeline.on_method_request_received is not None
assert (
client._mqtt_pipeline.on_method_request_received
== client._inbox_manager.route_method_request
)
@pytest.mark.it("Sets the Receive Mode/Type for the client as yet-unchosen")
def test_initial_receive_mode(self, client_class, mqtt_pipeline, http_pipeline):
client = client_class(mqtt_pipeline, http_pipeline)
assert client._receive_type == RECEIVE_TYPE_NONE_SET
@pytest.mark.usefixtures("mock_mqtt_pipeline_init", "mock_http_pipeline_init")
class SharedIoTHubClientCreateMethodUserOptionTests(object):
@pytest.fixture
def option_test_required_patching(self, mocker):
"""Override this fixture in a subclass if unique patching is required"""
pass
@pytest.mark.it(
"Sets the 'product_info' user option parameter on the PipelineConfig, if provided"
)
def test_product_info_option(
self,
option_test_required_patching,
client_create_method,
create_method_args,
mock_mqtt_pipeline_init,
mock_http_pipeline_init,
):
product_info = "MyProductInfo"
client_create_method(*create_method_args, product_info=product_info)
# Get configuration object, and ensure it was used for both protocol pipelines
assert mock_mqtt_pipeline_init.call_count == 1
config = mock_mqtt_pipeline_init.call_args[0][0]
assert isinstance(config, IoTHubPipelineConfig)
assert config == mock_http_pipeline_init.call_args[0][0]
assert config.product_info == product_info
@pytest.mark.it(
"Sets the 'websockets' user option parameter on the PipelineConfig, if provided"
)
def test_websockets_option(
self,
option_test_required_patching,
client_create_method,
create_method_args,
mock_mqtt_pipeline_init,
mock_http_pipeline_init,
):
client_create_method(*create_method_args, websockets=True)
# Get configuration object, and ensure it was used for both protocol pipelines
assert mock_mqtt_pipeline_init.call_count == 1
config = mock_mqtt_pipeline_init.call_args[0][0]
assert isinstance(config, IoTHubPipelineConfig)
assert config == mock_http_pipeline_init.call_args[0][0]
assert config.websockets
# TODO: Show that input in the wrong format is formatted to the correct one. This test exists
# in the IoTHubPipelineConfig object already, but we do not currently show that this is felt
# from the API level.
@pytest.mark.it("Sets the 'cipher' user option parameter on the PipelineConfig, if provided")
def test_cipher_option(
self,
option_test_required_patching,
client_create_method,
create_method_args,
mock_mqtt_pipeline_init,
mock_http_pipeline_init,
):
cipher = "DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:ECDHE-ECDSA-AES128-GCM-SHA256"
client_create_method(*create_method_args, cipher=cipher)
# Get configuration object, and ensure it was used for both protocol pipelines
assert mock_mqtt_pipeline_init.call_count == 1
config = mock_mqtt_pipeline_init.call_args[0][0]
assert isinstance(config, IoTHubPipelineConfig)
assert config == mock_http_pipeline_init.call_args[0][0]
assert config.cipher == cipher
@pytest.mark.it(
"Sets the 'server_verification_cert' user option parameter on the PipelineConfig, if provided"
)
def test_server_verification_cert_option(
self,
option_test_required_patching,
client_create_method,
create_method_args,
mock_mqtt_pipeline_init,
mock_http_pipeline_init,
):
server_verification_cert = "fake_server_verification_cert"
client_create_method(*create_method_args, server_verification_cert=server_verification_cert)
# Get configuration object, and ensure it was used for both protocol pipelines
assert mock_mqtt_pipeline_init.call_count == 1
config = mock_mqtt_pipeline_init.call_args[0][0]
assert isinstance(config, IoTHubPipelineConfig)
assert config == mock_http_pipeline_init.call_args[0][0]
assert config.server_verification_cert == server_verification_cert
@pytest.mark.it(
"Sets the 'proxy_options' user option parameter on the PipelineConfig, if provided"
)
def test_proxy_options(
self,
option_test_required_patching,
client_create_method,
create_method_args,
mock_mqtt_pipeline_init,
mock_http_pipeline_init,
):
proxy_options = ProxyOptions(proxy_type=socks.HTTP, proxy_addr="127.0.0.1", proxy_port=8888)
client_create_method(*create_method_args, proxy_options=proxy_options)
# Get configuration object, and ensure it was used for both protocol pipelines
assert mock_mqtt_pipeline_init.call_count == 1
config = mock_mqtt_pipeline_init.call_args[0][0]
assert isinstance(config, IoTHubPipelineConfig)
assert config == mock_http_pipeline_init.call_args[0][0]
assert config.proxy_options is proxy_options
@pytest.mark.it(
"Sets the 'keep_alive' user option parameter on the PipelineConfig, if provided"
)
def test_keep_alive_options(
self,
option_test_required_patching,
client_create_method,
create_method_args,
mock_mqtt_pipeline_init,
mock_http_pipeline_init,
):
keepalive_value = 60
client_create_method(*create_method_args, keep_alive=keepalive_value)
# Get configuration object, and ensure it was used for both protocol pipelines
assert mock_mqtt_pipeline_init.call_count == 1
config = mock_mqtt_pipeline_init.call_args[0][0]
assert isinstance(config, IoTHubPipelineConfig)
assert config == mock_http_pipeline_init.call_args[0][0]
assert config.keep_alive == keepalive_value
@pytest.mark.it("Raises a TypeError if an invalid user option parameter is provided")
def test_invalid_option(
self, option_test_required_patching, client_create_method, create_method_args
):
with pytest.raises(TypeError):
client_create_method(*create_method_args, invalid_option="some_value")
@pytest.mark.it("Sets default user options if none are provided")
def test_default_options(
self,
mocker,
option_test_required_patching,
client_create_method,
create_method_args,
mock_mqtt_pipeline_init,
mock_http_pipeline_init,
):
client_create_method(*create_method_args)
# Both pipelines use the same IoTHubPipelineConfig
assert mock_mqtt_pipeline_init.call_count == 1
assert mock_http_pipeline_init.call_count == 1
assert mock_mqtt_pipeline_init.call_args[0][0] is mock_http_pipeline_init.call_args[0][0]
config = mock_mqtt_pipeline_init.call_args[0][0]
assert isinstance(config, IoTHubPipelineConfig)
# Pipeline Config has default options set that were not user-specified
assert config.product_info == ""
assert config.websockets is False
assert config.cipher == ""
assert config.proxy_options is None
assert config.server_verification_cert is None
assert config.keep_alive == DEFAULT_KEEPALIVE
# TODO: consider splitting this test class up into device/module specific test classes to avoid
# the conditional logic in some tests
@pytest.mark.usefixtures("mock_mqtt_pipeline_init", "mock_http_pipeline_init")
class SharedIoTHubClientCreateFromConnectionStringTests(
SharedIoTHubClientCreateMethodUserOptionTests
):
@pytest.fixture
def client_create_method(self, client_class):
"""Provides the specific create method for use in universal tests"""
return client_class.create_from_connection_string
@pytest.fixture
def create_method_args(self, connection_string):
"""Provides the specific create method args for use in universal tests"""
return [connection_string]
@pytest.mark.it(
"Creates a SasToken that uses a SymmetricKeySigningMechanism, from the values in the provided connection string"
)
def test_sastoken(self, mocker, client_class, connection_string):
sksm_mock = mocker.patch.object(auth, "SymmetricKeySigningMechanism")
sastoken_mock = mocker.patch.object(st, "SasToken")
cs_obj = cs.ConnectionString(connection_string)
custom_ttl = 1000
client_class.create_from_connection_string(connection_string, sastoken_ttl=custom_ttl)
# Determine expected URI based on class under test
if client_class.__name__ == "IoTHubDeviceClient":
expected_uri = "{hostname}/devices/{device_id}".format(
hostname=cs_obj[cs.HOST_NAME], device_id=cs_obj[cs.DEVICE_ID]
)
else:
expected_uri = "{hostname}/devices/{device_id}/modules/{module_id}".format(
hostname=cs_obj[cs.HOST_NAME],
device_id=cs_obj[cs.DEVICE_ID],
module_id=cs_obj[cs.MODULE_ID],
)
# SymmetricKeySigningMechanism created using the connection string's SharedAccessKey
assert sksm_mock.call_count == 1
assert sksm_mock.call_args == mocker.call(key=cs_obj[cs.SHARED_ACCESS_KEY])
# Token was created with a SymmetricKeySigningMechanism, the expected URI, and custom ttl
assert sastoken_mock.call_count == 1
assert sastoken_mock.call_args == mocker.call(
expected_uri, sksm_mock.return_value, ttl=custom_ttl
)
@pytest.mark.it(
"Uses 3600 seconds (1 hour) as the default SasToken TTL if no custom TTL is provided"
)
def test_sastoken_default(self, mocker, client_class, connection_string):
sksm_mock = mocker.patch.object(auth, "SymmetricKeySigningMechanism")
sastoken_mock = mocker.patch.object(st, "SasToken")
cs_obj = cs.ConnectionString(connection_string)
client_class.create_from_connection_string(connection_string)
# Determine expected URI based on class under test
if client_class.__name__ == "IoTHubDeviceClient":
expected_uri = "{hostname}/devices/{device_id}".format(
hostname=cs_obj[cs.HOST_NAME], device_id=cs_obj[cs.DEVICE_ID]
)
else:
expected_uri = "{hostname}/devices/{device_id}/modules/{module_id}".format(
hostname=cs_obj[cs.HOST_NAME],
device_id=cs_obj[cs.DEVICE_ID],
module_id=cs_obj[cs.MODULE_ID],
)
# SymmetricKeySigningMechanism created using the connection string's SharedAccessKey
assert sksm_mock.call_count == 1
assert sksm_mock.call_args == mocker.call(key=cs_obj[cs.SHARED_ACCESS_KEY])
# Token was created with a SymmetricKeySigningMechanism, the expected URI, and default ttl
assert sastoken_mock.call_count == 1
assert sastoken_mock.call_args == mocker.call(
expected_uri, sksm_mock.return_value, ttl=3600
)
@pytest.mark.it(
"Creates MQTT and HTTP Pipelines with an IoTHubPipelineConfig object containing the SasToken and values from the connection string"
)
def test_pipeline_config(
self,
mocker,
client_class,
connection_string,
mock_mqtt_pipeline_init,
mock_http_pipeline_init,
):
sastoken_mock = mocker.patch.object(st, "SasToken")
cs_obj = cs.ConnectionString(connection_string)
client_class.create_from_connection_string(connection_string)
# Verify pipelines created with an IoTHubPipelineConfig
assert mock_mqtt_pipeline_init.call_count == 1
assert mock_http_pipeline_init.call_count == 1
assert mock_mqtt_pipeline_init.call_args[0][0] is mock_http_pipeline_init.call_args[0][0]
assert isinstance(mock_mqtt_pipeline_init.call_args[0][0], IoTHubPipelineConfig)
# Verify the IoTHubPipelineConfig is constructed as expected
config = mock_mqtt_pipeline_init.call_args[0][0]
assert config.device_id == cs_obj[cs.DEVICE_ID]
assert config.hostname == cs_obj[cs.HOST_NAME]
assert config.sastoken is sastoken_mock.return_value
if client_class.__name__ == "IoTHubModuleClient":
assert config.module_id == cs_obj[cs.MODULE_ID]
assert config.blob_upload is False
assert config.method_invoke is False
else:
assert config.module_id is None
assert config.blob_upload is True
assert config.method_invoke is False
if cs_obj.get(cs.GATEWAY_HOST_NAME):
assert config.gateway_hostname == cs_obj[cs.GATEWAY_HOST_NAME]
else:
assert config.gateway_hostname is None
@pytest.mark.it(
"Returns an instance of an IoTHub client using the created MQTT and HTTP pipelines"
)
def test_client_returned(
self,
mocker,
client_class,
connection_string,
mock_mqtt_pipeline_init,
mock_http_pipeline_init,
):
client = client_class.create_from_connection_string(connection_string)
assert isinstance(client, client_class)
assert client._mqtt_pipeline is mock_mqtt_pipeline_init.return_value
assert client._http_pipeline is mock_http_pipeline_init.return_value
@pytest.mark.it("Raises ValueError when given an invalid connection string")
@pytest.mark.parametrize(
"bad_cs",
[
pytest.param("not-a-connection-string", id="Garbage string"),
pytest.param(
"HostName=value.domain.net;DeviceId=my_device;SharedAccessKey=Invalid",
id="Shared Access Key invalid",
),
pytest.param(
"HostName=value.domain.net;WrongValue=Invalid;SharedAccessKey=Zm9vYmFy",
id="Contains extraneous data",
),
pytest.param("HostName=value.domain.net;DeviceId=my_device", id="Incomplete"),
],
)
def test_raises_value_error_on_bad_connection_string(self, client_class, bad_cs):
with pytest.raises(ValueError):
client_class.create_from_connection_string(bad_cs)
@pytest.mark.it("Raises ValueError if a SasToken creation results in failure")
def test_raises_value_error_on_sastoken_failure(self, mocker, client_class, connection_string):
sastoken_mock = mocker.patch.object(st, "SasToken")
token_err = st.SasTokenError("Some SasToken failure")
sastoken_mock.side_effect = token_err
with pytest.raises(ValueError) as e_info:
client_class.create_from_connection_string(connection_string)
assert e_info.value.__cause__ is token_err
class SharedIoTHubClientPROPERTYHandlerTests(object):
@pytest.fixture(autouse=True)
def teardown(self, client, handler_name):
"""In an async context this makes sure tasks are finished"""
yield
try:
setattr(client, handler_name, None)
except client_exceptions.ClientError:
# In some tests involving locked client receive modes, trying to set
# back to None will raise errors (because handlers are disallowed).
# Just catch the error and keep it moving - if the client mode was locked
# then there's no need for the cleanup anyway
pass
@pytest.mark.it("Can have its value set and retrieved")
def test_read_write(self, client, handler, handler_name):
assert getattr(client, handler_name) is None
setattr(client, handler_name, handler)
assert getattr(client, handler_name) is handler
@pytest.mark.it("Reflects the value of the handler manager property of the same name")
def test_set_on_handler_manager(self, client, handler, handler_name):
assert getattr(client, handler_name) is None
assert getattr(client, handler_name) is getattr(client._handler_manager, handler_name)
setattr(client, handler_name, handler)
assert getattr(client, handler_name) is handler
assert getattr(client, handler_name) is getattr(client._handler_manager, handler_name)
@pytest.mark.it(
"Implicitly enables the corresponding feature if not already enabled, when a handler value is set"
)
def test_enables_feature_only_if_not_already_enabled(
self, mocker, client, handler, handler_name, feature_name, mqtt_pipeline
):
# Feature will appear disabled
mqtt_pipeline.feature_enabled.__getitem__.return_value = False
# Set handler
setattr(client, handler_name, handler)
# Feature was enabled
assert mqtt_pipeline.enable_feature.call_count == 1
assert mqtt_pipeline.enable_feature.call_args[0][0] == feature_name
mqtt_pipeline.enable_feature.reset_mock()
# Feature will appear already enabled
mqtt_pipeline.feature_enabled.__getitem__.return_value = True
# Set handler
setattr(client, handler_name, handler)
# Feature was not enabled again
assert mqtt_pipeline.enable_feature.call_count == 0
@pytest.mark.it(
"Implicitly disables the corresponding feature if not already disabled, when handler value is set back to None"
)
def test_disables_feature_only_if_not_already_disabled(
self, mocker, client, handler_name, feature_name, mqtt_pipeline
):
# Feature will appear enabled
mqtt_pipeline.feature_enabled.__getitem__.return_value = True
# Set handler to None
setattr(client, handler_name, None)
# Feature was disabled
assert mqtt_pipeline.disable_feature.call_count == 1
assert mqtt_pipeline.disable_feature.call_args[0][0] == feature_name
mqtt_pipeline.disable_feature.reset_mock()
# Feature will appear already disabled
mqtt_pipeline.feature_enabled.__getitem__.return_value = False
# Set handler to None
setattr(client, handler_name, None)
# Feature was not disabled again
assert mqtt_pipeline.disable_feature.call_count == 0
@pytest.mark.it(
"Locks the client to Handler Receive Mode if the receive mode has not yet been set"
)
def test_receive_mode_not_set(self, client, handler, handler_name):
assert client._receive_type is RECEIVE_TYPE_NONE_SET
setattr(client, handler_name, handler)
assert client._receive_type is RECEIVE_TYPE_HANDLER
@pytest.mark.it(
"Does not modify the client receive mode if it has already been set to Handler Receive Mode"
)
def test_receive_mode_set_handler(self, client, handler, handler_name):
client._receive_type = RECEIVE_TYPE_HANDLER
setattr(client, handler_name, handler)
assert client._receive_type is RECEIVE_TYPE_HANDLER
@pytest.mark.it(
"Raises a ClientError and does nothing else if the client receive mode has already been set to API Receive Mode"
)
def test_receive_mode_set_api(self, client, handler, handler_name, mqtt_pipeline):
client._receive_type = RECEIVE_TYPE_API
# Error was raised
with pytest.raises(client_exceptions.ClientError):
setattr(client, handler_name, handler)
# Feature was not enabled
assert mqtt_pipeline.enable_feature.call_count == 0
# NOTE: If more properties are added, this class should become a general purpose properties testclass
class SharedIoTHubClientPROPERTYConnectedTests(object):
@pytest.mark.it("Cannot be changed")
def test_read_only(self, client):
with pytest.raises(AttributeError):
client.connected = not client.connected
@pytest.mark.it("Reflects the value of the root stage property of the same name")
def test_reflects_pipeline_property(self, client, mqtt_pipeline):
mqtt_pipeline.connected = True
assert client.connected
mqtt_pipeline.connected = False
assert not client.connected
##############################
# SHARED DEVICE CLIENT TESTS #
##############################
@pytest.mark.usefixtures("mock_mqtt_pipeline_init", "mock_http_pipeline_init")
class SharedIoTHubDeviceClientCreateFromSymmetricKeyTests(
SharedIoTHubClientCreateMethodUserOptionTests
):
hostname = "durmstranginstitute.farend"
device_id = "MySnitch"
symmetric_key = "Zm9vYmFy"
@pytest.fixture
def client_create_method(self, client_class):
"""Provides the specific create method for use in universal tests"""
return client_class.create_from_symmetric_key
@pytest.fixture
def create_method_args(self):
"""Provides the specific create method args for use in universal tests"""
return [self.symmetric_key, self.hostname, self.device_id]
@pytest.mark.it(
"Creates a SasToken that uses a SymmetricKeySigningMechanism, from the values provided in parameters"
)
def test_sastoken(self, mocker, client_class):
sksm_mock = mocker.patch.object(auth, "SymmetricKeySigningMechanism")
sastoken_mock = mocker.patch.object(st, "SasToken")
expected_uri = "{hostname}/devices/{device_id}".format(
hostname=self.hostname, device_id=self.device_id
)
custom_ttl = 1000
client_class.create_from_symmetric_key(
symmetric_key=self.symmetric_key,
hostname=self.hostname,
device_id=self.device_id,
sastoken_ttl=custom_ttl,
)
# SymmetricKeySigningMechanism created using the provided symmetric key
assert sksm_mock.call_count == 1
assert sksm_mock.call_args == mocker.call(key=self.symmetric_key)
# SasToken created with the SymmetricKeySigningMechanism, the expected URI, and the custom ttl
assert sastoken_mock.call_count == 1
assert sastoken_mock.call_args == mocker.call(
expected_uri, sksm_mock.return_value, ttl=custom_ttl
)
@pytest.mark.it(
"Uses 3600 seconds (1 hour) as the default SasToken TTL if no custom TTL is provided"
)
def test_sastoken_default(self, mocker, client_class):
sksm_mock = mocker.patch.object(auth, "SymmetricKeySigningMechanism")
sastoken_mock = mocker.patch.object(st, "SasToken")
expected_uri = "{hostname}/devices/{device_id}".format(
hostname=self.hostname, device_id=self.device_id
)
client_class.create_from_symmetric_key(
symmetric_key=self.symmetric_key, hostname=self.hostname, device_id=self.device_id
)
# SymmetricKeySigningMechanism created using the provided symmetric key
assert sksm_mock.call_count == 1
assert sksm_mock.call_args == mocker.call(key=self.symmetric_key)
# SasToken created with the SymmetricKeySigningMechanism, the expected URI, and the default ttl
assert sastoken_mock.call_count == 1
assert sastoken_mock.call_args == mocker.call(
expected_uri, sksm_mock.return_value, ttl=3600
)
@pytest.mark.it(
"Creates MQTT and HTTP pipelines with an IoTHubPipelineConfig object containing the SasToken and values provided in parameters"
)
def test_pipeline_config(
self, mocker, client_class, mock_mqtt_pipeline_init, mock_http_pipeline_init
):
sastoken_mock = mocker.patch.object(st, "SasToken")
client_class.create_from_symmetric_key(
symmetric_key=self.symmetric_key, hostname=self.hostname, device_id=self.device_id
)
# Verify pipelines created with an IoTHubPipelineConfig
assert mock_mqtt_pipeline_init.call_count == 1
assert mock_http_pipeline_init.call_count == 1
assert mock_mqtt_pipeline_init.call_args[0][0] is mock_http_pipeline_init.call_args[0][0]
assert isinstance(mock_mqtt_pipeline_init.call_args[0][0], IoTHubPipelineConfig)
# Verify the IoTHubPipelineConfig is constructed as expected
config = mock_mqtt_pipeline_init.call_args[0][0]
assert config.device_id == self.device_id
assert config.hostname == self.hostname
assert config.gateway_hostname is None
assert config.sastoken is sastoken_mock.return_value
assert config.blob_upload is True
assert config.method_invoke is False
@pytest.mark.it(
"Returns an instance of an IoTHubDeviceClient using the created MQTT and HTTP pipelines"
)
def test_client_returned(
self, mocker, client_class, mock_mqtt_pipeline_init, mock_http_pipeline_init
):
client = client_class.create_from_symmetric_key(
symmetric_key=self.symmetric_key, hostname=self.hostname, device_id=self.device_id
)
assert isinstance(client, client_class)
assert client._mqtt_pipeline is mock_mqtt_pipeline_init.return_value
assert client._http_pipeline is mock_http_pipeline_init.return_value
@pytest.mark.it("Raises ValueError if a SasToken creation results in failure")
def test_raises_value_error_on_sastoken_failure(self, mocker, client_class):
sastoken_mock = mocker.patch.object(st, "SasToken")
token_err = st.SasTokenError("Some SasToken failure")
sastoken_mock.side_effect = token_err
with pytest.raises(ValueError) as e_info:
client_class.create_from_symmetric_key(
symmetric_key=self.symmetric_key, hostname=self.hostname, device_id=self.device_id
)
assert e_info.value.__cause__ is token_err
@pytest.mark.usefixtures("mock_mqtt_pipeline_init", "mock_http_pipeline_init")
class SharedIoTHubDeviceClientCreateFromX509CertificateTests(
SharedIoTHubClientCreateMethodUserOptionTests
):
hostname = "durmstranginstitute.farend"
device_id = "MySnitch"
@pytest.fixture
def client_create_method(self, client_class):
"""Provides the specific create method for use in universal tests"""
return client_class.create_from_x509_certificate
@pytest.fixture
def create_method_args(self, x509):
"""Provides the specific create method args for use in universal tests"""
return [x509, self.hostname, self.device_id]
@pytest.mark.it(
"Creates MQTT and HTTP pipelines with an IoTHubPipelineConfig object containing the X509 and other values provided in parameters"
)
def test_pipeline_config(
self, mocker, client_class, x509, mock_mqtt_pipeline_init, mock_http_pipeline_init
):
client_class.create_from_x509_certificate(
x509=x509, hostname=self.hostname, device_id=self.device_id
)
# Verify pipelines created with an IoTHubPipelineConfig
assert mock_mqtt_pipeline_init.call_count == 1
assert mock_http_pipeline_init.call_count == 1
assert mock_mqtt_pipeline_init.call_args[0][0] == mock_http_pipeline_init.call_args[0][0]
assert isinstance(mock_mqtt_pipeline_init.call_args[0][0], IoTHubPipelineConfig)
# Verify the IoTHubPipelineConfig is constructed as expected
config = mock_mqtt_pipeline_init.call_args[0][0]
assert config.device_id == self.device_id
assert config.hostname == self.hostname
assert config.gateway_hostname is None
assert config.x509 is x509
assert config.blob_upload is True
assert config.method_invoke is False
@pytest.mark.it(
"Returns an instance of an IoTHubDeviceclient using the created MQTT and HTTP pipelines"
)
def test_client_returned(
self, mocker, client_class, x509, mock_mqtt_pipeline_init, mock_http_pipeline_init
):
client = client_class.create_from_x509_certificate(
x509=x509, hostname=self.hostname, device_id=self.device_id
)
assert isinstance(client, client_class)
assert client._mqtt_pipeline is mock_mqtt_pipeline_init.return_value
assert client._http_pipeline is mock_http_pipeline_init.return_value
@pytest.mark.it("Raises a TypeError if the 'sastoken_ttl' kwarg is supplied by the user")
def test_sastoken_ttl(self, client_class, x509):
with pytest.raises(TypeError):
client_class.create_from_x509_certificate(
x509=x509, hostname=self.hostname, device_id=self.device_id, sastoken_ttl=1000
)
##############################
# SHARED MODULE CLIENT TESTS #
##############################
@pytest.mark.usefixtures("mock_mqtt_pipeline_init", "mock_http_pipeline_init")
class SharedIoTHubModuleClientCreateFromX509CertificateTests(
SharedIoTHubClientCreateMethodUserOptionTests
):
hostname = "durmstranginstitute.farend"
device_id = "MySnitch"
module_id = "Charms"
@pytest.fixture
def client_create_method(self, client_class):
"""Provides the specific create method for use in universal tests"""
return client_class.create_from_x509_certificate
@pytest.fixture
def create_method_args(self, x509):
"""Provides the specific create method args for use in universal tests"""
return [x509, self.hostname, self.device_id, self.module_id]
@pytest.mark.it(
"Creates MQTT and HTTP pipelines with an IoTHubPipelineConfig object containing the X509 and other values provided in parameters"
)
def test_pipeline_config(
self, mocker, client_class, x509, mock_mqtt_pipeline_init, mock_http_pipeline_init
):
client_class.create_from_x509_certificate(
x509=x509, hostname=self.hostname, device_id=self.device_id, module_id=self.module_id
)
# Verify pipelines created with an IoTHubPipelineConfig
assert mock_mqtt_pipeline_init.call_count == 1
assert mock_http_pipeline_init.call_count == 1
assert mock_mqtt_pipeline_init.call_args[0][0] == mock_http_pipeline_init.call_args[0][0]
assert isinstance(mock_mqtt_pipeline_init.call_args[0][0], IoTHubPipelineConfig)
# Verify the IoTHubPipelineConfig is constructed as expected
config = mock_mqtt_pipeline_init.call_args[0][0]
assert config.device_id == self.device_id
assert config.hostname == self.hostname
assert config.gateway_hostname is None
assert config.x509 is x509
assert config.blob_upload is False
assert config.method_invoke is False
@pytest.mark.it(
"Returns an instance of an IoTHubDeviceclient using the created MQTT and HTTP pipelines"
)
def test_client_returned(
self, mocker, client_class, x509, mock_mqtt_pipeline_init, mock_http_pipeline_init
):
client = client_class.create_from_x509_certificate(
x509=x509, hostname=self.hostname, device_id=self.device_id, module_id=self.module_id
)
assert isinstance(client, client_class)
assert client._mqtt_pipeline is mock_mqtt_pipeline_init.return_value
assert client._http_pipeline is mock_http_pipeline_init.return_value
@pytest.mark.it("Raises a TypeError if the 'sastoken_ttl' kwarg is supplied by the user")
def test_sastoken_ttl(self, client_class, x509):
with pytest.raises(TypeError):
client_class.create_from_x509_certificate(
x509=x509, hostname=self.hostname, device_id=self.device_id, sastoken_ttl=1000
)
@pytest.mark.usefixtures("mock_mqtt_pipeline_init", "mock_http_pipeline_init")
class SharedIoTHubModuleClientClientCreateFromEdgeEnvironmentUserOptionTests(
SharedIoTHubClientCreateMethodUserOptionTests
):
"""This class inherites the user option tests shared by all create method APIs, and overrides
tests in order to accomodate unique requirements for the .create_from_edge_enviornment() method.
Because .create_from_edge_environment() tests are spread accross multiple test units
(i.e. test classes), these overrides are done in this class, which is then inherited by all
.create_from_edge_environment() test units below.
"""
@pytest.fixture
def client_create_method(self, client_class):
"""Provides the specific create method for use in universal tests"""
return client_class.create_from_edge_environment
@pytest.fixture
def create_method_args(self):
"""Provides the specific create method args for use in universal tests"""
return []
@pytest.mark.it(
"Raises a TypeError if the 'server_verification_cert' user option parameter is provided"
)
def test_server_verification_cert_option(
self,
option_test_required_patching,
client_create_method,
create_method_args,
mock_mqtt_pipeline_init,
mock_http_pipeline_init,
):
"""THIS TEST OVERRIDES AN INHERITED TEST"""
# Override to test that server_verification_cert CANNOT be provided in Edge scenarios
with pytest.raises(TypeError):
client_create_method(
*create_method_args, server_verification_cert="fake_server_verification_cert"
)
@pytest.mark.it("Sets default user options if none are provided")
def test_default_options(
self,
mocker,
option_test_required_patching,
client_create_method,
create_method_args,
mock_mqtt_pipeline_init,
mock_http_pipeline_init,
):
"""THIS TEST OVERRIDES AN INHERITED TEST"""
# Override so that can avoid the check on server_verification_cert being None
# as in Edge scenarios, it is not None
client_create_method(*create_method_args)
# Both pipelines use the same IoTHubPipelineConfig
assert mock_mqtt_pipeline_init.call_count == 1
assert mock_http_pipeline_init.call_count == 1
assert mock_mqtt_pipeline_init.call_args[0][0] is mock_http_pipeline_init.call_args[0][0]
config = mock_mqtt_pipeline_init.call_args[0][0]
assert isinstance(config, IoTHubPipelineConfig)
# Pipeline Config has default options that were not specified
assert config.product_info == ""
assert config.websockets is False
assert config.cipher == ""
assert config.proxy_options is None
assert config.keep_alive == DEFAULT_KEEPALIVE
@pytest.mark.usefixtures("mock_mqtt_pipeline_init", "mock_http_pipeline_init")
class SharedIoTHubModuleClientCreateFromEdgeEnvironmentWithContainerEnvTests(
SharedIoTHubModuleClientClientCreateFromEdgeEnvironmentUserOptionTests
):
@pytest.fixture
def option_test_required_patching(self, mocker, mock_edge_hsm, edge_container_environment):
"""THIS FIXTURE OVERRIDES AN INHERITED FIXTURE"""
mocker.patch.dict(os.environ, edge_container_environment, clear=True)
@pytest.mark.it(
"Creates a SasToken that uses an IoTEdgeHsm, from the values extracted from the Edge environment and the user-provided TTL"
)
def test_sastoken(self, mocker, client_class, mock_edge_hsm, edge_container_environment):
mocker.patch.dict(os.environ, edge_container_environment, clear=True)
sastoken_mock = mocker.patch.object(st, "SasToken")
expected_uri = "{hostname}/devices/{device_id}/modules/{module_id}".format(
hostname=edge_container_environment["IOTEDGE_IOTHUBHOSTNAME"],
device_id=edge_container_environment["IOTEDGE_DEVICEID"],
module_id=edge_container_environment["IOTEDGE_MODULEID"],
)
custom_ttl = 1000
client_class.create_from_edge_environment(sastoken_ttl=custom_ttl)
# IoTEdgeHsm created using the extracted values
assert mock_edge_hsm.call_count == 1
assert mock_edge_hsm.call_args == mocker.call(
module_id=edge_container_environment["IOTEDGE_MODULEID"],
generation_id=edge_container_environment["IOTEDGE_MODULEGENERATIONID"],
workload_uri=edge_container_environment["IOTEDGE_WORKLOADURI"],
api_version=edge_container_environment["IOTEDGE_APIVERSION"],
)
# SasToken created with the IoTEdgeHsm, the expected URI and the custom ttl
assert sastoken_mock.call_count == 1
assert sastoken_mock.call_args == mocker.call(
expected_uri, mock_edge_hsm.return_value, ttl=custom_ttl
)
@pytest.mark.it(
"Uses 3600 seconds (1 hour) as the default SasToken TTL if no custom TTL is provided"
)
def test_sastoken_default(
self, mocker, client_class, mock_edge_hsm, edge_container_environment
):
mocker.patch.dict(os.environ, edge_container_environment, clear=True)
sastoken_mock = mocker.patch.object(st, "SasToken")
expected_uri = "{hostname}/devices/{device_id}/modules/{module_id}".format(
hostname=edge_container_environment["IOTEDGE_IOTHUBHOSTNAME"],
device_id=edge_container_environment["IOTEDGE_DEVICEID"],
module_id=edge_container_environment["IOTEDGE_MODULEID"],
)
client_class.create_from_edge_environment()
# IoTEdgeHsm created using the extracted values
assert mock_edge_hsm.call_count == 1
assert mock_edge_hsm.call_args == mocker.call(
module_id=edge_container_environment["IOTEDGE_MODULEID"],
generation_id=edge_container_environment["IOTEDGE_MODULEGENERATIONID"],
workload_uri=edge_container_environment["IOTEDGE_WORKLOADURI"],
api_version=edge_container_environment["IOTEDGE_APIVERSION"],
)
# SasToken created with the IoTEdgeHsm, the expected URI, and the default ttl
assert sastoken_mock.call_count == 1
assert sastoken_mock.call_args == mocker.call(
expected_uri, mock_edge_hsm.return_value, ttl=3600
)
@pytest.mark.it(
"Uses an IoTEdgeHsm as the SasToken signing mechanism even if any Edge local debug environment variables may also be present"
)
def test_hybrid_env(
self,
mocker,
client_class,
mock_edge_hsm,
edge_container_environment,
edge_local_debug_environment,
):
hybrid_environment = merge_dicts(edge_container_environment, edge_local_debug_environment)
mocker.patch.dict(os.environ, hybrid_environment, clear=True)
sastoken_mock = mocker.patch.object(st, "SasToken")
mock_sksm = mocker.patch.object(auth, "SymmetricKeySigningMechanism")
client_class.create_from_edge_environment()
assert mock_sksm.call_count == 0 # we did NOT use SK signing mechanism
assert mock_edge_hsm.call_count == 1 # instead, we still used edge hsm
assert mock_edge_hsm.call_args == mocker.call(
module_id=edge_container_environment["IOTEDGE_MODULEID"],
generation_id=edge_container_environment["IOTEDGE_MODULEGENERATIONID"],
workload_uri=edge_container_environment["IOTEDGE_WORKLOADURI"],
api_version=edge_container_environment["IOTEDGE_APIVERSION"],
)
assert sastoken_mock.call_count == 1
assert sastoken_mock.call_args == mocker.call(
mocker.ANY, mock_edge_hsm.return_value, ttl=3600
)
@pytest.mark.it(
"Creates MQTT and HTTP pipelines with an IoTHubPipelineConfig object containing the SasToken and values extracted from the Edge environment"
)
def test_pipeline_config(
self,
mocker,
client_class,
mock_edge_hsm,
edge_container_environment,
mock_mqtt_pipeline_init,
mock_http_pipeline_init,
):
mocker.patch.dict(os.environ, edge_container_environment, clear=True)
sastoken_mock = mocker.patch.object(st, "SasToken")
client_class.create_from_edge_environment()
# Verify pipelines created with an IoTHubPipelineConfig
assert mock_mqtt_pipeline_init.call_count == 1
assert mock_http_pipeline_init.call_count == 1
assert mock_mqtt_pipeline_init.call_args[0][0] is mock_http_pipeline_init.call_args[0][0]
assert isinstance(mock_mqtt_pipeline_init.call_args[0][0], IoTHubPipelineConfig)
# Verify the IoTHubPipelineConfig is constructed as expected
config = mock_mqtt_pipeline_init.call_args[0][0]
assert config.device_id == edge_container_environment["IOTEDGE_DEVICEID"]
assert config.module_id == edge_container_environment["IOTEDGE_MODULEID"]
assert config.hostname == edge_container_environment["IOTEDGE_IOTHUBHOSTNAME"]
assert config.gateway_hostname == edge_container_environment["IOTEDGE_GATEWAYHOSTNAME"]
assert config.sastoken is sastoken_mock.return_value
assert (
config.server_verification_cert
== mock_edge_hsm.return_value.get_certificate.return_value
)
assert config.method_invoke is True
assert config.blob_upload is False
@pytest.mark.it(
"Returns an instance of an IoTHubModuleClient using the created MQTT and HTTP pipelines"
)
def test_client_returns(
self,
mocker,
client_class,
mock_edge_hsm,
edge_container_environment,
mock_mqtt_pipeline_init,
mock_http_pipeline_init,
):
mocker.patch.dict(os.environ, edge_container_environment, clear=True)
client = client_class.create_from_edge_environment()
assert isinstance(client, client_class)
assert client._mqtt_pipeline is mock_mqtt_pipeline_init.return_value
assert client._http_pipeline is mock_http_pipeline_init.return_value
@pytest.mark.it("Raises OSError if the environment is missing required variables")
@pytest.mark.parametrize(
"missing_env_var",
[
"IOTEDGE_MODULEID",
"IOTEDGE_DEVICEID",
"IOTEDGE_IOTHUBHOSTNAME",
"IOTEDGE_GATEWAYHOSTNAME",
"IOTEDGE_APIVERSION",
"IOTEDGE_MODULEGENERATIONID",
"IOTEDGE_WORKLOADURI",
],
)
def test_bad_environment(
self, mocker, client_class, edge_container_environment, missing_env_var
):
# Remove a variable from the fixture
del edge_container_environment[missing_env_var]
mocker.patch.dict(os.environ, edge_container_environment, clear=True)
with pytest.raises(OSError):
client_class.create_from_edge_environment()
@pytest.mark.it(
"Raises OSError if there is an error retrieving the server verification certificate from Edge with the IoTEdgeHsm"
)
def test_bad_edge_auth(self, mocker, client_class, edge_container_environment, mock_edge_hsm):
mocker.patch.dict(os.environ, edge_container_environment, clear=True)
my_edge_error = edge_hsm.IoTEdgeError()
mock_edge_hsm.return_value.get_certificate.side_effect = my_edge_error
with pytest.raises(OSError) as e_info:
client_class.create_from_edge_environment()
assert e_info.value.__cause__ is my_edge_error
@pytest.mark.it("Raises ValueError if a SasToken creation results in failure")
def test_raises_value_error_on_sastoken_failure(
self, mocker, client_class, edge_container_environment, mock_edge_hsm
):
mocker.patch.dict(os.environ, edge_container_environment, clear=True)
sastoken_mock = mocker.patch.object(st, "SasToken")
token_err = st.SasTokenError("Some SasToken failure")
sastoken_mock.side_effect = token_err
with pytest.raises(ValueError) as e_info:
client_class.create_from_edge_environment()
assert e_info.value.__cause__ is token_err
@pytest.mark.usefixtures("mock_mqtt_pipeline_init", "mock_http_pipeline_init")
class SharedIoTHubModuleClientCreateFromEdgeEnvironmentWithDebugEnvTests(
SharedIoTHubModuleClientClientCreateFromEdgeEnvironmentUserOptionTests
):
@pytest.fixture
def option_test_required_patching(self, mocker, mock_open, edge_local_debug_environment):
"""THIS FIXTURE OVERRIDES AN INHERITED FIXTURE"""
mocker.patch.dict(os.environ, edge_local_debug_environment, clear=True)
@pytest.fixture
def mock_open(self, mocker):
return mocker.patch.object(io, "open")
@pytest.mark.it(
"Creates a SasToken that uses a SymmetricKeySigningMechanism, from the values in the connection string extracted from the Edge local debug environment, as well as the user-provided TTL"
)
def test_sastoken(self, mocker, client_class, mock_open, edge_local_debug_environment):
mocker.patch.dict(os.environ, edge_local_debug_environment, clear=True)
sksm_mock = mocker.patch.object(auth, "SymmetricKeySigningMechanism")
sastoken_mock = mocker.patch.object(st, "SasToken")
cs_obj = cs.ConnectionString(edge_local_debug_environment["EdgeHubConnectionString"])
expected_uri = "{hostname}/devices/{device_id}/modules/{module_id}".format(
hostname=cs_obj[cs.HOST_NAME],
device_id=cs_obj[cs.DEVICE_ID],
module_id=cs_obj[cs.MODULE_ID],
)
custom_ttl = 1000
client_class.create_from_edge_environment(sastoken_ttl=custom_ttl)
# SymmetricKeySigningMechanism created using the connection string's Shared Access Key
assert sksm_mock.call_count == 1
assert sksm_mock.call_args == mocker.call(key=cs_obj[cs.SHARED_ACCESS_KEY])
# SasToken created with the SymmetricKeySigningMechanism, the expected URI, and the custom ttl
assert sastoken_mock.call_count == 1
assert sastoken_mock.call_args == mocker.call(
expected_uri, sksm_mock.return_value, ttl=custom_ttl
)
@pytest.mark.it(
"Uses 3600 seconds (1 hour) as the default SasToken TTL if no custom TTL is provided"
)
def test_sastoken_default(self, mocker, client_class, mock_open, edge_local_debug_environment):
mocker.patch.dict(os.environ, edge_local_debug_environment, clear=True)
sksm_mock = mocker.patch.object(auth, "SymmetricKeySigningMechanism")
sastoken_mock = mocker.patch.object(st, "SasToken")
cs_obj = cs.ConnectionString(edge_local_debug_environment["EdgeHubConnectionString"])
expected_uri = "{hostname}/devices/{device_id}/modules/{module_id}".format(
hostname=cs_obj[cs.HOST_NAME],
device_id=cs_obj[cs.DEVICE_ID],
module_id=cs_obj[cs.MODULE_ID],
)
client_class.create_from_edge_environment()
# SymmetricKeySigningMechanism created using the connection string's Shared Access Key
assert sksm_mock.call_count == 1
assert sksm_mock.call_args == mocker.call(key=cs_obj[cs.SHARED_ACCESS_KEY])
# SasToken created with the SymmetricKeySigningMechanism, the expected URI and default ttl
assert sastoken_mock.call_count == 1
assert sastoken_mock.call_args == mocker.call(
expected_uri, sksm_mock.return_value, ttl=3600
)
@pytest.mark.it(
"Only uses Edge local debug variables if no Edge container variables are present in the environment"
)
def test_auth_provider_and_pipeline_hybrid_env(
self,
mocker,
client_class,
edge_container_environment,
edge_local_debug_environment,
mock_open,
mock_edge_hsm,
):
# This test verifies that the presence of edge container environment variables means the
# code will follow the edge container environment creation path (using the IoTEdgeHsm)
# even if edge local debug variables are present.
hybrid_environment = merge_dicts(edge_container_environment, edge_local_debug_environment)
mocker.patch.dict(os.environ, hybrid_environment, clear=True)
sastoken_mock = mocker.patch.object(st, "SasToken")
sksm_mock = mocker.patch.object(auth, "SymmetricKeySigningMechanism")
client_class.create_from_edge_environment()
assert sksm_mock.call_count == 0 # we did NOT use SK signing mechanism
assert mock_edge_hsm.call_count == 1 # instead, we still used edge HSM
assert mock_edge_hsm.call_args == mocker.call(
module_id=edge_container_environment["IOTEDGE_MODULEID"],
generation_id=edge_container_environment["IOTEDGE_MODULEGENERATIONID"],
workload_uri=edge_container_environment["IOTEDGE_WORKLOADURI"],
api_version=edge_container_environment["IOTEDGE_APIVERSION"],
)
assert sastoken_mock.call_count == 1
assert sastoken_mock.call_args == mocker.call(
mocker.ANY, mock_edge_hsm.return_value, ttl=3600
)
@pytest.mark.it(
"Extracts the server verification certificate from the file indicated by the filepath extracted from the Edge local debug environment"
)
def test_open_ca_cert(self, mocker, client_class, edge_local_debug_environment, mock_open):
mock_file_handle = mock_open.return_value.__enter__.return_value
mocker.patch.dict(os.environ, edge_local_debug_environment, clear=True)
client_class.create_from_edge_environment()
assert mock_open.call_count == 1
assert mock_open.call_args == mocker.call(
edge_local_debug_environment["EdgeModuleCACertificateFile"], mode="r"
)
assert mock_file_handle.read.call_count == 1
assert mock_file_handle.read.call_args == mocker.call()
@pytest.mark.it(
"Creates MQTT and HTTP pipelines with an IoTHubPipelineConfig object containing the SasToken and values extracted from the Edge local debug environment"
)
def test_pipeline_config(
self,
mocker,
client_class,
mock_open,
edge_local_debug_environment,
mock_mqtt_pipeline_init,
mock_http_pipeline_init,
):
mocker.patch.dict(os.environ, edge_local_debug_environment, clear=True)
sastoken_mock = mocker.patch.object(st, "SasToken")
mock_file_handle = mock_open.return_value.__enter__.return_value
ca_cert_file_contents = "some cert"
mock_file_handle.read.return_value = ca_cert_file_contents
cs_obj = cs.ConnectionString(edge_local_debug_environment["EdgeHubConnectionString"])
client_class.create_from_edge_environment()
# Verify pipelines created with an IoTHubPipelineConfig
assert mock_mqtt_pipeline_init.call_count == 1
assert mock_http_pipeline_init.call_count == 1
assert mock_mqtt_pipeline_init.call_args[0][0] is mock_http_pipeline_init.call_args[0][0]
assert isinstance(mock_mqtt_pipeline_init.call_args[0][0], IoTHubPipelineConfig)
# Verify the IoTHubPipelingConfig is constructed as expected
config = mock_mqtt_pipeline_init.call_args[0][0]
assert config.device_id == cs_obj[cs.DEVICE_ID]
assert config.module_id == cs_obj[cs.MODULE_ID]
assert config.hostname == cs_obj[cs.HOST_NAME]
assert config.gateway_hostname == cs_obj[cs.GATEWAY_HOST_NAME]
assert config.sastoken is sastoken_mock.return_value
assert config.server_verification_cert == ca_cert_file_contents
assert config.method_invoke is True
assert config.blob_upload is False
@pytest.mark.it(
"Returns an instance of an IoTHub client using the created MQTT and HTTP pipelines"
)
def test_client_returned(
self,
mocker,
client_class,
mock_open,
edge_local_debug_environment,
mock_mqtt_pipeline_init,
mock_http_pipeline_init,
):
mocker.patch.dict(os.environ, edge_local_debug_environment, clear=True)
client = client_class.create_from_edge_environment()
assert isinstance(client, client_class)
assert client._mqtt_pipeline is mock_mqtt_pipeline_init.return_value
assert client._http_pipeline is mock_http_pipeline_init.return_value
@pytest.mark.it("Raises OSError if the environment is missing required variables")
@pytest.mark.parametrize(
"missing_env_var", ["EdgeHubConnectionString", "EdgeModuleCACertificateFile"]
)
def test_bad_environment(
self, mocker, client_class, edge_local_debug_environment, missing_env_var, mock_open
):
# Remove a variable from the fixture
del edge_local_debug_environment[missing_env_var]
mocker.patch.dict(os.environ, edge_local_debug_environment, clear=True)
with pytest.raises(OSError):
client_class.create_from_edge_environment()
@pytest.mark.it(
"Raises ValueError if the connection string in the EdgeHubConnectionString environment variable is invalid"
)
@pytest.mark.parametrize(
"bad_cs",
[
pytest.param("not-a-connection-string", id="Garbage string"),
pytest.param(
"HostName=value.domain.net;DeviceId=my_device;ModuleId=my_module;SharedAccessKey=Invalid",
id="Shared Access Key invalid",
),
pytest.param(
"HostName=value.domain.net;WrongValue=Invalid;SharedAccessKey=Zm9vYmFy",
id="Contains extraneous data",
),
pytest.param("HostName=value.domain.net;DeviceId=my_device", id="Incomplete"),
],
)
def test_bad_connection_string(
self, mocker, client_class, edge_local_debug_environment, bad_cs, mock_open
):
edge_local_debug_environment["EdgeHubConnectionString"] = bad_cs
mocker.patch.dict(os.environ, edge_local_debug_environment, clear=True)
with pytest.raises(ValueError):
client_class.create_from_edge_environment()
@pytest.mark.it(
"Raises ValueError if the filepath in the EdgeModuleCACertificateFile environment variable is invalid"
)
def test_bad_filepath(self, mocker, client_class, edge_local_debug_environment, mock_open):
# To make tests compatible with Python 2 & 3, redfine errors
try:
FileNotFoundError # noqa: F823
except NameError:
FileNotFoundError = IOError
mocker.patch.dict(os.environ, edge_local_debug_environment, clear=True)
my_fnf_error = FileNotFoundError()
mock_open.side_effect = my_fnf_error
with pytest.raises(ValueError) as e_info:
client_class.create_from_edge_environment()
assert e_info.value.__cause__ is my_fnf_error
@pytest.mark.it(
"Raises ValueError if the file referenced by the filepath in the EdgeModuleCACertificateFile environment variable cannot be opened"
)
def test_bad_file_io(self, mocker, client_class, edge_local_debug_environment, mock_open):
# Raise a different error in Python 2 vs 3
if six.PY2:
error = IOError()
else:
error = OSError()
mocker.patch.dict(os.environ, edge_local_debug_environment, clear=True)
mock_open.side_effect = error
with pytest.raises(ValueError) as e_info:
client_class.create_from_edge_environment()
assert e_info.value.__cause__ is error
@pytest.mark.it("Raises ValueError if a SasToken creation results in failure")
def test_raises_value_error_on_sastoken_failure(
self, mocker, client_class, edge_local_debug_environment, mock_open
):
mocker.patch.dict(os.environ, edge_local_debug_environment, clear=True)
sastoken_mock = mocker.patch.object(st, "SasToken")
token_err = st.SasTokenError("Some SasToken failure")
sastoken_mock.side_effect = token_err
with pytest.raises(ValueError) as e_info:
client_class.create_from_edge_environment()
assert e_info.value.__cause__ is token_err
####################
# HELPER FUNCTIONS #
####################
def merge_dicts(d1, d2):
d3 = d1.copy()
d3.update(d2)
return d3
| 43.392805
| 193
| 0.708719
| 7,231
| 59,101
| 5.493016
| 0.066796
| 0.040483
| 0.031017
| 0.038771
| 0.843303
| 0.820972
| 0.799194
| 0.75856
| 0.733736
| 0.71435
| 0
| 0.007838
| 0.216426
| 59,101
| 1,361
| 194
| 43.424688
| 0.84986
| 0.107646
| 0
| 0.678402
| 0
| 0.003806
| 0.158666
| 0.044293
| 0
| 0
| 0
| 0.000735
| 0.19981
| 1
| 0.073264
| false
| 0.001903
| 0.014272
| 0.000951
| 0.117031
| 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
|
bfe869a9eb1470712f02bbc1350df3c1218357dd
| 44,909
|
py
|
Python
|
test/test_scrapbook_book.py
|
clach04/PyWebScrapBook
|
310e8f20cc5337336875679246b9269265b4476a
|
[
"MIT"
] | 39
|
2019-04-10T18:07:40.000Z
|
2022-02-07T07:11:30.000Z
|
test/test_scrapbook_book.py
|
clach04/PyWebScrapBook
|
310e8f20cc5337336875679246b9269265b4476a
|
[
"MIT"
] | 56
|
2019-05-07T23:29:14.000Z
|
2022-02-24T10:33:43.000Z
|
test/test_scrapbook_book.py
|
clach04/PyWebScrapBook
|
310e8f20cc5337336875679246b9269265b4476a
|
[
"MIT"
] | 15
|
2019-06-12T05:16:43.000Z
|
2022-01-16T13:24:11.000Z
|
from unittest import mock
import unittest
import os
import shutil
import io
import re
import zipfile
import time
import functools
from webscrapbook import WSB_DIR, Config
from webscrapbook import util
from webscrapbook.scrapbook.host import Host
from webscrapbook.scrapbook import book as wsb_book
from webscrapbook.scrapbook.book import Book
root_dir = os.path.abspath(os.path.dirname(__file__))
test_root = os.path.join(root_dir, 'test_scrapbook_book')
def setUpModule():
# mock out user config
global mockings
mockings = [
mock.patch('webscrapbook.scrapbook.host.WSB_USER_DIR', os.path.join(test_root, 'wsb')),
mock.patch('webscrapbook.WSB_USER_DIR', os.path.join(test_root, 'wsb')),
mock.patch('webscrapbook.WSB_USER_CONFIG', test_root),
]
for mocking in mockings:
mocking.start()
def tearDownModule():
# stop mock
for mocking in mockings:
mocking.stop()
class TestBook(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.maxDiff = 8192
cls.test_root = os.path.join(test_root, 'general')
cls.test_wsbdir = os.path.join(cls.test_root, WSB_DIR)
cls.test_config = os.path.join(cls.test_root, WSB_DIR, 'config.ini')
def setUp(self):
"""Set up a general temp test folder
"""
try:
shutil.rmtree(self.test_root)
except NotADirectoryError:
os.remove(self.test_root)
except FileNotFoundError:
pass
os.makedirs(self.test_wsbdir)
def tearDown(self):
"""Remove general temp test folder
"""
try:
shutil.rmtree(self.test_root)
except NotADirectoryError:
os.remove(self.test_root)
except FileNotFoundError:
pass
def create_general_config(self):
with open(self.test_config, 'w', encoding='UTF-8') as f:
f.write("""[book ""]
name = scrapbook
top_dir =
data_dir = data
tree_dir = tree
index = tree/map.html
no_tree = false
""")
def test_init01(self):
"""Check basic"""
with open(self.test_config, 'w', encoding='UTF-8') as f:
f.write("""[book ""]
name = scrapbook
top_dir =
data_dir = data
tree_dir = tree
index = tree/map.html
no_tree = false
""")
host = Host(self.test_root)
book = Book(host)
self.assertEqual(book.host, host)
self.assertEqual(book.id, '')
self.assertEqual(book.name, 'scrapbook')
self.assertEqual(book.root, self.test_root)
self.assertEqual(book.top_dir, self.test_root)
self.assertEqual(book.data_dir, os.path.join(self.test_root, 'data'))
self.assertEqual(book.tree_dir, os.path.join(self.test_root, 'tree'))
self.assertFalse(book.no_tree)
def test_init02(self):
"""Check book_id param"""
with open(self.test_config, 'w', encoding='UTF-8') as f:
f.write("""[book "book1"]
name = scrapbook1
top_dir =
data_dir =
tree_dir = .wsb/tree
index = .wsb/tree/map.html
no_tree = false
""")
host = Host(self.test_root)
book = Book(host, 'book1')
self.assertEqual(book.host, host)
self.assertEqual(book.id, 'book1')
self.assertEqual(book.name, 'scrapbook1')
self.assertEqual(book.root, self.test_root)
self.assertEqual(book.top_dir, self.test_root)
self.assertEqual(book.data_dir, self.test_root)
self.assertEqual(book.tree_dir, os.path.join(self.test_root, '.wsb', 'tree'))
self.assertFalse(book.no_tree)
def test_init03(self):
"""Check modified path"""
with open(self.test_config, 'w', encoding='UTF-8') as f:
f.write("""[app]
root = public
[book ""]
name = scrapbook
top_dir = sb
data_dir = data
tree_dir = tree
index = tree/map.html
no_tree = false
""")
host = Host(self.test_root)
book = Book(host)
self.assertEqual(book.host, host)
self.assertEqual(book.id, '')
self.assertEqual(book.name, 'scrapbook')
self.assertEqual(book.root, self.test_root)
self.assertEqual(book.top_dir, os.path.join(self.test_root, 'public', 'sb'))
self.assertEqual(book.data_dir, os.path.join(self.test_root, 'public', 'sb', 'data'))
self.assertEqual(book.tree_dir, os.path.join(self.test_root, 'public', 'sb', 'tree'))
self.assertFalse(book.no_tree)
def test_get_subpath(self):
self.create_general_config()
book = Book(Host(self.test_root))
self.assertEqual(book.get_subpath(os.path.join(self.test_root, 'tree', 'meta.js')), 'tree/meta.js')
def test_get_tree_file(self):
self.create_general_config()
book = Book(Host(self.test_root))
self.assertEqual(book.get_tree_file('meta'), os.path.join(self.test_root, 'tree', 'meta.js'))
self.assertEqual(book.get_tree_file('toc', 1), os.path.join(self.test_root, 'tree', 'toc1.js'))
def test_iter_tree_files01(self):
self.create_general_config()
os.makedirs(os.path.join(self.test_root, 'tree'))
with open(os.path.join(self.test_root, 'tree', 'meta.js'), 'w', encoding='UTF-8') as f:
pass
with open(os.path.join(self.test_root, 'tree', 'meta1.js'), 'w', encoding='UTF-8') as f:
pass
with open(os.path.join(self.test_root, 'tree', 'meta2.js'), 'w', encoding='UTF-8') as f:
pass
book = Book(Host(self.test_root))
self.assertEqual(list(book.iter_tree_files('meta')), [
os.path.join(self.test_root, 'tree', 'meta.js'),
os.path.join(self.test_root, 'tree', 'meta1.js'),
os.path.join(self.test_root, 'tree', 'meta2.js'),
])
def test_iter_tree_files02(self):
"""Break since nonexisting index"""
self.create_general_config()
os.makedirs(os.path.join(self.test_root, 'tree'))
with open(os.path.join(self.test_root, 'tree', 'meta.js'), 'w', encoding='UTF-8') as f:
pass
with open(os.path.join(self.test_root, 'tree', 'meta1.js'), 'w', encoding='UTF-8') as f:
pass
with open(os.path.join(self.test_root, 'tree', 'meta3.js'), 'w', encoding='UTF-8') as f:
pass
book = Book(Host(self.test_root))
self.assertEqual(list(book.iter_tree_files('meta')), [
os.path.join(self.test_root, 'tree', 'meta.js'),
os.path.join(self.test_root, 'tree', 'meta1.js'),
])
def test_iter_tree_files03(self):
"""Works when directory not exist"""
book = Book(Host(self.test_root))
self.assertEqual(list(book.iter_tree_files('meta')), [])
@mock.patch('webscrapbook.scrapbook.book.Book.iter_tree_files')
def test_iter_meta_files(self, mock_func):
book = Book(Host(self.test_root))
for i in book.iter_meta_files():
pass
mock_func.assert_called_once_with('meta')
@mock.patch('webscrapbook.scrapbook.book.Book.iter_tree_files')
def test_iter_toc_files(self, mock_func):
book = Book(Host(self.test_root))
for i in book.iter_toc_files():
pass
mock_func.assert_called_once_with('toc')
@mock.patch('webscrapbook.scrapbook.book.Book.iter_tree_files')
def test_iter_fulltext_files(self, mock_func):
book = Book(Host(self.test_root))
for i in book.iter_fulltext_files():
pass
mock_func.assert_called_once_with('fulltext')
def test_load_tree_file01(self):
"""Test normal loading"""
self.create_general_config()
with open(os.path.join(self.test_root, 'meta.js'), 'w', encoding='UTF-8') as f:
f.write("""/**
* This file is generated by WebScrapBook and is not intended to be edited.
*/
scrapbook.meta({
"20200101000000000": {
"index": "20200101000000000/index.html",
"title": "Dummy",
"type": "",
"create": "20200101000000000",
"modify": "20200101000000000"
}
})""")
book = Book(Host(self.test_root))
self.assertEqual(
book.load_tree_file(os.path.join(self.test_root, 'meta.js')), {
'20200101000000000': {
'index': '20200101000000000/index.html',
'title': 'Dummy',
'type': '',
'create': '20200101000000000',
'modify': '20200101000000000',
},
})
def test_load_tree_file02(self):
"""Test malformed wrapping"""
self.create_general_config()
with open(os.path.join(self.test_root, 'meta.js'), 'w', encoding='UTF-8') as f:
f.write("""
scrapbook.meta({
"20200101000000000": {
"index": "20200101000000000/index.html",
"title": "Dummy",
"type": "",
"create": "20200101000000000",
"modify": "20200101000000000"
}
}""")
book = Book(Host(self.test_root))
with self.assertRaises(wsb_book.TreeFileMalformedWrappingError):
book.load_tree_file(os.path.join(self.test_root, 'meta.js'))
def test_load_tree_file03(self):
"""Test malformed wrapping"""
self.create_general_config()
with open(os.path.join(self.test_root, 'meta.js'), 'w', encoding='UTF-8') as f:
f.write("""
scrapbook.meta{
"20200101000000000": {
"index": "20200101000000000/index.html",
"title": "Dummy",
"type": "",
"create": "20200101000000000",
"modify": "20200101000000000"
}
})""")
book = Book(Host(self.test_root))
with self.assertRaises(wsb_book.TreeFileMalformedWrappingError):
book.load_tree_file(os.path.join(self.test_root, 'meta.js'))
def test_load_tree_file04(self):
"""Test malformed wrapping"""
self.create_general_config()
with open(os.path.join(self.test_root, 'meta.js'), 'w', encoding='UTF-8') as f:
f.write("""({
"20200101000000000": {
"index": "20200101000000000/index.html",
"title": "Dummy",
"type": "",
"create": "20200101000000000",
"modify": "20200101000000000"
}
})""")
book = Book(Host(self.test_root))
with self.assertRaises(wsb_book.TreeFileMalformedWrappingError):
book.load_tree_file(os.path.join(self.test_root, 'meta.js'))
def test_load_tree_file05(self):
"""Test malformed JSON"""
self.create_general_config()
with open(os.path.join(self.test_root, 'meta.js'), 'w', encoding='UTF-8') as f:
f.write("""
scrapbook.meta({
'20200101000000000': {
index: '20200101000000000/index.html',
title: 'Dummy',
type: '',
create: '20200101000000000',
modify: '20200101000000000'
}
})""")
book = Book(Host(self.test_root))
with self.assertRaises(wsb_book.TreeFileMalformedJsonError):
book.load_tree_file(os.path.join(self.test_root, 'meta.js'))
def test_load_tree_file06(self):
"""Test empty file should not error out."""
self.create_general_config()
with open(os.path.join(self.test_root, 'meta.js'), 'w', encoding='UTF-8') as f:
f.write('')
book = Book(Host(self.test_root))
self.assertEqual(book.load_tree_file(os.path.join(self.test_root, 'meta.js')), {})
def test_load_tree_files01(self):
"""Test normal loading
- Item of same ID from the latter overwrites the formatter.
- Item with None value should be removed.
"""
self.create_general_config()
os.makedirs(os.path.join(self.test_root, 'tree'))
with open(os.path.join(self.test_root, 'tree', 'meta.js'), 'w', encoding='UTF-8') as f:
f.write("""/**
* This file is generated by WebScrapBook and is not intended to be edited.
*/
scrapbook.meta({
"20200101000000000": {
"index": "20200101000000000/index.html",
"title": "Dummy",
"type": "",
"create": "20200101000000000",
"modify": "20200101000000000",
"comment": "comment"
},
"20200101000000001": {
"index": "20200101000000001/index.html",
"title": "Dummy1",
"type": "",
"create": "20200101000000001",
"modify": "20200101000000001",
"comment": "comment1"
},
"20200101000000002": {
"index": "20200101000000002/index.html",
"title": "Dummy2",
"type": "",
"create": "20200101000000002",
"modify": "20200101000000002",
"comment": "comment2"
}
})""")
with open(os.path.join(self.test_root, 'tree', 'meta1.js'), 'w', encoding='UTF-8') as f:
f.write("""/**
* This file is generated by WebScrapBook and is not intended to be edited.
*/
scrapbook.meta({
"20200101000000001": {
"index": "20200101000000001/index.html",
"title": "Dummy1rev",
"type": "",
"create": "20200101000000001",
"modify": "20200101000000011"
},
"20200101000000002": null,
"20200101000000003": {
"index": "20200101000000003/index.html",
"title": "Dummy3",
"type": "",
"create": "20200101000000003",
"modify": "20200101000000003",
"comment": "comment3"
}
})""")
book = Book(Host(self.test_root))
self.assertEqual(book.load_tree_files('meta'), {
'20200101000000000': {
'index': '20200101000000000/index.html',
'title': 'Dummy',
'type': '',
'create': '20200101000000000',
'modify': '20200101000000000',
'comment': 'comment',
},
'20200101000000001': {
'index': '20200101000000001/index.html',
'title': 'Dummy1rev',
'type': '',
'create': '20200101000000001',
'modify': '20200101000000011',
},
'20200101000000003': {
'index': '20200101000000003/index.html',
'title': 'Dummy3',
'type': '',
'create': '20200101000000003',
'modify': '20200101000000003',
'comment': 'comment3',
},
})
def test_load_tree_files02(self):
"""Works when directory not exist"""
book = Book(Host(self.test_root))
self.assertEqual(book.load_tree_files('meta'), {})
@mock.patch('webscrapbook.scrapbook.book.Book.load_tree_files')
def test_load_meta_files01(self, mock_func):
book = Book(Host(self.test_root))
book.load_meta_files()
mock_func.assert_called_once_with('meta')
@mock.patch('webscrapbook.scrapbook.book.Book.load_tree_files')
def test_load_meta_files02(self, mock_func):
book = Book(Host(self.test_root))
book.meta = {}
book.load_meta_files()
mock_func.assert_not_called()
@mock.patch('webscrapbook.scrapbook.book.Book.load_tree_files')
def test_load_meta_files03(self, mock_func):
book = Book(Host(self.test_root))
book.meta = {}
book.load_meta_files(refresh=True)
mock_func.assert_called_once_with('meta')
@mock.patch('webscrapbook.scrapbook.book.Book.load_tree_files')
def test_load_toc_files01(self, mock_func):
book = Book(Host(self.test_root))
book.load_toc_files()
mock_func.assert_called_once_with('toc')
@mock.patch('webscrapbook.scrapbook.book.Book.load_tree_files')
def test_load_toc_files02(self, mock_func):
book = Book(Host(self.test_root))
book.toc = {}
book.load_toc_files()
mock_func.assert_not_called()
@mock.patch('webscrapbook.scrapbook.book.Book.load_tree_files')
def test_load_toc_files03(self, mock_func):
book = Book(Host(self.test_root))
book.toc = {}
book.load_toc_files(refresh=True)
mock_func.assert_called_once_with('toc')
@mock.patch('webscrapbook.scrapbook.book.Book.load_tree_files')
def test_load_fulltext_files01(self, mock_func):
book = Book(Host(self.test_root))
book.load_fulltext_files()
mock_func.assert_called_once_with('fulltext')
@mock.patch('webscrapbook.scrapbook.book.Book.load_tree_files')
def test_load_fulltext_files02(self, mock_func):
book = Book(Host(self.test_root))
book.fulltext = {}
book.load_fulltext_files()
mock_func.assert_not_called()
@mock.patch('webscrapbook.scrapbook.book.Book.load_tree_files')
def test_load_fulltext_files03(self, mock_func):
book = Book(Host(self.test_root))
book.fulltext = {}
book.load_fulltext_files(refresh=True)
mock_func.assert_called_once_with('fulltext')
def test_save_meta_files01(self):
self.create_general_config()
book = Book(Host(self.test_root))
book.meta = {
'20200101000000000': {'title': 'Dummy 1 中文'},
'20200101000000001': {'title': 'Dummy 2 中文'},
}
book.save_meta_files()
with open(os.path.join(self.test_root, 'tree', 'meta.js'), encoding='UTF-8') as fh:
self.assertEqual(fh.read(), """/**
* Feel free to edit this file, but keep data code valid JSON format.
*/
scrapbook.meta({
"20200101000000000": {
"title": "Dummy 1 中文"
},
"20200101000000001": {
"title": "Dummy 2 中文"
}
})""")
@mock.patch('webscrapbook.scrapbook.book.Book.SAVE_META_THRESHOLD', 3)
def test_save_meta_files02(self):
self.create_general_config()
book = Book(Host(self.test_root))
book.meta = {
'20200101000000000': {'title': 'Dummy 1 中文'},
'20200101000000001': {'title': 'Dummy 2 中文'},
'20200101000000002': {'title': 'Dummy 3 中文'},
'20200101000000003': {'title': 'Dummy 4 中文'},
}
book.save_meta_files()
with open(os.path.join(self.test_root, 'tree', 'meta.js'), encoding='UTF-8') as fh:
self.assertEqual(fh.read(), """/**
* Feel free to edit this file, but keep data code valid JSON format.
*/
scrapbook.meta({
"20200101000000000": {
"title": "Dummy 1 中文"
},
"20200101000000001": {
"title": "Dummy 2 中文"
}
})""")
with open(os.path.join(self.test_root, 'tree', 'meta1.js'), encoding='UTF-8') as fh:
self.assertEqual(fh.read(), """/**
* Feel free to edit this file, but keep data code valid JSON format.
*/
scrapbook.meta({
"20200101000000002": {
"title": "Dummy 3 中文"
},
"20200101000000003": {
"title": "Dummy 4 中文"
}
})""")
def test_save_meta_files03(self):
self.create_general_config()
os.makedirs(os.path.join(self.test_root, 'tree'))
with open(os.path.join(self.test_root, 'tree', 'meta.js'), 'w', encoding='UTF-8') as fh:
fh.write('dummy')
with open(os.path.join(self.test_root, 'tree', 'meta1.js'), 'w', encoding='UTF-8') as fh:
fh.write('dummy1')
with open(os.path.join(self.test_root, 'tree', 'meta2.js'), 'w', encoding='UTF-8') as fh:
fh.write('dummy2')
with open(os.path.join(self.test_root, 'tree', 'meta3.js'), 'w', encoding='UTF-8') as fh:
fh.write('dummy3')
book = Book(Host(self.test_root))
book.meta = {
'20200101000000000': {'title': 'Dummy 1 中文'},
'20200101000000001': {'title': 'Dummy 2 中文'},
}
book.save_meta_files()
with open(os.path.join(self.test_root, 'tree', 'meta.js'), encoding='UTF-8') as fh:
self.assertEqual(fh.read(), """/**
* Feel free to edit this file, but keep data code valid JSON format.
*/
scrapbook.meta({
"20200101000000000": {
"title": "Dummy 1 中文"
},
"20200101000000001": {
"title": "Dummy 2 中文"
}
})""")
self.assertFalse(os.path.exists(os.path.join(self.test_root, 'tree', 'meta1.js')))
self.assertFalse(os.path.exists(os.path.join(self.test_root, 'tree', 'meta2.js')))
self.assertFalse(os.path.exists(os.path.join(self.test_root, 'tree', 'meta3.js')))
self.assertFalse(os.path.exists(os.path.join(self.test_root, 'tree', 'meta4.js')))
def test_save_meta_files04(self):
"""Check if U+2028 and U+2029 are escaped in the embedded JSON."""
self.create_general_config()
book = Book(Host(self.test_root))
book.meta = {
'20200101\u2028000000000': {'title\u20281': 'Dummy 1\u2028中文'},
'20200101\u2029000000001': {'title\u20292': 'Dummy 2\u2029中文'},
}
book.save_meta_files()
with open(os.path.join(self.test_root, 'tree', 'meta.js'), encoding='UTF-8') as fh:
self.assertEqual(fh.read(), r"""/**
* Feel free to edit this file, but keep data code valid JSON format.
*/
scrapbook.meta({
"20200101\u2028000000000": {
"title\u20281": "Dummy 1\u2028中文"
},
"20200101\u2029000000001": {
"title\u20292": "Dummy 2\u2029中文"
}
})""")
def test_save_toc_files01(self):
self.create_general_config()
book = Book(Host(self.test_root))
book.toc = {
'root': [
'20200101000000000',
'20200101000000001',
'20200101000000002',
],
'20200101000000000': [
'20200101000000003'
]
}
book.save_toc_files()
with open(os.path.join(self.test_root, 'tree', 'toc.js'), encoding='UTF-8') as fh:
self.assertEqual(fh.read(), """/**
* Feel free to edit this file, but keep data code valid JSON format.
*/
scrapbook.toc({
"root": [
"20200101000000000",
"20200101000000001",
"20200101000000002"
],
"20200101000000000": [
"20200101000000003"
]
})""")
@mock.patch('webscrapbook.scrapbook.book.Book.SAVE_TOC_THRESHOLD', 3)
def test_save_toc_files02(self):
self.create_general_config()
book = Book(Host(self.test_root))
book.toc = {
'root': [
'20200101000000000',
'20200101000000001',
'20200101000000002',
'20200101000000003',
'20200101000000004',
],
'20200101000000001': [
'20200101000000011'
],
'20200101000000002': [
'20200101000000021'
],
'20200101000000003': [
'20200101000000031',
'20200101000000032'
],
}
book.save_toc_files()
with open(os.path.join(self.test_root, 'tree', 'toc.js'), encoding='UTF-8') as fh:
self.assertEqual(fh.read(), """/**
* Feel free to edit this file, but keep data code valid JSON format.
*/
scrapbook.toc({
"root": [
"20200101000000000",
"20200101000000001",
"20200101000000002",
"20200101000000003",
"20200101000000004"
]
})""")
with open(os.path.join(self.test_root, 'tree', 'toc1.js'), encoding='UTF-8') as fh:
self.assertEqual(fh.read(), """/**
* Feel free to edit this file, but keep data code valid JSON format.
*/
scrapbook.toc({
"20200101000000001": [
"20200101000000011"
],
"20200101000000002": [
"20200101000000021"
]
})""")
with open(os.path.join(self.test_root, 'tree', 'toc2.js'), encoding='UTF-8') as fh:
self.assertEqual(fh.read(), """/**
* Feel free to edit this file, but keep data code valid JSON format.
*/
scrapbook.toc({
"20200101000000003": [
"20200101000000031",
"20200101000000032"
]
})""")
def test_save_toc_files03(self):
self.create_general_config()
os.makedirs(os.path.join(self.test_root, 'tree'))
with open(os.path.join(self.test_root, 'tree', 'toc.js'), 'w', encoding='UTF-8') as fh:
fh.write('dummy')
with open(os.path.join(self.test_root, 'tree', 'toc1.js'), 'w', encoding='UTF-8') as fh:
fh.write('dummy1')
with open(os.path.join(self.test_root, 'tree', 'toc2.js'), 'w', encoding='UTF-8') as fh:
fh.write('dummy2')
with open(os.path.join(self.test_root, 'tree', 'toc4.js'), 'w', encoding='UTF-8') as fh:
fh.write('dummy4')
book = Book(Host(self.test_root))
book.toc = {
'root': [
'20200101000000000',
'20200101000000001',
'20200101000000002',
],
'20200101000000000': [
'20200101000000003'
]
}
book.save_toc_files()
with open(os.path.join(self.test_root, 'tree', 'toc.js'), encoding='UTF-8') as fh:
self.assertEqual(fh.read(), """/**
* Feel free to edit this file, but keep data code valid JSON format.
*/
scrapbook.toc({
"root": [
"20200101000000000",
"20200101000000001",
"20200101000000002"
],
"20200101000000000": [
"20200101000000003"
]
})""")
self.assertFalse(os.path.exists(os.path.join(self.test_root, 'tree', 'toc1.js')))
self.assertFalse(os.path.exists(os.path.join(self.test_root, 'tree', 'toc2.js')))
self.assertFalse(os.path.exists(os.path.join(self.test_root, 'tree', 'toc3.js')))
self.assertTrue(os.path.exists(os.path.join(self.test_root, 'tree', 'toc4.js')))
def test_save_toc_files04(self):
"""Check if U+2028 and U+2029 are escaped in the embedded JSON."""
self.create_general_config()
book = Book(Host(self.test_root))
book.toc = {
'root': [
'20200101\u2028000000000',
'20200101\u2029000000001',
],
'20200101\u2028000000000': [
'20200101\u2029000000003'
]
}
book.save_toc_files()
with open(os.path.join(self.test_root, 'tree', 'toc.js'), encoding='UTF-8') as fh:
self.assertEqual(fh.read(), r"""/**
* Feel free to edit this file, but keep data code valid JSON format.
*/
scrapbook.toc({
"root": [
"20200101\u2028000000000",
"20200101\u2029000000001"
],
"20200101\u2028000000000": [
"20200101\u2029000000003"
]
})""")
def test_save_fulltext_files01(self):
self.create_general_config()
book = Book(Host(self.test_root))
book.fulltext = {
"20200101000000000": {
'index.html': {
'content': 'dummy text 1 中文',
}
},
"20200101000000001": {
'index.html': {
'content': 'dummy text 2 中文',
}
},
}
book.save_fulltext_files()
with open(os.path.join(self.test_root, 'tree', 'fulltext.js'), encoding='UTF-8') as fh:
self.assertEqual(fh.read(), """/**
* This file is generated by WebScrapBook and is not intended to be edited.
*/
scrapbook.fulltext({
"20200101000000000": {
"index.html": {
"content": "dummy text 1 中文"
}
},
"20200101000000001": {
"index.html": {
"content": "dummy text 2 中文"
}
}
})""")
@mock.patch('webscrapbook.scrapbook.book.Book.SAVE_FULLTEXT_THRESHOLD', 10)
def test_save_fulltext_files02(self):
self.create_general_config()
book = Book(Host(self.test_root))
book.fulltext = {
"20200101000000000": {
'index.html': {
'content': 'dummy text 1 中文',
},
'frame.html': {
'content': 'frame page content',
},
},
"20200101000000001": {
'index.html': {
'content': 'dummy text 2 中文',
},
},
"20200101000000002": {
'index.html': {
'content': 'dummy text 3 中文',
},
},
}
book.save_fulltext_files()
with open(os.path.join(self.test_root, 'tree', 'fulltext.js'), encoding='UTF-8') as fh:
self.assertEqual(fh.read(), """/**
* This file is generated by WebScrapBook and is not intended to be edited.
*/
scrapbook.fulltext({
"20200101000000000": {
"index.html": {
"content": "dummy text 1 中文"
},
"frame.html": {
"content": "frame page content"
}
}
})""")
with open(os.path.join(self.test_root, 'tree', 'fulltext1.js'), encoding='UTF-8') as fh:
self.assertEqual(fh.read(), """/**
* This file is generated by WebScrapBook and is not intended to be edited.
*/
scrapbook.fulltext({
"20200101000000001": {
"index.html": {
"content": "dummy text 2 中文"
}
}
})""")
with open(os.path.join(self.test_root, 'tree', 'fulltext2.js'), encoding='UTF-8') as fh:
self.assertEqual(fh.read(), """/**
* This file is generated by WebScrapBook and is not intended to be edited.
*/
scrapbook.fulltext({
"20200101000000002": {
"index.html": {
"content": "dummy text 3 中文"
}
}
})""")
@mock.patch('webscrapbook.scrapbook.book.Book.SAVE_FULLTEXT_THRESHOLD', 10)
def test_save_fulltext_files03(self):
self.create_general_config()
os.makedirs(os.path.join(self.test_root, 'tree'))
with open(os.path.join(self.test_root, 'tree', 'fulltext.js'), 'w', encoding='UTF-8') as fh:
fh.write('dummy')
with open(os.path.join(self.test_root, 'tree', 'fulltext1.js'), 'w', encoding='UTF-8') as fh:
fh.write('dummy1')
with open(os.path.join(self.test_root, 'tree', 'fulltext2.js'), 'w', encoding='UTF-8') as fh:
fh.write('dummy2')
with open(os.path.join(self.test_root, 'tree', 'fulltext3.js'), 'w', encoding='UTF-8') as fh:
fh.write('dummy3')
with open(os.path.join(self.test_root, 'tree', 'fulltext4.js'), 'w', encoding='UTF-8') as fh:
fh.write('dummy4')
with open(os.path.join(self.test_root, 'tree', 'fulltext6.js'), 'w', encoding='UTF-8') as fh:
fh.write('dummy6')
book = Book(Host(self.test_root))
book.fulltext = {
"20200101000000000": {
'index.html': {
'content': 'dummy text 1 中文',
},
'frame.html': {
'content': 'frame page content',
},
},
"20200101000000001": {
'index.html': {
'content': 'dummy text 2 中文',
},
},
}
book.save_fulltext_files()
with open(os.path.join(self.test_root, 'tree', 'fulltext.js'), encoding='UTF-8') as fh:
self.assertEqual(fh.read(), """/**
* This file is generated by WebScrapBook and is not intended to be edited.
*/
scrapbook.fulltext({
"20200101000000000": {
"index.html": {
"content": "dummy text 1 中文"
},
"frame.html": {
"content": "frame page content"
}
}
})""")
with open(os.path.join(self.test_root, 'tree', 'fulltext1.js'), encoding='UTF-8') as fh:
self.assertEqual(fh.read(), """/**
* This file is generated by WebScrapBook and is not intended to be edited.
*/
scrapbook.fulltext({
"20200101000000001": {
"index.html": {
"content": "dummy text 2 中文"
}
}
})""")
self.assertFalse(os.path.exists(os.path.join(self.test_root, 'tree', 'fulltext2.js')))
self.assertFalse(os.path.exists(os.path.join(self.test_root, 'tree', 'fulltext3.js')))
self.assertFalse(os.path.exists(os.path.join(self.test_root, 'tree', 'fulltext4.js')))
self.assertFalse(os.path.exists(os.path.join(self.test_root, 'tree', 'fulltext5.js')))
self.assertTrue(os.path.exists(os.path.join(self.test_root, 'tree', 'fulltext6.js')))
def test_save_fulltext_files04(self):
"""Check if U+2028 and U+2029 are escaped in the embedded JSON."""
self.create_general_config()
book = Book(Host(self.test_root))
book.fulltext = {
"20200101\u2028000000000": {
'index.html': {
'content': 'dummy text 1 中文',
}
},
"20200101\u2029000000001": {
'index.html': {
'content': 'dummy text 2 中文',
}
},
}
book.save_fulltext_files()
with open(os.path.join(self.test_root, 'tree', 'fulltext.js'), encoding='UTF-8') as fh:
self.assertEqual(fh.read(), r"""/**
* This file is generated by WebScrapBook and is not intended to be edited.
*/
scrapbook.fulltext({
"20200101\u2028000000000": {
"index.html": {
"content": "dummy text 1 中文"
}
},
"20200101\u2029000000001": {
"index.html": {
"content": "dummy text 2 中文"
}
}
})""")
@mock.patch('webscrapbook.scrapbook.host.Host.auto_backup')
def test_backup(self, mock_func):
test_file = os.path.join(self.test_root, 'tree', 'meta.js')
host = Host(self.test_root)
book = Book(host)
book.backup(test_file)
mock_func.assert_called_with(test_file)
book.backup(test_file, base=self.test_wsbdir, move=False)
mock_func.assert_called_with(test_file, base=self.test_wsbdir, move=False)
@mock.patch('webscrapbook.scrapbook.host.FileLock')
def test_get_lock01(self, mock_filelock):
self.create_general_config()
host = Host(self.test_root)
book = Book(host)
book.get_lock('test')
mock_filelock.assert_called_once_with(host, 'book--test')
@mock.patch('webscrapbook.scrapbook.host.FileLock')
def test_get_lock02(self, mock_filelock):
"""With parameters"""
self.create_general_config()
host = Host(self.test_root)
book = Book(host)
book.get_lock('test',
timeout=10, stale=120, poll_interval=0.3, assume_acquired=True)
mock_filelock.assert_called_once_with(host, 'book--test',
timeout=10, stale=120, poll_interval=0.3, assume_acquired=True)
@mock.patch('webscrapbook.scrapbook.book.Book.get_lock')
def test_get_tree_lock01(self, mock_get_lock):
self.create_general_config()
host = Host(self.test_root)
book = Book(host)
book.get_tree_lock()
mock_get_lock.assert_called_once_with('tree')
@mock.patch('webscrapbook.scrapbook.book.Book.get_lock')
def test_get_tree_lock02(self, mock_get_lock):
"""With parameters"""
self.create_general_config()
host = Host(self.test_root)
book = Book(host)
book.get_tree_lock(timeout=10, stale=120, poll_interval=0.3, assume_acquired=True)
mock_get_lock.assert_called_once_with('tree',
timeout=10, stale=120, poll_interval=0.3, assume_acquired=True)
def test_get_index_paths01(self):
self.create_general_config()
book = Book(Host(self.test_root))
self.assertEqual(book.get_index_paths('20200101000000000/index.html'), ['index.html'])
self.assertEqual(book.get_index_paths('20200101000000000.html'), ['20200101000000000.html'])
self.assertEqual(book.get_index_paths('20200101000000000.htz'), ['index.html'])
def test_get_index_paths02(self):
"""MAFF with single page"""
self.create_general_config()
os.makedirs(os.path.join(self.test_root, 'data'))
archive_file = os.path.join(self.test_root, 'data', '20200101000000000.maff')
with zipfile.ZipFile(archive_file, 'w') as zh:
zh.writestr('20200101000000000/index.html', """dummy""")
book = Book(Host(self.test_root))
self.assertEqual(book.get_index_paths('20200101000000000.maff'), ['20200101000000000/index.html'])
def test_get_index_paths03(self):
"""MAFF with multiple pages"""
self.create_general_config()
os.makedirs(os.path.join(self.test_root, 'data'))
archive_file = os.path.join(self.test_root, 'data', '20200101000000000.maff')
with zipfile.ZipFile(archive_file, 'w') as zh:
zh.writestr('20200101000000000/index.html', """dummy""")
zh.writestr('20200101000000001/index.html', """dummy""")
book = Book(Host(self.test_root))
self.assertEqual(book.get_index_paths('20200101000000000.maff'), ['20200101000000000/index.html', '20200101000000001/index.html'])
def test_get_index_paths04(self):
"""MAFF with no page"""
self.create_general_config()
os.makedirs(os.path.join(self.test_root, 'data'))
archive_file = os.path.join(self.test_root, 'data', '20200101000000000.maff')
with zipfile.ZipFile(archive_file, 'w') as zh:
pass
book = Book(Host(self.test_root))
self.assertEqual(book.get_index_paths('20200101000000000.maff'), [])
def test_get_icon_file01(self):
"""Pass if file not exist."""
book = Book(Host(self.test_root))
self.assertIsNone(book.get_icon_file({
'index': '20200101000000000/index.html',
'icon': 'http://example.com',
}))
self.assertIsNone(book.get_icon_file({
'index': '20200101000000000/index.html',
'icon': 'data:image/bmp;base64,Qk08AAAAAAAAADYAAAAoAAAAAQAAAAEAAAABACAAAAAAAAYAAAASCwAAEgsAAAAAAAAAAAAAAP8AAAAA',
}))
self.assertIsNone(book.get_icon_file({
'index': '20200101000000000/index.html',
'icon': '//example.com',
}))
self.assertIsNone(book.get_icon_file({
'index': '20200101000000000/index.html',
'icon': '/favicon.ico',
}))
self.assertIsNone(book.get_icon_file({
'index': '20200101000000000/index.html',
'icon': '',
}))
self.assertIsNone(book.get_icon_file({
'index': '20200101000000000/index.html',
'icon': '?id=123',
}))
self.assertIsNone(book.get_icon_file({
'index': '20200101000000000/index.html',
'icon': '#test',
}))
self.assertEqual(book.get_icon_file({
'icon': 'favicon.ico?id=123#test',
}),
os.path.join(book.data_dir, 'favicon.ico'),
)
self.assertEqual(book.get_icon_file({
'icon': '%E4%B8%AD%E6%96%87%231.ico?id=123#test',
}),
os.path.join(book.data_dir, '中文#1.ico'),
)
self.assertEqual(book.get_icon_file({
'index': '20200101000000000/index.html',
'icon': 'favicon.ico?id=123#test',
}),
os.path.join(book.data_dir, '20200101000000000', 'favicon.ico'),
)
self.assertEqual(book.get_icon_file({
'index': '20200101000000000.html',
'icon': 'favicon.ico?id=123#test',
}),
os.path.join(book.data_dir, 'favicon.ico'),
)
self.assertEqual(book.get_icon_file({
'index': '20200101000000000.maff',
'icon': 'favicon.ico?id=123#test',
}),
os.path.join(book.data_dir, 'favicon.ico'),
)
self.assertEqual(book.get_icon_file({
'index': '20200101000000000.maff',
'icon': '.wsb/tree/favicon/dbc82be549e49d6db9a5719086722a4f1c5079cd.bmp?id=123#test',
}),
os.path.join(book.tree_dir, 'favicon', 'dbc82be549e49d6db9a5719086722a4f1c5079cd.bmp'),
)
def test_load_note_file01(self):
"""Test for common note file wrapper."""
test_file = os.path.join(self.test_root, 'index.html')
with open(test_file, 'w', encoding='UTF-8') as f:
f.write("""\
<!DOCTYPE html><html><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width"><style>pre{white-space: pre-wrap; overflow-wrap: break-word;}</style></head><body><pre>
Note content
2nd line
3rd line
</pre></body></html>""")
book = Book(Host(self.test_root))
content = book.load_note_file(test_file)
self.assertEqual(content, """\
Note content
2nd line
3rd line""")
def test_load_note_file02(self):
"""Test for common legacy note file wrapper."""
test_file = os.path.join(self.test_root, 'index.html')
with open(test_file, 'w', encoding='UTF-8') as f:
f.write("""\
<html><head><meta http-equiv="Content-Type" content="text/html;Charset=UTF-8"></head><body><pre>
Note content
2nd line
3rd line
</pre></body></html>""")
book = Book(Host(self.test_root))
content = book.load_note_file(test_file)
self.assertEqual(content, """\
Note content
2nd line
3rd line""")
def test_load_note_file03(self):
"""Return original text if malformatted."""
test_file = os.path.join(self.test_root, 'index.html')
html = """\
<html><head><meta http-equiv="Content-Type" content="text/html;Charset=UTF-8"></head><body>
Note content
2nd line
3rd line
</body></html>"""
with open(test_file, 'w', encoding='UTF-8') as f:
f.write(html)
book = Book(Host(self.test_root))
content = book.load_note_file(test_file)
self.assertEqual(content, html)
def test_save_note_file01(self):
"""Test saving. Enforce LF linefeeds."""
test_file = os.path.join(self.test_root, 'index.html')
book = Book(Host(self.test_root))
book.save_note_file(test_file, """\
Note content
2nd line
3rd line""")
with open(test_file, encoding='UTF-8', newline='') as fh:
self.assertEqual(fh.read(), """\
<!DOCTYPE html><html><head>\
<meta charset="UTF-8">\
<meta name="viewport" content="width=device-width">\
<style>pre { white-space: pre-wrap; overflow-wrap: break-word; }</style>\
</head><body><pre>
Note content
2nd line
3rd line
</pre></body></html>""")
def test_auto_backup(self):
"""Auto backup tree files if backup_dir is set."""
test_dir = os.path.join(self.test_root, WSB_DIR, 'tree')
os.makedirs(test_dir)
meta0 = """
scrapbook.meta({
"20200101000000000": {
"index": "20200101000000000/index.html",
"title": "Dummy",
"type": "",
"create": "20200101000000000",
"modify": "20200101000000000"
}
})"""
meta1 = """
scrapbook.meta({
"20200101000000001": {
"index": "20200101000000001/index.html",
"title": "Dummy",
"type": "",
"create": "20200101000000001",
"modify": "20200101000000001"
}
})"""
toc0 = """
scrapbook.toc({
"root": [
"20200101000000000",
"20200101000000001",
"20200101000000002"
],
"20200101000000000": [
"20200101000000003"
]
})"""
toc1 = """
scrapbook.toc({
"20200101000000001": [
"20200101000000004"
]
})"""
fulltext0 = """
scrapbook.fulltext({
"20200101000000000": {
"index.html": {
"content": "dummy text 1 中文"
}
},
"20200101000000001": {
"index.html": {
"content": "dummy text 2 中文"
}
}
})"""
fulltext1 = """
scrapbook.fulltext({
"20200101000000002": {
"index.html": {
"content": "dummy text 2 中文"
}
}
})"""
with open(os.path.join(test_dir, 'meta.js'), 'w', encoding='UTF-8') as fh:
fh.write(meta0)
with open(os.path.join(test_dir, 'meta1.js'), 'w', encoding='UTF-8') as fh:
fh.write(meta1)
with open(os.path.join(test_dir, 'toc.js'), 'w', encoding='UTF-8') as fh:
fh.write(toc0)
with open(os.path.join(test_dir, 'toc1.js'), 'w', encoding='UTF-8') as fh:
fh.write(toc1)
with open(os.path.join(test_dir, 'fulltext.js'), 'w', encoding='UTF-8') as fh:
fh.write(fulltext0)
with open(os.path.join(test_dir, 'fulltext1.js'), 'w', encoding='UTF-8') as fh:
fh.write(fulltext1)
host = Host(self.test_root)
book = Book(host)
host.init_backup()
book.load_meta_files()
book.load_toc_files()
book.load_fulltext_files()
book.save_meta_files()
book.save_toc_files()
book.save_fulltext_files()
with open(os.path.join(host._backup_dir, WSB_DIR, 'tree', 'meta.js'), encoding='UTF-8') as fh:
self.assertEqual(fh.read(), meta0)
with open(os.path.join(host._backup_dir, WSB_DIR, 'tree', 'meta1.js'), encoding='UTF-8') as fh:
self.assertEqual(fh.read(), meta1)
with open(os.path.join(host._backup_dir, WSB_DIR, 'tree', 'toc.js'), encoding='UTF-8') as fh:
self.assertEqual(fh.read(), toc0)
with open(os.path.join(host._backup_dir, WSB_DIR, 'tree', 'toc1.js'), encoding='UTF-8') as fh:
self.assertEqual(fh.read(), toc1)
with open(os.path.join(host._backup_dir, WSB_DIR, 'tree', 'fulltext.js'), encoding='UTF-8') as fh:
self.assertEqual(fh.read(), fulltext0)
with open(os.path.join(host._backup_dir, WSB_DIR, 'tree', 'fulltext1.js'), encoding='UTF-8') as fh:
self.assertEqual(fh.read(), fulltext1)
if __name__ == '__main__':
unittest.main()
| 33.893585
| 187
| 0.592242
| 5,337
| 44,909
| 4.8368
| 0.061458
| 0.055474
| 0.075308
| 0.052607
| 0.884481
| 0.87131
| 0.861548
| 0.843844
| 0.815991
| 0.779383
| 0
| 0.11438
| 0.252243
| 44,909
| 1,324
| 188
| 33.919184
| 0.654328
| 0.022958
| 0
| 0.632264
| 0
| 0.004337
| 0.334485
| 0.075527
| 0
| 0
| 0
| 0
| 0.100607
| 1
| 0.052905
| false
| 0.010408
| 0.012142
| 0
| 0.065915
| 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
|
bfeb485a221c30bddf15245bcce0968a19e46f2c
| 2,076
|
py
|
Python
|
data/price_history_data/convert_TREB_data_format.py
|
Johnny-Fung/toronto-housing-market-map-visualization
|
06d2e0b2ef521c883546c364c4b14236e01c5d51
|
[
"MIT"
] | 1
|
2020-12-24T00:16:13.000Z
|
2020-12-24T00:16:13.000Z
|
data/price_history_data/convert_TREB_data_format.py
|
Johnny-Fung/toronto-housing-market-map-visualization
|
06d2e0b2ef521c883546c364c4b14236e01c5d51
|
[
"MIT"
] | null | null | null |
data/price_history_data/convert_TREB_data_format.py
|
Johnny-Fung/toronto-housing-market-map-visualization
|
06d2e0b2ef521c883546c364c4b14236e01c5d51
|
[
"MIT"
] | null | null | null |
price_history_2015="$413,268 $371,473 $336,311 $239,010 $227,809 $398,996 $403,729 $353,405 $220,980 $203,186 $459,297 $461,085 $1,078,036 $551,382 $503,344 $364,826 $399,342 $430,636 $644,972 $554,170 $275,601 $849,539 $396,181 $410,221 $381,013 $272,015 $457,796 $472,744 $229,586 $217,508 $287,573 $284,288 $266,932 $223,534 $273,988 $195,500 $211,738"
price_history_2016="$439,648 $438,538 $391,078 $308,862 $261,944 $438,473 $456,983 $384,248 $303,172 $233,132 $487,963 $501,458 $955,023 $609,719 $533,115 $378,942 $439,497 $483,833 $667,246 $533,638 $314,875 $856,814 $372,426 $435,610 $393,582 $307,949 $536,336 $521,210 $266,057 $246,844 $341,592 $294,003 $302,657 $275,024 $302,408 $183,929 $231,798"
price_history_2017="$523,992 $539,020 $466,527 $365,449 $282,638 $516,201 $535,188 $443,103 $326,041 $305,194 $603,524 $614,867 $1,004,927 $665,622 $709,867 $438,652 $568,002 $597,910 $977,375 $638,565 $403,536 $1,382,429 $429,959 $533,156 $475,790 $392,071 $628,122 $609,705 $326,371 $331,098 $416,961 $468,983 $381,355 $324,884 $387,423 $225,500 $317,545"
price_history_2018="$583,007 $643,642 $486,300 $413,764 $342,793 $595,349 $519,710 $501,311 $392,586 $331,714 $667,328 $684,002 $1,146,225 $760,806 $762,995 $470,152 $558,430 $673,248 $1,265,141 $704,492 $442,576 $975,553 $522,466 $567,718 $528,943 $413,818 $688,117 $556,879 $374,662 $358,357 $434,249 $500,357 $400,839 $373,187 $411,051 $274,929 $351,553"
price_history_2019="$693,186 $668,225 $522,132 $456,438 $407,395 $615,858 $782,350 $545,753 $429,451 $387,794 $699,362 $713,678 $1,193,506 $961,755 $749,073 $540,111 $617,363 $712,111 $1,107,117 $706,420 $456,621 $910,883 $576,679 $627,852 $548,236 $459,159 $780,758 $660,538 $450,524 $404,360 $460,422 $577,957 $429,925 $415,568 $448,522 $325,223 $372,163"
print("2015")
print(price_history_2015.replace(" ","\n"))
print("2016")
print(price_history_2016.replace(" ","\n"))
print("2017")
print(price_history_2017.replace(" ","\n"))
print("2018")
print(price_history_2018.replace(" ","\n"))
print("2019")
print(price_history_2019.replace(" ","\n"))
| 115.333333
| 357
| 0.677746
| 432
| 2,076
| 3.210648
| 0.726852
| 0.086518
| 0.061283
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.628068
| 0.097303
| 2,076
| 17
| 358
| 122.117647
| 0.11206
| 0
| 0
| 0
| 0
| 0.333333
| 0.823218
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.666667
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 6
|
8729664ecd521faffb856bfed61361048469383f
| 66
|
py
|
Python
|
boards/microbit/main.py
|
nagexiucai/howtoiot
|
f97e13d7e1bcc41eee68ae3e1357acaa344091d1
|
[
"Apache-2.0"
] | null | null | null |
boards/microbit/main.py
|
nagexiucai/howtoiot
|
f97e13d7e1bcc41eee68ae3e1357acaa344091d1
|
[
"Apache-2.0"
] | null | null | null |
boards/microbit/main.py
|
nagexiucai/howtoiot
|
f97e13d7e1bcc41eee68ae3e1357acaa344091d1
|
[
"Apache-2.0"
] | null | null | null |
import microbit
print(dir(microbit))
# Write your code here :-)
| 11
| 26
| 0.712121
| 9
| 66
| 5.222222
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.166667
| 66
| 5
| 27
| 13.2
| 0.854545
| 0.363636
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.2
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
|
0
| 6
|
87596da149f998da9290b500c634052db63b5f53
| 78
|
py
|
Python
|
novelsave/utils/adapters/__init__.py
|
mHaisham/novelsave
|
011b6c5d705591783aee64662bc88b207bdc7205
|
[
"Apache-2.0"
] | 15
|
2020-11-05T10:05:01.000Z
|
2021-06-28T14:43:56.000Z
|
novelsave/utils/adapters/__init__.py
|
mHaisham/novelsave
|
011b6c5d705591783aee64662bc88b207bdc7205
|
[
"Apache-2.0"
] | 21
|
2020-11-01T04:36:56.000Z
|
2021-08-16T09:36:48.000Z
|
novelsave/utils/adapters/__init__.py
|
mHaisham/novelsave
|
011b6c5d705591783aee64662bc88b207bdc7205
|
[
"Apache-2.0"
] | null | null | null |
from .source_adapter import SourceAdapter
from .dto_adapter import DTOAdapter
| 26
| 41
| 0.871795
| 10
| 78
| 6.6
| 0.7
| 0.393939
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.102564
| 78
| 2
| 42
| 39
| 0.942857
| 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
|
5e40d145c5ecf9aaf3f31b95dead440fa8e1c2a2
| 37,101
|
py
|
Python
|
sympy/parsing/latex/_antlr/latexlexer.py
|
qcgm1978/sympy
|
cc46047f4449b525b7b0edd4c634bf93d6e7c83d
|
[
"BSD-3-Clause"
] | 2
|
2021-01-09T23:11:25.000Z
|
2021-01-11T15:04:22.000Z
|
sympy/parsing/latex/_antlr/latexlexer.py
|
qcgm1978/sympy
|
cc46047f4449b525b7b0edd4c634bf93d6e7c83d
|
[
"BSD-3-Clause"
] | 3
|
2021-02-28T03:58:40.000Z
|
2021-03-07T06:12:47.000Z
|
sympy/parsing/latex/_antlr/latexlexer.py
|
qcgm1978/sympy
|
cc46047f4449b525b7b0edd4c634bf93d6e7c83d
|
[
"BSD-3-Clause"
] | 2
|
2021-01-08T23:03:23.000Z
|
2021-01-13T18:57:02.000Z
|
# encoding: utf-8
# *** GENERATED BY `setup.py antlr`, DO NOT EDIT BY HAND ***
#
# Generated from ../LaTeX.g4, derived from latex2sympy
# latex2sympy is licensed under the MIT license
# https://github.com/augustt198/latex2sympy/blob/master/LICENSE.txt
#
# Generated with antlr4
# antlr4 is licensed under the BSD-3-Clause License
# https://github.com/antlr/antlr4/blob/master/LICENSE.txt
from __future__ import print_function
from antlr4 import *
from io import StringIO
import sys
def serializedATN():
with StringIO() as buf:
buf.write(u"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2")
buf.write(u"Y\u0384\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4")
buf.write(u"\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r")
buf.write(u"\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22")
buf.write(u"\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4")
buf.write(u"\30\t\30\4\31\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35")
buf.write(u"\t\35\4\36\t\36\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\4")
buf.write(u"$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4,\t")
buf.write(u",\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63")
buf.write(u"\t\63\4\64\t\64\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\4")
buf.write(u"9\t9\4:\t:\4;\t;\4<\t<\4=\t=\4>\t>\4?\t?\4@\t@\4A\tA")
buf.write(u"\4B\tB\4C\tC\4D\tD\4E\tE\4F\tF\4G\tG\4H\tH\4I\tI\4J\t")
buf.write(u"J\4K\tK\4L\tL\4M\tM\4N\tN\4O\tO\4P\tP\4Q\tQ\4R\tR\4S")
buf.write(u"\tS\4T\tT\4U\tU\4V\tV\4W\tW\4X\tX\4Y\tY\4Z\tZ\3\2\3\2")
buf.write(u"\3\3\6\3\u00b9\n\3\r\3\16\3\u00ba\3\3\3\3\3\4\3\4\3\4")
buf.write(u"\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\5\4\u00cb\n\4\3")
buf.write(u"\4\3\4\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\5")
buf.write(u"\5\u00da\n\5\3\5\3\5\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6")
buf.write(u"\3\6\3\6\3\6\3\6\3\6\5\6\u00eb\n\6\3\6\3\6\3\7\3\7\3")
buf.write(u"\7\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3")
buf.write(u"\b\3\b\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3")
buf.write(u"\t\3\t\3\t\3\t\5\t\u010f\n\t\3\t\3\t\3\n\3\n\3\n\3\n")
buf.write(u"\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\13\3\13")
buf.write(u"\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3")
buf.write(u"\13\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3")
buf.write(u"\f\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\16")
buf.write(u"\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3")
buf.write(u"\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16")
buf.write(u"\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3")
buf.write(u"\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16")
buf.write(u"\3\16\3\16\3\16\3\16\3\16\3\16\5\16\u0177\n\16\3\16\3")
buf.write(u"\16\3\17\3\17\3\20\3\20\3\21\3\21\3\22\3\22\3\23\3\23")
buf.write(u"\3\24\3\24\3\25\3\25\3\26\3\26\3\27\3\27\3\27\3\30\3")
buf.write(u"\30\3\30\3\31\3\31\3\32\3\32\3\33\3\33\3\34\3\34\3\34")
buf.write(u"\3\34\3\34\3\34\3\34\3\34\3\35\3\35\3\35\3\35\3\35\3")
buf.write(u"\35\3\35\3\36\3\36\3\36\3\36\3\36\3\36\3\36\3\36\3\37")
buf.write(u"\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3 \3 \3 \3 \3 \3")
buf.write(u"!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!")
buf.write(u"\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3")
buf.write(u"!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!")
buf.write(u"\3!\3!\5!\u01f2\n!\3\"\3\"\3\"\3\"\3\"\3#\3#\3#\3#\3")
buf.write(u"#\3$\3$\3$\3$\3$\3$\3%\3%\3%\3%\3%\3&\3&\3&\3&\3&\3\'")
buf.write(u"\3\'\3\'\3\'\3(\3(\3(\3(\3(\3)\3)\3)\3)\3)\3*\3*\3*\3")
buf.write(u"*\3*\3+\3+\3+\3+\3+\3,\3,\3,\3,\3,\3-\3-\3-\3-\3-\3.")
buf.write(u"\3.\3.\3.\3.\3.\3.\3.\3/\3/\3/\3/\3/\3/\3/\3/\3\60\3")
buf.write(u"\60\3\60\3\60\3\60\3\60\3\60\3\60\3\61\3\61\3\61\3\61")
buf.write(u"\3\61\3\61\3\61\3\61\3\62\3\62\3\62\3\62\3\62\3\62\3")
buf.write(u"\62\3\62\3\63\3\63\3\63\3\63\3\63\3\63\3\63\3\63\3\64")
buf.write(u"\3\64\3\64\3\64\3\64\3\64\3\65\3\65\3\65\3\65\3\65\3")
buf.write(u"\65\3\66\3\66\3\66\3\66\3\66\3\66\3\67\3\67\3\67\3\67")
buf.write(u"\3\67\3\67\3\67\3\67\38\38\38\38\38\38\38\38\39\39\3")
buf.write(u"9\39\39\39\39\39\3:\3:\3:\3:\3:\3:\3:\3:\3;\3;\3;\3;")
buf.write(u"\3;\3;\3;\3;\3<\3<\3<\3<\3<\3<\3<\3=\3=\3=\3=\3=\3=\3")
buf.write(u"=\3>\3>\3>\3>\3>\3>\3?\3?\3?\3?\3?\3?\3?\3@\3@\3@\3@")
buf.write(u"\3@\3@\3A\3A\3A\3A\3A\3B\3B\3B\3B\3B\3B\3C\3C\3C\3C\3")
buf.write(u"C\3C\3C\3D\3D\3D\3D\3D\3D\3D\3D\3E\3E\3E\3E\3E\3E\3E")
buf.write(u"\3E\3F\3F\3F\3F\3F\3F\3F\3F\3G\3G\3H\3H\3I\3I\3J\3J\3")
buf.write(u"K\3K\7K\u02ef\nK\fK\16K\u02f2\13K\3K\3K\3K\6K\u02f7\n")
buf.write(u"K\rK\16K\u02f8\5K\u02fb\nK\3L\3L\3M\3M\3N\6N\u0302\n")
buf.write(u"N\rN\16N\u0303\3N\3N\3N\3N\3N\7N\u030b\nN\fN\16N\u030e")
buf.write(u"\13N\3N\7N\u0311\nN\fN\16N\u0314\13N\3N\3N\3N\3N\3N\7")
buf.write(u"N\u031b\nN\fN\16N\u031e\13N\3N\3N\6N\u0322\nN\rN\16N")
buf.write(u"\u0323\5N\u0326\nN\3O\3O\7O\u032a\nO\fO\16O\u032d\13")
buf.write(u"O\5O\u032f\nO\3O\3O\3O\7O\u0334\nO\fO\16O\u0337\13O\3")
buf.write(u"O\5O\u033a\nO\5O\u033c\nO\3P\3P\3P\3P\3P\3Q\3Q\3R\3R")
buf.write(u"\3R\3R\3R\3R\3R\3R\3R\5R\u034e\nR\3S\3S\3S\3S\3S\3S\3")
buf.write(u"T\3T\3T\3T\3T\3T\3T\3T\3T\3T\3U\3U\3V\3V\3V\3V\3V\3V")
buf.write(u"\3V\3V\3V\5V\u036b\nV\3W\3W\3W\3W\3W\3W\3X\3X\3X\3X\3")
buf.write(u"X\3X\3X\3X\3X\3X\3Y\3Y\3Z\3Z\6Z\u0381\nZ\rZ\16Z\u0382")
buf.write(u"\5\u02f0\u032b\u0335\2[\3\3\5\4\7\5\t\6\13\7\r\b\17\t")
buf.write(u"\21\n\23\13\25\f\27\r\31\16\33\17\35\20\37\21!\22#\23")
buf.write(u"%\24\'\25)\26+\27-\30/\31\61\32\63\33\65\34\67\359\36")
buf.write(u";\37= ?!A\"C#E$G%I&K\'M(O)Q*S+U,W-Y.[/]\60_\61a\62c\63")
buf.write(u"e\64g\65i\66k\67m8o9q:s;u<w=y>{?}@\177A\u0081B\u0083")
buf.write(u"C\u0085D\u0087E\u0089F\u008bG\u008dH\u008fI\u0091J\u0093")
buf.write(u"\2\u0095K\u0097L\u0099\2\u009bM\u009dN\u009fO\u00a1P")
buf.write(u"\u00a3Q\u00a5R\u00a7S\u00a9T\u00abU\u00adV\u00afW\u00b1")
buf.write(u"X\u00b3Y\3\2\5\5\2\13\f\17\17\"\"\4\2C\\c|\3\2\62;\2")
buf.write(u"\u03ab\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2")
buf.write(u"\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2")
buf.write(u"\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2")
buf.write(u"\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2\2\2")
buf.write(u"#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2")
buf.write(u"\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2")
buf.write(u"\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2")
buf.write(u"\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3")
buf.write(u"\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2\2\2O\3\2\2\2\2")
buf.write(u"Q\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3\2\2\2\2Y\3\2\2\2")
buf.write(u"\2[\3\2\2\2\2]\3\2\2\2\2_\3\2\2\2\2a\3\2\2\2\2c\3\2\2")
buf.write(u"\2\2e\3\2\2\2\2g\3\2\2\2\2i\3\2\2\2\2k\3\2\2\2\2m\3\2")
buf.write(u"\2\2\2o\3\2\2\2\2q\3\2\2\2\2s\3\2\2\2\2u\3\2\2\2\2w\3")
buf.write(u"\2\2\2\2y\3\2\2\2\2{\3\2\2\2\2}\3\2\2\2\2\177\3\2\2\2")
buf.write(u"\2\u0081\3\2\2\2\2\u0083\3\2\2\2\2\u0085\3\2\2\2\2\u0087")
buf.write(u"\3\2\2\2\2\u0089\3\2\2\2\2\u008b\3\2\2\2\2\u008d\3\2")
buf.write(u"\2\2\2\u008f\3\2\2\2\2\u0091\3\2\2\2\2\u0095\3\2\2\2")
buf.write(u"\2\u0097\3\2\2\2\2\u009b\3\2\2\2\2\u009d\3\2\2\2\2\u009f")
buf.write(u"\3\2\2\2\2\u00a1\3\2\2\2\2\u00a3\3\2\2\2\2\u00a5\3\2")
buf.write(u"\2\2\2\u00a7\3\2\2\2\2\u00a9\3\2\2\2\2\u00ab\3\2\2\2")
buf.write(u"\2\u00ad\3\2\2\2\2\u00af\3\2\2\2\2\u00b1\3\2\2\2\2\u00b3")
buf.write(u"\3\2\2\2\3\u00b5\3\2\2\2\5\u00b8\3\2\2\2\7\u00ca\3\2")
buf.write(u"\2\2\t\u00d9\3\2\2\2\13\u00ea\3\2\2\2\r\u00ee\3\2\2\2")
buf.write(u"\17\u00f6\3\2\2\2\21\u010e\3\2\2\2\23\u0112\3\2\2\2\25")
buf.write(u"\u0121\3\2\2\2\27\u0132\3\2\2\2\31\u013a\3\2\2\2\33\u0176")
buf.write(u"\3\2\2\2\35\u017a\3\2\2\2\37\u017c\3\2\2\2!\u017e\3\2")
buf.write(u"\2\2#\u0180\3\2\2\2%\u0182\3\2\2\2\'\u0184\3\2\2\2)\u0186")
buf.write(u"\3\2\2\2+\u0188\3\2\2\2-\u018a\3\2\2\2/\u018d\3\2\2\2")
buf.write(u"\61\u0190\3\2\2\2\63\u0192\3\2\2\2\65\u0194\3\2\2\2\67")
buf.write(u"\u0196\3\2\2\29\u019e\3\2\2\2;\u01a5\3\2\2\2=\u01ad\3")
buf.write(u"\2\2\2?\u01b5\3\2\2\2A\u01f1\3\2\2\2C\u01f3\3\2\2\2E")
buf.write(u"\u01f8\3\2\2\2G\u01fd\3\2\2\2I\u0203\3\2\2\2K\u0208\3")
buf.write(u"\2\2\2M\u020d\3\2\2\2O\u0211\3\2\2\2Q\u0216\3\2\2\2S")
buf.write(u"\u021b\3\2\2\2U\u0220\3\2\2\2W\u0225\3\2\2\2Y\u022a\3")
buf.write(u"\2\2\2[\u022f\3\2\2\2]\u0237\3\2\2\2_\u023f\3\2\2\2a")
buf.write(u"\u0247\3\2\2\2c\u024f\3\2\2\2e\u0257\3\2\2\2g\u025f\3")
buf.write(u"\2\2\2i\u0265\3\2\2\2k\u026b\3\2\2\2m\u0271\3\2\2\2o")
buf.write(u"\u0279\3\2\2\2q\u0281\3\2\2\2s\u0289\3\2\2\2u\u0291\3")
buf.write(u"\2\2\2w\u0299\3\2\2\2y\u02a0\3\2\2\2{\u02a7\3\2\2\2}")
buf.write(u"\u02ad\3\2\2\2\177\u02b4\3\2\2\2\u0081\u02ba\3\2\2\2")
buf.write(u"\u0083\u02bf\3\2\2\2\u0085\u02c5\3\2\2\2\u0087\u02cc")
buf.write(u"\3\2\2\2\u0089\u02d4\3\2\2\2\u008b\u02dc\3\2\2\2\u008d")
buf.write(u"\u02e4\3\2\2\2\u008f\u02e6\3\2\2\2\u0091\u02e8\3\2\2")
buf.write(u"\2\u0093\u02ea\3\2\2\2\u0095\u02ec\3\2\2\2\u0097\u02fc")
buf.write(u"\3\2\2\2\u0099\u02fe\3\2\2\2\u009b\u0325\3\2\2\2\u009d")
buf.write(u"\u033b\3\2\2\2\u009f\u033d\3\2\2\2\u00a1\u0342\3\2\2")
buf.write(u"\2\u00a3\u034d\3\2\2\2\u00a5\u034f\3\2\2\2\u00a7\u0355")
buf.write(u"\3\2\2\2\u00a9\u035f\3\2\2\2\u00ab\u036a\3\2\2\2\u00ad")
buf.write(u"\u036c\3\2\2\2\u00af\u0372\3\2\2\2\u00b1\u037c\3\2\2")
buf.write(u"\2\u00b3\u037e\3\2\2\2\u00b5\u00b6\7.\2\2\u00b6\4\3\2")
buf.write(u"\2\2\u00b7\u00b9\t\2\2\2\u00b8\u00b7\3\2\2\2\u00b9\u00ba")
buf.write(u"\3\2\2\2\u00ba\u00b8\3\2\2\2\u00ba\u00bb\3\2\2\2\u00bb")
buf.write(u"\u00bc\3\2\2\2\u00bc\u00bd\b\3\2\2\u00bd\6\3\2\2\2\u00be")
buf.write(u"\u00bf\7^\2\2\u00bf\u00cb\7.\2\2\u00c0\u00c1\7^\2\2\u00c1")
buf.write(u"\u00c2\7v\2\2\u00c2\u00c3\7j\2\2\u00c3\u00c4\7k\2\2\u00c4")
buf.write(u"\u00c5\7p\2\2\u00c5\u00c6\7u\2\2\u00c6\u00c7\7r\2\2\u00c7")
buf.write(u"\u00c8\7c\2\2\u00c8\u00c9\7e\2\2\u00c9\u00cb\7g\2\2\u00ca")
buf.write(u"\u00be\3\2\2\2\u00ca\u00c0\3\2\2\2\u00cb\u00cc\3\2\2")
buf.write(u"\2\u00cc\u00cd\b\4\2\2\u00cd\b\3\2\2\2\u00ce\u00cf\7")
buf.write(u"^\2\2\u00cf\u00da\7<\2\2\u00d0\u00d1\7^\2\2\u00d1\u00d2")
buf.write(u"\7o\2\2\u00d2\u00d3\7g\2\2\u00d3\u00d4\7f\2\2\u00d4\u00d5")
buf.write(u"\7u\2\2\u00d5\u00d6\7r\2\2\u00d6\u00d7\7c\2\2\u00d7\u00d8")
buf.write(u"\7e\2\2\u00d8\u00da\7g\2\2\u00d9\u00ce\3\2\2\2\u00d9")
buf.write(u"\u00d0\3\2\2\2\u00da\u00db\3\2\2\2\u00db\u00dc\b\5\2")
buf.write(u"\2\u00dc\n\3\2\2\2\u00dd\u00de\7^\2\2\u00de\u00eb\7=")
buf.write(u"\2\2\u00df\u00e0\7^\2\2\u00e0\u00e1\7v\2\2\u00e1\u00e2")
buf.write(u"\7j\2\2\u00e2\u00e3\7k\2\2\u00e3\u00e4\7e\2\2\u00e4\u00e5")
buf.write(u"\7m\2\2\u00e5\u00e6\7u\2\2\u00e6\u00e7\7r\2\2\u00e7\u00e8")
buf.write(u"\7c\2\2\u00e8\u00e9\7e\2\2\u00e9\u00eb\7g\2\2\u00ea\u00dd")
buf.write(u"\3\2\2\2\u00ea\u00df\3\2\2\2\u00eb\u00ec\3\2\2\2\u00ec")
buf.write(u"\u00ed\b\6\2\2\u00ed\f\3\2\2\2\u00ee\u00ef\7^\2\2\u00ef")
buf.write(u"\u00f0\7s\2\2\u00f0\u00f1\7w\2\2\u00f1\u00f2\7c\2\2\u00f2")
buf.write(u"\u00f3\7f\2\2\u00f3\u00f4\3\2\2\2\u00f4\u00f5\b\7\2\2")
buf.write(u"\u00f5\16\3\2\2\2\u00f6\u00f7\7^\2\2\u00f7\u00f8\7s\2")
buf.write(u"\2\u00f8\u00f9\7s\2\2\u00f9\u00fa\7w\2\2\u00fa\u00fb")
buf.write(u"\7c\2\2\u00fb\u00fc\7f\2\2\u00fc\u00fd\3\2\2\2\u00fd")
buf.write(u"\u00fe\b\b\2\2\u00fe\20\3\2\2\2\u00ff\u0100\7^\2\2\u0100")
buf.write(u"\u010f\7#\2\2\u0101\u0102\7^\2\2\u0102\u0103\7p\2\2\u0103")
buf.write(u"\u0104\7g\2\2\u0104\u0105\7i\2\2\u0105\u0106\7v\2\2\u0106")
buf.write(u"\u0107\7j\2\2\u0107\u0108\7k\2\2\u0108\u0109\7p\2\2\u0109")
buf.write(u"\u010a\7u\2\2\u010a\u010b\7r\2\2\u010b\u010c\7c\2\2\u010c")
buf.write(u"\u010d\7e\2\2\u010d\u010f\7g\2\2\u010e\u00ff\3\2\2\2")
buf.write(u"\u010e\u0101\3\2\2\2\u010f\u0110\3\2\2\2\u0110\u0111")
buf.write(u"\b\t\2\2\u0111\22\3\2\2\2\u0112\u0113\7^\2\2\u0113\u0114")
buf.write(u"\7p\2\2\u0114\u0115\7g\2\2\u0115\u0116\7i\2\2\u0116\u0117")
buf.write(u"\7o\2\2\u0117\u0118\7g\2\2\u0118\u0119\7f\2\2\u0119\u011a")
buf.write(u"\7u\2\2\u011a\u011b\7r\2\2\u011b\u011c\7c\2\2\u011c\u011d")
buf.write(u"\7e\2\2\u011d\u011e\7g\2\2\u011e\u011f\3\2\2\2\u011f")
buf.write(u"\u0120\b\n\2\2\u0120\24\3\2\2\2\u0121\u0122\7^\2\2\u0122")
buf.write(u"\u0123\7p\2\2\u0123\u0124\7g\2\2\u0124\u0125\7i\2\2\u0125")
buf.write(u"\u0126\7v\2\2\u0126\u0127\7j\2\2\u0127\u0128\7k\2\2\u0128")
buf.write(u"\u0129\7e\2\2\u0129\u012a\7m\2\2\u012a\u012b\7u\2\2\u012b")
buf.write(u"\u012c\7r\2\2\u012c\u012d\7c\2\2\u012d\u012e\7e\2\2\u012e")
buf.write(u"\u012f\7g\2\2\u012f\u0130\3\2\2\2\u0130\u0131\b\13\2")
buf.write(u"\2\u0131\26\3\2\2\2\u0132\u0133\7^\2\2\u0133\u0134\7")
buf.write(u"n\2\2\u0134\u0135\7g\2\2\u0135\u0136\7h\2\2\u0136\u0137")
buf.write(u"\7v\2\2\u0137\u0138\3\2\2\2\u0138\u0139\b\f\2\2\u0139")
buf.write(u"\30\3\2\2\2\u013a\u013b\7^\2\2\u013b\u013c\7t\2\2\u013c")
buf.write(u"\u013d\7k\2\2\u013d\u013e\7i\2\2\u013e\u013f\7j\2\2\u013f")
buf.write(u"\u0140\7v\2\2\u0140\u0141\3\2\2\2\u0141\u0142\b\r\2\2")
buf.write(u"\u0142\32\3\2\2\2\u0143\u0144\7^\2\2\u0144\u0145\7x\2")
buf.write(u"\2\u0145\u0146\7t\2\2\u0146\u0147\7w\2\2\u0147\u0148")
buf.write(u"\7n\2\2\u0148\u0177\7g\2\2\u0149\u014a\7^\2\2\u014a\u014b")
buf.write(u"\7x\2\2\u014b\u014c\7e\2\2\u014c\u014d\7g\2\2\u014d\u014e")
buf.write(u"\7p\2\2\u014e\u014f\7v\2\2\u014f\u0150\7g\2\2\u0150\u0177")
buf.write(u"\7t\2\2\u0151\u0152\7^\2\2\u0152\u0153\7x\2\2\u0153\u0154")
buf.write(u"\7d\2\2\u0154\u0155\7q\2\2\u0155\u0177\7z\2\2\u0156\u0157")
buf.write(u"\7^\2\2\u0157\u0158\7x\2\2\u0158\u0159\7u\2\2\u0159\u015a")
buf.write(u"\7m\2\2\u015a\u015b\7k\2\2\u015b\u0177\7r\2\2\u015c\u015d")
buf.write(u"\7^\2\2\u015d\u015e\7x\2\2\u015e\u015f\7u\2\2\u015f\u0160")
buf.write(u"\7r\2\2\u0160\u0161\7c\2\2\u0161\u0162\7e\2\2\u0162\u0177")
buf.write(u"\7g\2\2\u0163\u0164\7^\2\2\u0164\u0165\7j\2\2\u0165\u0166")
buf.write(u"\7h\2\2\u0166\u0167\7k\2\2\u0167\u0177\7n\2\2\u0168\u0169")
buf.write(u"\7^\2\2\u0169\u0177\7,\2\2\u016a\u016b\7^\2\2\u016b\u0177")
buf.write(u"\7/\2\2\u016c\u016d\7^\2\2\u016d\u0177\7\60\2\2\u016e")
buf.write(u"\u016f\7^\2\2\u016f\u0177\7\61\2\2\u0170\u0171\7^\2\2")
buf.write(u"\u0171\u0177\7$\2\2\u0172\u0173\7^\2\2\u0173\u0177\7")
buf.write(u"*\2\2\u0174\u0175\7^\2\2\u0175\u0177\7?\2\2\u0176\u0143")
buf.write(u"\3\2\2\2\u0176\u0149\3\2\2\2\u0176\u0151\3\2\2\2\u0176")
buf.write(u"\u0156\3\2\2\2\u0176\u015c\3\2\2\2\u0176\u0163\3\2\2")
buf.write(u"\2\u0176\u0168\3\2\2\2\u0176\u016a\3\2\2\2\u0176\u016c")
buf.write(u"\3\2\2\2\u0176\u016e\3\2\2\2\u0176\u0170\3\2\2\2\u0176")
buf.write(u"\u0172\3\2\2\2\u0176\u0174\3\2\2\2\u0177\u0178\3\2\2")
buf.write(u"\2\u0178\u0179\b\16\2\2\u0179\34\3\2\2\2\u017a\u017b")
buf.write(u"\7-\2\2\u017b\36\3\2\2\2\u017c\u017d\7/\2\2\u017d \3")
buf.write(u"\2\2\2\u017e\u017f\7,\2\2\u017f\"\3\2\2\2\u0180\u0181")
buf.write(u"\7\61\2\2\u0181$\3\2\2\2\u0182\u0183\7*\2\2\u0183&\3")
buf.write(u"\2\2\2\u0184\u0185\7+\2\2\u0185(\3\2\2\2\u0186\u0187")
buf.write(u"\7}\2\2\u0187*\3\2\2\2\u0188\u0189\7\177\2\2\u0189,\3")
buf.write(u"\2\2\2\u018a\u018b\7^\2\2\u018b\u018c\7}\2\2\u018c.\3")
buf.write(u"\2\2\2\u018d\u018e\7^\2\2\u018e\u018f\7\177\2\2\u018f")
buf.write(u"\60\3\2\2\2\u0190\u0191\7]\2\2\u0191\62\3\2\2\2\u0192")
buf.write(u"\u0193\7_\2\2\u0193\64\3\2\2\2\u0194\u0195\7~\2\2\u0195")
buf.write(u"\66\3\2\2\2\u0196\u0197\7^\2\2\u0197\u0198\7t\2\2\u0198")
buf.write(u"\u0199\7k\2\2\u0199\u019a\7i\2\2\u019a\u019b\7j\2\2\u019b")
buf.write(u"\u019c\7v\2\2\u019c\u019d\7~\2\2\u019d8\3\2\2\2\u019e")
buf.write(u"\u019f\7^\2\2\u019f\u01a0\7n\2\2\u01a0\u01a1\7g\2\2\u01a1")
buf.write(u"\u01a2\7h\2\2\u01a2\u01a3\7v\2\2\u01a3\u01a4\7~\2\2\u01a4")
buf.write(u":\3\2\2\2\u01a5\u01a6\7^\2\2\u01a6\u01a7\7n\2\2\u01a7")
buf.write(u"\u01a8\7c\2\2\u01a8\u01a9\7p\2\2\u01a9\u01aa\7i\2\2\u01aa")
buf.write(u"\u01ab\7n\2\2\u01ab\u01ac\7g\2\2\u01ac<\3\2\2\2\u01ad")
buf.write(u"\u01ae\7^\2\2\u01ae\u01af\7t\2\2\u01af\u01b0\7c\2\2\u01b0")
buf.write(u"\u01b1\7p\2\2\u01b1\u01b2\7i\2\2\u01b2\u01b3\7n\2\2\u01b3")
buf.write(u"\u01b4\7g\2\2\u01b4>\3\2\2\2\u01b5\u01b6\7^\2\2\u01b6")
buf.write(u"\u01b7\7n\2\2\u01b7\u01b8\7k\2\2\u01b8\u01b9\7o\2\2\u01b9")
buf.write(u"@\3\2\2\2\u01ba\u01bb\7^\2\2\u01bb\u01bc\7v\2\2\u01bc")
buf.write(u"\u01f2\7q\2\2\u01bd\u01be\7^\2\2\u01be\u01bf\7t\2\2\u01bf")
buf.write(u"\u01c0\7k\2\2\u01c0\u01c1\7i\2\2\u01c1\u01c2\7j\2\2\u01c2")
buf.write(u"\u01c3\7v\2\2\u01c3\u01c4\7c\2\2\u01c4\u01c5\7t\2\2\u01c5")
buf.write(u"\u01c6\7t\2\2\u01c6\u01c7\7q\2\2\u01c7\u01f2\7y\2\2\u01c8")
buf.write(u"\u01c9\7^\2\2\u01c9\u01ca\7T\2\2\u01ca\u01cb\7k\2\2\u01cb")
buf.write(u"\u01cc\7i\2\2\u01cc\u01cd\7j\2\2\u01cd\u01ce\7v\2\2\u01ce")
buf.write(u"\u01cf\7c\2\2\u01cf\u01d0\7t\2\2\u01d0\u01d1\7t\2\2\u01d1")
buf.write(u"\u01d2\7q\2\2\u01d2\u01f2\7y\2\2\u01d3\u01d4\7^\2\2\u01d4")
buf.write(u"\u01d5\7n\2\2\u01d5\u01d6\7q\2\2\u01d6\u01d7\7p\2\2\u01d7")
buf.write(u"\u01d8\7i\2\2\u01d8\u01d9\7t\2\2\u01d9\u01da\7k\2\2\u01da")
buf.write(u"\u01db\7i\2\2\u01db\u01dc\7j\2\2\u01dc\u01dd\7v\2\2\u01dd")
buf.write(u"\u01de\7c\2\2\u01de\u01df\7t\2\2\u01df\u01e0\7t\2\2\u01e0")
buf.write(u"\u01e1\7q\2\2\u01e1\u01f2\7y\2\2\u01e2\u01e3\7^\2\2\u01e3")
buf.write(u"\u01e4\7N\2\2\u01e4\u01e5\7q\2\2\u01e5\u01e6\7p\2\2\u01e6")
buf.write(u"\u01e7\7i\2\2\u01e7\u01e8\7t\2\2\u01e8\u01e9\7k\2\2\u01e9")
buf.write(u"\u01ea\7i\2\2\u01ea\u01eb\7j\2\2\u01eb\u01ec\7v\2\2\u01ec")
buf.write(u"\u01ed\7c\2\2\u01ed\u01ee\7t\2\2\u01ee\u01ef\7t\2\2\u01ef")
buf.write(u"\u01f0\7q\2\2\u01f0\u01f2\7y\2\2\u01f1\u01ba\3\2\2\2")
buf.write(u"\u01f1\u01bd\3\2\2\2\u01f1\u01c8\3\2\2\2\u01f1\u01d3")
buf.write(u"\3\2\2\2\u01f1\u01e2\3\2\2\2\u01f2B\3\2\2\2\u01f3\u01f4")
buf.write(u"\7^\2\2\u01f4\u01f5\7k\2\2\u01f5\u01f6\7p\2\2\u01f6\u01f7")
buf.write(u"\7v\2\2\u01f7D\3\2\2\2\u01f8\u01f9\7^\2\2\u01f9\u01fa")
buf.write(u"\7u\2\2\u01fa\u01fb\7w\2\2\u01fb\u01fc\7o\2\2\u01fcF")
buf.write(u"\3\2\2\2\u01fd\u01fe\7^\2\2\u01fe\u01ff\7r\2\2\u01ff")
buf.write(u"\u0200\7t\2\2\u0200\u0201\7q\2\2\u0201\u0202\7f\2\2\u0202")
buf.write(u"H\3\2\2\2\u0203\u0204\7^\2\2\u0204\u0205\7g\2\2\u0205")
buf.write(u"\u0206\7z\2\2\u0206\u0207\7r\2\2\u0207J\3\2\2\2\u0208")
buf.write(u"\u0209\7^\2\2\u0209\u020a\7n\2\2\u020a\u020b\7q\2\2\u020b")
buf.write(u"\u020c\7i\2\2\u020cL\3\2\2\2\u020d\u020e\7^\2\2\u020e")
buf.write(u"\u020f\7n\2\2\u020f\u0210\7p\2\2\u0210N\3\2\2\2\u0211")
buf.write(u"\u0212\7^\2\2\u0212\u0213\7u\2\2\u0213\u0214\7k\2\2\u0214")
buf.write(u"\u0215\7p\2\2\u0215P\3\2\2\2\u0216\u0217\7^\2\2\u0217")
buf.write(u"\u0218\7e\2\2\u0218\u0219\7q\2\2\u0219\u021a\7u\2\2\u021a")
buf.write(u"R\3\2\2\2\u021b\u021c\7^\2\2\u021c\u021d\7v\2\2\u021d")
buf.write(u"\u021e\7c\2\2\u021e\u021f\7p\2\2\u021fT\3\2\2\2\u0220")
buf.write(u"\u0221\7^\2\2\u0221\u0222\7e\2\2\u0222\u0223\7u\2\2\u0223")
buf.write(u"\u0224\7e\2\2\u0224V\3\2\2\2\u0225\u0226\7^\2\2\u0226")
buf.write(u"\u0227\7u\2\2\u0227\u0228\7g\2\2\u0228\u0229\7e\2\2\u0229")
buf.write(u"X\3\2\2\2\u022a\u022b\7^\2\2\u022b\u022c\7e\2\2\u022c")
buf.write(u"\u022d\7q\2\2\u022d\u022e\7v\2\2\u022eZ\3\2\2\2\u022f")
buf.write(u"\u0230\7^\2\2\u0230\u0231\7c\2\2\u0231\u0232\7t\2\2\u0232")
buf.write(u"\u0233\7e\2\2\u0233\u0234\7u\2\2\u0234\u0235\7k\2\2\u0235")
buf.write(u"\u0236\7p\2\2\u0236\\\3\2\2\2\u0237\u0238\7^\2\2\u0238")
buf.write(u"\u0239\7c\2\2\u0239\u023a\7t\2\2\u023a\u023b\7e\2\2\u023b")
buf.write(u"\u023c\7e\2\2\u023c\u023d\7q\2\2\u023d\u023e\7u\2\2\u023e")
buf.write(u"^\3\2\2\2\u023f\u0240\7^\2\2\u0240\u0241\7c\2\2\u0241")
buf.write(u"\u0242\7t\2\2\u0242\u0243\7e\2\2\u0243\u0244\7v\2\2\u0244")
buf.write(u"\u0245\7c\2\2\u0245\u0246\7p\2\2\u0246`\3\2\2\2\u0247")
buf.write(u"\u0248\7^\2\2\u0248\u0249\7c\2\2\u0249\u024a\7t\2\2\u024a")
buf.write(u"\u024b\7e\2\2\u024b\u024c\7e\2\2\u024c\u024d\7u\2\2\u024d")
buf.write(u"\u024e\7e\2\2\u024eb\3\2\2\2\u024f\u0250\7^\2\2\u0250")
buf.write(u"\u0251\7c\2\2\u0251\u0252\7t\2\2\u0252\u0253\7e\2\2\u0253")
buf.write(u"\u0254\7u\2\2\u0254\u0255\7g\2\2\u0255\u0256\7e\2\2\u0256")
buf.write(u"d\3\2\2\2\u0257\u0258\7^\2\2\u0258\u0259\7c\2\2\u0259")
buf.write(u"\u025a\7t\2\2\u025a\u025b\7e\2\2\u025b\u025c\7e\2\2\u025c")
buf.write(u"\u025d\7q\2\2\u025d\u025e\7v\2\2\u025ef\3\2\2\2\u025f")
buf.write(u"\u0260\7^\2\2\u0260\u0261\7u\2\2\u0261\u0262\7k\2\2\u0262")
buf.write(u"\u0263\7p\2\2\u0263\u0264\7j\2\2\u0264h\3\2\2\2\u0265")
buf.write(u"\u0266\7^\2\2\u0266\u0267\7e\2\2\u0267\u0268\7q\2\2\u0268")
buf.write(u"\u0269\7u\2\2\u0269\u026a\7j\2\2\u026aj\3\2\2\2\u026b")
buf.write(u"\u026c\7^\2\2\u026c\u026d\7v\2\2\u026d\u026e\7c\2\2\u026e")
buf.write(u"\u026f\7p\2\2\u026f\u0270\7j\2\2\u0270l\3\2\2\2\u0271")
buf.write(u"\u0272\7^\2\2\u0272\u0273\7c\2\2\u0273\u0274\7t\2\2\u0274")
buf.write(u"\u0275\7u\2\2\u0275\u0276\7k\2\2\u0276\u0277\7p\2\2\u0277")
buf.write(u"\u0278\7j\2\2\u0278n\3\2\2\2\u0279\u027a\7^\2\2\u027a")
buf.write(u"\u027b\7c\2\2\u027b\u027c\7t\2\2\u027c\u027d\7e\2\2\u027d")
buf.write(u"\u027e\7q\2\2\u027e\u027f\7u\2\2\u027f\u0280\7j\2\2\u0280")
buf.write(u"p\3\2\2\2\u0281\u0282\7^\2\2\u0282\u0283\7c\2\2\u0283")
buf.write(u"\u0284\7t\2\2\u0284\u0285\7v\2\2\u0285\u0286\7c\2\2\u0286")
buf.write(u"\u0287\7p\2\2\u0287\u0288\7j\2\2\u0288r\3\2\2\2\u0289")
buf.write(u"\u028a\7^\2\2\u028a\u028b\7n\2\2\u028b\u028c\7h\2\2\u028c")
buf.write(u"\u028d\7n\2\2\u028d\u028e\7q\2\2\u028e\u028f\7q\2\2\u028f")
buf.write(u"\u0290\7t\2\2\u0290t\3\2\2\2\u0291\u0292\7^\2\2\u0292")
buf.write(u"\u0293\7t\2\2\u0293\u0294\7h\2\2\u0294\u0295\7n\2\2\u0295")
buf.write(u"\u0296\7q\2\2\u0296\u0297\7q\2\2\u0297\u0298\7t\2\2\u0298")
buf.write(u"v\3\2\2\2\u0299\u029a\7^\2\2\u029a\u029b\7n\2\2\u029b")
buf.write(u"\u029c\7e\2\2\u029c\u029d\7g\2\2\u029d\u029e\7k\2\2\u029e")
buf.write(u"\u029f\7n\2\2\u029fx\3\2\2\2\u02a0\u02a1\7^\2\2\u02a1")
buf.write(u"\u02a2\7t\2\2\u02a2\u02a3\7e\2\2\u02a3\u02a4\7g\2\2\u02a4")
buf.write(u"\u02a5\7k\2\2\u02a5\u02a6\7n\2\2\u02a6z\3\2\2\2\u02a7")
buf.write(u"\u02a8\7^\2\2\u02a8\u02a9\7u\2\2\u02a9\u02aa\7s\2\2\u02aa")
buf.write(u"\u02ab\7t\2\2\u02ab\u02ac\7v\2\2\u02ac|\3\2\2\2\u02ad")
buf.write(u"\u02ae\7^\2\2\u02ae\u02af\7v\2\2\u02af\u02b0\7k\2\2\u02b0")
buf.write(u"\u02b1\7o\2\2\u02b1\u02b2\7g\2\2\u02b2\u02b3\7u\2\2\u02b3")
buf.write(u"~\3\2\2\2\u02b4\u02b5\7^\2\2\u02b5\u02b6\7e\2\2\u02b6")
buf.write(u"\u02b7\7f\2\2\u02b7\u02b8\7q\2\2\u02b8\u02b9\7v\2\2\u02b9")
buf.write(u"\u0080\3\2\2\2\u02ba\u02bb\7^\2\2\u02bb\u02bc\7f\2\2")
buf.write(u"\u02bc\u02bd\7k\2\2\u02bd\u02be\7x\2\2\u02be\u0082\3")
buf.write(u"\2\2\2\u02bf\u02c0\7^\2\2\u02c0\u02c1\7h\2\2\u02c1\u02c2")
buf.write(u"\7t\2\2\u02c2\u02c3\7c\2\2\u02c3\u02c4\7e\2\2\u02c4\u0084")
buf.write(u"\3\2\2\2\u02c5\u02c6\7^\2\2\u02c6\u02c7\7d\2\2\u02c7")
buf.write(u"\u02c8\7k\2\2\u02c8\u02c9\7p\2\2\u02c9\u02ca\7q\2\2\u02ca")
buf.write(u"\u02cb\7o\2\2\u02cb\u0086\3\2\2\2\u02cc\u02cd\7^\2\2")
buf.write(u"\u02cd\u02ce\7f\2\2\u02ce\u02cf\7d\2\2\u02cf\u02d0\7")
buf.write(u"k\2\2\u02d0\u02d1\7p\2\2\u02d1\u02d2\7q\2\2\u02d2\u02d3")
buf.write(u"\7o\2\2\u02d3\u0088\3\2\2\2\u02d4\u02d5\7^\2\2\u02d5")
buf.write(u"\u02d6\7v\2\2\u02d6\u02d7\7d\2\2\u02d7\u02d8\7k\2\2\u02d8")
buf.write(u"\u02d9\7p\2\2\u02d9\u02da\7q\2\2\u02da\u02db\7o\2\2\u02db")
buf.write(u"\u008a\3\2\2\2\u02dc\u02dd\7^\2\2\u02dd\u02de\7o\2\2")
buf.write(u"\u02de\u02df\7c\2\2\u02df\u02e0\7v\2\2\u02e0\u02e1\7")
buf.write(u"j\2\2\u02e1\u02e2\7k\2\2\u02e2\u02e3\7v\2\2\u02e3\u008c")
buf.write(u"\3\2\2\2\u02e4\u02e5\7a\2\2\u02e5\u008e\3\2\2\2\u02e6")
buf.write(u"\u02e7\7`\2\2\u02e7\u0090\3\2\2\2\u02e8\u02e9\7<\2\2")
buf.write(u"\u02e9\u0092\3\2\2\2\u02ea\u02eb\t\2\2\2\u02eb\u0094")
buf.write(u"\3\2\2\2\u02ec\u02f0\7f\2\2\u02ed\u02ef\5\u0093J\2\u02ee")
buf.write(u"\u02ed\3\2\2\2\u02ef\u02f2\3\2\2\2\u02f0\u02f1\3\2\2")
buf.write(u"\2\u02f0\u02ee\3\2\2\2\u02f1\u02fa\3\2\2\2\u02f2\u02f0")
buf.write(u"\3\2\2\2\u02f3\u02fb\t\3\2\2\u02f4\u02f6\7^\2\2\u02f5")
buf.write(u"\u02f7\t\3\2\2\u02f6\u02f5\3\2\2\2\u02f7\u02f8\3\2\2")
buf.write(u"\2\u02f8\u02f6\3\2\2\2\u02f8\u02f9\3\2\2\2\u02f9\u02fb")
buf.write(u"\3\2\2\2\u02fa\u02f3\3\2\2\2\u02fa\u02f4\3\2\2\2\u02fb")
buf.write(u"\u0096\3\2\2\2\u02fc\u02fd\t\3\2\2\u02fd\u0098\3\2\2")
buf.write(u"\2\u02fe\u02ff\t\4\2\2\u02ff\u009a\3\2\2\2\u0300\u0302")
buf.write(u"\5\u0099M\2\u0301\u0300\3\2\2\2\u0302\u0303\3\2\2\2\u0303")
buf.write(u"\u0301\3\2\2\2\u0303\u0304\3\2\2\2\u0304\u030c\3\2\2")
buf.write(u"\2\u0305\u0306\7.\2\2\u0306\u0307\5\u0099M\2\u0307\u0308")
buf.write(u"\5\u0099M\2\u0308\u0309\5\u0099M\2\u0309\u030b\3\2\2")
buf.write(u"\2\u030a\u0305\3\2\2\2\u030b\u030e\3\2\2\2\u030c\u030a")
buf.write(u"\3\2\2\2\u030c\u030d\3\2\2\2\u030d\u0326\3\2\2\2\u030e")
buf.write(u"\u030c\3\2\2\2\u030f\u0311\5\u0099M\2\u0310\u030f\3\2")
buf.write(u"\2\2\u0311\u0314\3\2\2\2\u0312\u0310\3\2\2\2\u0312\u0313")
buf.write(u"\3\2\2\2\u0313\u031c\3\2\2\2\u0314\u0312\3\2\2\2\u0315")
buf.write(u"\u0316\7.\2\2\u0316\u0317\5\u0099M\2\u0317\u0318\5\u0099")
buf.write(u"M\2\u0318\u0319\5\u0099M\2\u0319\u031b\3\2\2\2\u031a")
buf.write(u"\u0315\3\2\2\2\u031b\u031e\3\2\2\2\u031c\u031a\3\2\2")
buf.write(u"\2\u031c\u031d\3\2\2\2\u031d\u031f\3\2\2\2\u031e\u031c")
buf.write(u"\3\2\2\2\u031f\u0321\7\60\2\2\u0320\u0322\5\u0099M\2")
buf.write(u"\u0321\u0320\3\2\2\2\u0322\u0323\3\2\2\2\u0323\u0321")
buf.write(u"\3\2\2\2\u0323\u0324\3\2\2\2\u0324\u0326\3\2\2\2\u0325")
buf.write(u"\u0301\3\2\2\2\u0325\u0312\3\2\2\2\u0326\u009c\3\2\2")
buf.write(u"\2\u0327\u032b\7(\2\2\u0328\u032a\5\u0093J\2\u0329\u0328")
buf.write(u"\3\2\2\2\u032a\u032d\3\2\2\2\u032b\u032c\3\2\2\2\u032b")
buf.write(u"\u0329\3\2\2\2\u032c\u032f\3\2\2\2\u032d\u032b\3\2\2")
buf.write(u"\2\u032e\u0327\3\2\2\2\u032e\u032f\3\2\2\2\u032f\u0330")
buf.write(u"\3\2\2\2\u0330\u033c\7?\2\2\u0331\u0339\7?\2\2\u0332")
buf.write(u"\u0334\5\u0093J\2\u0333\u0332\3\2\2\2\u0334\u0337\3\2")
buf.write(u"\2\2\u0335\u0336\3\2\2\2\u0335\u0333\3\2\2\2\u0336\u0338")
buf.write(u"\3\2\2\2\u0337\u0335\3\2\2\2\u0338\u033a\7(\2\2\u0339")
buf.write(u"\u0335\3\2\2\2\u0339\u033a\3\2\2\2\u033a\u033c\3\2\2")
buf.write(u"\2\u033b\u032e\3\2\2\2\u033b\u0331\3\2\2\2\u033c\u009e")
buf.write(u"\3\2\2\2\u033d\u033e\7^\2\2\u033e\u033f\7p\2\2\u033f")
buf.write(u"\u0340\7g\2\2\u0340\u0341\7s\2\2\u0341\u00a0\3\2\2\2")
buf.write(u"\u0342\u0343\7>\2\2\u0343\u00a2\3\2\2\2\u0344\u0345\7")
buf.write(u"^\2\2\u0345\u0346\7n\2\2\u0346\u0347\7g\2\2\u0347\u034e")
buf.write(u"\7s\2\2\u0348\u0349\7^\2\2\u0349\u034a\7n\2\2\u034a\u034e")
buf.write(u"\7g\2\2\u034b\u034e\5\u00a5S\2\u034c\u034e\5\u00a7T\2")
buf.write(u"\u034d\u0344\3\2\2\2\u034d\u0348\3\2\2\2\u034d\u034b")
buf.write(u"\3\2\2\2\u034d\u034c\3\2\2\2\u034e\u00a4\3\2\2\2\u034f")
buf.write(u"\u0350\7^\2\2\u0350\u0351\7n\2\2\u0351\u0352\7g\2\2\u0352")
buf.write(u"\u0353\7s\2\2\u0353\u0354\7s\2\2\u0354\u00a6\3\2\2\2")
buf.write(u"\u0355\u0356\7^\2\2\u0356\u0357\7n\2\2\u0357\u0358\7")
buf.write(u"g\2\2\u0358\u0359\7s\2\2\u0359\u035a\7u\2\2\u035a\u035b")
buf.write(u"\7n\2\2\u035b\u035c\7c\2\2\u035c\u035d\7p\2\2\u035d\u035e")
buf.write(u"\7v\2\2\u035e\u00a8\3\2\2\2\u035f\u0360\7@\2\2\u0360")
buf.write(u"\u00aa\3\2\2\2\u0361\u0362\7^\2\2\u0362\u0363\7i\2\2")
buf.write(u"\u0363\u0364\7g\2\2\u0364\u036b\7s\2\2\u0365\u0366\7")
buf.write(u"^\2\2\u0366\u0367\7i\2\2\u0367\u036b\7g\2\2\u0368\u036b")
buf.write(u"\5\u00adW\2\u0369\u036b\5\u00afX\2\u036a\u0361\3\2\2")
buf.write(u"\2\u036a\u0365\3\2\2\2\u036a\u0368\3\2\2\2\u036a\u0369")
buf.write(u"\3\2\2\2\u036b\u00ac\3\2\2\2\u036c\u036d\7^\2\2\u036d")
buf.write(u"\u036e\7i\2\2\u036e\u036f\7g\2\2\u036f\u0370\7s\2\2\u0370")
buf.write(u"\u0371\7s\2\2\u0371\u00ae\3\2\2\2\u0372\u0373\7^\2\2")
buf.write(u"\u0373\u0374\7i\2\2\u0374\u0375\7g\2\2\u0375\u0376\7")
buf.write(u"s\2\2\u0376\u0377\7u\2\2\u0377\u0378\7n\2\2\u0378\u0379")
buf.write(u"\7c\2\2\u0379\u037a\7p\2\2\u037a\u037b\7v\2\2\u037b\u00b0")
buf.write(u"\3\2\2\2\u037c\u037d\7#\2\2\u037d\u00b2\3\2\2\2\u037e")
buf.write(u"\u0380\7^\2\2\u037f\u0381\t\3\2\2\u0380\u037f\3\2\2\2")
buf.write(u"\u0381\u0382\3\2\2\2\u0382\u0380\3\2\2\2\u0382\u0383")
buf.write(u"\3\2\2\2\u0383\u00b4\3\2\2\2\33\2\u00ba\u00ca\u00d9\u00ea")
buf.write(u"\u010e\u0176\u01f1\u02f0\u02f8\u02fa\u0303\u030c\u0312")
buf.write(u"\u031c\u0323\u0325\u032b\u032e\u0335\u0339\u033b\u034d")
buf.write(u"\u036a\u0382\3\b\2\2")
return buf.getvalue()
class LaTeXLexer(Lexer):
atn = ATNDeserializer().deserialize(serializedATN())
decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ]
T__0 = 1
WS = 2
THINSPACE = 3
MEDSPACE = 4
THICKSPACE = 5
QUAD = 6
QQUAD = 7
NEGTHINSPACE = 8
NEGMEDSPACE = 9
NEGTHICKSPACE = 10
CMD_LEFT = 11
CMD_RIGHT = 12
IGNORE = 13
ADD = 14
SUB = 15
MUL = 16
DIV = 17
L_PAREN = 18
R_PAREN = 19
L_BRACE = 20
R_BRACE = 21
L_BRACE_LITERAL = 22
R_BRACE_LITERAL = 23
L_BRACKET = 24
R_BRACKET = 25
BAR = 26
R_BAR = 27
L_BAR = 28
L_ANGLE = 29
R_ANGLE = 30
FUNC_LIM = 31
LIM_APPROACH_SYM = 32
FUNC_INT = 33
FUNC_SUM = 34
FUNC_PROD = 35
FUNC_EXP = 36
FUNC_LOG = 37
FUNC_LN = 38
FUNC_SIN = 39
FUNC_COS = 40
FUNC_TAN = 41
FUNC_CSC = 42
FUNC_SEC = 43
FUNC_COT = 44
FUNC_ARCSIN = 45
FUNC_ARCCOS = 46
FUNC_ARCTAN = 47
FUNC_ARCCSC = 48
FUNC_ARCSEC = 49
FUNC_ARCCOT = 50
FUNC_SINH = 51
FUNC_COSH = 52
FUNC_TANH = 53
FUNC_ARSINH = 54
FUNC_ARCOSH = 55
FUNC_ARTANH = 56
L_FLOOR = 57
R_FLOOR = 58
L_CEIL = 59
R_CEIL = 60
FUNC_SQRT = 61
CMD_TIMES = 62
CMD_CDOT = 63
CMD_DIV = 64
CMD_FRAC = 65
CMD_BINOM = 66
CMD_DBINOM = 67
CMD_TBINOM = 68
CMD_MATHIT = 69
UNDERSCORE = 70
CARET = 71
COLON = 72
DIFFERENTIAL = 73
LETTER = 74
NUMBER = 75
EQUAL = 76
NEQ = 77
LT = 78
LTE = 79
LTE_Q = 80
LTE_S = 81
GT = 82
GTE = 83
GTE_Q = 84
GTE_S = 85
BANG = 86
SYMBOL = 87
channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ]
modeNames = [ u"DEFAULT_MODE" ]
literalNames = [ u"<INVALID>",
u"','", u"'\\quad'", u"'\\qquad'", u"'\\negmedspace'", u"'\\negthickspace'",
u"'\\left'", u"'\\right'", u"'+'", u"'-'", u"'*'", u"'/'", u"'('",
u"')'", u"'{'", u"'}'", u"'\\{'", u"'\\}'", u"'['", u"']'",
u"'|'", u"'\\right|'", u"'\\left|'", u"'\\langle'", u"'\\rangle'",
u"'\\lim'", u"'\\int'", u"'\\sum'", u"'\\prod'", u"'\\exp'",
u"'\\log'", u"'\\ln'", u"'\\sin'", u"'\\cos'", u"'\\tan'", u"'\\csc'",
u"'\\sec'", u"'\\cot'", u"'\\arcsin'", u"'\\arccos'", u"'\\arctan'",
u"'\\arccsc'", u"'\\arcsec'", u"'\\arccot'", u"'\\sinh'", u"'\\cosh'",
u"'\\tanh'", u"'\\arsinh'", u"'\\arcosh'", u"'\\artanh'", u"'\\lfloor'",
u"'\\rfloor'", u"'\\lceil'", u"'\\rceil'", u"'\\sqrt'", u"'\\times'",
u"'\\cdot'", u"'\\div'", u"'\\frac'", u"'\\binom'", u"'\\dbinom'",
u"'\\tbinom'", u"'\\mathit'", u"'_'", u"'^'", u"':'", u"'\\neq'",
u"'<'", u"'\\leqq'", u"'\\leqslant'", u"'>'", u"'\\geqq'", u"'\\geqslant'",
u"'!'" ]
symbolicNames = [ u"<INVALID>",
u"WS", u"THINSPACE", u"MEDSPACE", u"THICKSPACE", u"QUAD", u"QQUAD",
u"NEGTHINSPACE", u"NEGMEDSPACE", u"NEGTHICKSPACE", u"CMD_LEFT",
u"CMD_RIGHT", u"IGNORE", u"ADD", u"SUB", u"MUL", u"DIV", u"L_PAREN",
u"R_PAREN", u"L_BRACE", u"R_BRACE", u"L_BRACE_LITERAL", u"R_BRACE_LITERAL",
u"L_BRACKET", u"R_BRACKET", u"BAR", u"R_BAR", u"L_BAR", u"L_ANGLE",
u"R_ANGLE", u"FUNC_LIM", u"LIM_APPROACH_SYM", u"FUNC_INT", u"FUNC_SUM",
u"FUNC_PROD", u"FUNC_EXP", u"FUNC_LOG", u"FUNC_LN", u"FUNC_SIN",
u"FUNC_COS", u"FUNC_TAN", u"FUNC_CSC", u"FUNC_SEC", u"FUNC_COT",
u"FUNC_ARCSIN", u"FUNC_ARCCOS", u"FUNC_ARCTAN", u"FUNC_ARCCSC",
u"FUNC_ARCSEC", u"FUNC_ARCCOT", u"FUNC_SINH", u"FUNC_COSH",
u"FUNC_TANH", u"FUNC_ARSINH", u"FUNC_ARCOSH", u"FUNC_ARTANH",
u"L_FLOOR", u"R_FLOOR", u"L_CEIL", u"R_CEIL", u"FUNC_SQRT",
u"CMD_TIMES", u"CMD_CDOT", u"CMD_DIV", u"CMD_FRAC", u"CMD_BINOM",
u"CMD_DBINOM", u"CMD_TBINOM", u"CMD_MATHIT", u"UNDERSCORE",
u"CARET", u"COLON", u"DIFFERENTIAL", u"LETTER", u"NUMBER", u"EQUAL",
u"NEQ", u"LT", u"LTE", u"LTE_Q", u"LTE_S", u"GT", u"GTE", u"GTE_Q",
u"GTE_S", u"BANG", u"SYMBOL" ]
ruleNames = [ u"T__0", u"WS", u"THINSPACE", u"MEDSPACE", u"THICKSPACE",
u"QUAD", u"QQUAD", u"NEGTHINSPACE", u"NEGMEDSPACE", u"NEGTHICKSPACE",
u"CMD_LEFT", u"CMD_RIGHT", u"IGNORE", u"ADD", u"SUB",
u"MUL", u"DIV", u"L_PAREN", u"R_PAREN", u"L_BRACE", u"R_BRACE",
u"L_BRACE_LITERAL", u"R_BRACE_LITERAL", u"L_BRACKET",
u"R_BRACKET", u"BAR", u"R_BAR", u"L_BAR", u"L_ANGLE",
u"R_ANGLE", u"FUNC_LIM", u"LIM_APPROACH_SYM", u"FUNC_INT",
u"FUNC_SUM", u"FUNC_PROD", u"FUNC_EXP", u"FUNC_LOG", u"FUNC_LN",
u"FUNC_SIN", u"FUNC_COS", u"FUNC_TAN", u"FUNC_CSC", u"FUNC_SEC",
u"FUNC_COT", u"FUNC_ARCSIN", u"FUNC_ARCCOS", u"FUNC_ARCTAN",
u"FUNC_ARCCSC", u"FUNC_ARCSEC", u"FUNC_ARCCOT", u"FUNC_SINH",
u"FUNC_COSH", u"FUNC_TANH", u"FUNC_ARSINH", u"FUNC_ARCOSH",
u"FUNC_ARTANH", u"L_FLOOR", u"R_FLOOR", u"L_CEIL", u"R_CEIL",
u"FUNC_SQRT", u"CMD_TIMES", u"CMD_CDOT", u"CMD_DIV", u"CMD_FRAC",
u"CMD_BINOM", u"CMD_DBINOM", u"CMD_TBINOM", u"CMD_MATHIT",
u"UNDERSCORE", u"CARET", u"COLON", u"WS_CHAR", u"DIFFERENTIAL",
u"LETTER", u"DIGIT", u"NUMBER", u"EQUAL", u"NEQ", u"LT",
u"LTE", u"LTE_Q", u"LTE_S", u"GT", u"GTE", u"GTE_Q", u"GTE_S",
u"BANG", u"SYMBOL" ]
grammarFileName = u"LaTeX.g4"
def __init__(self, input=None, output=sys.stdout):
super(LaTeXLexer, self).__init__(input, output=output)
self.checkVersion("4.7.2")
self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache())
self._actions = None
self._predicates = None
| 63.52911
| 103
| 0.581898
| 8,658
| 37,101
| 2.469392
| 0.146454
| 0.12189
| 0.166698
| 0.059869
| 0.261038
| 0.212816
| 0.182086
| 0.135594
| 0.116043
| 0.11188
| 0
| 0.335372
| 0.145037
| 37,101
| 583
| 104
| 63.638079
| 0.338651
| 0.010269
| 0
| 0.01083
| 1
| 0.456679
| 0.632403
| 0.577671
| 0
| 0
| 0
| 0
| 0
| 1
| 0.00361
| false
| 0
| 0.00722
| 0
| 0.185921
| 0.001805
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
5e8bf8eca1d600a3b3ab4d5acda13b22ed5f6235
| 23
|
py
|
Python
|
src/tcanvas/__init__.py
|
ast0815/tcanvas
|
d33fdc3ed9d965e06bcff1eaf059a5b665278883
|
[
"MIT"
] | null | null | null |
src/tcanvas/__init__.py
|
ast0815/tcanvas
|
d33fdc3ed9d965e06bcff1eaf059a5b665278883
|
[
"MIT"
] | null | null | null |
src/tcanvas/__init__.py
|
ast0815/tcanvas
|
d33fdc3ed9d965e06bcff1eaf059a5b665278883
|
[
"MIT"
] | null | null | null |
from .tcanvas import *
| 11.5
| 22
| 0.73913
| 3
| 23
| 5.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.173913
| 23
| 1
| 23
| 23
| 0.894737
| 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
|
5e933cd008d5e3ec8047e077356a4ab3268eaa70
| 139
|
py
|
Python
|
skel_io/__path.py
|
isosc/skel-io
|
0abc23a10ce40d6f9bce9d3b9fb65018746ddef7
|
[
"Apache-2.0"
] | null | null | null |
skel_io/__path.py
|
isosc/skel-io
|
0abc23a10ce40d6f9bce9d3b9fb65018746ddef7
|
[
"Apache-2.0"
] | null | null | null |
skel_io/__path.py
|
isosc/skel-io
|
0abc23a10ce40d6f9bce9d3b9fb65018746ddef7
|
[
"Apache-2.0"
] | null | null | null |
from pathlib import Path
def get_project_root() -> Path:
r"""Returns project root folder"""
return Path(__file__).parent.parent
| 17.375
| 39
| 0.71223
| 19
| 139
| 4.894737
| 0.736842
| 0.236559
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.179856
| 139
| 7
| 40
| 19.857143
| 0.815789
| 0.194245
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| true
| 0
| 0.25
| 0
| 0.75
| 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
| 1
| 0
| 0
| 0
| 1
| 0
|
0
| 6
|
5ebe63e19b602c3ff17506c27866ed441a831ba0
| 25
|
py
|
Python
|
emout/plot/__init__.py
|
Nkzono99/emout
|
77eb2b90ce5408055715f1aeb0a4479ccb97668d
|
[
"MIT"
] | null | null | null |
emout/plot/__init__.py
|
Nkzono99/emout
|
77eb2b90ce5408055715f1aeb0a4479ccb97668d
|
[
"MIT"
] | null | null | null |
emout/plot/__init__.py
|
Nkzono99/emout
|
77eb2b90ce5408055715f1aeb0a4479ccb97668d
|
[
"MIT"
] | null | null | null |
from .basic_plot import *
| 25
| 25
| 0.8
| 4
| 25
| 4.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.12
| 25
| 1
| 25
| 25
| 0.863636
| 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
|
5ecd959890e34189f06092f9294af4c7f447dcb5
| 400
|
py
|
Python
|
titan/django_pkg/djangoapp/resources.py
|
mnieber/gen
|
65f8aa4fb671c4f90d5cbcb1a0e10290647a31d9
|
[
"MIT"
] | null | null | null |
titan/django_pkg/djangoapp/resources.py
|
mnieber/gen
|
65f8aa4fb671c4f90d5cbcb1a0e10290647a31d9
|
[
"MIT"
] | null | null | null |
titan/django_pkg/djangoapp/resources.py
|
mnieber/gen
|
65f8aa4fb671c4f90d5cbcb1a0e10290647a31d9
|
[
"MIT"
] | null | null | null |
from dataclasses import dataclass, field
from moonleap import Resource
from titan.project_pkg.service import Tool
@dataclass
class DjangoApp(Tool):
pass
@dataclass
class DjangoConfig(Resource):
settings: dict = field(default_factory=dict)
urls: list = field(default_factory=list)
urls_imports: list = field(default_factory=list)
cors_urls: list = field(default_factory=list)
| 22.222222
| 52
| 0.77
| 51
| 400
| 5.901961
| 0.470588
| 0.159468
| 0.252492
| 0.229236
| 0.295681
| 0.20598
| 0
| 0
| 0
| 0
| 0
| 0
| 0.1525
| 400
| 17
| 53
| 23.529412
| 0.887906
| 0
| 0
| 0.166667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.083333
| 0.333333
| 0
| 0.833333
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
|
0
| 6
|
0d96f2fffd95a0bb5a4be7eef2f674942331dd6f
| 154
|
py
|
Python
|
mud/handlers/__init__.py
|
erwanaubry/alamud_IUT_Escape
|
cc9e77203245a9b933300edc2efb9bd5fcd8abc3
|
[
"Unlicense"
] | null | null | null |
mud/handlers/__init__.py
|
erwanaubry/alamud_IUT_Escape
|
cc9e77203245a9b933300edc2efb9bd5fcd8abc3
|
[
"Unlicense"
] | null | null | null |
mud/handlers/__init__.py
|
erwanaubry/alamud_IUT_Escape
|
cc9e77203245a9b933300edc2efb9bd5fcd8abc3
|
[
"Unlicense"
] | null | null | null |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Denys Duchier, IUT d'Orléans
#==============================================================================
| 38.5
| 79
| 0.305195
| 11
| 154
| 4.272727
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.035714
| 0.090909
| 154
| 3
| 80
| 51.333333
| 0.3
| 0.954545
| 0
| null | 0
| null | 0
| 0
| null | 1
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
0dc6faefe15bf562ec2e3eff7f3b9a1224ab152a
| 9,168
|
py
|
Python
|
tests/test_auditor/test_auditor_job.py
|
gzcf/polyaxon
|
77ac8838c6444a36541e6c28aba7ae42de392fee
|
[
"MIT"
] | null | null | null |
tests/test_auditor/test_auditor_job.py
|
gzcf/polyaxon
|
77ac8838c6444a36541e6c28aba7ae42de392fee
|
[
"MIT"
] | null | null | null |
tests/test_auditor/test_auditor_job.py
|
gzcf/polyaxon
|
77ac8838c6444a36541e6c28aba7ae42de392fee
|
[
"MIT"
] | null | null | null |
# pylint:disable=ungrouped-imports
from unittest.mock import patch
import pytest
import activitylogs
import auditor
import tracker
from event_manager.events import job as job_events
from factories.factory_plugins import NotebookJobFactory
from factories.factory_projects import ProjectFactory
from tests.utils import BaseTest
@pytest.mark.auditor_mark
class AuditorJobTest(BaseTest):
"""Testing subscribed events"""
def setUp(self):
self.job = NotebookJobFactory(project=ProjectFactory())
auditor.validate()
auditor.setup()
tracker.validate()
tracker.setup()
activitylogs.validate()
activitylogs.setup()
super().setUp()
@patch('tracker.service.TrackerService.record_event')
@patch('activitylogs.service.ActivityLogService.record_event')
def test_job_created(self, activitylogs_record, tracker_record):
auditor.record(event_type=job_events.JOB_CREATED,
instance=self.job)
assert tracker_record.call_count == 1
assert activitylogs_record.call_count == 1
@patch('tracker.service.TrackerService.record_event')
@patch('activitylogs.service.ActivityLogService.record_event')
def test_job_updated(self, activitylogs_record, tracker_record):
auditor.record(event_type=job_events.JOB_UPDATED,
instance=self.job,
actor_id=1,
actor_name='foo')
assert tracker_record.call_count == 1
assert activitylogs_record.call_count == 1
@patch('tracker.service.TrackerService.record_event')
@patch('activitylogs.service.ActivityLogService.record_event')
def test_job_started(self, activitylogs_record, tracker_record):
auditor.record(event_type=job_events.JOB_STARTED,
instance=self.job)
assert tracker_record.call_count == 1
assert activitylogs_record.call_count == 0
@patch('tracker.service.TrackerService.record_event')
@patch('activitylogs.service.ActivityLogService.record_event')
def test_job_started_triggered(self, activitylogs_record, tracker_record):
auditor.record(event_type=job_events.JOB_STARTED_TRIGGERED,
instance=self.job,
actor_id=1,
actor_name='foo')
assert tracker_record.call_count == 1
assert activitylogs_record.call_count == 1
@patch('tracker.service.TrackerService.record_event')
@patch('activitylogs.service.ActivityLogService.record_event')
def test_job_deleted(self, activitylogs_record, tracker_record):
auditor.record(event_type=job_events.JOB_DELETED,
instance=self.job)
assert tracker_record.call_count == 1
assert activitylogs_record.call_count == 0
@patch('tracker.service.TrackerService.record_event')
@patch('activitylogs.service.ActivityLogService.record_event')
def test_job_triggered_deleted(self, activitylogs_record, tracker_record):
auditor.record(event_type=job_events.JOB_DELETED_TRIGGERED,
instance=self.job,
actor_id=1,
actor_name='foo')
assert tracker_record.call_count == 1
assert activitylogs_record.call_count == 1
@patch('tracker.service.TrackerService.record_event')
@patch('activitylogs.service.ActivityLogService.record_event')
def test_job_stopped(self, activitylogs_record, tracker_record):
auditor.record(event_type=job_events.JOB_STOPPED,
instance=self.job)
assert tracker_record.call_count == 1
assert activitylogs_record.call_count == 0
@patch('tracker.service.TrackerService.record_event')
@patch('activitylogs.service.ActivityLogService.record_event')
def test_job_stopped_triggered(self, activitylogs_record, tracker_record):
auditor.record(event_type=job_events.JOB_STOPPED_TRIGGERED,
instance=self.job,
actor_id=1,
actor_name='foo')
assert tracker_record.call_count == 1
assert activitylogs_record.call_count == 1
@patch('tracker.service.TrackerService.record_event')
@patch('activitylogs.service.ActivityLogService.record_event')
def test_job_viewed(self, activitylogs_record, tracker_record):
auditor.record(event_type=job_events.JOB_VIEWED,
instance=self.job,
actor_id=1,
actor_name='foo')
assert tracker_record.call_count == 1
assert activitylogs_record.call_count == 1
@patch('tracker.service.TrackerService.record_event')
@patch('activitylogs.service.ActivityLogService.record_event')
def test_job_bookmarked(self, activitylogs_record, tracker_record):
auditor.record(event_type=job_events.JOB_BOOKMARKED,
instance=self.job,
actor_id=1,
actor_name='foo')
assert tracker_record.call_count == 1
assert activitylogs_record.call_count == 1
@patch('tracker.service.TrackerService.record_event')
@patch('activitylogs.service.ActivityLogService.record_event')
def test_job_unbookmarked(self, activitylogs_record, tracker_record):
auditor.record(event_type=job_events.JOB_UNBOOKMARKED,
instance=self.job,
actor_id=1,
actor_name='foo')
assert tracker_record.call_count == 1
assert activitylogs_record.call_count == 1
@patch('tracker.service.TrackerService.record_event')
@patch('activitylogs.service.ActivityLogService.record_event')
def test_job_new_status(self, activitylogs_record, tracker_record):
auditor.record(event_type=job_events.JOB_NEW_STATUS,
instance=self.job)
assert tracker_record.call_count == 1
assert activitylogs_record.call_count == 0
@patch('tracker.service.TrackerService.record_event')
@patch('activitylogs.service.ActivityLogService.record_event')
def test_job_failed(self, activitylogs_record, tracker_record):
auditor.record(event_type=job_events.JOB_FAILED,
instance=self.job)
assert tracker_record.call_count == 1
assert activitylogs_record.call_count == 0
@patch('tracker.service.TrackerService.record_event')
@patch('activitylogs.service.ActivityLogService.record_event')
def test_job_succeeded(self, activitylogs_record, tracker_record):
auditor.record(event_type=job_events.JOB_SUCCEEDED,
instance=self.job)
assert tracker_record.call_count == 1
assert activitylogs_record.call_count == 0
@patch('tracker.service.TrackerService.record_event')
@patch('activitylogs.service.ActivityLogService.record_event')
def test_job_done(self, activitylogs_record, tracker_record):
auditor.record(event_type=job_events.JOB_DONE,
instance=self.job)
assert tracker_record.call_count == 1
assert activitylogs_record.call_count == 0
@patch('tracker.service.TrackerService.record_event')
@patch('activitylogs.service.ActivityLogService.record_event')
def test_job_logs_viewed_triggered(self, activitylogs_record, tracker_record):
auditor.record(event_type=job_events.JOB_LOGS_VIEWED,
instance=self.job,
actor_id=1,
actor_name='foo')
assert tracker_record.call_count == 1
assert activitylogs_record.call_count == 1
@patch('tracker.service.TrackerService.record_event')
@patch('activitylogs.service.ActivityLogService.record_event')
def test_job_restarted_triggered(self, activitylogs_record, tracker_record):
auditor.record(event_type=job_events.JOB_RESTARTED_TRIGGERED,
instance=self.job,
actor_id=1,
actor_name='foo')
assert tracker_record.call_count == 1
assert activitylogs_record.call_count == 1
@patch('tracker.service.TrackerService.record_event')
@patch('activitylogs.service.ActivityLogService.record_event')
def test_job_statuses_viewed_triggered(self, activitylogs_record, tracker_record):
auditor.record(event_type=job_events.JOB_STATUSES_VIEWED,
instance=self.job,
actor_id=1,
actor_name='foo')
assert tracker_record.call_count == 1
assert activitylogs_record.call_count == 1
@patch('tracker.service.TrackerService.record_event')
@patch('activitylogs.service.ActivityLogService.record_event')
def test_job_outputs_downloaded(self, activitylogs_record, tracker_record):
auditor.record(event_type=job_events.JOB_OUTPUTS_DOWNLOADED,
instance=self.job,
actor_id=1,
actor_name='foo')
assert tracker_record.call_count == 1
assert activitylogs_record.call_count == 1
| 41.112108
| 86
| 0.683137
| 995
| 9,168
| 6.001005
| 0.073367
| 0.105008
| 0.095461
| 0.083068
| 0.877742
| 0.877742
| 0.877742
| 0.877742
| 0.877742
| 0.877742
| 0
| 0.006952
| 0.231239
| 9,168
| 222
| 87
| 41.297297
| 0.840238
| 0.006435
| 0
| 0.668571
| 0
| 0
| 0.201911
| 0.198286
| 0
| 0
| 0
| 0
| 0.217143
| 1
| 0.114286
| false
| 0
| 0.051429
| 0
| 0.171429
| 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
|
0dcaace2ddce852fce495001ba0f40a33ca831eb
| 138
|
py
|
Python
|
ambra_sdk/service/entrypoints/keyimage.py
|
dyens/sdk-python
|
24bf05268af2832c70120b84fd53bf44862cffec
|
[
"Apache-2.0"
] | null | null | null |
ambra_sdk/service/entrypoints/keyimage.py
|
dyens/sdk-python
|
24bf05268af2832c70120b84fd53bf44862cffec
|
[
"Apache-2.0"
] | null | null | null |
ambra_sdk/service/entrypoints/keyimage.py
|
dyens/sdk-python
|
24bf05268af2832c70120b84fd53bf44862cffec
|
[
"Apache-2.0"
] | null | null | null |
from ambra_sdk.service.entrypoints.generated.keyimage import \
Keyimage as GKeyimage
class Keyimage(GKeyimage):
"""Keyimage."""
| 19.714286
| 62
| 0.746377
| 15
| 138
| 6.8
| 0.733333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.144928
| 138
| 6
| 63
| 23
| 0.864407
| 0.065217
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 6
|
0de7a71926ac77799c245ad12e0b561d4273a1ea
| 113
|
py
|
Python
|
graphflow/simvoltage/__init__.py
|
vishalbelsare/GraphFlow-1
|
6a1a1c441521bf7642d21de297277bedf98f6d31
|
[
"MIT"
] | 7
|
2018-08-19T10:15:02.000Z
|
2019-02-25T07:48:42.000Z
|
graphflow/simvoltage/__init__.py
|
vishalbelsare/GraphFlow-1
|
6a1a1c441521bf7642d21de297277bedf98f6d31
|
[
"MIT"
] | 3
|
2019-06-26T16:30:54.000Z
|
2021-04-11T03:23:04.000Z
|
graphflow/simvoltage/__init__.py
|
vishalbelsare/GraphFlow-1
|
6a1a1c441521bf7642d21de297277bedf98f6d31
|
[
"MIT"
] | 3
|
2018-11-30T02:49:04.000Z
|
2019-12-31T20:51:43.000Z
|
from .resistancedist import GraphResistanceDistance
from .SocialNetworkSimVoltage import SocialNetworkSimVoltage
| 37.666667
| 60
| 0.911504
| 8
| 113
| 12.875
| 0.625
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.070796
| 113
| 3
| 60
| 37.666667
| 0.980952
| 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
|
0df08d8b97a462eb62a07f07ef461e8479bb18f4
| 1,241
|
py
|
Python
|
config/elements.py
|
sindavid/get_free_amazon_ebooks
|
ba861da0e3500ca9db24f438d5afea5b3f7d5014
|
[
"MIT"
] | null | null | null |
config/elements.py
|
sindavid/get_free_amazon_ebooks
|
ba861da0e3500ca9db24f438d5afea5b3f7d5014
|
[
"MIT"
] | null | null | null |
config/elements.py
|
sindavid/get_free_amazon_ebooks
|
ba861da0e3500ca9db24f438d5afea5b3f7d5014
|
[
"MIT"
] | null | null | null |
elements = {
'login_page': {
'input_email': '//*[@id="ap_email"]',
'btn_continue': '//*[@id="continue"]',
'input_password': '//*[@id="ap_password"]',
'btn_login': '//*[@id="signInSubmit"]'
},
'header_confirm': '/html/body/div[1]/header/div/div[1]/div[3]/div/a[1]/div/span',
'bnt_buy_one_click': '/html/body/div[1]/div[2]/div[1]/div[2]/div/span[4]/div[1]/div[{0}]/div/span/div/div/div[2]/div[2]/div/div[2]/div[1]/div/div[2]/div/span/span/a',
'title_ebook': '/html/body/div[1]/div[2]/div[1]/div[2]/div/span[3]/div[2]/div[{0}]/div/span/div/div/div[2]/div[2]/div/div[1]/div/div/div[1]/h2/a/span',
'img_ebook': '/html/body/div[1]/div[2]/div[1]/div[2]/div/span[4]/div[1]/div[{0}]/div/span/div/div/div[2]/div[1]/div/div/span/a/div',
'btn_next_page': 'a-last',
'if_bought': '/html/body/div[1]/div[3]/div/div/div/p[3]',
'btn_buy': 'one-click-button',
'name_ebook': '/html/body/div[1]/div[2]/div[2]/div/div/div[1]/div/div[1]/div[1]/div[1]/div/div/div[1]/span[1]',
'confirm_message': '/html/body/div[1]/div[2]/div[2]/div/div/div[1]/div/div[1]/div[1]/div[1]/div/div/div[1]/span[2]',
'confirm_bought': '/html/body/div[2]/div[2]/div[3]/div[2]/div/div/div/div/div/div/span'
}
| 65.315789
| 170
| 0.591459
| 244
| 1,241
| 2.92623
| 0.159836
| 0.252101
| 0.22549
| 0.089636
| 0.579832
| 0.491597
| 0.47619
| 0.45098
| 0.443978
| 0.443978
| 0
| 0.055062
| 0.092667
| 1,241
| 18
| 171
| 68.944444
| 0.579041
| 0
| 0
| 0
| 0
| 0.444444
| 0.827558
| 0.638195
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.055556
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 6
|
0df9668fec096ba8f70bccbe8bf81c7ea03e328c
| 500
|
py
|
Python
|
001 - 050/ex011.py
|
SocrammBR/Desafios-Python-CursoEmVideo
|
bd2454a24134500343ece91b936c169d3a66f89e
|
[
"MIT"
] | null | null | null |
001 - 050/ex011.py
|
SocrammBR/Desafios-Python-CursoEmVideo
|
bd2454a24134500343ece91b936c169d3a66f89e
|
[
"MIT"
] | null | null | null |
001 - 050/ex011.py
|
SocrammBR/Desafios-Python-CursoEmVideo
|
bd2454a24134500343ece91b936c169d3a66f89e
|
[
"MIT"
] | null | null | null |
# Código Original
# altura = float(input('Digite a altura da parede em metros: '))
# largura = float(input('Digite a largura da parede em metros: '))
# metro_quadrado = altura*largura
# print(f'Você precisará de {metro_quadrado/2}l de tinta')
# Desafio da aula 11
altura = float(input('\033[33mDigite a altura da parede em metros: '))
largura = float(input('\033[33mDigite a largura da parede em metros: '))
metro_quadrado = altura*largura
print (f'Você precisará de {metro_quadrado/2}l de tinta')
| 38.461538
| 72
| 0.734
| 78
| 500
| 4.653846
| 0.346154
| 0.110193
| 0.110193
| 0.176309
| 0.826446
| 0.732782
| 0.732782
| 0.732782
| 0.732782
| 0.512397
| 0
| 0.032787
| 0.146
| 500
| 13
| 73
| 38.461538
| 0.81733
| 0.502
| 0
| 0
| 0
| 0
| 0.563786
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.25
| 0
| 0
| 0
| null | 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
2176cc3ca46341b832c20e95ccafa89608cddf3e
| 302
|
py
|
Python
|
desafios/desafio010.py
|
genisyskernel/cursoemvideo-python
|
dec301e33933388c886fe78010f38adfb24dae82
|
[
"MIT"
] | 1
|
2020-10-26T04:33:14.000Z
|
2020-10-26T04:33:14.000Z
|
desafios/desafio010.py
|
genisyskernel/cursoemvideo-python
|
dec301e33933388c886fe78010f38adfb24dae82
|
[
"MIT"
] | null | null | null |
desafios/desafio010.py
|
genisyskernel/cursoemvideo-python
|
dec301e33933388c886fe78010f38adfb24dae82
|
[
"MIT"
] | null | null | null |
valor_real = float(input("\033[1;30mDigite o valor na carteira?\033[m \033[1;32mR$\033[m"))
dolares = valor_real / 3.27
print("\033[1;37mO valor\033[m \033[1;32mR$: {0:.2f} reais\033[m \033[1;37mpode comprar\033[m \033[1;32mUSD$: {1:.2f} dolares\033[m \033[1;37m!\033[m".format(valor_real, dolares))
| 50.333333
| 179
| 0.68543
| 61
| 302
| 3.344262
| 0.409836
| 0.137255
| 0.171569
| 0.196078
| 0.117647
| 0
| 0
| 0
| 0
| 0
| 0
| 0.254545
| 0.089404
| 302
| 5
| 180
| 60.4
| 0.487273
| 0
| 0
| 0
| 0
| 0.666667
| 0.675497
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.333333
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
21870086d5a697beca5ff647e63360582def8db9
| 122
|
py
|
Python
|
src/View/__init__.py
|
wklock/nasal-modeling
|
35623d1c6f62a2ee07a99d01a475ea1ca735f0ff
|
[
"BSD-3-Clause"
] | null | null | null |
src/View/__init__.py
|
wklock/nasal-modeling
|
35623d1c6f62a2ee07a99d01a475ea1ca735f0ff
|
[
"BSD-3-Clause"
] | 4
|
2021-06-08T19:00:37.000Z
|
2022-03-11T23:15:09.000Z
|
src/View/__init__.py
|
wklock/nasal-modeling
|
35623d1c6f62a2ee07a99d01a475ea1ca735f0ff
|
[
"BSD-3-Clause"
] | 1
|
2019-05-16T08:11:25.000Z
|
2019-05-16T08:11:25.000Z
|
from src.View.ContouringWorkspace import ContouringWorkspace
from src.View.ResizingImageCanvas import ResizingImageCanvas
| 40.666667
| 60
| 0.901639
| 12
| 122
| 9.166667
| 0.5
| 0.127273
| 0.2
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.065574
| 122
| 2
| 61
| 61
| 0.964912
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 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
|
218fba0a2a129255d0cbe59253b6f9fa68e5b789
| 45
|
py
|
Python
|
test/children/tesla.py
|
Hira63S/KnightRyder
|
d4b7238d8fc8dfcdfbbb9fd5d232f6273c76840e
|
[
"MIT"
] | 1
|
2020-12-19T15:44:25.000Z
|
2020-12-19T15:44:25.000Z
|
test/children/tesla.py
|
Hira63S/PythonPractice
|
5eadc04f2fb056b04db59a658d5914ea847be7d2
|
[
"MIT"
] | null | null | null |
test/children/tesla.py
|
Hira63S/PythonPractice
|
5eadc04f2fb056b04db59a658d5914ea847be7d2
|
[
"MIT"
] | null | null | null |
def Tesla():
print('Hello! I am tesla')
| 11.25
| 30
| 0.577778
| 7
| 45
| 3.714286
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.244444
| 45
| 3
| 31
| 15
| 0.764706
| 0
| 0
| 0
| 0
| 0
| 0.386364
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| true
| 0
| 0
| 0
| 0.5
| 0.5
| 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
| 0
| 0
| 1
|
0
| 6
|
21ac6db36f5c2c7be0e3bcf9280e6ee809dd5b37
| 146
|
py
|
Python
|
libary/developer.py
|
NekoFanatic/kaiji
|
7ae8e12d4e821e7d28d78034e1ec044ed75f9536
|
[
"MIT"
] | null | null | null |
libary/developer.py
|
NekoFanatic/kaiji
|
7ae8e12d4e821e7d28d78034e1ec044ed75f9536
|
[
"MIT"
] | null | null | null |
libary/developer.py
|
NekoFanatic/kaiji
|
7ae8e12d4e821e7d28d78034e1ec044ed75f9536
|
[
"MIT"
] | null | null | null |
class Developer:
DUNDY = 321730481903370240
ADM = 600443374587346989
TEMPLAR = 108281077319077888
GHOSTRIDER = 846009958062358548
| 24.333333
| 35
| 0.760274
| 10
| 146
| 11.1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.62069
| 0.205479
| 146
| 5
| 36
| 29.2
| 0.336207
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 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
| 1
| 0
|
0
| 6
|
21af1029ca8c8361da1627389c73fb11f7ff6195
| 5,298
|
py
|
Python
|
backend/tests/test_apps_admin_workspaces.py
|
fief-dev/fief
|
cbfeec11da7a03aa345cb7ceb088b5d8ec9d6ab1
|
[
"MIT"
] | 1
|
2022-02-13T17:39:42.000Z
|
2022-02-13T17:39:42.000Z
|
backend/tests/test_apps_admin_workspaces.py
|
fief-dev/fief
|
cbfeec11da7a03aa345cb7ceb088b5d8ec9d6ab1
|
[
"MIT"
] | 1
|
2022-02-13T14:46:24.000Z
|
2022-02-13T14:46:24.000Z
|
backend/tests/test_apps_admin_workspaces.py
|
fief-dev/fief
|
cbfeec11da7a03aa345cb7ceb088b5d8ec9d6ab1
|
[
"MIT"
] | null | null | null |
from unittest.mock import AsyncMock, MagicMock
import httpx
import pytest
from fastapi import status
from fief.models import Workspace
from fief.schemas.user import UserDB
from fief.services.workspace_db import WorkspaceDatabaseConnectionError
@pytest.mark.asyncio
@pytest.mark.workspace_host
class TestListWorkspaces:
async def test_unauthorized(self, test_client_admin: httpx.AsyncClient):
response = await test_client_admin.get("/workspaces/")
assert response.status_code == status.HTTP_401_UNAUTHORIZED
@pytest.mark.authenticated_admin(mode="api_key")
async def test_unauthorized_with_api_key(
self, test_client_admin: httpx.AsyncClient
):
response = await test_client_admin.get("/workspaces/")
assert response.status_code == status.HTTP_401_UNAUTHORIZED
@pytest.mark.authenticated_admin(mode="session")
async def test_valid(
self, test_client_admin: httpx.AsyncClient, workspace: Workspace
):
response = await test_client_admin.get("/workspaces/")
assert response.status_code == status.HTTP_200_OK
json = response.json()
assert json["count"] == 1
assert json["results"][0]["id"] == str(workspace.id)
@pytest.mark.asyncio
class TestCheckConnection:
async def test_unauthorized(self, test_client_admin: httpx.AsyncClient):
response = await test_client_admin.post("/workspaces/check-connection")
assert response.status_code == status.HTTP_401_UNAUTHORIZED
@pytest.mark.authenticated_admin(mode="api_key")
async def test_unauthorized_with_api_key(
self, test_client_admin: httpx.AsyncClient
):
response = await test_client_admin.post("/workspaces/check-connection")
assert response.status_code == status.HTTP_401_UNAUTHORIZED
@pytest.mark.authenticated_admin(mode="session")
async def test_db_connection_error(
self, test_client_admin: httpx.AsyncClient, workspace_db_mock: MagicMock
):
workspace_db_mock.check_connection.return_value = (False, "An error occured")
response = await test_client_admin.post(
"/workspaces/check-connection",
json={
"database_type": "POSTGRESQL",
"database_host": "db.bretagne.duchy",
"database_port": 5432,
"database_username": "anne",
"database_password": "hermine",
"database_name": "fief",
},
)
assert response.status_code == status.HTTP_400_BAD_REQUEST
json = response.json()
assert json["detail"] == "An error occured"
@pytest.mark.authenticated_admin(mode="session")
async def test_success(
self, test_client_admin: httpx.AsyncClient, workspace_db_mock: MagicMock
):
workspace_db_mock.check_connection.return_value = (True, None)
response = await test_client_admin.post(
"/workspaces/check-connection",
json={
"database_type": "POSTGRESQL",
"database_host": "db.bretagne.duchy",
"database_port": 5432,
"database_username": "anne",
"database_password": "hermine",
"database_name": "fief",
},
)
assert response.status_code == status.HTTP_200_OK
@pytest.mark.asyncio
class TestCreateWorkspace:
async def test_unauthorized(self, test_client_admin: httpx.AsyncClient):
response = await test_client_admin.post("/workspaces/")
assert response.status_code == status.HTTP_401_UNAUTHORIZED
@pytest.mark.authenticated_admin(mode="api_key")
async def test_unauthorized_with_api_key(
self, test_client_admin: httpx.AsyncClient
):
response = await test_client_admin.post("/workspaces/")
assert response.status_code == status.HTTP_401_UNAUTHORIZED
@pytest.mark.authenticated_admin(mode="session")
async def test_db_connection_error(
self, test_client_admin: httpx.AsyncClient, workspace_creation_mock: MagicMock
):
workspace_creation_mock.create.side_effect = WorkspaceDatabaseConnectionError(
"An error occured"
)
response = await test_client_admin.post(
"/workspaces/",
json={"name": "Burgundy"},
)
assert response.status_code == status.HTTP_400_BAD_REQUEST
json = response.json()
assert json["detail"] == "An error occured"
@pytest.mark.authenticated_admin(mode="session")
async def test_success(
self,
test_client_admin: httpx.AsyncClient,
workspace_creation_mock: MagicMock,
workspace: Workspace,
workspace_admin_user: UserDB,
):
workspace_creation_mock.create.side_effect = AsyncMock(return_value=workspace)
response = await test_client_admin.post(
"/workspaces/",
json={"name": "Burgundy"},
)
assert response.status_code == status.HTTP_201_CREATED
json = response.json()
assert "id" in json
workspace_creation_mock.create.assert_called_once()
create_call_args = workspace_creation_mock.create.call_args
create_call_args[1]["user_id"] == workspace_admin_user.id
| 33.961538
| 86
| 0.673462
| 578
| 5,298
| 5.884083
| 0.16955
| 0.064687
| 0.09703
| 0.061453
| 0.802411
| 0.794766
| 0.770362
| 0.757424
| 0.754484
| 0.754484
| 0
| 0.010808
| 0.231597
| 5,298
| 155
| 87
| 34.180645
| 0.824613
| 0
| 0
| 0.680672
| 0
| 0
| 0.119102
| 0.02114
| 0
| 0
| 0
| 0
| 0.142857
| 1
| 0
| false
| 0.016807
| 0.058824
| 0
| 0.084034
| 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
|
21c33c12b98e1797e63078f852ddb83f17d2d35e
| 96
|
py
|
Python
|
venv/lib/python3.8/site-packages/debugpy/adapter/servers.py
|
Retraces/UkraineBot
|
3d5d7f8aaa58fa0cb8b98733b8808e5dfbdb8b71
|
[
"MIT"
] | 2
|
2022-03-13T01:58:52.000Z
|
2022-03-31T06:07:54.000Z
|
venv/lib/python3.8/site-packages/debugpy/adapter/servers.py
|
DesmoSearch/Desmobot
|
b70b45df3485351f471080deb5c785c4bc5c4beb
|
[
"MIT"
] | 19
|
2021-11-20T04:09:18.000Z
|
2022-03-23T15:05:55.000Z
|
venv/lib/python3.8/site-packages/debugpy/adapter/servers.py
|
DesmoSearch/Desmobot
|
b70b45df3485351f471080deb5c785c4bc5c4beb
|
[
"MIT"
] | null | null | null |
/home/runner/.cache/pip/pool/5e/d2/7f/3671e1de0b98c55df45f65a912c9a07f22b6e999663400107ad9d0f39d
| 96
| 96
| 0.895833
| 9
| 96
| 9.555556
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.4375
| 0
| 96
| 1
| 96
| 96
| 0.458333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
21f1385f418f3304c5cf5888d996420edd75cbe4
| 96
|
py
|
Python
|
venv/lib/python3.8/site-packages/pastel/pastel.py
|
Retraces/UkraineBot
|
3d5d7f8aaa58fa0cb8b98733b8808e5dfbdb8b71
|
[
"MIT"
] | 2
|
2022-03-13T01:58:52.000Z
|
2022-03-31T06:07:54.000Z
|
venv/lib/python3.8/site-packages/pastel/pastel.py
|
DesmoSearch/Desmobot
|
b70b45df3485351f471080deb5c785c4bc5c4beb
|
[
"MIT"
] | 19
|
2021-11-20T04:09:18.000Z
|
2022-03-23T15:05:55.000Z
|
venv/lib/python3.8/site-packages/pastel/pastel.py
|
DesmoSearch/Desmobot
|
b70b45df3485351f471080deb5c785c4bc5c4beb
|
[
"MIT"
] | null | null | null |
/home/runner/.cache/pip/pool/bc/ad/6d/2e2e65f608298ed8db5b28d66d52bd45884851828699bbbdee6a3f0579
| 96
| 96
| 0.895833
| 9
| 96
| 9.555556
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.40625
| 0
| 96
| 1
| 96
| 96
| 0.489583
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
df54184b0330fdc35609de2aebe16cb6b8e42bd3
| 43
|
py
|
Python
|
vnaddress/combined.py
|
datkt1998/vnaddress_standardize
|
22c67d934a1a16add1ce1b6011ce759de8bb8440
|
[
"MIT"
] | 3
|
2020-10-27T03:36:31.000Z
|
2021-07-31T16:39:00.000Z
|
vnaddress/combined.py
|
datkt1998/vnaddress_standardize
|
22c67d934a1a16add1ce1b6011ce759de8bb8440
|
[
"MIT"
] | 4
|
2020-10-13T07:16:30.000Z
|
2022-01-24T02:23:38.000Z
|
vnaddress/combined.py
|
datkt1998/vnaddress_standardize
|
22c67d934a1a16add1ce1b6011ce759de8bb8440
|
[
"MIT"
] | 7
|
2020-06-01T16:04:25.000Z
|
2021-12-04T14:06:53.000Z
|
def test():
print("QQQQQQQQQQQQQQQQQQ")
| 21.5
| 31
| 0.697674
| 4
| 43
| 7.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.139535
| 43
| 2
| 31
| 21.5
| 0.810811
| 0
| 0
| 0
| 0
| 0
| 0.409091
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| true
| 0
| 0
| 0
| 0.5
| 0.5
| 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
| 0
| 0
| 1
|
0
| 6
|
10f776c812b8efd243579d95fd2ab5c78d845fcd
| 33
|
py
|
Python
|
src/example_package2/example2.py
|
martinwimpff/python-package-template
|
a1d181f9bae0157b19e8177d8dea8ce2a76e9f9c
|
[
"MIT"
] | 2
|
2022-03-24T18:53:48.000Z
|
2022-03-24T18:53:53.000Z
|
src/example_package2/example2.py
|
martinwimpff/python-package-template
|
a1d181f9bae0157b19e8177d8dea8ce2a76e9f9c
|
[
"MIT"
] | null | null | null |
src/example_package2/example2.py
|
martinwimpff/python-package-template
|
a1d181f9bae0157b19e8177d8dea8ce2a76e9f9c
|
[
"MIT"
] | null | null | null |
def add_two(n):
return n + 2
| 11
| 16
| 0.575758
| 7
| 33
| 2.571429
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.043478
| 0.30303
| 33
| 2
| 17
| 16.5
| 0.73913
| 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
|
3395f8bae5bdd8b60524a935578b35ae82d00945
| 85
|
py
|
Python
|
GPTime/__init__.py
|
statisticalbiotechnology/GPTime
|
a073d1ef2eff0bd92c4b070c721d869cf1b7843a
|
[
"Apache-2.0"
] | 8
|
2016-07-19T18:37:38.000Z
|
2021-05-12T02:52:23.000Z
|
GPTime/__init__.py
|
statisticalbiotechnology/GPTime
|
a073d1ef2eff0bd92c4b070c721d869cf1b7843a
|
[
"Apache-2.0"
] | 1
|
2018-11-13T16:29:36.000Z
|
2018-11-13T16:29:36.000Z
|
GPTime/__init__.py
|
statisticalbiotechnology/GPTime
|
a073d1ef2eff0bd92c4b070c721d869cf1b7843a
|
[
"Apache-2.0"
] | 3
|
2016-11-17T02:20:40.000Z
|
2020-09-24T09:17:59.000Z
|
from . import peptides
from . import features
from . import model
from . import data
| 17
| 22
| 0.764706
| 12
| 85
| 5.416667
| 0.5
| 0.615385
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.188235
| 85
| 4
| 23
| 21.25
| 0.942029
| 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
|
339a64778ea8f4bc86e2f2a767778b6b4ed8d4f9
| 19
|
py
|
Python
|
optimization/tools/dali_preprocess.py
|
AICryptoGroup/TorchSlim
|
5e1a5eb994b7b22e226cce9ee3849a623ddaacb7
|
[
"Apache-2.0"
] | 5
|
2022-03-11T09:35:33.000Z
|
2022-03-26T14:47:03.000Z
|
optimization/tools/dali_preprocess.py
|
AICryptoGroup/TorchSlim
|
5e1a5eb994b7b22e226cce9ee3849a623ddaacb7
|
[
"Apache-2.0"
] | null | null | null |
optimization/tools/dali_preprocess.py
|
AICryptoGroup/TorchSlim
|
5e1a5eb994b7b22e226cce9ee3849a623ddaacb7
|
[
"Apache-2.0"
] | 1
|
2022-03-11T09:47:28.000Z
|
2022-03-11T09:47:28.000Z
|
#TODO comming soon
| 9.5
| 18
| 0.789474
| 3
| 19
| 5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.157895
| 19
| 1
| 19
| 19
| 0.9375
| 0.894737
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 1
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
339ba392dea8ccf75ced044cf80ded310e99c9d4
| 54
|
py
|
Python
|
login.py
|
13754499307/python2
|
afa3857a69cc9488c6e764245b629523412267a2
|
[
"MIT"
] | null | null | null |
login.py
|
13754499307/python2
|
afa3857a69cc9488c6e764245b629523412267a2
|
[
"MIT"
] | null | null | null |
login.py
|
13754499307/python2
|
afa3857a69cc9488c6e764245b629523412267a2
|
[
"MIT"
] | null | null | null |
a = 1
b = 2
d = 4
c = 3
e = 6
e = 5
f = 7
g = 8
| 3.6
| 5
| 0.296296
| 16
| 54
| 1
| 0.9375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.333333
| 0.555556
| 54
| 14
| 6
| 3.857143
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 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
|
33e552b3b5a2d2bf6fec356300f4936e94878aad
| 21
|
py
|
Python
|
collagen/parallel/__init__.py
|
MIPT-Oulu/Collagen
|
0cbc4285d60e5c9fcc89f629fcf4321e80b7452c
|
[
"MIT"
] | 4
|
2019-05-14T14:44:51.000Z
|
2020-03-13T08:37:48.000Z
|
collagen/parallel/__init__.py
|
MIPT-Oulu/Collagen
|
0cbc4285d60e5c9fcc89f629fcf4321e80b7452c
|
[
"MIT"
] | 26
|
2019-04-21T20:35:22.000Z
|
2022-03-12T00:32:57.000Z
|
collagen/parallel/__init__.py
|
MIPT-Oulu/Collagen
|
0cbc4285d60e5c9fcc89f629fcf4321e80b7452c
|
[
"MIT"
] | 1
|
2019-05-14T14:53:28.000Z
|
2019-05-14T14:53:28.000Z
|
from ._apex import *
| 10.5
| 20
| 0.714286
| 3
| 21
| 4.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.190476
| 21
| 1
| 21
| 21
| 0.823529
| 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
|
d5101b79866a0aacfdf5353158f0299658890e26
| 168
|
py
|
Python
|
apps/homes/__init__.py
|
tuanquanghpvn/flask-intro
|
4dbc6bfbbdee13bc601b7ba8f10ede3635a2cfaf
|
[
"MIT"
] | null | null | null |
apps/homes/__init__.py
|
tuanquanghpvn/flask-intro
|
4dbc6bfbbdee13bc601b7ba8f10ede3635a2cfaf
|
[
"MIT"
] | null | null | null |
apps/homes/__init__.py
|
tuanquanghpvn/flask-intro
|
4dbc6bfbbdee13bc601b7ba8f10ede3635a2cfaf
|
[
"MIT"
] | null | null | null |
from flask import Blueprint
homes_bluesrprints = Blueprint('homes', __name__, template_folder='templates', static_folder='static', url_prefix='/')
from . import views
| 33.6
| 118
| 0.785714
| 20
| 168
| 6.2
| 0.7
| 0.225806
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.095238
| 168
| 5
| 119
| 33.6
| 0.815789
| 0
| 0
| 0
| 0
| 0
| 0.12426
| 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
|
1d32cce521d16c306a9a4e12bb758c94f5318543
| 69
|
py
|
Python
|
peakina/readers/__init__.py
|
ToucanToco/peakina
|
7fed8de8f04d263cc7f704d5d16533cc8676a350
|
[
"BSD-3-Clause"
] | 10
|
2019-01-24T10:32:20.000Z
|
2022-03-04T18:24:59.000Z
|
peakina/readers/__init__.py
|
ToucanToco/peakina
|
7fed8de8f04d263cc7f704d5d16533cc8676a350
|
[
"BSD-3-Clause"
] | 94
|
2018-12-26T11:00:40.000Z
|
2022-03-31T14:10:57.000Z
|
peakina/readers/__init__.py
|
ToucanToco/peakina
|
7fed8de8f04d263cc7f704d5d16533cc8676a350
|
[
"BSD-3-Clause"
] | 4
|
2018-11-25T21:39:03.000Z
|
2022-02-21T21:38:55.000Z
|
# flake8: noqa
from .json import read_json
from .xml import read_xml
| 17.25
| 27
| 0.782609
| 12
| 69
| 4.333333
| 0.583333
| 0.384615
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.017241
| 0.15942
| 69
| 3
| 28
| 23
| 0.87931
| 0.173913
| 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
|
1d39c496ea8e89e6b8e095aa4b8233b127120058
| 15,489
|
py
|
Python
|
sdk/python/pulumi_azure/compute/configuration_policy_assignment.py
|
aangelisc/pulumi-azure
|
71dd9c75403146e16f7480e5a60b08bc0329660e
|
[
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
sdk/python/pulumi_azure/compute/configuration_policy_assignment.py
|
aangelisc/pulumi-azure
|
71dd9c75403146e16f7480e5a60b08bc0329660e
|
[
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
sdk/python/pulumi_azure/compute/configuration_policy_assignment.py
|
aangelisc/pulumi-azure
|
71dd9c75403146e16f7480e5a60b08bc0329660e
|
[
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
from ._inputs import *
__all__ = ['ConfigurationPolicyAssignmentArgs', 'ConfigurationPolicyAssignment']
@pulumi.input_type
class ConfigurationPolicyAssignmentArgs:
def __init__(__self__, *,
configuration: pulumi.Input['ConfigurationPolicyAssignmentConfigurationArgs'],
virtual_machine_id: pulumi.Input[str],
location: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None):
"""
The set of arguments for constructing a ConfigurationPolicyAssignment resource.
:param pulumi.Input['ConfigurationPolicyAssignmentConfigurationArgs'] configuration: A `configuration` block as defined below.
:param pulumi.Input[str] virtual_machine_id: The resource ID of the Virtual Machine which this Guest Configuration Assignment should apply to. Changing this forces a new resource to be created.
:param pulumi.Input[str] location: The Azure location where the Virtual Machine Configuration Policy Assignment should exist. Changing this forces a new resource to be created.
:param pulumi.Input[str] name: The name of the Virtual Machine Configuration Policy Assignment. Changing this forces a new resource to be created.
"""
pulumi.set(__self__, "configuration", configuration)
pulumi.set(__self__, "virtual_machine_id", virtual_machine_id)
if location is not None:
pulumi.set(__self__, "location", location)
if name is not None:
pulumi.set(__self__, "name", name)
@property
@pulumi.getter
def configuration(self) -> pulumi.Input['ConfigurationPolicyAssignmentConfigurationArgs']:
"""
A `configuration` block as defined below.
"""
return pulumi.get(self, "configuration")
@configuration.setter
def configuration(self, value: pulumi.Input['ConfigurationPolicyAssignmentConfigurationArgs']):
pulumi.set(self, "configuration", value)
@property
@pulumi.getter(name="virtualMachineId")
def virtual_machine_id(self) -> pulumi.Input[str]:
"""
The resource ID of the Virtual Machine which this Guest Configuration Assignment should apply to. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "virtual_machine_id")
@virtual_machine_id.setter
def virtual_machine_id(self, value: pulumi.Input[str]):
pulumi.set(self, "virtual_machine_id", value)
@property
@pulumi.getter
def location(self) -> Optional[pulumi.Input[str]]:
"""
The Azure location where the Virtual Machine Configuration Policy Assignment should exist. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "location")
@location.setter
def location(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "location", value)
@property
@pulumi.getter
def name(self) -> Optional[pulumi.Input[str]]:
"""
The name of the Virtual Machine Configuration Policy Assignment. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "name")
@name.setter
def name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "name", value)
@pulumi.input_type
class _ConfigurationPolicyAssignmentState:
def __init__(__self__, *,
configuration: Optional[pulumi.Input['ConfigurationPolicyAssignmentConfigurationArgs']] = None,
location: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
virtual_machine_id: Optional[pulumi.Input[str]] = None):
"""
Input properties used for looking up and filtering ConfigurationPolicyAssignment resources.
:param pulumi.Input['ConfigurationPolicyAssignmentConfigurationArgs'] configuration: A `configuration` block as defined below.
:param pulumi.Input[str] location: The Azure location where the Virtual Machine Configuration Policy Assignment should exist. Changing this forces a new resource to be created.
:param pulumi.Input[str] name: The name of the Virtual Machine Configuration Policy Assignment. Changing this forces a new resource to be created.
:param pulumi.Input[str] virtual_machine_id: The resource ID of the Virtual Machine which this Guest Configuration Assignment should apply to. Changing this forces a new resource to be created.
"""
if configuration is not None:
pulumi.set(__self__, "configuration", configuration)
if location is not None:
pulumi.set(__self__, "location", location)
if name is not None:
pulumi.set(__self__, "name", name)
if virtual_machine_id is not None:
pulumi.set(__self__, "virtual_machine_id", virtual_machine_id)
@property
@pulumi.getter
def configuration(self) -> Optional[pulumi.Input['ConfigurationPolicyAssignmentConfigurationArgs']]:
"""
A `configuration` block as defined below.
"""
return pulumi.get(self, "configuration")
@configuration.setter
def configuration(self, value: Optional[pulumi.Input['ConfigurationPolicyAssignmentConfigurationArgs']]):
pulumi.set(self, "configuration", value)
@property
@pulumi.getter
def location(self) -> Optional[pulumi.Input[str]]:
"""
The Azure location where the Virtual Machine Configuration Policy Assignment should exist. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "location")
@location.setter
def location(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "location", value)
@property
@pulumi.getter
def name(self) -> Optional[pulumi.Input[str]]:
"""
The name of the Virtual Machine Configuration Policy Assignment. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "name")
@name.setter
def name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "name", value)
@property
@pulumi.getter(name="virtualMachineId")
def virtual_machine_id(self) -> Optional[pulumi.Input[str]]:
"""
The resource ID of the Virtual Machine which this Guest Configuration Assignment should apply to. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "virtual_machine_id")
@virtual_machine_id.setter
def virtual_machine_id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "virtual_machine_id", value)
class ConfigurationPolicyAssignment(pulumi.CustomResource):
@overload
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
configuration: Optional[pulumi.Input[pulumi.InputType['ConfigurationPolicyAssignmentConfigurationArgs']]] = None,
location: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
virtual_machine_id: Optional[pulumi.Input[str]] = None,
__props__=None):
"""
Applies a Configuration Policy to a Virtual Machine.
## Import
Virtual Machine Configuration Policy Assignments can be imported using the `resource id`, e.g.
```sh
$ pulumi import azure:compute/configurationPolicyAssignment:ConfigurationPolicyAssignment example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/assignment1
```
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[pulumi.InputType['ConfigurationPolicyAssignmentConfigurationArgs']] configuration: A `configuration` block as defined below.
:param pulumi.Input[str] location: The Azure location where the Virtual Machine Configuration Policy Assignment should exist. Changing this forces a new resource to be created.
:param pulumi.Input[str] name: The name of the Virtual Machine Configuration Policy Assignment. Changing this forces a new resource to be created.
:param pulumi.Input[str] virtual_machine_id: The resource ID of the Virtual Machine which this Guest Configuration Assignment should apply to. Changing this forces a new resource to be created.
"""
...
@overload
def __init__(__self__,
resource_name: str,
args: ConfigurationPolicyAssignmentArgs,
opts: Optional[pulumi.ResourceOptions] = None):
"""
Applies a Configuration Policy to a Virtual Machine.
## Import
Virtual Machine Configuration Policy Assignments can be imported using the `resource id`, e.g.
```sh
$ pulumi import azure:compute/configurationPolicyAssignment:ConfigurationPolicyAssignment example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/assignment1
```
:param str resource_name: The name of the resource.
:param ConfigurationPolicyAssignmentArgs args: The arguments to use to populate this resource's properties.
:param pulumi.ResourceOptions opts: Options for the resource.
"""
...
def __init__(__self__, resource_name: str, *args, **kwargs):
resource_args, opts = _utilities.get_resource_args_opts(ConfigurationPolicyAssignmentArgs, pulumi.ResourceOptions, *args, **kwargs)
if resource_args is not None:
__self__._internal_init(resource_name, opts, **resource_args.__dict__)
else:
__self__._internal_init(resource_name, *args, **kwargs)
def _internal_init(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
configuration: Optional[pulumi.Input[pulumi.InputType['ConfigurationPolicyAssignmentConfigurationArgs']]] = None,
location: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
virtual_machine_id: Optional[pulumi.Input[str]] = None,
__props__=None):
if opts is None:
opts = pulumi.ResourceOptions()
if not isinstance(opts, pulumi.ResourceOptions):
raise TypeError('Expected resource options to be a ResourceOptions instance')
if opts.version is None:
opts.version = _utilities.get_version()
if opts.id is None:
if __props__ is not None:
raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
__props__ = ConfigurationPolicyAssignmentArgs.__new__(ConfigurationPolicyAssignmentArgs)
if configuration is None and not opts.urn:
raise TypeError("Missing required property 'configuration'")
__props__.__dict__["configuration"] = configuration
__props__.__dict__["location"] = location
__props__.__dict__["name"] = name
if virtual_machine_id is None and not opts.urn:
raise TypeError("Missing required property 'virtual_machine_id'")
__props__.__dict__["virtual_machine_id"] = virtual_machine_id
super(ConfigurationPolicyAssignment, __self__).__init__(
'azure:compute/configurationPolicyAssignment:ConfigurationPolicyAssignment',
resource_name,
__props__,
opts)
@staticmethod
def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None,
configuration: Optional[pulumi.Input[pulumi.InputType['ConfigurationPolicyAssignmentConfigurationArgs']]] = None,
location: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
virtual_machine_id: Optional[pulumi.Input[str]] = None) -> 'ConfigurationPolicyAssignment':
"""
Get an existing ConfigurationPolicyAssignment resource's state with the given name, id, and optional extra
properties used to qualify the lookup.
:param str resource_name: The unique name of the resulting resource.
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[pulumi.InputType['ConfigurationPolicyAssignmentConfigurationArgs']] configuration: A `configuration` block as defined below.
:param pulumi.Input[str] location: The Azure location where the Virtual Machine Configuration Policy Assignment should exist. Changing this forces a new resource to be created.
:param pulumi.Input[str] name: The name of the Virtual Machine Configuration Policy Assignment. Changing this forces a new resource to be created.
:param pulumi.Input[str] virtual_machine_id: The resource ID of the Virtual Machine which this Guest Configuration Assignment should apply to. Changing this forces a new resource to be created.
"""
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = _ConfigurationPolicyAssignmentState.__new__(_ConfigurationPolicyAssignmentState)
__props__.__dict__["configuration"] = configuration
__props__.__dict__["location"] = location
__props__.__dict__["name"] = name
__props__.__dict__["virtual_machine_id"] = virtual_machine_id
return ConfigurationPolicyAssignment(resource_name, opts=opts, __props__=__props__)
@property
@pulumi.getter
def configuration(self) -> pulumi.Output['outputs.ConfigurationPolicyAssignmentConfiguration']:
"""
A `configuration` block as defined below.
"""
return pulumi.get(self, "configuration")
@property
@pulumi.getter
def location(self) -> pulumi.Output[str]:
"""
The Azure location where the Virtual Machine Configuration Policy Assignment should exist. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "location")
@property
@pulumi.getter
def name(self) -> pulumi.Output[str]:
"""
The name of the Virtual Machine Configuration Policy Assignment. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "name")
@property
@pulumi.getter(name="virtualMachineId")
def virtual_machine_id(self) -> pulumi.Output[str]:
"""
The resource ID of the Virtual Machine which this Guest Configuration Assignment should apply to. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "virtual_machine_id")
| 50.126214
| 309
| 0.692491
| 1,680
| 15,489
| 6.202381
| 0.101786
| 0.076583
| 0.055086
| 0.050672
| 0.784645
| 0.764012
| 0.750288
| 0.730806
| 0.718042
| 0.708637
| 0
| 0.005907
| 0.22403
| 15,489
| 308
| 310
| 50.288961
| 0.861053
| 0.384402
| 0
| 0.632768
| 1
| 0
| 0.147517
| 0.07088
| 0
| 0
| 0
| 0
| 0
| 1
| 0.152542
| false
| 0.00565
| 0.039548
| 0
| 0.282486
| 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
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
1d527b4b6d499267eb2b0179e407f601a8ba73f6
| 42
|
py
|
Python
|
maps/flooded_valley/__init__.py
|
56kyle/bloons_auto
|
419d55b51d1cddc49099593970adf1c67985b389
|
[
"MIT"
] | null | null | null |
maps/flooded_valley/__init__.py
|
56kyle/bloons_auto
|
419d55b51d1cddc49099593970adf1c67985b389
|
[
"MIT"
] | null | null | null |
maps/flooded_valley/__init__.py
|
56kyle/bloons_auto
|
419d55b51d1cddc49099593970adf1c67985b389
|
[
"MIT"
] | null | null | null |
from .flooded_valley import FloodedValley
| 21
| 41
| 0.880952
| 5
| 42
| 7.2
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.095238
| 42
| 1
| 42
| 42
| 0.947368
| 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
|
1d6cd3aa80424f9d33665475f8ccb776d8e52200
| 8,561
|
py
|
Python
|
automatic_replenishment_system/retail_core/migrations/0001_initial.py
|
udwivedi394/automatic_replenishment
|
c2fde9a94329147ee33b3d7f4f8826378d278f51
|
[
"MIT"
] | null | null | null |
automatic_replenishment_system/retail_core/migrations/0001_initial.py
|
udwivedi394/automatic_replenishment
|
c2fde9a94329147ee33b3d7f4f8826378d278f51
|
[
"MIT"
] | null | null | null |
automatic_replenishment_system/retail_core/migrations/0001_initial.py
|
udwivedi394/automatic_replenishment
|
c2fde9a94329147ee33b3d7f4f8826378d278f51
|
[
"MIT"
] | null | null | null |
# Generated by Django 2.0.13 on 2019-04-21 04:13
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='BrandModel',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_on', models.DateTimeField(auto_now_add=True, db_index=True)),
('updated_at', models.DateTimeField(auto_now=True, db_index=True)),
('name', models.CharField(db_index=True, max_length=256)),
('ranking_model', models.CharField(choices=[('static', 'Static'), ('dynamic', 'Dynamic')], max_length=128)),
],
options={
'verbose_name': 'Brand',
'verbose_name_plural': 'Brands',
},
),
migrations.CreateModel(
name='BSQ',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_on', models.DateTimeField(auto_now_add=True, db_index=True)),
('updated_at', models.DateTimeField(auto_now=True, db_index=True)),
('bsq', models.IntegerField()),
('brand_model', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='retail_core.BrandModel')),
],
options={
'verbose_name': 'BSQ',
'verbose_name_plural': 'BSQ',
},
),
migrations.CreateModel(
name='ProductModel',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_on', models.DateTimeField(auto_now_add=True, db_index=True)),
('updated_at', models.DateTimeField(auto_now=True, db_index=True)),
('product_code', models.CharField(db_index=True, max_length=256)),
('brand_model', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='retail_core.BrandModel')),
],
options={
'verbose_name': 'Product',
'verbose_name_plural': 'Products',
},
),
migrations.CreateModel(
name='SalesTransaction',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_on', models.DateTimeField(auto_now_add=True, db_index=True)),
('updated_at', models.DateTimeField(auto_now=True, db_index=True)),
('date', models.DateTimeField()),
('quantity', models.IntegerField()),
('brand_model', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='retail_core.BrandModel')),
('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='retail_core.ProductModel')),
],
options={
'verbose_name': 'Sale Transaction',
'verbose_name_plural': 'Sales Transactions',
},
),
migrations.CreateModel(
name='StaticPriorityModel',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_on', models.DateTimeField(auto_now_add=True, db_index=True)),
('updated_at', models.DateTimeField(auto_now=True, db_index=True)),
('static_priority_rank', models.IntegerField()),
('brand_model', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='retail_core.BrandModel')),
],
options={
'verbose_name': 'Static Priority',
'verbose_name_plural': 'Static Priorities',
},
),
migrations.CreateModel(
name='StoreInventoryModel',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_on', models.DateTimeField(auto_now_add=True, db_index=True)),
('updated_at', models.DateTimeField(auto_now=True, db_index=True)),
('date', models.DateTimeField()),
('closing_inventory', models.IntegerField()),
('brand_model', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='retail_core.BrandModel')),
('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='retail_core.ProductModel')),
],
options={
'verbose_name': 'Store Inventory',
'verbose_name_plural': 'Store Inventory',
},
),
migrations.CreateModel(
name='StoreModel',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_on', models.DateTimeField(auto_now_add=True, db_index=True)),
('updated_at', models.DateTimeField(auto_now=True, db_index=True)),
('store_code', models.CharField(db_index=True, max_length=256)),
('brand_model', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='retail_core.BrandModel')),
],
options={
'verbose_name': 'Store',
'verbose_name_plural': 'Stores',
},
),
migrations.CreateModel(
name='WarehouseInventoryModel',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_on', models.DateTimeField(auto_now_add=True, db_index=True)),
('updated_at', models.DateTimeField(auto_now=True, db_index=True)),
('date', models.DateTimeField()),
('closing_inventory', models.IntegerField()),
('brand_model', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='retail_core.BrandModel')),
('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='retail_core.ProductModel')),
],
options={
'verbose_name': 'Warehouse Inventory',
'verbose_name_plural': 'Warehouse Inventory',
},
),
migrations.CreateModel(
name='WarehouseModel',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_on', models.DateTimeField(auto_now_add=True, db_index=True)),
('updated_at', models.DateTimeField(auto_now=True, db_index=True)),
('warehouse_code', models.CharField(db_index=True, max_length=256)),
('brand_model', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='retail_core.BrandModel')),
('store', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='retail_core.StoreModel')),
],
options={
'verbose_name': 'Warehouse',
'verbose_name_plural': 'Warehouses',
},
),
migrations.AddField(
model_name='storeinventorymodel',
name='store',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='retail_core.StoreModel'),
),
migrations.AddField(
model_name='staticprioritymodel',
name='store',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='retail_core.StoreModel'),
),
migrations.AddField(
model_name='salestransaction',
name='store',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='retail_core.StoreModel'),
),
migrations.AddField(
model_name='bsq',
name='product',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='retail_core.ProductModel'),
),
migrations.AddField(
model_name='bsq',
name='store',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='retail_core.StoreModel'),
),
]
| 49.201149
| 125
| 0.58089
| 831
| 8,561
| 5.766546
| 0.108303
| 0.061978
| 0.050501
| 0.082638
| 0.768364
| 0.768364
| 0.760643
| 0.760643
| 0.752713
| 0.752713
| 0
| 0.005051
| 0.283144
| 8,561
| 173
| 126
| 49.485549
| 0.775786
| 0.005373
| 0
| 0.650602
| 1
| 0
| 0.182779
| 0.047574
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.012048
| 0
| 0.036145
| 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
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
1d987e5f9e342128c669cf8fb3f8e192fe20c65f
| 63
|
py
|
Python
|
forge/blade/item/tool.py
|
jarbus/neural-mmo
|
7ad02fab50f2781c0a71f7d2afd10c1503110736
|
[
"MIT"
] | 1,450
|
2019-03-04T15:47:38.000Z
|
2022-03-30T03:33:35.000Z
|
forge/blade/item/tool.py
|
jarbus/neural-mmo
|
7ad02fab50f2781c0a71f7d2afd10c1503110736
|
[
"MIT"
] | 34
|
2019-03-05T09:50:38.000Z
|
2021-08-31T15:20:27.000Z
|
forge/blade/item/tool.py
|
LaudateCorpus1/neural-mmo
|
a9a7c34a1fb24fbf252e2958bdb869c213e580a3
|
[
"MIT"
] | 164
|
2019-03-04T16:09:19.000Z
|
2022-02-26T15:43:40.000Z
|
from forge.blade.item import Item
class Tool(Item.Item): pass
| 15.75
| 33
| 0.777778
| 11
| 63
| 4.454545
| 0.727273
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.126984
| 63
| 3
| 34
| 21
| 0.890909
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0.5
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
|
0
| 6
|
d53b4eb04616817318c490e935ebd11d92435c98
| 181
|
py
|
Python
|
rest_in_python/utils.py
|
Varun2604/rest_in_python
|
cd8e0c7b2862c43176d249a9de26e0133ae7a7af
|
[
"MIT"
] | null | null | null |
rest_in_python/utils.py
|
Varun2604/rest_in_python
|
cd8e0c7b2862c43176d249a9de26e0133ae7a7af
|
[
"MIT"
] | null | null | null |
rest_in_python/utils.py
|
Varun2604/rest_in_python
|
cd8e0c7b2862c43176d249a9de26e0133ae7a7af
|
[
"MIT"
] | null | null | null |
from flask import Response
def get_as_response(data, success=True):
return Response(response=data, headers={'content-type': 'application/json'}, status=200 if success else 400)
| 45.25
| 112
| 0.773481
| 26
| 181
| 5.307692
| 0.807692
| 0.173913
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.037267
| 0.110497
| 181
| 4
| 112
| 45.25
| 0.819876
| 0
| 0
| 0
| 0
| 0
| 0.153846
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 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
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 6
|
d546bdc043277b331a975c7f9688f555fd7b5ef0
| 81
|
py
|
Python
|
pureskillgg_makenew_pyskill/notebook/__init__.py
|
pureskillgg/makenew-pyskill
|
3045f0639506fcaefd3191dada76277598bbb1eb
|
[
"MIT"
] | null | null | null |
pureskillgg_makenew_pyskill/notebook/__init__.py
|
pureskillgg/makenew-pyskill
|
3045f0639506fcaefd3191dada76277598bbb1eb
|
[
"MIT"
] | null | null | null |
pureskillgg_makenew_pyskill/notebook/__init__.py
|
pureskillgg/makenew-pyskill
|
3045f0639506fcaefd3191dada76277598bbb1eb
|
[
"MIT"
] | null | null | null |
"""
Setup local Jupyter notebooks
"""
from .setup_notebook import setup_notebook
| 16.2
| 42
| 0.790123
| 10
| 81
| 6.2
| 0.7
| 0.419355
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.123457
| 81
| 4
| 43
| 20.25
| 0.873239
| 0.358025
| 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
|
d55fa92057887aea1488a52c2c40af41a5643927
| 136
|
py
|
Python
|
tools/pubschemata.py
|
surchs/dandischema
|
4fd78fe55e2c8efeb0ce27fba5652ab87a10958c
|
[
"Apache-2.0"
] | 1
|
2021-09-19T10:56:25.000Z
|
2021-09-19T10:56:25.000Z
|
tools/pubschemata.py
|
surchs/dandischema
|
4fd78fe55e2c8efeb0ce27fba5652ab87a10958c
|
[
"Apache-2.0"
] | 121
|
2021-05-20T18:35:32.000Z
|
2022-03-31T13:13:52.000Z
|
tools/pubschemata.py
|
surchs/dandischema
|
4fd78fe55e2c8efeb0ce27fba5652ab87a10958c
|
[
"Apache-2.0"
] | 4
|
2021-05-20T22:03:21.000Z
|
2021-09-22T23:31:00.000Z
|
import sys
from dandischema.metadata import publish_model_schemata
if __name__ == "__main__":
publish_model_schemata(sys.argv[1])
| 19.428571
| 55
| 0.794118
| 18
| 136
| 5.333333
| 0.722222
| 0.25
| 0.416667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.008403
| 0.125
| 136
| 6
| 56
| 22.666667
| 0.798319
| 0
| 0
| 0
| 0
| 0
| 0.058824
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 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
|
6345bd50a7fa096d40a919e74d955c806e77f8d5
| 8,957
|
py
|
Python
|
SimModel_Python_API/simmodel_swig/Release/SimMaterialLayerSet_OpaqueLayerSet_Door.py
|
EnEff-BIM/EnEffBIM-Framework
|
6328d39b498dc4065a60b5cc9370b8c2a9a1cddf
|
[
"MIT"
] | 3
|
2016-05-30T15:12:16.000Z
|
2022-03-22T08:11:13.000Z
|
SimModel_Python_API/simmodel_swig/Release/SimMaterialLayerSet_OpaqueLayerSet_Door.py
|
EnEff-BIM/EnEffBIM-Framework
|
6328d39b498dc4065a60b5cc9370b8c2a9a1cddf
|
[
"MIT"
] | 21
|
2016-06-13T11:33:45.000Z
|
2017-05-23T09:46:52.000Z
|
SimModel_Python_API/simmodel_swig/Release/SimMaterialLayerSet_OpaqueLayerSet_Door.py
|
EnEff-BIM/EnEffBIM-Framework
|
6328d39b498dc4065a60b5cc9370b8c2a9a1cddf
|
[
"MIT"
] | null | null | null |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.7
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2, 6, 0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_SimMaterialLayerSet_OpaqueLayerSet_Door', [dirname(__file__)])
except ImportError:
import _SimMaterialLayerSet_OpaqueLayerSet_Door
return _SimMaterialLayerSet_OpaqueLayerSet_Door
if fp is not None:
try:
_mod = imp.load_module('_SimMaterialLayerSet_OpaqueLayerSet_Door', fp, pathname, description)
finally:
fp.close()
return _mod
_SimMaterialLayerSet_OpaqueLayerSet_Door = swig_import_helper()
del swig_import_helper
else:
import _SimMaterialLayerSet_OpaqueLayerSet_Door
del version_info
try:
_swig_property = property
except NameError:
pass # Python < 2.2 doesn't have 'property'.
def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
if (name == "thisown"):
return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'SwigPyObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name, None)
if method:
return method(self, value)
if (not static):
if _newclass:
object.__setattr__(self, name, value)
else:
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self, class_type, name, value):
return _swig_setattr_nondynamic(self, class_type, name, value, 0)
def _swig_getattr_nondynamic(self, class_type, name, static=1):
if (name == "thisown"):
return self.this.own()
method = class_type.__swig_getmethods__.get(name, None)
if method:
return method(self)
if (not static):
return object.__getattr__(self, name)
else:
raise AttributeError(name)
def _swig_getattr(self, class_type, name):
return _swig_getattr_nondynamic(self, class_type, name, 0)
def _swig_repr(self):
try:
strthis = "proxy of " + self.this.__repr__()
except:
strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
try:
_object = object
_newclass = 1
except AttributeError:
class _object:
pass
_newclass = 0
try:
import weakref
weakref_proxy = weakref.proxy
except:
weakref_proxy = lambda x: x
import base
import SimMaterialLayerSet_OpaqueLayerSet_Ceiling
import SimMaterialLayerSet_Default_Default
class SimMaterialLayerSet_OpaqueLayerSet_Door(SimMaterialLayerSet_OpaqueLayerSet_Ceiling.SimMaterialLayerSet_OpaqueLayerSet):
__swig_setmethods__ = {}
for _s in [SimMaterialLayerSet_OpaqueLayerSet_Ceiling.SimMaterialLayerSet_OpaqueLayerSet]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, SimMaterialLayerSet_OpaqueLayerSet_Door, name, value)
__swig_getmethods__ = {}
for _s in [SimMaterialLayerSet_OpaqueLayerSet_Ceiling.SimMaterialLayerSet_OpaqueLayerSet]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, SimMaterialLayerSet_OpaqueLayerSet_Door, name)
__repr__ = _swig_repr
def SimMatLayerSet_OutsideLayer(self, *args):
return _SimMaterialLayerSet_OpaqueLayerSet_Door.SimMaterialLayerSet_OpaqueLayerSet_Door_SimMatLayerSet_OutsideLayer(self, *args)
def SimMatLayerSet_Layer_2_10(self, *args):
return _SimMaterialLayerSet_OpaqueLayerSet_Door.SimMaterialLayerSet_OpaqueLayerSet_Door_SimMatLayerSet_Layer_2_10(self, *args)
def T24DoorCertMethod(self, *args):
return _SimMaterialLayerSet_OpaqueLayerSet_Door.SimMaterialLayerSet_OpaqueLayerSet_Door_T24DoorCertMethod(self, *args)
def T24DoorOpenType(self, *args):
return _SimMaterialLayerSet_OpaqueLayerSet_Door.SimMaterialLayerSet_OpaqueLayerSet_Door_T24DoorOpenType(self, *args)
def T24DoorType(self, *args):
return _SimMaterialLayerSet_OpaqueLayerSet_Door.SimMaterialLayerSet_OpaqueLayerSet_Door_T24DoorType(self, *args)
def __init__(self, *args):
this = _SimMaterialLayerSet_OpaqueLayerSet_Door.new_SimMaterialLayerSet_OpaqueLayerSet_Door(*args)
try:
self.this.append(this)
except:
self.this = this
def _clone(self, f=0, c=None):
return _SimMaterialLayerSet_OpaqueLayerSet_Door.SimMaterialLayerSet_OpaqueLayerSet_Door__clone(self, f, c)
__swig_destroy__ = _SimMaterialLayerSet_OpaqueLayerSet_Door.delete_SimMaterialLayerSet_OpaqueLayerSet_Door
__del__ = lambda self: None
SimMaterialLayerSet_OpaqueLayerSet_Door_swigregister = _SimMaterialLayerSet_OpaqueLayerSet_Door.SimMaterialLayerSet_OpaqueLayerSet_Door_swigregister
SimMaterialLayerSet_OpaqueLayerSet_Door_swigregister(SimMaterialLayerSet_OpaqueLayerSet_Door)
class SimMaterialLayerSet_OpaqueLayerSet_Door_sequence(base.sequence_common):
__swig_setmethods__ = {}
for _s in [base.sequence_common]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, SimMaterialLayerSet_OpaqueLayerSet_Door_sequence, name, value)
__swig_getmethods__ = {}
for _s in [base.sequence_common]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, SimMaterialLayerSet_OpaqueLayerSet_Door_sequence, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _SimMaterialLayerSet_OpaqueLayerSet_Door.new_SimMaterialLayerSet_OpaqueLayerSet_Door_sequence(*args)
try:
self.this.append(this)
except:
self.this = this
def assign(self, n, x):
return _SimMaterialLayerSet_OpaqueLayerSet_Door.SimMaterialLayerSet_OpaqueLayerSet_Door_sequence_assign(self, n, x)
def begin(self, *args):
return _SimMaterialLayerSet_OpaqueLayerSet_Door.SimMaterialLayerSet_OpaqueLayerSet_Door_sequence_begin(self, *args)
def end(self, *args):
return _SimMaterialLayerSet_OpaqueLayerSet_Door.SimMaterialLayerSet_OpaqueLayerSet_Door_sequence_end(self, *args)
def rbegin(self, *args):
return _SimMaterialLayerSet_OpaqueLayerSet_Door.SimMaterialLayerSet_OpaqueLayerSet_Door_sequence_rbegin(self, *args)
def rend(self, *args):
return _SimMaterialLayerSet_OpaqueLayerSet_Door.SimMaterialLayerSet_OpaqueLayerSet_Door_sequence_rend(self, *args)
def at(self, *args):
return _SimMaterialLayerSet_OpaqueLayerSet_Door.SimMaterialLayerSet_OpaqueLayerSet_Door_sequence_at(self, *args)
def front(self, *args):
return _SimMaterialLayerSet_OpaqueLayerSet_Door.SimMaterialLayerSet_OpaqueLayerSet_Door_sequence_front(self, *args)
def back(self, *args):
return _SimMaterialLayerSet_OpaqueLayerSet_Door.SimMaterialLayerSet_OpaqueLayerSet_Door_sequence_back(self, *args)
def push_back(self, *args):
return _SimMaterialLayerSet_OpaqueLayerSet_Door.SimMaterialLayerSet_OpaqueLayerSet_Door_sequence_push_back(self, *args)
def pop_back(self):
return _SimMaterialLayerSet_OpaqueLayerSet_Door.SimMaterialLayerSet_OpaqueLayerSet_Door_sequence_pop_back(self)
def detach_back(self, pop=True):
return _SimMaterialLayerSet_OpaqueLayerSet_Door.SimMaterialLayerSet_OpaqueLayerSet_Door_sequence_detach_back(self, pop)
def insert(self, *args):
return _SimMaterialLayerSet_OpaqueLayerSet_Door.SimMaterialLayerSet_OpaqueLayerSet_Door_sequence_insert(self, *args)
def erase(self, *args):
return _SimMaterialLayerSet_OpaqueLayerSet_Door.SimMaterialLayerSet_OpaqueLayerSet_Door_sequence_erase(self, *args)
def detach(self, position, r, erase=True):
return _SimMaterialLayerSet_OpaqueLayerSet_Door.SimMaterialLayerSet_OpaqueLayerSet_Door_sequence_detach(self, position, r, erase)
def swap(self, x):
return _SimMaterialLayerSet_OpaqueLayerSet_Door.SimMaterialLayerSet_OpaqueLayerSet_Door_sequence_swap(self, x)
__swig_destroy__ = _SimMaterialLayerSet_OpaqueLayerSet_Door.delete_SimMaterialLayerSet_OpaqueLayerSet_Door_sequence
__del__ = lambda self: None
SimMaterialLayerSet_OpaqueLayerSet_Door_sequence_swigregister = _SimMaterialLayerSet_OpaqueLayerSet_Door.SimMaterialLayerSet_OpaqueLayerSet_Door_sequence_swigregister
SimMaterialLayerSet_OpaqueLayerSet_Door_sequence_swigregister(SimMaterialLayerSet_OpaqueLayerSet_Door_sequence)
# This file is compatible with both classic and new-style classes.
| 42.051643
| 166
| 0.765993
| 933
| 8,957
| 6.822079
| 0.162915
| 0.409584
| 0.418539
| 0.211155
| 0.673841
| 0.648075
| 0.638963
| 0.545954
| 0.492852
| 0.333386
| 0
| 0.004408
| 0.164117
| 8,957
| 212
| 167
| 42.25
| 0.845733
| 0.032823
| 0
| 0.3125
| 1
| 0
| 0.027505
| 0.009245
| 0
| 0
| 0
| 0
| 0
| 1
| 0.18125
| false
| 0.0125
| 0.08125
| 0.14375
| 0.56875
| 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
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 6
|
6388eb204db85deae502956d96ba700b272b91a7
| 75
|
py
|
Python
|
doctr/utils/__init__.py
|
mzeidhassan/doctr
|
14b376e07d31b09b6bd31bceebf6ffb477c30f08
|
[
"Apache-2.0"
] | 1
|
2021-09-26T06:03:10.000Z
|
2021-09-26T06:03:10.000Z
|
doctr/utils/__init__.py
|
mzeidhassan/doctr
|
14b376e07d31b09b6bd31bceebf6ffb477c30f08
|
[
"Apache-2.0"
] | null | null | null |
doctr/utils/__init__.py
|
mzeidhassan/doctr
|
14b376e07d31b09b6bd31bceebf6ffb477c30f08
|
[
"Apache-2.0"
] | null | null | null |
from .geometry import *
from .common_types import *
from .metrics import *
| 18.75
| 27
| 0.76
| 10
| 75
| 5.6
| 0.6
| 0.357143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.16
| 75
| 3
| 28
| 25
| 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
|
892131c74e300a31db22c61e8166de2d25b19033
| 39
|
py
|
Python
|
__main__.py
|
35359595/pyfs
|
23688b59a1f86c1c9ee76051849703f9e22da3f4
|
[
"Apache-2.0"
] | null | null | null |
__main__.py
|
35359595/pyfs
|
23688b59a1f86c1c9ee76051849703f9e22da3f4
|
[
"Apache-2.0"
] | null | null | null |
__main__.py
|
35359595/pyfs
|
23688b59a1f86c1c9ee76051849703f9e22da3f4
|
[
"Apache-2.0"
] | null | null | null |
#!/bin/bash/env python3
import tvcheck
| 13
| 23
| 0.769231
| 6
| 39
| 5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.028571
| 0.102564
| 39
| 2
| 24
| 19.5
| 0.828571
| 0.564103
| 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
|
89238e21b0ef9afa2c7139ef63e4b7d39ea97684
| 47
|
py
|
Python
|
geco/mips/graph_coloring/__init__.py
|
FreestyleBuild/GeCO
|
6db1a549b3145b3bc5d3025a9bccc03be6575564
|
[
"MIT"
] | 8
|
2020-12-16T09:59:05.000Z
|
2022-03-18T09:48:43.000Z
|
geco/mips/graph_coloring/__init__.py
|
FreestyleBuild/GeCO
|
6db1a549b3145b3bc5d3025a9bccc03be6575564
|
[
"MIT"
] | 101
|
2020-11-09T10:20:03.000Z
|
2022-03-24T13:50:06.000Z
|
geco/mips/graph_coloring/__init__.py
|
FreestyleBuild/GeCO
|
6db1a549b3145b3bc5d3025a9bccc03be6575564
|
[
"MIT"
] | 3
|
2021-04-06T13:26:03.000Z
|
2022-03-22T13:22:16.000Z
|
from geco.mips.graph_coloring.generic import *
| 23.5
| 46
| 0.829787
| 7
| 47
| 5.428571
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.085106
| 47
| 1
| 47
| 47
| 0.883721
| 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
|
8931bf1a634ff1fdeb557edf81ff16bd5adbb4e3
| 102
|
py
|
Python
|
packages/watchmen-pipeline-surface/src/watchmen_pipeline_surface/__init__.py
|
Indexical-Metrics-Measure-Advisory/watchmen
|
c54ec54d9f91034a38e51fd339ba66453d2c7a6d
|
[
"MIT"
] | null | null | null |
packages/watchmen-pipeline-surface/src/watchmen_pipeline_surface/__init__.py
|
Indexical-Metrics-Measure-Advisory/watchmen
|
c54ec54d9f91034a38e51fd339ba66453d2c7a6d
|
[
"MIT"
] | null | null | null |
packages/watchmen-pipeline-surface/src/watchmen_pipeline_surface/__init__.py
|
Indexical-Metrics-Measure-Advisory/watchmen
|
c54ec54d9f91034a38e51fd339ba66453d2c7a6d
|
[
"MIT"
] | null | null | null |
from .main import get_pipeline_surface_routers
from .surface import pipeline_surface, PipelineSurface
| 34
| 54
| 0.882353
| 13
| 102
| 6.615385
| 0.615385
| 0.348837
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.088235
| 102
| 2
| 55
| 51
| 0.924731
| 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
|
895e267c47ed1c0208b6314ea03002f639590590
| 45
|
py
|
Python
|
materialize_nav/__init__.py
|
justengel-django/django_materialize_nav
|
35349041e41defe599f959047d9e3f6e4bed38c2
|
[
"MIT"
] | 1
|
2020-11-02T11:20:59.000Z
|
2020-11-02T11:20:59.000Z
|
materialize_nav/__init__.py
|
justengel-django/django_materialize_nav
|
35349041e41defe599f959047d9e3f6e4bed38c2
|
[
"MIT"
] | 1
|
2021-04-25T07:10:37.000Z
|
2021-04-26T16:34:19.000Z
|
materialize_nav/__init__.py
|
justengel-django/django_materialize_nav
|
35349041e41defe599f959047d9e3f6e4bed38c2
|
[
"MIT"
] | 1
|
2021-01-30T14:36:12.000Z
|
2021-01-30T14:36:12.000Z
|
from .__meta__ import version as __version__
| 22.5
| 44
| 0.844444
| 6
| 45
| 5
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.133333
| 45
| 1
| 45
| 45
| 0.769231
| 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
|
895f0a1841a177ac5bf26698e8ed37b4f749d14f
| 113
|
py
|
Python
|
titan/api_pkg/pipeline/resources.py
|
mnieber/gen
|
65f8aa4fb671c4f90d5cbcb1a0e10290647a31d9
|
[
"MIT"
] | null | null | null |
titan/api_pkg/pipeline/resources.py
|
mnieber/gen
|
65f8aa4fb671c4f90d5cbcb1a0e10290647a31d9
|
[
"MIT"
] | null | null | null |
titan/api_pkg/pipeline/resources.py
|
mnieber/gen
|
65f8aa4fb671c4f90d5cbcb1a0e10290647a31d9
|
[
"MIT"
] | null | null | null |
from dataclasses import dataclass
from moonleap import Resource
@dataclass
class Pipeline(Resource):
pass
| 12.555556
| 33
| 0.79646
| 13
| 113
| 6.923077
| 0.692308
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.168142
| 113
| 8
| 34
| 14.125
| 0.957447
| 0
| 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
|
89656f2fad7fd498654e53d2c392a19de0898093
| 22
|
py
|
Python
|
asystem-anode/src/main/python/anode/plugin/darksky/__init__.py
|
ggear/asystem_archive
|
b97f67218e8aa60991fba386c9e73d27d20d6c47
|
[
"Apache-2.0"
] | 4
|
2019-03-26T13:57:54.000Z
|
2021-11-04T04:55:49.000Z
|
asystem-anode/src/main/python/anode/plugin/darksky/__init__.py
|
ggear/asystem_archive
|
b97f67218e8aa60991fba386c9e73d27d20d6c47
|
[
"Apache-2.0"
] | 2
|
2021-03-25T21:27:09.000Z
|
2022-02-11T03:38:48.000Z
|
asystem-anode/src/main/python/anode/plugin/darksky/__init__.py
|
ggear/asystem_archive
|
b97f67218e8aa60991fba386c9e73d27d20d6c47
|
[
"Apache-2.0"
] | 2
|
2019-04-02T19:20:34.000Z
|
2019-08-13T16:39:52.000Z
|
from darksky import *
| 11
| 21
| 0.772727
| 3
| 22
| 5.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.181818
| 22
| 1
| 22
| 22
| 0.944444
| 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
|
896fb08159c716acf9e1aaa1596fd3038e0be294
| 96
|
py
|
Python
|
venv/lib/python3.8/site-packages/numpy/core/tests/test_conversion_utils.py
|
Retraces/UkraineBot
|
3d5d7f8aaa58fa0cb8b98733b8808e5dfbdb8b71
|
[
"MIT"
] | 2
|
2022-03-13T01:58:52.000Z
|
2022-03-31T06:07:54.000Z
|
venv/lib/python3.8/site-packages/numpy/core/tests/test_conversion_utils.py
|
DesmoSearch/Desmobot
|
b70b45df3485351f471080deb5c785c4bc5c4beb
|
[
"MIT"
] | 19
|
2021-11-20T04:09:18.000Z
|
2022-03-23T15:05:55.000Z
|
venv/lib/python3.8/site-packages/numpy/core/tests/test_conversion_utils.py
|
DesmoSearch/Desmobot
|
b70b45df3485351f471080deb5c785c4bc5c4beb
|
[
"MIT"
] | null | null | null |
/home/runner/.cache/pip/pool/e9/d6/fb/d7a91f6bc17824d7499aa0fa4959a960ca85b59a43d568fd6b25738d66
| 96
| 96
| 0.895833
| 9
| 96
| 9.555556
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.416667
| 0
| 96
| 1
| 96
| 96
| 0.479167
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
89a2b8f33c0be266be48c78456a2c841a4ff28df
| 67
|
py
|
Python
|
Source/boost_1_33_1/libs/python/example/test_std_pair.py
|
spxuw/RFIM
|
32b78fbb90c7008b1106b0cff4f8023ae83c9b6d
|
[
"MIT"
] | null | null | null |
Source/boost_1_33_1/libs/python/example/test_std_pair.py
|
spxuw/RFIM
|
32b78fbb90c7008b1106b0cff4f8023ae83c9b6d
|
[
"MIT"
] | null | null | null |
Source/boost_1_33_1/libs/python/example/test_std_pair.py
|
spxuw/RFIM
|
32b78fbb90c7008b1106b0cff4f8023ae83c9b6d
|
[
"MIT"
] | null | null | null |
import std_pair_ext
assert std_pair_ext.foo() == (3, 5)
print "OK"
| 16.75
| 35
| 0.716418
| 13
| 67
| 3.384615
| 0.769231
| 0.318182
| 0.454545
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.034483
| 0.134328
| 67
| 3
| 36
| 22.333333
| 0.724138
| 0
| 0
| 0
| 0
| 0
| 0.029851
| 0
| 0
| 0
| 0
| 0
| 0.333333
| 0
| null | null | 0
| 0.333333
| null | null | 0.333333
| 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
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 6
|
9871b7506ef050b51b44e4331dc3ff648bb16428
| 294,541
|
py
|
Python
|
src/TAME_simax.py
|
charlescolley/TKP_simax_plots
|
9c6b65c1800a8d12614cc62dae34670d36a575dd
|
[
"MIT"
] | null | null | null |
src/TAME_simax.py
|
charlescolley/TKP_simax_plots
|
9c6b65c1800a8d12614cc62dae34670d36a575dd
|
[
"MIT"
] | null | null | null |
src/TAME_simax.py
|
charlescolley/TKP_simax_plots
|
9c6b65c1800a8d12614cc62dae34670d36a575dd
|
[
"MIT"
] | null | null | null |
#from sqlalchemy import true
from sqlalchemy import false
import CTAMELogParser as CT_LP
from plotting_style import *
def call_all_plots():
#
# -- Low Rank Structure -- #
#
max_rank_experiments()
TAME_vs_LRTAME_clique_scaling_summarized()
# Appendix plots
TAME_vs_LRTAME_rank_1_case_singular_values()
# Supplementary File
TAME_vs_LRTAME_clique_scaling_detailed()
#
# -- Random Graph Experiments -- #
#
RandomGeometricRG_PostProcessing_is_needed()
LambdaTAME_increasing_clique_size_v2()
#Supplementary Plots
RandomGeometricDupNoise_allModes()
RandomGeometricERNoise_allModes()
# NOTE: default params are n = 250, p = .05
#
# -- LVGNA Experiments -- #
#
LVGNA_end_to_end_relative_to_TAME_table_with_microplots()
make_LVGNA_TTVMatchingRatio_runtime_plots()
# Supplementary figures
LVGNA_pre_and_post_processed()
#
# -- Dominant Eigenpair Experiments -- #
#
tensor_kronecker_product_eigenspaces_as_row()
def render_and_save_all_plots(output_path=None):
if output_path is None:
output_path = "../rendered_figures/"
assert output_path[-1] == "/"
make_path = lambda filename: output_path + filename
#
# -- Low Rank Structure -- #
#
max_rank_experiments(save_path=make_path("MaxRankExperiments.pdf"))
print(f"saved fig {make_path('MaxRankExperiments.pdf')}")
TAME_vs_LRTAME_clique_scaling_summarized(save_path=make_path("TAME_LRTAME_clique_scaling_summarized.pdf"))
print(f"saved fig {make_path('TAME_LRTAME_clique_scaling_summarized.pdf')}")
# Appendix plots
TAME_vs_LRTAME_rank_1_case_singular_values(save_path=make_path("LRTAME_vs_TAME_rank_1_case_secondSingularValues.pdf"))
print(f"saved fig {make_path('LRTAME_vs_TAME_rank_1_case_secondSingularValues')}")
# Supplementary File
TAME_vs_LRTAME_clique_scaling_detailed(save_path=make_path("TAME_LRTAME_clique_scaling.pdf"))
#TODO: need to update with 8 + 9 Clique results
# violin plots style need to be updated too.
print(f"saved fig {make_path('TAME_LRTAME_clique_scaling.pdf')}")
#
# -- Random Graph Experiments -- #
#
RandomGeometricRG_PostProcessing_is_needed(save_path=make_path('SynthAlignments_SizeExps_theNeedForPostProcessing.pdf'))
print(f"saved fig {make_path('SynthAlignments_SizeExps_theNeedForPostProcessing.pdf')}")
LambdaTAME_increasing_clique_size_v2(save_path=make_path('PostProcessing_KNearest_IncreasingMotifs.pdf'))
print(f"saved fig {make_path('PostProcessing_KNearest_IncreasingMotifs.pdf')}")
#Supplementary Plots
RandomGeometricDupNoise_allModes(save_path=make_path('DupNoiseRG_exps.pdf'))
print(f"saved fig {make_path('DupNoiseRG_exps.pdf')}")
RandomGeometricERNoise_allModes(save_path=make_path('ERNoiseRG_exps.pdf'))
print(f"saved fig {make_path('ERNoiseRG_exps.pdf')}")
# TODO: add in LREA post processing results
# update plot style
# NOTE: default params are n = 250, p = .05
#
# -- LVGNA Experiments -- #
#
LVGNA_end_to_end_relative_to_TAME_table_with_microplots(save_path=make_path('LVGNA_end_to_end_vs_TAME.pdf'))
print(f"saved fig {make_path('LVGNA_end_to_end_vs_TAME.pdf')}")
make_LVGNA_TTVMatchingRatio_runtime_plots(save_path=make_path('LVGNA_TTVMatchingRatio_noLowRank.pdf'))
print(f"saved fig {make_path('LVGNA_TTVMatchingRatio_noLowRank.pdf')}")
# Supplementary figures
LVGNA_pre_and_post_processed(save_path=make_path('TAME_LVGNA_PreAndPostProcessing.pdf'))
print(f"saved fig {make_path('TAME_LVGNA_PreAndPostProcessing.pdf')}")
#
# -- Dominant Eigenpair Experiments -- #
#
tensor_kronecker_product_eigenspaces_as_row(save_path=make_path('TKPDominantEigenpairs.pdf'))
print(f"saved fig {make_path('TKPDominantEigenpairs.pdf')}")
#
# Matlab Experiment Summary stats
#
def verify_ARST_tensors_are_generated_tensors():
""" Copies of the tensors are saved within the AReigST files too.
This function verifies all the tensors are the same to ensure
correct spectra are used across all algorithms."""
tensor_path = TKP_RESULTS + "tensor_problems/"
tensors = {}
for file in os.listdir(tensor_path):
tenParamStr = file.split(".mat")[0].split("weighted_TKP_")[-1]
mat_file_obj = scipy.io.loadmat(tensor_path+file)
A = mat_file_obj["A"][0][0][0]
B = mat_file_obj["B"][0][0][0]
A_kron_B = mat_file_obj["A_kron_B"][0]
tensors[tenParamStr] = [A,B,A_kron_B]
ARST_result_path = TKP_RESULTS + "AREigST/"
for file in os.listdir(ARST_result_path):
tenParamStr = file.split("_results.mat")[0].split("weighted_kronzeig_exp_")[-1]
mat_file_obj = scipy.io.loadmat(ARST_result_path+file)
A = mat_file_obj["A"][0][0][0]
B = mat_file_obj["B"][0][0][0]
A_kron_B = mat_file_obj["A_kron_B"][0]
A_prob, B_prob, A_kron_B_prob = tensors[tenParamStr]
print(f"file:{file}\n |A-Ap|={np.sum(A - A_prob)} |B -Bp|={np.sum(B - B_prob)} |A_kron_B -A_kron_Bp|={np.sum(A_kron_B - A_kron_B_prob)}")
def tensor_kronecker_product_eigenspaces(save_path=None):
#
# Data loading drivers
#
def process_AReigSTdata():
result_path = TKP_RESULTS + "AReigST/"
#
# Load data from files
#
success_codes = []
eigenvectors_found = {}
for file in os.listdir(result_path):
tensor_param_str = file.split("_results.mat")[0].split("exp_")[-1]
mat_file = scipy.io.loadmat(result_path + file)
codes = []
for key in ["info_B","info_A","info_A_kron_B"]:
codes.append(mat_file[key][0]["success"][0][0][0])
A_eigvals = mat_file["lmd_A"].reshape(-1)
B_eigvals = mat_file["lmd_B"].reshape(-1)
A_kron_B_eigvals = mat_file["lmd_A_kron_B"].reshape(-1)
A_eigvecs = mat_file["eigvec_A"]
B_eigvecs = mat_file["eigvec_B"]
A_kron_B_eigvecs = mat_file["eigvec_A_kron_B"]
eigenvectors_found[tensor_param_str] = [A_eigvals, A_eigvecs, B_eigvals, B_eigvecs, A_kron_B_eigvals, A_kron_B_eigvecs]
success_codes.append(codes)
return eigenvectors_found,success_codes
def process_NCMdata(subdirectory="NCM_sampling/"):
results_path = TKP_RESULTS +subdirectory
eigenvectors_found = {}
for file in os.listdir(results_path):
tensor_param_str = file.split("_delta:")[0].split("NCM_")[-1]
matfile_object = scipy.io.loadmat(results_path+file)
A_eigvals, A_eigvecs, _,_ = matfile_object["A_output"][0][0]
B_eigvals, B_eigvecs, _,_= matfile_object["B_output"][0][0]
A_kron_B_eigvals, A_kron_B_eigvecs, _,_ = matfile_object["A_kron_B_output"][0][0]
A_eigvecs = np.transpose(A_eigvecs)
B_eigvecs = np.transpose(B_eigvecs)
A_kron_B_eigvecs = np.transpose(A_kron_B_eigvecs)
A_eigvals = A_eigvals.reshape(-1)
B_eigvals = B_eigvals.reshape(-1)
A_kron_B_eigvals = A_kron_B_eigvals.reshape(-1)
eigenvectors_found[tensor_param_str] = [A_eigvals, A_eigvecs, B_eigvals, B_eigvecs, A_kron_B_eigvals, A_kron_B_eigvecs]
return eigenvectors_found
AReigST_codes = process_AReigSTdata()[1]
eigenpairs_found = [
process_AReigSTdata()[0],
process_NCMdata(subdirectory="NCM_sampling/"),
process_NCMdata(subdirectory="ONCM_sampling/"),
]
#return eigenpairs_found
#
# Consolidate the eigevectors found for each tensor
#
def update_max(eigvals,eigvec,curr_eigpair):
# curr_eigpair::(eigval,eigvec)
vals = abs(eigvals)
idx = np.argmax(vals)
#print(vals)
lmd = vals[idx]
if lmd > curr_eigpair[0]:
return (lmd,eigvec[idx,:]), True
else:
return curr_eigpair, False
dominant_eigenpairs = []
algorithm_with_best_results = []
for tenParamStr in eigenpairs_found[0].keys():
max_A_eigpair = (-np.Inf,[])
max_B_eigpair = (-np.Inf,[])
max_A_kron_B_eigpair = (-np.Inf,[])
algorithm_chosen = [-1,-1,-1]
# 3 entries for A,B,A_kron_B
for alg_idx,exp in enumerate(eigenpairs_found):
(A_eigvals, A_eigvecs, B_eigvals, B_eigvecs, A_kron_B_eigvals, A_kron_B_eigvecs) = exp[tenParamStr]
max_A_eigpair, was_updated = update_max(A_eigvals, A_eigvecs,max_A_eigpair)
if was_updated:
algorithm_chosen[0] = alg_idx
max_B_eigpair, was_updated = update_max(B_eigvals, B_eigvecs,max_B_eigpair)
if was_updated:
algorithm_chosen[1] = alg_idx
max_A_kron_B_eigpair, was_updated = update_max(A_kron_B_eigvals, A_kron_B_eigvecs, max_A_kron_B_eigpair)
if was_updated:
algorithm_chosen[2] = alg_idx
algorithm_with_best_results.append(algorithm_chosen)
dominant_eigenpairs.append([max_A_eigpair,max_B_eigpair,max_A_kron_B_eigpair])
lmd_diff = []
subspace_angle = []
for i,((A_eigpair,B_eigpair,A_kron_B_eigpair),file) in enumerate(zip(dominant_eigenpairs,eigenpairs_found[0].keys())):
(A_val,A_vec) = A_eigpair
(B_val,B_vec) = B_eigpair
(A_kron_B_val,A_kron_B_vec) = A_kron_B_eigpair
lmd_diff.append((A_val*B_val-A_kron_B_val)/A_kron_B_val)
subspace_angle.append(1-abs(np.dot(np.kron(B_vec,A_vec),A_kron_B_vec)))
print(f"{file}: diff:{lmd_diff[-1]} angle:{subspace_angle[-1]} ARST_codes:{AReigST_codes[i]}")
#
# Plotting Subroutines
#
def make_violin_plot(ax,data,precision=2,c=None,v_alpha=.8,format="default",xlim=None,xscale="linear",column_type=None):
if xscale=="linear":
v = ax.violinplot(data,[.5], points=100, showmeans=False,widths=.15,
showextrema=False, showmedians=True,vert=False)#,quantiles=[[.2,.8]]*len(data2))
elif xscale=="log":
v = ax.violinplot(np.log10(data),[.5], points=100, showmeans=False,widths=.15,showextrema=False, showmedians=True,vert=False)#,quantiles=[[.2,.8]]*len(data2))
else:
raise ValueError(f"supports xscale values: 'linear' & 'log'; Got {xscale}.")
# -- update median lines to have a gap -- #
((x0,y0),(_,y1)) = v["cmedians"].get_segments()[0]
newMedianLines = [[(x0,y1),(x0,y1+.7)]]
v["cmedians"].set_segments(newMedianLines)
# -- place extremal markers underneath
extremal_tick_ypos = .25
# -- write data values as text
bbox = dict(boxstyle="round", ec="w", fc="w", alpha=.7,pad=.01)
if column_type is None:
if format == "default":
ax.annotate(f"{np.median(data):.{precision}f}",xy=(.5,.4),xycoords="axes fraction",ha="center",fontsize=10).set_bbox(bbox)
ax.annotate(f"{np.min(data):.{precision}f}",xy=(.075,extremal_tick_ypos),xycoords="axes fraction",ha="left",fontsize=8,alpha=.8).set_bbox(bbox)
ax.annotate(f"{np.max(data):.{precision}f}",xy=(.925,extremal_tick_ypos),xycoords="axes fraction",ha="right",fontsize=8,alpha=.8).set_bbox(bbox)
elif format == "scientific":
ax.annotate(f"{np.median(data):.{precision}e}",xy=(.5,.4),xycoords="axes fraction",ha="center",fontsize=10).set_bbox(bbox)
ax.annotate(f"{np.min(data):.{precision}e}",xy=(.025,extremal_tick_ypos),xycoords="axes fraction",ha="left",fontsize=8,alpha=.8).set_bbox(bbox)
ax.annotate(f"{np.max(data):.{precision}e}",xy=(.925,extremal_tick_ypos),xycoords="axes fraction",ha="right",fontsize=8,alpha=.8).set_bbox(bbox)
else:
print(f"expecting format to be either 'default' or 'scientific', got:{format}")
elif column_type == "merged_axis":
pass
else:
raise ValueError("column_type expecting 'merged_axis' or None, but got {column_type}\n")
if c is not None:
v["cmedians"].set_color(c)
v["cmedians"].set_alpha(.75)
for b in v['bodies']:
# set colors
b.set_facecolor("None")
b.set_edgecolor(c)
b.set_alpha(v_alpha)
# -- only plot the top half of violin plot -- #
m = np.mean(b.get_paths()[0].vertices[:, 1])
b.get_paths()[0].vertices[:, 1] = np.clip(b.get_paths()[0].vertices[:, 1],m, np.inf)
# -- clip the top of the med-line to the top of the violin plot -- #
def clip_to_top_of_violin(segment):
med_line_x = segment.get_paths()[0].vertices[0, 0]
# find the y-vals of the violin plots near the med-lines
distances = [abs(p[0]- med_line_x) for p in b.get_paths()[0].vertices]
k = 5
closest_x_points = np.argpartition(distances,k)[:k]
new_max_y = np.max([b.get_paths()[0].vertices[idx,1] for idx in closest_x_points] )
segment.get_paths()[0].vertices[:, 1] = np.clip(segment.get_paths()[0].vertices[:, 1],-np.inf,new_max_y)
clip_to_top_of_violin(v["cmedians"])
def make_violin_plot_legend(ax,c="k"):
np.random.seed(12)#Ok looking:12
data = [np.random.normal() for i in range(50)]
v = ax.violinplot(data, points=100, positions=[.6], showmeans=False,
showextrema=False, showmedians=True,widths=.6,vert=False)#,quantiles=[[.2,.8]]*len(data2))
#ax.axes.set_axis_off()
ax.set_ylim(.5,1.0)
ax.patch.set_alpha(0.0)
# turn off background
# -- update median lines to have a gap -- #
((x0,y0),(_,y1)) = v["cmedians"].get_segments()[0]
newMedianLines = [[(x0,y1 +.05),(x0,1.5)]]
v["cmedians"].set_segments(newMedianLines)
ax.annotate("median",xy=(.5,.325),xycoords="axes fraction",ha="center",va="center",fontsize=10)
ax.annotate(f"min",xy=(.025,-.075),xycoords="axes fraction",ha="left",fontsize=9,alpha=.8)
ax.annotate(f"max",xy=(.975,-.075),xycoords="axes fraction",ha="right",fontsize=9,alpha=.8)
if c is not None:
v["cmedians"].set_color(c)
for b in v['bodies']:
b.set_facecolor(c)
b.set_edgecolor(c)
b.set_alpha(.3)
b.set_color(c)
m = np.mean(b.get_paths()[0].vertices[:, 1])
# modify the paths to not go further right than the center
b.get_paths()[0].vertices[:, 1] = np.clip(b.get_paths()[0].vertices[:, 1],m, np.inf)
def clip_to_top_of_violin(segment):
med_line_x = segment.get_paths()[0].vertices[0, 0]
# find the y-vals of the violin plots near the med-lines
distances = [abs(p[0]- med_line_x) for p in b.get_paths()[0].vertices]
k = 5
closest_x_points = np.argpartition(distances,k)[:k]
new_max_y = np.max([b.get_paths()[0].vertices[idx,1] for idx in closest_x_points] )
new_max_y += .02
#clip the lines
segment.get_paths()[0].vertices[:, 1] = np.clip(segment.get_paths()[0].vertices[:, 1],-np.inf,new_max_y)
clip_to_top_of_violin(v["cmedians"])
fig = plt.figure(figsize=(2.1,2))
n = 1
m = 2 # 4
gs = fig.add_gridspec(m, 1,
left=0.025, right=0.975,top=.975,bottom=.2,
wspace=.05,hspace=.1)
all_axes = np.empty(m,object)
for j in range(m):
all_axes[j] = fig.add_subplot(gs[j])
replace_zeros_with_machine_epsilon = lambda vals: [2e-16 if x == 0 else abs(x) for x in vals]
make_violin_plot(all_axes[0],replace_zeros_with_machine_epsilon(lmd_diff),xscale="log",c="k",format="scientific",precision=3)
make_violin_plot(all_axes[1],replace_zeros_with_machine_epsilon(subspace_angle),xscale="log",c="k",format="scientific",precision=3)
#
# Touch up Axes
#
legend_axis = all_axes[1].inset_axes([.2,-.5,.6,.5])
make_violin_plot_legend(legend_axis)
for ax in chain(all_axes.reshape(-1),[legend_axis]):
ax.set_xticklabels([])
ax.set_yticklabels([])
ax.tick_params(axis="both",which='major', length=0,pad=6)
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.spines['left'].set_visible(False)
ax.spines['bottom'].set_visible(False)
#for ax in all_axes:
#ax.set_ylim(.3,.8)
n = len(all_axes.reshape(-1))
for (i,ax) in zip(range(n-1,0,-1),all_axes.reshape(-1)):
ax.set_zorder(i)
all_axes[0].annotate(r"$||\lambda_B||\lambda_A| - |\lambda_{B \otimes A}||/|\lambda_{B \otimes A}|$",xy=(0.5 , 0.2), xycoords='axes fraction',ha="center",va="top",fontsize=12)
all_axes[1].annotate(r"$1-|\langle {\bf v_{B}} \otimes {\bf v_{A}},{\bf v_{B \otimes A}}\rangle|$",xy=(0.5 , 0.2), xycoords='axes fraction',ha="center",va="top",fontsize=12)
if save_path is None:
plt.show()
else:
plt.savefig(save_path)
def tensor_kronecker_product_eigenspaces_as_row(save_path=None):
#
# Data loading drivers
#
def process_AReigSTdata():
result_path = TKP_RESULTS + "AReigST/"
#
# Load data from files
#
success_codes = []
eigenvectors_found = {}
for file in os.listdir(result_path):
tensor_param_str = file.split("_results.mat")[0].split("exp_")[-1]
mat_file = scipy.io.loadmat(result_path + file)
codes = []
for key in ["info_B","info_A","info_A_kron_B"]:
codes.append(mat_file[key][0]["success"][0][0][0])
A_eigvals = mat_file["lmd_A"].reshape(-1)
B_eigvals = mat_file["lmd_B"].reshape(-1)
A_kron_B_eigvals = mat_file["lmd_A_kron_B"].reshape(-1)
A_eigvecs = mat_file["eigvec_A"]
B_eigvecs = mat_file["eigvec_B"]
A_kron_B_eigvecs = mat_file["eigvec_A_kron_B"]
eigenvectors_found[tensor_param_str] = [A_eigvals, A_eigvecs, B_eigvals, B_eigvecs, A_kron_B_eigvals, A_kron_B_eigvecs]
success_codes.append(codes)
return eigenvectors_found,success_codes
def process_NCMdata(subdirectory="NCM_sampling/"):
results_path = TKP_RESULTS +subdirectory
eigenvectors_found = {}
for file in os.listdir(results_path):
tensor_param_str = file.split("_delta:")[0].split("NCM_")[-1]
matfile_object = scipy.io.loadmat(results_path+file)
A_eigvals, A_eigvecs, _,_ = matfile_object["A_output"][0][0]
B_eigvals, B_eigvecs, _,_= matfile_object["B_output"][0][0]
A_kron_B_eigvals, A_kron_B_eigvecs, _,_ = matfile_object["A_kron_B_output"][0][0]
A_eigvecs = np.transpose(A_eigvecs)
B_eigvecs = np.transpose(B_eigvecs)
A_kron_B_eigvecs = np.transpose(A_kron_B_eigvecs)
A_eigvals = A_eigvals.reshape(-1)
B_eigvals = B_eigvals.reshape(-1)
A_kron_B_eigvals = A_kron_B_eigvals.reshape(-1)
eigenvectors_found[tensor_param_str] = [A_eigvals, A_eigvecs, B_eigvals, B_eigvecs, A_kron_B_eigvals, A_kron_B_eigvecs]
return eigenvectors_found
AReigST_codes = process_AReigSTdata()[1]
eigenpairs_found = [
process_AReigSTdata()[0],
process_NCMdata(subdirectory="NCM_sampling/"),
process_NCMdata(subdirectory="ONCM_sampling/"),
]
#return eigenpairs_found
#
# Consolidate the eigevectors found for each tensor
#
def update_max(eigvals,eigvec,curr_eigpair):
# curr_eigpair::(eigval,eigvec)
vals = abs(eigvals)
idx = np.argmax(vals)
#print(vals)
lmd = vals[idx]
if lmd > curr_eigpair[0]:
return (lmd,eigvec[idx,:]), True
else:
return curr_eigpair, False
dominant_eigenpairs = []
algorithm_with_best_results = []
for tenParamStr in eigenpairs_found[0].keys():
max_A_eigpair = (-np.Inf,[])
max_B_eigpair = (-np.Inf,[])
max_A_kron_B_eigpair = (-np.Inf,[])
algorithm_chosen = [-1,-1,-1]
# 3 entries for A,B,A_kron_B
for alg_idx,exp in enumerate(eigenpairs_found):
(A_eigvals, A_eigvecs, B_eigvals, B_eigvecs, A_kron_B_eigvals, A_kron_B_eigvecs) = exp[tenParamStr]
max_A_eigpair, was_updated = update_max(A_eigvals, A_eigvecs,max_A_eigpair)
if was_updated:
algorithm_chosen[0] = alg_idx
max_B_eigpair, was_updated = update_max(B_eigvals, B_eigvecs,max_B_eigpair)
if was_updated:
algorithm_chosen[1] = alg_idx
max_A_kron_B_eigpair, was_updated = update_max(A_kron_B_eigvals, A_kron_B_eigvecs, max_A_kron_B_eigpair)
if was_updated:
algorithm_chosen[2] = alg_idx
algorithm_with_best_results.append(algorithm_chosen)
dominant_eigenpairs.append([max_A_eigpair,max_B_eigpair,max_A_kron_B_eigpair])
lmd_diff = []
subspace_angle = []
for i,((A_eigpair,B_eigpair,A_kron_B_eigpair),file) in enumerate(zip(dominant_eigenpairs,eigenpairs_found[0].keys())):
(A_val,A_vec) = A_eigpair
(B_val,B_vec) = B_eigpair
(A_kron_B_val,A_kron_B_vec) = A_kron_B_eigpair
lmd_diff.append((A_val*B_val-A_kron_B_val)/A_kron_B_val)
subspace_angle.append(1-abs(np.dot(np.kron(B_vec,A_vec),A_kron_B_vec)))
print(f"{file}: diff:{lmd_diff[-1]} angle:{subspace_angle[-1]} ARST_codes:{AReigST_codes[i]}")
#
# Plotting Subroutines
#
def make_violin_plot(ax,data,precision=2,c=None,v_alpha=.3,format="default",xlim=None,xscale="linear",column_type=None):
if xscale=="linear":
v = ax.violinplot(data,[.5], points=100, showmeans=False,widths=.15,
showextrema=False, showmedians=True,vert=False)#,quantiles=[[.2,.8]]*len(data2))
elif xscale=="log":
v = ax.violinplot(np.log10(data),[.5], points=100, showmeans=False,widths=.15,showextrema=False, showmedians=True,vert=False)#,quantiles=[[.2,.8]]*len(data2))
else:
raise ValueError(f"supports xscale values: 'linear' & 'log'; Got {xscale}.")
# -- update median lines to have a gap -- #
((x0,y0),(_,y1)) = v["cmedians"].get_segments()[0]
newMedianLines = [[(x0,y1-.01),(x0,y1+.7)]]
v["cmedians"].set_segments(newMedianLines)
# -- place extremal markers underneath
extremal_tick_ypos = .25
# -- write data values as text
bbox = dict(boxstyle="round", ec="w", fc="w", alpha=.7,pad=.01)
if column_type is None:
if format == "default":
ax.annotate(f"{np.median(data):.{precision}f}",xy=(.5,.375),xycoords="axes fraction",ha="center",fontsize=10).set_bbox(bbox)
ax.annotate(f"{np.min(data):.{precision}f}",xy=(.075,extremal_tick_ypos),xycoords="axes fraction",ha="left",fontsize=8,alpha=.8).set_bbox(bbox)
ax.annotate(f"{np.max(data):.{precision}f}",xy=(.975,extremal_tick_ypos),xycoords="axes fraction",ha="right",fontsize=8,alpha=.8).set_bbox(bbox)
elif format == "scientific":
ax.annotate(f"{np.median(data):.{precision}e}",xy=(.5,.375),xycoords="axes fraction",ha="center",fontsize=10).set_bbox(bbox)
ax.annotate(f"{np.min(data):.{precision}e}",xy=(.025,extremal_tick_ypos),xycoords="axes fraction",ha="left",fontsize=8,alpha=.8).set_bbox(bbox)
ax.annotate(f"{np.max(data):.{precision}e}",xy=(.975,extremal_tick_ypos),xycoords="axes fraction",ha="right",fontsize=8,alpha=.8).set_bbox(bbox)
else:
print(f"expecting format to be either 'default' or 'scientific', got:{format}")
elif column_type == "merged_axis":
pass
else:
raise ValueError("column_type expecting 'merged_axis' or None, but got {column_type}\n")
if c is not None:
v["cmedians"].set_color(c)
v["cmedians"].set_alpha(.75)
for b in v['bodies']:
# set colors
b.set_facecolor(c)
b.set_edgecolor("None")
b.set_alpha(.3)
# -- only plot the top half of violin plot -- #
m = np.mean(b.get_paths()[0].vertices[:, 1])
b.get_paths()[0].vertices[:, 1] = np.clip(b.get_paths()[0].vertices[:, 1],m, np.inf)
# -- clip the top of the med-line to the top of the violin plot -- #
def clip_to_top_of_violin(segment):
med_line_x = segment.get_paths()[0].vertices[0, 0]
# find the y-vals of the violin plots near the med-lines
distances = [abs(p[0]- med_line_x) for p in b.get_paths()[0].vertices]
k = 5
closest_x_points = np.argpartition(distances,k)[:k]
new_max_y = np.max([b.get_paths()[0].vertices[idx,1] for idx in closest_x_points] )
segment.get_paths()[0].vertices[:, 1] = np.clip(segment.get_paths()[0].vertices[:, 1],-np.inf,new_max_y)
clip_to_top_of_violin(v["cmedians"])
def make_violin_plot_legend(ax,c="k"):
np.random.seed(12)#Ok looking:12
data = [np.random.normal() for i in range(50)]
v = ax.violinplot(data, points=100, positions=[.6], showmeans=False,
showextrema=False, showmedians=True,widths=.6,vert=False)#,quantiles=[[.2,.8]]*len(data2))
#ax.axes.set_axis_off()
ax.set_ylim(.5,1.0)
ax.patch.set_alpha(0.0)
# turn off background
# -- update median lines to have a gap -- #
((x0,y0),(_,y1)) = v["cmedians"].get_segments()[0]
newMedianLines = [[(x0,y1 +.05),(x0,1.5)]]
v["cmedians"].set_segments(newMedianLines)
ax.annotate("median",xy=(.5,.325),xycoords="axes fraction",ha="center",va="center",fontsize=10)
ax.annotate(f"min",xy=(.025,-.075),xycoords="axes fraction",ha="left",fontsize=9,alpha=.8)
ax.annotate(f"max",xy=(.975,-.075),xycoords="axes fraction",ha="right",fontsize=9,alpha=.8)
if c is not None:
v["cmedians"].set_color(c)
for b in v['bodies']:
b.set_facecolor(c)
b.set_edgecolor("None")
b.set_alpha(.3)
#b.set_color(c)
m = np.mean(b.get_paths()[0].vertices[:, 1])
# modify the paths to not go further right than the center
b.get_paths()[0].vertices[:, 1] = np.clip(b.get_paths()[0].vertices[:, 1],m, np.inf)
def clip_to_top_of_violin(segment):
med_line_x = segment.get_paths()[0].vertices[0, 0]
# find the y-vals of the violin plots near the med-lines
distances = [abs(p[0]- med_line_x) for p in b.get_paths()[0].vertices]
k = 5
closest_x_points = np.argpartition(distances,k)[:k]
new_max_y = np.max([b.get_paths()[0].vertices[idx,1] for idx in closest_x_points] )
new_max_y += .02
#clip the lines
segment.get_paths()[0].vertices[:, 1] = np.clip(segment.get_paths()[0].vertices[:, 1],-np.inf,new_max_y)
clip_to_top_of_violin(v["cmedians"])
fig = plt.figure(figsize=(5.75,1))
n = 1
m = 2 # 4
gs = fig.add_gridspec(1, m,
left=0.2, right=0.975,top=.975,bottom=.05,
wspace=.025,hspace=.1)
all_axes = np.empty(m,object)
for j in range(m):
all_axes[j] = fig.add_subplot(gs[j])
replace_zeros_with_machine_epsilon = lambda vals: [2e-16 if x == 0 else abs(x) for x in vals]
make_violin_plot(all_axes[0],replace_zeros_with_machine_epsilon(lmd_diff),xscale="log",c="k",v_alpha=.3,format="scientific",precision=3)
make_violin_plot(all_axes[1],replace_zeros_with_machine_epsilon(subspace_angle),xscale="log",c="k",v_alpha=.3,format="scientific",precision=3)
#
# Touch up Axes
#
legend_axis = all_axes[0].inset_axes([-0.45,.3,.4,.5])
make_violin_plot_legend(legend_axis)
for ax in chain(all_axes.reshape(-1),[legend_axis]):
ax.set_xticklabels([])
ax.set_yticklabels([])
ax.tick_params(axis="both",which='major', length=0,pad=6)
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.spines['left'].set_visible(False)
ax.spines['bottom'].set_visible(False)
#for ax in all_axes:
#ax.set_ylim(.3,.8)
n = len(all_axes.reshape(-1))
for (i,ax) in zip(range(n-1,0,-1),all_axes.reshape(-1)):
ax.set_zorder(i)
all_axes[0].annotate(r"$||\lambda_B||\lambda_A| - |\lambda_{B \otimes A}||/|\lambda_{B \otimes A}|$",xy=(0.5 , 0.2), xycoords='axes fraction',ha="center",va="top",fontsize=12)
all_axes[1].annotate(r"$1-|\langle {\bf v_{B}} \otimes {\bf v_{A}},{\bf v_{B \otimes A}}\rangle|$",xy=(0.5 , 0.2), xycoords='axes fraction',ha="center",va="top",fontsize=12)
if save_path is None:
plt.show()
else:
plt.savefig(save_path)
#
# TAME Low Rank Structure + Scaling
#
def TAME_vs_LRTAME_rank_1_case_singular_values(save_path=None):
f = plt.figure(figsize=(7,3))
gs = f.add_gridspec(nrows=1, ncols=3, left=0.05, right=0.975,wspace=0.3,hspace=0.1,top=.975,bottom=.175)
all_ax = np.empty(3,object)
for i in range(3):
all_ax[i] = f.add_subplot(gs[i])
TAME_LVGNA_rank_1_case_singular_values(all_ax[0])
TAME_RandomGeometric_rank_1_singular_values_v2(all_ax[1],noiseModel="dupNoise")
TAME_RandomGeometric_rank_1_singular_values_v2(all_ax[2],noiseModel="ERNoise")
#
# Tweak Axis Details
#
all_ax[0].set_ylabel(r"$\sigma_2$",fontsize=14,labelpad=-5)
for ax in all_ax[:2]:
ax.annotate(r"$\epsilon$", xy=(1.125, .05), xycoords='axes fraction', c=purple_c,fontsize=12)
for ax in all_ax:
ax.set_ylim(5e-17,1e-7)
ax.set_yticks([1e-16,1e-14,1e-12,1e-10,1e-08])
ax.tick_params(axis="both",which='major', length=0,pad=6)
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.spines['left'].set_visible(False)
ax.spines['bottom'].set_visible(False)
all_ax[0].set_yticklabels([])
all_ax[0].set_xlim(2e5,4e11)
for ax in all_ax[1:]:
ax.set_xlim(3e5,3e11)
ax.set_yticklabels(["",1e-14,1e-12,1e-10,1e-8])
ax.set_xticks([1e6,1e7,1e8,1e9,1e10,1e11])
title_size = 12
x_loc = .125
all_ax[0].annotate("LVGNA",xy=(x_loc,.875), xycoords='axes fraction',ha="left",va="top",fontsize=title_size)
all_ax[1].annotate("Duplication\nNoise",xy=(x_loc,.875), xycoords='axes fraction',ha="left",va="top",fontsize=title_size)
all_ax[2].annotate(u"Erdős Rényi"+"\nNoise",xy=(x_loc,.875), xycoords='axes fraction',ha="left",va="top",fontsize=title_size)
if save_path is None:
plt.show()
else:
plt.savefig(save_path)
# - LRTAME has more accurate singular values for Triangle Adjancency tensors - #
def TAME_LVGNA_rank_1_case_singular_values(ax=None):
datapath = TAME_RESULTS + "rank1_singular_values/"
with open(datapath + "TAME_LVGNA_iter_30_no_match_tol_1e-12.json","r") as f:
TAME_data = json.load(f)
TAME_data= TAME_data[-1]
with open(datapath + "LowRankTAME_LVGNA_iter_30_no_match_tol_1e-12.json","r") as f:
LowRankTAME_data = json.load(f)
LowRankTAME_data = LowRankTAME_data[-1]
showFig = False
if ax is None:
f = plt.figure(figsize=(3,3))
ax = plt.gca()
showFig = True
def process_data(data):
nonzero_second_largest_sing_vals = []
zero_second_largest_sing_vals = []
nonzero_vertex_products = []
zero_vertex_products = []
nonzero_triangle_products = []
zero_triangle_products = []
for file_A,file_B,_,_,profile in data:
graph_A = " ".join(file_A.split(".ssten")[0].split("_"))
graph_B = " ".join(file_B.split(".ssten")[0].split("_"))
profile_dict = profile[0][-1]
#normalize the singular values
for s in profile_dict["sing_vals"]:
total = sum(s)
s[:] = [s_i/total for s_i in s]
#max_rank = int(max(profile_dict["ranks"]))
#sing_vals = [s[1] if len(s) > 1 else 2e-16 for s in profile_dict["sing_vals"]
sing_vals = [(i,s[1]) if len(s) > 1 else (i,2e-16) for (i,s) in enumerate(profile_dict["sing_vals"])]
#find max sing val, and check iterates rank
i,sing2_val = max(sing_vals,key=lambda x:x[1])
rank = profile_dict["ranks"][i]
if rank > 1:
#if max_rank > 1.0:
nonzero_second_largest_sing_vals.append(sing2_val)
nonzero_vertex_products.append(vertex_counts[graph_A]*vertex_counts[graph_B])
nonzero_triangle_products.append(triangle_counts[graph_A]*triangle_counts[graph_B])
else:
zero_second_largest_sing_vals.append(sing2_val)
zero_vertex_products.append(vertex_counts[graph_A]*vertex_counts[graph_B])
zero_triangle_products.append(triangle_counts[graph_A]*triangle_counts[graph_B])
return nonzero_second_largest_sing_vals, nonzero_vertex_products, nonzero_triangle_products, zero_second_largest_sing_vals, zero_vertex_products, zero_triangle_products
TAME_nonzero_second_largest_sing_vals, TAME_nonzero_vertex_products, \
TAME_nonzero_triangle_products, TAME_zero_second_largest_sing_vals,\
TAME_zero_vertex_products, TAME_zero_triangle_products = process_data(TAME_data)
LowRankTAME_nonzero_second_largest_sing_vals, LowRankTAME_nonzero_vertex_products, \
LowRankTAME_nonzero_triangle_products, LowRankTAME_zero_second_largest_sing_vals,\
LowRankTAME_zero_vertex_products, LowRankTAME_zero_triangle_products = process_data(LowRankTAME_data)
ax.set_yscale("log")
ax.grid(which="major", axis="both")
if showFig:
ax.annotate(r"$\epsilon$", xy=(1.06, .02), xycoords='axes fraction', c=purple_c)
ax.set_ylabel(r"$\sigma_2$")
ax.set_ylim(1e-16,1e-7)
ax.annotate("TAME", xy=(.6,.55),xycoords='axes fraction',fontsize=12,c=T_color)
ax.annotate("LowRankTAME", xy=(.2,.1),xycoords='axes fraction',fontsize=12,c=LRT_color)
ax.set_xlabel(r"|$T_A$||$T_B$|")
ax.set_yscale("log")
ax.set_xscale("log")
#scatter plot formatting
marker_size = 25
marker_alpha = .5
ax.scatter(TAME_nonzero_triangle_products,TAME_nonzero_second_largest_sing_vals,marker='o',c=T_color,s=marker_size,alpha=marker_alpha)
ax.scatter(TAME_zero_triangle_products,TAME_zero_second_largest_sing_vals,facecolors='none',edgecolors=T_color,s=marker_size)
#plot machine epsilon
ax.plot([1e5,1e13],[2e-16]*2,c=purple_c,zorder=1)
ax.scatter(LowRankTAME_nonzero_triangle_products,LowRankTAME_nonzero_second_largest_sing_vals,marker='o', c=LRT_color,s=marker_size,alpha=marker_alpha)
scatter = ax.scatter(LowRankTAME_zero_triangle_products,LowRankTAME_zero_second_largest_sing_vals,facecolors='none',edgecolors=LRT_color,s=marker_size,zorder=2)
ax.set_xlim(7e4,1e12)
ax.set_xticks([1e6,1e7,1e8,1e9,1e10,1e11])
if showFig:
plt.show()
#Shows the noise introduced by the TAME routine by considering second largest
# singular values in the rank 1 case (alpha=1.0, beta =0.0), plots againts both
# |V_A||V_B| and |T_A||T_B| for comparison. Data plotted for RandomGeometric Graphs
# degreedist = LogNormal(5,1).
def TAME_RandomGeometric_rank_1_case_singular_values(axes=None):
"""
Note: This an old figure
"""
if axes is None:
f,axes = plt.subplots(1,1,dpi=60)
f.set_size_inches(3, 3)
with open(TAME_RESULTS + "Rank1SingularValues/LowRankTAME_RandomGeometric_log5_iter_30_n_100_20K_no_match_tol_1e-12.json","r") as f:
LowRankTAME_data = json.load(f)
with open(TAME_RESULTS + "Rank1SingularValues/TAME_RandomGeometric_degreedist:log5_alphas:[1.0]_betas:[0.0]_iter:30_trials:10_n:[1e2,5e2,1e3,2e3,5e3,1e4,2e4]_no_match_tol:1e-12.json","r") as f:
TAME_data = json.load(f)
def process_RandomGeometricResults(data):
nonzero_second_largest_sing_vals = []
zero_second_largest_sing_vals = []
nonzero_vertex_products = []
zero_vertex_products = []
nonzero_triangle_products = []
zero_triangle_products = []
n_values = set()
for p,seed,p_remove,n,_,max_tris,profiles in data:
n_values.add(n)
params, profile_dict = profiles[0] #should only be alpha = 1.0, beta = 0.0
#normalize the singular values
for s in profile_dict["sing_vals"]:
s = [0.0 if x is None else x for x in s]
#saving to json seems to introduce Nones when reading from saved Julia files
total = sum(s)
s[:] = [s_i/total for s_i in s]
#max_rank = int(max(profile_dict["ranks"]))
sing_vals = [(i,s[1]) if len(s) > 1 else (i,2e-16) for (i,s) in enumerate(profile_dict["sing_vals"])]
#find max sing val, and check iterates rank
i,sing2_val = max(sing_vals,key=lambda x:x[1])
rank = profile_dict["ranks"][i]
if rank > 1:
#print([sum(s) for s in profile_dict["sing_vals"]])
nonzero_second_largest_sing_vals.append(sing2_val)
nonzero_vertex_products.append(n**2)
nonzero_triangle_products.append(max_tris**2)
#TODO: need to use seed to compute actual triangle counts
else:
zero_second_largest_sing_vals.append(sing2_val)
zero_vertex_products.append(n**2)
zero_triangle_products.append(max_tris**2)
return n_values, nonzero_second_largest_sing_vals, nonzero_vertex_products, nonzero_triangle_products, zero_second_largest_sing_vals, zero_vertex_products, zero_triangle_products
n_values, LowRankTAME_nonzero_second_largest_sing_vals, LowRankTAME_nonzero_vertex_products,\
LowRankTAME_nonzero_triangle_products, LowRankTAME_zero_second_largest_sing_vals,\
LowRankTAME_zero_vertex_products, LowRankTAME_zero_triangle_products =\
process_RandomGeometricResults(LowRankTAME_data)
_, TAME_nonzero_second_largest_sing_vals, TAME_nonzero_vertex_products,\
TAME_nonzero_triangle_products, TAME_zero_second_largest_sing_vals,\
TAME_zero_vertex_products, TAME_zero_triangle_products =\
process_RandomGeometricResults(TAME_data)
#
# Make Triangle_Triangle plots
#
ax = axes
#ax = plt.subplot(122)
#format the axis
ax.set_yscale("log")
ax.grid(which="major", axis="y")
#ax.set_ylabel(r"max $\sigma_2")
#ax.set_ylabel(r"max [$\sum_{i=2}^k\sigma_i]")
#ax.yaxis.set_ticks_position('right')
#ax.tick_params(labeltop=False, labelright=True)
ax.set_xlabel(r"|$T_A$||$T_B$|")
ax.set_yscale("log")
ax.set_xscale("log")
ax.set_xlim(3e5,7e11)
ax.set_xticks([1e7,1e8,1e11])
#ax.set_ylim(1e-16,1e-7)
ax.annotate(r"$\epsilon$", xy=(1.06, .02), xycoords='axes fraction', c=purple_c)
ax.set_ylabel(r"$\sigma_2$")
#scatter plot formatting
marker_size = 20
marker_alpha = 1.0
#plot the TAME Data
"""
plt.scatter(TAME_nonzero_triangle_products,TAME_nonzero_second_largest_sing_vals,marker='o',c=darker_t4_color,s=marker_size)
plt.scatter(TAME_zero_triangle_products,TAME_zero_second_largest_sing_vals,facecolors='none',edgecolors=darker_t4_color,s=marker_size)
"""
#plot machine epsilon
plt.plot([3e5,7e11],[2e-16]*2,c=purple_c,zorder=1)
#plot LowRankTAME Data
plt.scatter(LowRankTAME_nonzero_triangle_products,LowRankTAME_nonzero_second_largest_sing_vals,marker='o', c=LRT_color,s=marker_size,zorder=2)
plt.scatter(LowRankTAME_zero_triangle_products,LowRankTAME_zero_second_largest_sing_vals,facecolors='none',edgecolors=LRT_color,s=marker_size,zorder=2)
#plot TAME Data
plt.scatter(TAME_nonzero_triangle_products,TAME_nonzero_second_largest_sing_vals,marker='o', c=T_color,s=marker_size,zorder=3)
plt.scatter(TAME_zero_triangle_products,TAME_zero_second_largest_sing_vals,facecolors='none',edgecolors=T_color,s=marker_size,zorder=3)
axins = ax.inset_axes([.6,.15,.25,.25]) # zoom = 6
axins.scatter(TAME_nonzero_triangle_products,TAME_nonzero_second_largest_sing_vals,marker='o', c=T_color,s=marker_size)
axins.scatter(TAME_zero_triangle_products,TAME_zero_second_largest_sing_vals,facecolors='none',edgecolors=T_color,s=marker_size)
# sub region of the original image
#axins.set_xlim(9e9, 3e11)
axins.set_xlim(4e9, 1e10)
axins.set_ylim(5e-13, 1.5e-12)
axins.set_xscale("log")
axins.set_yscale("log")
axins.set_xticks([])
axins.minorticks_off()
axins.set_yticks([])
mark_inset(ax, axins, loc1=3, loc2=1, fc="none", ec="0.5",alpha=.5,zorder=1)
#axins.tick_params(labelleft=False, labelbottom=False)
#axins.set_yticks([])
"""
axins.set_xticklabels([])
axins.set_yticklabels([])
"""
#TODO: combining plots, potentially remove later
plt.tight_layout()
plt.show()
def TAME_data_extraction():
results_path = TAME_RESULTS + "MaxRankExperiments/"
T_file = "TAME_noMatch_RandomGeometric_degreedist:LogNormal_alpha:[0.5,1.0]_beta:[0.0,1.0,10.0,100.0]_n:[100,500,1000,2000,5000,10000]_p:[0.5]_noiseModel:Duplication_sp:[0.25]_trials:50_MaxRankResults.json"
new_data = []
new_file = "TAME_noMatch_RandomGeometric_degreedist:LogNormal_alpha:[1.0]_beta:[0.0]_n:[100,500,1000,2000,5000,10000]_p:[0.5]_noiseModel:Duplication_sp:[0.25]_trials:50_MaxRankResults.json"
with open(results_path+T_file,"r") as f:
TAME_data = json.load(f)
for (seed,p,n,sp,acc,dw_acc,tri_match,A_tri,B_tri,max_tris,profiles) in TAME_data:
new_profiles = []
for (param, profiling) in profiles:
if param == "α:1.0_β:0.0":
new_profiles.append([param, profiling])
new_data.append((seed,p,n,sp,acc,dw_acc,tri_match,A_tri,B_tri,max_tris,new_profiles))
with open(results_path+new_file,"w") as f:
json.dump(new_data,f)
return new_data
def TAME_RandomGeometric_rank_1_singular_values_v2(ax=None,noiseModel="dupNoise"):
showFig=False
if ax is None:
f = plt.figure(dpi=60)
ax = plt.gca()
f.set_size_inches(3, 4)
showFig=True
#
# Load the Data
#
results_path = TAME_RESULTS + "MaxRankExperiments/"
results_path = TAME_RESULTS + "TAME_iterate_max_rank/"
def process_data(data):
nonzero_second_largest_sing_vals = []
zero_second_largest_sing_vals = []
nonzero_vertex_products = []
zero_vertex_products = []
nonzero_triangle_products = []
zero_triangle_products = []
n_values = set()
for datum in data:
if noiseModel == "dupNoise":
(seed,p,n,sp,acc,dw_acc,tri_match,A_tri,B_tri,max_tris,profiles) = datum
elif noiseModel == "ERNoise":
(seed,p,n,acc,dw_acc,tri_match,A_tri,B_tri,max_tris,profiles) = datum
for (params, profile_dict) in profiles:
if params == "α:1.0_β:0.0":
#normalize the singular values
for s in profile_dict["sing_vals"]:
s = [0.0 if x is None else x for x in s]
#saving to json seems to introduce Nones when reading from saved Julia files
total = sum(s)
s[:] = [s_i/total for s_i in s]
sing_vals = [(i,s[1]) if len(s) > 1 else (i,2e-16) for (i,s) in enumerate(profile_dict["sing_vals"])]
#find max sing val, and check iterates rank
i,sing2_val = max(sing_vals,key=lambda x:x[1])
rank = profile_dict["ranks"][i]
if rank > 1:
#print([sum(s) for s in profile_dict["sing_vals"]])
nonzero_second_largest_sing_vals.append(sing2_val)
nonzero_vertex_products.append(n**2)
nonzero_triangle_products.append(max_tris**2)
#TODO: need to use seed to compute actual triangle counts
else:
zero_second_largest_sing_vals.append(sing2_val)
zero_vertex_products.append(n**2)
zero_triangle_products.append(max_tris**2)
return nonzero_second_largest_sing_vals, zero_second_largest_sing_vals,\
nonzero_vertex_products, zero_vertex_products,\
nonzero_triangle_products, zero_triangle_products,\
n_values
if noiseModel == "dupNoise":
LRT_file = "LRTAME_noMatch_RandomGeometric_degreedist:LogNormal_alpha:[0.5,1.0]_beta:[0.0,1.0,10.0,100.0]_n:[100,500,1000,2000,5000,10000]_p:[0.5]_noiseModel:Duplication_sp:[0.25]_trials:50_MaxRankResults.json"
elif noiseModel == "ERNoise":
LRT_file = "LRTAME_noMatch_RandomGeometric_degreedist:LogNormal_alpha:[0.5,1.0]_beta:[0.0,1.0,10.0,100.0]_n:[100,500,1000,2000,5000,10000]_p:[0.05]_noiseModel:ER_trials:50_MaxRankResults.json"
with open(results_path + LRT_file,"r") as f:
LowRankTAME_nonzero_second_largest_sing_vals, LowRankTAME_zero_second_largest_sing_vals,\
LowRankTAME_nonzero_vertex_products, LowRankTAME_zero_vertex_products,\
LowRankTAME_nonzero_triangle_products, LowRankTAME_zero_triangle_products,\
n_values = process_data(json.load(f))
#TODO: extra out the \alpha:1.0, \beta = 0.0 case into a seperate file
#T_file = "TAME_noMatch_RandomGeometric_degreedist:LogNormal_alpha:[0.5,1.0]_beta:[0.0,1.0,10.0,100.0]_n:[100,500,1000,2000,5000,10000]_p:[0.5]_noiseModel:Duplication_sp:[0.25]_trials:50_MaxRankResults.json"
if noiseModel == "dupNoise":
T_file = "TAME_noMatch_RandomGeometric_degreedist:LogNormal_alpha:[1.0]_beta:[0.0]_n:[100,500,1000,2000,5000,10000]_p:[0.5]_noiseModel:Duplication_sp:[0.25]_trials:50_MaxRankResults.json"
elif noiseModel == "ERNoise":
T_file = "TAME_noMatch_RandomGeometric_degreedist:LogNormal_alpha:[1.0]_beta:[0.0]_n:[100,500,1000,2000,5000,10000]_p:[0.05]_noiseModel:ER_trials:50_MaxRankResults.json"
with open(results_path+T_file,"r") as f:
TAME_nonzero_second_largest_sing_vals, TAME_zero_second_largest_sing_vals,\
TAME_nonzero_vertex_products, TAME_zero_vertex_products,\
TAME_nonzero_triangle_products, TAME_zero_triangle_products,\
n_values = process_data(json.load(f))
#
# Plot the Data
#
ax.set_yscale("log")
ax.grid(which="major", axis="both")
#ax.set_ylabel(r"max $\sigma_2")
#ax.set_ylabel(r"max [$\sum_{i=2}^k\sigma_i]")
#ax.yaxis.set_ticks_position('right')
#ax.tick_params(labeltop=False, labelright=True)
ax.set_xlabel(r"|$T_A$||$T_B$|")
ax.set_yscale("log")
ax.set_xscale("log")
ax.set_xlim(3e5,3e11)
ax.set_xticks([1e7,1e8,1e11])
#ax.set_ylim(1e-16,1e-7)
if showFig:
ax.annotate(r"$\epsilon$", xy=(1.06, .02), xycoords='axes fraction', c=purple_c)
ax.set_ylabel(r"$\sigma_2$")
#scatter plot formatting
marker_size = 25
marker_alpha = .2
#plot the TAME Data
"""
plt.scatter(TAME_nonzero_triangle_products,TAME_nonzero_second_largest_sing_vals,marker='o',c=darker_t4_color,s=marker_size)
plt.scatter(TAME_zero_triangle_products,TAME_zero_second_largest_sing_vals,facecolors='none',edgecolors=darker_t4_color,s=marker_size)
"""
#plot machine epsilon
ax.plot([3e5,7e11],[2e-16]*2,c=purple_c,zorder=1)
#plot LowRankTAME Data
ax.scatter(LowRankTAME_nonzero_triangle_products,LowRankTAME_nonzero_second_largest_sing_vals,marker='o', c=LRT_color,s=marker_size,zorder=2,alpha=marker_alpha)
ax.scatter(LowRankTAME_zero_triangle_products,LowRankTAME_zero_second_largest_sing_vals,facecolors='none',edgecolors=LRT_color,s=marker_size,zorder=2)
#plot TAME Data
ax.scatter(TAME_nonzero_triangle_products,TAME_nonzero_second_largest_sing_vals,marker="o", c=T_color,s=marker_size,zorder=3,alpha=marker_alpha)
ax.scatter(TAME_zero_triangle_products,TAME_zero_second_largest_sing_vals,marker="o",facecolors='none',edgecolors=T_color,s=marker_size,zorder=3)
#
# Add in inset axes
#
"""
axin_axes = []
if noiseModel == "dupNoise":
box_parameters = [
([.4,.125,.125,.2],(9e7, 4.5e8),(1e-13, 8e-13)),
([.525,.125,.125,.2],(7e8, 2e9),(3e-13, 1e-12)),
([.65,.125,.125,.2],(4e9, 8.5e9),(5e-13, 1.5e-12)),
([.775,.125,.125,.2],(2e10, 4e10),(6e-13, 3e-12)),
]
else:
box_parameters = [
([.4,.125,.125,.2],(2e8, 2e9),(5e-13, 1e-12)),
([.525,.125,.125,.2],(8e8, 2e9),(3e-13, 1e-12)),
([.65,.125,.125,.2],(6e9, 1e10),(8e-13, 2e-12)),
([.775,.125,.125,.2],(2e10, 5e10),(9.5e-13, 3.5e-12)),
]
for (axin_loc,xlims,ylims) in box_parameters:
axins = ax.inset_axes(axin_loc) # zoom = 6
axin_axes.append(axins)
axins.scatter(TAME_nonzero_triangle_products,TAME_nonzero_second_largest_sing_vals,marker='o', c=T_color,s=marker_size,alpha=marker_alpha)
axins.scatter(TAME_zero_triangle_products,TAME_zero_second_largest_sing_vals,facecolors='none',edgecolors=T_color,s=marker_size)
# sub region of the original image
#axins.set_xlim(9e9, 3e11)
axins.set_xlim(*xlims)
axins.set_ylim(*ylims)
axins.set_xscale("log")
axins.set_yscale("log")
axins.set_xticks([])
axins.minorticks_off()
axins.set_yticks([])
mark_inset(ax, axins, loc1=3, loc2=1, fc="none", ec="0.5",alpha=.5,zorder=1)
"""
"""
if noiseModel == "dupNoise":
axins = ax.inset_axes([.3,.1,.4,.2])
else:
axins = ax.inset_axes([.6,.15,.25,.25])
axins.scatter(TAME_nonzero_triangle_products,TAME_nonzero_second_largest_sing_vals,marker='o', c=T_color,s=marker_size)
axins.scatter(TAME_zero_triangle_products,TAME_zero_second_largest_sing_vals,facecolors='none',edgecolors=T_color,s=marker_size)
# sub region of the original image
if noiseModel == "dupNoise":
#axins.set_xlim(9e9, 3e11)
axins.set_xlim(5e7, 1e10)
axins.set_ylim(1e-13, 1e-12)
else:
axins.set_xlim(4e9, 1e10)
axins.set_ylim(5e-13, 1.5e-12)
axins.set_xscale("log")
axins.set_yscale("log")
axins.set_xticks([])
axins.minorticks_off()
axins.set_yticks([])
mark_inset(ax, axins, loc1=3, loc2=1, fc="none", ec="0.5",alpha=.5,zorder=1)
"""
if showFig:
plt.tight_layout()
plt.show()
# - TAME iterates are low rank - #
def max_rank_experiments(save_path=None):
#f = plt.figure(dpi=60)
#f.set_size_inches(10, 4)
f = plt.figure(figsize=(5.2,5))
n = 3
m = 2
gs = f.add_gridspec(nrows=n, ncols=m, left=0.05, right=0.975,wspace=0.225,hspace=0.125,top=.975,bottom=.1)
all_ax = np.empty((n,m),object)
for i in range(n):
for j in range(m):
if j == 0:
all_ax[i,j] = f.add_subplot(gs[i,j])
else:
all_ax[i,j] = f.add_subplot(gs[i,j],sharex=all_ax[i,0])
DupNoise_data = "LRTAME_noMatch_RandomGeometric_degreedist:LogNormal_alpha:[0.5,1.0]_beta:[0.0,1.0,10.0,100.0]_n:[100,500,1000,2000,5000,10000]_p:[0.5]_noiseModel:Duplication_sp:[0.25]_trials:50_MaxRankResults.json"
ERNoise_data = "LRTAME_noMatch_RandomGeometric_degreedist:LogNormal_alpha:[0.5,1.0]_beta:[0.0,1.0,10.0,100.0]_n:[100,500,1000,2000,5000,10000]_p:[0.05]_noiseModel:ER_trials:50_MaxRankResults.json"
max_rank_synthetic_data(all_ax[0,:],ERNoise_data,"ER")
max_rank_synthetic_data(all_ax[1,:],DupNoise_data,"Duplication")
max_rank_LVGNA_data(all_ax[2,:])
checkboard_color = [.925]*3
for ax in all_ax.reshape(-1):
ax.grid(which="major", axis="both")
ax.set_xscale("log")
ax.set_xlim(1e5,1e12)
#
# -- handle tick marks -- #
#
for i,ax in enumerate(all_ax[:,1]):
ax.set_ylabel("max rank\n min{n,m}",ha="center")
#ax.set_ylabel(r"max rank/$\min{\{n,m\}}$")
ax.annotate('', xy=(-.1, .25), xycoords='axes fraction', xytext=(-.1, 0.75),
arrowprops=dict(arrowstyle="-", color='k'))
if i != 2:
tick_ha = "right"
else:
tick_ha = "left"
for tick in ax.yaxis.get_majorticklabels():
tick.set_horizontalalignment(tick_ha)
ax.tick_params(axis="y",which="both",direction="in",pad=-25)
ax.set_yscale("log")
if i != 2:
ax.set_ylim(5e-3,1.5)
else:
ax.set_ylim(5e-4,2e-1)
# -- add in Plot labels
x_loc = .85
title_size = 12
if i == 0:
ax.annotate(u"Erdős Rényi"+"\nNoise",xy=(.9,.675), xycoords='axes fraction',ha="right",fontsize=title_size)
elif i == 1:
ax.annotate("Duplication\n Noise",xy=(.9,.675), xycoords='axes fraction',ha="right",fontsize=title_size)
elif i == 2:
x_loc = .85
ax.annotate("LVGNA",xy=(x_loc,.7), xycoords='axes fraction',ha="right",fontsize=title_size)
#ax.yaxis.set_ticks_position('right')
if i != 2:
ax.tick_params(axis="x",direction="out",which='both', length=0)
#ax.set_ylabel("maximum rank")
all_ax[2,1].tick_params(labeltop=False, labelright=True)
# -- set labels -- #
for i,ax in enumerate(all_ax[:,0]):
ax.set_ylabel("max rank")
ax.set_xlim(5e4,5e11)
ax.set_xticks([1e5,1e6,1e7,1e8,1e9,1e10,1e11])
ax.tick_params(axis="y",which="both",direction="in",pad=-25)
if i != 2:
ax.set_ylim(0,320)
ax.tick_params(axis="x",direction="out",which='both', length=0)
ax.set_yticks([50,100,150,200,250,300])
ax.set_xticklabels([])
#for tl in ax.get_yticklabels():
# tl.set_bbox(bbox)
else:
ax.set_ylim(0,150)
ax.set_yticks([50,100,125])
ax.set_xticklabels([1e5,1e6,1e7,1e8,1e9,1e10,1e11])
# -- add in annotations
all_ax[2,0].xaxis.set_major_formatter(mpl.ticker.LogFormatterMathtext())
for j in range(m):
#parity = 1
for (i,ax) in enumerate(all_ax[:,j]):
parity = 1
for pos in ['left','bottom','top','right']:
ax.spines[pos].set_visible(False)
if j == 1:
ax.tick_params(axis="y",which='minor', length=0)
if i == 2:
ax.yaxis.set_ticks_position('right')
"""
if i == 0:
ax.spines['bottom'].set_visible(False)
elif i == 2:
ax.spines['top'].set_visible(False)
ax.yaxis.set_ticks_position('right')
else:
ax.spines['bottom'].set_visible(False)
ax.spines['top'].set_visible(False)
"""
if parity == -1:
all_ax[i,j].patch.set_facecolor(checkboard_color)
if parity == 1:
bbox = dict(boxstyle="round", ec="w", fc="w", alpha=1.0,pad=.1)
else:
bbox = dict(boxstyle="round", ec=checkboard_color, fc=checkboard_color, alpha=1.0,pad=.1)
for tl in ax.get_yticklabels():
tl.set_bbox(bbox)
parity *= -1
parity *= -1
for ax in all_ax[2,:]:
ax.set_xlabel(r"$|T_A||T_B|$")
ax.tick_params(axis="x",direction="out",which='both', length=0)
if save_path is None:
plt.show()
else:
plt.savefig(save_path)
def max_rank_LVGNA_data(axes,includeSampledEigShift=False):
data_path = TAME_RESULTS + "TAME_iterate_max_rank/"
with open(data_path + "LowRankTAME_LVGNA.json", 'r') as f:
MM_results = json.load(f)
MM_exp_data, param_indices,MM_file_names = process_TAME_output2(MM_results[1])
if includeSampledEigShift:
beta_100_loc = (.475, .75)
else:
beta_100_loc = (.05, .10)
label_meta = [
((.05, .35),"o",red_c,"solid"),
((.05, .575),"v",green_shift_c,"dotted"),
((.075, .75),"*",purple_c,"dashed"),
(beta_100_loc,"s",blue_c,"dashdot")
]
for (param, j),(loc,marker,c,linestyle) in zip(param_indices.items(),label_meta):
n_points = []
max_ranks = []
normalized_max_ranks = []
param_label = f"β:{int(float(param.split('β:')[-1]))}"
axes[0].annotate(param_label, xy=loc, xycoords='axes fraction',c=c)
for i in range(MM_exp_data.shape[0]):
graph_names = [str.join(" ", x.split(".ssten")[0].split("_")) for x in MM_file_names[i]]
min_n = np.min([vertex_counts[f] for f in graph_names])
tri_counts = triangle_counts[graph_names[0]]*triangle_counts[graph_names[1]]
# tri_counts = sum([triangle_counts[graph_names[0]] for f in graph_names])
n_points.append(tri_counts)
max_ranks.append(np.max(MM_exp_data[i,:,j,:]))
normalized_max_ranks.append(np.max(MM_exp_data[i,:,j,:])/min_n)
plot_1d_loess_smoothing(n_points,max_ranks,.3,axes[0],c=c)#,linestyle=linestyle
plot_1d_loess_smoothing(n_points,normalized_max_ranks,.3,axes[1],c=c,logFilter=True) #linestyle=linestyle,
if includeSampledEigShift:
(filename,color,label,loc,linestyle) = (
"LVGNAMaxEigShiftRanks_alphas:[0.5,1.0]_iter:30_SSHOPMSamples:1000_tol:1.0e-16_results.json",
[.25]*3,
"β:"+r"$\lambda_A\lambda_B$",
(-.05,.02),
(0,(3,1,1,1,1,1)))
with open(data_path + filename,"r") as f:
data = json.load(f)
tri_products = []
max_ranks = []
normalized_max_ranks = []
tri_count =lambda f: triangle_counts[str.join(" ", f.split(".ssten")[0].split("_"))]
for (graphA, graphB,shiftA,shiftB,profiles) in data:
graph_names = [str.join(" ", x.split(".ssten")[0].split("_")) for x in [graphA, graphB]]
min_n = np.min([vertex_counts[f] for f in graph_names])
tri_products.append(tri_count(graphA)*tri_count(graphB))
max_ranks.append(max([max(profile["ranks"]) for (p,profile) in profiles]))
normalized_max_ranks.append(max([max(profile["ranks"]) for (p,profile) in profiles])/min_n)
plot_1d_loess_smoothing(tri_products,max_ranks,.3,axes[0],c=color,logFilter=True) #,linestyle=linestyle
plot_1d_loess_smoothing(tri_products,normalized_max_ranks,.3,axes[1],c=color,logFilter=True)#,linestyle=linestyle
axes[0].annotate(label, xy=loc, xycoords='axes fraction',c=color)
def max_rank_synthetic_data(axes,filename,noise_model="ER"):
#with open(TAME_RESULTS + "MaxRankExperiments/","r") as f:
with open(TAME_RESULTS + "TAME_iterate_max_rank/" + filename,"r") as f:
#with open(TAME_RESULTS + "MaxRankExperiments/LowRankTAME_RandomGeometric_degreedist_log5_iter:15_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_n:[100,500,1K,2K,5K,10K,20K]_noMatching_pRemove:[.01,.05]_tol:1e-12_trialcount:50.json","r") as f:
synth_results = json.load(f)
MM_exp_data, n_vals, p_vals, param_vals, tri_counts = process_synthetic_TAME_output2(synth_results,noise_model)
print(np.mean(MM_exp_data))
#ax = axes[0]
#ax.set_xscale("log")
#ax.set_ylim(00,315)
if filename == "LRTAME_noMatch_RandomGeometric_degreedist:LogNormal_alpha:[0.5,1.0]_beta:[0.0,1.0,10.0,100.0]_n:[100,500,1000,2000,5000,10000]_p:[0.05]_noiseModel:ER_trials:50_MaxRankResults.json":
label_meta = [
((.825, .09),"o",red_c,"solid"),
((.825, .26),"v",green_shift_c,"dotted"),
((.825, .6), "*",purple_c,"dashed"),
((.825, .8), "s",blue_c,"dashdot")]
else:
label_meta = [
((.85, .11), "o",red_c,"solid"),
((.85, .25),"v",green_shift_c,"dotted"),
((.85, .55), "*",purple_c,"dashed"),
((.85, .825), "s",blue_c,"dashdot")]# no_ylim_points
#label_meta = [((.92, .25),t1_color),((.8, .51),t2_color),((.625, .8),purple_c),((.25, .88),t4_color)]
#beta=100 annotations
beta_100_meta = [(.15,.4),(.42,1.01),(.51,1.01),(.6,1.01),(.725,1.01),(.8,1.01),(.9,1.01)]
#beta=10 annotations
beta_10_meta = [(.15,.32),(.42,.515),(.51,.6),(.6,.65),(.725,.75),(.8,.95),(.9,.95)]
for ((params,k),(loc,marker,c,linestyle)) in zip(param_vals.items(),label_meta):
max_vals = []
normalized_max_vals = []
mean_tris = []
for n,j in n_vals.items():
max_vals.append(np.max(MM_exp_data[:,j,:,k,:]))
normalized_max_vals.append(np.max(MM_exp_data[:,j,:,k,:])/n)
mean_tris.append(np.mean(tri_counts[:,j,:,k]))
axes[0].plot(mean_tris,max_vals,c=c)#,linestyle=linestyle
axes[1].plot(mean_tris,normalized_max_vals,c=c)#,linestyle=linestyle
param_label = f"β:{int(float(params.split('β:')[-1]))}"
axes[0].annotate(param_label, xy=loc, xycoords='axes fraction',c=c)
# - TAME & LRTAM don't scale for larger motifs - #
def TAME_vs_LRTAME_clique_scaling_detailed(save_path=None,global_ax= None):
plt.rc('text.latex', preamble=r'\usepackage{/Users/charlie/Documents/Code/TKPExperimentPlots/latex/dgleich-math}\usepackage{amsmath}')
#
# subplot routines
#
def make_violin_plot(ax,data,precision=2,c=None,v_alpha=.3,format="default",xlim=None,xscale="linear",column_type=None):
if xscale=="linear":
v = ax.violinplot(data,[.5], points=100, showmeans=False,widths=.15,
showextrema=False, showmedians=True,vert=False)#,quantiles=[[.2,.8]]*len(data2))
elif xscale=="log":
v = ax.violinplot(np.log10(data), points=100, showmeans=False,widths=.15,showextrema=False, showmedians=True,vert=False)#,quantiles=[[.2,.8]]*len(data2))
else:
raise ValueError(f"supports xscale values: 'linear' & 'log'; Got {xscale}.")
# -- update median lines to have a gap -- #
((x0,y0),(_,y1)) = v["cmedians"].get_segments()[0]
newMedianLines = [[(x0,y1),(x0,y1+.7)]]
v["cmedians"].set_segments(newMedianLines)
# -- write data values as text
bbox = dict(boxstyle="round", ec="w", fc="w", alpha=.5,pad=.05)
extremal_tick_ypos = .1
if column_type is None:
if format == "default":
ax.annotate(f"{np.median(data):.{precision}f}",xy=(.5,.4),xycoords="axes fraction",ha="center",fontsize=10)#.set_bbox(bbox)
ax.annotate(f"{np.min(data):.{precision}f}",xy=(.075,extremal_tick_ypos),xycoords="axes fraction",ha="left",fontsize=8,alpha=.8).set_bbox(bbox)
ax.annotate(f"{np.max(data):.{precision}f}",xy=(.925,extremal_tick_ypos),xycoords="axes fraction",ha="right",fontsize=8,alpha=.8).set_bbox(bbox)
elif format == "scientific":
ax.annotate(f"{np.median(data):.{precision}e}",xy=(.5,.4),xycoords="axes fraction",ha="center",fontsize=10).set_bbox(bbox)
ax.annotate(f"{np.min(data):.{precision}e}",xy=(.025,extremal_tick_ypos),xycoords="axes fraction",ha="left",fontsize=8,alpha=.8).set_bbox(bbox)
ax.annotate(f"{np.max(data):.{precision}e}",xy=(.925,extremal_tick_ypos),xycoords="axes fraction",ha="right",fontsize=8,alpha=.8).set_bbox(bbox)
else:
print(f"expecting format to be either 'default' or 'scientific', got:{format}")
elif column_type == "merged_axis":
pass
else:
raise ValueError("column_type expecting 'merged_axis' or None, but got {column_type}\n")
if c is not None:
v["cmedians"].set_color(c)
v["cmedians"].set_alpha(.75)
for b in v['bodies']:
# set colors
b.set_facecolor(c)
b.set_edgecolor("None")
b.set_alpha(v_alpha)
# -- only plot the top half of violin plot -- #
m = np.mean(b.get_paths()[0].vertices[:, 1])
b.get_paths()[0].vertices[:, 1] = np.clip(b.get_paths()[0].vertices[:, 1],m, np.inf)
# -- clip the top of the med-line to the top of the violin plot -- #
def clip_to_top_of_violin(segment):
med_line_x = segment.get_paths()[0].vertices[0, 0]
# find the y-vals of the violin plots near the med-lines
distances = [abs(p[0]- med_line_x) for p in b.get_paths()[0].vertices]
k = 5
closest_x_points = np.argpartition(distances,k)[:k]
new_max_y = np.max([b.get_paths()[0].vertices[idx,1] for idx in closest_x_points] )
#clip the lines
segment.get_paths()[0].vertices[:, 1] = np.clip(segment.get_paths()[0].vertices[:, 1],-np.inf,new_max_y)
clip_to_top_of_violin(v["cmedians"])
def make_violin_plot_legend(ax,c="k"):
np.random.seed(12)#Ok looking:12
v = ax.violinplot([np.random.normal() for i in range(50)], points=100, positions=[.6], showmeans=False,
showextrema=False, showmedians=True,widths=.6,vert=False)#,quantiles=[[.2,.8]]*len(data2))
ax.set_ylim(.5,1.0)
# -- update median lines to have a gap -- #
((x0,y0),(_,y1)) = v["cmedians"].get_segments()[0]
newMedianLines = [[(x0,y1 +.05),(x0,1.5)]]
v["cmedians"].set_segments(newMedianLines)
ax.annotate("median",xy=(.5,.35),xycoords="axes fraction",ha="center",va="center",fontsize=10)
ax.annotate(f"min",xy=(.025,-.125),xycoords="axes fraction",ha="left",fontsize=9,alpha=.8)
ax.annotate(f"max",xy=(.975,-.125),xycoords="axes fraction",ha="right",fontsize=9,alpha=.8)
if c is not None:
v["cmedians"].set_color(c)
for b in v['bodies']:
b.set_facecolor(c)
b.set_edgecolor(c)
b.set_alpha(.3)
b.set_color(c)
m = np.mean(b.get_paths()[0].vertices[:, 1])
# modify the paths to not go further right than the center
b.get_paths()[0].vertices[:, 1] = np.clip(b.get_paths()[0].vertices[:, 1],m, np.inf)
def clip_to_top_of_violin(segment):
med_line_x = segment.get_paths()[0].vertices[0, 0]
# find the y-vals of the violin plots near the med-lines
distances = [abs(p[0]- med_line_x) for p in b.get_paths()[0].vertices]
k = 5
closest_x_points = np.argpartition(distances,k)[:k]
new_max_y = np.max([b.get_paths()[0].vertices[idx,1] for idx in closest_x_points] )
new_max_y += .02
#clip the lines
segment.get_paths()[0].vertices[:, 1] = np.clip(segment.get_paths()[0].vertices[:, 1],-np.inf,new_max_y)
clip_to_top_of_violin(v["cmedians"])
#
# Parse Data
#
results_path = TAME_RESULTS + "RG_DupNoise/"
elemwise_list_sum =lambda l1,l2: [a + b for (a,b) in zip(l1,l2)]
filename = "LowRankTAME_RandomGeometric_degreedist:LogNormal_alpha:[0.5,1.0]_beta:[0.0,1.0]_n:[100]_orders:[3,4,5,6,7,8]_p:0.5_sample:10000_sp:[0.2]_trials:25_results.json"
with open(results_path + filename,"r") as file:
data = json.load(file)
LR_results = {}
debug_results = {}
LR_seeds = {}
for (order, LRTAME_output) in data:
trials = len(LRTAME_output)
LR_results[order] = {
"full runtime":{},
"contraction runtime":{},
"A motifs":[],
"ranks":{},
}
debug_results[order] = {
"runtimes":[],
"ranks":[]
}
LR_seeds[order] = []
for trial_idx,(seed,p,n,sp,accuracy,dup_tol_accuracy,motifs_matched,A_motifs,B_motifs,A_motif_dist,B_motif_dist,profiling) in enumerate(LRTAME_output):
LR_results[order]["A motifs"].append(A_motifs)
LR_seeds[order].append(seed)
for (params,profile) in profiling:
rt = reduce(elemwise_list_sum,[
profile["low_rank_factoring_timings"],
profile["contraction_timings"],
profile["matching_timings"],
profile["scoring_timings"],
])
if params in LR_results[order]["full runtime"]:
LR_results[order]["full runtime"][params].append(rt)
else:
LR_results[order]["full runtime"][params] = [rt]
contract_rt = reduce(elemwise_list_sum,[
profile["low_rank_factoring_timings"],
profile["contraction_timings"],
])
if params in LR_results[order]["contraction runtime"]:
LR_results[order]["contraction runtime"][params].append(contract_rt)
else:
LR_results[order]["contraction runtime"][params] = [contract_rt]
if params == 'α:0.5_β:1.0':
debug_results[order]["ranks"].append(profile["ranks"])
debug_results[order]["runtimes"].append(contract_rt)
if params in LR_results[order]["ranks"]:
LR_results[order]["ranks"][params].append(profile["ranks"])
else:
LR_results[order]["ranks"][params] = [profile["ranks"]]
for key in ["contraction runtime","full runtime"]:
for (param,rts) in LR_results[order][key].items():
LR_results[order][key][param] = np.median(np.array(rts),axis=0)
def get_TAME_data():
file = "TAME_RandomGeometric_degreedist:LogNormal_alpha:[0.5,1.0]_beta:[0.0,1.0]_n:[25]_orders:[3,4,5,6,7]_p:0.5_sample:10000_sp:[0.2]_trials:25_results.json"
files = [
"TAME_RandomGeometric_degreedist:LogNormal_alpha:[0.5,1.0]_beta:[0.0,1.0]_n:[100]_orders:[3,4,5,6,7]_p:0.5_sample:10000_sp:[0.2]_trials:25_results.json",
"TAME_RandomGeometric_degreedist:LogNormal_alpha:[0.5,1.0]_beta:[0.0,1.0]_n:[100]_orders:[8]_p:0.5_sample:10000_sp:[0.2]_trials:25_results.json",
]
data = []
for file in files:
with open(results_path + file,"r") as f:
data.extend(json.load(f))
T_results = {}
for (order, TAME_output) in data:
trials = len(TAME_output)
T_results[order] = {
"contraction runtime":{},
"full runtime":{},
}
for trial_idx,(seed,p,n,sp,accuracy,dup_tol_accuracy,motifs_matched,A_motifs,B_motifs,A_motif_dist,B_motif_dist,profiling) in enumerate(TAME_output):
for (params,profile) in profiling:
rt = reduce(elemwise_list_sum,[
profile["contraction_timings"],
profile["matching_timings"],
profile["scoring_timings"],
])
if params in T_results[order]:
T_results[order]["full runtime"][params].append(rt)
else:
T_results[order]["full runtime"][params] = [rt]
if params in T_results[order]:
T_results[order]["contraction runtime"][params].append(profile["contraction_timings"])
else:
T_results[order]["contraction runtime"][params] = [profile["contraction_timings"]]
for key in ["contraction runtime","full runtime"]:
for (param,rts) in T_results[order][key].items():
T_results[order][key][param] = np.median(np.array(rts),axis=0)
"""
for params in T_results[order]["contraction runtime"].keys():
T_results[order]["contraction runtime"][params] = [rt/trials for rt in T_results[order]["contraction runtime"][params]]
for params in T_results[order]["full runtime"].keys():
T_results[order]["full runtime"][params] = [rt/trials for rt in T_results[order]["full runtime"][params]]
"""
return T_results
T_results = get_TAME_data()
file = "LambdaTAME_RandomGeometric_degreedist:LogNormal_alpha:[0.5,1.0]_beta:[0.0,1.0]_n:[100]_orders:[3,4,5,6,7]_p:0.5_sample:10000_sp:[0.2]_trials:25_results.json"
with open(results_path + file,"r") as file:
data = json.load(file)
LT_results = {}
all_shifts = [
'α:0.5_β:0.0',
'α:0.5_β:1.0',
'α:1.0_β:0.0',
'α:1.0_β:1.0',
]
for (order, TAME_output) in data:
trials = len(TAME_output)
LT_results[order] = {
"contraction runtime":{},
"full runtime":{},
}
for trial_idx,(seed,p,n,sp,accuracy,dup_tol_accuracy,motifs_matched,A_motifs,B_motifs,A_motif_dist,B_motif_dist,profile) in enumerate(TAME_output):
# aggregate the runtimes
full_rt = reduce(elemwise_list_sum,[
profile["Matching Timings"],
profile["TAME_timings"],
profile["Scoring Timings"],
])
for (i,rt) in enumerate(full_rt):
params = all_shifts[i]
if params in LT_results[order]["full runtime"]:
LT_results[order]["full runtime"][params].append(rt)
else:
LT_results[order]["full runtime"][params] = [rt]
for (i,rt) in enumerate(profile["TAME_timings"]):
params = all_shifts[i]
if params in LT_results[order]["contraction runtime"]:
LT_results[order]["contraction runtime"][params].append(rt)
else:
LT_results[order]["contraction runtime"][params] = [rt]
for key in ["contraction runtime","full runtime"]:
for (param,rts) in LT_results[order][key].items():
LT_results[order][key][param] = np.median(np.array(rts))
#return LR_results, T_results
#
# Create Plots
#
if global_ax is None:
fig = plt.figure(figsize=(5.5,3))
global_ax = plt.gca()
global_ax.set_axis_off()
parity = 1 #used for checkerboard effect in plots.
linestyles= {
'α:0.5_β:0.0':"dotted",
'α:0.5_β:1.0':"solid",
'α:1.0_β:0.0':(0,(3,1,1,1)),
'α:1.0_β:1.0':(0,(5,1))
}
motif_label = 0
rt_data = 1
rank_data = 2
A_motif_data = 3
n = 4
m = len(LT_results.keys())
widths = [.5,3,2,1]
col_width_ratios = [1]*m
col_width_ratios.append(.8)
# +1 for vioin legend
gs = fig.add_gridspec(nrows=n,ncols=m + 1,hspace=0.1,wspace=0.1,
height_ratios=widths,width_ratios=col_width_ratios,
left=.18,right=.99,top=.925,bottom=.05)
gs_ax = np.empty((n,m),object)
iterate_tick_idx = 2
# -- plot runtime data -- #
for idx,((LRT_order,LRT_data),(T_order,T_data),(LT_order,LT_data)) in enumerate(zip(LR_results.items(),T_results.items(),LT_results.items())):
assert LRT_order == T_order
assert LRT_order == LT_order
order = LRT_order
for row in range(n):
ax = fig.add_subplot(gs[row,idx])
gs_ax[row,idx] = ax
if row == motif_label:
ax.annotate(f"{order}",xy=(.5, .5), xycoords='axes fraction', c="k",size=10,ha="center",va="center")
elif row == rt_data:
for (exp_data,c) in zip([LRT_data,T_data],[LRT_color,T_color]):
for (param,runtime) in exp_data["contraction runtime"].items():
if param == 'α:0.5_β:0.0' or param == 'α:1.0_β:1.0':
continue #ignore partial shifts
gs_ax[row,idx].plot(runtime,c=c,linestyle=linestyles[param])
iterations = len(runtime)
for (param,runtime) in LT_data["contraction runtime"].items():
if param == 'α:0.5_β:0.0' or param == 'α:1.0_β:1.0':
continue
gs_ax[row,idx].axhline(runtime/iterations,c=LT_color,linestyle=linestyles[param])
elif row == rank_data:
for (param,ranks) in LRT_data["ranks"].items():
if param == 'α:0.5_β:0.0' or param == 'α:1.0_β:1.0':
continue
if idx == iterate_tick_idx:
ax.set_zorder(3.5)
ax.plot(np.median(np.array(ranks),axis=0),c=[.1]*3,linestyle=linestyles[param])
#if T_order == 7:
# for (motifs,rank) in sorted(zip(LRT_data["A motifs"],ranks),key=lambda x:x[0]):
# print(f"motifs:{motifs} ranks:{rank}")
elif row == A_motif_data:
make_violin_plot(ax,LRT_data["A motifs"],precision=0,c="k")
# -- plot motif data -- #
#
# Adjust Axes
#
gs_ax[motif_label,0].set_ylabel(" Clique Size",rotation=0,labelpad=32.5,ha="center",va="center")
subylabel_xpos = -.7
gs_ax[rt_data,0].set_ylabel("Contraction\nRuntime (s)",rotation=0,labelpad=32.5,ha="center",va="center")
gs_ax[rt_data,0].annotate("25 unique\ntrials",xy=(subylabel_xpos, .15), xycoords='axes fraction',ha="center",fontsize=7,style='italic')
for (idx,ax) in enumerate(gs_ax[rt_data,:]):
ax.set_ylim(5e-5,5e3)
ax.set_yscale("log")
ax.yaxis.set_ticks_position('right')
ax.set_yticks([1e-4,1e-3,1e-2,1e-1,1e0,1e1,1e2,1e3])
if idx == m-1:
ax.set_yticklabels([r"$10^{-4}$",r"$10^{-3}$",None,r"$10^{-1}$",None,r"$10^1$",None,r"$10^3$"])
else:
ax.set_yticklabels([])
ax.set_xticks([0,6,14])
ax.grid(True)
ax.set_xlim(-1,15)
bbox = dict(boxstyle="round", ec="w", fc="w", alpha=1.0,pad=.01)
gs_ax[rt_data,3].annotate("LR-TAME",c=LRT_color,xy=(.225, .375), xycoords='axes fraction').set_bbox(bbox)
gs_ax[rt_data,3].annotate("TAME",c=T_color,xy=(.2, .85), xycoords='axes fraction').set_bbox(bbox)
gs_ax[rt_data,3].annotate(r"$\Lambda$"+"-TAME",c=LT_color,xy=(.225, .14), xycoords='axes fraction').set_bbox(bbox)
gs_ax[rank_data,0].set_ylabel("Iterate\nRank",rotation=0,labelpad=32.5,ha="center",va="center")
gs_ax[rank_data,0].annotate("max rank=100",xy=(subylabel_xpos, .15), xycoords='axes fraction',ha="center",fontsize=7,style='italic')
for (idx,ax) in enumerate(gs_ax[rank_data,:].reshape(-1)):
ax.set_ylim(-1,32.5)
ax.yaxis.set_ticks_position('right')
ax.set_yticks([0,1,5,10,15,20,25,30])
if idx == m-1:
ax.set_yticklabels([None,None,5,None,15,None,25,None])
else:
ax.set_yticklabels([])
ax.set_xticks([0,6,14])
ax.grid(True)
ax.set_xlim(-1,15)
# -- add in shift annotations -- #
gs_ax[rank_data,1].annotate('α=.5 β=1\n(both shifts)',xy=(.375, .65), xycoords='axes fraction',fontsize=6,ha="left",zorder=5)
x_loc = .18
gs_ax[rank_data,1].annotate('β=0 (no shifts)',xy=(x_loc, .1),xycoords='axes fraction',fontsize=6, ha="left",va="bottom")
gs_ax[rank_data,1].annotate('α=1',xy=(x_loc - .01, .225), xycoords='axes fraction',fontsize=6,ha="left")
legend_ax = fig.add_subplot(gs[A_motif_data,-1])
make_violin_plot_legend(legend_ax)
gs_ax[A_motif_data,0].set_ylabel("A motifs",rotation=0,labelpad=32.5,ha="center",va="center")
gs_ax[A_motif_data,0].annotate("samples="+r"$10^4$",xy=(subylabel_xpos, .01), xycoords='axes fraction',ha="center",fontsize=7,style='italic')
for ax in chain(gs_ax[[A_motif_data,motif_label],:].reshape(-1),[legend_ax]):
ax.set_yticklabels([])
for ax in chain(gs_ax.reshape(-1),[legend_ax]):
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.spines['left'].set_visible(False)
ax.spines['bottom'].set_visible(False)
ax.tick_params(axis="both",direction="out",which='both', length=0)
ax.set_xticklabels([])
#add back in right most column tick marks
gs_ax[rt_data,m-1].tick_params(axis="y",direction="out",which='both', length=2)
gs_ax[rank_data,m-1].tick_params(axis="y",direction="out",which='both', length=2)
gs_ax[rank_data,iterate_tick_idx].xaxis.set_label_position("top")
gs_ax[rank_data,iterate_tick_idx].xaxis.set_ticks_position('top')
gs_ax[rank_data,iterate_tick_idx].tick_params(axis="x",direction="out", pad=-17.5,length=5)
gs_ax[rank_data,iterate_tick_idx].set_xticklabels([1,5,15])
bbox = dict(boxstyle="round", ec="w", fc="w", alpha=1.0,pad=-.01)
gs_ax[rank_data,iterate_tick_idx].annotate("iteration "+r"$(\ell)$",xy=(.5,1.25),ha="center",xycoords='axes fraction',fontsize=10)#.set_bbox(bbox)
if save_path is None:
plt.show()
else:
plt.savefig(save_path)
def TAME_vs_LRTAME_clique_scaling_summarized(save_path=None):
"""This version stacks the results of LR-TAME and TAME on top of one another."""
plt.rc('text.latex', preamble=r'\usepackage{/Users/charlie/Documents/Code/TKPExperimentPlots/latex/dgleich-math}\usepackage{amsmath}')
#
# subplot routines
#
extremal_tick_ypos = .2
# subroutine globals
def underline_text(ax,text,c,linestyle):
tb = text.get_tightbbox(fig.canvas.get_renderer()).transformed(fig.transFigure.inverted())
ax.annotate('', xy=(tb.xmin,tb.y0), xytext=(tb.xmax,tb.y0), xycoords="figure fraction",arrowprops=dict(arrowstyle="-", color=c,linestyle=linestyle,linewidth=1.5,alpha=.8))
def mark_as_algorithm(ax,text,c,linestyle,algorithm="LRTAME"):
tb = text.get_tightbbox(fig.canvas.get_renderer()).transformed(fig.transFigure.inverted())
# calculate asymmetry of x and y axes:
x0, y0 = fig.transFigure.transform((0, 0)) # lower left in pixels
x1, y1 = fig.transFigure.transform((1, 1)) # upper right in pixes
dx = x1 - x0
dy = y1 - y0
maxd = max(dx, dy)
if algorithm == "LRTAME":
radius=.02
height = radius * maxd / dy
width = radius * maxd / dx
p=ax.add_patch(patches.Ellipse((tb.xmin-.015,tb.y0+(5/8)*tb.height),width, height,color=LRT_color,transform=fig.transFigure,clip_on=False))
elif algorithm == "TAME":
side_length=.015
height = side_length * maxd / dy
width = side_length * maxd / dx
p=ax.add_patch(patches.Rectangle((tb.xmax+.01,tb.y0+.5*(tb.height - side_length)),
width, height,color=T_color,
transform=fig.transFigure,clip_on=False))
else:
raise ValueError(f"algorithm must be either 'TAME' or 'LRTAME', got {algorithm}.\n")
def make_violin_plot(ax,data,precision=2,c=None,v_alpha=.3,format="default",xlim=None,xscale="linear",column_type=None):
bbox = dict(boxstyle="round", ec="w", fc="w", alpha=.5,pad=.01)
if xscale=="linear":
v = ax.violinplot(data,[.5], points=100, showmeans=False,widths=.15,
showextrema=False, showmedians=True,vert=False)#,quantiles=[[.2,.8]]*len(data2))
elif xscale=="log":
v = ax.violinplot(np.log10(data), points=100, showmeans=False,widths=.15,showextrema=False, showmedians=True,vert=False)#,quantiles=[[.2,.8]]*len(data2))
else:
raise ValueError(f"supports xscale values: 'linear' & 'log'; Got {xscale}.")
# -- update median lines to have a gap -- #
((x0,y0),(_,y1)) = v["cmedians"].get_segments()[0]
newMedianLines = [[(x0,y1),(x0,y1+.7)]]
v["cmedians"].set_segments(newMedianLines)
# -- write data values as text
if column_type is None:
if format == "default":
ax.annotate(f"{np.median(data):.{precision}f}",xy=(.475,.4),xycoords="axes fraction",ha="center",fontsize=10)#.set_bbox(bbox)
ax.annotate(f"{np.min(data):.{precision}f}",xy=(.025,extremal_tick_ypos),xycoords="axes fraction",ha="left",fontsize=8,alpha=.8)
ax.annotate(f"{np.max(data):.{precision}f}",xy=(.975,extremal_tick_ypos),xycoords="axes fraction",ha="right",fontsize=8,alpha=.8)
elif format == "scientific":
ax.annotate(f"{np.median(data):.{precision}e}",xy=(.5,.4),xycoords="axes fraction",ha="center",fontsize=10)
ax.annotate(f"{np.min(data):.{precision}e}",xy=(.025,extremal_tick_ypos),xycoords="axes fraction",ha="left",fontsize=8,alpha=.8)
ax.annotate(f"{np.max(data):.{precision}e}",xy=(.925,extremal_tick_ypos),xycoords="axes fraction",ha="right",fontsize=8,alpha=.8)
else:
print(f"expecting format to be either 'default' or 'scientific', got:{format}")
elif column_type == "merged_axis":
pass
else:
raise ValueError("column_type expecting 'merged_axis' or None, but got {column_type}\n")
if c is not None:
v["cmedians"].set_color(c)
v["cmedians"].set_alpha(.75)
for b in v['bodies']:
# set colors
b.set_facecolor(c)
b.set_edgecolor("None")
b.set_alpha(v_alpha)
#b.set_color(c)
# -- only plot the top half of violin plot -- #
m = np.mean(b.get_paths()[0].vertices[:, 1])
b.get_paths()[0].vertices[:, 1] = np.clip(b.get_paths()[0].vertices[:, 1],m, np.inf)
# -- clip the top of the med-line to the top of the violin plot -- #
def clip_to_top_of_violin(segment):
med_line_x = segment.get_paths()[0].vertices[0, 0]
# find the y-vals of the violin plots near the med-lines
distances = [abs(p[0]- med_line_x) for p in b.get_paths()[0].vertices]
k = 5
closest_x_points = np.argpartition(distances,k)[:k]
new_max_y = np.max([b.get_paths()[0].vertices[idx,1] for idx in closest_x_points] )
#new_max_y += .04
#clip the lines
segment.get_paths()[0].vertices[:, 1] = np.clip(segment.get_paths()[0].vertices[:, 1],-np.inf,new_max_y)
clip_to_top_of_violin(v["cmedians"])
def make_violin_plot_merged_axis(ax,data1,data2,c1,c2,marker1,marker2,format=None,**kwargs):
make_violin_plot(ax,data1,**dict(kwargs,c=c1,column_type="merged_axis"))
make_violin_plot(ax,data2,**dict(kwargs,format=format,c=c2,column_type="merged_axis"))
# add markers to the median lines
marker_size = 12.5
marker_y_loc = ax.get_ylim()[-1]
ax.scatter(np.log10(np.median(data1)),marker_y_loc,marker=T_marker,color=c1,s=marker_size)
ax.scatter(np.log10(np.median(data2)),marker_y_loc,marker=LRT_marker,color=c2,s=marker_size)
ax.set_ylim(0.9175, 1.1)
#
#ax.scatter(np.median(data1),.65,marker=marker1,s=5)
bbox = dict(boxstyle="round", ec="w", fc="w", alpha=.5,pad=.01)
min1 = np.min(data1)
min2 = np.min(data2)
if min1 < min2:
#text = f"{min1:.{kwargs['precision']}f}"
#underlined_annotation(fig,ax,(.075,extremal_tick_ypos),text,linestyle=LRT_linestyle,ha="left",fontsize=8,alpha=.8)
text = ax.annotate(f"{min1:.{kwargs['precision']}f}",xy=(.075,extremal_tick_ypos),xycoords="axes fraction",ha="left",fontsize=8,alpha=.8)
#mark_as_algorithm(ax,text,T_color,T_linestyle,algorithm="TAME")
#underline_text(ax,text,T_color,T_linestyle)
"""
tb = text.get_tightbbox(fig.canvas.get_renderer()).transformed(fig.transFigure.inverted())
ax.annotate('', xy=(tb.xmin,tb.y0), xytext=(tb.xmax,tb.y0), xycoords="figure fraction",arrowprops=dict(arrowstyle="-", color='k',linestyle=T_linestyle))
"""
else:
text = ax.annotate(f"{min2:.{kwargs['precision']}f}",xy=(.075,extremal_tick_ypos),xycoords="axes fraction",ha="left",fontsize=8,alpha=.8)
#mark_as_algorithm(ax,text,LRT_color,LRT_linestyle,algorithm="LRTAME")
#underline_text(ax,text,LRT_color,LRT_linestyle)
#minimum_val = min([np.min(data1),np.min(data2)])
maximum_val = min([np.max(data1),np.max(data2)])
max1 = np.max(data1)
max2 = np.max(data2)
if max1 > max2:
text = f"{maximum_val:.{kwargs['precision']}f}"
text = ax.annotate(f"{max1:.{kwargs['precision']}f}",xy=(.925,extremal_tick_ypos),xycoords="axes fraction",ha="right",fontsize=8,alpha=.8)
#mark_as_algorithm(ax,text,T_color,T_linestyle,algorithm="TAME")
#underline_text(ax,text,T_color,T_linestyle)
#underlined_annotation(fig,ax,(.925,extremal_tick_ypos),text,linestyle=LRT_linestyle,ha="right",fontsize=8,alpha=.8)
else:
text = ax.annotate(f"{maximum_val:.{kwargs['precision']}f}",xy=(.925,extremal_tick_ypos),xycoords="axes fraction",ha="right",fontsize=8,alpha=.8)
#mark_as_algorithm(ax,text,LRT_color,LRT_linestyle,algorithm="LRTAME")
#underline_text(ax,text,LRT_color,LRT_linestyle)
ax.annotate(f"{np.median(data1):.{kwargs['precision']}f}",xy=(.7,.5),xycoords="axes fraction",ha="center",fontsize=10)#.set_bbox(bbox)
ax.annotate(f"{np.median(data2):.{kwargs['precision']}f}",xy=(.3,.5),xycoords="axes fraction",ha="center",fontsize=10)#.set_bbox(bbox)
#for x in sorted(dir(text)):
# print(x)
"""
if format is None:
ax.annotate(f"{np.median(data1):.{kwargs[:precision]}f}",xy=(.5,.2),xycoords="axes fraction",ha="center",fontsize=10)
ax.annotate(f"{np.min(data1):.{precision}f}",xy=(.075,extremal_tick_ypos),xycoords="axes fraction",ha="left",fontsize=8,alpha=.8)
ax.annotate(f"{np.max(data1):.{precision}f}",xy=(.925,extremal_tick_ypos),xycoords="axes fraction",ha="right",fontsize=8,alpha=.8)
elif format == "scientific":
ax.annotate(f"{np.median(data):.{precision}e}",xy=(.5,.2),xycoords="axes fraction",ha="center",fontsize=10)
ax.annotate(f"{np.min(data):.{precision}e}",xy=(.025,extremal_tick_ypos),xycoords="axes fraction",ha="left",fontsize=8,alpha=.8)
ax.annotate(f"{np.max(data):.{precision}e}",xy=(.925,extremal_tick_ypos),xycoords="axes fraction",ha="right",fontsize=8,alpha=.8)
else:
print(f"expecting format to be 'scientific' or None, got:{format}")
"""
def make_violin_plot_legend(ax,c="k"):
np.random.seed(12)#Ok looking:12
v = ax.violinplot([np.random.normal() for i in range(50)], points=100, positions=[.6], showmeans=False,
showextrema=False, showmedians=True,widths=.6,vert=False)#,quantiles=[[.2,.8]]*len(data2))
#ax.axes.set_axis_off()
ax.set_ylim(.5,1.0)
# -- update median lines to have a gap -- #
((x0,y0),(_,y1)) = v["cmedians"].get_segments()[0]
#newMedianLines = [[(x0,y0-.125),(x0,y0 + (y1-y0)/2 -.1)]]#,[(x0,y0 + (y1-y0)/2 +.1),(x0,y1+.1)]]
newMedianLines = [[(x0,y1 +.05),(x0,1.5)]]
v["cmedians"].set_segments(newMedianLines)
bbox = dict(boxstyle="round", ec="w", fc="w", alpha=.3,pad=.01)
ax.annotate("median",xy=(.5,.375),xycoords="axes fraction",ha="center",va="center",fontsize=10)#.set_bbox(bbox)
ax.annotate(f"min",xy=(.025,-.125),xycoords="axes fraction",ha="left",fontsize=9,alpha=.8)
ax.annotate(f"max",xy=(.975,-.125),xycoords="axes fraction",ha="right",fontsize=9,alpha=.8)
if c is not None:
v["cmedians"].set_color(c)
for b in v['bodies']:
b.set_facecolor(c)
b.set_edgecolor("None")
b.set_alpha(.3)
m = np.mean(b.get_paths()[0].vertices[:, 1])
# modify the paths to not go further right than the center
b.get_paths()[0].vertices[:, 1] = np.clip(b.get_paths()[0].vertices[:, 1],m, np.inf)
def clip_to_top_of_violin(segment):
med_line_x = segment.get_paths()[0].vertices[0, 0]
# find the y-vals of the violin plots near the med-lines
distances = [abs(p[0]- med_line_x) for p in b.get_paths()[0].vertices]
k = 5
closest_x_points = np.argpartition(distances,k)[:k]
new_max_y = np.max([b.get_paths()[0].vertices[idx,1] for idx in closest_x_points] )
new_max_y += .02
#clip the lines
segment.get_paths()[0].vertices[:, 1] = np.clip(segment.get_paths()[0].vertices[:, 1],-np.inf,new_max_y)
clip_to_top_of_violin(v["cmedians"])
def make_merged_violin_plot_legend(ax):
np.random.seed(12)#Ok looking:12
data1 = [np.random.normal(-.25,.25) for i in range(50)]
v1= ax.violinplot(data1, points=100, positions=[.6], showmeans=False, showextrema=False, showmedians=True,widths=.6,vert=False)#,quantiles=[[.2,.8]]*len(data2))
data2 = [np.random.normal(.5,.25) for i in range(50)]
v2 = ax.violinplot(data2, points=100, positions=[.6],
showmeans=False, showextrema=False, showmedians=True,widths=.6,vert=False)
ax.set_ylim(.5,1.0)
marker_size = 12.5
marker_y_loc = ax.get_ylim()[-1] - .05
ax.scatter(-0.282,marker_y_loc,marker=LRT_marker,color=LRT_color,s=marker_size)
ax.scatter(np.log10(np.median(data2))+.795,marker_y_loc,marker=T_marker,color=T_color,s=marker_size)
bbox = dict(boxstyle="sawtooth", ec="w", fc="w", alpha=.3,pad=-.15)
for (c,v) in [(LRT_color,v1),(T_color,v2)]:
# -- update median lines to have a gap -- #
((x0,y0),(_,y1)) = v["cmedians"].get_segments()[0]
#newMedianLines = [[(x0,y0-.125),(x0,y0 + (y1-y0)/2 -.1)]]#,[(x0,y0 + (y1-y0)/2 +.1),(x0,y1+.1)]]
newMedianLines = [[(x0,y1 +.05),(x0,1.5)]]
v["cmedians"].set_segments(newMedianLines)
med_label1 = ax.annotate("LR-TAME med.",xy=(.275,.35),xycoords="axes fraction",ha="center",va="center",fontsize=9)#.set_bbox(bbox)
#ax.annotate("median",xy=(.25,.35),xycoords="axes fraction",ha="center",va="top",fontsize=9)#.set_bbox(bbox)
#mark_as_algorithm(ax,med_label1,LRT_color,LRT_linestyle,algorithm="LRTAME")
med_label2 = ax.annotate("TAME med.",xy=(.725,.35),xycoords="axes fraction",ha="center",va="center",fontsize=9)#.set_bbox(bbox)
#ax.annotate("median",xy=(.7,.35),xycoords="axes fraction",ha="center",va="top",fontsize=9)#.set_bbox(bbox)
#mark_as_algorithm(ax,med_label2,T_color,T_linestyle,algorithm="TAME")
min_label = ax.annotate(f"min",xy=(.075,-.125),xycoords="axes fraction",ha="left",fontsize=9,alpha=.8)
#mark_as_algorithm(ax,min_label,LRT_color,LRT_linestyle,algorithm="LRTAME")
max_label = ax.annotate(f"max",xy=(.925,-.125),xycoords="axes fraction",ha="right",fontsize=9,alpha=.8)
#mark_as_algorithm(ax,max_label,T_color,T_linestyle,algorithm="TAME")
v["cmedians"].set_color(c)
for b in v['bodies']:
b.set_facecolor(c)
b.set_edgecolor("None")
b.set_alpha(.3)
#b.set_color(c)
m = np.mean(b.get_paths()[0].vertices[:, 1])
# modify the paths to not go further right than the center
b.get_paths()[0].vertices[:, 1] = np.clip(b.get_paths()[0].vertices[:, 1],m, np.inf)
def clip_to_top_of_violin(segment):
med_line_x = segment.get_paths()[0].vertices[0, 0]
# find the y-vals of the violin plots near the med-lines
distances = [abs(p[0]- med_line_x) for p in b.get_paths()[0].vertices]
k = 5
closest_x_points = np.argpartition(distances,k)[:k]
new_max_y = np.max([b.get_paths()[0].vertices[idx,1] for idx in closest_x_points] )
new_max_y += .02
#clip the lines
segment.get_paths()[0].vertices[:, 1] = np.clip(segment.get_paths()[0].vertices[:, 1],-np.inf,new_max_y)
clip_to_top_of_violin(v["cmedians"])
#
# Parse Data
#
results_path = TAME_RESULTS + "RG_DupNoise/"
elemwise_list_sum =lambda l1,l2: [a + b for (a,b) in zip(l1,l2)]
filename = "LowRankTAME_RandomGeometric_degreedist:LogNormal_alpha:[0.5,1.0]_beta:[0.0,1.0]_n:[100]_orders:[3,4,5,6,7,8]_p:0.5_sample:10000_sp:[0.2]_trials:25_results.json"
with open(results_path + filename,"r") as file:
data = json.load(file)
LR_results = {}
debug_results = {}
LR_seeds = {}
for (order, LRTAME_output) in data:
trials = len(LRTAME_output)
LR_results[order] = {
"full runtime":{},
"contraction runtime":{},
"A motifs":[],
"ranks":{},
}
debug_results[order] = {
"runtimes":[],
"ranks":[]
}
LR_seeds[order] = []
for trial_idx,(seed,p,n,sp,accuracy,dup_tol_accuracy,motifs_matched,A_motifs,B_motifs,A_motif_dist,B_motif_dist,profiling) in enumerate(LRTAME_output):
LR_results[order]["A motifs"].append(A_motifs)
LR_seeds[order].append(seed)
for (params,profile) in profiling:
contract_rt = reduce(elemwise_list_sum,[
profile["low_rank_factoring_timings"],
profile["contraction_timings"],
])
if params in LR_results[order]["contraction runtime"]:
LR_results[order]["contraction runtime"][params].append(np.max(contract_rt))
else:
LR_results[order]["contraction runtime"][params] = [np.max(contract_rt)]
if params == 'α:0.5_β:1.0':
debug_results[order]["ranks"].append(profile["ranks"])
debug_results[order]["runtimes"].append(contract_rt)
ranks = profile["ranks"]
if len(ranks) < 15:
# if algorithm terminated from tol bounds, extend last rank to fill the rest
ranks.extend([ranks[-1]]*(15-len(ranks)))
if params in LR_results[order]["ranks"]:
LR_results[order]["ranks"][params].append(profile["ranks"])
else:
LR_results[order]["ranks"][params] = [profile["ranks"]]
#return debug_results
file = "TAME_RandomGeometric_degreedist:LogNormal_alpha:[0.5,1.0]_beta:[0.0,1.0]_n:[100]_orders:[3,4,5,6,7]_p:0.5_sample:10000_sp:[0.2]_trials:25_results.json"
with open(results_path + file,"r") as file:
data = json.load(file)
T_results = {}
for (order, TAME_output) in data:
trials = len(TAME_output)
T_results[order] = {
"contraction runtime":{},
"full runtime":{},
}
for trial_idx,(seed,p,n,sp,accuracy,dup_tol_accuracy,motifs_matched,A_motifs,B_motifs,A_motif_dist,B_motif_dist,profiling) in enumerate(TAME_output):
for (params,profile) in profiling:
if params in T_results[order]["contraction runtime"]:
T_results[order]["contraction runtime"][params].append(np.max(profile["contraction_timings"]))
else:
T_results[order]["contraction runtime"][params] = [np.max(profile["contraction_timings"])]
file = "LambdaTAME_RandomGeometric_degreedist:LogNormal_alpha:[0.5,1.0]_beta:[0.0,1.0]_n:[100]_orders:[3,4,5,6,7]_p:0.5_sample:10000_sp:[0.2]_trials:25_results.json"
with open(results_path + file,"r") as file:
data = json.load(file)
LT_results = {}
all_shifts = [
'α:0.5_β:0.0',
'α:0.5_β:1.0',
'α:1.0_β:0.0',
'α:1.0_β:1.0',
]
for (order, TAME_output) in data:
trials = len(TAME_output)
LT_results[order] = {
"contraction runtime":{},
"full runtime":{},
}
for trial_idx,(seed,p,n,sp,accuracy,dup_tol_accuracy,motifs_matched,A_motifs,B_motifs,A_motif_dist,B_motif_dist,profile) in enumerate(TAME_output):
# aggregate the runtimes
full_rt = reduce(elemwise_list_sum,[
profile["Matching Timings"],
profile["TAME_timings"],
profile["Scoring Timings"],
])
for (i,rt) in enumerate(full_rt):
params = all_shifts[i]
if params in LT_results[order]["full runtime"]:
LT_results[order]["full runtime"][params].append(rt)
else:
LT_results[order]["full runtime"][params] = [rt]
for (i,rt) in enumerate(profile["TAME_timings"]):
params = all_shifts[i]
if params in LT_results[order]["contraction runtime"]:
LT_results[order]["contraction runtime"][params].append(rt)
else:
LT_results[order]["contraction runtime"][params] = [rt]
#
# Create Plots
#
fig = plt.figure(figsize=(5,3))
global_ax = plt.gca()
global_ax.set_axis_off()
parity = 1 #used for checkerboard effect in plots.
linestyles= {
'α:0.5_β:0.0':"dotted",
'α:0.5_β:1.0':"solid",
'α:1.0_β:0.0':(0,(3,1,1,1)),
'α:1.0_β:1.0':(0,(5,1))
}
# column assignment
motif_label = 0
A_motif_data = 1
rank_data = 2
TAME_rt = 3
LRTAME_rt = 3
LTAME_rt = 5
#rt_data = 1
main_gs = fig.add_gridspec(2, 1,hspace=0.0,wspace=0.0, height_ratios = [1,.15],
left=0.05,right=.975,top=.85,bottom=0.025)
n = len(T_results.keys())
m = 4 # - 1 for no LT
# - 1 for merging TAME w/ LRT
heights = [.1,.3,.3,.7]
row_height_ratios = [1]*n
#col_width_ratios.append(.8)
gs = main_gs[0].subgridspec(nrows=n,ncols=m,hspace=0.0,wspace=0.1,
width_ratios=heights,height_ratios=row_height_ratios)
legend_gs = main_gs[1].subgridspec(nrows=1,ncols=20)
gs_ax = np.empty((n,m),object)
iterate_tick_idx = 2
# -- plot runtime data -- #
LambdaTAME_runtime_data = []
motif_label_xloc = .4
for idx,((LRT_order,LRT_data),(T_order,T_data),(LT_order,LT_data)) in enumerate(zip(LR_results.items(),T_results.items(),LT_results.items())):
assert LRT_order == T_order
assert LRT_order == LT_order
LambdaTAME_runtime_data.append((T_order,np.max(LT_data["contraction runtime"]['α:0.5_β:1.0'])))
order = LRT_order
for col in range(m):
if idx == 0:
ax = fig.add_subplot(gs[idx,col])
else:
ax = fig.add_subplot(gs[idx,col],sharex=gs_ax[0,col])
gs_ax[idx,col] = ax
if col == motif_label:
ax.annotate(f"{order}",xy=(motif_label_xloc, .5), xycoords='axes fraction', c="k",size=10,ha="center",va="center")#,weight="bold")
elif col == TAME_rt:
#ax.set_xscale("log")
make_violin_plot_merged_axis(ax,T_data["contraction runtime"]['α:0.5_β:1.0'],
LRT_data["contraction runtime"]['α:0.5_β:1.0'],
T_color,LRT_color,T_marker,LRT_marker, precision=2,v_alpha=.3,xscale="log")
elif col == LRTAME_rt:
#ax.set_xscale("log")
pass
elif col == LTAME_rt:
make_violin_plot(ax,LT_data["contraction runtime"]['α:0.5_β:1.0'],
precision=1,c=LT_color,v_alpha=.3,format = "scientific",xscale="log")
elif col == A_motif_data:
make_violin_plot(ax,LRT_data["A motifs"],precision=0,c="k",v_alpha=.3)
elif col == rank_data:
make_violin_plot(ax,np.array(LRT_data["ranks"]['α:0.5_β:1.0']).max(axis=1),precision=0,c="k",v_alpha=.3)
#ax.set_xlim(13,61)
print(f"(order,LambdTAME maximum contraction runtimes):\n{LambdaTAME_runtime_data}")
vp_legend_ax = fig.add_subplot(legend_gs[3:8])
make_violin_plot_legend(vp_legend_ax)
merged_vp_legend_ax = fig.add_subplot(legend_gs[11:20])
make_merged_violin_plot_legend(merged_vp_legend_ax)
#marker_legend_ax = fig.add_subplot(legend_gs[6:10])
label_font = 11
#LRT_label = marker_legend_ax.annotate("LR-TAME",rotation=0,ha="right",va="top",xy=(.85, 1.0), xycoords='axes fraction',c=LRT_color,fontsize=label_font)
#mark_as_algorithm(marker_legend_ax,LRT_label,LRT_color,LRT_linestyle,"LRTAME")
#TAME_label = marker_legend_ax.annotate("TAME",rotation=0,ha="right",va="bottom",xy=(.85, 0.0), xycoords='axes fraction',c=T_color,fontsize=label_font)
#mark_as_algorithm(marker_legend_ax ,TAME_label,T_color,T_linestyle,"TAME")
#make_violin_plot_legend(merged_vp_legend_ax)
# -- create legends -- #
#
# Adjust Axes
#
# -- Set the column titles -- #
title_ypos = 1.1
annotation_ypos = .6
gs_ax[0,motif_label].annotate("Clique\nSize",ha="center",va="bottom",xy=(motif_label_xloc, title_ypos), xycoords='axes fraction')
#bbox = dict(boxstyle="round", ec=checkboard_color, fc=checkboard_color, alpha=1.0,pad=-.1)
#gs_ax[0,LRTAME_rt].set_ylabel("Max Iterate\nTTV Time (s)",rotation=0,labelpad=30,ha="center",va="center")#,c=LT_color,xy=(.3, .125), xycoords='axes fraction').set_bbox(bbox)
gs_ax[0,LRTAME_rt].annotate("Longest\nContraction (s)",rotation=0,ha="center",va="bottom",xy=(.5, title_ypos), xycoords='axes fraction')#,c=LT_color,xy=(.3, .125), xycoords='axes fraction').set_bbox(bbox)
gs_ax[0,rank_data].annotate("Max (LR-)TAME\nIterate Rank",ha="center",va="bottom",xy=(.5, title_ypos), xycoords='axes fraction')
gs_ax[0,A_motif_data].annotate("A motifs",xy=(.5, title_ypos), xycoords='axes fraction',ha="center",va="bottom")
#y_pos = -1.25
#gs_ax[-1,-1].annotate("LRT - LowRankTAME",xy=(.625, y_pos), xycoords='axes fraction',ha="right",va="center",fontsize=11,c=LRT_color)
#gs_ax[-1,-1].annotate("T - TAME",xy=(1.0, y_pos), xycoords='axes fraction',ha="right",va="center",fontsize=11,c=T_color)#
# -- make a label for shared x-axis
super_title_ypos = .875
additional_ax = [
global_ax,vp_legend_ax,merged_vp_legend_ax,#marker_legend_ax #legend_ax # annotation_ax,
]
for ax in chain(gs_ax.reshape(-1),additional_ax):
ax.set_yticklabels([])
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.spines['left'].set_visible(False)
ax.spines['bottom'].set_visible(False)
ax.tick_params(axis="both",direction="out",which='both', length=0)
ax.set_xticklabels([])
if save_path is None:
plt.show()
else:
plt.savefig(save_path)
#
# LVGNA Alignments
#
def LVGNA_end_to_end_relative_to_TAME_table_with_microplots(save_path=None):
fig = plt.figure(figsize=(5,4.2))
#
# Subroutines
#
def make_microplot_legend(ax):
ax.grid(True)
ax.set_ylim(-.1,1.1)
ax.set_xlim(-.1,1.1)
ax.set_xticks(np.linspace(0,1,5))
ax.set_yticks(np.linspace(0,1,5))
ax.set_xticklabels([])
ax.set_yticklabels([])
ax.set_xlabel(r"$|T_A||T_B|$",labelpad=-2)
ax.set_ylabel(r"Data",labelpad=-2)
bbox = dict(boxstyle="round", ec="w", fc="w", alpha=1,pad=0.0)
ax.annotate("log",xy=(.4,.1),xycoords="axes fraction",va="center",fontsize=6).set_bbox(bbox)
ax.annotate("log",xy=(.1,.4),xycoords="axes fraction",ha="center",rotation=90,fontsize=6).set_bbox(bbox)
def make_violin_plot_legend(ax,c="k"):
np.random.seed(12)#Ok looking:12
v = ax.violinplot([np.random.normal() for i in range(50)], points=100, positions=[.6], showmeans=False,
showextrema=False, showmedians=True,widths=.6,vert=False)#,quantiles=[[.2,.8]]*len(data2))
#ax.axes.set_axis_off()
ax.set_ylim(.5,1.0)
# -- update median lines to have a gap -- #
((x0,y0),(_,y1)) = v["cmedians"].get_segments()[0]
#newMedianLines = [[(x0,y0-.125),(x0,y0 + (y1-y0)/2 -.1)]]#,[(x0,y0 + (y1-y0)/2 +.1),(x0,y1+.1)]]
newMedianLines = [[(x0,y1 +.05),(x0,1.5)]]
v["cmedians"].set_segments(newMedianLines)
ax.annotate("median",xy=(.5,.35),xycoords="axes fraction",ha="center",va="center",fontsize=10)
ax.annotate(f"min",xy=(.025,0),xycoords="axes fraction",ha="left",fontsize=9,alpha=.8)
ax.annotate(f"max",xy=(.975,0),xycoords="axes fraction",ha="right",fontsize=9,alpha=.8)
if c is not None:
v["cmedians"].set_color(c)
for b in v['bodies']:
b.set_facecolor(c)
b.set_edgecolor("None")
b.set_alpha(.3)
#b.set_color(c)
m = np.mean(b.get_paths()[0].vertices[:, 1])
# modify the paths to not go further right than the center
b.get_paths()[0].vertices[:, 1] = np.clip(b.get_paths()[0].vertices[:, 1],m, np.inf)
def clip_to_top_of_violin(segment):
med_line_x = segment.get_paths()[0].vertices[0, 0]
# find the y-vals of the violin plots near the med-lines
distances = [abs(p[0]- med_line_x) for p in b.get_paths()[0].vertices]
k = 5
closest_x_points = np.argpartition(distances,k)[:k]
new_max_y = np.max([b.get_paths()[0].vertices[idx,1] for idx in closest_x_points] )
new_max_y += .02
#clip the lines
segment.get_paths()[0].vertices[:, 1] = np.clip(segment.get_paths()[0].vertices[:, 1],-np.inf,new_max_y)
clip_to_top_of_violin(v["cmedians"])
def underline_text(ax,renderer,text,c,linestyle):
tb = text.get_tightbbox(renderer).transformed(fig.transFigure.inverted())
ax.annotate('', xy=(tb.xmin,tb.y0), xytext=(tb.xmax,tb.y0), xycoords="figure fraction",arrowprops=dict(arrowstyle="-", color=c,linestyle=linestyle,linewidth=1.5,alpha=.8))
def make_violin_plot(ax,data,precision=2,c=None,v_alpha=.8,format="default",xlim=None,xscale="linear",column_type=None):
#background_v = ax.violinplot(data, points=100, positions=[0.5], showmeans=False,
# showextrema=False, showmedians=False,widths=.5,vert=False)#,quantiles=[[.2,.8]]*len(data2))
#
#positions=[0.5], ,widths=.5
if xscale=="linear":
v = ax.violinplot(data,[.5], points=100, showmeans=False,widths=.15,
showextrema=False, showmedians=True,vert=False)#,quantiles=[[.2,.8]]*len(data2))
elif xscale=="log":
v = ax.violinplot(np.log10(data), points=100, showmeans=False,widths=.15,showextrema=False, showmedians=True,vert=False)#,quantiles=[[.2,.8]]*len(data2))
else:
raise ValueError(f"supports xscale values: 'linear' & 'log'; Got {xscale}.")
#ax.set_ylim(0.95, 1.3)
#ax.set_xlim(np.min(data),np.max(data))
# -- update median lines to have a gap -- #
((x0,y0),(_,y1)) = v["cmedians"].get_segments()[0]
newMedianLines = [[(x0,y1),(x0,y1+.7)]]
v["cmedians"].set_segments(newMedianLines)
# -- place extremal markers underneath
"""
v['cbars'].set_segments([]) # turns off x-axis spine
for segment in [v["cmaxes"],v["cmins"]]:
((x,y0),(_,y1)) = segment.get_segments()[0]
segment.set_segments([[(x,0.45),(x,.525)]])
segment.set_color(c)
"""
# -- write data values as text
bbox = dict(boxstyle="round", ec="w", fc="w", alpha=.5,pad=.05)
extremal_tick_ypos = .25
if column_type is None:
if format == "default":
ax.annotate(f"{np.median(data):.{precision}f}",xy=(.5,.4),xycoords="axes fraction",ha="center",fontsize=10)#.set_bbox(bbox)
ax.annotate(f"{np.min(data):.{precision}f}",xy=(.025,extremal_tick_ypos),xycoords="axes fraction",ha="left",fontsize=8,alpha=.8)#.set_bbox(bbox)
ax.annotate(f"{np.max(data):.{precision}f}",xy=(.975,extremal_tick_ypos),xycoords="axes fraction",ha="right",fontsize=8,alpha=.8)#.set_bbox(bbox)
elif format == "scientific":
ax.annotate(f"{np.median(data):.{precision}e}",xy=(.5,.4),xycoords="axes fraction",ha="center",fontsize=10)#.set_bbox(bbox)
ax.annotate(f"{np.min(data):.{precision}e}",xy=(.025,extremal_tick_ypos),xycoords="axes fraction",ha="left",fontsize=8,alpha=.8)#.set_bbox(bbox)
ax.annotate(f"{np.max(data):.{precision}e}",xy=(.975,extremal_tick_ypos),xycoords="axes fraction",ha="right",fontsize=8,alpha=.8)#.set_bbox(bbox)
else:
print(f"expecting format to be either 'default' or 'scientific', got:{format}")
elif column_type == "merged_axis":
pass
else:
raise ValueError("column_type expecting 'merged_axis' or None, but got {column_type}\n")
if c is not None:
v["cmedians"].set_color(c)
v["cmedians"].set_alpha(.75)
for b in v['bodies']:
# set colors
b.set_facecolor(c)
b.set_edgecolor("None")
b.set_alpha(v_alpha)
#b.set_color(c)
# -- only plot the top half of violin plot -- #
m = np.mean(b.get_paths()[0].vertices[:, 1])
b.get_paths()[0].vertices[:, 1] = np.clip(b.get_paths()[0].vertices[:, 1],m, np.inf)
# -- clip the top of the med-line to the top of the violin plot -- #
def clip_to_top_of_violin(segment):
med_line_x = segment.get_paths()[0].vertices[0, 0]
# find the y-vals of the violin plots near the med-lines
distances = [abs(p[0]- med_line_x) for p in b.get_paths()[0].vertices]
k = 5
closest_x_points = np.argpartition(distances,k)[:k]
new_max_y = np.max([b.get_paths()[0].vertices[idx,1] for idx in closest_x_points] )
#new_max_y += .04
#clip the lines
segment.get_paths()[0].vertices[:, 1] = np.clip(segment.get_paths()[0].vertices[:, 1],-np.inf,new_max_y)
clip_to_top_of_violin(v["cmedians"])
#clip_to_top_of_violin(v["cmaxes"])
#clip_to_top_of_violin(v["cmins"])
#
# Load and Parse Pre + Post Processing information.
#
TAME_tri_results,TAME_edge_match,\
TAME_pp_edge_match,TAME_pp_tri_match,\
TAME_runtimes, TAME_impTTV_runtimes, TAME_BM_runtimes,\
TAME_pp_runtime, exp_idx = CT_LP.parse_results()
full_TAME_runtimes = TAME_runtimes + TAME_pp_runtime
graph_names = [" ".join(file.split(".smat")[0].split("_")) for (file,idx) in sorted(exp_idx.items(),key=lambda x:x[1])]
gn_dict = {graph:i for (i,graph) in enumerate(graph_names)}
LGRAAL_graphs, LGRAAL_tri_results, LGRAAL_runtimes, _,_, _,_ = get_results()
LGRAAL_perm = [gn_dict[graph] for graph in LGRAAL_graphs]
LGRAAL_tri_results = LGRAAL_tri_results[np.ix_(LGRAAL_perm, LGRAAL_perm)]
LGRAAL_runtimes = LGRAAL_runtimes[np.ix_(LGRAAL_perm, LGRAAL_perm)]
#data_path = TAME_RESULTS + "LVGNA_Experiments/klauPostProcessing/"
data_path = TAME_RESULTS + "LVGNA_Alignments/"
file = "LVGNA_pairwiseAlignment_LambdaTAME_MultiMotif_alphas:[1.0,0.5]_betas:[0.0,1.0,10.0,100.0]_order:3_samples:3000000_data.json"
file = "LVGNA_pairwiseAlignment_LambdaTAME_alphas:[0.5,1.0]_betas:[0.0,1.0,10.0,100.0]_iter:15_matchingMethod:GramMatching_postProcessing:KlauAlgo_profile:true_tol:1e-6_results.json"
with open(data_path + file,"r") as f:
data = json.load(f)
vertex_products = []
edge_products = []
motif_products = []
LT_klau_tri_match_ratios = []
LT_klau_edge_match_ratios = []
LT_klau_runtimes = []
#return data
#for (file_i,file_j,LT_matchedMotifs,A_Motifs,B_Motifs,A_motifDistribution,B_motifDistribution,LT_profile,LT_edges_matched,klau_edges_matched,klau_tris_matched,_,klau_setup_rt,klau_rt,L_sparsity) in data:
for (file_i,file_j,LT_matchedMotifs,A_Motifs,B_Motifs,LT_profile,LT_edges_matched,klau_edges_matched,klau_tris_matched,_,klau_setup_rt,klau_rt,L_sparsity,f_status) in data:
i = gn_dict[" ".join(file_i.split(".smat")[0].split("_"))]
j = gn_dict[" ".join(file_j.split(".smat")[0].split("_"))]
pre_processed_time = sum([sum(v) for (k,v) in LT_profile.items() if "Timings" in k])
LT_klau_runtimes.append(full_TAME_runtimes[i,j]/(pre_processed_time+klau_setup_rt+klau_rt))
vertex_A = vertex_counts[" ".join(file_i.split(".smat")[0].split("_"))]
vertex_B = vertex_counts[" ".join(file_j.split(".smat")[0].split("_"))]
vertex_products.append(vertex_A*vertex_B)
edges_A = edge_counts[file_i.split(".smat")[0]]
edges_B = edge_counts[file_j.split(".smat")[0]]
edge_products.append(edges_A*edges_B)
#motif_products.append(A_Motifs[0]*B_Motifs[0])
motif_products.append(A_Motifs*B_Motifs)
LT_klau_edge_match_ratios.append((klau_edges_matched/min(edges_A,edges_B))/TAME_pp_edge_match[i,j])
#LT_klau_tri_match_ratios.append((klau_tris_matched/min(A_Motifs[0],B_Motifs[0]))/TAME_pp_tri_match[i,j])
LT_klau_tri_match_ratios.append((klau_tris_matched/min(A_Motifs,B_Motifs))/TAME_pp_tri_match[i,j])
"""
#with open(data_path + "LVGNA_pairwiseAlignment_LambdaTAME_MultiMotif_alphas:[1.0,0.5]_betas:[0.0,1.0,10.0,100.0]_order:3_postProcessing:SuccessiveKlau_samples:3000000_data.json","r") as f:
with open(data_path + "LVGNA_pairwiseAlignment_LambdaTAME_MultiMotif_alphas:[1.0,0.5]_betas:[0.0,1.0,10.0,100.0]_order:3_postProcessing:SuccessiveKlau-const-iter:5-maxIter:500_samples:10000000_data.json","r") as f:
data = json.load(f)
successive_klau_tri_match_ratios = []
successive_klau_edge_match_ratios = []
successive_klau_runtimes = []
for (file_i,file_j,LT_matchedMotifs,A_Motifs,B_Motifs,A_motifDistribution,B_motifDistribution,LT_profile,LT_edges_matched,sklau_edges_matched,sklau_tris_matched,_,successive_klau_profiling) in data:
edges_A = edge_counts[file_i.split(".smat")[0]]
edges_B = edge_counts[file_j.split(".smat")[0]]
successive_klau_edge_match_ratios.append(sklau_edges_matched/min(edges_A,edges_B))
successive_klau_tri_match_ratios.append(sklau_tris_matched/min(A_Motifs[0],B_Motifs[0]))
successive_klau_runtimes.append(sum(successive_klau_profiling["runtime"]))
"""
file = "LVGNA_pairwiseAlignment_LambdaTAME_MultiMotif_alphas:[1.0,0.5]_betas:[0.0,1.0,10.0,100.0]_order:3_postProcessing:TabuSearch_samples:30000000_data.json"
file = "LVGNA_pairwiseAlignment_LambdaTAME_alphas:[0.5,1.0]_betas:[0.0,1.0,10.0,100.0]_iter:15_matchingMethod:GramMatching_postProcessing:LocalSearch_profile:true_tol:1e-6_results.json"
with open(data_path + file,"r") as f:
data = json.load(f)
LT_tabu_tri_match_ratios = []
LT_tabu_edge_match_ratios = []
LT_tabu_runtimes = []
#return data
#for (file_i,file_j,LT_matchedMotifs,A_Motifs,B_Motifs,A_motifDistribution,B_motifDistribution,LT_profile,LT_edges_matched,tabu_edges_matched,tabu_tris_matched,matching,tabu_profile,tabu_full_rt) in data:
for (file_i,file_j,LT_matchedMotifs,A_Motifs,B_Motifs,LT_profile,LT_edges_matched,tabu_edges_matched,tabu_tris_matched,matching,tabu_profile,tabu_full_rt) in data:
i = gn_dict[" ".join(file_i.split(".smat")[0].split("_"))]
j = gn_dict[" ".join(file_j.split(".smat")[0].split("_"))]
edges_A = edge_counts[file_i.split(".smat")[0]]
edges_B = edge_counts[file_j.split(".smat")[0]]
LT_tabu_edge_match_ratios.append((tabu_edges_matched/min(edges_A,edges_B))/TAME_pp_edge_match[i,j])
#LT_tabu_tri_match_ratios.append((tabu_tris_matched/min(A_Motifs[0],B_Motifs[0]))/TAME_pp_tri_match[i,j])
LT_tabu_tri_match_ratios.append((tabu_tris_matched/min(A_Motifs,B_Motifs))/TAME_pp_tri_match[i,j])
pre_processed_time = sum([sum(v) for (k,v) in LT_profile.items() if "Timings" in k])
LT_tabu_runtimes.append(full_TAME_runtimes[i,j]/(pre_processed_time + tabu_full_rt))
file = "LVGNA_pairwiseAlignment_LowRankTAME_alphas:[0.5,1.0]_betas:[0.0,1.0,10.0,100.0]_iter:15_order:3_postProcessing:KlauAlgo_profile:true_samples:3000000_tol:1e-6_results.json"
file = "LVGNA_pairwiseAlignment_LowRankTAME_alphas:[0.5,1.0]_betas:[0.0,1.0,10.0,100.0]_iter:15_postProcessing:KlauAlgo_profile:true_tol:1e-6_results_colMajor.json"
with open(data_path + file,"r") as f:
data = json.load(f)
#add in missing \beta = 1.0 case
LRT_klau_tri_match_ratios = []
LRT_klau_edge_match_ratios = []
LRT_klau_runtimes = []
#for (file_i,file_j,LRT_matchedMotifs,A_Motifs,B_Motifs,A_motifDistribution,B_motifDistribution,LRT_profile,LRT_edges_matched,klau_edges_matched,klau_tris_matched,_,klau_setup_rt,klau_rt,L_sparsity,f_status) in data:
for (file_i,file_j,LRT_matchedMotifs,A_Motifs,B_Motifs,LRT_profile,LRT_edges_matched,klau_edges_matched,klau_tris_matched,_,klau_setup_rt,klau_rt,L_sparsity,f_status) in data:
i = gn_dict[" ".join(file_i.split(".smat")[0].split("_"))]
j = gn_dict[" ".join(file_j.split(".smat")[0].split("_"))]
edges_A = edge_counts[file_i.split(".smat")[0]]
edges_B = edge_counts[file_j.split(".smat")[0]]
LRT_klau_edge_match_ratios.append((klau_edges_matched/min(edges_A,edges_B))/TAME_pp_edge_match[i,j])
LRT_klau_tri_match_ratios.append((klau_tris_matched/min(A_Motifs,B_Motifs))/TAME_pp_tri_match[i,j])
pre_processed_time = 0.0
for (param, profile) in LRT_profile:
pre_processed_time += sum([sum(v) for (k,v) in profile.items() if "timings" in k])
post_processed_time = klau_setup_rt + klau_rt
LRT_klau_runtimes.append(full_TAME_runtimes[i,j]/(pre_processed_time + post_processed_time))
file = "LVGNA_pairwiseAlignment_LowRankTAME_alphas:[1.0,0.5]_betas:[0.0,1.0,10.0,100.0]_iter:15_order:3_postProcessing:TabuSearch_profile:true_tol:1e-6_results.json"
file = "LVGNA_pairwiseAlignment_LowRankTAME_alphas:[0.5,1.0]_betas:[0.0,1.0,10.0,100.0]_iter:15_postProcessing:LocalSearch_profile:true_tol:1e-6_results_colMajor.json"
with open(data_path +file ,"r") as f:
data = json.load(f)
LRT_tabu_tri_match_ratios = []
LRT_tabu_edge_match_ratios = []
LRT_tabu_runtimes = []
#for (file_i,file_j,LRT_matchedMotifs,A_Motifs,B_Motifs,A_motifDistribution,B_motifDistribution,LRT_profile,LRT_edges_matched,tabu_edges_matched,tabu_tris_matched,matching,tabu_profile,tabu_full_rt) in data:
for (file_i,file_j,LRT_matchedMotifs,A_Motifs,B_Motifs,LRT_profile,LRT_edges_matched,tabu_edges_matched,tabu_tris_matched,matching,tabu_profile,tabu_full_rt) in data:
i = gn_dict[" ".join(file_i.split(".smat")[0].split("_"))]
j = gn_dict[" ".join(file_j.split(".smat")[0].split("_"))]
edges_A = edge_counts[file_i.split(".smat")[0]]
edges_B = edge_counts[file_j.split(".smat")[0]]
#print(f"{LRT_matchedMotifs}/min({A_Motifs},{B_Motifs})")
LRT_tabu_edge_match_ratios.append((tabu_edges_matched/min(edges_A,edges_B))/TAME_pp_edge_match[i,j])
LRT_tabu_tri_match_ratios.append((tabu_tris_matched/min(A_Motifs,B_Motifs))/TAME_pp_tri_match[i,j])
pre_processed_time = 0.0
for (param, profile) in LRT_profile:
pre_processed_time += sum([sum(v) for (k,v) in profile.items() if "timings" in k])
LRT_tabu_runtimes.append(full_TAME_runtimes[i,j]/(pre_processed_time + tabu_full_rt))
"""
file = "LVGNA_pairwiseAlignment_LowRankTAME_alphas:[0.5,1.0]_betas:[0.0,1.0,10.0,100.0]_iter:15_postProcessing:LocalSearch_profile:true_tol:1e-6_results_colMajor.json"
with open(data_path +file ,"r") as f:
data = json.load(f)
for (file_i,file_j,LRT_matchedMotifs,A_Motifs,B_Motifs,LRT_profile,LRT_edges_matched,tabu_edges_matched,tabu_tris_matched,matching,tabu_profile,tabu_full_rt) in data:
#print(f"{LRT_matchedMotifs}/min({A_Motifs},{B_Motifs})")
#print(LRT_profile[0]["ranks"])
"""
with open(data_path + "LVGNA_pairwiseAlignment_LowRankTAME_lrm_alphas:[0.5,1.0]_betas:[0.0,1.0,10.0,100.0]_iter:15_order:3_postProcessing:KlauAlgo_profile:true_samples:3000000_tol:1e-6_results.json",'r') as f:
data = json.load(f)
LRT_lrm_klau_tri_match_ratios = []
LRT_lrm_klau_edge_match_ratios = []
LRT_lrm_klau_runtimes = []
for (file_i,file_j,LRT_matchedMotifs,A_Motifs,B_Motifs,A_motifDistribution,B_motifDistribution,LRT_profile,LRT_edges_matched,klau_edges_matched,klau_tris_matched,_,klau_setup_rt,klau_rt,L_sparsity,f_status) in data:
i = gn_dict[" ".join(file_i.split(".smat")[0].split("_"))]
j = gn_dict[" ".join(file_j.split(".smat")[0].split("_"))]
edges_A = edge_counts[file_i.split(".smat")[0]]
edges_B = edge_counts[file_j.split(".smat")[0]]
LRT_lrm_klau_edge_match_ratios.append((klau_edges_matched/min(edges_A,edges_B))/TAME_pp_edge_match[i,j])
LRT_lrm_klau_tri_match_ratios.append((klau_tris_matched/min(A_Motifs,B_Motifs))/TAME_pp_tri_match[i,j])
pre_processed_time = 0.0
for (param, profile) in LRT_profile:
pre_processed_time += sum([sum(v) for (k,v) in profile.items() if "timings" in k])
post_processed_time = klau_setup_rt + klau_rt
LRT_lrm_klau_runtimes.append(full_TAME_runtimes[i,j]/(pre_processed_time + post_processed_time))
with open(data_path + "LVGNA_pairwiseAlignment_LowRankTAME_lrm_alphas:[0.5,1.0]_betas:[0.0,1.0,10.0,100.0]_iter:15_order:3_postProcessing:TabuSearch_profile:true_samples:3000000_tol:1e-6_results.json",'r') as f:
data = json.load(f)
#add in missing \beta = 1.0 case
LRT_lrm_tabu_tri_match_ratios = []
LRT_lrm_tabu_edge_match_ratios = []
LRT_lrm_tabu_runtimes = []
for (file_i,file_j,LRT_matchedMotifs,A_Motifs,B_Motifs,A_motifDistribution,B_motifDistribution,LRT_profile,LRT_edges_matched,tabu_edges_matched,tabu_tris_matched,matching,tabu_profile,tabu_full_rt) in data:
i = gn_dict[" ".join(file_i.split(".smat")[0].split("_"))]
j = gn_dict[" ".join(file_j.split(".smat")[0].split("_"))]
edges_A = edge_counts[file_i.split(".smat")[0]]
edges_B = edge_counts[file_j.split(".smat")[0]]
LRT_lrm_tabu_edge_match_ratios.append((tabu_edges_matched/min(edges_A,edges_B))/TAME_pp_edge_match[i,j])
LRT_lrm_tabu_tri_match_ratios.append((tabu_tris_matched/min(A_Motifs,B_Motifs))/TAME_pp_tri_match[i,j])
pre_processed_time = 0.0
for (param, profile) in LRT_profile:
pre_processed_time += sum([sum(v) for (k,v) in profile.items() if "timings" in k])
LRT_lrm_tabu_runtimes.append(full_TAME_runtimes[i,j]/(pre_processed_time + tabu_full_rt))
with open(data_path + "LVGNA_pairwiseAlignment_LowRankEigenAlign_postProcessing:TabuSearch_profile:true_results.json") as f:
data = json.load(f)
#for (file_i,file_j,LT_matchedMotifs,A_Motifs,B_Motifs,LREA_profile,LREA_edges_matched,LREA_klau_edges_matched,LREA_klau_tris_matched,_,klau_setup_rt,klau_rt,L_sparsity,f_status) in data:
LREA_tabu_tri_match_ratios = []
LREA_tabu_edge_match_ratios = []
LREA_tabu_runtimes = []
for (file_i,file_j,LREA_matchedMotifs,A_Motifs,B_Motifs,LREA_runtime,LREA_edges_matched,tabu_edges_matched,tabu_tris_matched,matching,tabu_profile,tabu_full_rt) in data:
i = gn_dict[" ".join(file_i.split(".smat")[0].split("_"))]
j = gn_dict[" ".join(file_j.split(".smat")[0].split("_"))]
edges_A = edge_counts[file_i.split(".smat")[0]]
edges_B = edge_counts[file_j.split(".smat")[0]]
LREA_tabu_edge_match_ratios.append((tabu_edges_matched/min(edges_A,edges_B))/TAME_pp_edge_match[i,j])
LREA_tabu_tri_match_ratios.append((tabu_tris_matched/min(A_Motifs,B_Motifs))/TAME_pp_tri_match[i,j])
LREA_tabu_runtimes.append(full_TAME_runtimes[i,j]/(LREA_runtime+tabu_full_rt))
with open(data_path + "LVGNA_pairwiseAlignment_LowRankEigenAlign_postProcessing:KlauAlgo_profile:true_results.json") as f:
data = json.load(f)
LREA_klau_tri_match_ratios = []
LREA_klau_edge_match_ratios = []
LREA_klau_runtimes = []
for (file_i,file_j,LT_matchedMotifs,A_Motifs,B_Motifs,LREA_runtime,LREA_edges_matched,LREA_klau_edges_matched,LREA_klau_tris_matched,_,klau_setup_rt,klau_rt,L_sparsity,f_status) in data:
i = gn_dict[" ".join(file_i.split(".smat")[0].split("_"))]
j = gn_dict[" ".join(file_j.split(".smat")[0].split("_"))]
edges_A = edge_counts[file_i.split(".smat")[0]]
edges_B = edge_counts[file_j.split(".smat")[0]]
LREA_klau_edge_match_ratios.append((LREA_klau_edges_matched/min(edges_A,edges_B))/TAME_pp_edge_match[i,j])
LREA_klau_tri_match_ratios.append((LREA_klau_tris_matched/min(A_Motifs,B_Motifs))/TAME_pp_tri_match[i,j])
LREA_klau_runtimes.append(full_TAME_runtimes[i,j]/(LREA_runtime+klau_setup_rt+klau_rt))
#
# Plot the Data
#
# -- Table Data -- #
tri_match_idx = 0
edge_match_idx = 1
runtime_idx = 2
results_to_plot = [
(LT_tabu_tri_match_ratios,LT_tabu_edge_match_ratios,LT_tabu_runtimes,LT_Tabu_color,LT_Tabu_linestyle,r"$\Lambda$"+"-TAME\nLocal Search",(-.45,-.01)),
(LT_klau_tri_match_ratios,LT_klau_edge_match_ratios,LT_klau_runtimes,LT_Klau_color,LT_Klau_linestyle,r"$\Lambda$"+"-TAME\nKlau",(-.425,-.01)),
(LRT_tabu_tri_match_ratios,LRT_tabu_edge_match_ratios,LRT_tabu_runtimes,LRT_Tabu_color,LRT_Tabu_linestyle,"LR-TAME\nLocal Search",(-.475,-.01)),
#(LRT_lrm_tabu_tri_match_ratios,LRT_lrm_tabu_edge_match_ratios,LRT_lrm_tabu_runtimes,LRT_Tabu_color,LRT_Tabu_linestyle,"LRT-lrm-Tabu",(-.675,-.01)),
(LRT_klau_tri_match_ratios,LRT_klau_edge_match_ratios,LRT_klau_runtimes,LRT_Klau_color,LRT_Klau_linestyle,"LR-TAME\nKlau",(-.475,-.01)),
#(LRT_lrm_klau_tri_match_ratios,LRT_lrm_klau_edge_match_ratios,LRT_lrm_klau_runtimes,LRT_Klau_color,LRT_Klau_linestyle,"LRT-lrm-Klau",(-.675,-.01)),
(LREA_tabu_tri_match_ratios,LREA_tabu_edge_match_ratios,LREA_tabu_runtimes,LREA_Tabu_color,LREA_Tabu_linestyle,"LR-EigenAlign\nLocal Search",(-.55,-.01)),
(LREA_klau_tri_match_ratios,LREA_klau_edge_match_ratios,LREA_klau_runtimes,LREA_Klau_color,LREA_Klau_linestyle,"LR-EigenAlign\nKlau",(-.55,-.01))
]
main_gs = fig.add_gridspec(2, 1,
hspace=0.0,wspace=0.2, height_ratios = [1,.25],
left=0.2, right=0.975, top=.85, bottom=.05)
#legend_gs = main_gs[1].subgridspec(nrows=1,ncols=20)
table_gs = main_gs[0].subgridspec(nrows=len(results_to_plot),ncols=3,wspace=0.05,hspace=0.0)
microplot_gs = main_gs[1].subgridspec(nrows=1,ncols=3,wspace=0.2,hspace=0.0)
all_axes = np.empty((len(results_to_plot)+1,3),object)
# +1 for microplots
loess_frac = .3
annotations = []
for i,(tri_match_data,edge_match_data,runtime_data,color,linestyle,label,underline_xs) in enumerate(results_to_plot):
if i == 0:
for j in [tri_match_idx,runtime_idx,edge_match_idx]:
all_axes[i,j] = fig.add_subplot(table_gs[i,j])
all_axes[-1,j] = fig.add_subplot(microplot_gs[-1,j])
else:
for j in [tri_match_idx,runtime_idx,edge_match_idx]:
all_axes[i,j] = fig.add_subplot(table_gs[i,j],sharex=all_axes[0,j])
#all_axes[i,tri_match_idx] = fig.add_subplot(table_gs[i,tri_match_idx],sharex=all_axes[0,tri_match_idx])
#all_axes[i,runtime_idx] = fig.add_subplot(table_gs[i,runtime_idx],sharex=all_axes[0,runtime_idx])
#all_axes[i,edge_match_idx] = fig.add_subplot(table_gs[i,edge_match_idx],sharex=all_axes[0,edge_match_idx])
make_violin_plot(all_axes[i,tri_match_idx],tri_match_data,precision=2,c=color,v_alpha=.3,format="default",xlim=None,xscale="linear",column_type=None)
make_violin_plot(all_axes[i,edge_match_idx],edge_match_data,precision=2,c=color,v_alpha=.3,format="default",xlim=None,xscale="log",column_type=None)
make_violin_plot(all_axes[i,runtime_idx],runtime_data,precision=1,c=color,v_alpha=.3,format="default",xlim=None,xscale="log",column_type=None)
"""
(line_x_start,line_x_end) = underline_xs
y = .4
line_x_start = -.7
line_x_end = -.01
all_axes[i,0].annotate('', xy=(line_x_start, y), xycoords='axes fraction', xytext=(line_x_end,y),
arrowprops=dict(arrowstyle="-", color=color,linestyle=linestyle,linewidth=3))
"""
annotations.append(all_axes[i,0].annotate(label,xy=(-.4,.5), xycoords='axes fraction',ha="center",va="center",c=color,fontsize=9))
plot_1d_loess_smoothing(motif_products,tri_match_data,loess_frac,all_axes[-1,tri_match_idx],c=color,logFilter=True,logFilterAx="x")#,linestyle=linestyle
plot_1d_loess_smoothing(motif_products,edge_match_data,loess_frac,all_axes[-1,edge_match_idx],c=color,logFilter=True,logFilterAx="x")#,linestyle=linestyle
plot_1d_loess_smoothing(motif_products,runtime_data,loess_frac,all_axes[-1,runtime_idx],c=color,logFilter=True,logFilterAx="x")#,linestyle=linestyle
#
# Format the Axes
#
microplot_legend = all_axes[-1,0].inset_axes([-.6,.2,.45,.65])
violinplot_legend = all_axes[0,0].inset_axes([-.65,1.2,.6,1.0])
for ax in chain(all_axes.reshape(-1),[microplot_legend,violinplot_legend]):
#ax.set_xscale("log")
#ax.grid(True)
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.spines['left'].set_visible(False)
ax.spines['bottom'].set_visible(False)
ax.tick_params(axis="both",direction="out",which='both', length=0)
ax.set_xticks([])
ax.set_yticks([])
make_microplot_legend(microplot_legend)
make_violin_plot_legend(violinplot_legend)
for (j,ax) in enumerate(all_axes[-1,:]):
ax.grid(True)
ax.set_xscale("log")
if j != 0:
ax.set_yscale("log")
ax.yaxis.set_major_formatter(NullFormatter())
ax.yaxis.set_minor_formatter(NullFormatter())
ax.set_xticks([1e6,1e7,1e8,1e9,1e10,1e11])
ax.set_xticklabels([])
bbox = dict(boxstyle="round", ec="w", fc="w", alpha=1,pad=0.01)
all_axes[-1,0].annotate("linear",xy=(.125,.825),xycoords="axes fraction",ha="center",va="center",rotation=90,fontsize=6).set_bbox(bbox)
#denotes microplot in column 0 is linear
#all_axes[-1,-1].set_yscale("log")
bbox = dict(boxstyle="round", ec="w", fc="w", alpha=1,pad=0.0)
#ax.annotate("log",xy=(.1,.4),xycoords="axes fraction",ha="center",rotation=90,fontsize=6).set_bbox(bbox)
#all_axes[-1,edge_match_idx].set_yscale("log")
#all_axes[-1,runtime_idx].set_yscale("log")
all_axes[-1,tri_match_idx].set_yticks(np.linspace(.2,1.8,5))
all_axes[-1,tri_match_idx].set_ylim(0,2)
all_axes[-1,edge_match_idx].set_yticks(np.linspace(1.0,7,5))
all_axes[-1,edge_match_idx].set_ylim(.8,7.5)
all_axes[-1,runtime_idx].set_yticks([1e0,1e1,1e2,1e3])
all_axes[-1,runtime_idx].set_ylim(.5,1.5e3)
# - row/col labels - #
title_ypos = 1.2
line_offset = .3
line_x_start = .15
line_x_end = .85
all_axes[0,tri_match_idx].annotate("Algo. Tri Match\n TAME Tri Match",xy=(.5, title_ypos), xycoords='axes fraction',ha="center")
all_axes[0,tri_match_idx].annotate('', xy=(.075, title_ypos+line_offset), xycoords='axes fraction', xytext=(.925, title_ypos+line_offset),
arrowprops=dict(arrowstyle="-", color='k'))
all_axes[0,edge_match_idx].annotate("Algo. Edge Match\n TAME Edge Match",xy=(.5, title_ypos), xycoords='axes fraction',ha="center")
all_axes[0,edge_match_idx].annotate('', xy=(.0, title_ypos+line_offset), xycoords='axes fraction', xytext=(1.0, title_ypos+line_offset),
arrowprops=dict(arrowstyle="-", color='k'))
all_axes[0,runtime_idx].annotate("TAME Runtime\n Algo. Runtime",xy=(.5, title_ypos), xycoords='axes fraction',ha="center")
all_axes[0,runtime_idx].annotate('', xy=(.1, title_ypos+line_offset), xycoords='axes fraction', xytext=(.925, title_ypos+line_offset),
arrowprops=dict(arrowstyle="-", color='k'))
"""
renderer = fig.canvas.get_renderer()
for i,row_label in enumerate(annotations):
print(i)
underline_text(all_axes[i,0],renderer,row_label,color,linestyle)
"""
if save_path is None:
plt.show()
else:
plt.savefig(save_path)
def make_LVGNA_TTVMatchingRatio_runtime_plots(ax=None,useLowRank=False,save_path=None):
"""
new version of MatchingRatio plot in the new simax-v2 style
"""
Opt_tri_ratio,Opt_edge_match,\
Opt_pp_edge_match,Opt_pp_tri_match,\
Runtimes, TAME_impTTV_runtimes, TAME_BM_runtimes,\
post_processing_runtime, exp_idx = CT_LP.parse_results()
graph_names = [" ".join(file.split(".smat")[0].split("_")) for (file,idx) in sorted(exp_idx.items(),key=lambda x:x[1])]
TAME_BM_ratio = np.divide(TAME_BM_runtimes,TAME_impTTV_runtimes)
datapath = TAME_RESULTS + "LVGNA_alignments/"
def process_LowRankTAME_data(f):
_, results = json.load(f)
#
# Parse Input files
#
#Format the data to
#exp_idx = {name:i for i,name in enumerate(graph_names)}
matchingRuntimes = np.zeros((len(exp_idx),len(exp_idx)))
contractionRuntimes = np.zeros((len(exp_idx),len(exp_idx)))
for (file_A,file_B,matched_tris,max_tris,param_profiles) in results:
graph_A = file_A.split(".ssten")[0] + ".smat"
graph_B = file_B.split(".ssten")[0] + ".smat"
i = exp_idx[graph_A]
j = exp_idx[graph_B]
#sum over all params
totalContractionRuntime = 0.0
contraction_times = ['qr_timings', 'contraction_timings','svd_timings']
totalMatchingRuntime = 0.0
for params, profile in param_profiles:
contraction_timings = [v for k,v in profile.items() if k in contraction_times]
totalContractionRuntime += sum(reduce(lambda l1,l2: [x + y for x,y in zip(l1,l2)],contraction_timings))
totalMatchingRuntime += sum(profile['matching_timings'])
contractionRuntimes[i,j] = totalContractionRuntime
contractionRuntimes[j,i] = totalContractionRuntime
matchingRuntimes[i,j] = totalMatchingRuntime
matchingRuntimes[j,i] = totalMatchingRuntime
return matchingRuntimes, contractionRuntimes
with open(datapath+"LowRankTAME_LVGNA_alpha_[.5,1.0]_beta_[0,1e0,1e1,1e2]_iter_15.json", "r") as f:
matchingRuntimes, contractionRuntimes = process_LowRankTAME_data(f)
LowRankTAME_ratio = np.divide(matchingRuntimes,contractionRuntimes)
with open(datapath+"LowRankTAME_LVGNA_alpha_[.5,1.0]_beta_[0,1,1e1,1e2]_iter_15_low_rank_matching.json", "r") as f:
matchingRuntimes,contractionRuntimes = process_LowRankTAME_data(f)
LowRankTAME_LRM_ratio = np.divide(matchingRuntimes,contractionRuntimes)
def parseLambdaTAMEData(exp_results):
#exp_idx = {name:i for i,name in enumerate(graph_names)}
ratio_data = np.zeros((len(exp_idx),len(exp_idx)))
for (file_A,file_B,matched_tris,max_tris,_,runtime) in exp_results:
graph_A = file_A.split(".ssten")[0] + ".smat"
graph_B = file_B.split(".ssten")[0] + ".smat"
i = exp_idx[graph_A]
j = exp_idx[graph_B]
contraction_rt = sum(runtime['TAME_timings'])
matching_rt = sum(runtime['Matching Timings'])
ratio_data[j,i] = matching_rt/contraction_rt
ratio_data[i,j] = matching_rt/contraction_rt
return ratio_data
#with open(TAME_RESULTS + "LVGNA_Experiments/LambdaTAME_LVGNA_results_alphas:[.5,1.0]_betas:[0,1e0,1e1,1e2]_iter:15.json","r") as f:
with open(datapath+"LVGNA_pairwairAlignemnt_LambdaTAME_alphas:[.5,1.0]_betas:[0.0,1.0,10.0,100.0]_iter:15_matchingMethod:rankOneMatching_profile:true_tol:1e-6_results.json","r") as f:
LambdaTAME_ratio = parseLambdaTAMEData(json.load(f))
#with open(TAME_RESULTS + "LVGNA_Experiments/LVGNA_pairwairAlignemnt_LambdaTAME_alphas:[.5,1.0]_betas:[0.0,1.0,10.0,100.0]_iter:15_matchingMethod:GramMatching_profile:true_tol:1e-6_results.json","r") as f:
with open(datapath+"LVGNA_pairwiseAlignment_LambdaTAME_alphas:[.5,1.0]_betas:[0.0,1.0,10.0,100.0]_iter:15_matchingMethod:GramMatching_MatchingTol:1e-8_profile:true_tol:1e-6_results.json","r") as f:
LambdaTAMEGramMatching_ratio = parseLambdaTAMEData(json.load(f))
n = len(graph_names)
problem_sizes = []
TAME_exp_ratios = []
LambdaTAME_exp_ratios = []
LambdaTAMEGramMatching_exp_ratios = []
LowRankTAME_exp_ratios = []
LowRankTAME_LRM_exp_ratios = []
Is,Js = np.triu_indices(n,k=1)
for i,j in zip(Is,Js):
TAME_exp_ratios.append(TAME_BM_ratio[i,j])
LambdaTAME_exp_ratios.append(LambdaTAME_ratio[i,j])
LambdaTAMEGramMatching_exp_ratios.append(LambdaTAMEGramMatching_ratio[i,j])
LowRankTAME_exp_ratios.append(LowRankTAME_ratio[i, j])
LowRankTAME_LRM_exp_ratios.append(LowRankTAME_LRM_ratio[i, j])
problem_sizes.append(triangle_counts[graph_names[i]]*triangle_counts[graph_names[j]])
#
# Plot results
#
if ax is None:
fig =plt.figure(figsize=(4.25,3.5))
spec = fig.add_gridspec(nrows=1, ncols=1,left=.175,right=.9,top=.95,bottom=.125)
ax = fig.add_subplot(spec[0,0])
show_plot = True
else:
show_plot = False
#ax = [ax] #jerry rigged
if useLowRank:
ax.set_ylim(1e-3,1e5)
fontsize=10
else:
ax.set_ylim(1e-2,1e5)
fontsize=14
ax.set_xlim(2e5,5e11)
label_font_size = None
#if show_plot:
ax.set_ylabel("matching runtime\ncontraction runtime",fontsize=label_font_size)
x_loc = -.19
ax.annotate('', xy=(x_loc, .29), xycoords='axes fraction', xytext=(x_loc, 0.71),
arrowprops=dict(arrowstyle="-", color='k'))
#else:
# ax.set_ylabel("matching runtime / contraction runtime")
ax.set_xlabel(r"|$T_A$||$T_B$|")
#left axis labels
ax.set_xscale("log")
ax.set_yscale("log")
loess_smoothing_frac = .3
ax.grid(which="major",zorder=-2)
ax.axhspan(1e-5,1,alpha=.1,color="k")
scatter_alpha = 0.5
#TODO: update marker types to use global vars
ax.scatter(problem_sizes,TAME_exp_ratios,label="TAME", c=T_color,marker=T_marker,alpha=scatter_alpha)
plot_1d_loess_smoothing(problem_sizes,TAME_exp_ratios,loess_smoothing_frac,ax,c=T_color,logFilter=True)#linestyle=T_linestyle,
#ax[0].plot(range(len(old_TAME_performance)), old_TAME_performance, label="TAME", c=t4_color)
if useLowRank:
T_annotationloc = (.1, .55)
else:
T_annotationloc = (.5, .05)
ax.annotate("TAME (C++)",xy=T_annotationloc, xycoords='axes fraction', c=T_color,fontsize=fontsize)
ax.scatter(problem_sizes,LowRankTAME_exp_ratios,label="LowRankTAME", c=LRT_color,alpha=scatter_alpha,marker=LRT_marker)
plot_1d_loess_smoothing(problem_sizes,LowRankTAME_exp_ratios,loess_smoothing_frac,ax,c=LRT_color,logFilter=True)#linestyle=LRT_linestyle,
if useLowRank:
LRT_annotationloc = (.01, .38)
else:
LRT_annotationloc = (.8, .36)
ax.annotate("LowRank\nTAME",xy=LRT_annotationloc, xycoords='axes fraction', c=LRT_color,ha="left",fontsize=fontsize)
ax.scatter(problem_sizes,LambdaTAMEGramMatching_exp_ratios,label="$\Lambda$-TAME", c=LT_color ,marker=LT_marker,alpha=scatter_alpha)
plot_1d_loess_smoothing(problem_sizes,LambdaTAMEGramMatching_exp_ratios,loess_smoothing_frac,ax,c=LT_color)#,linestyle=LT_linestyle
#ax[0].plot(range(len(new_TAME_performance)), new_TAME_performance, label="$\Lambda$-TAME", c=t2_color)
if useLowRank:
LT_annotationloc = (.1, .825)
else:
LT_annotationloc = (.1, .86)
ax.annotate("$\Lambda$-TAME",xy=LT_annotationloc, xycoords='axes fraction', c=LT_color,fontsize=fontsize)
if useLowRank:
ax.scatter(problem_sizes,LowRankTAME_LRM_exp_ratios,facecolors='none',edgecolors=LRT_lrm_color,label="LowRankTAME-(lrm)",marker=LRT_lrm_marker,alpha=scatter_alpha)
plot_1d_loess_smoothing(problem_sizes,LowRankTAME_LRM_exp_ratios,loess_smoothing_frac,ax,c=LRT_lrm_color,logFilter=True)#,linestyle=LRT_lrm_linestyle
ax.annotate("LowRankTAME-(lrm)",xy=(.075, .05), xycoords='axes fraction', c=LRT_lrm_color,fontsize=fontsize)
#print(new_TAME_exp_runtimes)
ax.scatter(problem_sizes,LambdaTAME_exp_ratios,label="$\Lambda$-TAME-(rom)",facecolors='none', edgecolors=LT_rom_color,marker=LT_rom_marker,alpha=scatter_alpha)
plot_1d_loess_smoothing(problem_sizes,LambdaTAME_exp_ratios,loess_smoothing_frac,ax,c=LT_rom_color,logFilter=True)#,linestyle=LT_rom_linestyle
#ax[0].plot(range(len(new_TAME_performance)), new_TAME_performance, label="$\Lambda$-TAME", c=t2_color)
ax.annotate("$\Lambda$-TAME\n(rom)",xy=(.25, .225), xycoords='axes fraction', ha="center",c=LT_rom_color,fontsize=fontsize)
#ax.text(.95, .6,"contraction\ndominates")#, ha="center",c="k",rotation=90)
#ax.text(.95, .1,"contraction\ndominates")#, ha="center",c="k",rotation=90)
if useLowRank:
ax.annotate("matching\ndominates",xy=(1.05, .6), xycoords='axes fraction', ha="center",c="k",rotation=90,fontsize=label_font_size)
ax.annotate("contraction\ndominates",xy=(1.05, 0.05), xycoords='axes fraction', ha="center",c="k",rotation=90,fontsize=label_font_size)
else:
ax.annotate("matching\ndominates",xy=(1.05, .55), xycoords='axes fraction', ha="center",c="k",rotation=90,fontsize=label_font_size)
ax.annotate("contraction\ndominates",xy=(1.05, 0.025), xycoords='axes fraction', ha="center",c="k",rotation=90,fontsize=label_font_size)
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.spines['left'].set_visible(False)
ax.spines['bottom'].set_visible(False)
ax.tick_params(axis="both",direction="out",which='both', length=0)
if show_plot and save_path is None:
plt.show()
if not (save_path is None):
plt.savefig(save_path)
# Supplementary File
def LVGNA_pre_and_post_processed(save_path=None):
#
# Load in Data
#
data_path = TAME_RESULTS + "LVGNA_Alignments/"
file = "LVGNA_pairwiseAlignment_LambdaTAME_MultiMotif_alphas:[1.0,0.5]_betas:[0.0,1.0,10.0,100.0]_order:3_samples:3000000_data.json"
file = "LVGNA_pairwiseAlignment_LambdaTAME_alphas:[0.5,1.0]_betas:[0.0,1.0,10.0,100.0]_iter:15_matchingMethod:GramMatching_postProcessing:KlauAlgo_profile:true_tol:1e-6_results.json"
with open(data_path +file,"r") as f:
data = json.load(f)
vertex_products = []
edge_products = []
motif_products = []
LT_klau_tri_match = []
LT_klau_edge_match = []
LT_klau_runtimes = []
filenames = []
#for (file_i,file_j,LT_matchedMotifs,A_Motifs,B_Motifs,A_motifDistribution,B_motifDistribution,LT_profile,LT_edges_matched,klau_edges_matched,klau_tris_matched,_,klau_setup_rt,klau_rt,L_sparsity) in data:
for (file_i,file_j,LT_matchedMotifs,A_Motifs,B_Motifs,LT_profile,LT_edges_matched,klau_edges_matched,klau_tris_matched,_,klau_setup_rt,klau_rt,L_sparsity,f_status) in data:
filenames.append((file_i,file_j))
vertex_A = vertex_counts[" ".join(file_i.split(".smat")[0].split("_"))]
vertex_B = vertex_counts[" ".join(file_j.split(".smat")[0].split("_"))]
edges_A = edge_counts[file_i.split(".smat")[0]]
edges_B = edge_counts[file_j.split(".smat")[0]]
LT_klau_runtimes.append(klau_setup_rt+klau_rt)
vertex_products.append(vertex_A*vertex_B)
edge_products.append(edges_A*edges_B)
#motif_products.append(A_Motifs[0]*B_Motifs[0])
motif_products.append(A_Motifs*B_Motifs)
LT_klau_edge_match.append(klau_edges_matched/min(edges_A,edges_B))
#LT_klau_tri_match.append(klau_tris_matched/min(A_Motifs[0],B_Motifs[0]))
LT_klau_tri_match.append(klau_tris_matched/min(A_Motifs,B_Motifs))
"""
with open(data_path + "LVGNA_pairwiseAlignment_LambdaTAME_MultiMotif_alphas:[1.0,0.5]_betas:[0.0,1.0,10.0,100.0]_order:3_postProcessing:SuccessiveKlau-const-iter:5-maxIter:500_samples:10000000_data.json","r") as f:
data = json.load(f)
successive_klau_tri_match_ratios = []
successive_klau_edge_match_ratios = []
successive_klau_runtimes = []
for (file_i,file_j,LT_matchedMotifs,A_Motifs,B_Motifs,A_motifDistribution,B_motifDistribution,LT_profile,LT_edges_matched,sklau_edges_matched,sklau_tris_matched,_,successive_klau_profiling) in data:
edges_A = edge_counts[file_i.split(".smat")[0]]
edges_B = edge_counts[file_j.split(".smat")[0]]
successive_klau_edge_match_ratios.append(sklau_edges_matched/min(edges_A,edges_B))
successive_klau_tri_match_ratios.append(sklau_tris_matched/min(A_Motifs[0],B_Motifs[0]))
successive_klau_runtimes.append(sum(successive_klau_profiling["runtime"]))
"""
#LT data comes from here
file = "LVGNA_pairwiseAlignment_LambdaTAME_MultiMotif_alphas:[1.0,0.5]_betas:[0.0,1.0,10.0,100.0]_order:3_postProcessing:TabuSearch_samples:30000000_data.json"
file = "LVGNA_pairwiseAlignment_LambdaTAME_alphas:[0.5,1.0]_betas:[0.0,1.0,10.0,100.0]_iter:15_matchingMethod:GramMatching_postProcessing:LocalSearch_profile:true_tol:1e-6_results.json"
with open(data_path + file,"r") as f:
data = json.load(f)
LT_tabu_tri_match = []
LT_tabu_edge_match = []
LT_tabu_runtimes = []
LT_tri_match = []
LT_runtimes = []
#for i,(file_i,file_j,LT_matchedMotifs,A_Motifs,B_Motifs,A_motifDistribution,B_motifDistribution,LT_profile,LT_edges_matched,tabu_edges_matched,tabu_tris_matched,matching,tabu_profile,full_rt) in enumerate(data):
for i,(file_i,file_j,LT_matchedMotifs,A_Motifs,B_Motifs,LT_profile,LT_edges_matched,tabu_edges_matched,tabu_tris_matched,matching,tabu_profile,full_rt) in enumerate(data):
assert (file_i,file_j) == filenames[i]
edges_A = edge_counts[file_i.split(".smat")[0]]
edges_B = edge_counts[file_j.split(".smat")[0]]
#LT_tri_match.append(LT_matchedMotifs[0]/min(A_Motifs[0],B_Motifs[0]))
LT_tri_match.append(LT_matchedMotifs/min(A_Motifs,B_Motifs))
LT_runtimes.append(sum([sum(profile) for profile in LT_profile.values()]))
LT_tabu_edge_match.append(tabu_edges_matched/min(edges_A,edges_B))
#LT_tabu_tri_match.append(tabu_tris_matched/min(A_Motifs[0],B_Motifs[0]))
LT_tabu_tri_match.append(tabu_tris_matched/min(A_Motifs,B_Motifs))
LT_tabu_runtimes.append(full_rt)
def parse_Cpp_data(files):
# given the file pairs to make the data consistent with
preP_tri_match_ratio = []
preP_edge_match_ratio = []
preP_runtime = []
postP_tri_match_ratio = []
postP_edge_match_ratio = []
postP_runtime = []
Opt_tri_ratio,Opt_edge_match,\
Opt_pp_edge_match,Opt_pp_tri_match,\
Runtimes, impTTV_runtimes, matching_runtimes,\
post_processing_runtime, indexing = CT_LP.parse_results()
for file_idx,(file_i,file_j) in enumerate(files):
i = indexing[file_i]
j = indexing[file_j]
preP_tri_match_ratio.append(Opt_tri_ratio[i,j])
preP_edge_match_ratio.append(Opt_edge_match[i,j])
preP_runtime.append(Runtimes[i,j])
postP_tri_match_ratio.append(Opt_pp_tri_match[i,j])
postP_edge_match_ratio.append(Opt_pp_edge_match[i,j])
postP_runtime.append(post_processing_runtime[i,j])
return preP_tri_match_ratio, preP_edge_match_ratio, preP_runtime, postP_tri_match_ratio, postP_edge_match_ratio, postP_runtime, indexing
# LREA data comes from here
with open(data_path + "LVGNA_pairwiseAlignment_LowRankEigenAlign_postProcessing:TabuSearch_profile:true_results.json") as f:
data = json.load(f)
#for (file_i,file_j,LT_matchedMotifs,A_Motifs,B_Motifs,LREA_profile,LREA_edges_matched,LREA_klau_edges_matched,LREA_klau_tris_matched,_,klau_setup_rt,klau_rt,L_sparsity,f_status) in data:
LREA_tri_match = []
LREA_runtimes = []
LREA_tabu_tri_match = []
LREA_tabu_edge_match = []
LREA_tabu_runtimes = []
for i,(file_i,file_j,LREA_matchedMotifs,A_Motifs,B_Motifs,LREA_profile,LREA_edges_matched,tabu_edges_matched,tabu_tris_matched,matching,tabu_profile,full_rt) in enumerate(data):
assert filenames[i] == (file_i,file_j)
edges_A = edge_counts[file_i.split(".smat")[0]]
edges_B = edge_counts[file_j.split(".smat")[0]]
LREA_tri_match.append(LREA_matchedMotifs/min(A_Motifs,B_Motifs))
LREA_runtimes.append(LREA_profile)
LREA_tabu_edge_match.append(tabu_edges_matched/min(edges_A,edges_B))
LREA_tabu_tri_match.append(tabu_tris_matched/min(A_Motifs,B_Motifs))
LREA_tabu_runtimes.append(full_rt)
with open(data_path + "LVGNA_pairwiseAlignment_LowRankEigenAlign_postProcessing:KlauAlgo_profile:true_results.json") as f:
data = json.load(f)
LREA_klau_tri_match = []
LREA_klau_edge_match = []
LREA_klau_runtimes = []
for i,(file_i,file_j,_,A_Motifs,B_Motifs,LREA_profile,LREA_edges_matched,LREA_klau_edges_matched,LREA_klau_tris_matched,_,klau_setup_rt,klau_rt,L_sparsity,f_status) in enumerate(data):
assert filenames[i] == (file_i,file_j)
edges_A = edge_counts[file_i.split(".smat")[0]]
edges_B = edge_counts[file_j.split(".smat")[0]]
LREA_klau_edge_match.append(LREA_klau_edges_matched/min(edges_A,edges_B))
LREA_klau_tri_match.append(LREA_klau_tris_matched/min(A_Motifs,B_Motifs))
LREA_klau_runtimes.append(klau_setup_rt+klau_rt)
file = "LVGNA_pairwiseAlignment_LowRankTAME_alphas:[0.5,1.0]_betas:[0.0,1.0,10.0,100.0]_iter:15_order:3_postProcessing:KlauAlgo_profile:true_samples:3000000_tol:1e-6_results.json"
file = "LVGNA_pairwiseAlignment_LowRankTAME_alphas:[0.5,1.0]_betas:[0.0,1.0,10.0,100.0]_iter:15_postProcessing:KlauAlgo_profile:true_tol:1e-6_results_colMajor.json"
with open(data_path + file,"r") as f:
data = json.load(f)
#add in missing \beta = 1.0 case
LRT_klau_tri_match = []
LRT_klau_edge_match = []
LRT_klau_runtimes = []
#for i,(file_i,file_j,LRT_matchedMotifs,A_Motifs,B_Motifs,A_motifDistribution,B_motifDistribution,LRT_profile,LRT_edges_matched,klau_edges_matched,klau_tris_matched,_,klau_setup_rt,klau_rt,L_sparsity,f_status) in enumerate(data):
for i,(file_i,file_j,LRT_matchedMotifs,A_Motifs,B_Motifs,LRT_profile,LRT_edges_matched,klau_edges_matched,klau_tris_matched,_,klau_setup_rt,klau_rt,L_sparsity,f_status) in enumerate(data):
assert filenames[i] == (file_i,file_j)
#i = gn_dict[" ".join(file_i.split(".smat")[0].split("_"))]
#j = gn_dict[" ".join(file_j.split(".smat")[0].split("_"))]
edges_A = edge_counts[file_i.split(".smat")[0]]
edges_B = edge_counts[file_j.split(".smat")[0]]
LRT_klau_edge_match.append(klau_edges_matched/min(edges_A,edges_B))
LRT_klau_tri_match.append(klau_tris_matched/min(A_Motifs,B_Motifs))
LRT_klau_runtimes.append(klau_setup_rt + klau_rt)
# LRT data comes from here
file = "LVGNA_pairwiseAlignment_LowRankTAME_alphas:[1.0,0.5]_betas:[0.0,1.0,10.0,100.0]_iter:15_order:3_postProcessing:TabuSearch_profile:true_tol:1e-6_results.json"
file = "LVGNA_pairwiseAlignment_LowRankTAME_alphas:[0.5,1.0]_betas:[0.0,1.0,10.0,100.0]_iter:15_postProcessing:LocalSearch_profile:true_tol:1e-6_results_colMajor.json"
with open(data_path + file,"r") as f:
data = json.load(f)
LRT_tri_match = []
LRT_runtimes = []
LRT_tabu_tri_match = []
LRT_tabu_edge_match = []
LRT_tabu_runtimes = []
LRT_runtimes = []
#for i,(file_i,file_j,LRT_matchedMotifs,A_Motifs,B_Motifs,A_motifDistribution,B_motifDistribution,LRT_profile,LRT_edges_matched,tabu_edges_matched,tabu_tris_matched,matching,tabu_profile,tabu_full_rt) in enumerate(data):
for i,(file_i,file_j,LRT_matchedMotifs,A_Motifs,B_Motifs,LRT_profile,LRT_edges_matched,tabu_edges_matched,tabu_tris_matched,matching,tabu_profile,tabu_full_rt) in enumerate(data):
assert filenames[i] == (file_i,file_j)
#i = gn_dict[" ".join(file_i.split(".smat")[0].split("_"))]
#j = gn_dict[" ".join(file_j.split(".smat")[0].split("_"))]
edges_A = edge_counts[file_i.split(".smat")[0]]
edges_B = edge_counts[file_j.split(".smat")[0]]
LRT_tabu_edge_match.append(tabu_edges_matched/min(edges_A,edges_B))
LRT_tabu_tri_match.append(tabu_tris_matched/min(A_Motifs,B_Motifs))
LRT_tabu_runtimes.append(tabu_full_rt)
pre_processed_time = 0.0
for (param, profile) in LRT_profile:
pre_processed_time += sum([sum(v) for (k,v) in profile.items() if "timings" in k])
LRT_tri_match.append(LRT_matchedMotifs/min(A_Motifs,B_Motifs))
LRT_runtimes.append(pre_processed_time)
TAME_preP_tri_match_ratio, TAME_preP_edge_match_ratio, TAME_preP_runtime,\
TAME_postP_tri_match_ratio, TAME_postP_edge_match_ratio, TAME_postP_runtime, \
exp_indexing = parse_Cpp_data(filenames)
graph_names = [" ".join(file.split(".smat")[0].split("_")) for (file,idx) in sorted(exp_indexing.items(),key=lambda x:x[1])]
gn_dict = {graph:i for (i,graph) in enumerate(graph_names)}
LGRAAL_graphs, LGRAAL_tri_results, LGRAAL_runtimes, _,_, _,_ = get_results()
LGRAAL_perm = [gn_dict[graph] for graph in LGRAAL_graphs]
LGRAAL_tri_results = LGRAAL_tri_results[np.ix_(LGRAAL_perm, LGRAAL_perm)]
LGRAAL_runtimes = LGRAAL_runtimes[np.ix_(LGRAAL_perm, LGRAAL_perm)]
LGRAAL_tri_match = []
LGRAAL_runtime = []
for (file_i,file_j) in filenames:
i = exp_indexing[file_i]
j = exp_indexing[file_j]
LGRAAL_tri_match.append(LGRAAL_tri_results[i,j])
LGRAAL_runtime.append(LGRAAL_runtimes[i,j])
#
# Plot the Data
#
fig = plt.figure(figsize=(9,7))
gs = fig.add_gridspec(nrows=2, ncols=1,
left=0.05, right=0.975,top=.95,bottom=.1,
wspace=0.1,hspace=0.1
)
height_ratios = [.5,1.0,1.0]
tri_match_gs = gs[0].subgridspec(nrows=3,ncols=5,hspace=0.4,wspace=0.2,height_ratios=height_ratios)
tri_match_axes = np.empty((3,5),object)
runtime_gs = gs[1].subgridspec(nrows=1,ncols=2,
#left=0.125, right=0.9,top=.95,bottom=.075,
wspace=0.1,hspace=0.1)
runtime_axes = np.empty(2,object)
# -- Plot Runtime Data -- #
for i in range(2):
runtime_axes[i] = fig.add_subplot(runtime_gs[i])
pre_index = 0
post_index = 1
loess_frac = .3
annotation_fontsize = 10
preP_data_to_plot = [
(LRT_runtimes,LRT_color,LRT_linestyle,"LowRankTAME",(.665,.61),12.6,"both"),#-.05,.43)
(LREA_runtimes,LREigenAlign_color,LREigenAlign_linestyle,"LowRankEigenAlign",(.5,.075),7.5,"both"),
(LT_runtimes,LT_color,LT_linestyle,r"$\Lambda-$TAME",(.35,.3),0,"both"),
(TAME_preP_runtime,T_color,T_linestyle,"TAME (C++)",(.6,.7),20,"both"),
(LGRAAL_runtime,LGRAAL_color,LGRAAL_linestyle,"LGRAAL",(.3,.6),0,"both"),
]
for (tri_match_data,color,linestyle,annotation_text,annotation_loc,annotation_angle,logFilterAx) in preP_data_to_plot:
#runtime_axes[pre_index].scatter(motif_products,tri_match_data)
plot_1d_loess_smoothing(motif_products,tri_match_data,loess_frac,runtime_axes[pre_index],
c=color,logFilter=True,logFilterAx=logFilterAx)#linestyle=linestyle,
runtime_axes[pre_index].annotate(annotation_text,xy=annotation_loc,c=color,
xycoords='axes fraction',ha="left",rotation=annotation_angle,
fontsize=annotation_fontsize)
postP_data_to_plot = [
(LRT_klau_runtimes,LRT_Klau_color,LRT_Klau_linestyle,"LRT-Klau",(.1,.45),0),
(LRT_tabu_runtimes,LRT_Tabu_color,LRT_Tabu_linestyle,"LRT-LS",(.1,.175),-5),
(LREA_klau_runtimes,LREA_Klau_color,LRT_Klau_linestyle,"LREA-Klau",(.35,.41),12.5),
(LREA_tabu_runtimes,LREA_Tabu_color,LREA_Tabu_linestyle,"LREA-LS",(.9,.6),12.5),
(LT_klau_runtimes,LT_Klau_color,LT_Klau_linestyle,r"$\Lambda$T-Klau",(.9,.45),10),
(LT_tabu_runtimes,LT_Tabu_color,LT_Tabu_linestyle,r"$\Lambda$T-LS",(.525,.225),7.5),
(TAME_postP_runtime,T_color,T_linestyle,"TAME (C++)\nLocal Search",(.525,.75),0),
]
for (tri_match_data,color,linestyle,annotation_text,annotation_loc,annotation_angle) in postP_data_to_plot:
plot_1d_loess_smoothing(motif_products,tri_match_data,loess_frac,runtime_axes[post_index],
c=color,logFilter=True,logFilterAx="both")#linestyle=linestyle,
runtime_axes[post_index].annotate(annotation_text,xy=annotation_loc,c=color,
xycoords='axes fraction',ha="center",rotation=annotation_angle,
fontsize=annotation_fontsize)
annotation_fontsize = 12
# -- Plot Tri Match Data -- #
for i in range(3):
for j in range(5):
tri_match_axes[i,j] = fig.add_subplot(tri_match_gs[i,j])
preP_triMatch_data_to_plot = [
(LGRAAL_tri_match,LGRAAL_color,LGRAAL_linestyle),
(LT_tri_match,LT_color,LT_linestyle),
(LRT_tri_match,LRT_color,LRT_linestyle),
(LREA_tri_match,LREigenAlign_color,LREigenAlign_linestyle),
(TAME_preP_tri_match_ratio,T_color,T_linestyle),
]
for j,(exp_tri_match,color,linestyle) in enumerate(preP_triMatch_data_to_plot):
tri_match_axes[0,j].scatter(motif_products,exp_tri_match,s=5,c=color,zorder=3,alpha=.5)
plot_1d_loess_smoothing(motif_products,exp_tri_match,loess_frac,tri_match_axes[0,j],
c=color,logFilter=True,logFilterAx="x")#,linestyle=linestyle
postP_triMatch_data_to_plot = [
[(None,LGRAAL_color,LGRAAL_linestyle)],
[(LT_tabu_tri_match,LT_Tabu_color,LT_Tabu_linestyle),(LT_klau_tri_match,LT_Klau_color,LT_Klau_linestyle)],
[(LRT_tabu_tri_match,LRT_Tabu_color,LRT_Tabu_linestyle),(LRT_klau_tri_match,LRT_Klau_color,LRT_Klau_linestyle)],
[(LREA_tabu_tri_match,LREA_Tabu_color,LREA_Tabu_linestyle),(LREA_klau_tri_match,LREA_Klau_color,LREA_Klau_linestyle)],
[(TAME_postP_tri_match_ratio,T_color,T_linestyle)],
]
for j,post_processed_exps in enumerate(postP_triMatch_data_to_plot):
for (exp_tri_match,color,linestyle) in post_processed_exps:
if exp_tri_match is not None:
tri_match_axes[1,j].scatter(motif_products,exp_tri_match,s=5,c=color,zorder=3,alpha=.25)
plot_1d_loess_smoothing(motif_products,exp_tri_match,loess_frac,tri_match_axes[1,j],
c=color,logFilter=True,logFilterAx="both")#linestyle=linestyle,
postP_edgeMatch_data_to_plot = [
[(None,LGRAAL_color,LGRAAL_linestyle)],
[(LT_tabu_edge_match,LT_Tabu_color,LT_Tabu_linestyle),(LT_klau_edge_match,LT_Klau_color,LT_Klau_linestyle)],
[(LRT_tabu_edge_match,LRT_Tabu_color,LRT_Tabu_linestyle),(LRT_klau_edge_match,LRT_Klau_color,LRT_Klau_linestyle)],
[(LREA_tabu_edge_match,LREA_Tabu_color,LREA_Tabu_linestyle),(LREA_klau_edge_match,LREA_Klau_color,LREA_Klau_linestyle)],
[(TAME_postP_edge_match_ratio,T_color,T_linestyle)],
]
for j,post_processed_exps in enumerate(postP_edgeMatch_data_to_plot):
for (exp_tri_match,color,linestyle) in post_processed_exps:
if exp_tri_match is not None:
tri_match_axes[2,j].scatter(motif_products,exp_tri_match,s=5,c=color,zorder=3,alpha=.25)
plot_1d_loess_smoothing(motif_products,exp_tri_match,loess_frac,tri_match_axes[2,j],
c=color,logFilter=True,logFilterAx="both")#linestyle=linestyle,
#
# Touch up the Axes
#
for ax in chain(runtime_axes.reshape(-1),tri_match_axes.reshape(-1)):
ax.set_xscale("log")
ax.grid(True)
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.spines['left'].set_visible(False)
ax.spines['bottom'].set_visible(False)
ax.tick_params(axis="both",direction="out",which='both', length=0)
ax.set_xticks([1e6,1e7,1e8,1e9,1e10,1e11])
for ax in runtime_axes:
ax.set_xlabel(r"$|T_A||T_B|$")
ax.set_yscale("log")
ax.set_ylim(5e0,3e6)
ax.set_yticks([1e1,1e2,1e3,1e4,1e5,1e6])
ax.tick_params(axis="y",which="both",pad=6)
runtime_axes[0].set_yticklabels([])
for j,ax in enumerate(tri_match_axes[0,:]):
ax.set_ylim(0,.5)
ax.set_yticks([0.0,.25,.5])
if j == 0:
ax.set_yticklabels([])
else:
ax.set_yticklabels(["0",".25",".5"],ha='center')
for j,ax in enumerate(tri_match_axes[1,:]):
ax.set_ylim(0,1)
ax.set_yticks([0.0,.25,.5,.75,1.0])
if j == 1:
ax.set_yticklabels([])
else:
ax.set_yticklabels(["0",".25",".5",".75","1"],ha='center')
for j,ax in enumerate(tri_match_axes[2,:]):
ax.set_ylim(0,.75)
ax.set_yticks([0.0,.25,.5,.75])
if j == 1:
ax.set_yticklabels([])
else:
ax.set_yticklabels(["0",".25",".5",".75"],ha='center')
for ax in tri_match_axes.reshape(-1):
ax.set_xticklabels([])
ax.tick_params(axis="y",which="both",pad=12)
tri_match_axes[1,0].axes.set_axis_off()
tri_match_axes[2,0].axes.set_axis_off()
#LGRAAL doesn't have post processing
preP_tri_match_annotations = [
("LGRAAL",LGRAAL_color,(.5,1.3)),
(r"$\Lambda-$TAME",LT_color,(.5,1.3)),
("LowRankTAME",LRT_color,(.5,1.3)),
("LowRank\nEigenAlign",LREigenAlign_color,(.5,1.3)),
("TAME",T_color,(.5,1.3)),
]
for j,(label,color,xy) in enumerate(preP_tri_match_annotations):
tri_match_axes[0,j].annotate(label,xy=xy,c=color,xycoords='axes fraction',ha="center",va="top",
fontsize=annotation_fontsize)
postP_tri_match_annotations = [
[(None,LGRAAL_color,(.5,.5),1)],
[(r"$\Lambda$T-Klau",LT_Klau_color,(.8,.01),1),(r"$\Lambda$T-LS",LT_Tabu_color,(.7,.7),1)],
[("LRT-Klau",LRT_Klau_color,(.75,-.1),1),("LRT-LS",LRT_Tabu_color,(.5,.65),1)],
[("LREA-Klau",LREA_Klau_color,(.7,-.15),1),("LREA-LS",LREA_Tabu_color,(.65,.65),1)],
[("TAME (C++)\nLocal Search",T_color,(.4,.375),2)],
]
for j,postP_annotations in enumerate(postP_tri_match_annotations):
for (label,color,xy,row_idx) in postP_annotations:
if label is not None:
tri_match_axes[row_idx,j].annotate(label,xy=xy,c=color,xycoords='axes fraction',ha="center",
fontsize=annotation_fontsize)
tri_match_axes[0,0].set_ylabel("matched tris\n"+r"$\min{\{|T_A|,|T_B|\}}$",labelpad=-7.5)
xloc = -.18
tri_match_axes[0,0].annotate('', xy=(xloc, -.4), xycoords='axes fraction', xytext=(xloc, 1.4),
arrowprops=dict(arrowstyle="-", color='k'))
tri_match_axes[0,0].set_xlabel(r"$|T_A||T_B|$")
tri_match_axes[1,1].set_ylabel("(refined)\nmatched tris\n"+r"$\min{\{|T_A|,|T_B|\}}$",labelpad=-7.5)
xloc = -.18
tri_match_axes[1,1].annotate('', xy=(xloc, .025), xycoords='axes fraction', xytext=(xloc, .975),
arrowprops=dict(arrowstyle="-", color='k'))
tri_match_axes[2,1].set_ylabel("(refined)\nmatched edges\n"+r"$\min{\{|E_A|,|E_B|\}}$",labelpad=-7.5)
xloc = -.18
tri_match_axes[2,1].annotate('', xy=(xloc, -.05), xycoords='axes fraction', xytext=(xloc, 1.05),
arrowprops=dict(arrowstyle="-", color='k'))
runtime_axes[0].set_ylabel("runtime (s)")
title_size = 18
bbox = dict(boxstyle="round", ec="w", fc="w", alpha=1.0,pad=.05)
x_loc = 0.18
y_loc = .975
y_gap = .1
runtime_axes[0].annotate("Pre",xy=(x_loc,y_loc), xycoords='axes fraction',ha="center",va="top",fontsize=title_size).set_bbox(bbox)
runtime_axes[0].annotate("Processed",xy=(x_loc,y_loc-y_gap), xycoords='axes fraction',ha="center",va="top",fontsize=title_size//2).set_bbox(bbox)
x_loc = 0.2025
runtime_axes[1].annotate("Post",xy=(x_loc,y_loc), xycoords='axes fraction',ha="center",va="top",fontsize=title_size).set_bbox(bbox)
runtime_axes[1].annotate("Processed",xy=(x_loc,y_loc-y_gap), xycoords='axes fraction',ha="center",va="top",fontsize=title_size//2).set_bbox(bbox)
# -- #
if save_path is None:
plt.show()
else:
plt.savefig(save_path)
#
# Random Graph Experiment Plots
#
def RandomGeometricRG_PostProcessing_is_needed(save_path=None):
data_location = TAME_RESULTS + "klauExps/"
fig = plt.figure(figsize=(4.5,4.5))
#fig, axes = plt.subplots(2,2,figsize=(4.25,5))
n = 2
m = 2
spec = fig.add_gridspec(nrows=n, ncols=m,hspace=0.1,wspace=0.15,left=.15,right=.975,top=.95,bottom=.15)
all_ax = []
axes = np.empty((n,m),object)
for i in range(n):
for j in range(m):
ax = fig.add_subplot(spec[i,j])
axes[i,j] = ax
def process_ER_Noise_data(data,version="klau_old"):
p_idx = {p:i for (i,p) in enumerate(sorted(set([datum[1] for datum in data])))}
n_idx = {p:i for (i,p) in enumerate(sorted(set([datum[2] for datum in data])))}
trials = int(len(data)/(len(p_idx)*len(n_idx)))
accuracy = np.zeros((len(p_idx),len(n_idx),trials))
LT_klauAccuracy = np.zeros((len(p_idx),len(n_idx),trials))
triMatch = np.zeros((len(p_idx),len(n_idx),trials))
LT_klauTriMatch = np.zeros((len(p_idx),len(n_idx),trials))
trial_idx = np.zeros((len(p_idx),len(n_idx)),int)
for datum in data:
if version == "klau_new":
(seed,p,n,acc,dup_tol_acc,matched_tris,tri_A,tri_B,_,profiling,edges,klau_edges,klau_tri_match,klau_acc,_,klau_setup,klau_rt,L_sparsity,fbounds) = datum
elif version == "klau_old":
(seed,p,n,acc,dup_tol_acc,matched_tris,tri_A,tri_B,_,profiling,edges,klau_edges,klau_tri_match,klau_acc,_,klau_setup,klau_rt) = datum
elif version == "tabu":
(seed,p,n,acc,dup_tol_acc,matched_tris,tri_A,tri_B,_,profiling,edges,klau_edges,klau_tri_match,klau_acc,_,klau_setup,klau_rt) = datum
else:
raise ValueError("only supports ")
i = p_idx[p]
j = n_idx[n]
accuracy[i,j,trial_idx[i,j]] = acc
LT_klauAccuracy[i,j,trial_idx[i,j]] = klau_acc
triMatch[i,j,trial_idx[i,j]] = matched_tris/min(tri_A,tri_B)
LT_klauTriMatch[i,j,trial_idx[i,j]] = klau_tri_match/min(tri_A,tri_B)
trial_idx[i,j] += 1
return accuracy, LT_klauAccuracy, triMatch, LT_klauTriMatch, p_idx, n_idx
def process_Dup_Noise_data(data,version="old"):
p_idx = {p:i for (i,p) in enumerate(sorted(set([datum[1] for datum in data])))}
n_idx = {n:i for (i,n) in enumerate(sorted(set([datum[2] for datum in data])))}
sp_idx = {sp:i for (i,sp) in enumerate(sorted(set([datum[3] for datum in data])))}
trials = int(len(data)/(len(p_idx)*len(n_idx)*len(sp_idx)))
accuracy = np.zeros((len(p_idx),len(n_idx),len(sp_idx),trials))
klauAccuracy = np.zeros((len(p_idx),len(n_idx),len(sp_idx),trials))
triMatch = np.zeros((len(p_idx),len(n_idx),len(sp_idx),trials))
LT_klauTriMatch = np.zeros((len(p_idx),len(n_idx),len(sp_idx),trials))
trial_idx = np.zeros((len(p_idx),len(n_idx),len(sp_idx)),int)
for datum in data:
if version == "old":
(seed,p,n,sp,acc,dup_tol_acc,matched_tris,tri_A,tri_B,_,profiling,edges,klau_edges,klau_tri_match,klau_acc,_,klau_setup,klau_rt) = datum
elif version == "new klau":
(seed,p,n,sp,acc,dup_tol_acc,matched_tris,tri_A,tri_B,_,profiling,edges,klau_edges,klau_tri_match,klau_acc,_,klau_setup,klau_rt,L_sparsity,fstatus) = datum
else:
print(f"only supports 'old' and 'new klau', got {version}")
i = p_idx[p]
j = n_idx[n]
k = sp_idx[sp]
accuracy[i,j,k,trial_idx[i,j,k]] = acc
klauAccuracy[i,j,k,trial_idx[i,j,k]] = klau_acc
triMatch[i,j,k,trial_idx[i,j,k]] = matched_tris/min(tri_A,tri_B)
LT_klauTriMatch[i,j,k,trial_idx[i,j,k]] = klau_tri_match/min(tri_A,tri_B)
trial_idx[i,j,k] += 1
return accuracy, klauAccuracy, triMatch,LT_klauTriMatch, p_idx, n_idx, sp_idx
def make_percentile_plot(plot_ax, x_domain,data,color,hatch=None,**kwargs):
#TODO: check on scope priorities of ax for closures
lines = [(lambda col: np.percentile(col,50),1.0,color) ]
ribbons = [
(20,80,.05,color)
]
#plot_percentiles(plot_ax, data.T, x_domain, lines, ribbons,**kwargs)
n,m = data.shape
percentile_linewidth=.01
for (lower_percentile,upper_percentile,alpha,color) in ribbons:
#plot_ax.plot(np.percentile(data.T, lower_percentile, axis=0),c=color,linewidth=percentile_linewidth)
#plot_ax.plot(np.percentile(data.T, upper_percentile, axis=0),c=color,linewidth=percentile_linewidth)
plot_ax.fill_between(x_domain,
np.percentile(data.T, lower_percentile, axis=0),
np.percentile(data.T, upper_percentile, axis=0),
facecolor=color,alpha=.1,edgecolor=color)
for (col_func,alpha,color) in lines:
line_data = []
for i in range(n):
line_data.append(col_func(data[i,:]))
plot_ax.plot(x_domain,line_data,alpha=alpha,c=color,**kwargs)
#
# Erdos Reyni Noise
#
data_location = TAME_RESULTS + "RG_ERNoise/"
file = 'LambdaTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:ErdosReyni_p:[0.05]_postProcess:KlauAlgo_trialcount:20.json'
with open(data_location + file,'r') as f:
accuracy, LT_klauAccuracy,triMatch,LT_klauTriMatch, p_idx, n_idx = process_ER_Noise_data(json.load(f),"klau_new")
file = 'LambdaTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:ErdosReyni_p:[0.05]_postProcess:TabuSearch_trialcount:20.json'
with open(data_location + file,'r') as f:
_, LT_TabuAccuracy, _, LT_TabuTriMatch, p_idx, n_idx = process_ER_Noise_data(json.load(f),"tabu")
file = "LowRankTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:ErdosReyni_p:[0.05]_postProcess:KlauAlgo_trialcount:20.json"
with open(data_location + file,'r') as f:
LRT_accuracy, LRT_KlauAccuracy, LRT_triMatch, LRT_KlauTriMatch, p_idx, n_idx = process_ER_Noise_data(json.load(f),"klau_new")
file = "LowRankTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:ErdosReyni_p:[0.05]_postProcess:TabuSearch_trialcount:20.json"
with open(data_location + file,'r') as f:
_, LRT_TabuAccuracy,_,LRT_TabuTriMatch, p_idx, n_idx = process_ER_Noise_data(json.load(f),"tabu")
file = "LowRankTAME-lrm_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:ErdosReyni_p:[0.05]_postProcess:KlauAlgo_trialcount:20.json"
with open(data_location + file,'r') as f:
_, LRT_lrm_KlauAccuracy, _, LRT_lrm_KlauTriMatch, p_idx, n_idx = process_ER_Noise_data(json.load(f),"klau_new")
file = "LowRankEigenAlign_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:ErdosReyni_p:[0.05]_postProcess:KlauAlgo_trialcount:20.json"
with open(data_location + file,'r') as f:
LREA_Accuracy, LREA_KlauAccuracy, LREA_TriMatch, LREA_KlauTriMatch, p_idx, n_idx = process_ER_Noise_data(json.load(f),"klau_new")
file = "LowRankEigenAlign_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:ErdosReyni_p:[0.05]_postProcess:TabuSearch_trialcount:20.json"
with open(data_location + file,'r') as f:
_, LREA_TabuAccuracy, _, LREA_TabuTriMatch, _, _ = process_ER_Noise_data(json.load(f),"tabu")
sub_ax = axes[:,0]
spectral_embedding_exps = [
(accuracy,triMatch,LT_color,LT_linestyle),
(LRT_accuracy,LRT_triMatch,LRT_color,LRT_linestyle),
(LREA_Accuracy, LREA_TriMatch,LREigenAlign_color,LREigenAlign_linestyle),
]
post_processing_exps = [
(LT_klauAccuracy,LT_klauTriMatch,LT_Klau_color,LT_Klau_linestyle),
(LT_TabuAccuracy,LT_TabuTriMatch,LT_Tabu_color,LT_Tabu_linestyle),
#(LRT_lrm_KlauAccuracy,LRT_lrm_KlauTriMatch,LRM_lrm_Klau_color),
(LRT_KlauAccuracy,LRT_KlauTriMatch,LRT_Klau_color,LRT_Klau_linestyle),
(LRT_TabuAccuracy,LRT_TabuTriMatch,LRT_Tabu_color,LRT_Tabu_linestyle),
(LREA_TabuAccuracy, LREA_TabuTriMatch,LREA_Tabu_color,LREA_Tabu_linestyle),
(LREA_KlauAccuracy, LREA_KlauTriMatch,LREA_Klau_color,LREA_Klau_linestyle),
]
for (acc,tri,c,linestyle) in chain(spectral_embedding_exps,post_processing_exps):
make_percentile_plot(axes[0,0],n_idx.keys(),acc[0,:,:],c,linestyle=linestyle)
make_percentile_plot(axes[1,0],n_idx.keys(),tri[0,:,:],c,linestyle=linestyle)
#
# Duplcation Noise
#
default_p = .5
default_sp = .25
sub_ax = axes[:,1]
data_location = TAME_RESULTS + "RG_DupNoise/"
file = "LambdaTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:Duplication_p:[0.5]_sp:[0.25]_postProcess:KlauAlgo_trialcount:20.json"
with open(data_location + file,'r') as f:
accuracy, LT_klauAccuracy,triMatch,LT_klauTriMatch, p_idx, n_idx, sp_idx = process_Dup_Noise_data(json.load(f))
file = 'LambdaTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:Duplication_p:[0.5]_sp:[0.25]_postProcess:TabuSearch_trialcount:20.json'
with open(data_location + file,'r') as f:
_, LT_TabuAccuracy,_,LT_TabuTriMatch, p_idx, n_idx, sp_idx = process_Dup_Noise_data(json.load(f))
file = "LowRankTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:Duplication_p:[0.5]_sp:[0.25]_postProcess:TabuSearch_trialcount:20.json"
with open(data_location + file,'r') as f:
LRT_accuracy, LRT_TabuAccuracy,LRT_triMatch,LRT_TabuTriMatch, p_idx, n_idx, sp_idx = process_Dup_Noise_data(json.load(f))
file = "LowRankTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:Duplication_p:[0.5]_sp:[0.25]_postProcess:KlauAlgo_trialcount:20.json"
with open(data_location + file,'r') as f:
_, LRT_KlauAccuracy,_,LRT_KlauTriMatch, p_idx, n_idx, sp_idx = process_Dup_Noise_data(json.load(f),"new klau")
file = "LowRankTAME-lrm_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:Duplication_p:[0.5]_sp:[0.25]_postProcess:KlauAlgo_trialcount:20.json"
with open(data_location + file,'r') as f:
_, LRT_lrm_KlauAccuracy,_,LRT_lrm_KlauTriMatch, p_idx, n_idx, sp_idx = process_Dup_Noise_data(json.load(f),"new klau")
file ="LowRankEigenAlign_graphType:RG_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:Duplication_p:[0.5]_sp:[0.25]_postProcess:KlauAlgo_trialcount:20.json"
with open(data_location + file,'r') as f:
LREA_Accuracy, LREA_KlauAccuracy,LREA_TriMatch,LREA_KlauTriMatch, _, _, _ = process_Dup_Noise_data(json.load(f),"new klau")
file ="LowRankEigenAlign_graphType:RG_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:Duplication_p:[0.5]_sp:[0.25]_postProcess:TabuSearch_trialcount:20.json"
with open(data_location + file,'r') as f:
_, LREA_TabuAccuracy,_,LREA_TabuTriMatch, _, _, _ = process_Dup_Noise_data(json.load(f))
n_exps = [
(accuracy,triMatch,LT_color,None,LT_linestyle),
(LT_klauAccuracy,LT_klauTriMatch,LT_Klau_color,None,LT_Klau_linestyle),
(LT_TabuAccuracy,LT_TabuTriMatch,LT_Tabu_color,None,LT_Tabu_linestyle),
(LRT_accuracy,LRT_triMatch,LRT_color,None,LRT_linestyle),
(LRT_TabuAccuracy,LRT_TabuTriMatch,LRT_Tabu_color,None,LRT_Tabu_linestyle),
(LRT_KlauAccuracy,LRT_KlauTriMatch,LRT_Klau_color,None,LRT_Klau_linestyle),
(LREA_Accuracy, LREA_TriMatch,LREigenAlign_color,None,LREigenAlign_linestyle),
(LREA_KlauAccuracy, LREA_KlauTriMatch,LREA_Klau_color,None,LREA_Klau_linestyle),
(LREA_TabuAccuracy,LREA_TabuTriMatch,LREA_Tabu_color,None,LREA_Tabu_linestyle),
#(LRT_lrm_KlauAccuracy,LRT_lrm_KlauTriMatch,LRT_lrm_Klau_color),
]
for (acc, tri, c,hatch,linestyle) in n_exps:
make_percentile_plot(sub_ax[0],n_idx.keys(),acc[p_idx[default_p],:,sp_idx[default_sp],:],c,linestyle=linestyle)
make_percentile_plot(sub_ax[1],n_idx.keys(),tri[p_idx[default_p],:,sp_idx[default_sp],:],c,linestyle=linestyle)
#
# Final touches on axis
#
title_size = 12
bbox = dict(boxstyle="round", fc="w",ec="w",alpha=1.0,pad=.05)
axes[0,0].annotate(u"Erdős Rényi",xy=(.975,.975), xycoords='axes fraction',ha="right",va="top",fontsize=title_size).set_bbox(bbox)
axes[0,1].annotate("Duplication",xy=(.975,.975), xycoords='axes fraction',ha="right",va="top",fontsize=title_size).set_bbox(bbox)
axes[1,1].annotate(r"$\Lambda$T",xy=(.4,.25),color=LT_color,xycoords="axes fraction",ha="center",va="center",fontsize=10,rotation=-15)
axes[1,1].annotate("LRT",xy=(.4,.1),color=LRT_color,xycoords="axes fraction",ha="center",va="center",fontsize=10,rotation=-7.5)
axes[1,1].annotate("LREA",xy=(.01,.005),color=LREigenAlign_color,xycoords="axes fraction",ha="left",va="bottom",fontsize=10,rotation=0)
axes[1,0].annotate("LRT-Klau",xy=(.575,.325),color=LRT_Klau_color,xycoords="axes fraction",ha="center",va="center",fontsize=10,rotation=-5)
axes[1,0].annotate(r"$\Lambda$T-"+"Klau",xy=(.6,.62),color=LT_Klau_color,xycoords="axes fraction",ha="center",va="center",fontsize=10,rotation=-26)
axes[1,0].annotate("LREA-Klau",xy=(.275,.55),color=LREA_Klau_color,xycoords="axes fraction",ha="center",va="center",fontsize=10,rotation=-35)
axes[0,1].annotate(r"$\Lambda$T-"+"LS",xy=(.775,.525),color=LT_Tabu_color,xycoords="axes fraction",ha="center",va="center",fontsize=10,rotation=-2.5)
axes[0,1].annotate("LRT-LS",xy=(.775,.74),color=LRT_Tabu_color,xycoords="axes fraction",ha="center",va="center",fontsize=10,rotation=0)
axes[0,1].annotate("LREA-LS",xy=(.375,.575),color=LREA_Tabu_color,xycoords="axes fraction",ha="center",va="center",fontsize=10,rotation=-40)
for ax in axes[0,:]:
ax.set_xticklabels([])
for ax in axes[1,:]:
ax.tick_params(axis="x",direction="out",pad=1)
ax.set_xticklabels(["100","250","500","1000","1250","1500"],rotation=60)
ax.set_xlabel(r"$|V_A|$")
for ax in axes.reshape(-1):
ax.set_ylim(0.0,1.00)
ax.grid(True)
axes[0,0].set_ylabel("accuracy")
axes[1,0].set_ylabel("matched tris\n"+r"$\min{\{|T_A|,|T_B|\}}$",labelpad=0)
xloc = -.26
axes[1,0].annotate('', xy=(xloc, .2), xycoords='axes fraction', xytext=(xloc, 0.8),
arrowprops=dict(arrowstyle="-", color='k'))
#axes[0,0].set_yticklabels([])
for ax in axes[:,1]:
ax.set_yticklabels([])
#axes[1,1].yaxis.set_label_position("right")
for ax in axes[:,1]:
ax.yaxis.tick_right()
for ax in axes.reshape(-1):
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.spines['left'].set_visible(False)
ax.spines['bottom'].set_visible(False)
ax.tick_params(axis="both",direction="out",which='both', length=0)
ax.set_ylim(-.00,1.00)
ax.grid(True)
ax.set_xlim(min(n_idx.keys()),max(n_idx.keys()))
ax.set_xticks([100, 250, 500, 1000, 1250, 1500])
ax.set_xlim(100,1500)
if save_path is None:
plt.show()
else:
plt.savefig(save_path)
# Supplemental File
def RandomGeometricDupNoise_allModes(save_path=None):
data_location = TAME_RESULTS + "RG_DupNoise/"
fig= plt.figure(figsize=(5.75,4))
n = 2
m = 3
spec = fig.add_gridspec(nrows=n, ncols=m,hspace=0.1,wspace=0.15,left=.125,right=.975,top=.975,bottom=.2)
all_ax = []
all_ax_gs = np.empty((n,m),object)
def process_data(data,version="old"):
p_idx = {p:i for (i,p) in enumerate(sorted(set([datum[1] for datum in data])))}
n_idx = {n:i for (i,n) in enumerate(sorted(set([datum[2] for datum in data])))}
sp_idx = {sp:i for (i,sp) in enumerate(sorted(set([datum[3] for datum in data])))}
trials = int(len(data)/(len(p_idx)*len(n_idx)*len(sp_idx)))
accuracy = np.zeros((len(p_idx),len(n_idx),len(sp_idx),trials))
klauAccuracy = np.zeros((len(p_idx),len(n_idx),len(sp_idx),trials))
triMatch = np.zeros((len(p_idx),len(n_idx),len(sp_idx),trials))
LT_klauTriMatch = np.zeros((len(p_idx),len(n_idx),len(sp_idx),trials))
trial_idx = np.zeros((len(p_idx),len(n_idx),len(sp_idx)),int)
for datum in data:
if version == "old":
(seed,p,n,sp,acc,dup_tol_acc,matched_tris,tri_A,tri_B,_,profiling,edges,klau_edges,klau_tri_match,klau_acc,_,klau_setup,klau_rt) = datum
elif version == "new klau":
(seed,p,n,sp,acc,dup_tol_acc,matched_tris,tri_A,tri_B,_,profiling,edges,klau_edges,klau_tri_match,klau_acc,_,klau_setup,klau_rt,L_sparsity,fstatus) = datum
else:
print(f"only supports 'old' and 'new klau', got {version}")
i = p_idx[p]
j = n_idx[n]
k = sp_idx[sp]
accuracy[i,j,k,trial_idx[i,j,k]] = acc
klauAccuracy[i,j,k,trial_idx[i,j,k]] = klau_acc
triMatch[i,j,k,trial_idx[i,j,k]] = matched_tris/min(tri_A,tri_B)
LT_klauTriMatch[i,j,k,trial_idx[i,j,k]] = klau_tri_match/min(tri_A,tri_B)
trial_idx[i,j,k] += 1
return accuracy, klauAccuracy, triMatch,LT_klauTriMatch, p_idx, n_idx, sp_idx
def make_percentile_plot(plot_ax, x_domain,data,color,hatch=None,**kwargs):
lines = [(lambda col: np.percentile(col,50),1.0,color) ]
ribbons = [
(20,80,.05,color)
]
n,m = data.shape
percentile_linewidth=.01
for (lower_percentile,upper_percentile,alpha,color) in ribbons:
plot_ax.fill_between(x_domain,
np.percentile(data.T, lower_percentile, axis=0),
np.percentile(data.T, upper_percentile, axis=0),
facecolor=color,alpha=.1,edgecolor=color)
for (col_func,alpha,color) in lines:
line_data = []
for i in range(n):
line_data.append(col_func(data[i,:]))
plot_ax.plot(x_domain,line_data,alpha=alpha,c=color,**kwargs)
#hatches
LRT_Klau_hatch = None#"+"
LT_Klau_hatch = None#"x"
LRT_Tabu_hatch = None#"+"
LT_Tabu_hatch = None#"+"
default_p = .5
default_n = 250
default_sp = .25
#
# p_edge experiments
#
sub_ax = [fig.add_subplot(spec[i,0]) for i in [0,1]]
all_ax_gs[:,0] = sub_ax
all_ax.append(sub_ax)
file = "LambdaTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[250]_noiseModel:Duplication_p:[0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0]_sp:[0.25]_postProcess:KlauAlgo_trialcount:20.json"
with open(data_location + file,'r') as f:
#return json.load(f)
accuracy, LT_klauAccuracy,triMatch,LT_klauTriMatch, p_idx, n_idx, sp_idx = process_data(json.load(f))
LT_file = "LambdaTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[250]_noiseModel:Duplication_p:[0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0]_sp:[0.25]_postProcess:TabuSearch_trialcount:20.json"
with open(data_location + LT_file,'r') as f:
_, LT_TabuAccuracy,_,LT_TabuTriMatch, p_idx, n_idx, sp_idx = process_data(json.load(f))
LRT_file = "LowRankTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[250]_noiseModel:Duplication_p:[0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0]_sp:[0.25]_postProcess:TabuSearch_trialcount:20.json"
with open(data_location + LRT_file,'r') as f:
LRT_accuracy, LRT_TabuAccuracy,LRT_triMatch,LRT_TabuTriMatch, p_idx, n_idx, sp_idx = process_data(json.load(f))
file = "LowRankTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[250]_noiseModel:Duplication_p:[0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0]_sp:[0.25]_postProcess:KlauAlgo_trialcount:20.json"
with open(data_location + file,'r') as f:
_, LRT_KlauAccuracy,_,LRT_KlauTriMatch, p_idx, n_idx, sp_idx = process_data(json.load(f),"new klau")
file = "LowRankTAME-lrm_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[250]_noiseModel:Duplication_p:[0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0]_sp:[0.25]_postProcess:KlauAlgo_trialcount:20.json"
with open(data_location + file,'r') as f:
_, LRT_lrm_KlauAccuracy,_,LRT_lrm_KlauTriMatch, p_idx, n_idx, sp_idx = process_data(json.load(f),"new klau")
file = "LowRankEigenAlign_graphType:RG_degdist:LogNormal-log5_n:[250]_noiseModel:Duplication_p:[0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0]_sp:[0.25]_postProcess:TabuSearch_trialcount:20.json"
with open(data_location + file,'r') as f:
_, LREA_TabuAccuracy, _ ,LREA_TabuTriMatch, _,_,_ = process_data(json.load(f))
file = "LowRankEigenAlign_graphType:RG_degdist:LogNormal-log5_n:[250]_noiseModel:Duplication_p:[0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0]_sp:[0.25]_postProcess:KlauAlgo_trialcount:20.json"
with open(data_location + file,'r') as f:
LREA_Accuracy, LREA_KlauAccuracy, LREA_TriMatch ,LREA_KlauTriMatch, _,_,_ = process_data(json.load(f),"new klau")
p_exps = [
(accuracy,triMatch,LT_color,None,LT_linestyle),
(LT_klauAccuracy,LT_klauTriMatch,LT_Klau_color,LT_Klau_hatch,LT_Klau_linestyle),
(LT_TabuAccuracy,LT_TabuTriMatch,LT_Tabu_color,LT_Tabu_hatch,LT_Tabu_linestyle),
(LRT_accuracy,LRT_triMatch,LRT_color,None,LRT_linestyle),
(LRT_TabuAccuracy,LRT_TabuTriMatch,LRT_Tabu_color,LRT_Tabu_hatch,LRT_Tabu_linestyle),
(LRT_KlauAccuracy,LRT_KlauTriMatch,LRT_Klau_color,LRT_Klau_hatch,LRT_Klau_linestyle),
(LREA_Accuracy, LREA_TriMatch, LREigenAlign_color,None,LREigenAlign_linestyle),
(LREA_TabuAccuracy, LREA_TabuTriMatch, LREA_Tabu_color,None,LREA_Tabu_linestyle),
(LREA_KlauAccuracy, LREA_KlauTriMatch, LREA_Klau_color,None,LREA_Klau_linestyle),
#(LRT_lrm_KlauAccuracy,LRT_lrm_KlauTriMatch,LREA_Klau_color,None,LREA_Klau_linestyle),
]
for (acc, tri, c,hatch,linestyle) in p_exps:
make_percentile_plot(sub_ax[0],p_idx.keys(),acc[:,n_idx[default_n],sp_idx[default_sp],:],c,hatch,linestyle=linestyle)
make_percentile_plot(sub_ax[1],p_idx.keys(),tri[:,n_idx[default_n],sp_idx[default_sp],:],c,hatch,linestyle=linestyle)
for ax in sub_ax:
ax.set_xticks([0.0,.25,.5,.75,1.0])
ax.set_xlim(min(p_idx.keys()),max(p_idx.keys()))
sub_ax[1].set_xticklabels(["0.0",".25",r"${\bf .5}$",".75","1.0"],rotation=60)
sub_ax[1].set_xlabel(r"$p_{edge}$")
#
# n size experiments
#
sub_ax = [fig.add_subplot(spec[i,1]) for i in [0,1]]
all_ax.append(sub_ax)
all_ax_gs[:,1] = sub_ax
file = "LambdaTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:Duplication_p:[0.75]_sp:[0.25]_postProcess:KlauAlgo_trialcount:20.json"
file = "LambdaTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:Duplication_p:[0.5]_sp:[0.25]_postProcess:KlauAlgo_trialcount:20.json"
with open(data_location + file,'r') as f:
accuracy, LT_klauAccuracy,triMatch,LT_klauTriMatch, p_idx, n_idx, sp_idx = process_data(json.load(f))
file = 'LambdaTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:Duplication_p:[0.5]_sp:[0.25]_postProcess:TabuSearch_trialcount:20.json'
with open(data_location + file,'r') as f:
_, LT_TabuAccuracy,_,LT_TabuTriMatch, p_idx, n_idx, sp_idx = process_data(json.load(f))
file = "LowRankTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:Duplication_p:[0.5]_sp:[0.25]_postProcess:TabuSearch_trialcount:20.json"
with open(data_location + file,'r') as f:
LRT_accuracy, LRT_TabuAccuracy,LRT_triMatch,LRT_TabuTriMatch, p_idx, n_idx, sp_idx = process_data(json.load(f))
file = "LowRankTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:Duplication_p:[0.5]_sp:[0.25]_postProcess:KlauAlgo_trialcount:20.json"
with open(data_location + file,'r') as f:
_, LRT_KlauAccuracy,_,LRT_KlauTriMatch, p_idx, n_idx, sp_idx = process_data(json.load(f),"new klau")
file = "LowRankTAME-lrm_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:Duplication_p:[0.5]_sp:[0.25]_postProcess:KlauAlgo_trialcount:20.json"
with open(data_location + file,'r') as f:
_, LRT_lrm_KlauAccuracy,_,LRT_lrm_KlauTriMatch, p_idx, n_idx, sp_idx = process_data(json.load(f),"new klau")
file ="LowRankEigenAlign_graphType:RG_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:Duplication_p:[0.5]_sp:[0.25]_postProcess:KlauAlgo_trialcount:20.json"
with open(data_location + file,'r') as f:
LREA_Accuracy, LREA_KlauAccuracy,LREA_TriMatch,LREA_KlauTriMatch, _, _, _ = process_data(json.load(f),"new klau")
file ="LowRankEigenAlign_graphType:RG_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:Duplication_p:[0.5]_sp:[0.25]_postProcess:TabuSearch_trialcount:20.json"
with open(data_location + file,'r') as f:
_, LREA_TabuAccuracy,_,LREA_TabuTriMatch, _, _, _ = process_data(json.load(f))
n_exps = [
(accuracy,triMatch,LT_color,None,LT_linestyle),
(LT_klauAccuracy,LT_klauTriMatch,LT_Klau_color,LT_Klau_hatch,LT_Klau_linestyle),
(LT_TabuAccuracy,LT_TabuTriMatch,LT_Tabu_color,LT_Tabu_hatch,LT_Tabu_linestyle),
(LRT_accuracy,LRT_triMatch,LRT_color,None,LRT_linestyle),
(LRT_TabuAccuracy,LRT_TabuTriMatch,LRT_Tabu_color,LRT_Tabu_hatch,LRT_Tabu_linestyle),
(LRT_KlauAccuracy,LRT_KlauTriMatch,LRT_Klau_color,LRT_Klau_hatch,LRT_Klau_linestyle),
(LREA_Accuracy, LREA_TriMatch,LREigenAlign_color,None,LREigenAlign_linestyle),
(LREA_KlauAccuracy, LREA_KlauTriMatch,LREA_Klau_color,None,LREA_Klau_linestyle),
(LREA_TabuAccuracy,LREA_TabuTriMatch,LREA_Tabu_color,None,LREA_Tabu_linestyle),
#(LRT_lrm_KlauAccuracy,LRT_lrm_KlauTriMatch,LRT_lrm_Klau_color,None,"solid"),
]
for (acc, tri, c,hatch,linestyle) in n_exps:
make_percentile_plot(sub_ax[0],n_idx.keys(),acc[p_idx[default_p],:,sp_idx[default_sp],:],c,hatch,linestyle=linestyle)
make_percentile_plot(sub_ax[1],n_idx.keys(),tri[p_idx[default_p],:,sp_idx[default_sp],:],c,hatch,linestyle=linestyle)
for ax in sub_ax:
ax.set_xticks([100, 250, 500, 1000, 1250, 1500])
ax.set_xlim(100,1500)
sub_ax[1].set_xticklabels(["100",r"${\bf 250}$","500","1000","1250","1500"],rotation=60)
sub_ax[1].set_xlabel(r"$|V_A|$")
#
# step percentage experiments
#
sub_ax = [fig.add_subplot(spec[i,2]) for i in [0,1]]
all_ax.append(sub_ax)
all_ax_gs[:,2] = sub_ax
file = "LambdaTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[250]_noiseModel:Duplication_p:[0.5]_sp:[0.05,0.1,0.2,0.25,0.3,0.4,0.5]_postProcess:KlauAlgo_trialcount:20.json"
with open(data_location + file,'r') as f:
accuracy, LT_klauAccuracy,triMatch,LT_klauTriMatch, p_idx, n_idx, sp_idx = process_data(json.load(f))
file = 'LambdaTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[250]_noiseModel:Duplication_p:[0.5]_sp:[0.05,0.1,0.2,0.25,0.3,0.4,0.5]_postProcess:TabuSearch_trialcount:20.json'
with open(data_location + file,'r') as f:
_, LT_TabuAccuracy, _ ,LT_TabuTriMatch, p_idx, n_idx, sp_idx = process_data(json.load(f))
file = "LowRankTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[250]_noiseModel:Duplication_p:[0.5]_sp:[0.05,0.1,0.2,0.25,0.3,0.4,0.5]_postProcess:TabuSearch_trialcount:20.json"
with open(data_location + file,'r') as f:
LRT_accuracy, LRT_TabuAccuracy, LRT_triMatch ,LRT_TabuTriMatch, p_idx, n_idx, sp_idx = process_data(json.load(f))
file = "LowRankTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[250]_noiseModel:Duplication_p:[0.5]_sp:[0.05,0.1,0.2,0.25,0.3,0.4,0.5]_postProcess:KlauAlgo_trialcount:20.json"
with open(data_location + file,'r') as f:
_, LRT_KlauAccuracy, _ ,LRT_KlauTriMatch, p_idx, n_idx, sp_idx = process_data(json.load(f),"new klau")
file = "LowRankTAME-lrm_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[250]_noiseModel:Duplication_p:[0.5]_sp:[0.05,0.1,0.2,0.25,0.3,0.4,0.5]_postProcess:KlauAlgo_trialcount:20.json"
with open(data_location + file,'r') as f:
#return json.load(f)
_, LRT_lrm_KlauAccuracy, _ ,LRT_lrm_KlauTriMatch, p_idx, n_idx, sp_idx = process_data(json.load(f),version="new klau")
file = "LowRankEigenAlign_graphType:RG_degdist:LogNormal-log5_n:[250]_noiseModel:Duplication_p:[0.5]_sp:[0.05,0.1,0.2,0.25,0.3,0.4,0.5]_postProcess:TabuSearch_trialcount:20.json"
with open(data_location + file,'r') as f:
LREA_Accuracy, LREA_TabuAccuracy, LREA_TriMatch ,LREA_TabuTriMatch,_,_,_ = process_data(json.load(f))
file = "LowRankEigenAlign_graphType:RG_degdist:LogNormal-log5_n:[250]_noiseModel:Duplication_p:[0.5]_sp:[0.05,0.1,0.2,0.25,0.3,0.4,0.5]_postProcess:KlauAlgo_trialcount:20.json"
with open(data_location + file,'r') as f:
_, LREA_KlauAccuracy, _ ,LREA_KlauTriMatch,p_idx2, n_idx2, sp_idx2 = process_data(json.load(f),"new klau")
sp_exps = [
(accuracy,triMatch,LT_color,None,LT_linestyle),
(LT_klauAccuracy,LT_klauTriMatch,LT_Klau_color,LT_Klau_hatch,LT_Klau_linestyle),
(LT_TabuAccuracy,LT_TabuTriMatch,LT_Tabu_color,LT_Tabu_hatch,LT_Tabu_linestyle),
(LRT_accuracy,LRT_triMatch,LRT_color,None,LRT_linestyle),
(LRT_TabuAccuracy,LRT_TabuTriMatch,LRT_Tabu_color,LRT_Tabu_hatch,LRT_Tabu_linestyle),
(LRT_KlauAccuracy,LRT_KlauTriMatch,LRT_Klau_color,LRT_Klau_hatch,LRT_Klau_linestyle),
(LREA_Accuracy, LREA_TriMatch,LREigenAlign_color,None,LREigenAlign_linestyle),
(LREA_TabuAccuracy, LREA_TabuTriMatch,LREA_Tabu_color,None,LREA_Tabu_linestyle),
(LREA_KlauAccuracy, LREA_KlauTriMatch,LREA_Klau_color,None,LREA_Klau_linestyle),
#(LRT_lrm_KlauAccuracy, LRT_lrm_KlauTriMatch,LRT_lrm_Klau_color,None,"solid")
]
for (acc, tri, c,hatch,linestyle) in sp_exps:
make_percentile_plot(sub_ax[0],sp_idx.keys(),acc[p_idx[default_p],n_idx[default_n],:,:],c,hatch,linestyle=linestyle)
make_percentile_plot(sub_ax[1],sp_idx.keys(),tri[p_idx[default_p],n_idx[default_n],:,:],c,hatch,linestyle=linestyle)
for ax in sub_ax:
ax.set_xticks([.05,.1,.25,.5])
ax.set_xlim(0.05,.5)
sub_ax[1].set_xticklabels(["5%","10%",r"${\bf 25\%}$","50%"],rotation=60)#52.5
shift = -.25
sub_ax[1].annotate(r"$|V_B|-|V_A|$",xy=(.5,-.09+shift),xycoords='axes fraction',ha="center")
sub_ax[1].annotate('', xy=(.23, -.125+shift), xycoords='axes fraction', xytext=(.77, -.125+shift),
arrowprops=dict(arrowstyle="-", color='k',linewidth=.5))
sub_ax[1].annotate(r"$|V_A|$",xy=(.5,-.21+shift),xycoords='axes fraction',ha="center")
sub_ax[1].annotate(r"(%)",xy=(.78, -.125+shift),xycoords='axes fraction',ha="left",va="center")
#
# Final Axes touch up
#
all_ax_gs[0,0].set_ylabel("accuracy")
all_ax_gs[1,0].set_ylabel("matched tris\n"+r"$\min{\{|T_A|,|T_B|\}}$",labelpad=1)
xloc = -.31
all_ax_gs[1,0].annotate('', xy=(xloc , .18), xycoords='axes fraction', xytext=(xloc, 0.82),
arrowprops=dict(arrowstyle="-", color='k'))
for ax in all_ax_gs[0,:]:
ax.set_xticklabels([])
for ax in all_ax_gs[1,:]:
ax.tick_params(axis="x",direction="out",pad=1)
for ax in all_ax_gs[:,1:].reshape(-1):
ax.set_yticklabels([])
#all_ax_gs[0,0].set_yticklabels([])
#all_ax_gs[1,0].set_yticklabels([])
#for ax in all_ax_gs[:,2]:
# ax.yaxis.tick_right()
for ax in all_ax_gs.reshape(-1):
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.spines['left'].set_visible(False)
ax.spines['bottom'].set_visible(False)
ax.tick_params(axis="both",direction="out",which='both', length=0)
ax.set_ylim(0.0,1.0)
ax.grid(True)
all_ax_gs[1,1].annotate(r"$\Lambda$-TAME",xy=(.4,.26),color=LT_color,xycoords="axes fraction",ha="center",va="center",fontsize=10,rotation=-15)
all_ax_gs[0,2].annotate(r"$\Lambda$T" +"-Klau",xy=(.65,.875),color=LT_Klau_color,xycoords="axes fraction",ha="center",va="center",fontsize=10,rotation=-17.5)
all_ax_gs[1,2].annotate(r"$\Lambda$T" +"-LS",xy=(.825,.9),color=LT_Tabu_color,xycoords="axes fraction",ha="center",va="center",fontsize=10,rotation=-7)
all_ax_gs[1,2].annotate("LRT-TAME",xy=(.75,.15),color=LRT_color,xycoords="axes fraction",ha="center",va="center",fontsize=10,rotation=-7.5)
all_ax_gs[1,1].annotate(r"LRT-LS",xy=(.8,.85),color=LRT_Tabu_color,xycoords="axes fraction",ha="center",va="center",fontsize=10)
all_ax_gs[1,2].annotate(r"LRT-Klau",xy=(.3,.675),color=LRT_Klau_color,xycoords="axes fraction",ha="center",va="center",fontsize=10,rotation=-35)
all_ax_gs[1,0].annotate("LREA",xy=(.325,.075),color=LREigenAlign_color,xycoords="axes fraction",ha="center",va="center",fontsize=10,rotation=-10)
all_ax_gs[1,1].annotate(r"LREA-LS",xy=(.5,.65),color=LREA_Tabu_color,xycoords="axes fraction",ha="center",va="center",fontsize=10,rotation=-25)
all_ax_gs[1,1].annotate(r"LREA-Klau",xy=(.7,.3),color=LREA_Klau_color,xycoords="axes fraction",ha="center",va="center",fontsize=10,rotation=-30)
if save_path is None:
plt.show()
else:
plt.savefig(save_path)
def RandomGeometricERNoise_allModes(save_path=None):
data_location = TAME_RESULTS + "RG_ERNoise/"
fig = plt.figure(figsize=(4.25,4.25))
n = 2
m = 2
spec = fig.add_gridspec(nrows=n, ncols=m,hspace=0.1,wspace=0.15,left=.15,right=.97,top=.975,bottom=.2)
all_ax = []
axes = np.empty((n,m),object)
for i in range(n):
for j in range(m):
ax = fig.add_subplot(spec[i,j])
axes[i,j] = ax
def process_data(data,version="klau_old"):
p_idx = {p:i for (i,p) in enumerate(sorted(set([datum[1] for datum in data])))}
n_idx = {p:i for (i,p) in enumerate(sorted(set([datum[2] for datum in data])))}
trials = int(len(data)/(len(p_idx)*len(n_idx)))
accuracy = np.zeros((len(p_idx),len(n_idx),trials))
LT_klauAccuracy = np.zeros((len(p_idx),len(n_idx),trials))
triMatch = np.zeros((len(p_idx),len(n_idx),trials))
LT_klauTriMatch = np.zeros((len(p_idx),len(n_idx),trials))
trial_idx = np.zeros((len(p_idx),len(n_idx)),int)
for datum in data:
if version == "klau_new":
(seed,p,n,acc,dup_tol_acc,matched_tris,tri_A,tri_B,_,profiling,edges,klau_edges,klau_tri_match,klau_acc,_,klau_setup,klau_rt,L_sparsity,fbounds) = datum
elif version == "klau_old":
(seed,p,n,acc,dup_tol_acc,matched_tris,tri_A,tri_B,_,profiling,edges,klau_edges,klau_tri_match,klau_acc,_,klau_setup,klau_rt) = datum
elif version == "tabu":
(seed,p,n,acc,dup_tol_acc,matched_tris,tri_A,tri_B,_,profiling,edges,klau_edges,klau_tri_match,klau_acc,_,klau_setup,klau_rt) = datum
else:
raise ValueError("only supports ")
i = p_idx[p]
j = n_idx[n]
accuracy[i,j,trial_idx[i,j]] = acc
LT_klauAccuracy[i,j,trial_idx[i,j]] = klau_acc
triMatch[i,j,trial_idx[i,j]] = matched_tris/min(tri_A,tri_B)
LT_klauTriMatch[i,j,trial_idx[i,j]] = klau_tri_match/min(tri_A,tri_B)
trial_idx[i,j] += 1
return accuracy, LT_klauAccuracy, triMatch, LT_klauTriMatch, p_idx, n_idx
def make_percentile_plot(plot_ax, x_domain,data,color,hatch=None,**kwargs):
#TODO: check on scope priorities of ax for closures
lines = [(lambda col: np.percentile(col,50),1.0,color) ]
ribbons = [
(20,80,.05,color)
]
#plot_percentiles(plot_ax, data.T, x_domain, lines, ribbons,**kwargs)
n,m = data.shape
percentile_linewidth=.01
for (lower_percentile,upper_percentile,alpha,color) in ribbons:
#plot_ax.plot(np.percentile(data.T, lower_percentile, axis=0),c=color,linewidth=percentile_linewidth)
#plot_ax.plot(np.percentile(data.T, upper_percentile, axis=0),c=color,linewidth=percentile_linewidth)
plot_ax.fill_between(x_domain,
np.percentile(data.T, lower_percentile, axis=0),
np.percentile(data.T, upper_percentile, axis=0),
facecolor=color,alpha=.1,edgecolor=color)
"""
plot_ax.fill_between(x_domain,
np.percentile(data.T, lower_percentile, axis=0),
np.percentile(data.T, upper_percentile, axis=0),
facecolor="None",hatch=hatch,edgecolor=color,alpha=.4)
"""
for (col_func,alpha,color) in lines:
line_data = []
for i in range(n):
line_data.append(col_func(data[i,:]))
plot_ax.plot(x_domain,line_data,alpha=alpha,c=color,**kwargs)
#
# p_remove experiments
#
sub_ax = axes[:,0]
#file = "LambdaTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[250]_noiseModel:ErdosReyni_p:[0.0,0.005,0.01,0.05,0.1,0.2]_postProcess:KlauAlgo_trialcount:20.json"
file = "LambdaTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[250]_noiseModel:ErdosReyni_p:[0.01,0.05,0.1,0.15,0.2,0.25,0.3,0.4,0.5]_postProcess:KlauAlgo_trialcount:20.json"
with open(data_location + file,'r') as f:
#return json.load(f)
accuracy, LT_klauAccuracy,triMatch,LT_klauTriMatch, p_idx, n_idx = process_data(json.load(f),"klau_new")
files=[
# "LambdaTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[250]_noiseModel:ErdosReyni_p:[0.0,0.005,0.01,0.05,0.1,0.2]_postProcess:TabuSearch_trialcount:20.json",
"LambdaTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[250]_noiseModel:ErdosReyni_p:[0.05,0.15,0.25,0.3,0.4,0.5]_postProcess:TabuSearch_trialcount:20.json",
"LambdaTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[250]_noiseModel:ErdosReyni_p:[0.01,0.1,0.2]_postProcess:TabuSearch_trialcount:20.json"
]
res = []
for file in files:
with open(data_location + file,'r') as f:
res.extend(json.load(f))
_, LT_TabuAccuracy, _, LT_TabuTriMatch, p_idx, n_idx = process_data(res,"tabu")
file = "LowRankTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[250]_noiseModel:ErdosReyni_p:[0.01,0.05,0.1,0.15,0.2,0.25,0.3,0.4,0.5]_postProcess:KlauAlgo_trialcount:20.json"
with open(data_location + file,'r') as f:
#return json.load(f)
LRT_accuracy, LRT_KlauAccuracy, LRT_triMatch, LRT_KlauTriMatch, p_idx, n_idx = process_data(json.load(f),"klau_new")
file = "LowRankTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[250]_noiseModel:ErdosReyni_p:[0.01,0.05,0.1,0.15,0.2,0.25,0.3,0.4,0.5]_postProcess:TabuSearch_trialcount:20.json"
with open(data_location + file,'r') as f:
#return json.load(f)
_, LRT_TabuAccuracy,_,LRT_TabuTriMatch, p_idx, n_idx = process_data(json.load(f),"tabu")
file = "LowRankTAME-lrm_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[250]_noiseModel:ErdosReyni_p:[0.01,0.05,0.1,0.15,0.2,0.25,0.3,0.4,0.5]_postProcess:KlauAlgo_trialcount:20.json"
with open(data_location + file,'r') as f:
#return json.load(f)
_, LRT_lrm_klauAccuracy,_,LRT_lrm_klauTriMatch, p_idx, n_idx = process_data(json.load(f),"klau_new")
file = "LowRankEigenAlign_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[250]_noiseModel:ErdosReyni_p:[0.01,0.05,0.1,0.15,0.2,0.25,0.3,0.4,0.5]_postProcess:KlauAlgo_trialcount:20.json"
with open(data_location + file,'r') as f:
#return json.load(f)
LREA_accuracy, LREA_klauAccuracy,LREA_triMatch,LREA_klauTriMatch, _ ,_ = process_data(json.load(f),"klau_new")
file = "LowRankEigenAlign_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[250]_noiseModel:ErdosReyni_p:[0.01,0.05,0.1,0.15,0.2,0.25,0.3,0.4,0.5]_postProcess:TabuSearch_trialcount:20.json"
with open(data_location + file,'r') as f:
#return json.load(f)
_, LREA_tabuAccuracy,_,LREA_tabuTriMatch, _,_ = process_data(json.load(f),"tabu")
#make_percentile_plot(sub_ax[0],p_idx.keys(),LT_TabuAccuracy[:,0,:],LT_Tabu_color)
#make_percentile_plot(sub_ax[1],p_idx.keys(),LT_TabuTriMatch[:,0,:],LT_Tabu_color)
p_exps = [
(accuracy,triMatch,LT_color,LT_linestyle),
(LT_klauAccuracy,LT_klauTriMatch,LT_Klau_color,LT_Klau_linestyle),
(LT_TabuAccuracy,LT_TabuTriMatch,LT_Tabu_color,LT_Tabu_linestyle),
#(LRT_lrm_klauAccuracy,LRT_lrm_klauTriMatch,LRM_lrm_Klau_color),
(LRT_accuracy,LRT_triMatch,LRT_color,LRT_linestyle),
(LRT_KlauAccuracy,LRT_KlauTriMatch,LRT_Klau_color,LRT_Klau_linestyle),
(LRT_TabuAccuracy,LRT_TabuTriMatch,LRT_Tabu_color,LRT_Tabu_linestyle),
(LREA_accuracy,LREA_triMatch,LREigenAlign_color,LREigenAlign_linestyle),
(LREA_tabuAccuracy,LREA_tabuTriMatch,LREA_Tabu_color,LREA_Tabu_linestyle),
(LREA_klauAccuracy,LREA_klauTriMatch,LREA_Klau_color,LREA_Klau_linestyle),
]
for (acc,tri,c,linestyle) in p_exps:
make_percentile_plot(sub_ax[0],p_idx.keys(),acc[:,0,:],c,linestyle=linestyle)
make_percentile_plot(sub_ax[1],p_idx.keys(),tri[:,0,:],c,linestyle=linestyle)
for ax in sub_ax:
ax.set_xticks([0.01, 0.05, 0.1, 0.2,.3,.4])
ax.set_xlim(min(p_idx.keys()),.4)
sub_ax[1].set_xticklabels([1.e-02, r"${\bf 0.05}$", .1, .2,.3,.4],rotation=60)
sub_ax[1].set_xlabel(r"$p_{remove} \equiv p$"+'\n'+r"$p_{add}=\frac{p\rho}{1-\rho}$",ha="center",labelpad=-5)
#
# n size experiments
#
sub_ax = axes[:,1]
file = 'LambdaTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:ErdosReyni_p:[0.05]_postProcess:KlauAlgo_trialcount:20.json'
with open(data_location + file,'r') as f:
accuracy, LT_klauAccuracy,triMatch,LT_klauTriMatch, p_idx, n_idx = process_data(json.load(f),"klau_new")
#file = 'LambdaTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:ErdosReyni_p:[0.01]_postProcess:TabuSearch_trialcount:20.json'
file = 'LambdaTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:ErdosReyni_p:[0.05]_postProcess:TabuSearch_trialcount:20.json'
with open(data_location + file,'r') as f:
#return json.load(f)
_, LT_TabuAccuracy, _, LT_TabuTriMatch, p_idx, n_idx = process_data(json.load(f),"tabu")
file = "LowRankTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:ErdosReyni_p:[0.05]_postProcess:KlauAlgo_trialcount:20.json"
with open(data_location + file,'r') as f:
#return json.load(f)
LRT_accuracy, LRT_KlauAccuracy, LRT_triMatch, LRT_KlauTriMatch, p_idx, n_idx = process_data(json.load(f),"klau_new")
file = "LowRankTAME_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:ErdosReyni_p:[0.05]_postProcess:TabuSearch_trialcount:20.json"
with open(data_location + file,'r') as f:
#return json.load(f)
_, LRT_TabuAccuracy,_,LRT_TabuTriMatch, p_idx, n_idx = process_data(json.load(f),"tabu")
file = "LowRankTAME-lrm_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:ErdosReyni_p:[0.05]_postProcess:KlauAlgo_trialcount:20.json"
with open(data_location + file,'r') as f:
#return json.load(f)
_, LRT_lrm_KlauAccuracy, _, LRT_lrm_KlauTriMatch, p_idx, n_idx = process_data(json.load(f),"klau_new")
file = "LowRankEigenAlign_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:ErdosReyni_p:[0.05]_postProcess:KlauAlgo_trialcount:20.json"
with open(data_location + file,'r') as f:
#return json.load(f)
LREA_accuracy, LREA_klauAccuracy,LREA_triMatch,LREA_klauTriMatch, _ ,_ = process_data(json.load(f),"klau_new")
file = "LowRankEigenAlign_graphType:RG_alphas:[.5,1.0]_betas:[0.0,1e0,1e1,1e2]_degdist:LogNormal-log5_n:[100,250,500,1000,1250,1500]_noiseModel:ErdosReyni_p:[0.05]_postProcess:TabuSearch_trialcount:20.json"
with open(data_location + file,'r') as f:
#return json.load(f)
_, LREA_tabuAccuracy,_,LREA_tabuTriMatch, _,_ = process_data(json.load(f),"tabu")
n_exps = [
(accuracy,triMatch,LT_color,LT_linestyle),
(LT_klauAccuracy,LT_klauTriMatch,LT_Klau_color,LT_Klau_linestyle),
(LT_TabuAccuracy,LT_TabuTriMatch,LT_Tabu_color,LT_Tabu_linestyle),
#(LRT_lrm_KlauAccuracy,LRT_lrm_KlauTriMatch,LRM_lrm_Klau_color),
(LRT_accuracy,LRT_triMatch,LRT_color,LRT_linestyle),
(LRT_KlauAccuracy,LRT_KlauTriMatch,LRT_Klau_color,LRT_Klau_linestyle),
(LRT_TabuAccuracy,LRT_TabuTriMatch,LRT_Tabu_color,LRT_Tabu_linestyle),
(LREA_accuracy,LREA_triMatch,LREigenAlign_color,LREigenAlign_linestyle),
(LREA_tabuAccuracy,LREA_tabuTriMatch,LREA_Tabu_color,LREA_Tabu_linestyle),
(LREA_klauAccuracy,LREA_klauTriMatch,LREA_Klau_color,LREA_Klau_linestyle),
]
for (acc,tri,c,linestyle) in n_exps:
make_percentile_plot(sub_ax[0],n_idx.keys(),acc[0,:,:],c,linestyle=linestyle)
make_percentile_plot(sub_ax[1],n_idx.keys(),tri[0,:,:],c,linestyle=linestyle)
for ax in sub_ax:
ax.set_xlim(min(n_idx.keys()),max(n_idx.keys()))
ax.set_xticks([100, 250, 500, 1000, 1250, 1500])
sub_ax[1].set_xticklabels(["100",r"${\bf 250}$","500","1000","1250","1500"],rotation=60)
sub_ax[1].set_xlabel(r"$|V_A|$")
axes[1,1].annotate(r"$\Lambda$-TAME",xy=(.175,.35),color=LT_color,xycoords="axes fraction",ha="center",va="center",fontsize=10,rotation=-40)
axes[1,0].annotate(r"$\Lambda$T-"+"Klau",xy=(.45,.35),color=LT_Klau_color,xycoords="axes fraction",ha="center",va="center",fontsize=10,rotation=-45)
axes[0,0].annotate(r"$\Lambda$T-"+"LS",xy=(.475,.425),color=LT_Tabu_color,xycoords="axes fraction",ha="center",va="center",fontsize=10,rotation=-50)
axes[0,1].annotate("LR-TAME",xy=(.825,.17),color=LRT_color,xycoords="axes fraction",ha="center",va="center",fontsize=10,rotation=-2.5)
axes[0,1].annotate("LRT-Klau",xy=(.325,.475),color=LRT_Klau_color,xycoords="axes fraction",ha="center",va="center",fontsize=10,rotation=0)
axes[0,1].annotate("LRT-LS",xy=(.85,.73),color=LRT_Tabu_color,xycoords="axes fraction",ha="center",va="center",fontsize=10,rotation=-10)
axes[1,1].annotate("LREA",xy=(.125,.075),color=LREigenAlign_color,xycoords="axes fraction",ha="center",va="center",fontsize=10,rotation=-20)
axes[1,1].annotate("LREA-Klau",xy=(.6,.525),color=LREA_Klau_color,xycoords="axes fraction",ha="center",va="center",fontsize=10,rotation=-25)
axes[1,0].annotate("LREA-LS",xy=(.8,.4),color=LREA_Tabu_color,xycoords="axes fraction",ha="center",va="center",fontsize=10,rotation=-10)
axes[0,0].set_ylabel("accuracy")
axes[1,0].set_ylabel("matched tris\n"+r"$\min{\{|T_A|,|T_B|\}}$",labelpad=2.5)
xloc = -.3
axes[1,0].annotate('', xy=(xloc, .2), xycoords='axes fraction', xytext=(xloc, 0.8),
arrowprops=dict(arrowstyle="-", color='k'))
for ax in axes[0,:]:
ax.set_xticklabels([])
for ax in axes[:,1]:
ax.set_yticklabels([])
for ax in axes[1,:]:
ax.tick_params(axis="x",direction="out",pad=1)
for ax in axes[:,1]:
ax.yaxis.tick_right()
for ax in axes.reshape(-1):
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.spines['left'].set_visible(False)
ax.spines['bottom'].set_visible(False)
ax.tick_params(axis="both",direction="out",which='both', length=0)
ax.set_ylim(0.0,1.0)
ax.grid(True)
if save_path is None:
plt.show()
else:
plt.savefig(save_path)
#
# K nearest Neighbors Post Processing Experiments
#
def LambdaTAME_increasing_clique_size(save_path=None):
plt.rc('text.latex', preamble=r'\usepackage{/Users/charlie/Documents/Code/TKPExperimentPlots/latex/dgleich-math}')
fig = plt.figure(figsize=(6,3.5))
global_ax = plt.gca()
data_location = TAME_RESULTS + "klauExps/"
data_location = TAME_RESULTS + "RG_DupNoise/"
def process_klau_data(data,version="LT"):
order_idx = {order:i for (i,order) in enumerate(sorted(set([datum[0] for datum in data])))}
k_idx = {k:i for (i,k) in enumerate(sorted(set([datum[1] for datum in data])))}
trials =len(data[0][-1])
runtime = np.zeros((len(order_idx),len(k_idx),trials))
accuracy = np.zeros((len(order_idx),len(k_idx),trials))
postProcessingAccuracy = np.zeros((len(order_idx),len(k_idx),trials))
triMatch = np.zeros((len(order_idx),len(k_idx),trials))
postProcessingRuntime = np.zeros((len(order_idx),len(k_idx),trials))
#sparsity = np.zeros((len(order_idx),len(k_idx),trials))
trial_idx = np.zeros((len(order_idx),len(k_idx)),int)
vertex_coverage = {}
A_motifs_counts = {}
for (order,k,results) in data:
# expecting results:
# (seed,p, n, sp, acc, dup_tol_acc, matched_matching_score, A_motifs, B_motifs, A_motifDistribution, B_motifsDistribution,profiling,edges,klau_edges,klau_tri_match,klau_acc,_,klau_setup,klau_rt)
i = order_idx[order]
j = k_idx[k]
accuracy[i,j,:] = [x[4] for x in results]
if version=="LT":
runtime[i,j,:] = [sum([sum(val) for val in result[11].values()]) for result in results]
postProcessingAccuracy[i,j,:] = [x[15] for x in results]
postProcessingRuntime[i,j,:] = [x[17] + x[18] for x in results]
#sparsity[i,j,:] = [x[19] for x in results]
if k == min(k_idx.keys()): #only do this once over k
#determine the size of A vs. B motif data
if len(results[0][9]) == results[0][2]:
vertex_coverage[order] = [len(list(filter(lambda y: y!= 0.0,x[9][0])))/x[2] for x in results]
A_motifs_counts[order]= [x[7][0] for x in results]
else:
vertex_coverage[order] = [len(list(filter(lambda y: y!= 0.0,x[10][0])))/x[2] for x in results]
A_motifs_counts[order]= [x[8][0] for x in results]
elif version=="LRT":
postProcessingAccuracy[i,j,:] = [x[14] for x in results]
postProcessingRuntime[i,j,:] = [x[16] + x[17] for x in results]
if version=="LT":
return accuracy,runtime, postProcessingAccuracy, postProcessingRuntime,vertex_coverage,A_motifs_counts, order_idx, k_idx #triMatch,LT_klauTriMatch, p_idx, n_idx
else:
return accuracy, postProcessingAccuracy, postProcessingRuntime,order_idx, k_idx #triMatch,LT_klauTriMatch, p_idx, n_idx
def process_tabu_data(data,version="LT"):
order_idx = {order:i for (i,order) in enumerate(sorted(set([datum[0] for datum in data])))}
k_idx = {k:i for (i,k) in enumerate(sorted(set([datum[1] for datum in data])))}
trials =len(data[0][-1])
accuracy = np.zeros((len(order_idx),len(k_idx),trials))
tabuAccuracy = np.zeros((len(order_idx),len(k_idx),trials))
triMatch = np.zeros((len(order_idx),len(k_idx),trials))
tabuRuntime = np.zeros((len(order_idx),len(k_idx),trials))
#sparsity = np.zeros((len(order_idx),len(k_idx),trials))
trial_idx = np.zeros((len(order_idx),len(k_idx)),int)
vertex_coverage = {}
for (order,k,results) in data:
# expecting results:
# (seed,p, n, sp, acc, dup_tol_acc, matched_matching_score, A_motifs, B_motifs, A_motifDistribution, B_motifsDistribution,profiling,edges,klau_edges,klau_tri_match,klau_acc,_,klau_setup,klau_rt)
i = order_idx[order]
j = k_idx[k]
accuracy[i,j,:] = [x[4] for x in results]
if version == "LT":
tabuAccuracy[i,j,:] = [x[15] for x in results]
tabuRuntime[i,j,:] = [x[18] for x in results]
#sparsity[i,j,:] = [x[19] for x in results]
if k == min(k_idx.keys()): #only do this once over k
vertex_coverage[order] = [len(list(filter(lambda y: y!= 0.0,x[9][0])))/x[2] for x in results]
elif version == "LRT":
print(i," ",j)
tabuAccuracy[i,j,:] = [x[14] for x in results]
tabuRuntime[i,j,:] = [x[17] for x in results]
if version == "LT":
return accuracy, tabuAccuracy,tabuRuntime,vertex_coverage, order_idx, k_idx
else:
return accuracy, tabuAccuracy,tabuRuntime,order_idx, k_idx
filename = "RandomGeometric_degreedist:LogNormal_KlauAlgokvals:[15,30,45,60,75,90]_noiseModel:Duplication_n:[500]_KAmiter:1000_orders:[2,3,4,5,6,7,8,9]_p:[0.5]_samples:1000000_sp:[0.25]_trials:25_data.json"
with open(data_location+filename,'r') as f:
accuracy,LT_runtime, LT_klauAccuracy,LT_klauRuntime,vertex_coverage,A_motifs_counts, order_idx, k_idx = process_klau_data(json.load(f))
filename = "RandomGeometric_degreedist:LogNormal_TabuSearchkvals:[15,30,45,60,75,90]_noiseModel:Duplication_n:[500]_orders:[2,3,4,5,6,7,8,9]_p:[0.5]_samples:1000000_sp:[0.25]_trials:25_data.json"
with open(data_location+filename,'r') as f:
_, LT_TabuAccuracy, LT_TabuRuntime, _, order_idx, k_idx = process_tabu_data(json.load(f))
def make_percentile_plot(plot_ax, x_domain,data,color,**kwargs):
lines = [(lambda col: np.percentile(col,50),1.0,color) ]
ribbons = [
(20,80,.2,color)
]
plot_percentiles(plot_ax, data.T, x_domain, lines, ribbons,**kwargs)
def make_violin_plot(ax,data,precision=2,c=None,v_alpha=.8):
background_v = ax.violinplot(data, points=100, positions=[0.5], showmeans=False,
showextrema=False, showmedians=False,widths=.5,vert=False)#,quantiles=[[.2,.8]]*len(data2))
v = ax.violinplot(data, points=100, positions=[.5], showmeans=False,
showextrema=False, showmedians=True,widths=.5,vert=False)#,quantiles=[[.2,.8]]*len(data2))
# -- update median lines to have a gap -- #
((x0,y0),(_,y1)) = v["cmedians"].get_segments()[0]
newMedianLines = [[(x0,y0-.1),(x0,y0 + (y1-y0)/2 -.1)],[(x0,y0 + (y1-y0)/2 +.1),(x0,y1+.1)]]
v["cmedians"].set_segments(newMedianLines)
ax.annotate(f"{np.median(data):.{precision}f}",xy=(.5,.38),xycoords="axes fraction",ha="center",fontsize=10)
ax.annotate(f"{np.min(data):.{precision}f}",xy=(0,.8),xycoords="axes fraction",ha="left",fontsize=6,alpha=.8)
ax.annotate(f"{np.max(data):.{precision}f}",xy=(1,.1),xycoords="axes fraction",ha="right",fontsize=6,alpha=.8)
if c is not None:
v["cmedians"].set_color("k")
v["cmedians"].set_alpha(.3)
for b in v['bodies']:
b.set_facecolor(c)
b.set_edgecolor(c)
b.set_alpha(v_alpha)
#b.set_alpha(1)
b.set_color(c)
for b in background_v["bodies"]:
b.set_facecolor("w")
b.set_edgecolor("w")
b.set_color("w")
def make_violin_plot_legend(ax,c="k"):
np.random.seed(12)
v = ax.violinplot([np.random.normal() for i in range(50)], points=100, positions=[.5], showmeans=False,
showextrema=False, showmedians=True,widths=.5,vert=False)#,quantiles=[[.2,.8]]*len(data2))
#ax.axes.set_axis_off()
# -- update median lines to have a gap -- #
((x0,y0),(_,y1)) = v["cmedians"].get_segments()[0]
newMedianLines = [[(x0,y0-.1),(x0,y0 + (y1-y0)/2 -.1)],[(x0,y0 + (y1-y0)/2 +.1),(x0,y1+.1)]]
v["cmedians"].set_segments(newMedianLines)
ax.annotate("med.",xy=(.5,.5),xycoords="axes fraction",ha="center",va="center",fontsize=10)
ax.annotate(f"min",xy=(0,.8),xycoords="axes fraction",ha="left",fontsize=6,alpha=.8)
ax.annotate(f"max",xy=(1,.1),xycoords="axes fraction",ha="right",fontsize=6,alpha=.8)
if c is not None:
v["cmedians"].set_color(c)
for b in v['bodies']:
b.set_facecolor(c)
b.set_edgecolor(c)
b.set_alpha(.2)
b.set_color(c)
# -- add in order labels overhead -- #
global_ax.set_yticklabels([])
global_ax.set_yticklabels([])
widths = [.5, 3, 2, .8,.8]
spec = fig.add_gridspec(nrows=5,ncols=1+len(order_idx),hspace=0.0,wspace=0.0,height_ratios=widths,left=.15,right=.95)
allCAx = []
allAccAx = []
allRtAx = []
allVCAx = []
allMotifCountAx = []
allSparsityAx = []
first = True
annotation_idx = 4
if filename == "RandomGeometric_degreedist:LogNormal_kvals:[15,30,45,60,75,90]_noiseModel:Duplication_orders:[2,3,4,5,6,7,8,9]_samples:1000000_trials:25_data.json":
k_tick_idx = 0
else:
k_tick_idx = 4
parity = 0
for idx,(order,i) in enumerate(order_idx.items()):
#
# Clique size
#
ax = fig.add_subplot(spec[0,i])
allCAx.append(ax)
if idx % 2 == parity:
ax.patch.set_facecolor('k')
ax.patch.set_alpha(0.1)
ax.annotate(f"{order}",xy=(.5, .5), xycoords='axes fraction', c="k",size=10,ha="center",va="center")
ax.set_xticklabels([])
ax.set_yticklabels([])
#
# Accuracy Plots
#
if idx == annotation_idx:
ax = fig.add_subplot(spec[1,i],zorder=5)#,sharey=allAccAx[0])
else:
ax = fig.add_subplot(spec[1,i])#,sharey=allAccAx[0])
allAccAx.append(ax)
if idx % 2 != parity:
ax.patch.set_facecolor('k')
ax.patch.set_alpha(0.1)
ax.set_yticks([0.0,0.25,.5,.75,1.0])
ax.set_ylim(0,1.0)
plt.axhline(y=np.median(accuracy[i,:,:]), color=LT_color,linestyle=LT_linestyle)
plt.axhline(y=np.max(accuracy[i,:,:]), color=LT_color,linestyle="dotted")
make_percentile_plot(ax,k_idx.keys(),LT_klauAccuracy[i,:,:],LT_Klau_color)#,linestyle=LT_Klau_linestyle
make_percentile_plot(ax,k_idx.keys(),LT_TabuAccuracy[i,:,:],LT_Tabu_color)#,linestyle=LT_Tabu_linestyle
ax.set_xticklabels([])
ax.set_yticklabels([])
#
# Runtime Plots
#
if idx == k_tick_idx:
ax = fig.add_subplot(spec[2,i],zorder=3)
else:
ax = fig.add_subplot(spec[2,i])
allRtAx.append(ax)
if idx % 2 == parity:
ax.patch.set_facecolor('k')
ax.patch.set_alpha(0.1)
if filename == "RandomGeometric_degreedist:LogNormal_kvals:[15,30,45,60,75,90]_noiseModel:Duplication_orders:[2,3,4,5,6,7,8,9]_samples:1000000_trials:25_data.json":
ax.set_ylim(np.min(LT_klauRuntime[:,:,:]),600)
elif filename == "RandomGeometric_degreedist:LogNormal_kvals:[15,30,45,60,75,90]_noiseModel:Duplication_n:[500]_orders:[2,3,4,5,6,7,8,9]_samples:1000000_trials:25_data.json":
ax.set_ylim(np.min(LT_klauRuntime[:,:,:]),1200)
else:
ax.set_ylim(np.min(LT_klauRuntime[:,:,:]),2100)
#ax.set_yscale("log")
if idx != 0:
ax.set_yticklabels([])
ax.set_xticks([15,45,90])
ax.set_xticklabels([])
make_percentile_plot(ax,k_idx.keys(),LT_klauRuntime[i,:,:],LT_Klau_color,linestyle=LT_Klau_linestyle)
make_percentile_plot(ax,k_idx.keys(),LT_TabuRuntime[i,:,:],LT_Tabu_color,linestyle=LT_Tabu_linestyle)
plt.axhline(y=np.median(LT_runtime[i,:,:]), color=LT_color,linestyle=LT_linestyle)
#
# Vertex Coverage
#
ax = fig.add_subplot(spec[3,i])
allVCAx.append(ax)
if idx % 2 != parity:
make_violin_plot(ax,vertex_coverage[order],c="w")
ax.patch.set_facecolor('k')
ax.patch.set_alpha(0.1)
else:
make_violin_plot(ax,vertex_coverage[order],c="k",v_alpha=.1)
#
# Motif Counts
#
ax = fig.add_subplot(spec[4,i])
allMotifCountAx.append(ax)
if idx % 2 == parity:
make_violin_plot(ax,A_motifs_counts[order],c="w",precision=0)
ax.patch.set_facecolor('k')
ax.patch.set_alpha(0.1)
else:
make_violin_plot(ax,A_motifs_counts[order],c="k",v_alpha=.1,precision=0)
violinLegendAx = fig.add_subplot(spec[3,-1])
for ax in chain(allAccAx,allRtAx,allCAx,allVCAx,allMotifCountAx,allSparsityAx,[global_ax],[violinLegendAx]):
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.spines['left'].set_visible(False)
ax.spines['bottom'].set_visible(False)
ax.yaxis.set_ticks_position('none')
ax.xaxis.set_ticks_position('none')
ax.set_xticklabels([])
ax.set_yticklabels([])
for ax in chain(allAccAx,allRtAx,allSparsityAx):
ax.grid(True)
ax.set_xticks([15,45,90])
ax.set_xlim(min(k_idx.keys()),max(k_idx.keys()))
# - make violin plot legend - #
make_violin_plot_legend(violinLegendAx)
# -- Add in x-domain annotations mid plot -- #
allRtAx[k_tick_idx].xaxis.set_label_position("top")
allRtAx[k_tick_idx].xaxis.set_ticks_position('top')
allRtAx[k_tick_idx].tick_params(axis="x",direction="out", pad=-15)
allAccAx[k_tick_idx].annotate("nearest neighbors ("+r"$K$"+')',xy=(.5,.05),ha="center",xycoords='axes fraction')
allRtAx[k_tick_idx].set_xticklabels([15,45,90],zorder=5)
# -- Alternate tick labels to opposite axes -- #
allCAx[0].annotate("Clique Size",xy=(-.1,.5),ha="right",va="center",xycoords='axes fraction')
allAccAx[-1].yaxis.set_ticks_position('right')
allAccAx[-1].set_yticklabels([0,.25,.5,.75,1.0])
allAccAx[-1].tick_params(axis="both",direction="out",which='both', length=7.5)
allAccAx[0].set_ylabel("Accuracy",rotation=0,labelpad=0,ha="right")
allRtAx[-1].yaxis.set_label_position("right")
allRtAx[0].annotate("Runtime (s)",xy=(-.1,.5),ha="right",va="center",xycoords='axes fraction')
allRtAx[-1].yaxis.set_ticks_position('right')
if filename == "RandomGeometric_degreedist:LogNormal_kvals:[15,30,45,60,75,90]_noiseModel:Duplication_orders:[2,3,4,5,6,7,8,9]_samples:1000000_trials:25_data.json":
allRtAx[0].set_yticklabels(["10 s","2 min","5 min","10 min"])
for ax in allRtAx:
ax.set_yticks([1e0,1e1,120,300,600])
elif filename == "RandomGeometric_degreedist:LogNormal_kvals:[15,30,45,60,75,90]_noiseModel:Duplication_n:[500]_orders:[2,3,4,5,6,7,8,9]_samples:1000000_trials:25_data.json":
allRtAx[0].set_yticklabels(["10 s","5 min","10 min","15 min","20 min"])
for ax in allRtAx:
ax.set_yticks([1e1,300,600,900,1200])
else:
for i,ax in enumerate(allRtAx):
ax.set_yscale("log")
ax.set_yticks([1e0,1e1,1e2,1e3,1e4])
ax.set_ylim(1e-1,2e4)
if i == len(allRtAx)-1:
ax.set_yticklabels([r"$10^0$",r"$10^1$",r"$10^2$",r"$10^3$",None])
else:
ax.set_yticklabels([])
allVCAx[0].annotate("Vertex\nCoverage",xy=(-.1,.5),ha="right",va="center",xycoords='axes fraction')
# -- Annotate accuracy plots -- #
allAccAx[5].annotate(r"$\Lambda$T"+"-Klau", xy=(.5, .675), xycoords='axes fraction', c=LT_Klau_color,size=10,ha="center",rotation=20)
allAccAx[5].annotate(r"$\Lambda$T"+"-LS", xy=(.575, .5), xycoords='axes fraction', c=LT_Tabu_color,size=10,ha="center",zorder=4)
allAccAx[annotation_idx].annotate("maximum "+r"$\Lambda$"+"T", xy=(.975, .45), xycoords='axes fraction', c=LT_color,size=10,ha="right")
allAccAx[annotation_idx].annotate("median "+r"$\Lambda$"+"T", xy=(.975, .275), xycoords='axes fraction', c=LT_color,size=10,ha="right")
allMotifCountAx[0].annotate("A Motifs",xy=(-.1,.5),ha="right",va="center",xycoords='axes fraction')
plt.tight_layout()
if save_path is None:
plt.show()
else:
plt.savefig(save_path)
def LambdaTAME_increasing_clique_size_v2(save_path=None):
plt.rc('text.latex', preamble=r'\usepackage{/Users/charlie/Documents/Code/TKPExperimentPlots/latex/dgleich-math}')
fig = plt.figure(figsize=(6,3.5))
global_ax = plt.gca()
data_location = TAME_RESULTS + "klauExps/"
data_location = TAME_RESULTS + "RG_DupNoise/"
def process_klau_data(data,version="LT"):
order_idx = {order:i for (i,order) in enumerate(sorted(set([datum[0] for datum in data])))}
k_idx = {k:i for (i,k) in enumerate(sorted(set([datum[1] for datum in data])))}
trials =len(data[0][-1])
runtime = np.zeros((len(order_idx),len(k_idx),trials))
accuracy = np.zeros((len(order_idx),len(k_idx),trials))
postProcessingAccuracy = np.zeros((len(order_idx),len(k_idx),trials))
triMatch = np.zeros((len(order_idx),len(k_idx),trials))
postProcessingRuntime = np.zeros((len(order_idx),len(k_idx),trials))
#sparsity = np.zeros((len(order_idx),len(k_idx),trials))
trial_idx = np.zeros((len(order_idx),len(k_idx)),int)
vertex_coverage = {}
A_motifs_counts = {}
for (order,k,results) in data:
# expecting results:
# (seed,p, n, sp, acc, dup_tol_acc, matched_matching_score, A_motifs, B_motifs, A_motifDistribution, B_motifsDistribution,profiling,edges,klau_edges,klau_tri_match,klau_acc,_,klau_setup,klau_rt)
i = order_idx[order]
j = k_idx[k]
accuracy[i,j,:] = [x[4] for x in results]
if version=="LT":
runtime[i,j,:] = [sum([sum(val) for val in result[11].values()]) for result in results]
postProcessingAccuracy[i,j,:] = [x[15] for x in results]
postProcessingRuntime[i,j,:] = [x[17] + x[18] for x in results]
#sparsity[i,j,:] = [x[19] for x in results]
if k == min(k_idx.keys()): #only do this once over k
#determine the size of A vs. B motif data
if len(results[0][9]) == results[0][2]:
vertex_coverage[order] = [len(list(filter(lambda y: y!= 0.0,x[9][0])))/x[2] for x in results]
A_motifs_counts[order]= [x[7][0] for x in results]
else:
vertex_coverage[order] = [len(list(filter(lambda y: y!= 0.0,x[10][0])))/x[2] for x in results]
A_motifs_counts[order]= [x[8][0] for x in results]
elif version=="LRT":
postProcessingAccuracy[i,j,:] = [x[14] for x in results]
postProcessingRuntime[i,j,:] = [x[16] + x[17] for x in results]
if version=="LT":
return accuracy,runtime, postProcessingAccuracy, postProcessingRuntime,vertex_coverage,A_motifs_counts, order_idx, k_idx #triMatch,LT_klauTriMatch, p_idx, n_idx
else:
return accuracy, postProcessingAccuracy, postProcessingRuntime,order_idx, k_idx #triMatch,LT_klauTriMatch, p_idx, n_idx
def process_tabu_data(data,version="LT"):
order_idx = {order:i for (i,order) in enumerate(sorted(set([datum[0] for datum in data])))}
k_idx = {k:i for (i,k) in enumerate(sorted(set([datum[1] for datum in data])))}
trials =len(data[0][-1])
accuracy = np.zeros((len(order_idx),len(k_idx),trials))
tabuAccuracy = np.zeros((len(order_idx),len(k_idx),trials))
triMatch = np.zeros((len(order_idx),len(k_idx),trials))
tabuRuntime = np.zeros((len(order_idx),len(k_idx),trials))
#sparsity = np.zeros((len(order_idx),len(k_idx),trials))
trial_idx = np.zeros((len(order_idx),len(k_idx)),int)
vertex_coverage = {}
for (order,k,results) in data:
# expecting results:
# (seed,p, n, sp, acc, dup_tol_acc, matched_matching_score, A_motifs, B_motifs, A_motifDistribution, B_motifsDistribution,profiling,edges,klau_edges,klau_tri_match,klau_acc,_,klau_setup,klau_rt)
i = order_idx[order]
j = k_idx[k]
accuracy[i,j,:] = [x[4] for x in results]
if version == "LT":
tabuAccuracy[i,j,:] = [x[15] for x in results]
tabuRuntime[i,j,:] = [x[18] for x in results]
#sparsity[i,j,:] = [x[19] for x in results]
if k == min(k_idx.keys()): #only do this once over k
vertex_coverage[order] = [len(list(filter(lambda y: y!= 0.0,x[9][0])))/x[2] for x in results]
elif version == "LRT":
print(i," ",j)
tabuAccuracy[i,j,:] = [x[14] for x in results]
tabuRuntime[i,j,:] = [x[17] for x in results]
if version == "LT":
return accuracy, tabuAccuracy,tabuRuntime,vertex_coverage, order_idx, k_idx
else:
return accuracy, tabuAccuracy,tabuRuntime,order_idx, k_idx
filename = "RandomGeometric_degreedist:LogNormal_KlauAlgokvals:[15,30,45,60,75,90]_noiseModel:Duplication_n:[500]_KAmiter:1000_orders:[2,3,4,5,6,7,8,9]_p:[0.5]_samples:1000000_sp:[0.25]_trials:25_data.json"
with open(data_location+filename,'r') as f:
accuracy,LT_runtime, LT_klauAccuracy,LT_klauRuntime,vertex_coverage,A_motifs_counts, order_idx, k_idx = process_klau_data(json.load(f))
filename = "RandomGeometric_degreedist:LogNormal_TabuSearchkvals:[15,30,45,60,75,90]_noiseModel:Duplication_n:[500]_orders:[2,3,4,5,6,7,8,9]_p:[0.5]_samples:1000000_sp:[0.25]_trials:25_data.json"
with open(data_location+filename,'r') as f:
_, LT_TabuAccuracy, LT_TabuRuntime, _, order_idx, k_idx = process_tabu_data(json.load(f))
def make_percentile_plot(plot_ax, x_domain,data,color,**kwargs):
lines = [(lambda col: np.percentile(col,50),1.0,color) ]
ribbons = [
(20,80,.2,color)
]
plot_percentiles(plot_ax, data.T, x_domain, lines, ribbons,**kwargs)
def make_violin_plot_v2(ax,data,precision=2,c=None,v_alpha=.8,format="default",xlim=None,xscale="linear"):
med_bbox = dict(boxstyle="round", ec="w", fc="w", alpha=.5,pad=.05)
bbox = dict(boxstyle="round", ec="w", fc="w", alpha=.5,pad=.01)
max_elem = np.max(data)
center = np.min(data)
scaled_data = [(d-center)/max_elem for d in data]
if xscale=="linear":
v = ax.violinplot(data,[.455], points=100, showmeans=False,widths=.08,
showextrema=False, showmedians=True,vert=True)#,quantiles=[[.2,.8]]*len(data2))
ax.set_xlim(0.4, 0.54)
elif xscale=="log":
v = ax.violinplot(np.log10(data),[.455], points=100, showmeans=False,widths=.005,
showextrema=False, showmedians=True,vert=False)#,quantiles=[[.2,.8]]*len(data2))
else:
raise ValueError(f"supports xscale values: 'linear' & 'log'; Got {xscale}.")
# -- update median lines to have a gap -- #
((x0,y0),(x1,y1)) = v["cmedians"].get_segments()[0]
newMedianLines = [[(0.415,y1),(.43,y1)]]
v["cmedians"].set_segments(newMedianLines)
# -- write data values as text
tick_ypos = .1
def format_string(val):
if np.abs(val-1.0) < 1e-2:
return f"{val:.{1}f}"
elif val >= 1000:
return f"{round(val/1000,1)}k"
else:
return f"{val:.{precision}f}".strip("0")
#format_string = lambda val: f"{val:.{1}f}" if np.abs(val-1.0) <1e-2 else f"{val:.{precision}f}".strip("0")
xloc=.4
ax.annotate(format_string(np.median(data)),xy=(xloc,.4),xycoords="axes fraction",ha="left",va="center",fontsize=10)#.set_bbox(med_bbox)
#ax.annotate(format_string(np.min(data)),xy=(.025,.1),xycoords="axes fraction",ha="left",fontsize=6,alpha=.8)#.set_bbox(bbox)
#ax.annotate(format_string(np.max(data)),xy=(.925,.8),xycoords="axes fraction",ha="right",fontsize=6,alpha=.8)#.set_bbox(bbox)
ax.annotate(format_string(np.max(data)),xy=(xloc,.8),xycoords="axes fraction",ha="left",va="center",fontsize=8,alpha=.8)#.set_bbox(bbox)
ax.annotate(format_string(np.min(data)),xy=(xloc,.0),xycoords="axes fraction",ha="left",va="center",fontsize=8,alpha=.8)#.set_bbox(bbox)
if c is not None:
v["cmedians"].set_color(c)
v["cmedians"].set_alpha(.75)
for b in v['bodies']:
# set colors
b.set_facecolor(c) #b.set_facecolor("None")
b.set_edgecolor("None") #b.set_edgecolor(c)
b.set_alpha(v_alpha)
#b.set_color(c)
# -- only plot the left half of violin plot -- #
m = np.mean(b.get_paths()[0].vertices[:, 0])
b.get_paths()[0].vertices[:, 0] = np.clip(b.get_paths()[0].vertices[:, 0], -np.inf,m)
# -- clip the top of the med-line to the top of the violin plot -- #
def clip_to_top_of_violin(segment):
med_line_x = segment.get_paths()[0].vertices[0, 0]
# find the y-vals of the violin plots near the med-lines
distances = [abs(p[0]- med_line_x) for p in b.get_paths()[0].vertices]
k = 5
closest_x_points = np.argpartition(distances,k)[:k]
new_max_y = np.max([b.get_paths()[0].vertices[idx,1] for idx in closest_x_points] )
#new_max_y += .04
#clip the lines
segment.get_paths()[0].vertices[:, 1] = np.clip(segment.get_paths()[0].vertices[:, 1],-np.inf,new_max_y)
#clip_to_top_of_violin(v["cmedians"])
def make_violin_plot_legend(ax,c="k"):
np.random.seed(12)#Ok looking:12
v = ax.violinplot([np.random.normal() for i in range(50)], points=100, positions=[.1], showmeans=False,
showextrema=False, showmedians=True,vert=True,widths=[.5])#,quantiles=[[.2,.8]]*len(data2))
#ax.axes.set_axis_off()
#ax.set_ylim(.5,1.0)
# -- update median lines to have a gap -- #
((x0,y0),(x1,y1)) = v["cmedians"].get_segments()[0]
#newMedianLines = [[(x0,y0-.125),(x0,y0 + (y1-y0)/2 -.1)]]#,[(x0,y0 + (y1-y0)/2 +.1),(x0,y1+.1)]]
newMedianLines = [[(x1-2.5,y1),(x1-.3,y1)]]
v["cmedians"].set_segments(newMedianLines)
xloc = .6
ax.annotate(f"min ",xy=(xloc,0.2),xycoords="axes fraction",ha="left",va="center",fontsize=11,alpha=.8)
ax.annotate("med.",xy=(xloc,.475),xycoords="axes fraction",ha="left",va="center",fontsize=14)
ax.annotate(f"max ",xy=(xloc,.75),xycoords="axes fraction",ha="left",va="center",fontsize=11,alpha=.8)
if c is not None:
v["cmedians"].set_color(c)
for b in v['bodies']:
b.set_facecolor(c)
b.set_edgecolor("None")
b.set_alpha(.3)
m = np.mean(b.get_paths()[0].vertices[:, 0])
# modify the paths to not go further right than the center
b.get_paths()[0].vertices[:, 0] = np.clip(b.get_paths()[0].vertices[:, 0],-np.inf,m)
def clip_to_top_of_violin(segment):
med_line_x = segment.get_paths()[0].vertices[0, 0]
# find the y-vals of the violin plots near the med-lines
distances = [abs(p[0]- med_line_x) for p in b.get_paths()[0].vertices]
k = 5
closest_x_points = np.argpartition(distances,k)[:k]
new_max_y = np.max([b.get_paths()[0].vertices[idx,1] for idx in closest_x_points] )
new_max_y += .02
#clip the lines
segment.get_paths()[0].vertices[:, 1] = np.clip(segment.get_paths()[0].vertices[:, 1],-np.inf,new_max_y)
#clip_to_top_of_violin(v["cmedians"])
# -- add in order labels overhead -- #
global_ax.set_yticklabels([])
global_ax.set_yticklabels([])
widths = [.7,.3]
#spec = fig.add_gridspec(nrows=5,,hspace=0.2,wspace=0.1,height_ratios=widths,left=.2,right=1.075,top=.95,bottom=.05)
global_spec = fig.add_gridspec(nrows=2, ncols=1,
left=.2,right=1.075,top=.95,bottom=.05,
wspace=0.0,hspace=0.1,
height_ratios=widths
)
widths = [.5, 3, 2]
top_gs = global_spec[0].subgridspec(nrows=3,ncols=1+len(order_idx),
hspace=0.2,wspace=0.1,
height_ratios=widths)
bottom_gs = global_spec[1].subgridspec(nrows=2,ncols=1+len(order_idx),
#left=0.125, right=0.9,top=.95,bottom=.075,
wspace=0.1,hspace=0.4)
allCAx = []
allAccAx = []
allRtAx = []
allVCAx = []
allMotifCountAx = []
allSparsityAx = []
all_axes = np.empty((5,len(order_idx)),object)
first = True
annotation_idx = 1
if filename == "RandomGeometric_degreedist:LogNormal_kvals:[15,30,45,60,75,90]_noiseModel:Duplication_orders:[2,3,4,5,6,7,8,9]_samples:1000000_trials:25_data.json":
k_tick_idx = 0
else:
k_tick_idx = 0
parity = 0
for idx,(order,i) in enumerate(order_idx.items()):
#
# Clique size
#
ax = fig.add_subplot(top_gs[0,i])
all_axes[0,i] = ax
allCAx.append(ax)
ax.annotate(f"{order}",xy=(.5, .85), xycoords='axes fraction', c="k",size=10,ha="center",va="center",weight="bold")
ax.set_xticklabels([])
ax.set_yticklabels([])
#
# Accuracy Plots
#
if idx == annotation_idx:
ax = fig.add_subplot(top_gs[1,i],zorder=5)#,sharey=allAccAx[0])
elif idx == k_tick_idx:
ax = fig.add_subplot(top_gs[1,i],zorder=5)
else:
ax = fig.add_subplot(top_gs[1,i])#,sharey=allAccAx[0])
all_axes[1,i] = ax
allAccAx.append(ax)
#if idx % 2 != parity:
# ax.patch.set_facecolor('k')
# ax.patch.set_alpha(0.1)
ax.set_yticks([0.0,0.25,.5,.75,1.0])
ax.set_ylim(0,1.0)
plt.axhline(y=np.median(accuracy[i,:,:]), color=LT_color,linestyle=LT_linestyle)
plt.axhline(y=np.max(accuracy[i,:,:]), color=LT_color,linestyle="dotted")
make_percentile_plot(ax,k_idx.keys(),LT_klauAccuracy[i,:,:],LT_Klau_color)#,linestyle=LT_Klau_linestyle)
make_percentile_plot(ax,k_idx.keys(),LT_TabuAccuracy[i,:,:],LT_Tabu_color)#,linestyle=LT_Tabu_linestyle)
ax.set_xticklabels([])
ax.set_yticklabels([])
#
# Runtime Plots
#
"""
if idx == k_tick_idx:
ax = fig.add_subplot(spec[2,i],zorder=3)
else:
"""
ax = fig.add_subplot(top_gs[2,i])
all_axes[2,i] = ax
allRtAx.append(ax)
if filename == "RandomGeometric_degreedist:LogNormal_kvals:[15,30,45,60,75,90]_noiseModel:Duplication_orders:[2,3,4,5,6,7,8,9]_samples:1000000_trials:25_data.json":
ax.set_ylim(np.min(LT_klauRuntime[:,:,:]),600)
elif filename == "RandomGeometric_degreedist:LogNormal_kvals:[15,30,45,60,75,90]_noiseModel:Duplication_n:[500]_orders:[2,3,4,5,6,7,8,9]_samples:1000000_trials:25_data.json":
ax.set_ylim(np.min(LT_klauRuntime[:,:,:]),1200)
else:
ax.set_ylim(np.min(LT_klauRuntime[:,:,:]),2100)
#ax.set_yscale("log")
if idx != 0:
ax.set_yticklabels([])
ax.set_xticks([15,45,90])
ax.set_xticklabels([])
make_percentile_plot(ax,k_idx.keys(),LT_klauRuntime[i,:,:],LT_Klau_color)#,linestyle=LT_Klau_linestyle)
make_percentile_plot(ax,k_idx.keys(),LT_TabuRuntime[i,:,:],LT_Tabu_color)#,linestyle=LT_Tabu_linestyle)
plt.axhline(y=np.median(LT_runtime[i,:,:]), color=LT_color,linestyle=LT_linestyle)
#
# Vertex Coverage
#
if i == 0:
ax = fig.add_subplot(bottom_gs[0,i])
else:
ax = fig.add_subplot(bottom_gs[0,i],sharey=all_axes[3,0])
#ax = fig.add_subplot(spec[3,i])
all_axes[3,i] = ax
allVCAx.append(ax)
make_violin_plot_v2(ax,vertex_coverage[order],c="k",v_alpha=.2)
#
# Motif Counts
#
'''
if i == 0:
ax = fig.add_subplot(spec[4,i])
else:
ax = fig.add_subplot(spec[4,i],sharey=allMotifCountAx[0])
'''
if i == 0:
ax = fig.add_subplot(bottom_gs[1,i])
else:
ax = fig.add_subplot(bottom_gs[1,i],sharey=all_axes[4,0])
all_axes[4,i] = ax
allMotifCountAx.append(ax)
make_violin_plot_v2(ax,A_motifs_counts[order],c="k",v_alpha=.2, precision=0)#,xscale="log")
violinLegendAx = allVCAx[0].inset_axes([-2.1,-1.75,.5,1.5])
#for ax in chain(allAccAx,allRtAx,allCAx,allVCAx,allMotifCountAx,allSparsityAx,[global_ax],[violinLegendAx]):
for ax in chain(all_axes.reshape(-1),[global_ax],[violinLegendAx]):
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.spines['left'].set_visible(False)
ax.spines['bottom'].set_visible(False)
ax.yaxis.set_ticks_position('none')
ax.xaxis.set_ticks_position('none')
ax.set_xticklabels([])
ax.set_yticklabels([])
for ax in all_axes[1:3,:].reshape(-1):
ax.xaxis.set_ticks_position('top')
ax.grid(True,axis='y',linewidth=.5)
ax.tick_params(axis="x",direction="in", pad=-15)
ax.set_xticks([15,45,90])
ax.set_xlim(min(k_idx.keys()),max(k_idx.keys()))
for ax in all_axes[3:,:].reshape(-1):
ax.patch.set_facecolor('none')
for i,ax in enumerate(all_axes[2,:]):
ax.set_yscale("log")
ax.set_yticks([1e-1,1e0,1e1,1e2,1e3,1e4])
ax.set_ylim(1e-1,1e4)
if i == 0:
ax.set_yticklabels([r"$10^{-1}$",r"$10^0$",r"$10^1$",r"$10^2$",r"$10^3$",None],ha="left")
ax.tick_params(axis="y",direction="out",which='both', length=7.5,pad=20)
else:
ax.set_yticklabels([])
y_gridlines = ax.yaxis.get_gridlines()
for i in [0,-1]:
if i == 0:
y_gridlines[i].set_linewidth(1.5*y_gridlines[i].get_linewidth())
if i == -1:
y_gridlines[i].set_color("k")
for ax in allAccAx:
#ax.xaxis.set_ticks_position('top')
y_gridlines = ax.yaxis.get_gridlines()
for i in [0,-1]:
y_gridlines[i].set_linewidth(1.5*y_gridlines[i].get_linewidth())
if i == -1:
y_gridlines[i].set_color("k")
# - make violin plot legend - #
make_violin_plot_legend(violinLegendAx)
# -- Alternate tick labels to opposite axes -- #
label_xpos = -.1
allCAx[0].annotate("Clique Size",xy=(label_xpos,.85),ha="right",va="center",xycoords='axes fraction')
#allAccAx[-1].yaxis.set_ticks_position('right')
allAccAx[0].set_yticklabels([0,.25,.5,.75,1.0])
allAccAx[0].tick_params(axis="y",direction="out",which='both', length=7.5)
#allAccAx[0].set_ylabel("Accuracy",rotation=90,labelpad=0,ha="right")
allAccAx[0].annotate("Accuracy",xy=(-1.5,.5),rotation=0,ha="center",va="center",xycoords='axes fraction')
#allRtAx[-1].yaxis.set_label_position("right")
allRtAx[0].annotate("Runtime\n(seconds)",xy=(-1.5,.5),ha="center",va="center",xycoords='axes fraction',rotation=0)
allVCAx[0].annotate("Vertex\nCoverage",xy=(label_xpos,.5),ha="right",va="center",xycoords='axes fraction')
# -- Annotate accuracy plots -- #
allAccAx[0].annotate(r"$\Lambda$T"+"-Klau", xy=(.5, .675), xycoords='axes fraction', c=LT_Klau_color,size=10,ha="center",rotation=20)
allAccAx[0].annotate(r"$\Lambda$T"+"-LS", xy=(.575, .3), xycoords='axes fraction', c=LT_Tabu_color,size=10,ha="center",zorder=4)
allAccAx[annotation_idx].annotate("maximum "+r"$\Lambda$"+"T", xy=(.025, .375), xycoords='axes fraction', c=LT_color,size=10,ha="left")
allAccAx[annotation_idx].annotate("median "+r"$\Lambda$"+"T", xy=(.025, .1), xycoords='axes fraction', c=LT_color,size=10,ha="left")
allMotifCountAx[0].annotate("Motifs\nin A",xy=(label_xpos,.5),ha="right",va="center",xycoords='axes fraction')
# -- Add in x-domain annotations mid plot -- #
allAccAx[k_tick_idx].xaxis.set_label_position("top")
allAccAx[k_tick_idx].xaxis.set_ticks_position('top')
allAccAx[k_tick_idx].tick_params(axis="x",direction="in", pad=.1)
allAccAx[k_tick_idx].annotate("nearest\nneighbors ("+r"$K$"+')',xy=(0.0,-.125),ha="left",va="bottom",xycoords='axes fraction',zorder=10,fontsize=8)
allAccAx[k_tick_idx].set_xticklabels([15,45,90],zorder=3)
#allAccAx[k_tick_idx].grid(zorder=0)
#plt.tight_layout()
if save_path is None:
plt.show()
else:
plt.savefig(save_path)
def LambdaTAME_increasing_clique_size_summarized(save_path=None):
plt.rc('text.latex', preamble=r'\usepackage{/Users/charlie/Documents/Code/TKPExperimentPlots/latex/dgleich-math}')
5,3
fig = plt.figure(figsize=(6,5))
global_ax = plt.gca()
#
# Subroutines
#
def underline_text(ax,text,c,linestyle):
tb = text.get_tightbbox(fig.canvas.get_renderer()).transformed(fig.transFigure.inverted())
ax.annotate('', xy=(tb.xmin,tb.y0), xytext=(tb.xmax,tb.y0), xycoords="figure fraction",arrowprops=dict(arrowstyle="-", color=c,linestyle=linestyle,linewidth=1.5,alpha=.8))
def mark_as_algorithm(ax,text,c,linestyle,algorithm="Klau"):
tb = text.get_tightbbox(fig.canvas.get_renderer()).transformed(fig.transFigure.inverted())
# calculate asymmetry of x and y axes:
x0, y0 = fig.transFigure.transform((0, 0)) # lower left in pixels
x1, y1 = fig.transFigure.transform((1, 1)) # upper right in pixes
dx = x1 - x0
dy = y1 - y0
maxd = max(dx, dy)
#ax.annotate('', xy=(tb.xmin,tb.y0), xytext=(tb.xmax,tb.y0), xycoords="figure fraction",arrowprops=dict(arrowstyle="-", color=LRT_color,linestyle=LRT_linestyle,linewidth=1.5,alpha=.8))
"""
def algorithm_patches(algo):
if algo == "LRTAME":
radius=.02
height = radius * maxd / dy
width = radius * maxd / dx
return patches.Ellipse((tb.xmin-.015,tb.y0+(5/8)*tb.height),width, height,color=LRT_color,transform=fig.transFigure)
elif algo == "TAME":
side_length=.015
height = side_length * maxd / dy
width = side_length * maxd / dx
return patches.Rectangle((tb.xmax+.01,tb.y0+.5*(tb.height - side_length)),
width, height,color=T_color,
transform=fig.transFigure)
else:
raise ValueError(f"algorithm must be either 'TAME' or 'LRTAME', got {algo}.\n")
"""
if algorithm == "Klau":
radius=.01
height = radius * maxd / dy
width = radius * maxd / dx
p=ax.add_patch(patches.Ellipse((tb.xmin-.015,tb.y0+(5/8)*tb.height),width, height,color=LT_Klau_color,transform=fig.transFigure,clip_on=False))
elif algorithm == "Tabu":
side_length=.0075
height = side_length * maxd / dy
width = side_length * maxd / dx
p=ax.add_patch(patches.Rectangle((tb.xmax+.01,tb.y0+.5*(tb.height - side_length)),
width, height,color=LT_Tabu_color,
transform=fig.transFigure,clip_on=False))
else:
raise ValueError(f"algorithm must be either 'Klau' or 'Tabu', got {algorithm}.\n")
#p=ax.add_patch(algorithm_patches(algorithm))
#ax.add_patch(patches.Ellipse((tb.xmin-.015,tb.y0+tb.height/2),width, height,color=LRT_color,transform=fig.transFigure))
#ax.add_patch(patches.Ellipse((tb.xmax,tb.y0),width, height,color=LRT_color,#transform=fig.transFigure),)
"""
#width = .05
#height = .01
xshift = tb.width*.2
height = .03
width = .0075
ax.add_patch(patches.Rectangle((tb.xmin-xshift,tb.y0 + (3/4)*tb.height),width, height,color=LRT_color,transform=fig.transFigure))
height = .015 #* maxd / dy
width = .02 #* maxd / dx
xshift = tb.width*.1
ax.add_patch(patches.Rectangle((tb.xmin-xshift,tb.y1), width,height,color=LRT_color,transform=fig.transFigure))
"""
extremal_tick_ypos = .1
def make_violin_plot(ax,data,precision=2,c=None,v_alpha=.8,format="default",xlim=None,xscale="linear",column_type=None):
#background_v = ax.violinplot(data, points=100, positions=[0.5], showmeans=False,
# showextrema=False, showmedians=False,widths=.5,vert=False)#,quantiles=[[.2,.8]]*len(data2))
#
#positions=[0.5], ,widths=.5
if xscale=="linear":
v = ax.violinplot(data,[.5], points=100, showmeans=False,widths=.15,
showextrema=False, showmedians=True,vert=False)#,quantiles=[[.2,.8]]*len(data2))
elif xscale=="log":
v = ax.violinplot(np.log10(data), points=100, showmeans=False,widths=.15,showextrema=False, showmedians=True,vert=False)#,quantiles=[[.2,.8]]*len(data2))
else:
raise ValueError(f"supports xscale values: 'linear' & 'log'; Got {xscale}.")
#ax.set_ylim(0.95, 1.3)
#ax.set_xlim(np.min(data),np.max(data))
# -- update median lines to have a gap -- #
((x0,y0),(_,y1)) = v["cmedians"].get_segments()[0]
newMedianLines = [[(x0,y1),(x0,y1+.7)]]
v["cmedians"].set_segments(newMedianLines)
# -- place extremal markers underneath
"""
v['cbars'].set_segments([]) # turns off x-axis spine
for segment in [v["cmaxes"],v["cmins"]]:
((x,y0),(_,y1)) = segment.get_segments()[0]
segment.set_segments([[(x,0.45),(x,.525)]])
segment.set_color(c)
"""
# -- write data values as text
bbox = dict(boxstyle="round", ec="w", fc="w", alpha=.5,pad=.05)
extremal_tick_ypos = .1
if column_type is None:
if format == "default":
ax.annotate(f"{np.median(data):.{precision}f}",xy=(.5,.4),xycoords="axes fraction",ha="center",fontsize=10).set_bbox(bbox)
ax.annotate(f"{np.min(data):.{precision}f}",xy=(.075,extremal_tick_ypos),xycoords="axes fraction",ha="left",fontsize=8,alpha=.8)
ax.annotate(f"{np.max(data):.{precision}f}",xy=(.925,extremal_tick_ypos),xycoords="axes fraction",ha="right",fontsize=8,alpha=.8)
elif format == "scientific":
ax.annotate(f"{np.median(data):.{precision}e}",xy=(.5,.4),xycoords="axes fraction",ha="center",fontsize=10).set_bbox(bbox)
ax.annotate(f"{np.min(data):.{precision}e}",xy=(.025,extremal_tick_ypos),xycoords="axes fraction",ha="left",fontsize=8,alpha=.8)
ax.annotate(f"{np.max(data):.{precision}e}",xy=(.925,extremal_tick_ypos),xycoords="axes fraction",ha="right",fontsize=8,alpha=.8)
else:
print(f"expecting format to be either 'default' or 'scientific', got:{format}")
elif column_type == "merged_axis":
pass
else:
raise ValueError("column_type expecting 'merged_axis' or None, but got {column_type}\n")
if c is not None:
v["cmedians"].set_color(c)
v["cmedians"].set_alpha(.75)
for b in v['bodies']:
# set colors
b.set_facecolor("None")
b.set_edgecolor(c)
b.set_alpha(v_alpha)
#b.set_color(c)
# -- only plot the top half of violin plot -- #
m = np.mean(b.get_paths()[0].vertices[:, 1])
b.get_paths()[0].vertices[:, 1] = np.clip(b.get_paths()[0].vertices[:, 1],m, np.inf)
# -- clip the top of the med-line to the top of the violin plot -- #
def clip_to_top_of_violin(segment):
med_line_x = segment.get_paths()[0].vertices[0, 0]
# find the y-vals of the violin plots near the med-lines
distances = [abs(p[0]- med_line_x) for p in b.get_paths()[0].vertices]
k = 5
closest_x_points = np.argpartition(distances,k)[:k]
new_max_y = np.max([b.get_paths()[0].vertices[idx,1] for idx in closest_x_points] )
#new_max_y += .04
#clip the lines
segment.get_paths()[0].vertices[:, 1] = np.clip(segment.get_paths()[0].vertices[:, 1],-np.inf,new_max_y)
#clip_to_top_of_violin(v["cmaxes"])
#clip_to_top_of_violin(v["cmins"])
clip_to_top_of_violin(v["cmedians"])
def make_violin_plot_merged_axis(ax,data1,data2,c1,c2,marker1,marker2,format=None,**kwargs):
make_violin_plot(ax,data1,**dict(kwargs,c=c1,column_type="merged_axis"))
make_violin_plot(ax,data2,**dict(kwargs,format=format,c=c2,column_type="merged_axis"))
#ax.scatter(np.median(data1),.65,marker=marker1,s=5)
marker_size = 12.5
print(ax.get_ylim())
x,marker_y_loc = ax.get_ylim()
ax.set_ylim(x,marker_y_loc + .05)
ax.scatter(np.median(data1),marker_y_loc,marker=LT_Klau_marker,color=LT_Klau_color,s=marker_size)
ax.scatter(np.median(data2),marker_y_loc,marker=LT_Tabu_marker,color=LT_Tabu_color,s=marker_size)
min1 = np.min(data1)
min2 = np.min(data2)
if min1 < min2:
#text = f"{min1:.{kwargs['precision']}f}"
#underlined_annotation(fig,ax,(.075,extremal_tick_ypos),text,linestyle=LRT_linestyle,ha="left",fontsize=8,alpha=.8)
text = ax.annotate(f"{min1:.{kwargs['precision']}f}",xy=(.075,extremal_tick_ypos),xycoords="axes fraction",ha="left",fontsize=8,alpha=.8)
mark_as_algorithm(ax,text,T_color,T_linestyle,algorithm="Klau")
#underline_text(ax,text,T_color,T_linestyle)
"""
tb = text.get_tightbbox(fig.canvas.get_renderer()).transformed(fig.transFigure.inverted())
ax.annotate('', xy=(tb.xmin,tb.y0), xytext=(tb.xmax,tb.y0), xycoords="figure fraction",arrowprops=dict(arrowstyle="-", color='k',linestyle=T_linestyle))
"""
else:
text = ax.annotate(f"{min2:.{kwargs['precision']}f}",xy=(.075,extremal_tick_ypos),xycoords="axes fraction",ha="left",fontsize=8,alpha=.8)
mark_as_algorithm(ax,text,LRT_color,LRT_linestyle,algorithm="Tabu")
#underline_text(ax,text,LRT_color,LRT_linestyle)
#minimum_val = min([np.min(data1),np.min(data2)])
maximum_val = min([np.max(data1),np.max(data2)])
max1 = np.max(data1)
max2 = np.max(data2)
if max1 > max2:
text = f"{maximum_val:.{kwargs['precision']}f}"
text = ax.annotate(f"{max1:.{kwargs['precision']}f}",xy=(.925,extremal_tick_ypos),xycoords="axes fraction",ha="right",fontsize=8,alpha=.8)
mark_as_algorithm(ax,text,T_color,T_linestyle,algorithm="Klau")
#underline_text(ax,text,T_color,T_linestyle)
#underlined_annotation(fig,ax,(.925,extremal_tick_ypos),text,linestyle=LRT_linestyle,ha="right",fontsize=8,alpha=.8)
else:
text = ax.annotate(f"{maximum_val:.{kwargs['precision']}f}",xy=(.925,extremal_tick_ypos),xycoords="axes fraction",ha="right",fontsize=8,alpha=.8)
mark_as_algorithm(ax,text,LRT_color,LRT_linestyle,algorithm="Tabu")
#underline_text(ax,text,LRT_color,LRT_linestyle)
bbox = dict(boxstyle="round", ec="w", fc="w", alpha=.5,pad=.025)
ax.annotate(f"{np.median(data1):.{kwargs['precision']}f}",xy=(.7,.4),xycoords="axes fraction",ha="center",fontsize=10).set_bbox(bbox)
ax.annotate(f"{np.median(data2):.{kwargs['precision']}f}",xy=(.3,.4),xycoords="axes fraction",ha="center",fontsize=10).set_bbox(bbox)
#for x in sorted(dir(text)):
# print(x)
"""
if format is None:
ax.annotate(f"{np.median(data1):.{kwargs[:precision]}f}",xy=(.5,.2),xycoords="axes fraction",ha="center",fontsize=10)
ax.annotate(f"{np.min(data1):.{precision}f}",xy=(.075,extremal_tick_ypos),xycoords="axes fraction",ha="left",fontsize=8,alpha=.8)
ax.annotate(f"{np.max(data1):.{precision}f}",xy=(.925,extremal_tick_ypos),xycoords="axes fraction",ha="right",fontsize=8,alpha=.8)
elif format == "scientific":
ax.annotate(f"{np.median(data):.{precision}e}",xy=(.5,.2),xycoords="axes fraction",ha="center",fontsize=10)
ax.annotate(f"{np.min(data):.{precision}e}",xy=(.025,extremal_tick_ypos),xycoords="axes fraction",ha="left",fontsize=8,alpha=.8)
ax.annotate(f"{np.max(data):.{precision}e}",xy=(.925,extremal_tick_ypos),xycoords="axes fraction",ha="right",fontsize=8,alpha=.8)
else:
print(f"expecting format to be 'scientific' or None, got:{format}")
"""
def make_violin_plot_legend(ax,c="k"):
np.random.seed(12)#Ok looking:12
v = ax.violinplot([np.random.normal() for i in range(50)], points=100, positions=[.6], showmeans=False,
showextrema=False, showmedians=True,widths=.6,vert=False)#,quantiles=[[.2,.8]]*len(data2))
#ax.axes.set_axis_off()
ax.set_ylim(.5,1.0)
# -- update median lines to have a gap -- #
((x0,y0),(_,y1)) = v["cmedians"].get_segments()[0]
#newMedianLines = [[(x0,y0-.125),(x0,y0 + (y1-y0)/2 -.1)]]#,[(x0,y0 + (y1-y0)/2 +.1),(x0,y1+.1)]]
newMedianLines = [[(x0,y1 +.05),(x0,1.5)]]
v["cmedians"].set_segments(newMedianLines)
ax.annotate("median",xy=(.5,.4),xycoords="axes fraction",ha="center",va="center",fontsize=10)
ax.annotate(f"min",xy=(.025,-.125),xycoords="axes fraction",ha="left",fontsize=9,alpha=.8)
ax.annotate(f"max",xy=(.975,-.125),xycoords="axes fraction",ha="right",fontsize=9,alpha=.8)
if c is not None:
v["cmedians"].set_color(c)
for b in v['bodies']:
b.set_facecolor(c)
b.set_edgecolor(c)
b.set_alpha(.3)
b.set_color(c)
m = np.mean(b.get_paths()[0].vertices[:, 1])
# modify the paths to not go further right than the center
b.get_paths()[0].vertices[:, 1] = np.clip(b.get_paths()[0].vertices[:, 1],m, np.inf)
def clip_to_top_of_violin(segment):
med_line_x = segment.get_paths()[0].vertices[0, 0]
# find the y-vals of the violin plots near the med-lines
distances = [abs(p[0]- med_line_x) for p in b.get_paths()[0].vertices]
k = 5
closest_x_points = np.argpartition(distances,k)[:k]
new_max_y = np.max([b.get_paths()[0].vertices[idx,1] for idx in closest_x_points] )
new_max_y += .02
#clip the lines
segment.get_paths()[0].vertices[:, 1] = np.clip(segment.get_paths()[0].vertices[:, 1],-np.inf,new_max_y)
clip_to_top_of_violin(v["cmedians"])
def make_merged_violin_plot_legend(ax):
np.random.seed(12)#Ok looking:12
v1= ax.violinplot([np.random.normal(-.25,.25) for i in range(50)], points=100, positions=[.6], showmeans=False, showextrema=False, showmedians=True,widths=.6,vert=False)#,quantiles=[[.2,.8]]*len(data2))
v2 = ax.violinplot([np.random.normal(.5,.25) for i in range(50)], points=100, positions=[.6],
showmeans=False, showextrema=False, showmedians=True,widths=.6,vert=False)
ax.set_ylim(.5,1.0)
for (c,v) in [(LRT_color,v1),(T_color,v2)]:
# -- update median lines to have a gap -- #
((x0,y0),(_,y1)) = v["cmedians"].get_segments()[0]
#newMedianLines = [[(x0,y0-.125),(x0,y0 + (y1-y0)/2 -.1)]]#,[(x0,y0 + (y1-y0)/2 +.1),(x0,y1+.1)]]
newMedianLines = [[(x0,y1 +.05),(x0,1.5)]]
v["cmedians"].set_segments(newMedianLines)
med_label1 = ax.annotate(r"$\Lambda$T"+"Klau med.",xy=(.25,.35),xycoords="axes fraction",ha="center",va="center",fontsize=10)
#mark_as_algorithm(ax,med_label1,LRT_color,LRT_linestyle,algorithm="LRTAME")
med_label2 = ax.annotate(r"$\Lambda$T"+"Tabu med.",xy=(.7,.35),xycoords="axes fraction",ha="center",va="center",fontsize=10)
#mark_as_algorithm(ax,med_label2,T_color,T_linestyle,algorithm="TAME")
min_label = ax.annotate(f"min",xy=(.075,-.125),xycoords="axes fraction",ha="left",fontsize=9,alpha=.8)
mark_as_algorithm(ax,min_label,LRT_color,LRT_linestyle,algorithm="Klau")
max_label = ax.annotate(f"max",xy=(.925,-.125),xycoords="axes fraction",ha="right",fontsize=9,alpha=.8)
mark_as_algorithm(ax,max_label,T_color,T_linestyle,algorithm="Tabu")
v["cmedians"].set_color(c)
for b in v['bodies']:
b.set_facecolor(c)
b.set_edgecolor(c)
b.set_alpha(.3)
b.set_color(c)
m = np.mean(b.get_paths()[0].vertices[:, 1])
# modify the paths to not go further right than the center
b.get_paths()[0].vertices[:, 1] = np.clip(b.get_paths()[0].vertices[:, 1],m, np.inf)
def clip_to_top_of_violin(segment):
med_line_x = segment.get_paths()[0].vertices[0, 0]
# find the y-vals of the violin plots near the med-lines
distances = [abs(p[0]- med_line_x) for p in b.get_paths()[0].vertices]
k = 5
closest_x_points = np.argpartition(distances,k)[:k]
new_max_y = np.max([b.get_paths()[0].vertices[idx,1] for idx in closest_x_points] )
new_max_y += .02
#clip the lines
segment.get_paths()[0].vertices[:, 1] = np.clip(segment.get_paths()[0].vertices[:, 1],-np.inf,new_max_y)
clip_to_top_of_violin(v["cmedians"])
data_location = TAME_RESULTS + "RG_DupNoise/"
def process_klau_data(data,version="LT"):
order_idx = {order:i for (i,order) in enumerate(sorted(set([datum[0] for datum in data])))}
k_idx = {k:i for (i,k) in enumerate(sorted(set([datum[1] for datum in data])))}
trials =len(data[0][-1])
runtime = np.zeros((len(order_idx),len(k_idx),trials))
accuracy = np.zeros((len(order_idx),len(k_idx),trials))
postProcessingAccuracy = np.zeros((len(order_idx),len(k_idx),trials))
triMatch = np.zeros((len(order_idx),len(k_idx),trials))
postProcessingRuntime = np.zeros((len(order_idx),len(k_idx),trials))
#sparsity = np.zeros((len(order_idx),len(k_idx),trials))
trial_idx = np.zeros((len(order_idx),len(k_idx)),int)
vertex_coverage = {}
A_motifs_counts = {}
for (order,k,results) in data:
# expecting results:
# (seed,p, n, sp, acc, dup_tol_acc, matched_matching_score, A_motifs, B_motifs, A_motifDistribution, B_motifsDistribution,profiling,edges,klau_edges,klau_tri_match,klau_acc,_,klau_setup,klau_rt)
i = order_idx[order]
j = k_idx[k]
print(f"p:{results[0][1]} n:{results[0][2]} sp:{results[0][3]}")
accuracy[i,j,:] = [x[4] for x in results]
if version=="LT":
runtime[i,j,:] = [sum([sum(val) for val in result[11].values()]) for result in results]
postProcessingAccuracy[i,j,:] = [x[15] for x in results]
postProcessingRuntime[i,j,:] = [x[17] + x[18] for x in results]
#sparsity[i,j,:] = [x[19] for x in results]
if k == min(k_idx.keys()): #only do this once over k
#determine the size of A vs. B motif data
if len(results[0][9]) == results[0][2]:
vertex_coverage[order] = [len(list(filter(lambda y: y!= 0.0,x[9][0])))/x[2] for x in results]
A_motifs_counts[order]= [x[7][0] for x in results]
else:
vertex_coverage[order] = [len(list(filter(lambda y: y!= 0.0,x[10][0])))/x[2] for x in results]
A_motifs_counts[order]= [x[8][0] for x in results]
elif version=="LRT":
postProcessingAccuracy[i,j,:] = [x[14] for x in results]
postProcessingRuntime[i,j,:] = [x[16] + x[17] for x in results]
if version=="LT":
return accuracy,runtime, postProcessingAccuracy, postProcessingRuntime,vertex_coverage,A_motifs_counts, order_idx, k_idx #triMatch,LT_klauTriMatch, p_idx, n_idx
else:
return accuracy, postProcessingAccuracy, postProcessingRuntime,order_idx, k_idx #triMatch,LT_klauTriMatch, p_idx, n_idx
def process_tabu_data(data,version="LT"):
order_idx = {order:i for (i,order) in enumerate(sorted(set([datum[0] for datum in data])))}
k_idx = {k:i for (i,k) in enumerate(sorted(set([datum[1] for datum in data])))}
trials =len(data[0][-1])
accuracy = np.zeros((len(order_idx),len(k_idx),trials))
tabuAccuracy = np.zeros((len(order_idx),len(k_idx),trials))
triMatch = np.zeros((len(order_idx),len(k_idx),trials))
tabuRuntime = np.zeros((len(order_idx),len(k_idx),trials))
#sparsity = np.zeros((len(order_idx),len(k_idx),trials))
trial_idx = np.zeros((len(order_idx),len(k_idx)),int)
vertex_coverage = {}
for (order,k,results) in data:
# expecting results:
# (seed,p, n, sp, acc, dup_tol_acc, matched_matching_score, A_motifs, B_motifs, A_motifDistribution, B_motifsDistribution,profiling,edges,klau_edges,klau_tri_match,klau_acc,_,klau_setup,klau_rt)
i = order_idx[order]
j = k_idx[k]
accuracy[i,j,:] = [x[4] for x in results]
if version == "LT":
tabuAccuracy[i,j,:] = [x[15] for x in results]
tabuRuntime[i,j,:] = [x[18] for x in results]
#sparsity[i,j,:] = [x[19] for x in results]
if k == min(k_idx.keys()): #only do this once over k
vertex_coverage[order] = [len(list(filter(lambda y: y!= 0.0,x[9][0])))/x[2] for x in results]
elif version == "LRT":
print(i," ",j)
tabuAccuracy[i,j,:] = [x[14] for x in results]
tabuRuntime[i,j,:] = [x[17] for x in results]
if version == "LT":
return accuracy, tabuAccuracy,tabuRuntime,vertex_coverage, order_idx, k_idx
else:
return accuracy, tabuAccuracy,tabuRuntime,order_idx, k_idx
#
# Parse the Data
#
#filename = "RandomGeometric_degreedist:LogNormal_kvals:[15,30,45,60,75,90]_noiseModel:Duplication_n:[500]_orders:[2,3,4,5,6,7,8,9]_samples:1000000_trials:25_data.json"
filename = "RandomGeometric_degreedist:LogNormal_kvals:[15,30,45,60,75,90]_noiseModel:Duplication_n:[500]_KAmiter:1000_orders:[2,3,4,5,6,7,8,9]_samples:1000000_trials:25_data.json" # exp uses sp:10
filename = "RandomGeometric_degreedist:LogNormal_kvals:[15,30,45,60,75,90]_noiseModel:Duplication_n:[500]_KAmiter:100_orders:[2,3,4,5,6,7,8,9]_p:[0.5]_samples:1000000_sp:[0.25]_trials:25_data.json"
filename = "RandomGeometric_degreedist:LogNormal_KlauAlgokvals:[15,30,45,60,75,90]_noiseModel:Duplication_n:[500]_KAmiter:1000_orders:[2,3,4,5,6,7,8,9]_p:[0.5]_samples:1000000_sp:[0.25]_trials:25_data.json"
#filename = "RandomGeometric_degreedist:LogNormal_kvals:[15,30,45,60,75,90]_noiseModel:Duplication_orders:[2,3,4,5,6,7,8,9]_samples:1000000_trials:25_data.json"
print("loading Klau Data")
with open(data_location+filename,'r') as f:
# with open(data_location+filename,"r") as f:
accuracy,LT_runtime, LT_klauAccuracy,LT_klauRuntime,vertex_coverage,A_motifs_counts, order_idx, k_idx = process_klau_data(json.load(f))
filename = "RandomGeometric_degreedist:LogNormal_TabuSearchkvals:[15,30,45,60,75,90]_noiseModel:Duplication_n:[500]_orders:[2,3,4,5,6,7,8,9]_samples:1000000_trials:25_data.json"
filename = "RandomGeometric_degreedist:LogNormal_TabuSearchkvals:[15,30,45,60,75,90]_noiseModel:Duplication_n:[500]_orders:[2,3,4,5,6,7,8,9]_p:[0.5]_samples:1000000_sp:[0.25]_trials:25_data.json"
print("loading Local Search Data")
with open(data_location+filename,'r') as f:
_, LT_TabuAccuracy, LT_TabuRuntime, _, order_idx, k_idx = process_tabu_data(json.load(f))
"""
filename = "RandomGeometric_LRTAME_degreedist:LogNormal_KlauAlgokvals:[15,30,45,60,75,90]_n:[500]_noiseModel:Duplication_orders:[2,3,4,5,6,7,8,9]_samples:1000000_trials:25_data.json"
with open(data_location+filename,'r') as f:
_, LRT_klauAccuracy, LRT_klauRuntime, order_idx, k_idx = process_klau_data(json.load(f),"LRT")
filename = "RandomGeometric_LRTAME_degreedist:LogNormal_TabuSearchkvals:[15,30,45,60,75,90]_noiseModel:Duplication_n:[500]_orders:[2,3,4,5,6,7,8,9]_samples:1000000_trials:25_data.json"
with open(data_location+filename,'r') as f:
_, LRT_TabuAccuracy, LRT_TabuRuntime, order_idx, k_idx = process_tabu_data(json.load(f),"LRT")
"""
""" Old Plotting code
def make_percentile_plot(plot_ax, x_domain,data,color,**kwargs):
#TODO: check on scope priorities of ax for closures
lines = [(lambda col: np.percentile(col,50),1.0,color) ]
ribbons = [
(20,80,.2,color)
]
plot_percentiles(plot_ax, data.T, x_domain, lines, ribbons,**kwargs)
"""
# -- add in order labels overhead -- #
global_ax.set_yticklabels([])
global_ax.set_yticklabels([])
order_label_idx = 0
gap1 = 1
accuracy_idx = 2
vertex_coverage_idx = 3
motif_count_idx = 4
gap2 = 5
runtime_idx = 6
widths = [1, .25,4,2,2,.25,4]
# = [1]*len(order_idx)
spec = fig.add_gridspec(nrows=len(order_idx)+1,ncols=5+2,
hspace=0.05,wspace=0.025,
left=.025,right=.975,top=.85,bottom=.025,
width_ratios=widths)
allCAx = []
allAccAx = []
allRtAx = []
allVCAx = []
allMotifCountAx = []
allSparsityAx = []
first = True
annotation_idx = 4
k_tick_idx = 4
parity = 0
for idx,(order,i) in enumerate(order_idx.items()):
#
# Clique size
#
ax = fig.add_subplot(spec[i,order_label_idx])
allCAx.append(ax)
ax.annotate(f"{order}",xy=(.5, .5), xycoords='axes fraction', c="k",size=10,ha="center",va="center")
ax.set_xticklabels([])
ax.set_yticklabels([])
ax = fig.add_subplot(spec[i,accuracy_idx])#,sharey=allAccAx[0])
allAccAx.append(ax)
#if idx % 2 != parity:
# ax.patch.set_facecolor('k')
# ax.patch.set_alpha(0.1)
# -- Accuracy Plots -- #
#ax.set_yticks([0.0,0.25,.5,.75,1.0])
#ax.set_ylim(0,1.0)
#ax.set_xticks([])
#plt.axhline(y=np.median(accuracy[i,:,:]), color=LT_color,linestyle=LT_linestyle)
#plt.axhline(y=np.max(accuracy[i,:,:]), color=LT_color,linestyle="dotted")
default_k = 30
make_violin_plot_merged_axis(ax,LT_klauAccuracy[i,k_idx[default_k],:],LT_TabuAccuracy[i,k_idx[default_k],:],LT_Klau_color,LT_Tabu_color,None,None,precision=2)
#make_violin_plot(ax,LT_klauAccuracy[i,k_idx[default_k],:],precision=2,c=LT_Klau_color)
#make_violin_plot(ax,LT_TabuAccuracy[i,k_idx[default_k],:],precision=2,c=LT_Tabu_color)
#
# Runtime Plots
#
ax = fig.add_subplot(spec[i,runtime_idx])
allRtAx.append(ax)
make_violin_plot_merged_axis(ax,LT_klauRuntime[i,k_idx[default_k],:],LT_TabuRuntime[i,k_idx[default_k],:],LT_Klau_color,LT_Tabu_color,None,None,precision=1)
#make_violin_plot(ax,LT_klauRuntime[i,k_idx[default_k],:],precision=2,c=LT_Klau_color)
#make_violin_plot(ax,LT_TabuRuntime[i,k_idx[default_k],:],precision=2,c=LT_Tabu_color)
#
# Vertex Coverage
#
ax = fig.add_subplot(spec[i,vertex_coverage_idx])
allVCAx.append(ax)
make_violin_plot(ax,vertex_coverage[order],c="k",v_alpha=.1)
#
# Motif Counts
#
ax = fig.add_subplot(spec[i,motif_count_idx])
allMotifCountAx.append(ax)
make_violin_plot(ax,A_motifs_counts[order],c="k",v_alpha=.1,precision=0)
violinLegendAx = fig.add_subplot(spec[-1,1:3])
violinMergedAxisLegendAx = fig.add_subplot(spec[-1,3:6])
for ax in chain(allAccAx,allRtAx,allCAx,allVCAx,allMotifCountAx,allSparsityAx,[global_ax,violinLegendAx,violinMergedAxisLegendAx]):#,[violinLegendAx]):
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.spines['left'].set_visible(False)
ax.spines['bottom'].set_visible(False)
ax.yaxis.set_ticks_position('none')
ax.xaxis.set_ticks_position('none')
ax.set_xticklabels([])
ax.set_yticklabels([])
"""
for ax in chain(allAccAx,allRtAx,allSparsityAx):
ax.set_xticks([15,45,90])
ax.set_xlim(min(k_idx.keys()),max(k_idx.keys()))
"""
# - make violin plot legend - #
make_violin_plot_legend(violinLegendAx)
make_merged_violin_plot_legend(violinMergedAxisLegendAx)
# -- Add in x-domain annotations mid plot -- #
#allRtAx[k_tick_idx].xaxis.set_label_position("top")
#allRtAx[k_tick_idx].xaxis.set_ticks_position('top')
#allRtAx[k_tick_idx].tick_params(axis="x",direction="out", pad=-15)
#allAccAx[k_tick_idx].annotate("nearest neighbors",xy=(.5,.05),ha="center",xycoords='axes fraction')
#allRtAx[k_tick_idx].set_xticklabels([15,45,90],zorder=5)
#allRtAx[k_tick_idx].set_axisbelow(True)
#allRtAx[0].set_xlabel("nearest\nneighbors")
# -- Alternate tick labels to opposite axes -- #
title_yloc = 1.25
allCAx[0].annotate("Clique\nSize",xy=(.5,title_yloc ),ha="center",va="center",xycoords='axes fraction')
allAccAx[0].annotate("Accuracy",xy=(.5,title_yloc ),ha="center",va="center",xycoords='axes fraction')
allRtAx[0].annotate("Runtime (s)",xy=(.5,title_yloc ),ha="center",va="center",xycoords='axes fraction')
allVCAx[0].annotate("Vertex\nCoverage",xy=(.5,title_yloc),ha="center",va="center",xycoords='axes fraction')
# -- Annotate accuracy plots -- #
allMotifCountAx[0].annotate("A Motifs",xy=(.5,title_yloc ),ha="center",va="center",xycoords='axes fraction')
plt.tight_layout()
if save_path is None:
plt.show()
else:
plt.savefig(save_path)
| 46.072423
| 240
| 0.626137
| 42,778
| 294,541
| 4.063327
| 0.026415
| 0.003095
| 0.02773
| 0.021516
| 0.886728
| 0.858141
| 0.829399
| 0.801192
| 0.780619
| 0.757089
| 0
| 0.04481
| 0.220363
| 294,541
| 6,392
| 241
| 46.079631
| 0.712134
| 0.106484
| 0
| 0.637831
| 0
| 0.031481
| 0.156001
| 0.094496
| 0
| 0
| 0
| 0.000939
| 0.002646
| 1
| 0.025132
| false
| 0.001852
| 0.000794
| 0
| 0.035185
| 0.008466
| 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
|
98873f33583fca23ec3ac952660f87031e424681
| 48
|
py
|
Python
|
Python/libraries/recognizers-sequence/recognizers_sequence/resources/__init__.py
|
ParadoxARG/Recognizers-Text
|
70c2a368e48fb0694f8a185574d6dd6076b29362
|
[
"MIT"
] | null | null | null |
Python/libraries/recognizers-sequence/recognizers_sequence/resources/__init__.py
|
ParadoxARG/Recognizers-Text
|
70c2a368e48fb0694f8a185574d6dd6076b29362
|
[
"MIT"
] | null | null | null |
Python/libraries/recognizers-sequence/recognizers_sequence/resources/__init__.py
|
ParadoxARG/Recognizers-Text
|
70c2a368e48fb0694f8a185574d6dd6076b29362
|
[
"MIT"
] | null | null | null |
from .base_phone_numbers import BasePhoneNumbers
| 48
| 48
| 0.916667
| 6
| 48
| 7
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.0625
| 48
| 1
| 48
| 48
| 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
|
98abe8aa4c8b4e85caea439ba6a268acdc562426
| 170
|
py
|
Python
|
tankobon/__init__.py
|
ongyx/tankobon
|
d74894c12381a570938fe50a326449a8df2dc65b
|
[
"MIT"
] | 1
|
2021-07-01T15:17:24.000Z
|
2021-07-01T15:17:24.000Z
|
tankobon/__init__.py
|
ongyx/tankobon
|
d74894c12381a570938fe50a326449a8df2dc65b
|
[
"MIT"
] | 1
|
2021-06-21T04:26:41.000Z
|
2021-06-22T04:30:18.000Z
|
tankobon/__init__.py
|
ongyx/tankobon
|
d74894c12381a570938fe50a326449a8df2dc65b
|
[
"MIT"
] | null | null | null |
# coding: utf8
"""Yet another manga scraper and downloader"""
from .__version__ import __version__
from .core import Cache, Downloader
from .sources.base import Parser
| 21.25
| 46
| 0.782353
| 22
| 170
| 5.681818
| 0.727273
| 0.224
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006849
| 0.141176
| 170
| 7
| 47
| 24.285714
| 0.849315
| 0.317647
| 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
|
7f9425bcfb4f1cf30dd8023def05540ac1d866c2
| 133
|
py
|
Python
|
app/services/v2/healthcheck.py
|
rvmoura96/flask-template
|
d1383be7e17bff580e3ddf61ae580271c30201c4
|
[
"MIT"
] | 2
|
2019-09-25T19:19:11.000Z
|
2019-10-08T01:05:35.000Z
|
app/services/v2/healthcheck.py
|
rvmoura96/flask-template
|
d1383be7e17bff580e3ddf61ae580271c30201c4
|
[
"MIT"
] | 10
|
2019-09-13T23:41:42.000Z
|
2020-05-10T21:12:32.000Z
|
app/services/v2/healthcheck.py
|
rvmoura96/flask-template
|
d1383be7e17bff580e3ddf61ae580271c30201c4
|
[
"MIT"
] | 9
|
2019-09-30T15:26:23.000Z
|
2020-09-28T23:36:25.000Z
|
from flask_restful import Resource
import app
from app.services.healthcheck import HealthApi
class HealthApiV2(HealthApi):
pass
| 19
| 46
| 0.827068
| 17
| 133
| 6.411765
| 0.705882
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.008696
| 0.135338
| 133
| 6
| 47
| 22.166667
| 0.93913
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.2
| 0.6
| 0
| 0.8
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
|
0
| 6
|
f6d4c21895b6767fbe4da94408261ec0a9fce043
| 377
|
py
|
Python
|
openmdao.lib/src/openmdao/lib/doegenerators/api.py
|
OzanCKN/OpenMDAO-Framework
|
05e9d4b9bc41d0ec00a7073545146c925cd33b0b
|
[
"Apache-2.0"
] | 1
|
2015-11-05T11:14:45.000Z
|
2015-11-05T11:14:45.000Z
|
openmdao.lib/src/openmdao/lib/doegenerators/api.py
|
janus/OpenMDAO-Framework
|
05e9d4b9bc41d0ec00a7073545146c925cd33b0b
|
[
"Apache-2.0"
] | null | null | null |
openmdao.lib/src/openmdao/lib/doegenerators/api.py
|
janus/OpenMDAO-Framework
|
05e9d4b9bc41d0ec00a7073545146c925cd33b0b
|
[
"Apache-2.0"
] | 1
|
2020-07-15T02:45:54.000Z
|
2020-07-15T02:45:54.000Z
|
"""Pseudo package providing a central place to access all of the
OpenMDAO doegenerators in the standard library."""
from openmdao.lib.doegenerators.full_factorial import FullFactorial
from openmdao.lib.doegenerators.optlh import OptLatinHypercube
from openmdao.lib.doegenerators.uniform import Uniform
from openmdao.lib.doegenerators.central_composite import CentralComposite
| 47.125
| 73
| 0.859416
| 47
| 377
| 6.851064
| 0.574468
| 0.149068
| 0.186335
| 0.347826
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.090186
| 377
| 7
| 74
| 53.857143
| 0.938776
| 0.289125
| 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
|
63dfc85c5f1a168f3d17412579ff15b24c5e852d
| 36
|
py
|
Python
|
tests/fixtures/serve/app.py
|
checkr/fdep
|
36fba98e6b3af35adf238c61f700a8138c090a5e
|
[
"MIT"
] | 9
|
2017-01-21T00:08:17.000Z
|
2019-10-20T09:26:25.000Z
|
tests/fixtures/serve/app.py
|
checkr/fdep
|
36fba98e6b3af35adf238c61f700a8138c090a5e
|
[
"MIT"
] | 2
|
2017-01-28T02:17:20.000Z
|
2018-06-18T20:27:47.000Z
|
tests/fixtures/serve/app.py
|
checkr/fdep
|
36fba98e6b3af35adf238c61f700a8138c090a5e
|
[
"MIT"
] | null | null | null |
def classify(text):
return True
| 12
| 19
| 0.694444
| 5
| 36
| 5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.222222
| 36
| 2
| 20
| 18
| 0.892857
| 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
|
63e4e02f88d18272c3b9b59cca1f59a376103b37
| 401
|
py
|
Python
|
gym_cap/heuristic/__init__.py
|
raide-project/ctf_public
|
fdee45c77e3dd8e7f52bb28117ff111682cb88bf
|
[
"NCSA"
] | 6
|
2019-04-20T23:11:46.000Z
|
2021-12-16T20:47:17.000Z
|
gym_cap/heuristic/__init__.py
|
raide-project/ctf_public
|
fdee45c77e3dd8e7f52bb28117ff111682cb88bf
|
[
"NCSA"
] | 59
|
2019-04-19T17:55:29.000Z
|
2020-06-10T07:02:14.000Z
|
gym_cap/heuristic/__init__.py
|
raide-project/ctf_public
|
fdee45c77e3dd8e7f52bb28117ff111682cb88bf
|
[
"NCSA"
] | 5
|
2019-04-19T20:13:03.000Z
|
2020-05-30T18:33:20.000Z
|
from gym_cap.heuristic.policy import Policy
from gym_cap.heuristic.patrol import Patrol
from gym_cap.heuristic.roomba import Roomba
from gym_cap.heuristic.zeros import Zeros
from gym_cap.heuristic.random import Random
from gym_cap.heuristic.defense import Defense
from gym_cap.heuristic.astar_flag import AStar
from gym_cap.heuristic.spiral import Spiral
from gym_cap.heuristic.fighter import Fighter
| 40.1
| 46
| 0.865337
| 64
| 401
| 5.265625
| 0.234375
| 0.186944
| 0.267062
| 0.507418
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.089776
| 401
| 9
| 47
| 44.555556
| 0.923288
| 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
|
124ed99657012f492d4906c0edc7e79c0541fdba
| 60
|
py
|
Python
|
src/main/__init__.py
|
zrev2220/open-contest
|
5dbb383a19b8ff4dfe5bdcf18379cb8aa13b47b9
|
[
"Apache-2.0"
] | 1
|
2019-04-02T14:44:46.000Z
|
2019-04-02T14:44:46.000Z
|
src/main/__init__.py
|
zrev2220/open-contest
|
5dbb383a19b8ff4dfe5bdcf18379cb8aa13b47b9
|
[
"Apache-2.0"
] | 19
|
2019-04-02T16:52:43.000Z
|
2019-04-11T21:12:25.000Z
|
src/main/__init__.py
|
zrev2220/open-contest
|
5dbb383a19b8ff4dfe5bdcf18379cb8aa13b47b9
|
[
"Apache-2.0"
] | 3
|
2019-03-29T18:09:23.000Z
|
2019-03-29T18:09:42.000Z
|
from .util import *
from .web import *
from .setup import *
| 15
| 20
| 0.7
| 9
| 60
| 4.666667
| 0.555556
| 0.47619
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.2
| 60
| 3
| 21
| 20
| 0.875
| 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
|
89cab447521d80678027e80bc45c6e1f5f1dc455
| 14,107
|
py
|
Python
|
src/queryStrategy.py
|
davidtw999/BEMPS
|
446fe813e1534352a564ae8e3e45712e04904b36
|
[
"MIT"
] | 2
|
2022-02-08T23:29:30.000Z
|
2022-03-11T04:40:46.000Z
|
src/queryStrategy.py
|
davidtw999/BEMPS
|
446fe813e1534352a564ae8e3e45712e04904b36
|
[
"MIT"
] | null | null | null |
src/queryStrategy.py
|
davidtw999/BEMPS
|
446fe813e1534352a564ae8e3e45712e04904b36
|
[
"MIT"
] | null | null | null |
import random
from sklearn.manifold import TSNE
import numpy as np
from scipy.spatial.distance import cdist
import torch
from sklearn.cluster import KMeans
from torch.nn.functional import normalize
## Random generator for X prime
def random_generator_for_x_prime(x_dim, size):
sample_indices = random.sample(range(0, x_dim), round(x_dim * size))
return sorted(sample_indices)
## CoreLog
def bemps_corelog(probs_B_K_C, X):
## Pr(y|theta,x)
pr_YThetaX_X_E_Y = probs_B_K_C
pr_ThetaL = 1 / pr_YThetaX_X_E_Y.shape[1]
## Generate random number of x'
xp_indices = random_generator_for_x_prime(pr_YThetaX_X_E_Y.shape[0], X)
pr_YhThetaXp_Xp_E_Yh = pr_YThetaX_X_E_Y[xp_indices, :, :]
## Transpose dimension of Pr(y|theta,x), and calculate pr(theta|L,(x,y))
pr_YThetaX_X_E_Y = pr_ThetaL * pr_YThetaX_X_E_Y
pr_YThetaX_X_Y_E = torch.transpose(pr_YThetaX_X_E_Y, 1, 2) ## transpose by dimension E and Y
sum_pr_YThetaX_X_Y_1 = torch.sum(pr_YThetaX_X_Y_E, dim=-1).unsqueeze(dim=-1)
pr_ThetaLXY_X_Y_E = pr_YThetaX_X_Y_E / sum_pr_YThetaX_X_Y_1
## Calculate pr(y_hat)
pr_ThetaLXY_X_1_Y_E = pr_ThetaLXY_X_Y_E.unsqueeze(dim=1)
pr_Yhat_X_Xp_Y_Yh = torch.matmul(pr_ThetaLXY_X_1_Y_E, pr_YhThetaXp_Xp_E_Yh)
## Calculate core MSE by using unsqueeze into same dimension for pr(y_hat) and pr(y_hat|theta,x)
pr_YhThetaXp_1_1_Xp_E_Yh = pr_YhThetaXp_Xp_E_Yh.unsqueeze(dim = 0).unsqueeze(dim = 0)
pr_YhThetaXp_X_Y_Xp_E_Yh = pr_YhThetaXp_1_1_Xp_E_Yh.repeat(pr_Yhat_X_Xp_Y_Yh.shape[0], pr_Yhat_X_Xp_Y_Yh.shape[2], 1, 1, 1)
pr_Yhat_1_X_Xp_Y_Yh = pr_Yhat_X_Xp_Y_Yh.unsqueeze(dim = 0)
pr_Yhat_E_X_Xp_Y_Yh = pr_Yhat_1_X_Xp_Y_Yh.repeat(pr_YhThetaXp_Xp_E_Yh.shape[1],1,1,1,1)
pr_Yhat_X_Y_Xp_E_Yh = pr_Yhat_E_X_Xp_Y_Yh.transpose(0,3).transpose(0,1)
core_mse = torch.mul(pr_YhThetaXp_X_Y_Xp_E_Yh, torch.div(pr_YhThetaXp_X_Y_Xp_E_Yh, pr_Yhat_X_Y_Xp_E_Yh))
core_mse_X_Y = torch.sum(torch.sum(core_mse.sum(dim=-1), dim=-1),dim=-1)
## Calculate RR
pr_YLX_X_Y = torch.sum(pr_YThetaX_X_Y_E, dim=-1)
rr = torch.sum(torch.mul(pr_YLX_X_Y, core_mse_X_Y), dim=-1) / pr_YhThetaXp_Xp_E_Yh.shape[0]
return rr
## CoreMSE
def bemps_coremse(probs_B_K_C, X):
## Pr(y|theta,x)
pr_YThetaX_X_E_Y = probs_B_K_C
pr_ThetaL = 1 / pr_YThetaX_X_E_Y.shape[1]
## Generate random number of x'
xp_indices = random_generator_for_x_prime(pr_YThetaX_X_E_Y.shape[0], X)
pr_YhThetaXp_Xp_E_Yh = pr_YThetaX_X_E_Y[xp_indices, :, :]
## Transpose dimension of Pr(y|theta,x), and calculate pr(theta|L,(x,y))
pr_YThetaX_X_E_Y = pr_ThetaL * pr_YThetaX_X_E_Y
pr_YThetaX_X_Y_E = torch.transpose(pr_YThetaX_X_E_Y, 1, 2) ## transpose by dimension E and Y
sum_pr_YThetaX_X_Y_1 = torch.sum(pr_YThetaX_X_Y_E, dim=-1).unsqueeze(dim=-1)
pr_ThetaLXY_X_Y_E = pr_YThetaX_X_Y_E / sum_pr_YThetaX_X_Y_1
## Calculate pr(y_hat)
pr_ThetaLXY_X_1_Y_E = pr_ThetaLXY_X_Y_E.unsqueeze(dim=1)
pr_Yhat_X_Xp_Y_Yh = torch.matmul(pr_ThetaLXY_X_1_Y_E, pr_YhThetaXp_Xp_E_Yh)
## Calculate core MSE by using unsqueeze into same dimension for pr(y_hat) and pr(y_hat|theta,x)
pr_YhThetaXp_1_1_Xp_E_Yh = pr_YhThetaXp_Xp_E_Yh.unsqueeze(dim = 0).unsqueeze(dim = 0)
pr_YhThetaXp_X_Y_Xp_E_Yh = pr_YhThetaXp_1_1_Xp_E_Yh.repeat(pr_Yhat_X_Xp_Y_Yh.shape[0], pr_Yhat_X_Xp_Y_Yh.shape[2], 1, 1, 1)
pr_Yhat_1_X_Xp_Y_Yh = pr_Yhat_X_Xp_Y_Yh.unsqueeze(dim = 0)
pr_Yhat_E_X_Xp_Y_Yh = pr_Yhat_1_X_Xp_Y_Yh.repeat(pr_YhThetaXp_Xp_E_Yh.shape[1],1,1,1,1)
pr_Yhat_X_Y_Xp_E_Yh = pr_Yhat_E_X_Xp_Y_Yh.transpose(0,3).transpose(0,1)
core_mse = (pr_YhThetaXp_X_Y_Xp_E_Yh - pr_Yhat_X_Y_Xp_E_Yh).pow(2)
core_mse_X_Y = torch.sum(torch.sum(core_mse.sum(dim=-1), dim=-1),dim=-1)
## Calculate RR
pr_YLX_X_Y = torch.sum(pr_YThetaX_X_Y_E, dim=-1)
rr = torch.sum(torch.mul(pr_YLX_X_Y, core_mse_X_Y), dim=-1)/pr_YhThetaXp_Xp_E_Yh.shape[0]
return rr
## CoreMSE batch mode
def bemps_coremse_batch(probs_B_K_C, batch_size, X, T):
## Pr(y|theta,x)
pr_YThetaX_X_E_Y = probs_B_K_C
pr_ThetaL = 1 / pr_YThetaX_X_E_Y.shape[1]
## Generate random number of x'
xp_indices = random_generator_for_x_prime(pr_YThetaX_X_E_Y.shape[0], X)
pr_YhThetaXp_Xp_E_Yh = pr_YThetaX_X_E_Y[xp_indices, :, :]
## Transpose dimension of Pr(y|theta,x), and calculate pr(theta|L,(x,y))
pr_YThetaX_X_E_Y = pr_ThetaL * pr_YThetaX_X_E_Y
pr_YThetaX_X_Y_E = torch.transpose(pr_YThetaX_X_E_Y, 1, 2) ## transpose by dimension E and Y
sum_pr_YThetaX_X_Y_1 = torch.sum(pr_YThetaX_X_Y_E, dim=-1).unsqueeze(dim=-1)
pr_ThetaLXY_X_Y_E = pr_YThetaX_X_Y_E / sum_pr_YThetaX_X_Y_1
## Calculate pr(y_hat)
pr_ThetaLXY_X_1_Y_E = pr_ThetaLXY_X_Y_E.unsqueeze(dim=1)
pr_Yhat_X_Xp_Y_Yh = torch.matmul(pr_ThetaLXY_X_1_Y_E, pr_YhThetaXp_Xp_E_Yh)
## Calculate core MSE by using unsqueeze into same dimension for pr(y_hat) and pr(y_hat|theta,x)
pr_YhThetaXp_1_1_Xp_E_Yh = pr_YhThetaXp_Xp_E_Yh.unsqueeze(dim = 0).unsqueeze(dim = 0)
pr_YhThetaXp_X_Y_Xp_E_Yh = pr_YhThetaXp_1_1_Xp_E_Yh.repeat(pr_Yhat_X_Xp_Y_Yh.shape[0], pr_Yhat_X_Xp_Y_Yh.shape[2], 1, 1, 1)
pr_Yhat_1_X_Xp_Y_Yh = pr_Yhat_X_Xp_Y_Yh.unsqueeze(dim = 0)
pr_Yhat_E_X_Xp_Y_Yh = pr_Yhat_1_X_Xp_Y_Yh.repeat(pr_YhThetaXp_Xp_E_Yh.shape[1],1,1,1,1)
pr_Yhat_X_Y_Xp_E_Yh = pr_Yhat_E_X_Xp_Y_Yh.transpose(0,3).transpose(0,1)
core_mse = (pr_YhThetaXp_X_Y_Xp_E_Yh - pr_Yhat_X_Y_Xp_E_Yh).pow(2)
core_mse_X_Y_Xp = torch.sum(core_mse.sum(dim=-1), dim=-1)
core_mse_X_Xp_Y = torch.transpose(core_mse_X_Y_Xp, 1, 2)
core_mse_Xp_X_Y = torch.transpose(core_mse_X_Xp_Y, 0, 1)
## Calculate RR
pr_YLX_X_Y = torch.sum(pr_YThetaX_X_Y_E, dim=-1)
rr_Xp_X_Y = pr_YLX_X_Y.unsqueeze(0) * core_mse_Xp_X_Y
rr_Xp_X = torch.sum(rr_Xp_X_Y, dim=-1)
rr_X_Xp = torch.transpose(rr_Xp_X, 0, 1)
rr = clustering(rr_X_Xp, probs_B_K_C, T, batch_size)
return rr
## CoreMSE top rank mode
def bemps_coremse_batch_topk(probs_B_K_C, batch_size, X):
## Pr(y|theta,x)
pr_YThetaX_X_E_Y = probs_B_K_C
pr_ThetaL = 1 / pr_YThetaX_X_E_Y.shape[1]
## Generate random number of x'
xp_indices = random_generator_for_x_prime(pr_YThetaX_X_E_Y.shape[0], X)
pr_YhThetaXp_Xp_E_Yh = pr_YThetaX_X_E_Y[xp_indices, :, :]
## Transpose dimension of Pr(y|theta,x), and calculate pr(theta|L,(x,y))
pr_YThetaX_X_E_Y = pr_ThetaL * pr_YThetaX_X_E_Y
pr_YThetaX_X_Y_E = torch.transpose(pr_YThetaX_X_E_Y, 1, 2) ## transpose by dimension E and Y
sum_pr_YThetaX_X_Y_1 = torch.sum(pr_YThetaX_X_Y_E, dim=-1).unsqueeze(dim=-1)
pr_ThetaLXY_X_Y_E = pr_YThetaX_X_Y_E / sum_pr_YThetaX_X_Y_1
## Calculate pr(y_hat)
pr_ThetaLXY_X_1_Y_E = pr_ThetaLXY_X_Y_E.unsqueeze(dim=1)
pr_Yhat_X_Xp_Y_Yh = torch.matmul(pr_ThetaLXY_X_1_Y_E, pr_YhThetaXp_Xp_E_Yh)
## Calculate core MSE by using unsqueeze into same dimension for pr(y_hat) and pr(y_hat|theta,x)
pr_YhThetaXp_1_1_Xp_E_Yh = pr_YhThetaXp_Xp_E_Yh.unsqueeze(dim=0).unsqueeze(dim=0)
pr_YhThetaXp_X_Y_Xp_E_Yh = pr_YhThetaXp_1_1_Xp_E_Yh.repeat(pr_Yhat_X_Xp_Y_Yh.shape[0], pr_Yhat_X_Xp_Y_Yh.shape[2],
1, 1, 1)
pr_Yhat_1_X_Xp_Y_Yh = pr_Yhat_X_Xp_Y_Yh.unsqueeze(dim=0)
pr_Yhat_E_X_Xp_Y_Yh = pr_Yhat_1_X_Xp_Y_Yh.repeat(pr_YhThetaXp_Xp_E_Yh.shape[1], 1, 1, 1, 1)
pr_Yhat_X_Y_Xp_E_Yh = pr_Yhat_E_X_Xp_Y_Yh.transpose(0, 3).transpose(0, 1)
core_mse = (pr_YhThetaXp_X_Y_Xp_E_Yh - pr_Yhat_X_Y_Xp_E_Yh).pow(2)
core_mse_X_Y = torch.sum(torch.sum(core_mse.sum(dim=-1), dim=-1), dim=-1)
## Calculate RR
pr_YLX_X_Y = torch.sum(pr_YThetaX_X_Y_E, dim=-1)
rr = torch.sum(torch.mul(pr_YLX_X_Y, core_mse_X_Y), dim=-1) / pr_YhThetaXp_Xp_E_Yh.shape[0]
return rr.topk(batch_size).indices.numpy()
## CoreLog top rank mode
def bemps_corelog_batch_topk(probs_B_K_C, batch_size, X):
## Pr(y|theta,x)
pr_YThetaX_X_E_Y = probs_B_K_C
pr_ThetaL = 1 / pr_YThetaX_X_E_Y.shape[1]
## Generate random number of x'
xp_indices = random_generator_for_x_prime(pr_YThetaX_X_E_Y.shape[0], X)
pr_YhThetaXp_Xp_E_Yh = pr_YThetaX_X_E_Y[xp_indices, :, :]
## Transpose dimension of Pr(y|theta,x), and calculate pr(theta|L,(x,y))
pr_YThetaX_X_E_Y = pr_ThetaL * pr_YThetaX_X_E_Y
pr_YThetaX_X_Y_E = torch.transpose(pr_YThetaX_X_E_Y, 1, 2) ## transpose by dimension E and Y
sum_pr_YThetaX_X_Y_1 = torch.sum(pr_YThetaX_X_Y_E, dim=-1).unsqueeze(dim=-1)
pr_ThetaLXY_X_Y_E = pr_YThetaX_X_Y_E / sum_pr_YThetaX_X_Y_1
## Calculate pr(y_hat)
pr_ThetaLXY_X_1_Y_E = pr_ThetaLXY_X_Y_E.unsqueeze(dim=1)
pr_Yhat_X_Xp_Y_Yh = torch.matmul(pr_ThetaLXY_X_1_Y_E, pr_YhThetaXp_Xp_E_Yh)
## Calculate core MSE by using unsqueeze into same dimension for pr(y_hat) and pr(y_hat|theta,x)
pr_YhThetaXp_1_1_Xp_E_Yh = pr_YhThetaXp_Xp_E_Yh.unsqueeze(dim = 0).unsqueeze(dim = 0)
pr_YhThetaXp_X_Y_Xp_E_Yh = pr_YhThetaXp_1_1_Xp_E_Yh.repeat(pr_Yhat_X_Xp_Y_Yh.shape[0], pr_Yhat_X_Xp_Y_Yh.shape[2], 1, 1, 1)
pr_Yhat_1_X_Xp_Y_Yh = pr_Yhat_X_Xp_Y_Yh.unsqueeze(dim = 0)
pr_Yhat_E_X_Xp_Y_Yh = pr_Yhat_1_X_Xp_Y_Yh.repeat(pr_YhThetaXp_Xp_E_Yh.shape[1],1,1,1,1)
pr_Yhat_X_Y_Xp_E_Yh = pr_Yhat_E_X_Xp_Y_Yh.transpose(0,3).transpose(0,1)
core_mse = torch.mul(pr_YhThetaXp_X_Y_Xp_E_Yh, torch.div(pr_YhThetaXp_X_Y_Xp_E_Yh, pr_Yhat_X_Y_Xp_E_Yh))
core_mse_X_Y = torch.sum(torch.sum(core_mse.sum(dim=-1), dim=-1),dim=-1)
## Calculate RR
pr_YLX_X_Y = torch.sum(pr_YThetaX_X_Y_E, dim=-1)
rr = torch.sum(torch.mul(pr_YLX_X_Y, core_mse_X_Y), dim=-1) / pr_YhThetaXp_Xp_E_Yh.shape[0]
return rr.topk(batch_size).indices.numpy()
## CoreLog batch mode
def bemps_corelog_batch(probs_B_K_C, batch_size, X, T):
## Pr(y|theta,x)
pr_YThetaX_X_E_Y = probs_B_K_C
pr_ThetaL = 1 / pr_YThetaX_X_E_Y.shape[1]
## Generate random number of x'
xp_indices = random_generator_for_x_prime(pr_YThetaX_X_E_Y.shape[0], X)
pr_YhThetaXp_Xp_E_Yh = pr_YThetaX_X_E_Y[xp_indices, :, :]
## Transpose dimension of Pr(y|theta,x), and calculate pr(theta|L,(x,y))
pr_YThetaX_X_E_Y = pr_ThetaL * pr_YThetaX_X_E_Y
pr_YThetaX_X_Y_E = torch.transpose(pr_YThetaX_X_E_Y, 1, 2) ## transpose by dimension E and Y
sum_pr_YThetaX_X_Y_1 = torch.sum(pr_YThetaX_X_Y_E, dim=-1).unsqueeze(dim=-1)
pr_ThetaLXY_X_Y_E = pr_YThetaX_X_Y_E / sum_pr_YThetaX_X_Y_1
## Calculate pr(y_hat)
pr_ThetaLXY_X_1_Y_E = pr_ThetaLXY_X_Y_E.unsqueeze(dim=1)
pr_Yhat_X_Xp_Y_Yh = torch.matmul(pr_ThetaLXY_X_1_Y_E, pr_YhThetaXp_Xp_E_Yh)
## Calculate core MSE by using unsqueeze into same dimension for pr(y_hat) and pr(y_hat|theta,x)
pr_YhThetaXp_1_1_Xp_E_Yh = pr_YhThetaXp_Xp_E_Yh.unsqueeze(dim = 0).unsqueeze(dim = 0)
pr_YhThetaXp_X_Y_Xp_E_Yh = pr_YhThetaXp_1_1_Xp_E_Yh.repeat(pr_Yhat_X_Xp_Y_Yh.shape[0], pr_Yhat_X_Xp_Y_Yh.shape[2], 1, 1, 1)
pr_Yhat_1_X_Xp_Y_Yh = pr_Yhat_X_Xp_Y_Yh.unsqueeze(dim = 0)
pr_Yhat_E_X_Xp_Y_Yh = pr_Yhat_1_X_Xp_Y_Yh.repeat(pr_YhThetaXp_Xp_E_Yh.shape[1],1,1,1,1)
pr_Yhat_X_Y_Xp_E_Yh = pr_Yhat_E_X_Xp_Y_Yh.transpose(0,3).transpose(0,1)
core_mse = torch.mul(pr_YhThetaXp_X_Y_Xp_E_Yh, torch.div(pr_YhThetaXp_X_Y_Xp_E_Yh, pr_Yhat_X_Y_Xp_E_Yh))
core_mse_X_Y_Xp = torch.sum(core_mse.sum(dim=-1), dim=-1)
core_mse_X_Xp_Y = torch.transpose(core_mse_X_Y_Xp, 1, 2)
core_mse_Xp_X_Y = torch.transpose(core_mse_X_Xp_Y, 0, 1)
## Calculate RR
pr_YLX_X_Y = torch.sum(pr_YThetaX_X_Y_E, dim=-1)
rr_Xp_X_Y = pr_YLX_X_Y.unsqueeze(0) * core_mse_Xp_X_Y
rr_Xp_X = torch.sum(rr_Xp_X_Y, dim=-1)
rr_X_Xp = torch.transpose(rr_Xp_X, 0, 1)
rr = clustering(rr_X_Xp, probs_B_K_C, T, batch_size)
return rr
## cluster methods
def clustering(rr_X_Xp, probs_B_K_C, T, batch_size):
rr_X = torch.sum(rr_X_Xp, dim=-1)
rr_topk_X = torch.topk(rr_X, round(probs_B_K_C.shape[0] * T))
rr_topk_X_indices = rr_topk_X.indices.cpu().detach().numpy()
rr_X_Xp = rr_X_Xp[rr_topk_X_indices]
rr_X_Xp = normalize(rr_X_Xp)
# rr_X_Xp = convert_embedding_by_tsne(rr_X_Xp)
rr = kmeans(rr_X_Xp, batch_size)
rr = [rr_topk_X_indices[x] for x in rr]
return rr
## sub fuction for kmeans ++
def closest_center_dist(rr, centers):
dist = torch.cdist(rr, rr[centers])
cd = dist.min(axis=1).values
return cd
## kmeans
def kmeans(rr, k):
kmeans = KMeans(n_clusters=k, n_jobs=-1).fit(rr)
centers = kmeans.cluster_centers_
# find the nearest point to centers
centroids = cdist(centers, rr).argmin(axis=1)
centroids_set = np.unique(centroids)
m = k - len(centroids_set)
if m > 0:
pool = np.delete(np.arange(len(rr)), centroids_set)
p = np.random.choice(len(pool), m)
centroids = np.concatenate((centroids_set, pool[p]), axis = None)
return centroids
## create tsne feature space
def convert_embedding_by_tsne(X):
tsne = TSNE(n_components=3, random_state=100)
X = tsne.fit_transform(X)
return X
## random a single index
def random_queries(len_samples):
rand_index = random.sample(range(len_samples), 1)
return rand_index[0]
## random a set of indices
def random_queries_batch(len_samples, batch_size):
rand_index = random.sample(range(len_samples), batch_size)
return rand_index
## mean of the probability
def prob_mean(probs_B_K_C, dim: int, keepdim: bool = False):
return torch.mean(probs_B_K_C, dim=dim, keepdim=keepdim)
## entropy
def entropy(probs_B_K_C, dim: int, keepdim: bool = False):
return -torch.sum((torch.log(probs_B_K_C) * probs_B_K_C).double(), dim=dim, keepdim=keepdim)
## max entropy
def max_entropy_acquisition_function(probs_B_K_C):
return entropy(prob_mean(probs_B_K_C, dim=1, keepdim=False), dim=-1)
## test function
def test_function():
## generate data model classes
torch.manual_seed(1)
probs_matrix = torch.rand((100, 5, 2))
probs_matrix = torch.softmax(probs_matrix, dim=2)
probs_matrix = torch.FloatTensor(probs_matrix)
def main():
test_function()
if __name__ == "__main__":
main()
| 37.922043
| 127
| 0.736656
| 2,939
| 14,107
| 3.045253
| 0.055461
| 0.025251
| 0.087151
| 0.032179
| 0.826034
| 0.807039
| 0.803128
| 0.792067
| 0.792067
| 0.792067
| 0
| 0.023594
| 0.155738
| 14,107
| 372
| 128
| 37.922043
| 0.727876
| 0.144467
| 0
| 0.663265
| 0
| 0
| 0.00067
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.091837
| false
| 0
| 0.035714
| 0.015306
| 0.209184
| 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
|
d6047e863cea06769d5681ac0b2ac8c4c92f6227
| 69
|
py
|
Python
|
mindhome_alpha/erpnext/regional/germany/setup.py
|
Mindhome/field_service
|
3aea428815147903eb9af1d0c1b4b9fc7faed057
|
[
"MIT"
] | 1
|
2021-04-29T14:55:29.000Z
|
2021-04-29T14:55:29.000Z
|
mindhome_alpha/erpnext/regional/germany/setup.py
|
Mindhome/field_service
|
3aea428815147903eb9af1d0c1b4b9fc7faed057
|
[
"MIT"
] | null | null | null |
mindhome_alpha/erpnext/regional/germany/setup.py
|
Mindhome/field_service
|
3aea428815147903eb9af1d0c1b4b9fc7faed057
|
[
"MIT"
] | 1
|
2021-04-29T14:39:01.000Z
|
2021-04-29T14:39:01.000Z
|
import os
import frappe
def setup(company=None, patch=True):
pass
| 9.857143
| 36
| 0.753623
| 11
| 69
| 4.727273
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.15942
| 69
| 6
| 37
| 11.5
| 0.896552
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0.25
| 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
| 0
| 1
| 1
| 0
| 1
| 0
|
0
| 6
|
d64314046e4362ece51dddc0d86c474119ab81dc
| 31
|
py
|
Python
|
Slasher/__init__.py
|
tagptroll1/Slasher
|
88a40d5e21746cb0a97a5b3dd1885a54be5b76cf
|
[
"MIT"
] | null | null | null |
Slasher/__init__.py
|
tagptroll1/Slasher
|
88a40d5e21746cb0a97a5b3dd1885a54be5b76cf
|
[
"MIT"
] | null | null | null |
Slasher/__init__.py
|
tagptroll1/Slasher
|
88a40d5e21746cb0a97a5b3dd1885a54be5b76cf
|
[
"MIT"
] | null | null | null |
print("This does nothing atm.")
| 31
| 31
| 0.741935
| 5
| 31
| 4.6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.096774
| 31
| 1
| 31
| 31
| 0.821429
| 0
| 0
| 0
| 0
| 0
| 0.6875
| 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
|
c38b86cb97281597610aeeee867f50e912d5350e
| 169
|
py
|
Python
|
chunky/logger.py
|
ymkjp/chunky
|
9bd83f26a9cbc05cbd5225931a75e83c6ac3e7fb
|
[
"MIT"
] | null | null | null |
chunky/logger.py
|
ymkjp/chunky
|
9bd83f26a9cbc05cbd5225931a75e83c6ac3e7fb
|
[
"MIT"
] | null | null | null |
chunky/logger.py
|
ymkjp/chunky
|
9bd83f26a9cbc05cbd5225931a75e83c6ac3e7fb
|
[
"MIT"
] | null | null | null |
import logging
import logging.config
class Logger:
def __init__(self):
pass
def setup(self):
return logging.config.fileConfig('logging.conf')
| 15.363636
| 56
| 0.674556
| 20
| 169
| 5.5
| 0.65
| 0.236364
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.236686
| 169
| 10
| 57
| 16.9
| 0.852713
| 0
| 0
| 0
| 0
| 0
| 0.071006
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0.142857
| 0.285714
| 0.142857
| 0.857143
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
|
0
| 6
|
c3d415ea3ff93a28de8969170e7b072060647855
| 3,658
|
py
|
Python
|
checkarg/text.py
|
felipebrumpereira/checkarg
|
1dad052af183def92a7213add68dc91fe7f4462c
|
[
"MIT"
] | null | null | null |
checkarg/text.py
|
felipebrumpereira/checkarg
|
1dad052af183def92a7213add68dc91fe7f4462c
|
[
"MIT"
] | null | null | null |
checkarg/text.py
|
felipebrumpereira/checkarg
|
1dad052af183def92a7213add68dc91fe7f4462c
|
[
"MIT"
] | null | null | null |
from typing import List, Union
import checkarg.none_type as NoneType
from checkarg.exceptions import ArgumentException
def is_not_whitespace(
value: str, argument_name: str = None, exception: Exception = None
) -> None:
NoneType.is_not_none(value, argument_name, exception)
if len(value.strip()) <= 0:
raise ArgumentException(argument_name) if exception is None else exception
def is_not_empty(
value: Union[str, List], argument_name: str = None, exception: Exception = None
) -> None:
NoneType.is_not_none(value, argument_name, exception)
if isinstance(value, str):
value = value.strip()
if len(value) <= 0:
raise ArgumentException(argument_name) if exception is None else exception
def is_alphanumeric(
value: str, argument_name: str = None, exception: Exception = None
) -> None:
NoneType.is_not_none(value, argument_name, exception)
if not value.isalnum():
raise ArgumentException(argument_name) if exception is None else exception
def is_alphabetic(
value: str, argument_name: str = None, exception: Exception = None
) -> None:
NoneType.is_not_none(value, argument_name, exception)
if not value.isalpha():
raise ArgumentException(argument_name) if exception is None else exception
def is_number(
value: str, argument_name: str = None, exception: Exception = None
) -> None:
NoneType.is_not_none(value, argument_name, exception)
try:
float(value)
except Exception:
raise ArgumentException(argument_name) if exception is None else exception
def is_integer(
value: str, argument_name: str = None, exception: Exception = None
) -> None:
NoneType.is_not_none(value, argument_name, exception)
try:
int(value)
except Exception:
raise ArgumentException(argument_name) if exception is None else exception
def is_lowercase(
value: str, argument_name: str = None, exception: Exception = None
) -> None:
NoneType.is_not_none(value, argument_name, exception)
if not value.islower():
raise ArgumentException(argument_name) if exception is None else exception
def is_uppercase(
value: str, argument_name: str = None, exception: Exception = None
) -> None:
NoneType.is_not_none(value, argument_name, exception)
if not value.isupper():
raise ArgumentException(argument_name) if exception is None else exception
def has_length(
value: str, length: int, argument_name: str = None, exception: Exception = None
) -> None:
NoneType.is_not_none(value, argument_name, exception)
if len(value) != length:
raise ArgumentException(argument_name) if exception is None else exception
def has_length_between(
value: str,
min_lenght: int,
max_lenght: int,
argument_name: str = None,
exception: Exception = None,
) -> None:
NoneType.is_not_none(value, argument_name, exception)
value_length = len(value)
if value_length < min_lenght or value_length > max_lenght:
raise ArgumentException(argument_name) if exception is None else exception
def is_equal_to(
value: str, expected: str, argument_name: str = None, exception: Exception = None
) -> None:
NoneType.is_not_none(value, argument_name, exception)
if value != expected:
raise ArgumentException(argument_name) if exception is None else exception
def is_not_equal_to(
value: str, expected: str, argument_name: str = None, exception: Exception = None
) -> None:
NoneType.is_not_none(value, argument_name, exception)
if value == expected:
raise ArgumentException(argument_name) if exception is None else exception
| 32.660714
| 85
| 0.720886
| 474
| 3,658
| 5.381857
| 0.111814
| 0.169345
| 0.070561
| 0.089377
| 0.843983
| 0.843983
| 0.843983
| 0.843983
| 0.843983
| 0.843983
| 0
| 0.000679
| 0.195189
| 3,658
| 111
| 86
| 32.954955
| 0.865829
| 0
| 0
| 0.569767
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.139535
| false
| 0
| 0.034884
| 0
| 0.174419
| 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
|
c3d4ad7df87df2a71a1b0c71824d47846650c6aa
| 77
|
py
|
Python
|
pythonrails_templates/tags/tag_body.py
|
PythonRails/Templates
|
39871d33a613b33de8f7c90073acd0b9590c4084
|
[
"MIT"
] | null | null | null |
pythonrails_templates/tags/tag_body.py
|
PythonRails/Templates
|
39871d33a613b33de8f7c90073acd0b9590c4084
|
[
"MIT"
] | null | null | null |
pythonrails_templates/tags/tag_body.py
|
PythonRails/Templates
|
39871d33a613b33de8f7c90073acd0b9590c4084
|
[
"MIT"
] | null | null | null |
from pythonrails_templates import BaseTag
class TagBody(BaseTag):
pass
| 12.833333
| 41
| 0.792208
| 9
| 77
| 6.666667
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.168831
| 77
| 5
| 42
| 15.4
| 0.9375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.333333
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
|
0
| 6
|
c3eb765fc7b88c7d4f6f921d31d8cb9962525e09
| 65
|
py
|
Python
|
eod/plugins/yolox/utils/__init__.py
|
Helicopt/EOD
|
b5db36f4ce267bf64d093b8174bde2c4097b4718
|
[
"Apache-2.0"
] | 1
|
2022-01-12T01:51:39.000Z
|
2022-01-12T01:51:39.000Z
|
eod/tasks/det/plugins/yolox/utils/__init__.py
|
YZW-explorer/EOD
|
f10e64de86c0f356ebf5c7e923f4042eec4207b1
|
[
"Apache-2.0"
] | null | null | null |
eod/tasks/det/plugins/yolox/utils/__init__.py
|
YZW-explorer/EOD
|
f10e64de86c0f356ebf5c7e923f4042eec4207b1
|
[
"Apache-2.0"
] | null | null | null |
from .hook_helper import * # noqa
from .lr_helper import * # noqa
| 32.5
| 33
| 0.738462
| 10
| 65
| 4.6
| 0.6
| 0.521739
| 0.695652
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.169231
| 65
| 2
| 34
| 32.5
| 0.851852
| 0.138462
| 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
|
c3f10d62324b7dc35de1e7672b5965c1bd0ba2c6
| 139
|
py
|
Python
|
src/tsgettoolbox/ulmo/cdec/historical/__init__.py
|
timcera/tsgettoolbox
|
828306aefaa097a74abd8e71605bd19eeda29058
|
[
"BSD-3-Clause"
] | 4
|
2017-11-21T20:22:47.000Z
|
2021-09-27T13:27:05.000Z
|
src/tsgettoolbox/ulmo/cdec/historical/__init__.py
|
timcera/tsgettoolbox
|
828306aefaa097a74abd8e71605bd19eeda29058
|
[
"BSD-3-Clause"
] | 21
|
2016-04-28T16:52:18.000Z
|
2021-12-16T17:00:27.000Z
|
src/tsgettoolbox/ulmo/cdec/historical/__init__.py
|
timcera/tsgettoolbox
|
828306aefaa097a74abd8e71605bd19eeda29058
|
[
"BSD-3-Clause"
] | null | null | null |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from .core import get_data, get_sensors, get_station_sensors, get_stations
| 27.8
| 74
| 0.784173
| 20
| 139
| 4.95
| 0.65
| 0.20202
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.008197
| 0.122302
| 139
| 4
| 75
| 34.75
| 0.803279
| 0.151079
| 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
|
61816c150d0a4f5571f8ba24be390c3324c88890
| 12,065
|
py
|
Python
|
gehm/utils/np_distances.py
|
IngoMarquart/gehm
|
389f3cd786c8899e453584de204cac0719c37400
|
[
"MIT"
] | null | null | null |
gehm/utils/np_distances.py
|
IngoMarquart/gehm
|
389f3cd786c8899e453584de204cac0719c37400
|
[
"MIT"
] | null | null | null |
gehm/utils/np_distances.py
|
IngoMarquart/gehm
|
389f3cd786c8899e453584de204cac0719c37400
|
[
"MIT"
] | null | null | null |
""" Distances that make use of numpy algorithms and should be used outside of the PyTorch model"""
import networkx as nx
from typing import Union
from torch import Tensor
from numpy import ndarray
import numpy as np
import networkx as nx
from scipy.spatial.distance import pdist, squareform
import torch
from torch.nn.functional import cosine_similarity
from torch import cdist
from gehm.utils.funcs import row_norm
def second_order_proximity(
adjacency_matrix: Union[Tensor, ndarray],
indecies: Union[Tensor, ndarray, list] = None,
whole_graph_proximity: bool = True,
to_batch: bool = False,
distance_metric: str = "cosine",
norm_rows_in_sample: bool = False,
norm_rows: bool = True,
) -> Tensor:
"""
Takes an adjacency matrix and generates second-order node proximities, also known
as structural equivalence relations.
Nodes are similar, if they share similar ties to alters.
Diagonal elements are set to zero.
Note that this includes non-PyTorch operations!
Parameters
----------
adjacency_matrix: Union[Tensor, ndarray]
Input adjacency_matrix
indecies : Union[Tensor,ndarray,list]
List of node indecies to consider in the matrix
whole_graph_proximity : bool, optional
If True, similarities between nodes in indecies is computed based
on all alters in the matrix (including those not in indecies)
If False, similarities are only calculated based on nodes contained in
indecies.
to_batch : bool, optional
If true, will remove the row entries of nodes not in indecies
If norm_rows is True, will also re-norm the rows, by default True
distance_metric : str, optional
Any distance metric from scipy.spatial.distance that works
without parameter, by default 'cosine'
norm_rows_in_sample : bool, optional
If True, distances are scaled such that the highest distance is 1.
This implies that distances depend on the sample provided, by default False
norm_rows: bool, optional
If True, distances are scaled for each node, such that sum(a_ij)=1
This does not take into account the similarity to itself, a_ii, which is always 0.
Returns
-------
ndarray
Similarity matrix of dimension len(node_ids)^2
"""
if indecies is None:
indecies = np.arange(0, adjacency_matrix.shape[0])
else:
if isinstance(indecies, list):
indecies = np.array(indecies)
if isinstance(indecies, Tensor):
indecies = indecies.numpy()
if isinstance(adjacency_matrix, Tensor):
adjacency_matrix = adjacency_matrix.numpy()
if not whole_graph_proximity:
adjacency_matrix = adjacency_matrix[indecies, :]
adjacency_matrix = adjacency_matrix[:, indecies]
similarity_matrix = pdist(adjacency_matrix, metric=distance_metric)
similarity_matrix = 1 - squareform(similarity_matrix)
similarity_matrix = similarity_matrix - np.eye(
similarity_matrix.shape[0], similarity_matrix.shape[1]
)
if norm_rows_in_sample:
similarity_matrix = similarity_matrix / np.max(
similarity_matrix
) # Norm max similarity within the sample to 1
if norm_rows and not to_batch:
similarity_matrix = row_norm(similarity_matrix)
similarity_matrix = np.nan_to_num(similarity_matrix, copy=False)
if whole_graph_proximity:
similarity_matrix = similarity_matrix[indecies, :]
if to_batch:
similarity_matrix = whole_graph_rows_to_batch(
similarity_matrix, indecies, norm_rows=norm_rows
)
return torch.as_tensor(similarity_matrix)
def nx_first_order_proximity(
G: Union[nx.Graph, nx.DiGraph],
node_ids: Union[Tensor, ndarray, list],
whole_graph_proximity: bool = True,
to_batch: bool = False,
norm_rows_in_sample: bool = False,
norm_rows: bool = True,
) -> Tensor:
"""
Takes a networkx graph G and generates first-order node proximities.
Diagonal elements are set to zero.
Note that this includes non-PyTorch operations!
Parameters
----------
G : Union[nx.Graph,nx.DiGraph]
Input graph
node_ids : Union[Tensor,ndarray,list]
List of nodes. Must exist in G.
whole_graph_proximity : bool, optional
If True, similarities between nodes in node_ids is computed based
on all alters in the graph (including those not in node_ids)
If False, similarities are only calculated based on nodes contained in
node_ids.
ATTN: Note that if True, ordering of rows reflects G.nodes
if False, ordering reflects node_ids supplied (subnetwork)
by default True
to_batch : bool, optional
If true, will remove the row entries of nodes not in node_list
If norm_rows is True, will also re-norm the rows, by default True
norm_rows_in_sample : bool, optional
If True, distances are scaled such that the highest distance is 1.
This implies that distances depend on the sample provided, by default False
norm_rows: bool, optional
If True, distances are scaled for each node, such that sum(a_ij)=1
This does not take into account the similarity to itself, a_ii, which is always 0.
Returns
-------
ndarray
Similarity matrix of dimension len(node_ids)^2
"""
if isinstance(node_ids, list):
node_ids = np.array(node_ids)
if isinstance(node_ids, Tensor):
node_ids = node_ids.numpy()
if whole_graph_proximity:
adjacency_matrix = np.zeros([len(G.nodes), len(G.nodes)])
else:
adjacency_matrix = np.zeros([len(node_ids), len(node_ids)])
if whole_graph_proximity:
adjacency_matrix = np.array(nx.adjacency_matrix(G, weight="weight").todense())
else:
G_sub = G.subgraph(node_ids)
for i, node in enumerate(node_ids):
for j, (alter, datadict) in enumerate(G_sub[node].items()):
if hasattr(datadict, "weight"):
weight = datadict["weight"]
else:
weight = 1
adjacency_matrix[i, j] = weight
if norm_rows_in_sample:
adjacency_matrix = adjacency_matrix / np.max(
adjacency_matrix
) # Norm max similarity within the sample to 1
if norm_rows and not to_batch:
adjacency_matrix = row_norm(adjacency_matrix)
adjacency_matrix = np.nan_to_num(adjacency_matrix, copy=False)
if whole_graph_proximity:
selection = np.searchsorted(np.array(G.nodes), node_ids)
assert (
np.array(G.nodes)[selection] == node_ids
).all(), "Internal error, subsetting nodes"
adjacency_matrix = adjacency_matrix[selection, :]
if to_batch:
adjacency_matrix = whole_graph_rows_to_batch(
adjacency_matrix, selection, norm_rows=norm_rows
)
return torch.as_tensor(adjacency_matrix)
def nx_second_order_proximity(
G: Union[nx.Graph, nx.DiGraph],
node_ids: Union[Tensor, ndarray, list],
whole_graph_proximity: bool = True,
to_batch: bool = False,
distance_metric: str = "cosine",
norm_rows_in_sample: bool = False,
norm_rows: bool = True,
) -> Tensor:
"""
Takes a networkx graph G and generates second-order node proximities, also known
as structural equivalence relations.
Nodes are similar, if they share similar ties to alters.
Diagonal elements are set to zero.
Note that this includes non-PyTorch operations!
Parameters
----------
G : Union[nx.Graph,nx.DiGraph]
Input graph
node_ids : Union[Tensor,ndarray,list]
List of nodes. Must exist in G.
whole_graph_proximity : bool, optional
If True, similarities between nodes in node_ids is computed based
on all alters in the graph (including those not in node_ids)
If False, similarities are only calculated based on nodes contained in
node_ids.
ATTN: Note that if True, ordering of rows reflects G.nodes
if False, ordering reflects node_ids supplied (subnetwork)
by default True
to_batch : bool, optional
If true, will remove the row entries of nodes not in node_list
If norm_rows is True, will also re-norm the rows, by default True
distance_metric : str, optional
Any distance metric from scipy.spatial.distance that works
without parameter, by default 'cosine'
norm_rows_in_sample : bool, optional
If True, distances are scaled such that the highest distance is 1.
This implies that distances depend on the sample provided, by default False
norm_rows: bool, optional
If True, distances are scaled for each node, such that sum(a_ij)=1
This does not take into account the similarity to itself, a_ii, which is always 0.
Returns
-------
ndarray
Similarity matrix of dimension len(node_ids)^2
"""
if isinstance(node_ids, list):
node_ids = np.array(node_ids)
if isinstance(node_ids, Tensor):
node_ids = node_ids.numpy()
if whole_graph_proximity:
adjacency_matrix = np.zeros([len(G.nodes), len(G.nodes)])
similarity_matrix = np.zeros([len(node_ids), len(G.nodes)])
else:
adjacency_matrix = np.zeros([len(node_ids), len(node_ids)])
similarity_matrix = np.zeros([len(node_ids), len(node_ids)])
if whole_graph_proximity:
adjacency_matrix = nx.adjacency_matrix(G, weight="weight").todense()
else:
G_sub = G.subgraph(node_ids)
for i, node in enumerate(node_ids):
for j, (alter, datadict) in enumerate(G_sub[node].items()):
if hasattr(datadict, "weight"):
weight = datadict["weight"]
else:
weight = 1
adjacency_matrix[i, j] = weight
similarity_matrix = pdist(adjacency_matrix, metric=distance_metric)
similarity_matrix = 1 - squareform(similarity_matrix)
similarity_matrix = similarity_matrix - np.eye(
similarity_matrix.shape[0], similarity_matrix.shape[1]
)
if norm_rows_in_sample:
similarity_matrix = similarity_matrix / np.max(
similarity_matrix
) # Norm max similarity within the sample to 1
if norm_rows and not to_batch:
similarity_matrix = row_norm(similarity_matrix)
similarity_matrix = np.nan_to_num(similarity_matrix, copy=False)
if whole_graph_proximity:
selection = np.searchsorted(np.array(G.nodes), node_ids)
assert (
np.array(G.nodes)[selection] == node_ids
).all(), "Internal error, subsetting nodes"
similarity_matrix = similarity_matrix[selection, :]
if to_batch:
similarity_matrix = whole_graph_rows_to_batch(
similarity_matrix, selection, norm_rows=norm_rows
)
return torch.as_tensor(similarity_matrix)
def whole_graph_rows_to_batch(
similarity_matrix: Union[Tensor, ndarray],
indecies: Union[Tensor, ndarray, list],
norm_rows: bool = True,
) -> Tensor:
"""
Sorts matrix according to indecies and row-normalizes if desired
Parameters
----------
similarity_matrix : Union[Tensor,ndarray]
input
indecies : Union[Tensor, ndarray, list]
indecies with order
norm_rows : bool, optional
whether to row norm, by default True
Returns
-------
Tensor
similarity_matrix
"""
similarity_matrix = similarity_matrix[:, indecies]
if norm_rows:
similarity_matrix = row_norm(similarity_matrix)
return torch.as_tensor(similarity_matrix)
| 38.794212
| 99
| 0.657107
| 1,548
| 12,065
| 4.946382
| 0.121447
| 0.106569
| 0.034739
| 0.028209
| 0.869009
| 0.814941
| 0.785295
| 0.780985
| 0.77132
| 0.757216
| 0
| 0.002841
| 0.2707
| 12,065
| 310
| 100
| 38.919355
| 0.867371
| 0.403647
| 0
| 0.658228
| 0
| 0
| 0.017522
| 0
| 0
| 0
| 0
| 0
| 0.012658
| 1
| 0.025316
| false
| 0
| 0.06962
| 0
| 0.120253
| 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
|
61bd86ebf343376a705c9c9720b7ade08e7a31b1
| 58
|
py
|
Python
|
code/models/__init__.py
|
michael-1003/EfficientNet-1D
|
ec7ff79fbde647b97d5c60359eba3c68beae934b
|
[
"MIT"
] | 4
|
2021-06-23T02:58:42.000Z
|
2022-01-19T11:09:38.000Z
|
code/models/__init__.py
|
michael-1003/EfficientNet-1D
|
ec7ff79fbde647b97d5c60359eba3c68beae934b
|
[
"MIT"
] | 1
|
2021-06-23T03:19:45.000Z
|
2021-06-23T03:19:45.000Z
|
code/models/__init__.py
|
michael-1003/EfficientNet-1D
|
ec7ff79fbde647b97d5c60359eba3c68beae934b
|
[
"MIT"
] | 3
|
2021-05-22T09:24:50.000Z
|
2021-06-23T03:13:08.000Z
|
from .cnn1d_adaptive import *
from .mlp_adaptive import *
| 29
| 30
| 0.793103
| 8
| 58
| 5.5
| 0.625
| 0.636364
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02
| 0.137931
| 58
| 2
| 31
| 29
| 0.86
| 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
|
4ee5c30fdd5948324b448dd199c921e30bccd8e3
| 81
|
py
|
Python
|
segmate/util/__init__.py
|
justacid/segmate
|
7b66b207ca353805f7ad9c7e003645cd2cbc227a
|
[
"MIT"
] | null | null | null |
segmate/util/__init__.py
|
justacid/segmate
|
7b66b207ca353805f7ad9c7e003645cd2cbc227a
|
[
"MIT"
] | null | null | null |
segmate/util/__init__.py
|
justacid/segmate
|
7b66b207ca353805f7ad9c7e003645cd2cbc227a
|
[
"MIT"
] | null | null | null |
from . import draw
from . import mask
from .qimage import to_qimage, from_qimage
| 20.25
| 42
| 0.790123
| 13
| 81
| 4.769231
| 0.461538
| 0.322581
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.160494
| 81
| 3
| 43
| 27
| 0.911765
| 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
|
f618c02f65290fbc84359a3cdcb941a996dbb49a
| 5,508
|
py
|
Python
|
test.py
|
tagias/tagias-python
|
60b8c2161c9f262958a42d977199a7e0249432ec
|
[
"MIT"
] | null | null | null |
test.py
|
tagias/tagias-python
|
60b8c2161c9f262958a42d977199a7e0249432ec
|
[
"MIT"
] | null | null | null |
test.py
|
tagias/tagias-python
|
60b8c2161c9f262958a42d977199a7e0249432ec
|
[
"MIT"
] | null | null | null |
# import the tagias api helper classes
from tagias.tagias import TagiasHelper, TagiasHelper2, TagiasError, TagiasTypes, TagiasStatuses, TagiasOperation
# Replace the test API key with your own private API key
apiKey = 'test'
# Testing the TAGIAS external API methods using TagiasHelper class
def test(apiKey):
try:
print('Test Start')
# create tagias helper object
helper = TagiasHelper(apiKey)
# create a new package
newPackage = helper.create_package('Test package', TagiasTypes.Keypoints,
'Put one point only in the center of the image', None, None,
'https://p.tagias.com/samples/', ['dog.8001.jpg', 'dog.8002.jpg', 'dog.8003.jpg'])
print('Package {} was created with {} image(s)'.format(newPackage['id'], newPackage['pictures_num']))
try:
# modify the package's status
helper.set_package_status(newPackage['id'], TagiasStatuses.STOPPED)
except TagiasError as e:
# handle a TagiasError exception
print('{} package\'s status was NOT modified: {}'.format(newPackage['id'], e.message))
# get the package's properties
package = helper.get_package(newPackage['id'])
print('New package properties:')
for prop in package:
print(' * {}: {}'.format(prop, package[prop]))
# get the list of all your packages
packages = helper.get_packages()
print('Packages:')
for package in packages:
print(' * {} {} {} {}'.format(package['id'], package['name'], package['status'], package['created']))
if package['status'] == TagiasStatuses.FINISHED:
# get the package's result if it's already finished
result = helper.get_result(package['id'])
print(' Result: {}'.format(result))
try:
# request the package's result to be send to the callback endpoint
helper.request_result(package['id'])
except TagiasError as e:
# handle a TagiasError exception
print('{} package\'s result was NOT requested: {}'.format(package['id'], e.message))
# get current balance and financial operations
balance = helper.get_balance()
print('Current balance: {} USD'.format(balance['balance']))
print('Operations:')
for op in balance['operations']:
print(' * {}: {} USD, {}'.format(op['date'], op['amount'], op['note']))
print('Test End')
except TagiasError as e:
# handle a TagiasError exception
print('TagiasError: {} ({})'.format(e.message, e.code))
# Testing the TAGIAS external API methods using TagiasHelper2 class
def test2(apiKey):
try:
print('Test2 Start')
# create tagias helper object
helper = TagiasHelper2(apiKey)
# create a new package
newPackage = helper.create_package('Test package', TagiasTypes.Keypoints,
'Put one point only in the center of the image', None, None,
'https://p.tagias.com/samples/', ['dog.8001.jpg', 'dog.8002.jpg', 'dog.8003.jpg'])
print('Package {} was created with {} image(s)'.format(newPackage.id, newPackage.pictures_num))
try:
# modify the package's status
helper.set_package_status(newPackage.id, TagiasStatuses.STOPPED)
except TagiasError as e:
# handle a TagiasError exception
print('{} package\'s status was NOT modified: {}'.format(newPackage.id, e.message))
# get the package's properties
package = helper.get_package(newPackage.id)
print('New package properties:')
for prop in dir(package):
if not prop.startswith('_'):
print(' * {}: {}'.format(prop, getattr(package, prop)))
# get the list of all your packages
packages = helper.get_packages()
print('Packages:')
for package in packages:
print(' * {} {} {} {}'.format(package.id, package.name, package.status, package.created))
if package.status == TagiasStatuses.FINISHED:
# get the package's result if it's already finished
result = helper.get_result(package.id)
print(result)
try:
# request the package's result to be send to the callback endpoint
helper.request_result(package.id)
except TagiasError as e:
# handle a TagiasError exception
print('{} package\'s result was NOT requested: {}'.format(package.id, e.message))
# get current balance and financial operations
balance = helper.get_balance()
print('Current balance: {} USD'.format(balance.balance))
print('Operations:')
for op in balance.operations:
print(' * {}: {} USD, {}'.format(op.date, op.amount, op.note))
print('Test2 End')
except TagiasError as e:
# handle a TagiasError exception
print('TagiasError: {} ({})'.format(e.message, e.code))
# test with TagiasHelper class
# test(apiKey)
# test with TagiasHelper2 class
test2(apiKey)
| 42.369231
| 126
| 0.570443
| 591
| 5,508
| 5.284264
| 0.186125
| 0.03074
| 0.028178
| 0.038425
| 0.854307
| 0.854307
| 0.831892
| 0.806916
| 0.806916
| 0.806916
| 0
| 0.00849
| 0.315723
| 5,508
| 129
| 127
| 42.697674
| 0.820111
| 0.196078
| 0
| 0.432432
| 0
| 0
| 0.183884
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.027027
| false
| 0
| 0.013514
| 0
| 0.040541
| 0.378378
| 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
|
f62123edf19806dede42e78c0071fe85ac60aa62
| 48
|
py
|
Python
|
insight_tools/machine_learning/__init__.py
|
Insight-by-Team/insight-tools
|
c854970769d4149306b876d4e480e68a1485e7b6
|
[
"MIT"
] | null | null | null |
insight_tools/machine_learning/__init__.py
|
Insight-by-Team/insight-tools
|
c854970769d4149306b876d4e480e68a1485e7b6
|
[
"MIT"
] | null | null | null |
insight_tools/machine_learning/__init__.py
|
Insight-by-Team/insight-tools
|
c854970769d4149306b876d4e480e68a1485e7b6
|
[
"MIT"
] | null | null | null |
from .hparams_assistant import HParamsAssistant
| 24
| 47
| 0.895833
| 5
| 48
| 8.4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.083333
| 48
| 1
| 48
| 48
| 0.954545
| 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
|
f670376159fbdba595a1429d75e6e134bdc2d388
| 258,350
|
py
|
Python
|
instances/passenger_demand/pas-20210422-1717-int1/5.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-int1/5.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-int1/5.py
|
LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure
|
bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11
|
[
"BSD-3-Clause"
] | null | null | null |
"""
PASSENGERS
"""
numPassengers = 19157
passenger_arriving = (
(14, 8, 6, 8, 8, 0, 0, 1, 4, 0, 0, 2, 0, 7, 3, 3, 4, 3, 2, 0, 1, 0, 2, 2, 0, 0), # 0
(5, 5, 6, 5, 3, 2, 5, 2, 3, 5, 1, 1, 0, 7, 6, 5, 3, 8, 5, 1, 2, 2, 1, 0, 0, 0), # 1
(5, 9, 4, 2, 7, 4, 2, 1, 2, 0, 0, 0, 0, 10, 3, 5, 1, 6, 3, 3, 2, 3, 1, 0, 0, 0), # 2
(9, 3, 5, 2, 7, 1, 6, 2, 2, 4, 0, 1, 0, 12, 6, 2, 8, 8, 10, 1, 2, 0, 2, 2, 0, 0), # 3
(8, 7, 7, 10, 5, 0, 2, 1, 3, 1, 0, 0, 0, 8, 5, 4, 1, 3, 2, 3, 0, 0, 1, 1, 0, 0), # 4
(5, 4, 5, 3, 4, 3, 3, 5, 2, 0, 3, 0, 0, 6, 5, 7, 3, 7, 1, 2, 3, 3, 1, 3, 2, 0), # 5
(7, 4, 9, 9, 3, 4, 6, 1, 2, 3, 1, 0, 0, 6, 6, 6, 7, 2, 2, 4, 1, 0, 3, 1, 1, 0), # 6
(7, 5, 9, 3, 7, 4, 1, 5, 1, 1, 2, 1, 0, 4, 3, 8, 2, 8, 1, 5, 2, 2, 1, 0, 0, 0), # 7
(14, 6, 4, 9, 9, 3, 2, 0, 1, 2, 0, 0, 0, 5, 6, 5, 5, 7, 3, 1, 5, 4, 1, 1, 0, 0), # 8
(9, 7, 4, 10, 6, 3, 3, 0, 1, 2, 0, 0, 0, 4, 5, 6, 2, 7, 5, 1, 0, 4, 1, 2, 1, 0), # 9
(8, 5, 4, 9, 9, 5, 5, 6, 3, 0, 0, 1, 0, 6, 9, 7, 5, 6, 6, 1, 4, 4, 3, 1, 0, 0), # 10
(11, 6, 9, 10, 5, 3, 6, 1, 1, 1, 0, 0, 0, 11, 6, 3, 2, 11, 5, 2, 1, 4, 3, 1, 0, 0), # 11
(9, 4, 7, 5, 9, 4, 3, 2, 3, 1, 2, 1, 0, 5, 10, 9, 5, 12, 4, 5, 6, 4, 6, 4, 0, 0), # 12
(10, 7, 9, 8, 8, 2, 3, 3, 3, 1, 2, 1, 0, 7, 10, 4, 4, 5, 6, 2, 2, 5, 2, 2, 1, 0), # 13
(9, 13, 10, 12, 6, 1, 5, 7, 5, 5, 1, 0, 0, 7, 6, 4, 11, 9, 7, 5, 0, 3, 3, 2, 0, 0), # 14
(14, 10, 14, 7, 10, 6, 2, 5, 5, 0, 1, 1, 0, 4, 6, 7, 7, 5, 3, 8, 5, 6, 6, 1, 0, 0), # 15
(10, 9, 11, 8, 5, 3, 5, 5, 3, 1, 0, 2, 0, 8, 9, 8, 7, 12, 3, 2, 2, 7, 3, 1, 0, 0), # 16
(13, 8, 13, 8, 7, 3, 3, 2, 5, 1, 0, 0, 0, 3, 8, 5, 5, 5, 2, 3, 4, 5, 3, 1, 2, 0), # 17
(8, 10, 7, 7, 3, 5, 6, 8, 4, 3, 3, 1, 0, 11, 8, 6, 13, 13, 3, 8, 0, 6, 1, 1, 1, 0), # 18
(5, 13, 12, 11, 6, 5, 4, 2, 1, 2, 3, 1, 0, 8, 5, 8, 8, 7, 9, 4, 2, 0, 4, 3, 0, 0), # 19
(15, 13, 5, 4, 7, 2, 6, 4, 4, 4, 2, 3, 0, 18, 7, 8, 4, 6, 3, 3, 3, 4, 2, 1, 1, 0), # 20
(9, 15, 5, 9, 9, 3, 7, 2, 6, 0, 1, 2, 0, 10, 9, 10, 11, 8, 5, 2, 5, 3, 1, 1, 0, 0), # 21
(10, 9, 12, 5, 11, 3, 4, 5, 6, 1, 0, 1, 0, 9, 9, 3, 4, 15, 8, 5, 2, 3, 2, 3, 3, 0), # 22
(8, 7, 3, 6, 2, 3, 2, 4, 5, 2, 2, 2, 0, 6, 5, 5, 1, 12, 6, 2, 3, 3, 4, 1, 4, 0), # 23
(6, 7, 9, 9, 8, 6, 3, 6, 6, 2, 0, 1, 0, 12, 11, 8, 9, 9, 10, 2, 2, 6, 0, 2, 4, 0), # 24
(15, 13, 8, 9, 9, 3, 5, 5, 5, 0, 2, 1, 0, 8, 9, 11, 9, 8, 7, 2, 1, 2, 5, 2, 0, 0), # 25
(10, 6, 9, 4, 7, 3, 4, 6, 3, 1, 0, 1, 0, 8, 9, 5, 7, 9, 5, 7, 3, 1, 3, 0, 1, 0), # 26
(8, 10, 7, 6, 9, 7, 2, 2, 7, 1, 0, 2, 0, 7, 8, 6, 6, 4, 5, 4, 2, 4, 5, 2, 1, 0), # 27
(11, 9, 6, 10, 6, 2, 3, 5, 7, 3, 1, 1, 0, 6, 8, 4, 6, 4, 3, 2, 2, 2, 1, 0, 2, 0), # 28
(11, 9, 7, 12, 8, 4, 0, 7, 1, 1, 0, 0, 0, 8, 7, 9, 9, 4, 3, 7, 3, 4, 0, 1, 2, 0), # 29
(9, 10, 12, 13, 8, 6, 2, 2, 2, 2, 1, 1, 0, 10, 10, 4, 6, 7, 7, 6, 2, 4, 2, 1, 2, 0), # 30
(11, 9, 10, 4, 5, 0, 6, 6, 1, 1, 1, 1, 0, 12, 9, 6, 5, 3, 11, 4, 2, 7, 6, 4, 0, 0), # 31
(18, 9, 9, 6, 9, 0, 1, 1, 7, 3, 2, 0, 0, 9, 5, 6, 3, 8, 3, 1, 2, 2, 3, 3, 2, 0), # 32
(10, 10, 10, 6, 2, 12, 7, 0, 7, 2, 3, 0, 0, 5, 12, 8, 1, 14, 6, 4, 2, 6, 3, 1, 0, 0), # 33
(15, 9, 11, 11, 10, 4, 5, 1, 9, 3, 0, 1, 0, 9, 7, 7, 5, 6, 7, 2, 1, 3, 4, 0, 2, 0), # 34
(14, 13, 9, 18, 7, 6, 2, 4, 4, 1, 3, 1, 0, 9, 10, 7, 8, 4, 4, 5, 4, 2, 1, 3, 3, 0), # 35
(8, 5, 6, 4, 11, 3, 6, 5, 6, 2, 0, 2, 0, 15, 6, 6, 6, 5, 6, 3, 4, 3, 3, 1, 2, 0), # 36
(6, 8, 15, 4, 6, 3, 3, 4, 1, 4, 0, 0, 0, 15, 8, 11, 5, 12, 1, 6, 1, 5, 6, 1, 0, 0), # 37
(15, 17, 9, 7, 8, 4, 5, 2, 2, 0, 0, 1, 0, 10, 9, 3, 6, 8, 5, 2, 4, 5, 4, 1, 1, 0), # 38
(7, 11, 6, 11, 12, 3, 4, 4, 2, 1, 3, 1, 0, 9, 7, 10, 2, 8, 4, 7, 2, 7, 0, 1, 2, 0), # 39
(9, 5, 9, 12, 5, 1, 3, 4, 2, 1, 0, 1, 0, 11, 7, 5, 6, 15, 4, 4, 1, 4, 3, 1, 1, 0), # 40
(8, 5, 7, 10, 11, 5, 7, 3, 6, 1, 2, 1, 0, 18, 9, 6, 8, 8, 5, 6, 2, 3, 2, 1, 2, 0), # 41
(10, 12, 7, 10, 9, 2, 3, 4, 3, 1, 0, 0, 0, 7, 11, 3, 6, 8, 4, 4, 5, 6, 3, 0, 0, 0), # 42
(11, 10, 12, 7, 10, 8, 4, 1, 2, 3, 1, 1, 0, 16, 7, 14, 5, 12, 9, 1, 1, 5, 2, 3, 2, 0), # 43
(8, 14, 12, 8, 6, 4, 3, 2, 4, 1, 1, 0, 0, 14, 10, 11, 5, 9, 4, 2, 2, 5, 4, 2, 0, 0), # 44
(8, 14, 9, 3, 6, 3, 4, 6, 2, 0, 1, 2, 0, 7, 11, 7, 5, 15, 1, 3, 4, 2, 3, 0, 0, 0), # 45
(9, 11, 8, 9, 5, 1, 2, 3, 4, 5, 1, 0, 0, 11, 12, 10, 6, 8, 6, 4, 3, 11, 7, 2, 2, 0), # 46
(11, 10, 13, 12, 7, 5, 8, 4, 2, 2, 0, 0, 0, 11, 6, 10, 9, 3, 6, 5, 2, 3, 5, 5, 0, 0), # 47
(8, 7, 6, 7, 6, 4, 6, 1, 3, 2, 1, 1, 0, 12, 11, 7, 3, 14, 7, 0, 1, 3, 4, 3, 1, 0), # 48
(8, 8, 9, 10, 7, 3, 1, 3, 3, 4, 1, 0, 0, 12, 11, 7, 2, 6, 5, 1, 1, 2, 1, 3, 1, 0), # 49
(6, 11, 8, 5, 13, 2, 2, 4, 4, 1, 2, 1, 0, 10, 12, 6, 4, 4, 5, 4, 2, 2, 4, 2, 0, 0), # 50
(10, 11, 8, 14, 7, 4, 3, 6, 5, 0, 1, 0, 0, 6, 14, 2, 3, 6, 5, 4, 3, 4, 3, 1, 2, 0), # 51
(13, 6, 12, 10, 5, 2, 4, 2, 2, 2, 1, 0, 0, 12, 8, 11, 5, 11, 1, 7, 3, 7, 1, 1, 1, 0), # 52
(12, 14, 10, 6, 10, 3, 4, 6, 6, 3, 1, 0, 0, 10, 13, 5, 3, 11, 6, 4, 1, 5, 3, 2, 0, 0), # 53
(13, 10, 6, 11, 3, 5, 5, 7, 9, 0, 3, 0, 0, 6, 8, 7, 4, 4, 3, 4, 2, 4, 3, 2, 0, 0), # 54
(11, 8, 10, 13, 8, 6, 3, 4, 2, 2, 1, 2, 0, 5, 7, 6, 4, 10, 8, 4, 1, 4, 2, 0, 1, 0), # 55
(10, 13, 9, 6, 5, 4, 1, 4, 4, 5, 0, 2, 0, 8, 6, 6, 9, 7, 3, 6, 5, 4, 6, 0, 0, 0), # 56
(12, 5, 4, 10, 10, 3, 4, 5, 4, 1, 1, 0, 0, 12, 4, 5, 10, 7, 6, 1, 1, 5, 4, 1, 0, 0), # 57
(12, 14, 7, 12, 9, 0, 5, 3, 4, 1, 2, 0, 0, 10, 9, 4, 2, 6, 5, 6, 1, 2, 1, 1, 3, 0), # 58
(7, 9, 4, 7, 6, 1, 0, 2, 3, 2, 0, 0, 0, 10, 11, 9, 5, 7, 4, 2, 3, 4, 4, 2, 0, 0), # 59
(12, 6, 8, 12, 5, 4, 3, 5, 3, 2, 1, 0, 0, 18, 7, 9, 8, 5, 3, 9, 1, 6, 5, 4, 1, 0), # 60
(13, 10, 9, 11, 9, 4, 3, 3, 5, 1, 2, 0, 0, 10, 9, 8, 2, 8, 0, 8, 1, 3, 3, 1, 2, 0), # 61
(10, 12, 7, 10, 4, 5, 4, 3, 3, 3, 1, 0, 0, 6, 6, 6, 5, 11, 4, 3, 6, 3, 1, 2, 0, 0), # 62
(12, 12, 13, 5, 7, 11, 3, 4, 6, 2, 1, 1, 0, 17, 9, 11, 5, 6, 2, 4, 4, 2, 2, 0, 0, 0), # 63
(10, 11, 11, 6, 10, 2, 2, 2, 3, 4, 5, 0, 0, 9, 7, 6, 7, 4, 8, 10, 4, 4, 2, 0, 1, 0), # 64
(9, 6, 7, 14, 9, 6, 7, 5, 4, 1, 2, 0, 0, 12, 7, 4, 7, 12, 1, 2, 6, 5, 4, 0, 0, 0), # 65
(11, 7, 10, 13, 8, 2, 7, 2, 5, 0, 1, 0, 0, 14, 12, 7, 3, 9, 5, 5, 2, 1, 2, 1, 1, 0), # 66
(12, 7, 9, 9, 13, 3, 6, 3, 6, 1, 0, 0, 0, 14, 7, 7, 6, 6, 2, 5, 1, 2, 6, 2, 1, 0), # 67
(5, 9, 13, 13, 5, 4, 2, 4, 2, 1, 2, 1, 0, 8, 18, 11, 4, 13, 5, 6, 2, 5, 2, 0, 2, 0), # 68
(13, 3, 7, 10, 6, 7, 4, 1, 5, 2, 2, 0, 0, 6, 12, 3, 4, 3, 2, 2, 1, 3, 2, 2, 0, 0), # 69
(4, 9, 8, 7, 7, 4, 1, 4, 2, 1, 2, 0, 0, 8, 6, 8, 9, 9, 4, 6, 2, 2, 3, 2, 0, 0), # 70
(14, 9, 8, 9, 5, 8, 2, 1, 1, 1, 1, 2, 0, 17, 9, 15, 5, 8, 2, 4, 3, 2, 2, 1, 3, 0), # 71
(13, 6, 7, 12, 8, 4, 4, 3, 1, 1, 1, 1, 0, 14, 6, 6, 6, 12, 4, 4, 3, 4, 4, 2, 1, 0), # 72
(9, 7, 6, 12, 6, 1, 3, 2, 6, 2, 1, 1, 0, 9, 7, 8, 3, 10, 9, 6, 4, 2, 3, 2, 1, 0), # 73
(11, 11, 9, 8, 6, 7, 4, 1, 3, 3, 1, 1, 0, 5, 10, 4, 4, 7, 3, 4, 2, 6, 0, 0, 0, 0), # 74
(14, 8, 10, 8, 9, 3, 3, 3, 5, 3, 2, 2, 0, 12, 12, 5, 6, 4, 4, 3, 3, 0, 1, 2, 1, 0), # 75
(9, 13, 9, 9, 7, 3, 3, 3, 5, 3, 1, 1, 0, 13, 8, 4, 6, 3, 7, 1, 1, 5, 1, 2, 0, 0), # 76
(13, 8, 8, 9, 7, 5, 5, 2, 3, 0, 0, 0, 0, 13, 5, 5, 5, 13, 2, 7, 0, 7, 0, 1, 1, 0), # 77
(9, 7, 4, 14, 9, 2, 4, 4, 5, 2, 1, 1, 0, 9, 13, 8, 2, 2, 4, 3, 1, 3, 6, 0, 0, 0), # 78
(6, 12, 11, 13, 8, 3, 2, 2, 4, 0, 2, 0, 0, 10, 8, 5, 3, 8, 6, 3, 10, 1, 3, 4, 0, 0), # 79
(14, 15, 1, 10, 6, 2, 2, 3, 4, 0, 2, 1, 0, 6, 11, 11, 3, 9, 4, 3, 2, 4, 3, 1, 2, 0), # 80
(15, 5, 3, 9, 8, 1, 8, 2, 4, 1, 1, 2, 0, 14, 9, 8, 4, 10, 1, 3, 3, 9, 3, 3, 1, 0), # 81
(12, 10, 8, 16, 7, 5, 6, 1, 3, 1, 2, 1, 0, 11, 12, 5, 5, 10, 3, 6, 2, 3, 3, 2, 0, 0), # 82
(9, 13, 13, 3, 5, 3, 3, 4, 3, 1, 2, 1, 0, 11, 11, 13, 4, 4, 4, 4, 1, 7, 2, 3, 1, 0), # 83
(9, 4, 7, 5, 6, 2, 5, 5, 5, 1, 1, 0, 0, 11, 9, 10, 3, 3, 5, 0, 2, 3, 1, 1, 1, 0), # 84
(9, 12, 12, 11, 4, 3, 5, 4, 2, 1, 2, 0, 0, 10, 7, 6, 5, 9, 2, 4, 6, 4, 0, 0, 0, 0), # 85
(12, 6, 8, 6, 14, 4, 3, 3, 2, 1, 0, 1, 0, 7, 10, 4, 4, 6, 3, 4, 3, 4, 5, 1, 1, 0), # 86
(13, 10, 8, 3, 3, 5, 3, 4, 3, 1, 1, 0, 0, 11, 9, 9, 5, 9, 6, 3, 4, 5, 1, 2, 1, 0), # 87
(7, 6, 8, 9, 5, 2, 3, 2, 3, 0, 0, 0, 0, 8, 9, 2, 5, 4, 2, 1, 0, 3, 3, 2, 0, 0), # 88
(10, 10, 8, 6, 9, 4, 2, 4, 2, 1, 1, 2, 0, 7, 11, 8, 7, 13, 1, 5, 2, 1, 5, 1, 1, 0), # 89
(1, 6, 7, 8, 8, 9, 2, 1, 5, 2, 0, 1, 0, 12, 13, 10, 4, 12, 3, 2, 1, 1, 2, 3, 0, 0), # 90
(10, 12, 3, 11, 7, 4, 2, 3, 2, 5, 2, 2, 0, 12, 6, 7, 8, 5, 2, 7, 2, 3, 3, 5, 2, 0), # 91
(10, 10, 7, 5, 7, 4, 6, 3, 6, 1, 0, 0, 0, 16, 6, 8, 9, 8, 2, 0, 4, 4, 4, 1, 0, 0), # 92
(10, 8, 9, 6, 6, 0, 5, 3, 7, 0, 2, 0, 0, 6, 11, 5, 4, 9, 8, 0, 6, 0, 5, 3, 0, 0), # 93
(5, 10, 7, 11, 4, 3, 2, 2, 5, 0, 0, 1, 0, 10, 7, 8, 5, 7, 1, 1, 2, 2, 2, 0, 0, 0), # 94
(7, 3, 13, 8, 8, 4, 2, 5, 6, 3, 1, 0, 0, 7, 3, 6, 3, 4, 2, 4, 5, 5, 3, 4, 1, 0), # 95
(6, 8, 5, 5, 10, 3, 1, 2, 1, 2, 1, 2, 0, 8, 8, 7, 2, 12, 1, 4, 0, 3, 2, 2, 0, 0), # 96
(15, 11, 12, 7, 6, 2, 3, 5, 5, 1, 1, 0, 0, 12, 8, 6, 4, 2, 3, 0, 1, 9, 6, 3, 0, 0), # 97
(11, 8, 2, 5, 5, 4, 4, 2, 7, 5, 4, 1, 0, 6, 6, 9, 10, 8, 5, 8, 2, 2, 2, 0, 0, 0), # 98
(9, 8, 6, 8, 10, 1, 4, 3, 6, 5, 0, 0, 0, 20, 8, 7, 4, 10, 3, 5, 0, 3, 9, 1, 1, 0), # 99
(20, 6, 10, 4, 8, 5, 2, 4, 1, 3, 1, 0, 0, 11, 2, 5, 4, 10, 4, 5, 4, 2, 1, 3, 0, 0), # 100
(9, 5, 10, 8, 7, 7, 2, 3, 4, 1, 1, 1, 0, 7, 8, 6, 6, 7, 2, 4, 2, 3, 2, 5, 1, 0), # 101
(12, 8, 9, 7, 4, 2, 0, 3, 2, 4, 1, 1, 0, 11, 11, 8, 5, 4, 6, 9, 0, 4, 4, 0, 0, 0), # 102
(13, 4, 9, 1, 9, 2, 3, 5, 1, 1, 0, 0, 0, 6, 6, 6, 7, 4, 4, 3, 4, 1, 4, 1, 0, 0), # 103
(11, 7, 8, 4, 7, 6, 2, 3, 5, 0, 1, 0, 0, 4, 5, 4, 1, 9, 5, 0, 5, 2, 4, 3, 2, 0), # 104
(14, 10, 12, 4, 8, 3, 5, 2, 3, 0, 3, 1, 0, 9, 2, 2, 6, 7, 6, 1, 4, 6, 2, 2, 1, 0), # 105
(9, 7, 7, 11, 15, 3, 3, 7, 6, 1, 1, 1, 0, 13, 10, 10, 7, 6, 3, 3, 5, 7, 0, 1, 2, 0), # 106
(9, 8, 12, 4, 8, 4, 3, 1, 2, 0, 0, 2, 0, 9, 12, 4, 2, 12, 3, 6, 3, 5, 3, 3, 0, 0), # 107
(14, 5, 10, 6, 7, 2, 2, 1, 5, 1, 3, 0, 0, 10, 3, 10, 7, 4, 3, 1, 8, 4, 3, 1, 1, 0), # 108
(9, 9, 3, 7, 7, 2, 2, 4, 5, 2, 3, 1, 0, 14, 6, 2, 5, 4, 1, 4, 1, 3, 2, 0, 0, 0), # 109
(10, 8, 11, 9, 10, 4, 1, 1, 4, 2, 4, 0, 0, 9, 8, 7, 8, 6, 3, 3, 6, 3, 5, 3, 0, 0), # 110
(10, 9, 7, 5, 7, 3, 0, 4, 4, 0, 0, 0, 0, 15, 7, 6, 5, 3, 6, 3, 3, 6, 5, 3, 0, 0), # 111
(11, 8, 9, 11, 6, 3, 3, 3, 5, 1, 1, 0, 0, 9, 8, 7, 4, 4, 4, 1, 1, 4, 1, 0, 2, 0), # 112
(5, 8, 8, 10, 7, 5, 4, 0, 5, 1, 0, 1, 0, 11, 5, 3, 1, 11, 4, 2, 2, 3, 3, 1, 1, 0), # 113
(6, 8, 9, 6, 10, 5, 1, 1, 7, 1, 2, 1, 0, 8, 10, 3, 2, 11, 3, 1, 2, 2, 2, 4, 1, 0), # 114
(9, 8, 6, 6, 7, 3, 4, 2, 3, 2, 1, 0, 0, 10, 2, 9, 6, 9, 1, 4, 1, 2, 3, 2, 1, 0), # 115
(10, 7, 5, 8, 11, 2, 4, 4, 5, 1, 1, 0, 0, 10, 11, 4, 6, 9, 8, 6, 2, 3, 3, 4, 0, 0), # 116
(14, 12, 8, 6, 8, 3, 5, 4, 1, 0, 1, 0, 0, 6, 6, 5, 2, 3, 6, 4, 2, 4, 2, 2, 1, 0), # 117
(4, 11, 5, 12, 3, 3, 5, 5, 3, 2, 0, 0, 0, 6, 9, 4, 7, 5, 1, 4, 3, 5, 2, 0, 0, 0), # 118
(8, 11, 4, 6, 3, 2, 2, 3, 2, 2, 0, 1, 0, 7, 6, 13, 10, 8, 2, 2, 3, 0, 2, 2, 1, 0), # 119
(6, 6, 10, 6, 8, 3, 3, 3, 3, 2, 4, 0, 0, 7, 5, 4, 4, 6, 2, 1, 2, 5, 4, 5, 0, 0), # 120
(8, 7, 7, 5, 10, 2, 6, 8, 6, 4, 1, 0, 0, 8, 4, 8, 7, 11, 2, 3, 3, 6, 0, 3, 0, 0), # 121
(13, 6, 9, 8, 2, 2, 2, 1, 6, 1, 1, 0, 0, 9, 9, 3, 4, 10, 3, 3, 4, 2, 1, 4, 0, 0), # 122
(9, 7, 9, 9, 8, 1, 7, 5, 5, 2, 0, 0, 0, 7, 4, 5, 5, 3, 6, 1, 2, 8, 5, 2, 0, 0), # 123
(7, 7, 5, 10, 3, 3, 3, 3, 3, 2, 0, 0, 0, 9, 3, 3, 6, 5, 3, 3, 2, 6, 3, 2, 3, 0), # 124
(14, 5, 6, 4, 13, 5, 1, 4, 3, 1, 0, 2, 0, 10, 6, 5, 7, 6, 4, 3, 2, 2, 1, 0, 1, 0), # 125
(8, 5, 6, 13, 10, 1, 7, 1, 2, 0, 1, 0, 0, 7, 6, 7, 5, 8, 6, 4, 4, 0, 1, 2, 1, 0), # 126
(9, 3, 10, 11, 2, 1, 5, 1, 0, 0, 2, 1, 0, 10, 6, 7, 3, 6, 2, 5, 5, 5, 1, 0, 0, 0), # 127
(14, 7, 9, 6, 7, 2, 2, 2, 4, 3, 1, 0, 0, 11, 4, 2, 6, 6, 6, 0, 1, 4, 4, 1, 0, 0), # 128
(8, 4, 7, 15, 6, 1, 0, 1, 2, 2, 0, 0, 0, 14, 8, 5, 1, 3, 3, 5, 1, 2, 7, 0, 0, 0), # 129
(6, 3, 6, 4, 10, 2, 6, 2, 3, 2, 0, 0, 0, 14, 8, 5, 0, 7, 2, 2, 1, 4, 2, 0, 0, 0), # 130
(11, 8, 9, 8, 6, 1, 1, 1, 6, 2, 0, 0, 0, 8, 3, 6, 7, 7, 2, 2, 2, 1, 3, 0, 1, 0), # 131
(8, 4, 10, 5, 7, 2, 1, 5, 1, 1, 0, 0, 0, 9, 14, 7, 5, 5, 2, 3, 2, 2, 0, 0, 0, 0), # 132
(8, 6, 8, 15, 10, 4, 1, 2, 4, 4, 2, 1, 0, 6, 11, 5, 5, 5, 4, 3, 1, 1, 0, 1, 0, 0), # 133
(8, 4, 8, 14, 7, 1, 2, 3, 1, 1, 1, 0, 0, 7, 11, 5, 2, 6, 4, 3, 4, 3, 0, 2, 0, 0), # 134
(5, 11, 4, 13, 10, 2, 3, 2, 2, 1, 1, 1, 0, 7, 8, 2, 2, 5, 4, 3, 5, 2, 2, 1, 2, 0), # 135
(9, 9, 4, 12, 2, 1, 3, 1, 7, 0, 3, 0, 0, 15, 9, 2, 4, 9, 1, 2, 1, 1, 3, 4, 0, 0), # 136
(12, 2, 7, 6, 6, 3, 5, 2, 3, 0, 0, 0, 0, 9, 4, 7, 5, 11, 1, 3, 4, 9, 1, 1, 1, 0), # 137
(9, 5, 4, 10, 6, 3, 2, 3, 2, 3, 1, 0, 0, 11, 5, 8, 2, 7, 5, 4, 2, 6, 4, 3, 0, 0), # 138
(9, 5, 6, 4, 7, 5, 3, 3, 2, 2, 0, 1, 0, 12, 6, 5, 6, 5, 2, 3, 0, 1, 4, 0, 0, 0), # 139
(11, 13, 4, 6, 5, 6, 3, 2, 7, 0, 3, 1, 0, 3, 4, 5, 4, 6, 7, 6, 4, 3, 2, 0, 1, 0), # 140
(9, 7, 7, 8, 9, 2, 1, 4, 5, 1, 0, 0, 0, 9, 5, 13, 5, 10, 2, 5, 2, 2, 3, 2, 1, 0), # 141
(8, 5, 6, 8, 7, 1, 5, 1, 6, 2, 0, 0, 0, 2, 0, 8, 2, 5, 1, 1, 4, 2, 4, 3, 0, 0), # 142
(9, 7, 6, 9, 11, 2, 1, 1, 2, 2, 1, 4, 0, 13, 3, 3, 2, 3, 4, 3, 5, 6, 2, 0, 3, 0), # 143
(15, 11, 7, 9, 8, 4, 3, 6, 2, 1, 0, 0, 0, 7, 4, 4, 1, 6, 2, 2, 3, 1, 5, 0, 1, 0), # 144
(14, 4, 5, 5, 8, 3, 3, 2, 3, 2, 0, 0, 0, 10, 10, 7, 4, 5, 4, 0, 1, 6, 6, 0, 0, 0), # 145
(10, 7, 7, 5, 6, 1, 2, 5, 4, 7, 0, 1, 0, 14, 10, 5, 3, 9, 4, 4, 4, 2, 3, 1, 1, 0), # 146
(6, 4, 4, 7, 6, 1, 0, 2, 2, 1, 3, 2, 0, 8, 6, 7, 3, 6, 2, 3, 3, 2, 3, 1, 0, 0), # 147
(11, 3, 8, 5, 4, 3, 4, 1, 3, 4, 4, 0, 0, 11, 6, 2, 5, 9, 2, 1, 1, 6, 3, 2, 0, 0), # 148
(12, 7, 10, 8, 4, 2, 4, 2, 6, 1, 0, 0, 0, 8, 10, 3, 2, 5, 1, 2, 2, 1, 1, 1, 1, 0), # 149
(4, 2, 8, 11, 6, 3, 1, 6, 0, 2, 3, 3, 0, 8, 8, 5, 2, 9, 3, 3, 6, 4, 1, 1, 0, 0), # 150
(5, 4, 1, 4, 4, 2, 1, 3, 3, 1, 0, 2, 0, 10, 5, 5, 4, 5, 6, 2, 4, 3, 3, 2, 0, 0), # 151
(4, 5, 5, 7, 7, 2, 1, 2, 5, 0, 0, 1, 0, 14, 12, 3, 4, 5, 3, 1, 1, 1, 2, 1, 1, 0), # 152
(6, 1, 9, 9, 5, 1, 2, 1, 2, 0, 0, 0, 0, 12, 8, 8, 1, 7, 7, 3, 0, 3, 1, 2, 0, 0), # 153
(8, 4, 11, 8, 3, 4, 0, 4, 3, 3, 0, 1, 0, 7, 3, 6, 5, 6, 6, 4, 1, 5, 2, 1, 0, 0), # 154
(8, 7, 10, 3, 6, 6, 2, 1, 1, 2, 3, 0, 0, 11, 14, 8, 6, 5, 2, 2, 2, 2, 3, 0, 0, 0), # 155
(5, 10, 5, 8, 3, 2, 2, 4, 2, 0, 1, 1, 0, 10, 7, 4, 3, 3, 4, 3, 1, 5, 3, 1, 0, 0), # 156
(8, 10, 7, 7, 9, 0, 3, 1, 3, 2, 0, 2, 0, 8, 8, 7, 4, 5, 0, 1, 3, 3, 3, 0, 0, 0), # 157
(8, 2, 5, 11, 5, 1, 1, 1, 3, 1, 1, 0, 0, 4, 3, 11, 6, 4, 3, 4, 3, 5, 3, 1, 0, 0), # 158
(10, 5, 5, 4, 6, 6, 1, 0, 3, 2, 1, 1, 0, 7, 5, 5, 4, 7, 5, 3, 2, 1, 3, 2, 0, 0), # 159
(7, 4, 8, 5, 5, 3, 1, 3, 4, 0, 1, 1, 0, 12, 7, 3, 6, 11, 2, 1, 3, 5, 1, 3, 0, 0), # 160
(4, 4, 4, 3, 8, 3, 1, 4, 7, 1, 1, 2, 0, 4, 8, 5, 5, 8, 5, 2, 1, 2, 4, 0, 1, 0), # 161
(6, 3, 6, 10, 7, 4, 2, 1, 4, 2, 1, 0, 0, 4, 6, 6, 1, 12, 3, 3, 1, 2, 1, 0, 0, 0), # 162
(10, 10, 4, 3, 3, 6, 3, 4, 2, 0, 0, 0, 0, 5, 8, 4, 4, 8, 3, 1, 4, 2, 2, 0, 0, 0), # 163
(11, 2, 8, 9, 6, 1, 5, 1, 3, 0, 3, 0, 0, 1, 5, 3, 6, 4, 2, 1, 2, 4, 4, 0, 1, 0), # 164
(5, 6, 9, 7, 3, 1, 3, 2, 2, 1, 1, 0, 0, 10, 6, 3, 3, 9, 2, 1, 2, 4, 3, 0, 0, 0), # 165
(6, 4, 4, 5, 6, 4, 1, 1, 4, 1, 0, 3, 0, 3, 5, 4, 0, 10, 5, 0, 3, 4, 0, 1, 1, 0), # 166
(6, 1, 6, 7, 4, 1, 1, 0, 2, 2, 0, 1, 0, 4, 6, 3, 5, 7, 5, 1, 2, 4, 3, 0, 0, 0), # 167
(1, 5, 3, 5, 4, 3, 2, 3, 0, 1, 0, 0, 0, 8, 5, 6, 5, 4, 2, 0, 0, 1, 5, 1, 0, 0), # 168
(9, 3, 10, 5, 6, 0, 5, 3, 3, 1, 0, 0, 0, 8, 6, 2, 4, 9, 0, 2, 2, 4, 2, 0, 0, 0), # 169
(10, 3, 8, 7, 5, 4, 3, 3, 1, 0, 0, 0, 0, 1, 3, 3, 2, 5, 3, 3, 1, 0, 3, 0, 2, 0), # 170
(4, 2, 6, 3, 1, 2, 2, 0, 4, 0, 1, 0, 0, 8, 5, 4, 4, 3, 0, 2, 1, 5, 3, 0, 0, 0), # 171
(3, 5, 4, 1, 0, 2, 3, 0, 4, 2, 1, 0, 0, 5, 6, 2, 1, 5, 3, 3, 4, 2, 2, 0, 0, 0), # 172
(7, 2, 3, 4, 5, 2, 1, 2, 3, 3, 0, 0, 0, 7, 3, 2, 5, 4, 0, 1, 1, 1, 2, 0, 1, 0), # 173
(5, 2, 5, 6, 1, 4, 3, 0, 4, 0, 1, 0, 0, 7, 6, 1, 7, 4, 1, 2, 1, 2, 1, 1, 0, 0), # 174
(4, 3, 7, 2, 5, 3, 1, 3, 3, 0, 1, 0, 0, 3, 5, 7, 2, 6, 1, 0, 0, 1, 1, 1, 0, 0), # 175
(2, 2, 5, 2, 7, 1, 3, 1, 3, 2, 0, 0, 0, 11, 5, 1, 1, 5, 2, 1, 1, 1, 4, 0, 0, 0), # 176
(1, 0, 7, 3, 5, 3, 1, 0, 2, 1, 0, 1, 0, 6, 1, 1, 4, 4, 2, 2, 2, 2, 4, 0, 0, 0), # 177
(1, 4, 5, 3, 3, 0, 0, 2, 1, 1, 0, 0, 0, 5, 3, 3, 1, 6, 2, 1, 0, 2, 1, 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 = (
(5.020865578371768, 5.525288559693166, 5.211283229612507, 6.214667773863432, 5.554685607609612, 3.1386549320373387, 4.146035615373915, 4.653176172979423, 6.090099062168007, 3.9580150155223697, 4.205265163885603, 4.897915078306173, 5.083880212578363), # 0
(5.354327152019974, 5.890060694144759, 5.555346591330152, 6.625144253276616, 5.922490337474237, 3.3459835840425556, 4.419468941263694, 4.959513722905708, 6.492245326332909, 4.21898069227715, 4.483096135956131, 5.221216660814354, 5.419791647439855), # 1
(5.686723008979731, 6.253385170890979, 5.8980422855474135, 7.033987704664794, 6.288962973749744, 3.5524851145124448, 4.691818507960704, 5.264625247904419, 6.892786806877549, 4.478913775020546, 4.759823148776313, 5.543232652053055, 5.75436482820969), # 2
(6.016757793146562, 6.613820501936447, 6.238010869319854, 7.439576407532074, 6.652661676001902, 3.757340622585113, 4.962003641647955, 5.567301157494507, 7.290135160921093, 4.736782698426181, 5.0343484118273825, 5.862685684930461, 6.086272806254225), # 3
(6.343136148415981, 6.9699251992857745, 6.573892899703036, 7.840288641382569, 7.012144603796492, 3.9597312073986677, 5.2289436685084585, 5.866331861194915, 7.682702045582707, 4.991555897167679, 5.305574134590575, 6.178298392354764, 6.414188632939817), # 4
(6.66456271868351, 7.320257774943588, 6.9043289337525175, 8.234502685720393, 7.36596991669928, 4.158837968091214, 5.491557914725224, 6.160507768524592, 8.068899117981559, 5.242201805918663, 5.572402526547132, 6.488793407234148, 6.736785359632827), # 5
(6.979742147844666, 7.663376740914501, 7.227959528523866, 8.620596820049652, 7.712695774276043, 4.353842003800864, 5.7487657064812625, 6.4486192890024885, 8.447138035236815, 5.487688859352758, 5.833735797178282, 6.792893362476808, 7.052736037699606), # 6
(7.2873790797949685, 7.997840609203132, 7.543425241072635, 8.996949323874462, 8.050880336092554, 4.543924413665721, 5.999486369959585, 6.729456832147552, 8.815830454467644, 5.726985492143586, 6.088476155965268, 7.089320890990929, 7.360713718506519), # 7
(7.586178158429934, 8.322207891814099, 7.849366628454396, 9.361938476698928, 8.379081761714586, 4.7282662968238895, 6.2426392313431975, 7.001810807478725, 9.173388032793206, 5.959060138964774, 6.335525812389321, 7.376798625684702, 7.659391453419917), # 8
(7.874844027645085, 8.635037100752022, 8.144424247724704, 9.713942558027169, 8.69585821070791, 4.906048752413484, 6.47714361681512, 7.264471624514963, 9.518222427332674, 6.182881234489941, 6.573786975931678, 7.654049199466313, 7.947442293806162), # 9
(8.152081331335932, 8.934886748021516, 8.427238655939124, 10.051339847363288, 8.9997678426383, 5.076452879572607, 6.701918852558355, 7.516229692775211, 9.848745295205214, 6.397417213392714, 6.802161856073574, 7.919795245243952, 8.22353929103161), # 10
(8.416594713398005, 9.220315345627206, 8.696450410153215, 10.372508624211397, 9.289368817071534, 5.238659777439368, 6.915884264755916, 7.7558754217784145, 10.163368293529993, 6.601636510346719, 7.019552662296249, 8.17275939592581, 8.486355496462611), # 11
(8.667088817726812, 9.489881405573698, 8.95070006742254, 10.675827168075612, 9.563219293573377, 5.391850545151869, 7.1179591795908115, 7.982199221043521, 10.460503079426179, 6.794507560025572, 7.224861604080934, 8.411664284420068, 8.734563961465534), # 12
(8.902268288217876, 9.74214343986562, 9.188628184802662, 10.959673758460044, 9.819877431709601, 5.5352062818482235, 7.307062923246056, 8.193991500089481, 10.738561310012932, 6.974998797102904, 7.416990890908869, 8.63523254363492, 8.966837737406735), # 13
(9.120837768766716, 9.975659960507588, 9.408875319349146, 11.222426674868792, 10.05790139104599, 5.667908086666534, 7.482114821904661, 8.390042668435246, 10.995954642409421, 7.142078656252334, 7.594842732261284, 8.84218680647856, 9.181849875652563), # 14
(9.321501903268855, 10.188989479504217, 9.610082028117542, 11.462464196805985, 10.275849331148308, 5.789137058744912, 7.642034201749626, 8.569143135599756, 11.23109473373482, 7.29471557214749, 7.757319337619419, 9.031249705859171, 9.37827342756938), # 15
(9.5029653356198, 10.380690508860132, 9.790888868163425, 11.678164603775716, 10.472279411582333, 5.898074297221459, 7.785740388963976, 8.73008331110196, 11.442393241108286, 7.431877979461996, 7.9033229164645125, 9.20114387468494, 9.554781444523545), # 16
(9.663932709715075, 10.549321560579946, 9.949936396542352, 11.867906175282112, 10.645749791913838, 5.993900901234285, 7.9121527097307105, 8.871653604460818, 11.628261821648984, 7.552534312869467, 8.031755678277799, 9.350591945864055, 9.710046977881415), # 17
(9.803108669450204, 10.693441146668274, 10.08586517030988, 12.030067190829278, 10.794818631708589, 6.075797969921503, 8.020190490232851, 8.99264442519526, 11.787112132476096, 7.6556530070435365, 8.141519832540508, 9.478316552304715, 9.842743079009345), # 18
(9.919197858720699, 10.811607779129744, 10.197315746521578, 12.163025929921314, 10.918044090532366, 6.142946602421208, 8.108773056653394, 9.091846182824245, 11.917355830708779, 7.740202496657828, 8.231517588733878, 9.583040326915096, 9.951542799273696), # 19
(10.010904921422082, 10.902379969968962, 10.282928682233003, 12.265160672062354, 11.013984327950944, 6.194527897871518, 8.176819735175362, 9.168049286866717, 12.017404573466198, 7.805151216385958, 8.30065115633915, 9.66348590260339, 10.035119190040824), # 20
(10.076934501449866, 10.964316231190558, 10.341344534499719, 12.334849696756486, 11.081197503530088, 6.229722955410535, 8.223249851981759, 9.220044146841623, 12.085670017867521, 7.849467600901555, 8.34782274483756, 9.718375912277793, 10.092145302677078), # 21
(10.115991242699579, 10.995975074799144, 10.371203860377285, 12.370471283507836, 11.118241776835575, 6.247712874176367, 8.2469827332556, 9.246621172267915, 12.120563821031915, 7.872120084878242, 8.37193456371034, 9.74643298884649, 10.121294188548827), # 22
(10.13039336334264, 10.999723593964335, 10.374923182441702, 12.374930812757203, 11.127732056032597, 6.25, 8.249804002259339, 9.249493827160494, 12.124926234567901, 7.874792272519433, 8.37495803716174, 9.749897576588934, 10.125), # 23
(10.141012413034153, 10.997537037037038, 10.374314814814815, 12.374381944444446, 11.133107613614852, 6.25, 8.248253812636166, 9.2455, 12.124341666666666, 7.87315061728395, 8.37462457912458, 9.749086419753086, 10.125), # 24
(10.15140723021158, 10.993227023319616, 10.373113854595337, 12.373296039094651, 11.138364945594503, 6.25, 8.24519890260631, 9.237654320987655, 12.123186728395062, 7.869918838591678, 8.373963399426362, 9.747485139460448, 10.125), # 25
(10.161577019048034, 10.986859396433472, 10.371336762688616, 12.37168544238683, 11.143503868421105, 6.25, 8.240686718308721, 9.226104938271606, 12.1214762345679, 7.865150708733425, 8.372980483850855, 9.745115683584821, 10.125), # 26
(10.171520983716636, 10.978499999999999, 10.369, 12.369562499999999, 11.148524198544214, 6.25, 8.234764705882354, 9.211, 12.119225, 7.858899999999999, 8.371681818181818, 9.742, 10.125), # 27
(10.181238328390501, 10.968214677640603, 10.366120027434842, 12.366939557613168, 11.153425752413401, 6.25, 8.22748031146615, 9.192487654320988, 12.116447839506172, 7.851220484682213, 8.370073388203018, 9.73816003657979, 10.125), # 28
(10.19072825724275, 10.95606927297668, 10.362713305898492, 12.36382896090535, 11.15820834647822, 6.25, 8.218880981199066, 9.170716049382715, 12.113159567901235, 7.842165935070874, 8.368161179698216, 9.733617741197987, 10.125), # 29
(10.199989974446497, 10.94212962962963, 10.358796296296296, 12.360243055555555, 11.162871797188236, 6.25, 8.209014161220043, 9.145833333333332, 12.109375, 7.83179012345679, 8.365951178451178, 9.728395061728394, 10.125), # 30
(10.209022684174858, 10.926461591220852, 10.354385459533608, 12.356194187242798, 11.167415920993008, 6.25, 8.19792729766804, 9.117987654320988, 12.105108950617284, 7.820146822130773, 8.363449370245666, 9.722513946044812, 10.125), # 31
(10.217825590600954, 10.909131001371742, 10.349497256515773, 12.35169470164609, 11.171840534342095, 6.25, 8.185667836681999, 9.087327160493828, 12.100376234567902, 7.807289803383631, 8.360661740865444, 9.715996342021034, 10.125), # 32
(10.226397897897897, 10.890203703703703, 10.344148148148149, 12.346756944444444, 11.176145453685063, 6.25, 8.172283224400871, 9.054, 12.095191666666667, 7.793272839506173, 8.357594276094275, 9.708864197530863, 10.125), # 33
(10.23473881023881, 10.869745541838133, 10.338354595336076, 12.341393261316872, 11.180330495471466, 6.25, 8.15782090696361, 9.018154320987653, 12.089570061728397, 7.778149702789209, 8.354252961715924, 9.701139460448102, 10.125), # 34
(10.242847531796807, 10.847822359396433, 10.332133058984912, 12.335615997942385, 11.18439547615087, 6.25, 8.142328330509159, 8.979938271604938, 12.083526234567902, 7.761974165523548, 8.350643783514153, 9.692844078646548, 10.125), # 35
(10.250723266745005, 10.824499999999999, 10.3255, 12.3294375, 11.188340212172836, 6.25, 8.12585294117647, 8.9395, 12.077074999999999, 7.7448, 8.346772727272727, 9.684000000000001, 10.125), # 36
(10.258365219256524, 10.799844307270233, 10.318471879286694, 12.322870113168724, 11.192164519986921, 6.25, 8.108442185104494, 8.896987654320988, 12.070231172839506, 7.726680978509374, 8.34264577877541, 9.674629172382259, 10.125), # 37
(10.265772593504476, 10.773921124828533, 10.311065157750342, 12.315926183127573, 11.19586821604269, 6.25, 8.09014350843218, 8.85254938271605, 12.063009567901235, 7.707670873342479, 8.33826892380596, 9.664753543667125, 10.125), # 38
(10.272944593661986, 10.746796296296296, 10.303296296296297, 12.308618055555556, 11.199451116789703, 6.25, 8.071004357298476, 8.806333333333333, 12.055425000000001, 7.687823456790124, 8.333648148148148, 9.654395061728394, 10.125), # 39
(10.279880423902163, 10.718535665294924, 10.295181755829903, 12.300958076131687, 11.202913038677519, 6.25, 8.05107217784233, 8.758487654320989, 12.047492283950618, 7.667192501143119, 8.328789437585733, 9.643575674439873, 10.125), # 40
(10.286579288398128, 10.689205075445816, 10.286737997256516, 12.29295859053498, 11.206253798155702, 6.25, 8.030394416202695, 8.709160493827161, 12.0392262345679, 7.645831778692272, 8.323698777902482, 9.632317329675354, 10.125), # 41
(10.293040391323, 10.658870370370371, 10.277981481481483, 12.284631944444445, 11.209473211673808, 6.25, 8.009018518518518, 8.6585, 12.030641666666668, 7.623795061728395, 8.318382154882155, 9.620641975308642, 10.125), # 42
(10.299262936849892, 10.627597393689987, 10.268928669410151, 12.275990483539095, 11.212571095681403, 6.25, 7.98699193092875, 8.606654320987655, 12.021753395061728, 7.601136122542296, 8.312845554308517, 9.608571559213535, 10.125), # 43
(10.305246129151927, 10.595451989026063, 10.259596021947875, 12.267046553497943, 11.215547266628045, 6.25, 7.964362099572339, 8.553771604938273, 12.0125762345679, 7.577908733424783, 8.307094961965332, 9.596128029263832, 10.125), # 44
(10.310989172402216, 10.5625, 10.25, 12.2578125, 11.218401540963296, 6.25, 7.9411764705882355, 8.5, 12.003124999999999, 7.554166666666667, 8.301136363636363, 9.583333333333332, 10.125), # 45
(10.31649127077388, 10.528807270233196, 10.240157064471878, 12.24830066872428, 11.221133735136716, 6.25, 7.917482490115388, 8.445487654320988, 11.993414506172838, 7.529963694558756, 8.294975745105374, 9.57020941929584, 10.125), # 46
(10.321751628440035, 10.49443964334705, 10.230083676268862, 12.238523405349794, 11.223743665597867, 6.25, 7.893327604292747, 8.390382716049382, 11.983459567901235, 7.505353589391861, 8.288619092156129, 9.55677823502515, 10.125), # 47
(10.326769449573796, 10.459462962962963, 10.219796296296296, 12.228493055555557, 11.22623114879631, 6.25, 7.868759259259259, 8.334833333333334, 11.973275000000001, 7.4803901234567896, 8.28207239057239, 9.543061728395061, 10.125), # 48
(10.331543938348286, 10.42394307270233, 10.209311385459534, 12.218221965020577, 11.228596001181607, 6.25, 7.8438249011538765, 8.278987654320987, 11.96287561728395, 7.455127069044353, 8.275341626137923, 9.529081847279379, 10.125), # 49
(10.336074298936616, 10.387945816186559, 10.198645404663925, 12.207722479423868, 11.230838039203315, 6.25, 7.81857197611555, 8.222993827160494, 11.9522762345679, 7.429618198445358, 8.268432784636488, 9.514860539551899, 10.125), # 50
(10.34035973551191, 10.351537037037037, 10.187814814814814, 12.197006944444444, 11.232957079310998, 6.25, 7.793047930283224, 8.167, 11.941491666666668, 7.403917283950617, 8.261351851851853, 9.50041975308642, 10.125), # 51
(10.344399452247279, 10.314782578875173, 10.176836076817558, 12.186087705761317, 11.234952937954214, 6.25, 7.767300209795852, 8.111154320987653, 11.930536728395062, 7.3780780978509375, 8.254104813567777, 9.485781435756746, 10.125), # 52
(10.348192653315843, 10.27774828532236, 10.165725651577505, 12.174977109053497, 11.23682543158253, 6.25, 7.741376260792383, 8.055604938271605, 11.919426234567903, 7.3521544124371285, 8.246697655568026, 9.470967535436671, 10.125), # 53
(10.351738542890716, 10.2405, 10.154499999999999, 12.1636875, 11.238574376645502, 6.25, 7.715323529411765, 8.000499999999999, 11.908175, 7.3262, 8.239136363636362, 9.456, 10.125), # 54
(10.355036325145022, 10.203103566529492, 10.143175582990398, 12.152231224279834, 11.24019958959269, 6.25, 7.689189461792948, 7.945987654320987, 11.896797839506172, 7.300268632830361, 8.231426923556553, 9.44090077732053, 10.125), # 55
(10.358085204251871, 10.165624828532236, 10.131768861454047, 12.140620627572016, 11.241700886873659, 6.25, 7.663021504074881, 7.892216049382716, 11.885309567901235, 7.274414083219022, 8.223575321112358, 9.425691815272062, 10.125), # 56
(10.360884384384383, 10.12812962962963, 10.120296296296297, 12.128868055555555, 11.243078084937967, 6.25, 7.636867102396514, 7.839333333333334, 11.873725, 7.24869012345679, 8.215587542087542, 9.410395061728394, 10.125), # 57
(10.36343306971568, 10.090683813443073, 10.108774348422497, 12.116985853909464, 11.244331000235174, 6.25, 7.610773702896797, 7.787487654320987, 11.862058950617284, 7.223150525834477, 8.20746957226587, 9.395032464563329, 10.125), # 58
(10.36573046441887, 10.053353223593964, 10.097219478737998, 12.104986368312757, 11.245459449214845, 6.25, 7.584788751714678, 7.736827160493827, 11.850326234567902, 7.197849062642891, 8.1992273974311, 9.379625971650663, 10.125), # 59
(10.367775772667077, 10.016203703703704, 10.085648148148147, 12.092881944444445, 11.246463248326537, 6.25, 7.558959694989106, 7.6875, 11.838541666666668, 7.172839506172839, 8.190867003367003, 9.364197530864198, 10.125), # 60
(10.369568198633415, 9.97930109739369, 10.0740768175583, 12.080684927983539, 11.247342214019811, 6.25, 7.533333978859033, 7.639654320987654, 11.826720061728395, 7.148175628715135, 8.182394375857339, 9.348769090077733, 10.125), # 61
(10.371106946491004, 9.942711248285322, 10.062521947873801, 12.068407664609055, 11.248096162744234, 6.25, 7.507959049463406, 7.5934382716049384, 11.814876234567901, 7.123911202560586, 8.17381550068587, 9.333362597165067, 10.125), # 62
(10.37239122041296, 9.9065, 10.051, 12.056062500000001, 11.248724910949356, 6.25, 7.482882352941176, 7.549, 11.803025, 7.100099999999999, 8.165136363636364, 9.318, 10.125), # 63
(10.373420224572397, 9.870733196159122, 10.039527434842249, 12.043661779835391, 11.249228275084748, 6.25, 7.458151335431292, 7.506487654320988, 11.791181172839506, 7.076795793324188, 8.156362950492579, 9.302703246456334, 10.125), # 64
(10.374193163142438, 9.835476680384087, 10.0281207133059, 12.031217849794238, 11.249606071599967, 6.25, 7.433813443072703, 7.466049382716049, 11.779359567901235, 7.054052354823959, 8.147501247038285, 9.287494284407863, 10.125), # 65
(10.374709240296196, 9.800796296296298, 10.016796296296297, 12.018743055555555, 11.249858116944573, 6.25, 7.409916122004357, 7.427833333333334, 11.767575, 7.031923456790123, 8.138557239057238, 9.272395061728396, 10.125), # 66
(10.374967660206792, 9.766757887517146, 10.005570644718793, 12.006249742798353, 11.24998422756813, 6.25, 7.386506818365206, 7.391987654320989, 11.755842283950617, 7.010462871513489, 8.12953691233321, 9.257427526291723, 10.125), # 67
(10.374791614480825, 9.733248639320323, 9.994405949931412, 11.993641740472357, 11.249877955297345, 6.2498840115836, 7.363515194829646, 7.358343850022862, 11.744087848651121, 6.989620441647166, 8.120285988540376, 9.242530021899743, 10.124875150034294), # 68
(10.373141706924315, 9.699245519713262, 9.982988425925925, 11.980283514492752, 11.248910675381262, 6.248967078189301, 7.340268181346613, 7.325098765432099, 11.731797839506173, 6.968806390704429, 8.10986283891547, 9.227218973359324, 10.12388599537037), # 69
(10.369885787558895, 9.664592459843355, 9.971268432784635, 11.966087124261943, 11.246999314128942, 6.247161255906112, 7.31666013456137, 7.291952446273434, 11.718902892089622, 6.947919524462734, 8.09814888652608, 9.211422761292809, 10.121932334533609), # 70
(10.365069660642929, 9.62931016859153, 9.959250085733881, 11.951073503757382, 11.244168078754136, 6.244495808565767, 7.292701659538988, 7.258915866483768, 11.705422210791038, 6.926960359342639, 8.085187370783862, 9.195152937212715, 10.119039887688615), # 71
(10.358739130434783, 9.593419354838709, 9.946937499999999, 11.935263586956522, 11.240441176470588, 6.2410000000000005, 7.268403361344538, 7.226, 11.691375, 6.905929411764705, 8.07102153110048, 9.17842105263158, 10.115234375), # 72
(10.35094000119282, 9.556940727465816, 9.934334790809327, 11.918678307836823, 11.23584281449205, 6.236703094040542, 7.243775845043092, 7.193215820759031, 11.676780464106082, 6.884827198149493, 8.055694606887588, 9.161238659061919, 10.110541516632374), # 73
(10.341718077175404, 9.519894995353777, 9.921446073388202, 11.901338600375738, 11.230397200032275, 6.231634354519128, 7.218829715699722, 7.160574302697759, 11.661657807498857, 6.863654234917561, 8.039249837556856, 9.143617308016267, 10.104987032750344), # 74
(10.331119162640901, 9.482302867383511, 9.908275462962962, 11.883265398550725, 11.224128540305012, 6.22582304526749, 7.1935755783795, 7.128086419753086, 11.6460262345679, 6.84241103848947, 8.021730462519935, 9.125568551007147, 10.098596643518519), # 75
(10.319189061847677, 9.44418505243595, 9.894827074759945, 11.864479636339238, 11.217061042524005, 6.219298430117361, 7.168024038147495, 7.095763145861912, 11.629904949702789, 6.821098125285779, 8.003179721188491, 9.107103939547082, 10.091396069101508), # 76
(10.305973579054093, 9.40556225939201, 9.881105024005485, 11.845002247718732, 11.209218913903008, 6.212089772900472, 7.142185700068779, 7.063615454961135, 11.613313157293096, 6.7997160117270505, 7.983640852974187, 9.088235025148606, 10.083411029663925), # 77
(10.291518518518519, 9.366455197132618, 9.867113425925925, 11.824854166666666, 11.200626361655774, 6.204226337448559, 7.116071169208425, 7.031654320987655, 11.596270061728394, 6.7782652142338415, 7.9631570972886765, 9.068973359324238, 10.074667245370371), # 78
(10.275869684499314, 9.326884574538697, 9.8528563957476, 11.804056327160493, 11.191307592996047, 6.195737387593354, 7.089691050631501, 6.9998907178783725, 11.578794867398262, 6.756746249226714, 7.941771693543622, 9.049330493586504, 10.065190436385459), # 79
(10.259072881254847, 9.286871100491172, 9.838338048696844, 11.782629663177671, 11.181286815137579, 6.18665218716659, 7.063055949403081, 6.968335619570188, 11.560906778692273, 6.7351596331262265, 7.919527881150688, 9.029317979447935, 10.0550063228738), # 80
(10.241173913043479, 9.246435483870968, 9.8235625, 11.760595108695654, 11.170588235294117, 6.177, 7.036176470588235, 6.937, 11.542625, 6.713505882352941, 7.8964688995215315, 9.008947368421053, 10.044140624999999), # 81
(10.222218584123576, 9.205598433559008, 9.808533864883403, 11.737973597691894, 11.159236060679415, 6.166810089925317, 7.009063219252036, 6.90589483310471, 11.52396873571102, 6.691785513327416, 7.872637988067813, 8.988230212018387, 10.03261906292867), # 82
(10.202252698753504, 9.164380658436214, 9.793256258573388, 11.714786064143853, 11.147254498507221, 6.156111720774272, 6.981726800459553, 6.875031092821216, 11.504957190214906, 6.669999042470211, 7.848078386201194, 8.967178061752461, 10.020467356824417), # 83
(10.181322061191626, 9.122802867383513, 9.777733796296296, 11.691053442028986, 11.134667755991286, 6.144934156378601, 6.954177819275858, 6.844419753086419, 11.485609567901234, 6.648146986201889, 7.822833333333333, 8.945802469135803, 10.007711226851852), # 84
(10.159472475696308, 9.080885769281826, 9.761970593278463, 11.666796665324746, 11.121500040345357, 6.133306660570035, 6.926426880766024, 6.814071787837221, 11.465945073159578, 6.626229860943005, 7.796946068875894, 8.924114985680937, 9.994376393175584), # 85
(10.136749746525913, 9.03865007301208, 9.745970764746229, 11.64203666800859, 11.107775558783183, 6.121258497180309, 6.89848458999512, 6.783998171010516, 11.445982910379517, 6.604248183114124, 7.770459832240534, 8.902127162900394, 9.98048857596022), # 86
(10.113199677938807, 8.996116487455197, 9.729738425925925, 11.61679438405797, 11.09351851851852, 6.108818930041152, 6.870361552028219, 6.75420987654321, 11.425742283950619, 6.582202469135802, 7.743417862838915, 8.879850552306692, 9.96607349537037), # 87
(10.088868074193357, 8.9533057214921, 9.713277692043896, 11.59109074745035, 11.07875312676511, 6.096017222984301, 6.842068371930391, 6.724717878372199, 11.40524239826246, 6.560093235428601, 7.715863400082698, 8.857296705412365, 9.951156871570646), # 88
(10.063800739547922, 8.910238484003717, 9.696592678326475, 11.564946692163177, 11.063503590736707, 6.082882639841488, 6.813615654766708, 6.695533150434385, 11.384502457704619, 6.537920998413083, 7.687839683383544, 8.834477173729935, 9.935764424725651), # 89
(10.03804347826087, 8.866935483870968, 9.6796875, 11.538383152173914, 11.04779411764706, 6.069444444444445, 6.785014005602241, 6.666666666666666, 11.363541666666668, 6.515686274509804, 7.65938995215311, 8.81140350877193, 9.919921875), # 90
(10.011642094590563, 8.823417429974777, 9.662566272290809, 11.511421061460013, 11.031648914709915, 6.055731900624904, 6.756274029502062, 6.638129401005944, 11.342379229538182, 6.4933895801393255, 7.63055744580306, 8.788087262050874, 9.903654942558298), # 91
(9.984642392795372, 8.779705031196071, 9.64523311042524, 11.484081353998926, 11.015092189139029, 6.041774272214601, 6.727406331531242, 6.609932327389118, 11.321034350708734, 6.471031431722209, 7.601385403745053, 8.764539985079297, 9.886989347565157), # 92
(9.957090177133654, 8.735818996415771, 9.62769212962963, 11.456384963768118, 10.998148148148148, 6.027600823045267, 6.69842151675485, 6.582086419753087, 11.299526234567901, 6.448612345679011, 7.57191706539075, 8.74077322936972, 9.869950810185184), # 93
(9.92903125186378, 8.691780034514801, 9.609947445130317, 11.428352824745035, 10.98084099895102, 6.0132408169486355, 6.669330190237961, 6.554602652034752, 11.277874085505259, 6.426132838430297, 7.54219567015181, 8.716798546434674, 9.85256505058299), # 94
(9.90051142124411, 8.647608854374088, 9.592003172153635, 11.400005870907139, 10.963194948761398, 5.9987235177564395, 6.640142957045644, 6.527491998171011, 11.25609710791038, 6.403593426396621, 7.512264457439896, 8.69262748778668, 9.834857788923182), # 95
(9.871576489533012, 8.603326164874554, 9.573863425925927, 11.371365036231884, 10.945234204793028, 5.984078189300411, 6.610870422242971, 6.500765432098766, 11.234214506172838, 6.3809946259985475, 7.482166666666667, 8.668271604938273, 9.816854745370371), # 96
(9.842272260988848, 8.558952674897121, 9.555532321673525, 11.342451254696725, 10.926982974259664, 5.969334095412284, 6.581523190895013, 6.474433927754916, 11.212245484682214, 6.358336953656634, 7.451945537243782, 8.64374244940197, 9.798581640089164), # 97
(9.812644539869984, 8.514509093322713, 9.53701397462277, 11.31328546027912, 10.908465464375052, 5.954520499923793, 6.552111868066842, 6.44850845907636, 11.190209247828074, 6.335620925791441, 7.421644308582906, 8.619051572690298, 9.78006419324417), # 98
(9.782739130434782, 8.470016129032258, 9.5183125, 11.283888586956522, 10.889705882352942, 5.939666666666667, 6.52264705882353, 6.423, 11.168125, 6.312847058823529, 7.391306220095694, 8.59421052631579, 9.761328125), # 99
(9.752601836941611, 8.425494490906676, 9.49943201303155, 11.254281568706388, 10.870728435407084, 5.924801859472641, 6.493139368230145, 6.3979195244627345, 11.146011945587563, 6.290015869173458, 7.36097451119381, 8.569230861790967, 9.742399155521262), # 100
(9.722278463648834, 8.380964887826895, 9.480376628943759, 11.224485339506174, 10.85155733075123, 5.909955342173449, 6.463599401351762, 6.3732780064014625, 11.123889288980338, 6.267127873261788, 7.330692421288912, 8.544124130628353, 9.723303004972564), # 101
(9.691814814814816, 8.336448028673836, 9.461150462962962, 11.194520833333334, 10.832216775599129, 5.895156378600824, 6.43403776325345, 6.349086419753086, 11.1017762345679, 6.244183587509078, 7.300503189792663, 8.518901884340481, 9.704065393518519), # 102
(9.661256694697919, 8.291964622328422, 9.4417576303155, 11.164408984165325, 10.812730977164529, 5.880434232586496, 6.40446505900028, 6.325355738454504, 11.079691986739826, 6.221183528335889, 7.270450056116723, 8.493575674439873, 9.68471204132373), # 103
(9.63064990755651, 8.247535377671579, 9.422202246227709, 11.134170725979603, 10.79312414266118, 5.865818167962201, 6.374891893657326, 6.302096936442616, 11.057655749885688, 6.19812821216278, 7.24057625967275, 8.468157052439054, 9.665268668552812), # 104
(9.600040257648953, 8.203181003584229, 9.402488425925926, 11.103826992753623, 10.773420479302832, 5.851337448559671, 6.345328872289658, 6.279320987654321, 11.035686728395062, 6.175018155410313, 7.210925039872408, 8.442657569850553, 9.64576099537037), # 105
(9.569473549233614, 8.158922208947299, 9.382620284636488, 11.073398718464842, 10.753644194303236, 5.837021338210638, 6.315786599962345, 6.25703886602652, 11.01380412665752, 6.151853874499045, 7.181539636127355, 8.417088778186894, 9.626214741941014), # 106
(9.538995586568856, 8.11477970264171, 9.362601937585735, 11.042906837090714, 10.733819494876139, 5.822899100746838, 6.286275681740461, 6.235261545496114, 10.992027149062643, 6.128635885849539, 7.152463287849252, 8.391462228960604, 9.606655628429355), # 107
(9.508652173913044, 8.070774193548388, 9.3424375, 11.012372282608696, 10.713970588235293, 5.809, 6.256806722689075, 6.214, 10.970375, 6.105364705882353, 7.1237392344497605, 8.365789473684211, 9.587109375), # 108
(9.478489115524543, 8.026926390548255, 9.322131087105625, 10.98181598899624, 10.69412168159445, 5.795353299801859, 6.227390327873262, 6.193265203475081, 10.948866883859168, 6.082040851018047, 7.09541071534054, 8.340082063870238, 9.567601701817559), # 109
(9.448552215661715, 7.983257002522237, 9.301686814128946, 10.951258890230811, 10.674296982167354, 5.7819882639841484, 6.198037102358089, 6.173068129858253, 10.92752200502972, 6.058664837677183, 7.06752096993325, 8.314351551031214, 9.54815832904664), # 110
(9.41888727858293, 7.9397867383512555, 9.281108796296298, 10.920721920289855, 10.654520697167756, 5.768934156378601, 6.168757651208631, 6.153419753086419, 10.906359567901236, 6.035237182280319, 7.040113237639553, 8.288609486679663, 9.528804976851852), # 111
(9.38954010854655, 7.896536306916234, 9.26040114883402, 10.890226013150832, 10.634817033809409, 5.756220240816949, 6.139562579489958, 6.134331047096479, 10.885398776863282, 6.011758401248016, 7.013230757871109, 8.26286742232811, 9.509567365397805), # 112
(9.360504223703044, 7.853598618785952, 9.239617828252069, 10.85983388249204, 10.615175680173705, 5.7438697692145135, 6.1105259636567695, 6.115852568780606, 10.86471281125862, 5.988304736612729, 6.9869239061528665, 8.237192936504428, 9.490443900843221), # 113
(9.331480897900065, 7.811397183525536, 9.219045675021619, 10.829789421277336, 10.595393354566326, 5.731854608529901, 6.082018208410579, 6.09821125950512, 10.84461903571306, 5.965315167912783, 6.961244337113197, 8.211912172112974, 9.471275414160035), # 114
(9.302384903003995, 7.769947198683046, 9.198696932707318, 10.800084505181779, 10.5754076778886, 5.7201435124987645, 6.054059650191562, 6.081402654278709, 10.82512497866879, 5.942825327988077, 6.936154511427094, 8.187037582558851, 9.452006631660376), # 115
(9.273179873237634, 7.729188281291702, 9.178532189983873, 10.770666150266404, 10.555188526383779, 5.708708877287098, 6.026604817527893, 6.065380312898993, 10.80618133922783, 5.920793358449547, 6.911605931271481, 8.162523197487346, 9.43260725975589), # 116
(9.243829442823772, 7.689060048384721, 9.158512035525986, 10.741481372592244, 10.53470577629511, 5.6975230990608905, 5.9996082389477525, 6.050097795163585, 10.787738816492203, 5.899177400908129, 6.887550098823283, 8.13832304654375, 9.413047004858225), # 117
(9.214297245985211, 7.649502116995324, 9.138597058008367, 10.712477188220333, 10.513929303865842, 5.686558573986138, 5.973024442979315, 6.0355086608700965, 10.769748109563935, 5.877935596974759, 6.863938516259424, 8.11439115937335, 9.393295573379024), # 118
(9.184546916944742, 7.610454104156729, 9.118747846105723, 10.683600613211706, 10.492828985339221, 5.675787698228833, 5.946807958150756, 6.021566469816145, 10.752159917545043, 5.857026088260372, 6.840722685756828, 8.090681565621434, 9.373322671729932), # 119
(9.154542089925162, 7.571855626902158, 9.098924988492762, 10.654798663627394, 10.471374696958497, 5.665182867954965, 5.920913312990253, 6.008224781799343, 10.734924939537558, 5.836407016375905, 6.817854109492416, 8.067148294933297, 9.353098006322597), # 120
(9.124246399149268, 7.533646302264829, 9.079089073844187, 10.626018355528434, 10.449536314966918, 5.6547164793305305, 5.89529503602598, 5.995437156617307, 10.717993874643499, 5.816036522932296, 6.795284289643116, 8.043745376954222, 9.33259128356866), # 121
(9.093623478839854, 7.495765747277961, 9.059200690834711, 10.597206704975855, 10.427283715607734, 5.644360928521519, 5.869907655786117, 5.983157154067649, 10.70131742196489, 5.795872749540477, 6.772964728385851, 8.0204268413295, 9.31177220987977), # 122
(9.062636963219719, 7.458153578974774, 9.039220428139036, 10.568310728030694, 10.40458677512419, 5.634088611693925, 5.844705700798839, 5.971338333947983, 10.684846280603754, 5.775873837811387, 6.750846927897544, 7.997146717704421, 9.290610491667572), # 123
(9.031250486511654, 7.420749414388487, 9.01910887443187, 10.539277440753986, 10.381415369759537, 5.623871925013739, 5.819643699592319, 5.959934256055926, 10.668531149662115, 5.755997929355961, 6.728882390355119, 7.973859035724275, 9.269075835343711), # 124
(8.999427682938459, 7.38349287055232, 8.998826618387923, 10.51005385920676, 10.357739375757022, 5.613683264646956, 5.794676180694739, 5.948898480189091, 10.652322728241993, 5.736203165785134, 6.707022617935501, 7.950517825034348, 9.247137947319828), # 125
(8.967132186722928, 7.346323564499494, 8.978334248681898, 10.480586999450054, 10.333528669359893, 5.603495026759568, 5.76975767263427, 5.938184566145092, 10.636171715445418, 5.7164476887098425, 6.685219112815613, 7.927077115279934, 9.224766534007578), # 126
(8.93432763208786, 7.309181113263224, 8.957592353988504, 10.450823877544899, 10.308753126811398, 5.593279607517565, 5.744842703939094, 5.927746073721545, 10.620028810374407, 5.696689639741024, 6.6634233771723785, 7.903490936106316, 9.201931301818599), # 127
(8.900977653256046, 7.272005133876735, 8.93656152298245, 10.420711509552332, 10.28338262435479, 5.583009403086944, 5.719885803137382, 5.917536562716062, 10.603844712130984, 5.6768871604896125, 6.641586913182724, 7.879713317158788, 9.178601957164537), # 128
(8.867045884450281, 7.234735243373241, 8.91520234433844, 10.390196911533382, 10.257387038233311, 5.572656809633695, 5.694841498757313, 5.90750959292626, 10.587570119817174, 5.656998392566545, 6.619661223023571, 7.855698288082636, 9.154748206457038), # 129
(8.832495959893366, 7.197311058785966, 8.893475406731179, 10.359227099549086, 10.230736244690213, 5.562194223323808, 5.669664319327063, 5.89761872414975, 10.571155732535, 5.636981477582757, 6.5975978088718445, 7.831399878523152, 9.130339756107748), # 130
(8.797291513808094, 7.159672197148127, 8.87134129883538, 10.327749089660475, 10.203400119968745, 5.55159404032328, 5.644308793374809, 5.88781751618415, 10.554552249386486, 5.616794557149185, 6.575348172904468, 7.806772118125624, 9.105346312528312), # 131
(8.76139618041726, 7.121758275492944, 8.848760609325746, 10.295709897928587, 10.175348540312154, 5.540828656798102, 5.618729449428725, 5.878059528827073, 10.537710369473654, 5.596395772876765, 6.552863817298364, 7.781769036535342, 9.079737582130376), # 132
(8.724773593943663, 7.083508910853635, 8.825693926876983, 10.263056540414452, 10.146551381963686, 5.529870468914266, 5.592880816016989, 5.868298321876132, 10.520580791898526, 5.575743266376432, 6.53009624423046, 7.756344663397592, 9.053483271325586), # 133
(8.687387388610095, 7.044863720263423, 8.802101840163804, 10.229736033179103, 10.116978521166592, 5.518691872837765, 5.566717421667779, 5.858487455128944, 10.503114215763128, 5.5547951792591235, 6.506996955877678, 7.730453028357666, 9.026553086525583), # 134
(8.649201198639354, 7.005762320755524, 8.777944937860909, 10.195695392283579, 10.08659983416412, 5.507265264734592, 5.540193794909268, 5.84858048838312, 10.48526134016948, 5.533509653135776, 6.483517454416942, 7.704048161060852, 8.99891673414202), # 135
(8.610178658254235, 6.966144329363159, 8.753183808643008, 10.160881633788906, 10.055385197199517, 5.495563040770739, 5.513264464269635, 5.838530981436277, 10.466972864219606, 5.511844829617322, 6.459609242025177, 7.677084091152441, 8.970543920586536), # 136
(8.570283401677534, 6.925949363119547, 8.72777904118481, 10.125241773756125, 10.023304486516034, 5.483557597112198, 5.485883958277055, 5.828292494086029, 10.448199487015533, 5.4897588503147015, 6.435223820879306, 7.649514848277719, 8.941404352270776), # 137
(8.529479063132047, 6.885117039057908, 8.701691224161017, 10.088722828246263, 9.990327578356919, 5.471221329924964, 5.458006805459704, 5.81781858612999, 10.428891907659281, 5.4672098568388465, 6.410312693156252, 7.621294462081978, 8.91146773560639), # 138
(8.487729276840568, 6.843586974211461, 8.67488094624634, 10.051271813320358, 9.956424348965415, 5.458526635375026, 5.429587534345759, 5.807062817365774, 10.409000825252871, 5.444155990800697, 6.38482736103294, 7.592376962210506, 8.880703777005019), # 139
(8.444997677025897, 6.801298785613425, 8.647308796115487, 10.012835745039444, 9.92156467458478, 5.445445909628379, 5.400580673463397, 5.795978747590996, 10.388476938898332, 5.420555393811186, 6.358719326686294, 7.562716378308592, 8.849082182878314), # 140
(8.40124789791083, 6.758192090297021, 8.61893536244316, 9.973361639464553, 9.885718431458253, 5.431951548851015, 5.370940751340795, 5.78451993660327, 10.36727094769768, 5.396366207481251, 6.331940092293238, 7.532266740021525, 8.816572659637913), # 141
(8.356443573718156, 6.714206505295466, 8.58972123390407, 9.93279651265672, 9.848855495829087, 5.418015949208927, 5.340622296506126, 5.772639944200211, 10.345333550752942, 5.371546573421828, 6.304441160030697, 7.500982076994594, 8.783144913695466), # 142
(8.310548338670674, 6.669281647641981, 8.559626999172925, 9.891087380676975, 9.810945743940529, 5.403611506868106, 5.3095798374875685, 5.760292330179432, 10.322615447166147, 5.3460546332438525, 6.276174032075593, 7.4688164188730894, 8.748768651462617), # 143
(8.263525826991184, 6.623357134369786, 8.528613246924428, 9.848181259586356, 9.771959052035829, 5.388710617994547, 5.277767902813299, 5.747430654338549, 10.29906733603931, 5.31984852855826, 6.247090210604851, 7.435723795302299, 8.713413579351014), # 144
(8.215339672902477, 6.576372582512099, 8.496640565833289, 9.804025165445895, 9.731865296358233, 5.3732856787542405, 5.245141021011493, 5.734008476475176, 10.274639916474454, 5.292886400975988, 6.217141197795395, 7.401658235927513, 8.6770494037723), # 145
(8.16595351062735, 6.528267609102142, 8.463669544574216, 9.758566114316626, 9.690634353150992, 5.35730908531318, 5.21165372061033, 5.719979356386927, 10.249283887573606, 5.2651263921079705, 6.186278495824149, 7.3665737703940195, 8.639645831138118), # 146
(8.1153309743886, 6.47898183117313, 8.42966077182191, 9.71175112225958, 9.648236098657351, 5.340753233837358, 5.177260530137981, 5.705296853871415, 10.22294994843879, 5.236526643565146, 6.154453606868036, 7.3304244283471105, 8.601172567860118), # 147
(8.063435698409021, 6.428454865758288, 8.394574836251083, 9.663527205335797, 9.604640409120561, 5.323590520492767, 5.1419159781226265, 5.689914528726257, 10.195588798172029, 5.207045296958447, 6.1216180331039824, 7.29316423943207, 8.561599320349941), # 148
(8.010231316911412, 6.37662632989083, 8.358372326536443, 9.613841379606303, 9.55981716078387, 5.3057933414453995, 5.105574593092441, 5.673785940749067, 10.167151135875338, 5.176640493898813, 6.08772327670891, 7.254747233294191, 8.520895795019237), # 149
(7.955681464118564, 6.323435840603979, 8.321013831352694, 9.562640661132138, 9.513736229890526, 5.287334092861249, 5.0681909035756005, 5.656864649737456, 10.137587660650752, 5.1452703759971765, 6.0527208398597425, 7.215127439578763, 8.479031698279647), # 150
(7.899749774253275, 6.268823014930954, 8.282459939374542, 9.50987206597433, 9.466367492683776, 5.268185170906305, 5.029719438100283, 5.639104215489043, 10.106849071600289, 5.112893084864478, 6.016562224733405, 7.174258887931072, 8.435976736542818), # 151
(7.842399881538343, 6.212727469904973, 8.242671239276701, 9.455482610193918, 9.417680825406869, 5.2483189717465635, 4.9901147251946645, 5.620458197801441, 10.07488606782597, 5.079466762111649, 5.979198933506821, 7.132095607996409, 8.391700616220398), # 152
(7.78359542019656, 6.155088822559256, 8.201608319733868, 9.399419309851933, 9.367646104303056, 5.2277078915480155, 4.949331293386919, 5.600880156472262, 10.041649348429823, 5.044949549349629, 5.940582468356916, 7.088591629420064, 8.346173043724027), # 153
(7.723300024450729, 6.095846689927024, 8.159231769420758, 9.34162918100941, 9.31623320561558, 5.206324326476654, 4.907323671205228, 5.580323651299123, 10.007089612513866, 5.009299588189353, 5.900664331460612, 7.043700981847325, 8.299363725465357), # 154
(7.6614773285236355, 6.034940689041495, 8.115502177012075, 9.282059239727378, 9.263412005587696, 5.184140672698471, 4.864046387177761, 5.558742242079636, 9.971157559180128, 4.972475020241754, 5.859396024994833, 6.997377694923482, 8.251242367856026), # 155
(7.598090966638081, 5.972310436935888, 8.070380131182526, 9.220656502066875, 9.209152380462648, 5.161129326379461, 4.8194539698327, 5.5360894886114185, 9.933803887530626, 4.934433987117773, 5.816729051136504, 6.949575798293822, 8.201778677307685), # 156
(7.533104573016862, 5.907895550643423, 8.023826220606818, 9.157367984088937, 9.153424206483685, 5.137262683685614, 4.773500947698219, 5.512318950692082, 9.894979296667389, 4.895134630428341, 5.772614912062549, 6.900249321603637, 8.150942360231976), # 157
(7.464680946405239, 5.840453120772258, 7.973591953902355, 9.089769581651243, 9.093681105870997, 5.11102447631711, 4.725106720927857, 5.485796952349372, 9.851662091599097, 4.8533659162911436, 5.7255957525389425, 6.847599564194339, 8.096485859415345), # 158
(7.382286766978402, 5.763065319599478, 7.906737818402988, 9.003977158788453, 9.015191309781628, 5.073689648007103, 4.668212763385716, 5.4472135327643825, 9.786427261222144, 4.802280994098745, 5.667416935618994, 6.781362523683108, 8.025427646920194), # 159
(7.284872094904309, 5.675096728540714, 7.821920957955888, 8.89857751040886, 8.916420131346795, 5.024341296047684, 4.602243748383784, 5.3955991895273465, 9.697425227228651, 4.741205651862893, 5.59725950860954, 6.700501948887847, 7.93642060889358), # 160
(7.17322205458596, 5.577120868080469, 7.720046971910309, 8.774572503756728, 8.798393124282113, 4.963577241570314, 4.527681446006876, 5.33160053310978, 9.585829766999018, 4.6706581931709374, 5.515741654599707, 6.605767468907571, 7.830374044819097), # 161
(7.048121770426357, 5.469711258703239, 7.602021459615496, 8.632964006076326, 8.662135842303204, 4.891995305706455, 4.445007626339809, 5.255864173983202, 9.452814657913637, 4.5911569216102315, 5.42348155667862, 6.497908712841293, 7.708197254180333), # 162
(6.9103563668284975, 5.353441420893524, 7.468750020420702, 8.474753884611934, 8.508673839125688, 4.810193309587572, 4.354704059467401, 5.169036722619125, 9.299553677352906, 4.503220140768125, 5.321097397935408, 6.3776753097880325, 7.570799536460879), # 163
(6.760710968195384, 5.228884875135821, 7.321138253675176, 8.300944006607818, 8.339032668465189, 4.718769074345129, 4.257252515474466, 5.071764789489069, 9.127220602697223, 4.407366154231968, 5.209207361459196, 6.245816888846803, 7.419090191144328), # 164
(6.599970698930017, 5.096615141914632, 7.160091758728169, 8.112536239308252, 8.154237884037324, 4.618320421110586, 4.153134764445822, 4.964694985064546, 8.93698921132698, 4.3041132655891134, 5.088429630339111, 6.10308307911662, 7.25397851771427), # 165
(6.428920683435397, 4.957205741714454, 6.9865161349289275, 7.910532449957501, 7.955315039557714, 4.509445171015408, 4.042832576466286, 4.848473919817077, 8.730033280622573, 4.193979778426912, 4.959382387664279, 5.950223509696501, 7.0763738156542955), # 166
(6.248346046114523, 4.811230195019787, 6.801316981626704, 7.695934505799843, 7.74328968874198, 4.392741145191058, 3.9268277216206746, 4.723748204218176, 8.5075265879644, 4.077483996332714, 4.822683816523827, 5.7879878096854585, 6.887185384447996), # 167
(6.059031911370395, 4.659262022315128, 6.605399898170748, 7.469744274079546, 7.519187385305742, 4.268806164768999, 3.805601969993804, 4.5911644487393595, 8.270642910732855, 3.955144222893872, 4.678952100006881, 5.617125608182511, 6.6873225235789615), # 168
(5.861763403606015, 4.501874744084979, 6.399670483910309, 7.232963622040883, 7.28403368296462, 4.138238050880695, 3.6796370916704917, 4.451369263852145, 8.020556026308338, 3.8274787616977366, 4.528805421202568, 5.438386534286672, 6.477694532530785), # 169
(5.657325647224384, 4.339641880813837, 6.185034338194635, 6.98659441692812, 7.038854135434233, 4.001634624657607, 3.549414856735553, 4.305009260028047, 7.7584397120712385, 3.6950059163316578, 4.372861963200016, 5.252520217096959, 6.259210710787055), # 170
(5.4465037666285, 4.173136952986201, 5.962397060372978, 6.731638525985535, 6.784674296430206, 3.8595937072311983, 3.4154170352738054, 4.152731047738583, 7.485467745401956, 3.5582439903829886, 4.211739909088348, 5.060276285712386, 6.032780357831365), # 171
(5.230082886221365, 4.002933481086569, 5.7326642497945866, 6.4690978164573965, 6.5225197196681535, 3.7127131197329337, 3.2781253973700655, 3.9951812374552707, 7.202813903680886, 3.41771128743908, 4.046057441956694, 4.862404369231971, 5.799312773147303), # 172
(5.00884813040598, 3.8296049855994423, 5.4967415058087115, 6.1999741555879755, 6.253415958863702, 3.5615906832942748, 3.1380217131091497, 3.8330064396496235, 6.911651964288422, 3.2739261110872815, 3.8764327448941778, 4.659654096754725, 5.5597172562184625), # 173
(4.783584623585344, 3.653724987009318, 5.2555344277646014, 5.9252694106215404, 5.978388567732466, 3.406824219046685, 2.9955877525758754, 3.6668532647931604, 6.613155704604964, 3.1274067649149466, 3.7034840009899277, 4.452775097379668, 5.314903106528433), # 174
(4.555077490162455, 3.4758670058006946, 5.009948615011508, 5.645985448802367, 5.698463099990069, 3.2490115481216284, 2.851305285855058, 3.497368323357396, 6.308498902010905, 2.9786715525094243, 3.5278293933330693, 4.242517000205814, 5.0657796235608075), # 175
(4.324111854540319, 3.296604562458073, 4.760889666898678, 5.363124137374725, 5.41466510935213, 3.0887504916505666, 2.705656083031515, 3.325198225813849, 5.998855333886642, 2.828238777458067, 3.35008710501273, 4.029629434332179, 4.813256106799174), # 176
(4.0914728411219325, 3.1165111774659513, 4.5092631827753635, 5.077687343582883, 5.128020149534273, 2.9266388707649633, 2.5591219141900625, 3.1509895826340326, 5.68539877761257, 2.6766267433482245, 3.1708753191180357, 3.8148620288577786, 4.5582418557271245), # 177
(3.8579455743102966, 2.9361603713088282, 4.255974761990814, 4.790676934671116, 4.8395537742521135, 2.7632745065962827, 2.4121845494155174, 2.9753890042894655, 5.3693030105690855, 2.52435375376725, 2.9908122187381125, 3.598964412881627, 4.301646169828252), # 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 = (
(14, 8, 6, 8, 8, 0, 0, 1, 4, 0, 0, 2, 0, 7, 3, 3, 4, 3, 2, 0, 1, 0, 2, 2, 0, 0), # 0
(19, 13, 12, 13, 11, 2, 5, 3, 7, 5, 1, 3, 0, 14, 9, 8, 7, 11, 7, 1, 3, 2, 3, 2, 0, 0), # 1
(24, 22, 16, 15, 18, 6, 7, 4, 9, 5, 1, 3, 0, 24, 12, 13, 8, 17, 10, 4, 5, 5, 4, 2, 0, 0), # 2
(33, 25, 21, 17, 25, 7, 13, 6, 11, 9, 1, 4, 0, 36, 18, 15, 16, 25, 20, 5, 7, 5, 6, 4, 0, 0), # 3
(41, 32, 28, 27, 30, 7, 15, 7, 14, 10, 1, 4, 0, 44, 23, 19, 17, 28, 22, 8, 7, 5, 7, 5, 0, 0), # 4
(46, 36, 33, 30, 34, 10, 18, 12, 16, 10, 4, 4, 0, 50, 28, 26, 20, 35, 23, 10, 10, 8, 8, 8, 2, 0), # 5
(53, 40, 42, 39, 37, 14, 24, 13, 18, 13, 5, 4, 0, 56, 34, 32, 27, 37, 25, 14, 11, 8, 11, 9, 3, 0), # 6
(60, 45, 51, 42, 44, 18, 25, 18, 19, 14, 7, 5, 0, 60, 37, 40, 29, 45, 26, 19, 13, 10, 12, 9, 3, 0), # 7
(74, 51, 55, 51, 53, 21, 27, 18, 20, 16, 7, 5, 0, 65, 43, 45, 34, 52, 29, 20, 18, 14, 13, 10, 3, 0), # 8
(83, 58, 59, 61, 59, 24, 30, 18, 21, 18, 7, 5, 0, 69, 48, 51, 36, 59, 34, 21, 18, 18, 14, 12, 4, 0), # 9
(91, 63, 63, 70, 68, 29, 35, 24, 24, 18, 7, 6, 0, 75, 57, 58, 41, 65, 40, 22, 22, 22, 17, 13, 4, 0), # 10
(102, 69, 72, 80, 73, 32, 41, 25, 25, 19, 7, 6, 0, 86, 63, 61, 43, 76, 45, 24, 23, 26, 20, 14, 4, 0), # 11
(111, 73, 79, 85, 82, 36, 44, 27, 28, 20, 9, 7, 0, 91, 73, 70, 48, 88, 49, 29, 29, 30, 26, 18, 4, 0), # 12
(121, 80, 88, 93, 90, 38, 47, 30, 31, 21, 11, 8, 0, 98, 83, 74, 52, 93, 55, 31, 31, 35, 28, 20, 5, 0), # 13
(130, 93, 98, 105, 96, 39, 52, 37, 36, 26, 12, 8, 0, 105, 89, 78, 63, 102, 62, 36, 31, 38, 31, 22, 5, 0), # 14
(144, 103, 112, 112, 106, 45, 54, 42, 41, 26, 13, 9, 0, 109, 95, 85, 70, 107, 65, 44, 36, 44, 37, 23, 5, 0), # 15
(154, 112, 123, 120, 111, 48, 59, 47, 44, 27, 13, 11, 0, 117, 104, 93, 77, 119, 68, 46, 38, 51, 40, 24, 5, 0), # 16
(167, 120, 136, 128, 118, 51, 62, 49, 49, 28, 13, 11, 0, 120, 112, 98, 82, 124, 70, 49, 42, 56, 43, 25, 7, 0), # 17
(175, 130, 143, 135, 121, 56, 68, 57, 53, 31, 16, 12, 0, 131, 120, 104, 95, 137, 73, 57, 42, 62, 44, 26, 8, 0), # 18
(180, 143, 155, 146, 127, 61, 72, 59, 54, 33, 19, 13, 0, 139, 125, 112, 103, 144, 82, 61, 44, 62, 48, 29, 8, 0), # 19
(195, 156, 160, 150, 134, 63, 78, 63, 58, 37, 21, 16, 0, 157, 132, 120, 107, 150, 85, 64, 47, 66, 50, 30, 9, 0), # 20
(204, 171, 165, 159, 143, 66, 85, 65, 64, 37, 22, 18, 0, 167, 141, 130, 118, 158, 90, 66, 52, 69, 51, 31, 9, 0), # 21
(214, 180, 177, 164, 154, 69, 89, 70, 70, 38, 22, 19, 0, 176, 150, 133, 122, 173, 98, 71, 54, 72, 53, 34, 12, 0), # 22
(222, 187, 180, 170, 156, 72, 91, 74, 75, 40, 24, 21, 0, 182, 155, 138, 123, 185, 104, 73, 57, 75, 57, 35, 16, 0), # 23
(228, 194, 189, 179, 164, 78, 94, 80, 81, 42, 24, 22, 0, 194, 166, 146, 132, 194, 114, 75, 59, 81, 57, 37, 20, 0), # 24
(243, 207, 197, 188, 173, 81, 99, 85, 86, 42, 26, 23, 0, 202, 175, 157, 141, 202, 121, 77, 60, 83, 62, 39, 20, 0), # 25
(253, 213, 206, 192, 180, 84, 103, 91, 89, 43, 26, 24, 0, 210, 184, 162, 148, 211, 126, 84, 63, 84, 65, 39, 21, 0), # 26
(261, 223, 213, 198, 189, 91, 105, 93, 96, 44, 26, 26, 0, 217, 192, 168, 154, 215, 131, 88, 65, 88, 70, 41, 22, 0), # 27
(272, 232, 219, 208, 195, 93, 108, 98, 103, 47, 27, 27, 0, 223, 200, 172, 160, 219, 134, 90, 67, 90, 71, 41, 24, 0), # 28
(283, 241, 226, 220, 203, 97, 108, 105, 104, 48, 27, 27, 0, 231, 207, 181, 169, 223, 137, 97, 70, 94, 71, 42, 26, 0), # 29
(292, 251, 238, 233, 211, 103, 110, 107, 106, 50, 28, 28, 0, 241, 217, 185, 175, 230, 144, 103, 72, 98, 73, 43, 28, 0), # 30
(303, 260, 248, 237, 216, 103, 116, 113, 107, 51, 29, 29, 0, 253, 226, 191, 180, 233, 155, 107, 74, 105, 79, 47, 28, 0), # 31
(321, 269, 257, 243, 225, 103, 117, 114, 114, 54, 31, 29, 0, 262, 231, 197, 183, 241, 158, 108, 76, 107, 82, 50, 30, 0), # 32
(331, 279, 267, 249, 227, 115, 124, 114, 121, 56, 34, 29, 0, 267, 243, 205, 184, 255, 164, 112, 78, 113, 85, 51, 30, 0), # 33
(346, 288, 278, 260, 237, 119, 129, 115, 130, 59, 34, 30, 0, 276, 250, 212, 189, 261, 171, 114, 79, 116, 89, 51, 32, 0), # 34
(360, 301, 287, 278, 244, 125, 131, 119, 134, 60, 37, 31, 0, 285, 260, 219, 197, 265, 175, 119, 83, 118, 90, 54, 35, 0), # 35
(368, 306, 293, 282, 255, 128, 137, 124, 140, 62, 37, 33, 0, 300, 266, 225, 203, 270, 181, 122, 87, 121, 93, 55, 37, 0), # 36
(374, 314, 308, 286, 261, 131, 140, 128, 141, 66, 37, 33, 0, 315, 274, 236, 208, 282, 182, 128, 88, 126, 99, 56, 37, 0), # 37
(389, 331, 317, 293, 269, 135, 145, 130, 143, 66, 37, 34, 0, 325, 283, 239, 214, 290, 187, 130, 92, 131, 103, 57, 38, 0), # 38
(396, 342, 323, 304, 281, 138, 149, 134, 145, 67, 40, 35, 0, 334, 290, 249, 216, 298, 191, 137, 94, 138, 103, 58, 40, 0), # 39
(405, 347, 332, 316, 286, 139, 152, 138, 147, 68, 40, 36, 0, 345, 297, 254, 222, 313, 195, 141, 95, 142, 106, 59, 41, 0), # 40
(413, 352, 339, 326, 297, 144, 159, 141, 153, 69, 42, 37, 0, 363, 306, 260, 230, 321, 200, 147, 97, 145, 108, 60, 43, 0), # 41
(423, 364, 346, 336, 306, 146, 162, 145, 156, 70, 42, 37, 0, 370, 317, 263, 236, 329, 204, 151, 102, 151, 111, 60, 43, 0), # 42
(434, 374, 358, 343, 316, 154, 166, 146, 158, 73, 43, 38, 0, 386, 324, 277, 241, 341, 213, 152, 103, 156, 113, 63, 45, 0), # 43
(442, 388, 370, 351, 322, 158, 169, 148, 162, 74, 44, 38, 0, 400, 334, 288, 246, 350, 217, 154, 105, 161, 117, 65, 45, 0), # 44
(450, 402, 379, 354, 328, 161, 173, 154, 164, 74, 45, 40, 0, 407, 345, 295, 251, 365, 218, 157, 109, 163, 120, 65, 45, 0), # 45
(459, 413, 387, 363, 333, 162, 175, 157, 168, 79, 46, 40, 0, 418, 357, 305, 257, 373, 224, 161, 112, 174, 127, 67, 47, 0), # 46
(470, 423, 400, 375, 340, 167, 183, 161, 170, 81, 46, 40, 0, 429, 363, 315, 266, 376, 230, 166, 114, 177, 132, 72, 47, 0), # 47
(478, 430, 406, 382, 346, 171, 189, 162, 173, 83, 47, 41, 0, 441, 374, 322, 269, 390, 237, 166, 115, 180, 136, 75, 48, 0), # 48
(486, 438, 415, 392, 353, 174, 190, 165, 176, 87, 48, 41, 0, 453, 385, 329, 271, 396, 242, 167, 116, 182, 137, 78, 49, 0), # 49
(492, 449, 423, 397, 366, 176, 192, 169, 180, 88, 50, 42, 0, 463, 397, 335, 275, 400, 247, 171, 118, 184, 141, 80, 49, 0), # 50
(502, 460, 431, 411, 373, 180, 195, 175, 185, 88, 51, 42, 0, 469, 411, 337, 278, 406, 252, 175, 121, 188, 144, 81, 51, 0), # 51
(515, 466, 443, 421, 378, 182, 199, 177, 187, 90, 52, 42, 0, 481, 419, 348, 283, 417, 253, 182, 124, 195, 145, 82, 52, 0), # 52
(527, 480, 453, 427, 388, 185, 203, 183, 193, 93, 53, 42, 0, 491, 432, 353, 286, 428, 259, 186, 125, 200, 148, 84, 52, 0), # 53
(540, 490, 459, 438, 391, 190, 208, 190, 202, 93, 56, 42, 0, 497, 440, 360, 290, 432, 262, 190, 127, 204, 151, 86, 52, 0), # 54
(551, 498, 469, 451, 399, 196, 211, 194, 204, 95, 57, 44, 0, 502, 447, 366, 294, 442, 270, 194, 128, 208, 153, 86, 53, 0), # 55
(561, 511, 478, 457, 404, 200, 212, 198, 208, 100, 57, 46, 0, 510, 453, 372, 303, 449, 273, 200, 133, 212, 159, 86, 53, 0), # 56
(573, 516, 482, 467, 414, 203, 216, 203, 212, 101, 58, 46, 0, 522, 457, 377, 313, 456, 279, 201, 134, 217, 163, 87, 53, 0), # 57
(585, 530, 489, 479, 423, 203, 221, 206, 216, 102, 60, 46, 0, 532, 466, 381, 315, 462, 284, 207, 135, 219, 164, 88, 56, 0), # 58
(592, 539, 493, 486, 429, 204, 221, 208, 219, 104, 60, 46, 0, 542, 477, 390, 320, 469, 288, 209, 138, 223, 168, 90, 56, 0), # 59
(604, 545, 501, 498, 434, 208, 224, 213, 222, 106, 61, 46, 0, 560, 484, 399, 328, 474, 291, 218, 139, 229, 173, 94, 57, 0), # 60
(617, 555, 510, 509, 443, 212, 227, 216, 227, 107, 63, 46, 0, 570, 493, 407, 330, 482, 291, 226, 140, 232, 176, 95, 59, 0), # 61
(627, 567, 517, 519, 447, 217, 231, 219, 230, 110, 64, 46, 0, 576, 499, 413, 335, 493, 295, 229, 146, 235, 177, 97, 59, 0), # 62
(639, 579, 530, 524, 454, 228, 234, 223, 236, 112, 65, 47, 0, 593, 508, 424, 340, 499, 297, 233, 150, 237, 179, 97, 59, 0), # 63
(649, 590, 541, 530, 464, 230, 236, 225, 239, 116, 70, 47, 0, 602, 515, 430, 347, 503, 305, 243, 154, 241, 181, 97, 60, 0), # 64
(658, 596, 548, 544, 473, 236, 243, 230, 243, 117, 72, 47, 0, 614, 522, 434, 354, 515, 306, 245, 160, 246, 185, 97, 60, 0), # 65
(669, 603, 558, 557, 481, 238, 250, 232, 248, 117, 73, 47, 0, 628, 534, 441, 357, 524, 311, 250, 162, 247, 187, 98, 61, 0), # 66
(681, 610, 567, 566, 494, 241, 256, 235, 254, 118, 73, 47, 0, 642, 541, 448, 363, 530, 313, 255, 163, 249, 193, 100, 62, 0), # 67
(686, 619, 580, 579, 499, 245, 258, 239, 256, 119, 75, 48, 0, 650, 559, 459, 367, 543, 318, 261, 165, 254, 195, 100, 64, 0), # 68
(699, 622, 587, 589, 505, 252, 262, 240, 261, 121, 77, 48, 0, 656, 571, 462, 371, 546, 320, 263, 166, 257, 197, 102, 64, 0), # 69
(703, 631, 595, 596, 512, 256, 263, 244, 263, 122, 79, 48, 0, 664, 577, 470, 380, 555, 324, 269, 168, 259, 200, 104, 64, 0), # 70
(717, 640, 603, 605, 517, 264, 265, 245, 264, 123, 80, 50, 0, 681, 586, 485, 385, 563, 326, 273, 171, 261, 202, 105, 67, 0), # 71
(730, 646, 610, 617, 525, 268, 269, 248, 265, 124, 81, 51, 0, 695, 592, 491, 391, 575, 330, 277, 174, 265, 206, 107, 68, 0), # 72
(739, 653, 616, 629, 531, 269, 272, 250, 271, 126, 82, 52, 0, 704, 599, 499, 394, 585, 339, 283, 178, 267, 209, 109, 69, 0), # 73
(750, 664, 625, 637, 537, 276, 276, 251, 274, 129, 83, 53, 0, 709, 609, 503, 398, 592, 342, 287, 180, 273, 209, 109, 69, 0), # 74
(764, 672, 635, 645, 546, 279, 279, 254, 279, 132, 85, 55, 0, 721, 621, 508, 404, 596, 346, 290, 183, 273, 210, 111, 70, 0), # 75
(773, 685, 644, 654, 553, 282, 282, 257, 284, 135, 86, 56, 0, 734, 629, 512, 410, 599, 353, 291, 184, 278, 211, 113, 70, 0), # 76
(786, 693, 652, 663, 560, 287, 287, 259, 287, 135, 86, 56, 0, 747, 634, 517, 415, 612, 355, 298, 184, 285, 211, 114, 71, 0), # 77
(795, 700, 656, 677, 569, 289, 291, 263, 292, 137, 87, 57, 0, 756, 647, 525, 417, 614, 359, 301, 185, 288, 217, 114, 71, 0), # 78
(801, 712, 667, 690, 577, 292, 293, 265, 296, 137, 89, 57, 0, 766, 655, 530, 420, 622, 365, 304, 195, 289, 220, 118, 71, 0), # 79
(815, 727, 668, 700, 583, 294, 295, 268, 300, 137, 91, 58, 0, 772, 666, 541, 423, 631, 369, 307, 197, 293, 223, 119, 73, 0), # 80
(830, 732, 671, 709, 591, 295, 303, 270, 304, 138, 92, 60, 0, 786, 675, 549, 427, 641, 370, 310, 200, 302, 226, 122, 74, 0), # 81
(842, 742, 679, 725, 598, 300, 309, 271, 307, 139, 94, 61, 0, 797, 687, 554, 432, 651, 373, 316, 202, 305, 229, 124, 74, 0), # 82
(851, 755, 692, 728, 603, 303, 312, 275, 310, 140, 96, 62, 0, 808, 698, 567, 436, 655, 377, 320, 203, 312, 231, 127, 75, 0), # 83
(860, 759, 699, 733, 609, 305, 317, 280, 315, 141, 97, 62, 0, 819, 707, 577, 439, 658, 382, 320, 205, 315, 232, 128, 76, 0), # 84
(869, 771, 711, 744, 613, 308, 322, 284, 317, 142, 99, 62, 0, 829, 714, 583, 444, 667, 384, 324, 211, 319, 232, 128, 76, 0), # 85
(881, 777, 719, 750, 627, 312, 325, 287, 319, 143, 99, 63, 0, 836, 724, 587, 448, 673, 387, 328, 214, 323, 237, 129, 77, 0), # 86
(894, 787, 727, 753, 630, 317, 328, 291, 322, 144, 100, 63, 0, 847, 733, 596, 453, 682, 393, 331, 218, 328, 238, 131, 78, 0), # 87
(901, 793, 735, 762, 635, 319, 331, 293, 325, 144, 100, 63, 0, 855, 742, 598, 458, 686, 395, 332, 218, 331, 241, 133, 78, 0), # 88
(911, 803, 743, 768, 644, 323, 333, 297, 327, 145, 101, 65, 0, 862, 753, 606, 465, 699, 396, 337, 220, 332, 246, 134, 79, 0), # 89
(912, 809, 750, 776, 652, 332, 335, 298, 332, 147, 101, 66, 0, 874, 766, 616, 469, 711, 399, 339, 221, 333, 248, 137, 79, 0), # 90
(922, 821, 753, 787, 659, 336, 337, 301, 334, 152, 103, 68, 0, 886, 772, 623, 477, 716, 401, 346, 223, 336, 251, 142, 81, 0), # 91
(932, 831, 760, 792, 666, 340, 343, 304, 340, 153, 103, 68, 0, 902, 778, 631, 486, 724, 403, 346, 227, 340, 255, 143, 81, 0), # 92
(942, 839, 769, 798, 672, 340, 348, 307, 347, 153, 105, 68, 0, 908, 789, 636, 490, 733, 411, 346, 233, 340, 260, 146, 81, 0), # 93
(947, 849, 776, 809, 676, 343, 350, 309, 352, 153, 105, 69, 0, 918, 796, 644, 495, 740, 412, 347, 235, 342, 262, 146, 81, 0), # 94
(954, 852, 789, 817, 684, 347, 352, 314, 358, 156, 106, 69, 0, 925, 799, 650, 498, 744, 414, 351, 240, 347, 265, 150, 82, 0), # 95
(960, 860, 794, 822, 694, 350, 353, 316, 359, 158, 107, 71, 0, 933, 807, 657, 500, 756, 415, 355, 240, 350, 267, 152, 82, 0), # 96
(975, 871, 806, 829, 700, 352, 356, 321, 364, 159, 108, 71, 0, 945, 815, 663, 504, 758, 418, 355, 241, 359, 273, 155, 82, 0), # 97
(986, 879, 808, 834, 705, 356, 360, 323, 371, 164, 112, 72, 0, 951, 821, 672, 514, 766, 423, 363, 243, 361, 275, 155, 82, 0), # 98
(995, 887, 814, 842, 715, 357, 364, 326, 377, 169, 112, 72, 0, 971, 829, 679, 518, 776, 426, 368, 243, 364, 284, 156, 83, 0), # 99
(1015, 893, 824, 846, 723, 362, 366, 330, 378, 172, 113, 72, 0, 982, 831, 684, 522, 786, 430, 373, 247, 366, 285, 159, 83, 0), # 100
(1024, 898, 834, 854, 730, 369, 368, 333, 382, 173, 114, 73, 0, 989, 839, 690, 528, 793, 432, 377, 249, 369, 287, 164, 84, 0), # 101
(1036, 906, 843, 861, 734, 371, 368, 336, 384, 177, 115, 74, 0, 1000, 850, 698, 533, 797, 438, 386, 249, 373, 291, 164, 84, 0), # 102
(1049, 910, 852, 862, 743, 373, 371, 341, 385, 178, 115, 74, 0, 1006, 856, 704, 540, 801, 442, 389, 253, 374, 295, 165, 84, 0), # 103
(1060, 917, 860, 866, 750, 379, 373, 344, 390, 178, 116, 74, 0, 1010, 861, 708, 541, 810, 447, 389, 258, 376, 299, 168, 86, 0), # 104
(1074, 927, 872, 870, 758, 382, 378, 346, 393, 178, 119, 75, 0, 1019, 863, 710, 547, 817, 453, 390, 262, 382, 301, 170, 87, 0), # 105
(1083, 934, 879, 881, 773, 385, 381, 353, 399, 179, 120, 76, 0, 1032, 873, 720, 554, 823, 456, 393, 267, 389, 301, 171, 89, 0), # 106
(1092, 942, 891, 885, 781, 389, 384, 354, 401, 179, 120, 78, 0, 1041, 885, 724, 556, 835, 459, 399, 270, 394, 304, 174, 89, 0), # 107
(1106, 947, 901, 891, 788, 391, 386, 355, 406, 180, 123, 78, 0, 1051, 888, 734, 563, 839, 462, 400, 278, 398, 307, 175, 90, 0), # 108
(1115, 956, 904, 898, 795, 393, 388, 359, 411, 182, 126, 79, 0, 1065, 894, 736, 568, 843, 463, 404, 279, 401, 309, 175, 90, 0), # 109
(1125, 964, 915, 907, 805, 397, 389, 360, 415, 184, 130, 79, 0, 1074, 902, 743, 576, 849, 466, 407, 285, 404, 314, 178, 90, 0), # 110
(1135, 973, 922, 912, 812, 400, 389, 364, 419, 184, 130, 79, 0, 1089, 909, 749, 581, 852, 472, 410, 288, 410, 319, 181, 90, 0), # 111
(1146, 981, 931, 923, 818, 403, 392, 367, 424, 185, 131, 79, 0, 1098, 917, 756, 585, 856, 476, 411, 289, 414, 320, 181, 92, 0), # 112
(1151, 989, 939, 933, 825, 408, 396, 367, 429, 186, 131, 80, 0, 1109, 922, 759, 586, 867, 480, 413, 291, 417, 323, 182, 93, 0), # 113
(1157, 997, 948, 939, 835, 413, 397, 368, 436, 187, 133, 81, 0, 1117, 932, 762, 588, 878, 483, 414, 293, 419, 325, 186, 94, 0), # 114
(1166, 1005, 954, 945, 842, 416, 401, 370, 439, 189, 134, 81, 0, 1127, 934, 771, 594, 887, 484, 418, 294, 421, 328, 188, 95, 0), # 115
(1176, 1012, 959, 953, 853, 418, 405, 374, 444, 190, 135, 81, 0, 1137, 945, 775, 600, 896, 492, 424, 296, 424, 331, 192, 95, 0), # 116
(1190, 1024, 967, 959, 861, 421, 410, 378, 445, 190, 136, 81, 0, 1143, 951, 780, 602, 899, 498, 428, 298, 428, 333, 194, 96, 0), # 117
(1194, 1035, 972, 971, 864, 424, 415, 383, 448, 192, 136, 81, 0, 1149, 960, 784, 609, 904, 499, 432, 301, 433, 335, 194, 96, 0), # 118
(1202, 1046, 976, 977, 867, 426, 417, 386, 450, 194, 136, 82, 0, 1156, 966, 797, 619, 912, 501, 434, 304, 433, 337, 196, 97, 0), # 119
(1208, 1052, 986, 983, 875, 429, 420, 389, 453, 196, 140, 82, 0, 1163, 971, 801, 623, 918, 503, 435, 306, 438, 341, 201, 97, 0), # 120
(1216, 1059, 993, 988, 885, 431, 426, 397, 459, 200, 141, 82, 0, 1171, 975, 809, 630, 929, 505, 438, 309, 444, 341, 204, 97, 0), # 121
(1229, 1065, 1002, 996, 887, 433, 428, 398, 465, 201, 142, 82, 0, 1180, 984, 812, 634, 939, 508, 441, 313, 446, 342, 208, 97, 0), # 122
(1238, 1072, 1011, 1005, 895, 434, 435, 403, 470, 203, 142, 82, 0, 1187, 988, 817, 639, 942, 514, 442, 315, 454, 347, 210, 97, 0), # 123
(1245, 1079, 1016, 1015, 898, 437, 438, 406, 473, 205, 142, 82, 0, 1196, 991, 820, 645, 947, 517, 445, 317, 460, 350, 212, 100, 0), # 124
(1259, 1084, 1022, 1019, 911, 442, 439, 410, 476, 206, 142, 84, 0, 1206, 997, 825, 652, 953, 521, 448, 319, 462, 351, 212, 101, 0), # 125
(1267, 1089, 1028, 1032, 921, 443, 446, 411, 478, 206, 143, 84, 0, 1213, 1003, 832, 657, 961, 527, 452, 323, 462, 352, 214, 102, 0), # 126
(1276, 1092, 1038, 1043, 923, 444, 451, 412, 478, 206, 145, 85, 0, 1223, 1009, 839, 660, 967, 529, 457, 328, 467, 353, 214, 102, 0), # 127
(1290, 1099, 1047, 1049, 930, 446, 453, 414, 482, 209, 146, 85, 0, 1234, 1013, 841, 666, 973, 535, 457, 329, 471, 357, 215, 102, 0), # 128
(1298, 1103, 1054, 1064, 936, 447, 453, 415, 484, 211, 146, 85, 0, 1248, 1021, 846, 667, 976, 538, 462, 330, 473, 364, 215, 102, 0), # 129
(1304, 1106, 1060, 1068, 946, 449, 459, 417, 487, 213, 146, 85, 0, 1262, 1029, 851, 667, 983, 540, 464, 331, 477, 366, 215, 102, 0), # 130
(1315, 1114, 1069, 1076, 952, 450, 460, 418, 493, 215, 146, 85, 0, 1270, 1032, 857, 674, 990, 542, 466, 333, 478, 369, 215, 103, 0), # 131
(1323, 1118, 1079, 1081, 959, 452, 461, 423, 494, 216, 146, 85, 0, 1279, 1046, 864, 679, 995, 544, 469, 335, 480, 369, 215, 103, 0), # 132
(1331, 1124, 1087, 1096, 969, 456, 462, 425, 498, 220, 148, 86, 0, 1285, 1057, 869, 684, 1000, 548, 472, 336, 481, 369, 216, 103, 0), # 133
(1339, 1128, 1095, 1110, 976, 457, 464, 428, 499, 221, 149, 86, 0, 1292, 1068, 874, 686, 1006, 552, 475, 340, 484, 369, 218, 103, 0), # 134
(1344, 1139, 1099, 1123, 986, 459, 467, 430, 501, 222, 150, 87, 0, 1299, 1076, 876, 688, 1011, 556, 478, 345, 486, 371, 219, 105, 0), # 135
(1353, 1148, 1103, 1135, 988, 460, 470, 431, 508, 222, 153, 87, 0, 1314, 1085, 878, 692, 1020, 557, 480, 346, 487, 374, 223, 105, 0), # 136
(1365, 1150, 1110, 1141, 994, 463, 475, 433, 511, 222, 153, 87, 0, 1323, 1089, 885, 697, 1031, 558, 483, 350, 496, 375, 224, 106, 0), # 137
(1374, 1155, 1114, 1151, 1000, 466, 477, 436, 513, 225, 154, 87, 0, 1334, 1094, 893, 699, 1038, 563, 487, 352, 502, 379, 227, 106, 0), # 138
(1383, 1160, 1120, 1155, 1007, 471, 480, 439, 515, 227, 154, 88, 0, 1346, 1100, 898, 705, 1043, 565, 490, 352, 503, 383, 227, 106, 0), # 139
(1394, 1173, 1124, 1161, 1012, 477, 483, 441, 522, 227, 157, 89, 0, 1349, 1104, 903, 709, 1049, 572, 496, 356, 506, 385, 227, 107, 0), # 140
(1403, 1180, 1131, 1169, 1021, 479, 484, 445, 527, 228, 157, 89, 0, 1358, 1109, 916, 714, 1059, 574, 501, 358, 508, 388, 229, 108, 0), # 141
(1411, 1185, 1137, 1177, 1028, 480, 489, 446, 533, 230, 157, 89, 0, 1360, 1109, 924, 716, 1064, 575, 502, 362, 510, 392, 232, 108, 0), # 142
(1420, 1192, 1143, 1186, 1039, 482, 490, 447, 535, 232, 158, 93, 0, 1373, 1112, 927, 718, 1067, 579, 505, 367, 516, 394, 232, 111, 0), # 143
(1435, 1203, 1150, 1195, 1047, 486, 493, 453, 537, 233, 158, 93, 0, 1380, 1116, 931, 719, 1073, 581, 507, 370, 517, 399, 232, 112, 0), # 144
(1449, 1207, 1155, 1200, 1055, 489, 496, 455, 540, 235, 158, 93, 0, 1390, 1126, 938, 723, 1078, 585, 507, 371, 523, 405, 232, 112, 0), # 145
(1459, 1214, 1162, 1205, 1061, 490, 498, 460, 544, 242, 158, 94, 0, 1404, 1136, 943, 726, 1087, 589, 511, 375, 525, 408, 233, 113, 0), # 146
(1465, 1218, 1166, 1212, 1067, 491, 498, 462, 546, 243, 161, 96, 0, 1412, 1142, 950, 729, 1093, 591, 514, 378, 527, 411, 234, 113, 0), # 147
(1476, 1221, 1174, 1217, 1071, 494, 502, 463, 549, 247, 165, 96, 0, 1423, 1148, 952, 734, 1102, 593, 515, 379, 533, 414, 236, 113, 0), # 148
(1488, 1228, 1184, 1225, 1075, 496, 506, 465, 555, 248, 165, 96, 0, 1431, 1158, 955, 736, 1107, 594, 517, 381, 534, 415, 237, 114, 0), # 149
(1492, 1230, 1192, 1236, 1081, 499, 507, 471, 555, 250, 168, 99, 0, 1439, 1166, 960, 738, 1116, 597, 520, 387, 538, 416, 238, 114, 0), # 150
(1497, 1234, 1193, 1240, 1085, 501, 508, 474, 558, 251, 168, 101, 0, 1449, 1171, 965, 742, 1121, 603, 522, 391, 541, 419, 240, 114, 0), # 151
(1501, 1239, 1198, 1247, 1092, 503, 509, 476, 563, 251, 168, 102, 0, 1463, 1183, 968, 746, 1126, 606, 523, 392, 542, 421, 241, 115, 0), # 152
(1507, 1240, 1207, 1256, 1097, 504, 511, 477, 565, 251, 168, 102, 0, 1475, 1191, 976, 747, 1133, 613, 526, 392, 545, 422, 243, 115, 0), # 153
(1515, 1244, 1218, 1264, 1100, 508, 511, 481, 568, 254, 168, 103, 0, 1482, 1194, 982, 752, 1139, 619, 530, 393, 550, 424, 244, 115, 0), # 154
(1523, 1251, 1228, 1267, 1106, 514, 513, 482, 569, 256, 171, 103, 0, 1493, 1208, 990, 758, 1144, 621, 532, 395, 552, 427, 244, 115, 0), # 155
(1528, 1261, 1233, 1275, 1109, 516, 515, 486, 571, 256, 172, 104, 0, 1503, 1215, 994, 761, 1147, 625, 535, 396, 557, 430, 245, 115, 0), # 156
(1536, 1271, 1240, 1282, 1118, 516, 518, 487, 574, 258, 172, 106, 0, 1511, 1223, 1001, 765, 1152, 625, 536, 399, 560, 433, 245, 115, 0), # 157
(1544, 1273, 1245, 1293, 1123, 517, 519, 488, 577, 259, 173, 106, 0, 1515, 1226, 1012, 771, 1156, 628, 540, 402, 565, 436, 246, 115, 0), # 158
(1554, 1278, 1250, 1297, 1129, 523, 520, 488, 580, 261, 174, 107, 0, 1522, 1231, 1017, 775, 1163, 633, 543, 404, 566, 439, 248, 115, 0), # 159
(1561, 1282, 1258, 1302, 1134, 526, 521, 491, 584, 261, 175, 108, 0, 1534, 1238, 1020, 781, 1174, 635, 544, 407, 571, 440, 251, 115, 0), # 160
(1565, 1286, 1262, 1305, 1142, 529, 522, 495, 591, 262, 176, 110, 0, 1538, 1246, 1025, 786, 1182, 640, 546, 408, 573, 444, 251, 116, 0), # 161
(1571, 1289, 1268, 1315, 1149, 533, 524, 496, 595, 264, 177, 110, 0, 1542, 1252, 1031, 787, 1194, 643, 549, 409, 575, 445, 251, 116, 0), # 162
(1581, 1299, 1272, 1318, 1152, 539, 527, 500, 597, 264, 177, 110, 0, 1547, 1260, 1035, 791, 1202, 646, 550, 413, 577, 447, 251, 116, 0), # 163
(1592, 1301, 1280, 1327, 1158, 540, 532, 501, 600, 264, 180, 110, 0, 1548, 1265, 1038, 797, 1206, 648, 551, 415, 581, 451, 251, 117, 0), # 164
(1597, 1307, 1289, 1334, 1161, 541, 535, 503, 602, 265, 181, 110, 0, 1558, 1271, 1041, 800, 1215, 650, 552, 417, 585, 454, 251, 117, 0), # 165
(1603, 1311, 1293, 1339, 1167, 545, 536, 504, 606, 266, 181, 113, 0, 1561, 1276, 1045, 800, 1225, 655, 552, 420, 589, 454, 252, 118, 0), # 166
(1609, 1312, 1299, 1346, 1171, 546, 537, 504, 608, 268, 181, 114, 0, 1565, 1282, 1048, 805, 1232, 660, 553, 422, 593, 457, 252, 118, 0), # 167
(1610, 1317, 1302, 1351, 1175, 549, 539, 507, 608, 269, 181, 114, 0, 1573, 1287, 1054, 810, 1236, 662, 553, 422, 594, 462, 253, 118, 0), # 168
(1619, 1320, 1312, 1356, 1181, 549, 544, 510, 611, 270, 181, 114, 0, 1581, 1293, 1056, 814, 1245, 662, 555, 424, 598, 464, 253, 118, 0), # 169
(1629, 1323, 1320, 1363, 1186, 553, 547, 513, 612, 270, 181, 114, 0, 1582, 1296, 1059, 816, 1250, 665, 558, 425, 598, 467, 253, 120, 0), # 170
(1633, 1325, 1326, 1366, 1187, 555, 549, 513, 616, 270, 182, 114, 0, 1590, 1301, 1063, 820, 1253, 665, 560, 426, 603, 470, 253, 120, 0), # 171
(1636, 1330, 1330, 1367, 1187, 557, 552, 513, 620, 272, 183, 114, 0, 1595, 1307, 1065, 821, 1258, 668, 563, 430, 605, 472, 253, 120, 0), # 172
(1643, 1332, 1333, 1371, 1192, 559, 553, 515, 623, 275, 183, 114, 0, 1602, 1310, 1067, 826, 1262, 668, 564, 431, 606, 474, 253, 121, 0), # 173
(1648, 1334, 1338, 1377, 1193, 563, 556, 515, 627, 275, 184, 114, 0, 1609, 1316, 1068, 833, 1266, 669, 566, 432, 608, 475, 254, 121, 0), # 174
(1652, 1337, 1345, 1379, 1198, 566, 557, 518, 630, 275, 185, 114, 0, 1612, 1321, 1075, 835, 1272, 670, 566, 432, 609, 476, 255, 121, 0), # 175
(1654, 1339, 1350, 1381, 1205, 567, 560, 519, 633, 277, 185, 114, 0, 1623, 1326, 1076, 836, 1277, 672, 567, 433, 610, 480, 255, 121, 0), # 176
(1655, 1339, 1357, 1384, 1210, 570, 561, 519, 635, 278, 185, 115, 0, 1629, 1327, 1077, 840, 1281, 674, 569, 435, 612, 484, 255, 121, 0), # 177
(1656, 1343, 1362, 1387, 1213, 570, 561, 521, 636, 279, 185, 115, 0, 1634, 1330, 1080, 841, 1287, 676, 570, 435, 614, 485, 256, 121, 0), # 178
(1656, 1343, 1362, 1387, 1213, 570, 561, 521, 636, 279, 185, 115, 0, 1634, 1330, 1080, 841, 1287, 676, 570, 435, 614, 485, 256, 121, 0), # 179
)
passenger_arriving_rate = (
(5.020865578371768, 5.064847846385402, 4.342736024677089, 4.661000830397574, 3.7031237384064077, 1.8308820436884476, 2.0730178076869574, 1.938823405408093, 2.030033020722669, 0.9895037538805926, 0.7008775273142672, 0.4081595898588478, 0.0, 5.083880212578363, 4.489755488447325, 3.5043876365713356, 2.968511261641777, 4.060066041445338, 2.7143527675713304, 2.0730178076869574, 1.3077728883488913, 1.8515618692032039, 1.5536669434658585, 0.8685472049354179, 0.4604407133077639, 0.0), # 0
(5.354327152019974, 5.399222302966028, 4.629455492775127, 4.968858189957462, 3.948326891649491, 1.9518237573581576, 2.209734470631847, 2.066464051210712, 2.164081775444303, 1.0547451730692876, 0.7471826893260219, 0.4351013884011963, 0.0, 5.419791647439855, 4.786115272413158, 3.73591344663011, 3.164235519207862, 4.328163550888606, 2.8930496716949965, 2.209734470631847, 1.3941598266843982, 1.9741634458247455, 1.6562860633191545, 0.9258910985550255, 0.49083839117872996, 0.0), # 1
(5.686723008979731, 5.732269739983398, 4.915035237956178, 5.275490778498595, 4.192641982499829, 2.072282983465593, 2.345909253980352, 2.193593853293508, 2.297595602292516, 1.1197284437551367, 0.7933038581293855, 0.46193605433775464, 0.0, 5.75436482820969, 5.0812965977153, 3.9665192906469278, 3.3591853312654094, 4.595191204585032, 3.0710313946109116, 2.345909253980352, 1.480202131046852, 2.0963209912499146, 1.758496926166199, 0.9830070475912357, 0.5211154309075817, 0.0), # 2
(6.016757793146562, 6.062668793441743, 5.198342391099879, 5.579682305649055, 4.435107784001268, 2.191782029841316, 2.4810018208239777, 2.3197088156227115, 2.430045053640364, 1.1841956746065454, 0.8390580686378972, 0.4885571404108718, 0.0, 6.086272806254225, 5.374128544519589, 4.195290343189486, 3.5525870238196355, 4.860090107280728, 3.247592341871796, 2.4810018208239777, 1.5655585927437972, 2.217553892000634, 1.8598941018830188, 1.0396684782199759, 0.551151708494704, 0.0), # 3
(6.343136148415981, 6.389098099345293, 5.478244083085864, 5.880216481036927, 4.674763069197661, 2.3098432043158894, 2.6144718342542292, 2.444304942164548, 2.560900681860902, 1.24788897429192, 0.8842623557650959, 0.514858199362897, 0.0, 6.414188632939817, 5.6634401929918665, 4.42131177882548, 3.743666922875759, 5.121801363721804, 3.422026919030367, 2.6144718342542292, 1.6498880030827783, 2.3373815345988307, 1.9600721603456428, 1.095648816617173, 0.5808270999404813, 0.0), # 4
(6.66456271868351, 6.710236293698289, 5.753607444793765, 6.175877014290295, 4.910646611132853, 2.4259888147198754, 2.745778957362612, 2.566878236885247, 2.689633039327186, 1.310550451479666, 0.9287337544245222, 0.5407327839361791, 0.0, 6.736785359632827, 5.948060623297969, 4.64366877212261, 3.9316513544389973, 5.379266078654372, 3.593629531639346, 2.745778957362612, 1.7328491533713395, 2.4553233055664263, 2.058625671430099, 1.1507214889587531, 0.6100214812452991, 0.0), # 5
(6.979742147844666, 7.024762012504959, 6.023299607103222, 6.465447615037239, 5.141797182850695, 2.5397411688838374, 2.8743828532406313, 2.686924703751037, 2.8157126784122717, 1.3719222148381898, 0.9722892995297139, 0.5660744468730674, 0.0, 7.052736037699606, 6.22681891560374, 4.8614464976485685, 4.115766644514569, 5.631425356824543, 3.761694585251452, 2.8743828532406313, 1.8141008349170267, 2.5708985914253475, 2.1551492050124135, 1.2046599214206444, 0.6386147284095418, 0.0), # 6
(7.2873790797949685, 7.331353891769537, 6.286187700893863, 6.747711992905847, 5.367253557395036, 2.650622574638337, 2.9997431849797924, 2.8039403467281465, 2.9386101514892147, 1.4317463730358968, 1.0147460259942116, 0.5907767409159108, 0.0, 7.360713718506519, 6.498544150075018, 5.073730129971057, 4.2952391191076895, 5.877220302978429, 3.9255164854194056, 2.9997431849797924, 1.8933018390273837, 2.683626778697518, 2.249237330968616, 1.2572375401787725, 0.6664867174335943, 0.0), # 7
(7.586178158429934, 7.628690567496257, 6.54113885704533, 7.021453857524196, 5.586054507809724, 2.7581553398139356, 3.1213196156715988, 2.917421169782802, 3.0577960109310682, 1.4897650347411937, 1.0559209687315536, 0.6147332188070586, 0.0, 7.659391453419917, 6.762065406877643, 5.279604843657768, 4.469295104223581, 6.1155920218621365, 4.084389637695923, 3.1213196156715988, 1.970110957009954, 2.793027253904862, 2.3404846191747324, 1.3082277714090662, 0.6935173243178416, 0.0), # 8
(7.874844027645085, 7.915450675689353, 6.787020206437253, 7.285456918520376, 5.797238807138606, 2.861861772241199, 3.23857180840756, 3.0268631768812346, 3.1727408091108913, 1.5457203086224858, 1.0956311626552797, 0.6378374332888596, 0.0, 7.947442293806162, 7.016211766177453, 5.478155813276398, 4.637160925867456, 6.345481618221783, 4.237608447633728, 3.23857180840756, 2.044186980172285, 2.898619403569303, 2.4284856395067926, 1.3574040412874508, 0.7195864250626686, 0.0), # 9
(8.152081331335932, 8.190312852353056, 7.022698879949271, 7.538504885522466, 5.999845228425533, 2.961264179750688, 3.3509594262791773, 3.1317623719896712, 3.282915098401738, 1.599354303348179, 1.133693642678929, 0.6599829371036627, 0.0, 8.22353929103161, 7.259812308140289, 5.668468213394645, 4.798062910044536, 6.565830196803476, 4.384467320785539, 3.3509594262791773, 2.11518869982192, 2.9999226142127666, 2.5128349618408223, 1.4045397759898541, 0.7445738956684597, 0.0), # 10
(8.416594713398005, 8.451955733491605, 7.247042008461013, 7.779381468158547, 6.192912544714355, 3.055884870172965, 3.457942132377958, 3.2316147590743394, 3.3877894311766643, 1.6504091275866801, 1.1699254437160416, 0.6810632829938176, 0.0, 8.486355496462611, 7.491696112931993, 5.849627218580208, 4.951227382760039, 6.775578862353329, 4.524260662704076, 3.457942132377958, 2.1827749072664036, 3.0964562723571776, 2.5931271560528497, 1.4494084016922026, 0.7683596121356006, 0.0), # 11
(8.667088817726812, 8.699057955109222, 7.458916722852117, 8.006870376056709, 6.375479529048918, 3.1452461513385908, 3.5589795897954057, 3.325916342101467, 3.486834359808726, 1.6986268900063934, 1.2041436006801558, 0.7009720237016724, 0.0, 8.734563961465534, 7.710692260718395, 6.020718003400779, 5.095880670019179, 6.973668719617452, 4.656282878942054, 3.5589795897954057, 2.246604393813279, 3.187739764524459, 2.6689567920189035, 1.4917833445704234, 0.7908234504644749, 0.0), # 12
(8.902268288217876, 8.93029815321015, 7.657190154002218, 8.219755318845033, 6.546584954473067, 3.2288703310781304, 3.653531461623028, 3.414163125037284, 3.579520436670977, 1.7437496992757264, 1.2361651484848115, 0.7196027119695768, 0.0, 8.966837737406735, 7.915629831665344, 6.180825742424058, 5.2312490978271775, 7.159040873341954, 4.7798283750521975, 3.653531461623028, 2.306335950770093, 3.2732924772365335, 2.7399184396150114, 1.5314380308004438, 0.8118452866554684, 0.0), # 13
(9.120837768766716, 9.144354963798623, 7.840729432790956, 8.416820006151594, 6.705267594030659, 3.306279717222145, 3.7410574109523305, 3.4958511118480193, 3.6653182141364735, 1.785519664063084, 1.2658071220435476, 0.7368489005398801, 0.0, 9.181849875652563, 8.10533790593868, 6.329035610217737, 5.3565589921892505, 7.330636428272947, 4.894191556587227, 3.7410574109523305, 2.3616283694443894, 3.3526337970153297, 2.8056066687171985, 1.5681458865581912, 0.8313049967089657, 0.0), # 14
(9.321501903268855, 9.339907022878865, 8.008401690097953, 8.59684814760449, 6.850566220765538, 3.376996617601199, 3.821017100874813, 3.5704763064998986, 3.743698244578273, 1.823678893036873, 1.2928865562699035, 0.752604142154931, 0.0, 9.37827342756938, 8.27864556370424, 6.464432781349516, 5.471036679110618, 7.487396489156546, 4.998666829099858, 3.821017100874813, 2.4121404411437135, 3.425283110382769, 2.865616049201497, 1.6016803380195905, 0.8490824566253515, 0.0), # 15
(9.5029653356198, 9.51563296645512, 8.159074056802854, 8.758623452831788, 6.981519607721555, 3.4405433400458514, 3.892870194481988, 3.6375347129591504, 3.8141310803694286, 1.8579694948654994, 1.3172204860774188, 0.7667619895570784, 0.0, 9.554781444523545, 8.434381885127861, 6.586102430387094, 5.5739084845964975, 7.628262160738857, 5.092548598142811, 3.892870194481988, 2.4575309571756083, 3.4907598038607777, 2.9195411509439295, 1.6318148113605708, 0.8650575424050111, 0.0), # 16
(9.663932709715075, 9.670211430531618, 8.291613663785293, 8.900929631461583, 7.097166527942559, 3.4964421923866666, 3.9560763548653552, 3.6965223351920073, 3.8760872738829946, 1.8881335782173672, 1.3386259463796333, 0.7792159954886714, 0.0, 9.710046977881415, 8.571375950375383, 6.693129731898166, 5.6644007346521, 7.752174547765989, 5.17513126926881, 3.9560763548653552, 2.4974587088476192, 3.5485832639712793, 2.9669765438205284, 1.6583227327570589, 0.8791101300483289, 0.0), # 17
(9.803108669450204, 9.802321051112584, 8.404887641924901, 9.022550393121959, 7.1965457544723925, 3.5442154824542103, 4.010095245116426, 3.746935177164692, 3.929037377492032, 1.9139132517608846, 1.3569199720900849, 0.7898597126920597, 0.0, 9.842743079009345, 8.688456839612655, 6.784599860450424, 5.741739755282652, 7.858074754984064, 5.245709248030569, 4.010095245116426, 2.531582487467293, 3.5982728772361963, 3.0075167977073205, 1.6809775283849802, 0.8911200955556896, 0.0), # 18
(9.919197858720699, 9.910640464202265, 8.497763122101317, 9.122269447440985, 7.2786960603549105, 3.5833855180790386, 4.054386528326697, 3.7882692428434357, 3.9724519435695926, 1.9350506241644574, 1.3719195981223131, 0.7985866939095915, 0.0, 9.951542799273696, 8.784453633005505, 6.859597990611565, 5.80515187249337, 7.944903887139185, 5.30357693998081, 4.054386528326697, 2.55956108434217, 3.6393480301774552, 3.0407564824803295, 1.6995526244202632, 0.9009673149274788, 0.0), # 19
(10.010904921422082, 9.993848305804882, 8.569107235194169, 9.198870504046766, 7.342656218633962, 3.613474607091719, 4.088409867587681, 3.8200205361944657, 4.005801524488732, 1.95128780409649, 1.3834418593898585, 0.805290491883616, 0.0, 10.035119190040824, 8.858195410719775, 6.9172092969492915, 5.853863412289469, 8.011603048977465, 5.348028750672252, 4.088409867587681, 2.5810532907797996, 3.671328109316981, 3.0662901680155894, 1.713821447038834, 0.9085316641640803, 0.0), # 20
(10.076934501449866, 10.050623211924679, 8.6177871120831, 9.251137272567364, 7.387465002353392, 3.6340050573228124, 4.1116249259908795, 3.84168506118401, 4.028556672622507, 1.9623669002253892, 1.39130379080626, 0.8098646593564828, 0.0, 10.092145302677078, 8.90851125292131, 6.9565189540313, 5.887100700676166, 8.057113345245014, 5.378359085657614, 4.1116249259908795, 2.5957178980877234, 3.693732501176696, 3.0837124241891223, 1.72355742241662, 0.91369301926588, 0.0), # 21
(10.115991242699579, 10.079643818565883, 8.642669883647738, 9.277853462630876, 7.41216118455705, 3.644499176602881, 4.1234913666278, 3.852758821778298, 4.040187940343971, 1.968030021219561, 1.3953224272850568, 0.8122027490705409, 0.0, 10.121294188548827, 8.934230239775948, 6.976612136425284, 5.904090063658682, 8.080375880687942, 5.393862350489617, 4.1234913666278, 2.6032136975734863, 3.706080592278525, 3.09261782087696, 1.7285339767295478, 0.9163312562332622, 0.0), # 22
(10.13039336334264, 10.083079961133974, 8.645769318701419, 9.281198109567903, 7.418488037355065, 3.6458333333333335, 4.124902001129669, 3.8539557613168727, 4.0416420781893, 1.9686980681298587, 1.3958263395269568, 0.8124914647157445, 0.0, 10.125, 8.93740611187319, 6.9791316976347835, 5.906094204389575, 8.0832841563786, 5.395538065843622, 4.124902001129669, 2.604166666666667, 3.7092440186775324, 3.0937327031893016, 1.729153863740284, 0.9166436328303613, 0.0), # 23
(10.141012413034153, 10.08107561728395, 8.645262345679013, 9.280786458333335, 7.422071742409901, 3.6458333333333335, 4.124126906318083, 3.852291666666667, 4.041447222222222, 1.968287654320988, 1.39577076318743, 0.8124238683127573, 0.0, 10.125, 8.936662551440328, 6.978853815937151, 5.904862962962962, 8.082894444444443, 5.393208333333334, 4.124126906318083, 2.604166666666667, 3.7110358712049507, 3.0935954861111123, 1.7290524691358027, 0.9164614197530866, 0.0), # 24
(10.15140723021158, 10.077124771376313, 8.644261545496114, 9.279972029320987, 7.4255766303963355, 3.6458333333333335, 4.122599451303155, 3.8490226337448563, 4.041062242798354, 1.96747970964792, 1.3956605665710604, 0.8122904282883707, 0.0, 10.125, 8.935194711172077, 6.978302832855302, 5.902439128943758, 8.082124485596708, 5.388631687242799, 4.122599451303155, 2.604166666666667, 3.7127883151981678, 3.0933240097736636, 1.728852309099223, 0.9161022519433014, 0.0), # 25
(10.161577019048034, 10.071287780064015, 8.642780635573846, 9.278764081790122, 7.429002578947403, 3.6458333333333335, 4.120343359154361, 3.8442103909465026, 4.0404920781893, 1.9662876771833566, 1.3954967473084758, 0.8120929736320684, 0.0, 10.125, 8.933022709952752, 6.977483736542379, 5.898863031550069, 8.0809841563786, 5.381894547325103, 4.120343359154361, 2.604166666666667, 3.7145012894737013, 3.0929213605967085, 1.7285561271147696, 0.915571616369456, 0.0), # 26
(10.171520983716636, 10.063624999999998, 8.640833333333333, 9.277171874999999, 7.432349465696142, 3.6458333333333335, 4.117382352941177, 3.837916666666667, 4.039741666666666, 1.9647250000000003, 1.3952803030303031, 0.8118333333333335, 0.0, 10.125, 8.930166666666667, 6.976401515151515, 5.894175, 8.079483333333332, 5.373083333333334, 4.117382352941177, 2.604166666666667, 3.716174732848071, 3.0923906250000006, 1.7281666666666669, 0.914875, 0.0), # 27
(10.181238328390501, 10.054196787837219, 8.638433356195703, 9.275204668209877, 7.4356171682756, 3.6458333333333335, 4.113740155733075, 3.830203189300412, 4.038815946502057, 1.9628051211705537, 1.3950122313671698, 0.8115133363816492, 0.0, 10.125, 8.926646700198141, 6.9750611568358485, 5.88841536351166, 8.077631893004114, 5.3622844650205765, 4.113740155733075, 2.604166666666667, 3.7178085841378, 3.091734889403293, 1.7276866712391405, 0.9140178898033837, 0.0), # 28
(10.19072825724275, 10.043063500228623, 8.635594421582077, 9.272871720679012, 7.438805564318813, 3.6458333333333335, 4.109440490599533, 3.821131687242798, 4.037719855967078, 1.9605414837677189, 1.3946935299497027, 0.811134811766499, 0.0, 10.125, 8.922482929431489, 6.973467649748514, 5.881624451303155, 8.075439711934155, 5.349584362139917, 4.109440490599533, 2.604166666666667, 3.7194027821594067, 3.0909572402263383, 1.7271188843164156, 0.9130057727480568, 0.0), # 29
(10.199989974446497, 10.03028549382716, 8.63233024691358, 9.270182291666666, 7.441914531458824, 3.6458333333333335, 4.104507080610022, 3.8107638888888884, 4.036458333333333, 1.957947530864198, 1.39432519640853, 0.8106995884773662, 0.0, 10.125, 8.917695473251028, 6.9716259820426485, 5.873842592592593, 8.072916666666666, 5.335069444444444, 4.104507080610022, 2.604166666666667, 3.720957265729412, 3.0900607638888897, 1.7264660493827162, 0.9118441358024693, 0.0), # 30
(10.209022684174858, 10.01592312528578, 8.62865454961134, 9.267145640432098, 7.444943947328672, 3.6458333333333335, 4.09896364883402, 3.799161522633745, 4.035036316872428, 1.9550367055326936, 1.3939082283742779, 0.8102094955037343, 0.0, 10.125, 8.912304450541077, 6.969541141871389, 5.865110116598079, 8.070072633744855, 5.318826131687243, 4.09896364883402, 2.604166666666667, 3.722471973664336, 3.0890485468107003, 1.7257309099222682, 0.910538465935071, 0.0), # 31
(10.217825590600954, 10.00003675125743, 8.624581047096479, 9.263771026234568, 7.447893689561397, 3.6458333333333335, 4.092833918340999, 3.7863863168724285, 4.033458744855967, 1.951822450845908, 1.3934436234775742, 0.8096663618350862, 0.0, 10.125, 8.906329980185948, 6.96721811738787, 5.8554673525377225, 8.066917489711933, 5.3009408436214, 4.092833918340999, 2.604166666666667, 3.7239468447806985, 3.0879236754115236, 1.7249162094192958, 0.909094250114312, 0.0), # 32
(10.226397897897897, 9.98268672839506, 8.620123456790123, 9.260067708333333, 7.450763635790041, 3.6458333333333335, 4.086141612200436, 3.7725000000000004, 4.031730555555555, 1.9483182098765437, 1.392932379349046, 0.8090720164609053, 0.0, 10.125, 8.899792181069957, 6.96466189674523, 5.84495462962963, 8.06346111111111, 5.2815, 4.086141612200436, 2.604166666666667, 3.7253818178950207, 3.086689236111112, 1.724024691358025, 0.9075169753086421, 0.0), # 33
(10.23473881023881, 9.963933413351622, 8.615295496113397, 9.256044945987654, 7.453553663647644, 3.6458333333333335, 4.078910453481805, 3.7575643004115222, 4.029856687242798, 1.9445374256973027, 1.3923754936193207, 0.8084282883706753, 0.0, 10.125, 8.892711172077426, 6.961877468096604, 5.833612277091907, 8.059713374485597, 5.260590020576132, 4.078910453481805, 2.604166666666667, 3.726776831823822, 3.085348315329219, 1.7230590992226795, 0.9058121284865113, 0.0), # 34
(10.242847531796807, 9.943837162780063, 8.610110882487428, 9.25171199845679, 7.456263650767246, 3.6458333333333335, 4.071164165254579, 3.741640946502058, 4.0278420781893, 1.9404935413808875, 1.3917739639190256, 0.807737006553879, 0.0, 10.125, 8.88510707209267, 6.958869819595128, 5.821480624142661, 8.0556841563786, 5.238297325102881, 4.071164165254579, 2.604166666666667, 3.728131825383623, 3.0839039994855972, 1.7220221764974855, 0.9039851966163696, 0.0), # 35
(10.250723266745005, 9.922458333333331, 8.604583333333334, 9.247078125, 7.45889347478189, 3.6458333333333335, 4.062926470588235, 3.724791666666667, 4.025691666666666, 1.9362000000000004, 1.391128787878788, 0.8070000000000002, 0.0, 10.125, 8.877, 6.95564393939394, 5.8086, 8.051383333333332, 5.214708333333334, 4.062926470588235, 2.604166666666667, 3.729446737390945, 3.0823593750000007, 1.7209166666666669, 0.9020416666666666, 0.0), # 36
(10.258365219256524, 9.89985728166438, 8.598726566072246, 9.242152584876543, 7.4614430133246135, 3.6458333333333335, 4.054221092552247, 3.707078189300412, 4.023410390946502, 1.931670244627344, 1.3904409631292352, 0.8062190976985216, 0.0, 10.125, 8.868410074683737, 6.952204815646175, 5.79501073388203, 8.046820781893004, 5.189909465020577, 4.054221092552247, 2.604166666666667, 3.7307215066623067, 3.080717528292182, 1.7197453132144491, 0.8999870256058529, 0.0), # 37
(10.265772593504476, 9.876094364426155, 8.592554298125286, 9.23694463734568, 7.46391214402846, 3.6458333333333335, 4.04507175421609, 3.6885622427983544, 4.021003189300411, 1.92691771833562, 1.3897114873009937, 0.8053961286389272, 0.0, 10.125, 8.859357415028198, 6.948557436504967, 5.780753155006859, 8.042006378600822, 5.163987139917697, 4.04507175421609, 2.604166666666667, 3.73195607201423, 3.078981545781894, 1.7185108596250571, 0.8978267604023779, 0.0), # 38
(10.272944593661986, 9.851229938271604, 8.586080246913582, 9.231463541666667, 7.466300744526468, 3.6458333333333335, 4.035502178649238, 3.6693055555555554, 4.0184750000000005, 1.9219558641975314, 1.3889413580246914, 0.8045329218106996, 0.0, 10.125, 8.849862139917693, 6.944706790123457, 5.765867592592593, 8.036950000000001, 5.137027777777778, 4.035502178649238, 2.604166666666667, 3.733150372263234, 3.07715451388889, 1.7172160493827164, 0.8955663580246914, 0.0), # 39
(10.279880423902163, 9.82532435985368, 8.579318129858253, 9.225718557098766, 7.468608692451679, 3.6458333333333335, 4.025536088921165, 3.649369855967079, 4.015830761316872, 1.9167981252857802, 1.3881315729309558, 0.8036313062033228, 0.0, 10.125, 8.83994436823655, 6.940657864654778, 5.750394375857339, 8.031661522633744, 5.1091177983539104, 4.025536088921165, 2.604166666666667, 3.7343043462258394, 3.0752395190329227, 1.7158636259716507, 0.8932113054412438, 0.0), # 40
(10.286579288398128, 9.79843798582533, 8.57228166438043, 9.219718942901235, 7.4708358654371345, 3.6458333333333335, 4.015197208101347, 3.628816872427984, 4.0130754115226335, 1.9114579446730684, 1.3872831296504138, 0.8026931108062796, 0.0, 10.125, 8.829624218869075, 6.936415648252069, 5.734373834019204, 8.026150823045267, 5.0803436213991775, 4.015197208101347, 2.604166666666667, 3.7354179327185673, 3.073239647633746, 1.7144563328760862, 0.8907670896204848, 0.0), # 41
(10.293040391323, 9.770631172839506, 8.564984567901236, 9.213473958333335, 7.472982141115872, 3.6458333333333335, 4.004509259259259, 3.6077083333333335, 4.010213888888889, 1.9059487654320992, 1.3863970258136926, 0.8017201646090536, 0.0, 10.125, 8.818921810699589, 6.931985129068463, 5.717846296296297, 8.020427777777778, 5.050791666666667, 4.004509259259259, 2.604166666666667, 3.736491070557936, 3.0711579861111122, 1.7129969135802474, 0.8882391975308643, 0.0), # 42
(10.299262936849892, 9.741964277549155, 8.557440557841794, 9.206992862654321, 7.475047397120935, 3.6458333333333335, 3.993495965464375, 3.58610596707819, 4.007251131687243, 1.9002840306355744, 1.3854742590514195, 0.800714296601128, 0.0, 10.125, 8.807857262612407, 6.927371295257098, 5.700852091906722, 8.014502263374485, 5.020548353909466, 3.993495965464375, 2.604166666666667, 3.7375236985604676, 3.0689976208847747, 1.7114881115683587, 0.8856331161408324, 0.0), # 43
(10.305246129151927, 9.712497656607225, 8.549663351623229, 9.200284915123458, 7.477031511085363, 3.6458333333333335, 3.9821810497861696, 3.564071502057614, 4.0041920781893, 1.8944771833561962, 1.3845158269942222, 0.7996773357719861, 0.0, 10.125, 8.796450693491845, 6.92257913497111, 5.683431550068587, 8.0083841563786, 4.98970010288066, 3.9821810497861696, 2.604166666666667, 3.7385157555426813, 3.0667616383744867, 1.709932670324646, 0.8829543324188387, 0.0), # 44
(10.310989172402216, 9.682291666666666, 8.541666666666668, 9.193359375, 7.478934360642197, 3.6458333333333335, 3.9705882352941178, 3.541666666666667, 4.001041666666666, 1.8885416666666672, 1.3835227272727273, 0.798611111111111, 0.0, 10.125, 8.784722222222221, 6.917613636363637, 5.665625, 8.002083333333331, 4.958333333333334, 3.9705882352941178, 2.604166666666667, 3.7394671803210984, 3.064453125000001, 1.7083333333333335, 0.8802083333333335, 0.0), # 45
(10.31649127077388, 9.65140666438043, 8.533464220393233, 9.186225501543209, 7.480755823424477, 3.6458333333333335, 3.958741245057694, 3.518953189300412, 3.997804835390946, 1.8824909236396894, 1.3824959575175624, 0.7975174516079867, 0.0, 10.125, 8.772691967687852, 6.912479787587812, 5.647472770919067, 7.995609670781892, 4.926534465020577, 3.958741245057694, 2.604166666666667, 3.7403779117122387, 3.062075167181071, 1.7066928440786466, 0.8774006058527665, 0.0), # 46
(10.321751628440035, 9.619903006401461, 8.525069730224052, 9.178892554012345, 7.482495777065244, 3.6458333333333335, 3.9466638021463734, 3.4959927983539094, 3.994486522633745, 1.8763383973479657, 1.3814365153593549, 0.7963981862520958, 0.0, 10.125, 8.760380048773053, 6.9071825767967745, 5.629015192043896, 7.98897304526749, 4.894389917695474, 3.9466638021463734, 2.604166666666667, 3.741247888532622, 3.0596308513374493, 1.7050139460448106, 0.8745366369455876, 0.0), # 47
(10.326769449573796, 9.587841049382716, 8.516496913580248, 9.171369791666667, 7.48415409919754, 3.6458333333333335, 3.9343796296296296, 3.4728472222222226, 3.9910916666666667, 1.8700975308641978, 1.3803453984287317, 0.7952551440329219, 0.0, 10.125, 8.74780658436214, 6.901726992143659, 5.610292592592592, 7.982183333333333, 4.861986111111112, 3.9343796296296296, 2.604166666666667, 3.74207704959877, 3.05712326388889, 1.7032993827160496, 0.871621913580247, 0.0), # 48
(10.331543938348286, 9.555281149977136, 8.507759487882945, 9.163666473765433, 7.485730667454405, 3.6458333333333335, 3.9219124505769383, 3.4495781893004116, 3.987625205761317, 1.8637817672610888, 1.3792236043563206, 0.7940901539399483, 0.0, 10.125, 8.73499169333943, 6.896118021781603, 5.5913453017832655, 7.975250411522634, 4.829409465020577, 3.9219124505769383, 2.604166666666667, 3.7428653337272024, 3.054555491255145, 1.7015518975765893, 0.8686619227251944, 0.0), # 49
(10.336074298936616, 9.522283664837678, 8.49887117055327, 9.155791859567902, 7.4872253594688765, 3.6458333333333335, 3.909285988057775, 3.4262474279835393, 3.9840920781893, 1.85740454961134, 1.3780721307727481, 0.7929050449626583, 0.0, 10.125, 8.72195549458924, 6.89036065386374, 5.572213648834019, 7.9681841563786, 4.796746399176955, 3.909285988057775, 2.604166666666667, 3.7436126797344382, 3.051930619855968, 1.6997742341106543, 0.86566215134888, 0.0), # 50
(10.34035973551191, 9.488908950617283, 8.489845679012346, 9.147755208333333, 7.488638052873998, 3.6458333333333335, 3.896523965141612, 3.4029166666666666, 3.9804972222222226, 1.8509793209876546, 1.3768919753086422, 0.7917016460905352, 0.0, 10.125, 8.708718106995885, 6.884459876543211, 5.552937962962963, 7.960994444444445, 4.764083333333334, 3.896523965141612, 2.604166666666667, 3.744319026436999, 3.049251736111112, 1.6979691358024693, 0.8626280864197532, 0.0), # 51
(10.344399452247279, 9.455217363968908, 8.480696730681299, 9.139565779320987, 7.489968625302809, 3.6458333333333335, 3.883650104897926, 3.3796476337448556, 3.976845576131687, 1.8445195244627348, 1.3756841355946297, 0.7904817863130622, 0.0, 10.125, 8.695299649443683, 6.878420677973147, 5.533558573388203, 7.953691152263374, 4.731506687242798, 3.883650104897926, 2.604166666666667, 3.7449843126514044, 3.04652192644033, 1.69613934613626, 0.8595652149062645, 0.0), # 52
(10.348192653315843, 9.421269261545497, 8.471438042981255, 9.131232831790122, 7.491216954388353, 3.6458333333333335, 3.8706881303961915, 3.3565020576131688, 3.9731420781893005, 1.8380386031092826, 1.3744496092613379, 0.7892472946197227, 0.0, 10.125, 8.681720240816947, 6.872248046306688, 5.514115809327846, 7.946284156378601, 4.699102880658437, 3.8706881303961915, 2.604166666666667, 3.7456084771941764, 3.043744277263375, 1.694287608596251, 0.8564790237768635, 0.0), # 53
(10.351738542890716, 9.387125000000001, 8.462083333333332, 9.122765625, 7.492382917763668, 3.6458333333333335, 3.8576617647058824, 3.333541666666666, 3.9693916666666667, 1.8315500000000005, 1.3731893939393938, 0.788, 0.0, 10.125, 8.668, 6.865946969696969, 5.49465, 7.938783333333333, 4.666958333333333, 3.8576617647058824, 2.604166666666667, 3.746191458881834, 3.040921875000001, 1.6924166666666667, 0.8533750000000002, 0.0), # 54
(10.355036325145022, 9.352844935985367, 8.452646319158665, 9.114173418209877, 7.493466393061793, 3.6458333333333335, 3.844594730896474, 3.3108281893004117, 3.9655992798353905, 1.8250671582075908, 1.3719044872594257, 0.7867417314433777, 0.0, 10.125, 8.654159045877153, 6.859522436297127, 5.4752014746227715, 7.931198559670781, 4.6351594650205765, 3.844594730896474, 2.604166666666667, 3.7467331965308963, 3.0380578060699595, 1.6905292638317333, 0.8502586305441244, 0.0), # 55
(10.358085204251871, 9.31848942615455, 8.443140717878373, 9.105465470679011, 7.4944672579157725, 3.6458333333333335, 3.8315107520374405, 3.288423353909465, 3.961769855967078, 1.818603520804756, 1.3705958868520598, 0.7854743179393385, 0.0, 10.125, 8.640217497332722, 6.852979434260299, 5.455810562414267, 7.923539711934156, 4.603792695473251, 3.8315107520374405, 2.604166666666667, 3.7472336289578863, 3.035155156893005, 1.6886281435756747, 0.8471354023776865, 0.0), # 56
(10.360884384384383, 9.284118827160494, 8.433580246913582, 9.096651041666666, 7.495385389958644, 3.6458333333333335, 3.818433551198257, 3.2663888888888892, 3.957908333333333, 1.812172530864198, 1.369264590347924, 0.7841995884773663, 0.0, 10.125, 8.626195473251027, 6.8463229517396185, 5.436517592592593, 7.915816666666666, 4.572944444444445, 3.818433551198257, 2.604166666666667, 3.747692694979322, 3.0322170138888898, 1.6867160493827165, 0.844010802469136, 0.0), # 57
(10.36343306971568, 9.24979349565615, 8.423978623685414, 9.087739390432098, 7.496220666823449, 3.6458333333333335, 3.8053868514483984, 3.2447865226337447, 3.954019650205761, 1.8057876314586196, 1.367911595377645, 0.7829193720469442, 0.0, 10.125, 8.612113092516385, 6.8395579768882255, 5.417362894375858, 7.908039300411522, 4.5427011316872425, 3.8053868514483984, 2.604166666666667, 3.7481103334117245, 3.029246463477367, 1.684795724737083, 0.8408903177869229, 0.0), # 58
(10.36573046441887, 9.215573788294467, 8.414349565614998, 9.078739776234567, 7.49697296614323, 3.6458333333333335, 3.792394375857339, 3.2236779835390945, 3.9501087448559673, 1.799462265660723, 1.3665378995718502, 0.7816354976375554, 0.0, 10.125, 8.597990474013107, 6.83268949785925, 5.398386796982168, 7.900217489711935, 4.513149176954733, 3.792394375857339, 2.604166666666667, 3.748486483071615, 3.02624659207819, 1.6828699131229998, 0.8377794352994972, 0.0), # 59
(10.367775772667077, 9.181520061728396, 8.404706790123456, 9.069661458333334, 7.497642165551024, 3.6458333333333335, 3.779479847494553, 3.203125, 3.946180555555556, 1.7932098765432103, 1.3651445005611673, 0.7803497942386832, 0.0, 10.125, 8.583847736625515, 6.825722502805837, 5.37962962962963, 7.892361111111112, 4.484375, 3.779479847494553, 2.604166666666667, 3.748821082775512, 3.023220486111112, 1.6809413580246915, 0.8346836419753088, 0.0), # 60
(10.369568198633415, 9.147692672610884, 8.395064014631917, 9.060513695987654, 7.498228142679874, 3.6458333333333335, 3.7666669894295164, 3.183189300411523, 3.9422400205761314, 1.7870439071787843, 1.3637323959762233, 0.7790640908398111, 0.0, 10.125, 8.56970499923792, 6.818661979881115, 5.361131721536351, 7.884480041152263, 4.456465020576132, 3.7666669894295164, 2.604166666666667, 3.749114071339937, 3.0201712319958856, 1.6790128029263836, 0.8316084247828076, 0.0), # 61
(10.371106946491004, 9.114151977594878, 8.385434956561502, 9.051305748456791, 7.498730775162823, 3.6458333333333335, 3.753979524731703, 3.1639326131687247, 3.9382920781893, 1.7809778006401469, 1.3623025834476452, 0.7777802164304223, 0.0, 10.125, 8.555582380734645, 6.811512917238226, 5.3429334019204395, 7.8765841563786, 4.429505658436215, 3.753979524731703, 2.604166666666667, 3.7493653875814115, 3.0171019161522645, 1.6770869913123003, 0.8285592706904436, 0.0), # 62
(10.37239122041296, 9.080958333333333, 8.375833333333334, 9.042046875, 7.499149940632904, 3.6458333333333335, 3.741441176470588, 3.1454166666666667, 3.9343416666666666, 1.7750250000000003, 1.360856060606061, 0.7765000000000001, 0.0, 10.125, 8.5415, 6.804280303030303, 5.325075, 7.868683333333333, 4.403583333333334, 3.741441176470588, 2.604166666666667, 3.749574970316452, 3.014015625000001, 1.675166666666667, 0.8255416666666667, 0.0), # 63
(10.373420224572397, 9.048172096479195, 8.366272862368541, 9.032746334876544, 7.4994855167231655, 3.6458333333333335, 3.729075667715646, 3.127703189300412, 3.9303937242798352, 1.7691989483310475, 1.3593938250820965, 0.7752252705380279, 0.0, 10.125, 8.527477975918305, 6.796969125410483, 5.307596844993141, 7.8607874485596705, 4.378784465020577, 3.729075667715646, 2.604166666666667, 3.7497427583615828, 3.0109154449588487, 1.6732545724737085, 0.822561099679927, 0.0), # 64
(10.374193163142438, 9.015853623685413, 8.35676726108825, 9.023413387345679, 7.499737381066645, 3.6458333333333335, 3.7169067215363514, 3.1108539094650207, 3.9264531893004113, 1.7635130887059902, 1.357916874506381, 0.7739578570339887, 0.0, 10.125, 8.513536427373873, 6.7895843725319045, 5.290539266117969, 7.852906378600823, 4.355195473251029, 3.7169067215363514, 2.604166666666667, 3.7498686905333223, 3.0078044624485605, 1.67135345221765, 0.819623056698674, 0.0), # 65
(10.374709240296196, 8.984063271604938, 8.34733024691358, 9.014057291666667, 7.499905411296382, 3.6458333333333335, 3.7049580610021784, 3.094930555555556, 3.9225250000000003, 1.7579808641975312, 1.3564262065095398, 0.7726995884773664, 0.0, 10.125, 8.499695473251029, 6.782131032547699, 5.273942592592592, 7.8450500000000005, 4.332902777777778, 3.7049580610021784, 2.604166666666667, 3.749952705648191, 3.0046857638888897, 1.6694660493827165, 0.8167330246913582, 0.0), # 66
(10.374967660206792, 8.952861396890716, 8.337975537265661, 9.004687307098765, 7.499989485045419, 3.6458333333333335, 3.693253409182603, 3.0799948559670787, 3.9186140946502057, 1.7526157178783728, 1.3549228187222018, 0.7714522938576437, 0.0, 10.125, 8.485975232434079, 6.774614093611008, 5.257847153635117, 7.837228189300411, 4.31199279835391, 3.693253409182603, 2.604166666666667, 3.7499947425227096, 3.001562435699589, 1.6675951074531323, 0.8138964906264289, 0.0), # 67
(10.374791614480825, 8.922144586043629, 8.328671624942844, 8.995231305354269, 7.499918636864896, 3.645765673423767, 3.681757597414823, 3.0659766041761927, 3.9146959495503735, 1.747405110411792, 1.3533809980900628, 0.770210835158312, 0.0, 10.124875150034294, 8.47231918674143, 6.766904990450313, 5.242215331235375, 7.829391899100747, 4.29236724584667, 3.681757597414823, 2.604118338159833, 3.749959318432448, 2.99841043511809, 1.6657343249885688, 0.8111040532766937, 0.0), # 68
(10.373141706924315, 8.890975059737157, 8.319157021604937, 8.985212635869564, 7.499273783587508, 3.6452307956104257, 3.6701340906733066, 3.052124485596708, 3.910599279835391, 1.7422015976761076, 1.3516438064859118, 0.7689349144466104, 0.0, 10.12388599537037, 8.458284058912714, 6.758219032429559, 5.226604793028321, 7.821198559670782, 4.272974279835391, 3.6701340906733066, 2.6037362825788755, 3.749636891793754, 2.9950708786231885, 1.6638314043209876, 0.8082704599761052, 0.0), # 69
(10.369885787558895, 8.859209754856408, 8.309390360653863, 8.974565343196456, 7.497999542752628, 3.6441773992785653, 3.658330067280685, 3.0383135192805977, 3.9063009640298736, 1.736979881115684, 1.3496914810876801, 0.7676185634410675, 0.0, 10.121932334533609, 8.44380419785174, 6.7484574054383994, 5.210939643347051, 7.812601928059747, 4.253638926992837, 3.658330067280685, 2.6029838566275467, 3.748999771376314, 2.991521781065486, 1.6618780721307727, 0.8053827049869463, 0.0), # 70
(10.365069660642929, 8.826867654542236, 8.299375071444901, 8.963305127818035, 7.496112052502757, 3.6426225549966977, 3.646350829769494, 3.0245482777015704, 3.9018074035970125, 1.7317400898356603, 1.347531228463977, 0.7662627447677263, 0.0, 10.119039887688615, 8.428890192444989, 6.737656142319885, 5.195220269506979, 7.803614807194025, 4.234367588782199, 3.646350829769494, 2.6018732535690696, 3.7480560262513785, 2.987768375939346, 1.6598750142889804, 0.8024425140492942, 0.0), # 71
(10.358739130434783, 8.793967741935482, 8.289114583333333, 8.95144769021739, 7.493627450980392, 3.6405833333333337, 3.634201680672269, 3.0108333333333333, 3.897125, 1.7264823529411768, 1.3451702551834133, 0.7648684210526316, 0.0, 10.115234375, 8.413552631578947, 6.7258512759170666, 5.179447058823529, 7.79425, 4.215166666666667, 3.634201680672269, 2.600416666666667, 3.746813725490196, 2.983815896739131, 1.6578229166666667, 0.7994516129032258, 0.0), # 72
(10.35094000119282, 8.760529000176998, 8.27861232567444, 8.939008730877617, 7.490561876328034, 3.638076804856983, 3.621887922521546, 2.9971732586495965, 3.8922601547020275, 1.7212067995373737, 1.3426157678145982, 0.7634365549218266, 0.0, 10.110541516632374, 8.397802104140093, 6.71307883907299, 5.163620398612119, 7.784520309404055, 4.196042562109435, 3.621887922521546, 2.598626289183559, 3.745280938164017, 2.979669576959206, 1.655722465134888, 0.7964117272888181, 0.0), # 73
(10.341718077175404, 8.726570412407629, 8.267871727823502, 8.926003950281803, 7.486931466688183, 3.6351200401361585, 3.609414857849861, 2.9835726261240665, 3.8872192691662857, 1.7159135587293908, 1.3398749729261428, 0.7619681090013557, 0.0, 10.104987032750344, 8.38164919901491, 6.699374864630713, 5.147740676188171, 7.774438538332571, 4.177001676573693, 3.609414857849861, 2.5965143143829703, 3.7434657333440917, 2.975334650093935, 1.6535743455647005, 0.7933245829461482, 0.0), # 74
(10.331119162640901, 8.692110961768218, 8.256896219135802, 8.912449048913043, 7.482752360203341, 3.6317301097393697, 3.59678778918975, 2.9700360082304527, 3.8820087448559666, 1.7106027596223679, 1.336955077086656, 0.7604640459172624, 0.0, 10.098596643518519, 8.365104505089885, 6.684775385433279, 5.131808278867102, 7.764017489711933, 4.158050411522634, 3.59678778918975, 2.594092935528121, 3.7413761801016703, 2.9708163496376816, 1.6513792438271604, 0.7901919056152927, 0.0), # 75
(10.319189061847677, 8.65716963139962, 8.245689228966622, 8.898359727254428, 7.478040695016003, 3.6279240842351275, 3.5840120190737474, 2.956567977442463, 3.876634983234263, 1.7052745313214452, 1.3338632868647486, 0.7589253282955902, 0.0, 10.091396069101508, 8.348178611251491, 6.669316434323743, 5.115823593964334, 7.753269966468526, 4.139195168419449, 3.5840120190737474, 2.5913743458822336, 3.7390203475080015, 2.96611990908481, 1.6491378457933243, 0.7870154210363293, 0.0), # 76
(10.305973579054093, 8.621765404442675, 8.234254186671238, 8.883751685789049, 7.472812609268672, 3.6237190341919425, 3.5710928500343897, 2.9431731062338065, 3.871104385764365, 1.699929002931763, 1.3306068088290313, 0.7573529187623839, 0.0, 10.083411029663925, 8.330882106386222, 6.653034044145156, 5.099787008795288, 7.74220877152873, 4.120442348727329, 3.5710928500343897, 2.58837073870853, 3.736406304634336, 2.9612505619296834, 1.6468508373342476, 0.7837968549493343, 0.0), # 77
(10.291518518518519, 8.585917264038233, 8.222594521604938, 8.868640625, 7.467084241103849, 3.6191320301783265, 3.5580355846042124, 2.9298559670781894, 3.8654233539094642, 1.6945663035584608, 1.327192849548113, 0.7557477799436866, 0.0, 10.074667245370371, 8.313225579380552, 6.635964247740564, 5.083698910675381, 7.7308467078189285, 4.101798353909466, 3.5580355846042124, 2.585094307270233, 3.7335421205519244, 2.956213541666667, 1.6445189043209878, 0.7805379330943849, 0.0), # 78
(10.275869684499314, 8.549644193327138, 8.210713663123, 8.85304224537037, 7.460871728664031, 3.61418014276279, 3.5448455253157505, 2.916621132449322, 3.859598289132754, 1.6891865623066789, 1.3236286155906039, 0.7541108744655421, 0.0, 10.065190436385459, 8.295219619120962, 6.618143077953018, 5.067559686920035, 7.719196578265508, 4.083269585429051, 3.5448455253157505, 2.5815572448305644, 3.7304358643320157, 2.951014081790124, 1.6421427326246, 0.7772403812115581, 0.0), # 79
(10.259072881254847, 8.51296517545024, 8.198615040580703, 8.836972247383253, 7.454191210091719, 3.6088804425138448, 3.5315279747015405, 2.9034731748209115, 3.853635592897424, 1.683789908281557, 1.3199213135251149, 0.7524431649539947, 0.0, 10.0550063228738, 8.27687481449394, 6.599606567625574, 5.05136972484467, 7.707271185794848, 4.064862444749276, 3.5315279747015405, 2.577771744652746, 3.7270956050458595, 2.945657415794418, 1.639723008116141, 0.7739059250409311, 0.0), # 80
(10.241173913043479, 8.475899193548386, 8.186302083333333, 8.82044633152174, 7.447058823529411, 3.60325, 3.5180882352941176, 2.890416666666667, 3.8475416666666664, 1.6783764705882358, 1.3160781499202554, 0.7507456140350878, 0.0, 10.044140624999999, 8.258201754385965, 6.580390749601277, 5.035129411764706, 7.695083333333333, 4.046583333333333, 3.5180882352941176, 2.57375, 3.7235294117647055, 2.940148777173914, 1.6372604166666667, 0.7705362903225808, 0.0), # 81
(10.222218584123576, 8.438465230762423, 8.17377822073617, 8.803480198268922, 7.43949070711961, 3.5973058857897686, 3.504531609626018, 2.8774561804602956, 3.841322911903673, 1.6729463783318543, 1.3121063313446355, 0.7490191843348656, 0.0, 10.03261906292867, 8.23921102768352, 6.560531656723177, 5.018839134995561, 7.682645823807346, 4.0284386526444145, 3.504531609626018, 2.5695042041355487, 3.719745353559805, 2.934493399422974, 1.634755644147234, 0.767133202796584, 0.0), # 82
(10.202252698753504, 8.400682270233196, 8.16104688214449, 8.78608954810789, 7.431502999004814, 3.591065170451659, 3.4908634002297765, 2.8645962886755068, 3.8349857300716352, 1.6674997606175532, 1.3080130643668657, 0.7472648384793719, 0.0, 10.020467356824417, 8.219913223273089, 6.540065321834328, 5.002499281852659, 7.6699714601432705, 4.01043480414571, 3.4908634002297765, 2.5650465503226134, 3.715751499502407, 2.9286965160359637, 1.632209376428898, 0.7636983882030178, 0.0), # 83
(10.181322061191626, 8.362569295101553, 8.14811149691358, 8.768290081521739, 7.423111837327523, 3.584544924554184, 3.477088909637929, 2.851841563786008, 3.8285365226337444, 1.6620367465504726, 1.3038055555555557, 0.7454835390946503, 0.0, 10.007711226851852, 8.200318930041153, 6.519027777777778, 4.986110239651417, 7.657073045267489, 3.9925781893004113, 3.477088909637929, 2.5603892318244172, 3.7115559186637617, 2.922763360507247, 1.629622299382716, 0.7602335722819594, 0.0), # 84
(10.159472475696308, 8.32414528850834, 8.13497549439872, 8.75009749899356, 7.414333360230238, 3.577762218665854, 3.463213440383012, 2.8391965782655086, 3.8219816910531925, 1.6565574652357518, 1.2994910114793157, 0.7436762488067449, 0.0, 9.994376393175584, 8.180438736874192, 6.497455057396579, 4.969672395707254, 7.643963382106385, 3.9748752095717124, 3.463213440383012, 2.5555444419041815, 3.707166680115119, 2.916699166331187, 1.626995098879744, 0.7567404807734855, 0.0), # 85
(10.136749746525913, 8.285429233594407, 8.121642303955191, 8.731527501006443, 7.405183705855455, 3.57073412335518, 3.44924229499756, 2.826665904587715, 3.815327636793172, 1.6510620457785314, 1.2950766387067558, 0.7418439302416996, 0.0, 9.98048857596022, 8.160283232658694, 6.475383193533778, 4.953186137335593, 7.630655273586344, 3.9573322664228017, 3.44924229499756, 2.550524373825129, 3.7025918529277275, 2.910509167002148, 1.6243284607910382, 0.7532208394176735, 0.0), # 86
(10.113199677938807, 8.246440113500597, 8.10811535493827, 8.712595788043478, 7.3956790123456795, 3.563477709190672, 3.4351807760141093, 2.8142541152263374, 3.8085807613168727, 1.645550617283951, 1.290569643806486, 0.7399875460255577, 0.0, 9.96607349537037, 8.139863006281134, 6.452848219032429, 4.936651851851852, 7.6171615226337455, 3.9399557613168725, 3.4351807760141093, 2.54534122085048, 3.6978395061728397, 2.904198596014493, 1.6216230709876542, 0.7496763739545999, 0.0), # 87
(10.088868074193357, 8.207196911367758, 8.094398076703246, 8.693318060587762, 7.385835417843406, 3.5560100467408424, 3.4210341859651954, 2.801965782655083, 3.8017474660874866, 1.6400233088571508, 1.2859772333471164, 0.7381080587843638, 0.0, 9.951156871570646, 8.119188646628, 6.429886166735582, 4.9200699265714505, 7.603494932174973, 3.9227520957171165, 3.4210341859651954, 2.540007176243459, 3.692917708921703, 2.897772686862588, 1.6188796153406495, 0.7461088101243417, 0.0), # 88
(10.063800739547922, 8.16771861033674, 8.080493898605397, 8.673710019122383, 7.375669060491138, 3.5483482065742016, 3.406807827383354, 2.7898054793476605, 3.794834152568206, 1.634480249603271, 1.2813066138972575, 0.7362064311441613, 0.0, 9.935764424725651, 8.098270742585774, 6.4065330694862865, 4.903440748809812, 7.589668305136412, 3.905727671086725, 3.406807827383354, 2.534534433267287, 3.687834530245569, 2.891236673040795, 1.6160987797210793, 0.7425198736669765, 0.0), # 89
(10.03804347826087, 8.128024193548386, 8.06640625, 8.653787364130435, 7.365196078431373, 3.5405092592592595, 3.3925070028011204, 2.7777777777777777, 3.7878472222222226, 1.6289215686274514, 1.2765649920255184, 0.7342836257309943, 0.0, 9.919921875, 8.077119883040936, 6.382824960127592, 4.886764705882353, 7.575694444444445, 3.888888888888889, 3.3925070028011204, 2.5289351851851856, 3.6825980392156863, 2.884595788043479, 1.6132812500000002, 0.7389112903225807, 0.0), # 90
(10.011642094590563, 8.088132644143545, 8.05213856024234, 8.63356579609501, 7.35443260980661, 3.532510275364528, 3.378137014751031, 2.7658872504191434, 3.780793076512727, 1.6233473950348318, 1.2717595743005101, 0.7323406051709063, 0.0, 9.903654942558298, 8.055746656879968, 6.35879787150255, 4.870042185104494, 7.561586153025454, 3.872242150586801, 3.378137014751031, 2.5232216252603767, 3.677216304903305, 2.8778552653650036, 1.6104277120484682, 0.7352847858312315, 0.0), # 91
(9.984642392795372, 8.048062945263066, 8.0376942586877, 8.613061015499195, 7.343394792759352, 3.524368325458518, 3.363703165765621, 2.754138469745466, 3.773678116902911, 1.6177578579305527, 1.2668975672908422, 0.7303783320899415, 0.0, 9.886989347565157, 8.034161652989356, 6.334487836454211, 4.853273573791657, 7.547356233805822, 3.8557938576436523, 3.363703165765621, 2.517405946756084, 3.671697396379676, 2.871020338499732, 1.6075388517375402, 0.7316420859330061, 0.0), # 92
(9.957090177133654, 8.00783408004779, 8.023076774691358, 8.592288722826089, 7.332098765432098, 3.5161004801097393, 3.349210758377425, 2.742536008230453, 3.766508744855967, 1.6121530864197533, 1.261986177565125, 0.7283977691141434, 0.0, 9.869950810185184, 8.012375460255576, 6.309930887825625, 4.836459259259259, 7.533017489711934, 3.839550411522634, 3.349210758377425, 2.5115003429355283, 3.666049382716049, 2.86409624094203, 1.6046153549382718, 0.727984916367981, 0.0), # 93
(9.92903125186378, 7.967465031638567, 8.008289537608597, 8.571264618558777, 7.320560665967347, 3.5077238098867043, 3.3346650951189805, 2.7310844383478132, 3.759291361835086, 1.6065332096075746, 1.2570326116919686, 0.7263998788695563, 0.0, 9.85256505058299, 7.990398667565118, 6.285163058459842, 4.819599628822722, 7.518582723670172, 3.823518213686939, 3.3346650951189805, 2.5055170070619317, 3.6602803329836733, 2.8570882061862592, 1.6016579075217197, 0.7243150028762335, 0.0), # 94
(9.90051142124411, 7.926974783176247, 7.993335976794697, 8.550004403180354, 7.308796632507598, 3.499255385357923, 3.320071478522822, 2.719788332571255, 3.7520323693034596, 1.6008983565991557, 1.2520440762399827, 0.7243856239822234, 0.0, 9.834857788923182, 7.968241863804456, 6.260220381199914, 4.8026950697974655, 7.504064738606919, 3.8077036655997567, 3.320071478522822, 2.4994681323985164, 3.654398316253799, 2.850001467726785, 1.5986671953589393, 0.7206340711978407, 0.0), # 95
(9.871576489533012, 7.886382317801674, 7.978219521604939, 8.528523777173913, 7.296822803195352, 3.4907122770919066, 3.3054352111214853, 2.708652263374486, 3.7447381687242793, 1.5952486564996373, 1.247027777777778, 0.7223559670781895, 0.0, 9.816854745370371, 7.945915637860083, 6.23513888888889, 4.785745969498911, 7.489476337448559, 3.7921131687242804, 3.3054352111214853, 2.4933659122085046, 3.648411401597676, 2.8428412590579715, 1.595643904320988, 0.7169438470728796, 0.0), # 96
(9.842272260988848, 7.845706618655694, 7.962943601394604, 8.506838441022543, 7.284655316173109, 3.482111555657166, 3.2907615954475067, 2.697680803231215, 3.7374151615607376, 1.589584238414159, 1.2419909228739638, 0.7203118707834976, 0.0, 9.798581640089164, 7.923430578618472, 6.209954614369819, 4.768752715242476, 7.474830323121475, 3.7767531245237014, 3.2907615954475067, 2.4872225397551184, 3.6423276580865545, 2.8356128136741816, 1.5925887202789208, 0.7132460562414268, 0.0), # 97
(9.812644539869984, 7.804966668879153, 7.947511645518976, 8.48496409520934, 7.272310309583368, 3.4734702916222124, 3.276055934033421, 2.68687852461515, 3.7300697492760246, 1.5839052314478608, 1.236940718097151, 0.7182542977241916, 0.0, 9.78006419324417, 7.900797274966106, 6.184703590485755, 4.751715694343581, 7.460139498552049, 3.7616299344612103, 3.276055934033421, 2.48105020830158, 3.636155154791684, 2.8283213650697805, 1.589502329103795, 0.7095424244435595, 0.0), # 98
(9.782739130434782, 7.764181451612902, 7.931927083333334, 8.462916440217391, 7.259803921568627, 3.464805555555556, 3.261323529411765, 2.67625, 3.7227083333333333, 1.5782117647058826, 1.2318843700159492, 0.7161842105263159, 0.0, 9.761328125, 7.878026315789473, 6.159421850079745, 4.734635294117647, 7.445416666666667, 3.7467500000000005, 3.261323529411765, 2.474861111111111, 3.6299019607843137, 2.820972146739131, 1.5863854166666669, 0.7058346774193549, 0.0), # 99
(9.752601836941611, 7.723369949997786, 7.916193344192958, 8.44071117652979, 7.247152290271389, 3.4561344180257074, 3.2465696841150726, 2.665799801859473, 3.715337315195854, 1.572503967293365, 1.2268290851989685, 0.714102571815914, 0.0, 9.742399155521262, 7.8551282899750525, 6.134145425994841, 4.717511901880093, 7.430674630391708, 3.732119722603262, 3.2465696841150726, 2.468667441446934, 3.6235761451356945, 2.8135703921765973, 1.5832386688385918, 0.7021245409088898, 0.0), # 100
(9.722278463648834, 7.682551147174654, 7.900313857453133, 8.41836400462963, 7.234371553834153, 3.4474739496011786, 3.231799700675881, 2.6555325026672763, 3.7079630963267793, 1.5667819683154474, 1.2217820702148188, 0.7120103442190294, 0.0, 9.723303004972564, 7.832113786409323, 6.108910351074094, 4.7003459049463405, 7.415926192653559, 3.7177455037341867, 3.231799700675881, 2.4624813925722706, 3.6171857769170765, 2.806121334876544, 1.5800627714906266, 0.6984137406522414, 0.0), # 101
(9.691814814814816, 7.641744026284349, 7.884292052469135, 8.395890625, 7.221477850399419, 3.4388412208504806, 3.217018881626725, 2.645452674897119, 3.7005920781893, 1.56104589687727, 1.2167505316321108, 0.7099084903617069, 0.0, 9.704065393518519, 7.808993393978774, 6.083752658160553, 4.683137690631809, 7.4011841563786, 3.703633744855967, 3.217018881626725, 2.4563151577503435, 3.6107389251997093, 2.798630208333334, 1.5768584104938272, 0.6947040023894864, 0.0), # 102
(9.661256694697919, 7.60096757046772, 7.8681313585962505, 8.373306738123993, 7.208487318109686, 3.430253302342123, 3.20223252950014, 2.63556489102271, 3.6932306622466085, 1.5552958820839726, 1.211741676019454, 0.7077979728699895, 0.0, 9.68471204132373, 7.785777701569883, 6.058708380097269, 4.6658876462519165, 7.386461324493217, 3.689790847431794, 3.20223252950014, 2.4501809302443736, 3.604243659054843, 2.7911022460413317, 1.5736262717192502, 0.6909970518607019, 0.0), # 103
(9.63064990755651, 7.560240762865614, 7.851835205189758, 8.350628044484703, 7.195416095107452, 3.421727264644617, 3.187445946828663, 2.6258737235177567, 3.685885249961896, 1.5495320530406955, 1.2067627099454585, 0.7056797543699213, 0.0, 9.665268668552812, 7.762477298069133, 6.033813549727292, 4.648596159122086, 7.371770499923792, 3.6762232129248593, 3.187445946828663, 2.4440909033175835, 3.597708047553726, 2.783542681494901, 1.5703670410379515, 0.687294614805965, 0.0), # 104
(9.600040257648953, 7.519582586618876, 7.835407021604938, 8.327870244565217, 7.182280319535221, 3.4132801783264752, 3.172664436144829, 2.6163837448559675, 3.6785622427983538, 1.5437545388525786, 1.201820839978735, 0.7035547974875461, 0.0, 9.64576099537037, 7.739102772363006, 6.009104199893674, 4.631263616557734, 7.3571244855967075, 3.662937242798354, 3.172664436144829, 2.4380572702331964, 3.5911401597676105, 2.775956748188406, 1.5670814043209877, 0.6835984169653525, 0.0), # 105
(9.569473549233614, 7.479012024868357, 7.818850237197074, 8.305049038848631, 7.1690961295354905, 3.404929113956206, 3.1578932999811724, 2.6070995275110502, 3.6712680422191735, 1.5379634686247616, 1.1969232726878927, 0.701424064848908, 0.0, 9.626214741941014, 7.715664713337986, 5.9846163634394625, 4.613890405874283, 7.342536084438347, 3.6499393385154706, 3.1578932999811724, 2.4320922242544327, 3.5845480647677452, 2.768349679616211, 1.5637700474394147, 0.6799101840789417, 0.0), # 106
(9.538995586568856, 7.438548060754901, 7.802168281321446, 8.282180127818036, 7.155879663250759, 3.3966911421023225, 3.1431378408702306, 2.5980256439567144, 3.6640090496875475, 1.532158971462385, 1.1920772146415421, 0.6992885190800504, 0.0, 9.606655628429355, 7.692173709880553, 5.96038607320771, 4.596476914387154, 7.328018099375095, 3.6372359015394005, 3.1431378408702306, 2.426207958644516, 3.5779398316253794, 2.760726709272679, 1.5604336562642893, 0.6762316418868093, 0.0), # 107
(9.508652173913044, 7.398209677419356, 7.785364583333334, 8.259279211956523, 7.1426470588235285, 3.3885833333333335, 3.1284033613445374, 2.589166666666667, 3.656791666666667, 1.5263411764705888, 1.1872898724082936, 0.6971491228070177, 0.0, 9.587109375, 7.668640350877193, 5.936449362041468, 4.579023529411765, 7.313583333333334, 3.624833333333334, 3.1284033613445374, 2.4204166666666667, 3.5713235294117642, 2.7530930706521746, 1.557072916666667, 0.6725645161290325, 0.0), # 108
(9.478489115524543, 7.358015858002567, 7.768442572588021, 8.23636199174718, 7.129414454396299, 3.3806227582177515, 3.113695163936631, 2.580527168114617, 3.6496222946197223, 1.5205102127545123, 1.1825684525567568, 0.6950068386558532, 0.0, 9.567601701817559, 7.645075225214384, 5.9128422627837836, 4.561530638263536, 7.299244589239445, 3.612738035360464, 3.113695163936631, 2.4147305415841083, 3.5647072271981495, 2.7454539972490606, 1.5536885145176043, 0.668910532545688, 0.0), # 109
(9.448552215661715, 7.317985585645383, 7.751405678440788, 8.213444167673108, 7.116197988111569, 3.3728264873240867, 3.0990185511790447, 2.5721117207742723, 3.6425073350099066, 1.5146662094192962, 1.177920161655542, 0.6928626292526012, 0.0, 9.54815832904664, 7.621488921778612, 5.8896008082777085, 4.543998628257887, 7.285014670019813, 3.600956409083981, 3.0990185511790447, 2.409161776660062, 3.5580989940557846, 2.737814722557703, 1.5502811356881578, 0.6652714168768531, 0.0), # 110
(9.41888727858293, 7.278137843488651, 7.7342573302469155, 8.190541440217391, 7.103013798111837, 3.365211591220851, 3.0843788256043156, 2.5639248971193416, 3.635453189300412, 1.5088092955700803, 1.173352206273259, 0.6907174572233054, 0.0, 9.528804976851852, 7.597892029456357, 5.866761031366295, 4.526427886710239, 7.270906378600824, 3.5894948559670783, 3.0843788256043156, 2.4037225651577505, 3.5515068990559184, 2.7301804800724643, 1.546851466049383, 0.6616488948626047, 0.0), # 111
(9.38954010854655, 7.238491614673214, 7.717000957361684, 8.167669509863124, 7.089878022539605, 3.357795140476554, 3.069781289744979, 2.5559712696235333, 3.628466258954427, 1.5029396003120044, 1.1688717929785184, 0.6885722851940093, 0.0, 9.509567365397805, 7.574295137134101, 5.844358964892591, 4.5088188009360115, 7.256932517908854, 3.5783597774729463, 3.069781289744979, 2.3984251003403956, 3.5449390112698027, 2.7225565032877084, 1.543400191472337, 0.6580446922430195, 0.0), # 112
(9.360504223703044, 7.1991320672204555, 7.699681523543391, 8.14487541186903, 7.076783786782469, 3.3505906987084666, 3.0552629818283847, 2.548271903658586, 3.6215709370862066, 1.4970761841531826, 1.1644873176921446, 0.6864327447087024, 0.0, 9.490443900843221, 7.550760191795725, 5.8224365884607225, 4.491228552459547, 7.243141874172413, 3.5675806651220205, 3.0552629818283847, 2.3932790705060474, 3.5383918933912346, 2.7149584706230105, 1.5399363047086783, 0.654466551565496, 0.0), # 113
(9.331480897900065, 7.16044741823174, 7.682538062518016, 8.122342065958001, 7.063595569710884, 3.343581854975776, 3.0410091042052896, 2.5409213581271333, 3.6148730119043533, 1.491328791978196, 1.1602073895188663, 0.684326014342748, 0.0, 9.471275414160035, 7.5275861577702265, 5.801036947594331, 4.473986375934587, 7.229746023808707, 3.557289901377987, 3.0410091042052896, 2.3882727535541255, 3.531797784855442, 2.7074473553193346, 1.5365076125036032, 0.6509497652937947, 0.0), # 114
(9.302384903003995, 7.122451598792792, 7.665580777256098, 8.100063378886334, 7.050271785259067, 3.3367503822909463, 3.027029825095781, 2.533917772616129, 3.6083749928895963, 1.4857063319970194, 1.1560257519045158, 0.6822531318799043, 0.0, 9.452006631660376, 7.5047844506789465, 5.7801287595225785, 4.457118995991058, 7.216749985779193, 3.5474848816625806, 3.027029825095781, 2.3833931302078186, 3.5251358926295335, 2.700021126295445, 1.5331161554512198, 0.647495599890254, 0.0), # 115
(9.273179873237634, 7.0850892578507265, 7.648776824986561, 8.077999612699802, 7.036792350922519, 3.330080178417474, 3.0133024087639466, 2.5272417970412473, 3.6020604464092765, 1.480198339612387, 1.1519343218785802, 0.6802102664572789, 0.0, 9.43260725975589, 7.482312931030067, 5.7596716093929015, 4.44059501883716, 7.204120892818553, 3.5381385158577463, 3.0133024087639466, 2.3786286988696244, 3.5183961754612594, 2.6926665375666015, 1.5297553649973124, 0.6440990234409752, 0.0), # 116
(9.243829442823772, 7.04830504435266, 7.632093362938321, 8.056111029444182, 7.02313718419674, 3.323555141118853, 2.9998041194738763, 2.5208740813181603, 3.5959129388307343, 1.4747943502270324, 1.1479250164705472, 0.6781935872119792, 0.0, 9.413047004858225, 7.46012945933177, 5.739625082352736, 4.424383050681096, 7.1918258776614685, 3.5292237138454245, 2.9998041194738763, 2.3739679579420376, 3.51156859209837, 2.6853703431480613, 1.5264186725876645, 0.6407550040320601, 0.0), # 117
(9.214297245985211, 7.0120436072457135, 7.615497548340306, 8.03435789116525, 7.009286202577227, 3.317159168158581, 2.9865122214896576, 2.51479527536254, 3.5899160365213114, 1.46948389924369, 1.143989752709904, 0.6761992632811126, 0.0, 9.393295573379024, 7.438191896092237, 5.71994876354952, 4.40845169773107, 7.179832073042623, 3.5207133855075567, 2.9865122214896576, 2.369399405827558, 3.5046431012886137, 2.678119297055084, 1.5230995096680613, 0.6374585097496104, 0.0), # 118
(9.184546916944742, 6.976249595477001, 7.598956538421437, 8.012700459908778, 6.99521932355948, 3.3108761573001524, 2.973403979075378, 2.5089860290900607, 3.5840533058483475, 1.4642565220650932, 1.1401204476261382, 0.6742234638017862, 0.0, 9.373322671729932, 7.416458101819647, 5.70060223813069, 4.392769566195279, 7.168106611696695, 3.5125804407260848, 2.973403979075378, 2.3649115409286803, 3.49760966177974, 2.670900153302927, 1.5197913076842873, 0.6342045086797276, 0.0), # 119
(9.154542089925162, 6.940867657993644, 7.582437490410635, 7.991098997720545, 6.980916464638998, 3.304690006307063, 2.9604566564951265, 2.5034269924163928, 3.578308313179186, 1.4591017540939766, 1.136309018248736, 0.6722623579111081, 0.0, 9.353098006322597, 7.394885937022188, 5.68154509124368, 4.377305262281929, 7.156616626358372, 3.50479778938295, 2.9604566564951265, 2.360492861647902, 3.490458232319499, 2.663699665906849, 1.516487498082127, 0.6309879689085133, 0.0), # 120
(9.124246399149268, 6.90584244374276, 7.565907561536823, 7.969513766646325, 6.966357543311279, 3.29858461294281, 2.94764751801299, 2.4980988152572112, 3.572664624881166, 1.4540091307330743, 1.1325473816071863, 0.6703121147461852, 0.0, 9.33259128356866, 7.373433262208036, 5.662736908035931, 4.362027392199222, 7.145329249762332, 3.497338341360096, 2.94764751801299, 2.356131866387721, 3.4831787716556395, 2.656504588882109, 1.5131815123073646, 0.6278038585220692, 0.0), # 121
(9.093623478839854, 6.871118601671464, 7.549333909028926, 7.947905028731892, 6.951522477071823, 3.292543874970886, 2.9349538278930587, 2.492982147528187, 3.5671058073216297, 1.4489681873851195, 1.1288274547309753, 0.6683689034441251, 0.0, 9.31177220987977, 7.352057937885375, 5.644137273654876, 4.346904562155357, 7.1342116146432595, 3.490175006539462, 2.9349538278930587, 2.351817053550633, 3.4757612385359113, 2.6493016762439643, 1.5098667818057854, 0.6246471456064968, 0.0), # 122
(9.062636963219719, 6.836640780726876, 7.532683690115864, 7.92623304602302, 6.936391183416127, 3.28655169015479, 2.9223528503994194, 2.4880576391449933, 3.5616154268679177, 1.443968459452847, 1.1251411546495909, 0.6664288931420351, 0.0, 9.290610491667572, 7.330717824562385, 5.625705773247954, 4.33190537835854, 7.123230853735835, 3.4832806948029904, 2.9223528503994194, 2.3475369215391355, 3.4681955917080636, 2.642077682007674, 1.5065367380231727, 0.621512798247898, 0.0), # 123
(9.031250486511654, 6.802353629856113, 7.515924062026559, 7.90445808056549, 6.920943579839691, 3.2805919562580144, 2.9098218497961597, 2.483305940023303, 3.5561770498873715, 1.4389994823389904, 1.1214803983925201, 0.664488252977023, 0.0, 9.269075835343711, 7.309370782747252, 5.6074019919625995, 4.316998447016971, 7.112354099774743, 3.476628316032624, 2.9098218497961597, 2.3432799687557244, 3.4604717899198456, 2.634819360188497, 1.5031848124053118, 0.618395784532374, 0.0), # 124
(8.999427682938459, 6.768201798006293, 7.499022181989936, 7.88254039440507, 6.905159583838015, 3.274648571044058, 2.8973380903473696, 2.478707700078788, 3.5507742427473308, 1.4340507914462837, 1.1178371029892504, 0.6625431520861957, 0.0, 9.247137947319828, 7.2879746729481525, 5.5891855149462515, 4.30215237433885, 7.1015484854946616, 3.470190780110303, 2.8973380903473696, 2.3390346936028985, 3.4525797919190073, 2.6275134648016905, 1.4998044363979874, 0.6152910725460268, 0.0), # 125
(8.967132186722928, 6.734129934124536, 7.481945207234916, 7.8604402495875405, 6.889019112906595, 3.2687054322764144, 2.884878836317135, 2.474243569227122, 3.545390571815139, 1.4291119221774609, 1.1142031854692689, 0.6605897596066612, 0.0, 9.224766534007578, 7.266487355673273, 5.571015927346345, 4.287335766532382, 7.090781143630278, 3.463940996917971, 2.884878836317135, 2.334789594483153, 3.4445095564532977, 2.620146749862514, 1.4963890414469831, 0.6121936303749579, 0.0), # 126
(8.93432763208786, 6.7000826871579555, 7.464660294990421, 7.838117908158674, 6.8725020845409315, 3.26274643771858, 2.872421351969547, 2.469894197383977, 3.5400096034581354, 1.4241724099352562, 1.1105705628620632, 0.6586242446755264, 0.0, 9.201931301818599, 7.244866691430789, 5.552852814310316, 4.272517229805768, 7.080019206916271, 3.457851876337568, 2.872421351969547, 2.3305331697989855, 3.4362510422704657, 2.612705969386225, 1.4929320589980841, 0.6090984261052688, 0.0), # 127
(8.900977653256046, 6.666004706053673, 7.447134602485375, 7.815533632164248, 6.855588416236526, 3.2567554851340508, 2.859942901568691, 2.465640234465026, 3.534614904043661, 1.4192217901224033, 1.1069311521971208, 0.6566427764298991, 0.0, 9.178601957164537, 7.223070540728888, 5.534655760985604, 4.257665370367209, 7.069229808087322, 3.4518963282510366, 2.859942901568691, 2.3262539179528936, 3.427794208118263, 2.6051778773880834, 1.4894269204970751, 0.6060004278230613, 0.0), # 128
(8.867045884450281, 6.631840639758805, 7.4293352869486995, 7.792647683650037, 6.838258025488874, 3.250716472286322, 2.8474207493786565, 2.4614623303859418, 3.529190039939058, 1.4142495981416365, 1.1032768705039286, 0.6546415240068865, 0.0, 9.154748206457038, 7.20105676407575, 5.516384352519642, 4.242748794424909, 7.058380079878116, 3.4460472625403185, 2.8474207493786565, 2.321940337347373, 3.419129012744437, 2.597549227883346, 1.4858670573897401, 0.6028946036144368, 0.0), # 129
(8.832495959893366, 6.5975351372204685, 7.411229505609316, 7.769420324661814, 6.820490829793475, 3.2446132969388883, 2.8348321596635313, 2.457341135062396, 3.5237185775116666, 1.4092453693956895, 1.0995996348119743, 0.6526166565435961, 0.0, 9.130339756107748, 7.178783221979556, 5.4979981740598705, 4.2277361081870675, 7.047437155023333, 3.4402775890873545, 2.8348321596635313, 2.3175809263849203, 3.4102454148967376, 2.589806774887272, 1.4822459011218634, 0.5997759215654973, 0.0), # 130
(8.797291513808094, 6.563032847385783, 7.392784415696151, 7.7458118172453565, 6.802266746645829, 3.238429856855247, 2.8221543966874045, 2.4532572984100627, 3.5181840831288285, 1.4041986392872965, 1.0958913621507447, 0.6505643431771354, 0.0, 9.105346312528312, 7.156207774948489, 5.479456810753724, 4.212595917861889, 7.036368166257657, 3.4345602177740875, 2.8221543966874045, 2.3131641834680337, 3.4011333733229145, 2.5819372724151193, 1.4785568831392302, 0.596639349762344, 0.0), # 131
(8.76139618041726, 6.528278419201865, 7.373967174438122, 7.72178242344644, 6.783565693541435, 3.2321500497988933, 2.8093647247143627, 2.449191470344614, 3.5125701231578845, 1.3990989432191914, 1.0921439695497275, 0.6484807530446118, 0.0, 9.079737582130376, 7.13328828349073, 5.460719847748638, 4.1972968296575734, 7.025140246315769, 3.4288680584824593, 2.8093647247143627, 2.3086786069992096, 3.3917828467707176, 2.573927474482147, 1.4747934348876244, 0.5934798562910787, 0.0), # 132
(8.724773593943663, 6.493216501615832, 7.354744939064153, 7.697292405310838, 6.764367587975791, 3.225757773533322, 2.7964404080084946, 2.445124300781722, 3.5068602639661752, 1.3939358165941083, 1.0883493740384103, 0.6463620552831327, 0.0, 9.053483271325586, 7.10998260811446, 5.44174687019205, 4.181807449782324, 7.0137205279323505, 3.4231740210944106, 2.7964404080084946, 2.3041126953809443, 3.3821837939878954, 2.5657641351036133, 1.4709489878128308, 0.590292409237803, 0.0), # 133
(8.687387388610095, 6.457791743574804, 7.33508486680317, 7.672302024884328, 6.7446523474443945, 3.2192369258220297, 2.7833587108338893, 2.44103643963706, 3.5010380719210428, 1.388698794814781, 1.0844994926462799, 0.6442044190298056, 0.0, 9.026553086525583, 7.0862486093278605, 5.422497463231399, 4.166096384444343, 7.0020761438420855, 3.417451015491884, 2.7833587108338893, 2.2994549470157355, 3.3723261737221972, 2.557434008294776, 1.4670169733606342, 0.5870719766886187, 0.0), # 134
(8.649201198639354, 6.421948794025897, 7.314954114884091, 7.646771544212684, 6.724399889442747, 3.212571404428512, 2.770096897454634, 2.4369085368263, 3.4950871133898262, 1.3833774132839443, 1.0805862424028239, 0.6420040134217377, 0.0, 8.99891673414202, 7.0620441476391145, 5.402931212014119, 4.150132239851832, 6.9901742267796525, 3.41167195155682, 2.770096897454634, 2.2946938603060802, 3.3621999447213735, 2.548923848070895, 1.4629908229768183, 0.583813526729627, 0.0), # 135
(8.610178658254235, 6.385632301916229, 7.294319840535841, 7.62066122534168, 6.703590131466344, 3.205745107116265, 2.7566322321348173, 2.4327212422651154, 3.4889909547398688, 1.3779612074043308, 1.0766015403375297, 0.6397570075960368, 0.0, 8.970543920586536, 7.037327083556404, 5.383007701687648, 4.133883622212991, 6.9779819094797375, 3.4058097391711617, 2.7566322321348173, 2.289817933654475, 3.351795065733172, 2.540220408447227, 1.4588639681071682, 0.58051202744693, 0.0), # 136
(8.570283401677534, 6.348786916192918, 7.273149200987342, 7.593931330317094, 6.682202991010689, 3.1987419316487826, 2.7429419791385277, 2.428455205869179, 3.4827331623385107, 1.3724397125786756, 1.0725373034798844, 0.63745957068981, 0.0, 8.941404352270776, 7.012055277587909, 5.362686517399421, 4.117319137736026, 6.965466324677021, 3.3998372882168506, 2.7429419791385277, 2.284815665463416, 3.3411014955053444, 2.5313104434390317, 1.4546298401974684, 0.577162446926629, 0.0), # 137
(8.529479063132047, 6.311357285803083, 7.251409353467515, 7.566542121184698, 6.660218385571278, 3.1915457757895624, 2.729003402729852, 2.4240910775541624, 3.4762973025530934, 1.3668024642097119, 1.0683854488593754, 0.6351078718401649, 0.0, 8.91146773560639, 6.986186590241813, 5.341927244296877, 4.100407392629135, 6.952594605106187, 3.3937275085758274, 2.729003402729852, 2.2796755541354017, 3.330109192785639, 2.5221807070615663, 1.450281870693503, 0.5737597532548258, 0.0), # 138
(8.487729276840568, 6.273288059693839, 7.229067455205284, 7.538453859990269, 6.63761623264361, 3.184140537302099, 2.7147937671728797, 2.4196095072357395, 3.469666941750957, 1.3610389977001744, 1.0641378935054902, 0.6326980801842089, 0.0, 8.880703777005019, 6.959678882026297, 5.32068946752745, 4.083116993100523, 6.939333883501914, 3.3874533101300353, 2.7147937671728797, 2.274386098072928, 3.318808116321805, 2.51281795333009, 1.4458134910410567, 0.5702989145176218, 0.0), # 139
(8.444997677025897, 6.234523886812306, 7.206090663429573, 7.509626808779583, 6.614376449723186, 3.176510113949888, 2.7002903367316984, 2.4149911448295818, 3.462825646299444, 1.3551388484527966, 1.0597865544477159, 0.6302263648590494, 0.0, 8.849082182878314, 6.932490013449542, 5.298932772238579, 4.0654165453583895, 6.925651292598888, 3.3809876027614147, 2.7002903367316984, 2.2689357956784915, 3.307188224861593, 2.5032089362598615, 1.4412181326859146, 0.5667748988011189, 0.0), # 140
(8.40124789791083, 6.195009416105602, 7.1824461353693, 7.480021229598415, 6.590478954305501, 3.1686384034964257, 2.6854703756703975, 2.4102166402513627, 3.455756982565893, 1.349091551870313, 1.0553233487155398, 0.6276888950017938, 0.0, 8.816572659637913, 6.904577845019731, 5.276616743577699, 4.047274655610939, 6.911513965131786, 3.3743032963519077, 2.6854703756703975, 2.26331314535459, 3.2952394771527507, 2.4933404098661387, 1.4364892270738603, 0.5631826741914184, 0.0), # 141
(8.356443573718156, 6.154689296520844, 7.158101028253392, 7.44959738449254, 6.565903663886058, 3.1605093037052074, 2.670311148253063, 2.4052666434167547, 3.448444516917647, 1.3428866433554572, 1.0507401933384497, 0.6250818397495496, 0.0, 8.783144913695466, 6.875900237245045, 5.253700966692247, 4.028659930066371, 6.896889033835294, 3.3673733007834565, 2.670311148253063, 2.2575066455037196, 3.282951831943029, 2.4831991281641805, 1.4316202056506786, 0.5595172087746222, 0.0), # 142
(8.310548338670674, 6.113508177005149, 7.133022499310772, 7.418315535507731, 6.540630495960352, 3.152106712339729, 2.6547899187437842, 2.4001218042414303, 3.4408718157220486, 1.3365136583109634, 1.0460290053459322, 0.6224013682394242, 0.0, 8.748768651462617, 6.846415050633665, 5.230145026729661, 4.009540974932889, 6.881743631444097, 3.360170525938002, 2.6547899187437842, 2.251504794528378, 3.270315247980176, 2.472771845169244, 1.4266044998621543, 0.5557734706368318, 0.0), # 143
(8.263525826991184, 6.071410706505636, 7.107177705770357, 7.386135944689768, 6.514639368023886, 3.1434145271634857, 2.6388839514066493, 2.3947627726410623, 3.4330224453464364, 1.3299621321395652, 1.0411817017674754, 0.619643649608525, 0.0, 8.713413579351014, 6.816080145693774, 5.205908508837376, 3.9898863964186946, 6.866044890692873, 3.3526678816974873, 2.6388839514066493, 2.245296090831061, 3.257319684011943, 2.4620453148965895, 1.4214355411540713, 0.5519464278641489, 0.0), # 144
(8.215339672902477, 6.0283415339694235, 7.080533804861075, 7.353018874084421, 6.487910197572155, 3.134416645939974, 2.6225705105057466, 2.3891701985313234, 3.424879972158151, 1.3232216002439972, 1.036190199632566, 0.6168048529939595, 0.0, 8.6770494037723, 6.784853382933553, 5.180950998162829, 3.969664800731991, 6.849759944316302, 3.344838277943853, 2.6225705105057466, 2.238869032814267, 3.2439550987860777, 2.451006291361474, 1.4161067609722149, 0.548031048542675, 0.0), # 145
(8.16595351062735, 5.984245308343629, 7.053057953811847, 7.318924585737469, 6.460422902100661, 3.1250969664326886, 2.605826860305165, 2.3833247318278863, 3.4164279625245353, 1.3162815980269928, 1.0310464159706916, 0.6138811475328351, 0.0, 8.639645831138118, 6.7526926228611845, 5.155232079853457, 3.948844794080978, 6.832855925049071, 3.3366546245590407, 2.605826860305165, 2.2322121188804918, 3.2302114510503306, 2.439641528579157, 1.4106115907623695, 0.5440223007585119, 0.0), # 146
(8.1153309743886, 5.93906667857537, 7.024717309851591, 7.283813341694685, 6.4321573991049, 3.1154393864051255, 2.5886302650689905, 2.3772070224464232, 3.40764998281293, 1.3091316608912866, 1.0257422678113395, 0.6108687023622593, 0.0, 8.601172567860118, 6.719555725984851, 5.1287113390566965, 3.9273949826738592, 6.81529996562586, 3.3280898314249923, 2.5886302650689905, 2.2253138474322327, 3.21607869955245, 2.4279377805648954, 1.4049434619703185, 0.5399151525977609, 0.0), # 147
(8.063435698409021, 5.892750293611764, 6.9954790302092364, 7.247645404001847, 6.403093606080374, 3.105427803620781, 2.5709579890613132, 2.3707977203026074, 3.398529599390676, 1.301761324239612, 1.0202696721839972, 0.6077636866193392, 0.0, 8.561599320349941, 6.68540055281273, 5.101348360919985, 3.905283972718835, 6.797059198781352, 3.3191168084236504, 2.5709579890613132, 2.2181627168719866, 3.201546803040187, 2.4158818013339496, 1.3990958060418472, 0.535704572146524, 0.0), # 148
(8.010231316911412, 5.845240802399927, 6.965310272113703, 7.210381034704727, 6.37321144052258, 3.0950461158431497, 2.5527872965462204, 2.3640774753121114, 3.3890503786251127, 1.2941601234747035, 1.0146205461181517, 0.6045622694411826, 0.0, 8.520895795019237, 6.650184963853008, 5.073102730590758, 3.88248037042411, 6.778100757250225, 3.3097084654369557, 2.5527872965462204, 2.21074722560225, 3.18660572026129, 2.403460344901576, 1.3930620544227408, 0.5313855274909026, 0.0), # 149
(7.955681464118564, 5.796482853886981, 6.934178192793912, 7.171980495849104, 6.342490819927017, 3.0842782208357287, 2.5340954517878003, 2.3570269373906068, 3.3791958868835836, 1.2863175939992944, 1.0087868066432906, 0.601260619964897, 0.0, 8.479031698279647, 6.6138668196138655, 5.043934033216452, 3.8589527819978824, 6.758391773767167, 3.2998377123468496, 2.5340954517878003, 2.2030558720255207, 3.1712454099635083, 2.390660165283035, 1.3868356385587826, 0.5269529867169983, 0.0), # 150
(7.899749774253275, 5.746421097020041, 6.902049949478785, 7.132404049480748, 6.310911661789184, 3.0731080163620113, 2.5148597190501416, 2.3496267564537683, 3.3689496905334293, 1.2782232712161197, 1.002760370788901, 0.5978549073275894, 0.0, 8.435976736542818, 6.576403980603482, 5.013801853944504, 3.8346698136483583, 6.737899381066859, 3.2894774590352753, 2.5148597190501416, 2.1950771545442938, 3.155455830894592, 2.377468016493583, 1.3804099898957571, 0.5224019179109128, 0.0), # 151
(7.842399881538343, 5.6950001807462245, 6.868892699397251, 7.091611957645439, 6.278453883604579, 3.0615194001854955, 2.4950573625973322, 2.3418575824172674, 3.3582953559419897, 1.2698666905279126, 0.9965331555844703, 0.5943413006663675, 0.0, 8.391700616220398, 6.537754307330042, 4.982665777922351, 3.809600071583737, 6.716590711883979, 3.2786006153841742, 2.4950573625973322, 2.1867995715610684, 3.1392269418022893, 2.36387065254848, 1.3737785398794504, 0.5177272891587478, 0.0), # 152
(7.78359542019656, 5.642164754012652, 6.834673599778224, 7.049564482388949, 6.245097402868703, 3.049496270069676, 2.4746656466934596, 2.333700065196776, 3.3472164494766075, 1.2612373873374074, 0.9900970780594861, 0.5907159691183387, 0.0, 8.346173043724027, 6.497875660301725, 4.95048539029743, 3.783712162012222, 6.694432898953215, 3.2671800912754865, 2.4746656466934596, 2.17821162147834, 3.1225487014343516, 2.3498548274629836, 1.3669347199556448, 0.5129240685466048, 0.0), # 153
(7.723300024450729, 5.587859465766439, 6.7993598078506325, 7.006221885757057, 6.210822137077053, 3.0370225237780484, 2.453661835602614, 2.325134854707968, 3.3356965375046217, 1.2523248970473384, 0.9834440552434354, 0.5869750818206104, 0.0, 8.299363725465357, 6.456725900026714, 4.917220276217177, 3.7569746911420143, 6.671393075009243, 3.2551887965911552, 2.453661835602614, 2.169301802698606, 3.1054110685385266, 2.335407295252353, 1.3598719615701265, 0.5079872241605854, 0.0), # 154
(7.6614773285236355, 5.532028964954703, 6.762918480843396, 6.961544429795533, 6.175608003725131, 3.0240820590741087, 2.4320231935888805, 2.316142600866515, 3.323719186393376, 1.2431187550604388, 0.9765660041658056, 0.5831148079102902, 0.0, 8.251242367856026, 6.414262887013191, 4.882830020829028, 3.7293562651813157, 6.647438372786752, 3.242599641213121, 2.4320231935888805, 2.160058613624363, 3.0878040018625654, 2.320514809931845, 1.3525836961686795, 0.5029117240867913, 0.0), # 155
(7.598090966638081, 5.474617900524564, 6.725316775985439, 6.915492376550157, 6.139434920308432, 3.0106587737213526, 2.40972698491635, 2.3067039535880913, 3.3112679625102084, 1.2336084967794434, 0.9694548418560842, 0.5791313165244852, 0.0, 8.201778677307685, 6.370444481769337, 4.84727420928042, 3.7008254903383295, 6.622535925020417, 3.2293855350233276, 2.40972698491635, 2.150470552658109, 3.069717460154216, 2.3051641255167192, 1.3450633551970879, 0.49769253641132405, 0.0), # 156
(7.533104573016862, 5.415570921423138, 6.686521850505682, 6.868025988066703, 6.102282804322456, 2.9967365654832747, 2.3867504738491094, 2.2967995627883675, 3.2983264322224626, 1.2237836576070855, 0.9621024853437583, 0.5750207768003032, 0.0, 8.150942360231976, 6.325228544803333, 4.810512426718791, 3.671350972821256, 6.596652864444925, 3.2155193879037145, 2.3867504738491094, 2.140526118202339, 3.051141402161228, 2.2893419960222348, 1.3373043701011365, 0.4923246292202853, 0.0), # 157
(7.464680946405239, 5.353748694041236, 6.644659961585297, 6.817327186238432, 6.062454070580665, 2.9814309445183143, 2.3625533604639286, 2.285748730145572, 3.2838873638663655, 1.213341479072786, 0.9542659587564906, 0.570633297016195, 0.0, 8.096485859415345, 6.276966267178143, 4.771329793782452, 3.640024437218358, 6.567774727732731, 3.200048222203801, 2.3625533604639286, 2.129593531798796, 3.0312270352903323, 2.2724423954128112, 1.3289319923170593, 0.48670442673102154, 0.0), # 158
(7.382286766978402, 5.282809876299521, 6.58894818200249, 6.7529828690913405, 6.010127539854418, 2.95965229467081, 2.334106381692858, 2.2696723053184926, 3.2621424204073812, 1.2005702485246865, 0.9445694892698324, 0.5651135436402591, 0.0, 8.025427646920194, 6.216248980042849, 4.722847446349162, 3.601710745574059, 6.5242848408147625, 3.17754122744589, 2.334106381692858, 2.114037353336293, 3.005063769927209, 2.250994289697114, 1.3177896364004982, 0.4802554432999565, 0.0), # 159
(7.284872094904309, 5.202172001162321, 6.51826746496324, 6.673933132806645, 5.94428008756453, 2.9308657560278157, 2.301121874191892, 2.248166328969728, 3.2324750757428835, 1.1853014129657236, 0.9328765847682567, 0.5583751624073207, 0.0, 7.93642060889358, 6.142126786480525, 4.664382923841283, 3.55590423889717, 6.464950151485767, 3.147432860557619, 2.301121874191892, 2.0934755400198686, 2.972140043782265, 2.2246443776022153, 1.3036534929926482, 0.47292472737839286, 0.0), # 160
(7.17322205458596, 5.11236079574043, 6.4333724765919245, 6.5809293778175455, 5.865595416188075, 2.895420057582683, 2.263840723003438, 2.2215002221290754, 3.1952765889996724, 1.1676645482927346, 0.9192902757666179, 0.5504806224089643, 0.0, 7.830374044819097, 6.055286846498606, 4.596451378833089, 3.5029936448782033, 6.390553177999345, 3.1101003109807053, 2.263840723003438, 2.0681571839876307, 2.9327977080940375, 2.1936431259391824, 1.2866744953183848, 0.46476007234003913, 0.0), # 161
(7.048121770426357, 5.013901987144635, 6.335017883012913, 6.474723004557244, 5.7747572282021356, 2.853663928328766, 2.2225038131699044, 2.1899434058263343, 3.150938219304545, 1.147789230402558, 0.9039135927797701, 0.5414923927367745, 0.0, 7.708197254180333, 5.956416320104519, 4.519567963898851, 3.4433676912076736, 6.30187643860909, 3.065920768156868, 2.2225038131699044, 2.03833137737769, 2.8873786141010678, 2.158241001519082, 1.2670035766025827, 0.4558092715586033, 0.0), # 162
(6.9103563668284975, 4.90732130248573, 6.223958350350585, 6.35606541345895, 5.672449226083792, 2.8059460972594175, 2.1773520297337003, 2.153765301091302, 3.0998512257843016, 1.1258050351920315, 0.8868495663225682, 0.5314729424823361, 0.0, 7.570799536460879, 5.846202367305696, 4.43424783161284, 3.3774151055760937, 6.199702451568603, 3.015271421527823, 2.1773520297337003, 2.0042472123281554, 2.836224613041896, 2.118688471152984, 1.2447916700701172, 0.4461201184077937, 0.0), # 163
(6.760710968195384, 4.793144468874502, 6.100948544729314, 6.225708004955863, 5.559355112310126, 2.752615293367992, 2.128626257737233, 2.113235328953779, 3.0424068675657407, 1.1018415385579923, 0.8682012269098661, 0.5204847407372336, 0.0, 7.419090191144328, 5.725332148109569, 4.34100613454933, 3.305524615673976, 6.0848137351314815, 2.9585294605352903, 2.128626257737233, 1.9661537809771372, 2.779677556155063, 2.075236001651955, 1.2201897089458629, 0.43574040626131844, 0.0), # 164
(6.599970698930017, 4.671897213421746, 5.966743132273474, 6.084402179481189, 5.436158589358215, 2.694020245647842, 2.076567382222911, 2.068622910443561, 2.9789964037756596, 1.0760283163972786, 0.8480716050565187, 0.5085902565930517, 0.0, 7.25397851771427, 5.594492822523568, 4.2403580252825925, 3.2280849491918353, 5.957992807551319, 2.8960720746209856, 2.076567382222911, 1.9243001754627442, 2.7180792946791077, 2.0281340598270634, 1.1933486264546949, 0.42471792849288603, 0.0), # 165
(6.428920683435397, 4.54410526323825, 5.82209677910744, 5.932899337468126, 5.3035433597051425, 2.630509683092322, 2.021416288233143, 2.020197466590449, 2.9100110935408576, 1.0484949446067282, 0.8265637312773799, 0.49585195914137514, 0.0, 7.0763738156542955, 5.454371550555126, 4.1328186563869, 3.145484833820184, 5.820022187081715, 2.8282764532266285, 2.021416288233143, 1.8789354879230868, 2.6517716798525712, 1.9776331124893758, 1.1644193558214881, 0.41310047847620457, 0.0), # 166
(6.248346046114523, 4.410294345434805, 5.667764151355587, 5.771950879349882, 5.1621931258279865, 2.562432334694784, 1.9634138608103373, 1.9682284184242402, 2.835842195988133, 1.0193709990831787, 0.8037806360873045, 0.48233231747378824, 0.0, 6.887185384447996, 5.30565549221167, 4.0189031804365225, 3.058112997249536, 5.671684391976266, 2.755519785793936, 1.9634138608103373, 1.8303088104962744, 2.5810965629139933, 1.9239836264499612, 1.1335528302711175, 0.4009358495849823, 0.0), # 167
(6.059031911370395, 4.270990187122201, 5.50449991514229, 5.60230820555966, 5.012791590203827, 2.490136929448583, 1.902800984996902, 1.9129851869747332, 2.7568809702442847, 0.9887860557234682, 0.7798253500011468, 0.468093800681876, 0.0, 6.6873225235789615, 5.149031807500635, 3.8991267500057343, 2.9663581671704042, 5.513761940488569, 2.6781792617646265, 1.902800984996902, 1.7786692353204163, 2.5063957951019136, 1.867436068519887, 1.100899983028458, 0.3882718351929274, 0.0), # 168
(5.861763403606015, 4.1267185154112305, 5.333058736591924, 5.4247227165306615, 4.856022455309747, 2.413972196347072, 1.8398185458352458, 1.8547371932717271, 2.6735186754361124, 0.9568696904244344, 0.7548009035337614, 0.45319887785722274, 0.0, 6.477694532530785, 4.985187656429449, 3.774004517668807, 2.8706090712733023, 5.347037350872225, 2.596632070580418, 1.8398185458352458, 1.724265854533623, 2.4280112276548733, 1.808240905510221, 1.066611747318385, 0.3751562286737483, 0.0), # 169
(5.657325647224384, 3.978005057412684, 5.154195281828863, 5.23994581269609, 4.692569423622822, 2.334286864383604, 1.7747074283677764, 1.7937538583450197, 2.5861465706904125, 0.9237514790829147, 0.7288103272000027, 0.4377100180914133, 0.0, 6.259210710787055, 4.814810199005545, 3.6440516360000137, 2.7712544372487433, 5.172293141380825, 2.5112554016830275, 1.7747074283677764, 1.6673477602740028, 2.346284711811411, 1.7466486042320304, 1.0308390563657726, 0.36163682340115316, 0.0), # 170
(5.4465037666285, 3.82537554023735, 4.968664216977482, 5.048728894489152, 4.523116197620137, 2.2514296625515327, 1.7077085176369027, 1.7303046032244096, 2.495155915133985, 0.8895609975957474, 0.7019566515147247, 0.4216896904760322, 0.0, 6.032780357831365, 4.638586595236354, 3.509783257573624, 2.6686829927872413, 4.99031183026797, 2.4224264445141737, 1.7077085176369027, 1.6081640446796661, 2.2615580988100685, 1.6829096314963843, 0.9937328433954964, 0.3477614127488501, 0.0), # 171
(5.230082886221365, 3.6693556909960217, 4.777220208162156, 4.851823362343048, 4.348346479778769, 2.1657493198442115, 1.6390626986850327, 1.664658848939696, 2.4009379678936282, 0.8544278218597702, 0.6743429069927823, 0.4052003641026643, 0.0, 5.799312773147303, 4.457204005129307, 3.3717145349639117, 2.56328346557931, 4.8018759357872565, 2.3305223885155746, 1.6390626986850327, 1.5469637998887225, 2.1741732398893845, 1.6172744541143496, 0.9554440416324312, 0.3335777900905475, 0.0), # 172
(5.00884813040598, 3.510471236799489, 4.58061792150726, 4.649980616690982, 4.168943972575801, 2.077594565254994, 1.5690108565545748, 1.5970860165206766, 2.303883988096141, 0.8184815277718206, 0.6460721241490297, 0.3883045080628938, 0.0, 5.5597172562184625, 4.271349588691831, 3.2303606207451483, 2.4554445833154612, 4.607767976192282, 2.235920423128947, 1.5690108565545748, 1.483996118039281, 2.0844719862879004, 1.5499935388969943, 0.916123584301452, 0.31913374879995354, 0.0), # 173
(4.783584623585344, 3.349247904758541, 4.3796120231371685, 4.443952057966156, 3.9855923784883105, 1.987314127777233, 1.4977938762879377, 1.5278555269971503, 2.204385234868321, 0.7818516912287369, 0.6172473334983214, 0.37106459144830567, 0.0, 5.314903106528433, 4.081710505931362, 3.0862366674916064, 2.34555507368621, 4.408770469736642, 2.1389977377960103, 1.4977938762879377, 1.4195100912694523, 1.9927961892441552, 1.4813173526553853, 0.8759224046274336, 0.3044770822507765, 0.0), # 174
(4.555077490162455, 3.18621142198397, 4.174957179176257, 4.2344890866017755, 3.7989753999933793, 1.8952567364042834, 1.425652642927529, 1.457236801398915, 2.102832967336968, 0.7446678881273562, 0.5879715655555117, 0.35354308335048457, 0.0, 5.0657796235608075, 3.8889739168553294, 2.939857827777558, 2.234003664382068, 4.205665934673936, 2.040131521958481, 1.425652642927529, 1.3537548117173452, 1.8994876999966896, 1.411496362200592, 0.8349914358352515, 0.28965558381672457, 0.0), # 175
(4.324111854540319, 3.0218875155865668, 3.9674080557488987, 4.0223431030310435, 3.609776739568087, 1.8017711201294973, 1.3528280415157574, 1.3854992607557703, 1.9996184446288805, 0.7070596943645169, 0.558347850835455, 0.33580245286101496, 0.0, 4.813256106799174, 3.693826981471164, 2.791739254177275, 2.1211790830935504, 3.999236889257761, 1.9396989650580787, 1.3528280415157574, 1.2869793715210696, 1.8048883697840434, 1.3407810343436815, 0.7934816111497798, 0.2747170468715061, 0.0), # 176
(4.0914728411219325, 2.856801912677122, 3.7577193189794698, 3.808265507687162, 3.4186800996895155, 1.7072060079462288, 1.2795609570950313, 1.3129123260975137, 1.8951329258708567, 0.6691566858370562, 0.528479219853006, 0.3179051690714816, 0.0, 4.5582418557271245, 3.496956859786297, 2.6423960992650297, 2.0074700575111684, 3.7902658517417134, 1.838077256536519, 1.2795609570950313, 1.2194328628187348, 1.7093400498447577, 1.269421835895721, 0.751543863795894, 0.25970926478882933, 0.0), # 177
(3.8579455743102966, 2.6914803403664256, 3.5466456349923448, 3.593007701003337, 3.226369182834742, 1.6119101288478317, 1.2060922747077587, 1.239745418453944, 1.7897676701896952, 0.6310884384418126, 0.49846870312301883, 0.299913701073469, 0.0, 4.301646169828252, 3.299050711808158, 2.4923435156150937, 1.8932653153254375, 3.5795353403793904, 1.7356435858355217, 1.2060922747077587, 1.1513643777484512, 1.613184591417371, 1.1976692336677792, 0.7093291269984691, 0.24468003094240237, 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
4, # 1
)
| 276.31016
| 494
| 0.769599
| 32,987
| 258,350
| 6.027071
| 0.217389
| 0.358524
| 0.344038
| 0.651862
| 0.376088
| 0.367507
| 0.364651
| 0.363997
| 0.363997
| 0.363997
| 0
| 0.849839
| 0.095738
| 258,350
| 934
| 495
| 276.605996
| 0.001194
| 0.015525
| 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
|
9cd2819a2d5876b9825a6bc3bf2faaf0e39d122a
| 39
|
py
|
Python
|
web/views/__init__.py
|
zhengbigbig/python_demo
|
29b62bea9e5abaa02e51744a926f722d1b99ec8d
|
[
"MIT"
] | null | null | null |
web/views/__init__.py
|
zhengbigbig/python_demo
|
29b62bea9e5abaa02e51744a926f722d1b99ec8d
|
[
"MIT"
] | null | null | null |
web/views/__init__.py
|
zhengbigbig/python_demo
|
29b62bea9e5abaa02e51744a926f722d1b99ec8d
|
[
"MIT"
] | null | null | null |
from myproject.web.views.index import *
| 39
| 39
| 0.820513
| 6
| 39
| 5.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.076923
| 39
| 1
| 39
| 39
| 0.888889
| 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
|
9cdc483f749eb3e693ef71ab058dc7b97c0d4d13
| 144
|
py
|
Python
|
ipylabel/__init__.py
|
crabtr26/ipylabel
|
9a7062b0438fcddc3253553ecbde3dc38826b68c
|
[
"MIT"
] | null | null | null |
ipylabel/__init__.py
|
crabtr26/ipylabel
|
9a7062b0438fcddc3253553ecbde3dc38826b68c
|
[
"MIT"
] | null | null | null |
ipylabel/__init__.py
|
crabtr26/ipylabel
|
9a7062b0438fcddc3253553ecbde3dc38826b68c
|
[
"MIT"
] | null | null | null |
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
from .dashboards import *
from .templates import *
| 20.571429
| 39
| 0.791667
| 18
| 144
| 5.888889
| 0.444444
| 0.311321
| 0.339623
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 144
| 6
| 40
| 24
| 0.84127
| 0
| 0
| 0
| 0
| 0
| 0.048611
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.6
| 0
| 0.6
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 6
|
9cf66bbc0e66a28b8f4bbc3615d42c92e08b9447
| 45
|
py
|
Python
|
cuisine/measurements/__init__.py
|
j3kstrum/recipe-tweaker
|
941d2fed87fc2c568b29d3b3baee3f8ebfe4daca
|
[
"MIT"
] | null | null | null |
cuisine/measurements/__init__.py
|
j3kstrum/recipe-tweaker
|
941d2fed87fc2c568b29d3b3baee3f8ebfe4daca
|
[
"MIT"
] | null | null | null |
cuisine/measurements/__init__.py
|
j3kstrum/recipe-tweaker
|
941d2fed87fc2c568b29d3b3baee3f8ebfe4daca
|
[
"MIT"
] | null | null | null |
from cuisine.measurements.grams import Grams
| 22.5
| 44
| 0.866667
| 6
| 45
| 6.5
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.088889
| 45
| 1
| 45
| 45
| 0.95122
| 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
|
149e8613b21e72b7b2a5636cf491440044f41f7b
| 105
|
py
|
Python
|
app/main/__init__.py
|
Anitha987/Ani-Newlight-pro
|
c5f481678daa403c304f0908bb759f5f3c583f11
|
[
"Unlicense"
] | null | null | null |
app/main/__init__.py
|
Anitha987/Ani-Newlight-pro
|
c5f481678daa403c304f0908bb759f5f3c583f11
|
[
"Unlicense"
] | null | null | null |
app/main/__init__.py
|
Anitha987/Ani-Newlight-pro
|
c5f481678daa403c304f0908bb759f5f3c583f11
|
[
"Unlicense"
] | null | null | null |
from flask import Blueprint
main = Blueprint('main', __name__)
from . import errors
from . import views
| 26.25
| 34
| 0.761905
| 14
| 105
| 5.428571
| 0.571429
| 0.342105
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.161905
| 105
| 4
| 35
| 26.25
| 0.863636
| 0
| 0
| 0
| 0
| 0
| 0.037736
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.75
| 0
| 0.75
| 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
| 0
| 0
| 1
| 0
| 1
| 1
|
0
| 6
|
1aeeb5b00fb20bb4f6db0a7ae809aa8ca3804439
| 40
|
py
|
Python
|
command_test/git_test.py
|
WommyInStandingPosition/YtbDataApiRelated
|
4856ad2ee5be49bb74c79c3d6649f9d1fdbdc85d
|
[
"MIT"
] | null | null | null |
command_test/git_test.py
|
WommyInStandingPosition/YtbDataApiRelated
|
4856ad2ee5be49bb74c79c3d6649f9d1fdbdc85d
|
[
"MIT"
] | null | null | null |
command_test/git_test.py
|
WommyInStandingPosition/YtbDataApiRelated
|
4856ad2ee5be49bb74c79c3d6649f9d1fdbdc85d
|
[
"MIT"
] | null | null | null |
#commit from ubuntu
#commit from windows
| 20
| 20
| 0.825
| 6
| 40
| 5.5
| 0.666667
| 0.606061
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 40
| 2
| 20
| 20
| 0.942857
| 0.925
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
2109467cb9b5633152168295ce8f8cb0a9678618
| 38
|
py
|
Python
|
algomorphism/figures/__init__.py
|
efth-mcl/algomorphism
|
5b69d19701e450020a539196215575706e7ff675
|
[
"MIT"
] | null | null | null |
algomorphism/figures/__init__.py
|
efth-mcl/algomorphism
|
5b69d19701e450020a539196215575706e7ff675
|
[
"MIT"
] | null | null | null |
algomorphism/figures/__init__.py
|
efth-mcl/algomorphism
|
5b69d19701e450020a539196215575706e7ff675
|
[
"MIT"
] | null | null | null |
from . import nn
from . import graphs
| 12.666667
| 20
| 0.736842
| 6
| 38
| 4.666667
| 0.666667
| 0.714286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.210526
| 38
| 2
| 21
| 19
| 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 | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 6
|
dcecdffebfb8d38f44a2af140ef98c13c581c8dc
| 18,285
|
py
|
Python
|
tests/iqfeed/test_iqfeed_postgres_cache.py
|
alexanu/atpy
|
3f4b5cfe7de7633ef053d2feaddae421806a9799
|
[
"MIT"
] | 24
|
2018-03-22T06:22:11.000Z
|
2022-03-14T09:04:44.000Z
|
tests/iqfeed/test_iqfeed_postgres_cache.py
|
alexanu/atpy
|
3f4b5cfe7de7633ef053d2feaddae421806a9799
|
[
"MIT"
] | null | null | null |
tests/iqfeed/test_iqfeed_postgres_cache.py
|
alexanu/atpy
|
3f4b5cfe7de7633ef053d2feaddae421806a9799
|
[
"MIT"
] | 9
|
2018-03-22T06:22:11.000Z
|
2020-09-19T16:47:13.000Z
|
import shutil
import tempfile
import unittest
from pandas.util.testing import assert_frame_equal
from sqlalchemy import create_engine
import atpy.data.cache.lmdb_cache as lmdb_cache
import atpy.data.iqfeed.iqfeed_history_provider as iq_history
from atpy.data.cache.postgres_cache import *
from atpy.data.iqfeed.iqfeed_level_1_provider import get_fundamentals, get_splits_dividends
from atpy.data.iqfeed.iqfeed_postgres_cache import *
class TestPostgresCache(unittest.TestCase):
"""
Test InfluxDBCache
"""
def test_update_to_latest_intraday(self):
with IQFeedHistoryProvider(num_connections=2) as history:
table_name = 'bars_test'
try:
url = 'postgresql://postgres:postgres@localhost:5432/test'
engine = create_engine(url)
con = psycopg2.connect(url)
con.autocommit = True
cur = con.cursor()
cur.execute(create_bars.format(table_name))
cur.execute(bars_indices.format(table_name))
bgn_prd = datetime.datetime(2017, 3, 1).astimezone(tz.gettz('US/Eastern'))
end_prd = datetime.datetime(2017, 3, 2)
filters = (BarsInPeriodFilter(ticker="IBM", bgn_prd=bgn_prd, end_prd=end_prd, interval_len=3600, ascend=True, interval_type='s'),
BarsInPeriodFilter(ticker="AAPL", bgn_prd=bgn_prd, end_prd=end_prd, interval_len=3600, ascend=True, interval_type='s'))
data = [history.request_data(f, sync_timestamps=False) for f in filters]
filters_no_limit = (BarsInPeriodFilter(ticker="IBM", bgn_prd=bgn_prd, end_prd=None, interval_len=3600, ascend=True, interval_type='s'),
BarsInPeriodFilter(ticker="AAPL", bgn_prd=bgn_prd, end_prd=None, interval_len=3600, ascend=True, interval_type='s'),
BarsInPeriodFilter(ticker="AMZN", bgn_prd=bgn_prd, end_prd=None, interval_len=3600, ascend=True, interval_type='s'))
for datum, f in zip(data, filters):
del datum['timestamp']
del datum['total_volume']
del datum['number_of_trades']
datum['symbol'] = f.ticker
datum['interval'] = '3600_s'
datum = datum.tz_localize(None)
datum.to_sql(table_name, con=engine, if_exists='append')
latest_old = pd.read_sql("select symbol, max(timestamp) as timestamp from {0} group by symbol".format(table_name), con=con, index_col=['symbol'])['timestamp']
update_to_latest(url=url, bars_table=table_name, symbols={('AAPL', 3600, 's'), ('AMZN', 3600, 's')}, noncache_provider=noncache_provider(history), time_delta_back=relativedelta(years=10))
data_no_limit = [history.request_data(f, sync_timestamps=False) for f in filters_no_limit]
latest_current = pd.read_sql("select symbol, max(timestamp) as timestamp from {0} group by symbol".format(table_name), con=con, index_col=['symbol'])['timestamp']
self.assertEqual(len(latest_current), len(latest_old) + 1)
self.assertEqual(len([k for k in latest_current.keys() & latest_old.keys()]) + 1, len(latest_current))
for k in latest_current.keys() & latest_old.keys():
self.assertGreater(latest_current[k], latest_old[k])
cache_data_no_limit = [request_bars(conn=engine, bars_table=table_name, interval_len=3600, interval_type='s', symbol=f.ticker,
bgn_prd=f.bgn_prd.astimezone(tz.tzutc()) + relativedelta(microseconds=1)) for f in filters_no_limit]
for df1, df2 in zip(data_no_limit, cache_data_no_limit):
del df1['timestamp']
del df1['total_volume']
del df1['number_of_trades']
del df1['symbol']
del df1['volume']
del df2['volume']
assert_frame_equal(df1, df2, check_exact=False, check_less_precise=True)
finally:
con.cursor().execute("DROP TABLE IF EXISTS {0};".format(table_name))
def test_update_to_latest_daily(self):
url = 'postgresql://postgres:postgres@localhost:5432/test'
con = psycopg2.connect(url)
con.autocommit = True
with IQFeedHistoryProvider(num_connections=2) as history:
table_name = 'bars_test'
try:
engine = create_engine(url)
cur = con.cursor()
cur.execute(create_bars.format(table_name))
cur.execute(bars_indices.format(table_name))
bgn_prd = datetime.datetime(2017, 3, 1).date()
end_prd = datetime.datetime(2017, 3, 2).date()
filters = (BarsDailyForDatesFilter(ticker="IBM", bgn_dt=bgn_prd, end_dt=end_prd, ascend=True),
BarsDailyForDatesFilter(ticker="AAPL", bgn_dt=bgn_prd, end_dt=end_prd, ascend=True))
filters_no_limit = (BarsDailyForDatesFilter(ticker="IBM", bgn_dt=bgn_prd, end_dt=None, ascend=True),
BarsDailyForDatesFilter(ticker="AAPL", bgn_dt=bgn_prd, end_dt=None, ascend=True),
BarsDailyForDatesFilter(ticker="AMZN", bgn_dt=bgn_prd, end_dt=None, ascend=True))
data = [history.request_data(f, sync_timestamps=False) for f in filters]
for datum, f in zip(data, filters):
del datum['timestamp']
del datum['open_interest']
datum['symbol'] = f.ticker
datum['interval'] = '1_d'
datum = datum.tz_localize(None)
datum.to_sql(table_name, con=engine, if_exists='append')
latest_old = pd.read_sql("select symbol, max(timestamp) as timestamp from {0} group by symbol".format(table_name), con=con, index_col=['symbol'])['timestamp']
update_to_latest(url=url, bars_table=table_name, symbols={('AAPL', 1, 'd'), ('AMZN', 1, 'd')}, noncache_provider=noncache_provider(history), time_delta_back=relativedelta(years=10))
latest_current = pd.read_sql("select symbol, max(timestamp) as timestamp from {0} group by symbol".format(table_name), con=con, index_col=['symbol'])['timestamp']
self.assertEqual(len(latest_current), len(latest_old) + 1)
self.assertEqual(len([k for k in latest_current.keys() & latest_old.keys()]) + 1, len(latest_current))
for k in latest_current.keys() & latest_old.keys():
self.assertGreater(latest_current[k], latest_old[k])
data_no_limit = [history.request_data(f, sync_timestamps=False) for f in filters_no_limit]
cache_data_no_limit = [request_bars(conn=engine,
bars_table=table_name,
interval_len=1, interval_type='d',
symbol=f.ticker,
bgn_prd=datetime.datetime.combine(f.bgn_dt, datetime.datetime.min.time()).astimezone(tz.tzutc()) + relativedelta(microseconds=1)) for f in filters_no_limit]
for df1, df2 in zip(data_no_limit, cache_data_no_limit):
del df1['timestamp']
del df1['open_interest']
del df1['symbol']
assert_frame_equal(df1, df2)
finally:
con.cursor().execute("DROP TABLE IF EXISTS {0};".format(table_name))
def test_bars_in_period(self):
with IQFeedHistoryProvider(num_connections=2) as history:
tmpdir = tempfile.mkdtemp()
table_name = 'bars_test'
url = 'postgresql://postgres:postgres@localhost:5432/test'
engine = create_engine(url)
con = psycopg2.connect(url)
con.autocommit = True
try:
cur = con.cursor()
cur.execute(create_bars.format(table_name))
cur.execute(bars_indices.format(table_name))
now = datetime.datetime.now()
bgn_prd = datetime.datetime(now.year - 1, 3, 1).astimezone(tz.gettz('US/Eastern'))
filters = (BarsInPeriodFilter(ticker="IBM", bgn_prd=bgn_prd, end_prd=None, interval_len=3600, ascend=True, interval_type='s'),
BarsInPeriodFilter(ticker="AAPL", bgn_prd=bgn_prd, end_prd=None, interval_len=3600, ascend=True, interval_type='s'))
data = [history.request_data(f, sync_timestamps=False) for f in filters]
for datum, f in zip(data, filters):
del datum['timestamp']
del datum['total_volume']
del datum['number_of_trades']
datum['symbol'] = f.ticker
datum['interval'] = '3600_s'
datum = datum.tz_localize(None)
datum.to_sql(table_name, con=engine, if_exists='append')
now = datetime.datetime.now()
# test all symbols no cache
bgn_prd = datetime.datetime(now.year - 1, 3, 1, tzinfo=tz.gettz('UTC'))
bars_in_period = BarsInPeriodProvider(conn=con, interval_len=3600, interval_type='s', bars_table=table_name, bgn_prd=bgn_prd, delta=relativedelta(days=30), overlap=relativedelta(microseconds=-1))
for i, df in enumerate(bars_in_period):
self.assertFalse(df.empty)
lmdb_cache.write(bars_in_period.current_cache_key(), df, tmpdir)
start, end = bars_in_period._periods[bars_in_period._deltas]
self.assertGreaterEqual(df.index[0][0], start)
self.assertGreater(end, df.index[-1][0])
self.assertGreater(end, df.index[0][0])
self.assertEqual(i, len(bars_in_period._periods) - 1)
self.assertGreater(i, 0)
# test all symbols cache
bgn_prd = datetime.datetime(now.year - 1, 3, 1, tzinfo=tz.gettz('UTC'))
bars_in_period = BarsInPeriodProvider(conn=con, interval_len=3600, interval_type='s', bars_table=table_name, bgn_prd=bgn_prd, delta=relativedelta(days=30), overlap=relativedelta(microseconds=-1),
cache=functools.partial(lmdb_cache.read_pickle, lmdb_path=tmpdir))
for i, df in enumerate(bars_in_period):
self.assertFalse(df.empty)
start, end = bars_in_period._periods[bars_in_period._deltas]
self.assertGreaterEqual(df.index[0][0], start)
self.assertGreater(end, df.index[-1][0])
self.assertGreater(end, df.index[0][0])
self.assertEqual(i, len(bars_in_period._periods) - 1)
self.assertGreater(i, 0)
# test symbols group
bgn_prd = datetime.datetime(now.year - 1, 3, 1, tzinfo=tz.gettz('UTC'))
bars_in_period = BarsInPeriodProvider(conn=con, interval_len=3600, interval_type='s', bars_table=table_name, bgn_prd=bgn_prd, symbol=['AAPL', 'IBM'], delta=relativedelta(days=30), overlap=relativedelta(microseconds=-1))
for i, df in enumerate(bars_in_period):
self.assertFalse(df.empty)
start, end = bars_in_period._periods[bars_in_period._deltas]
self.assertGreaterEqual(df.index[0][0], start)
self.assertGreater(end, df.index[-1][0])
self.assertGreater(end, df.index[0][0])
self.assertEqual(i, len(bars_in_period._periods) - 1)
self.assertGreater(i, 0)
finally:
shutil.rmtree(tmpdir)
con.cursor().execute("DROP TABLE IF EXISTS bars_test;")
def test_bars_by_symbol(self):
with IQFeedHistoryProvider(num_connections=2) as history:
tmpdir = tempfile.mkdtemp()
table_name = 'bars_test'
url = 'postgresql://postgres:postgres@localhost:5432/test'
engine = create_engine(url)
con = psycopg2.connect(url)
con.autocommit = True
try:
cur = con.cursor()
cur.execute(create_bars.format(table_name))
cur.execute(bars_indices.format(table_name))
iq_history.BarsFilter(ticker="IBM", interval_len=3600, interval_type='s', max_bars=1000)
filters = (iq_history.BarsFilter(ticker="IBM", interval_len=3600, interval_type='s', max_bars=1000),
iq_history.BarsFilter(ticker="AAPL", interval_len=3600, interval_type='s', max_bars=1000))
data = [history.request_data(f, sync_timestamps=False) for f in filters]
for datum, f in zip(data, filters):
del datum['timestamp']
del datum['total_volume']
del datum['number_of_trades']
datum['symbol'] = f.ticker
datum['interval'] = '3600_s'
datum = datum.tz_localize(None)
datum.to_sql(table_name, con=engine, if_exists='append')
bars_per_symbol = BarsBySymbolProvider(conn=con, records_per_query=1000, interval_len=3600, interval_type='s', table_name=table_name)
for i, df in enumerate(bars_per_symbol):
self.assertEqual(len(df), 1000)
self.assertEqual(i, 1)
bars_per_symbol = BarsBySymbolProvider(conn=con, records_per_query=100, interval_len=3600, interval_type='s', table_name=table_name)
for i, df in enumerate(bars_per_symbol):
self.assertEqual(len(df), 1000)
self.assertEqual(i, 1)
bars_per_symbol = BarsBySymbolProvider(conn=con, records_per_query=2000, interval_len=3600, interval_type='s', table_name=table_name)
for i, df in enumerate(bars_per_symbol):
self.assertEqual(len(df), 2000)
self.assertTrue(isinstance(df.index, pd.MultiIndex))
self.assertEqual(i, 0)
finally:
shutil.rmtree(tmpdir)
con.cursor().execute("DROP TABLE IF EXISTS bars_test;")
def test_symbol_counts(self):
with IQFeedHistoryProvider(num_connections=2) as history:
table_name = 'bars_test'
url = 'postgresql://postgres:postgres@localhost:5432/test'
engine = create_engine(url)
con = psycopg2.connect(url)
con.autocommit = True
try:
cur = con.cursor()
cur.execute(create_bars.format(table_name))
cur.execute(bars_indices.format(table_name))
now = datetime.datetime.now()
bgn_prd = datetime.datetime(now.year - 1, 3, 1).astimezone(tz.gettz('US/Eastern'))
filters = (BarsInPeriodFilter(ticker="IBM", bgn_prd=bgn_prd, end_prd=None, interval_len=3600, ascend=True, interval_type='s'),
BarsInPeriodFilter(ticker="AAPL", bgn_prd=bgn_prd, end_prd=None, interval_len=3600, ascend=True, interval_type='s'))
data = [history.request_data(f, sync_timestamps=False) for f in filters]
for datum, f in zip(data, filters):
del datum['timestamp']
del datum['total_volume']
del datum['number_of_trades']
datum['symbol'] = f.ticker
datum['interval'] = '3600_s'
datum = datum.tz_localize(None)
datum.to_sql(table_name, con=engine, if_exists='append')
counts = request_symbol_counts(conn=con, interval_len=3600, interval_type='s', symbol=["IBM", "AAPL"], bars_table=table_name)
self.assertEqual(counts.size, 2)
self.assertGreater(counts.min(), 0)
finally:
con.cursor().execute("DROP TABLE IF EXISTS bars_test;")
def test_update_adjustments(self):
table_name = 'adjustments_test'
url = 'postgresql://postgres:postgres@localhost:5432/test'
con = psycopg2.connect(url)
con.autocommit = True
try:
adjustments = get_splits_dividends({'IBM', 'AAPL', 'GOOG', 'MSFT'})
cur = con.cursor()
cur.execute(create_json_data.format(table_name))
insert_df_json(con, table_name, adjustments)
now = datetime.datetime.now()
df = request_adjustments(con, table_name, symbol=['IBM', 'AAPL', 'MSFT', 'GOOG'], bgn_prd=datetime.datetime(year=now.year - 30, month=now.month, day=now.day),
end_prd=datetime.datetime(year=now.year + 2, month=now.month, day=now.day), provider='iqfeed')
self.assertFalse(df.empty)
assert_frame_equal(adjustments, df)
finally:
con.cursor().execute("DROP TABLE IF EXISTS {0};".format(table_name))
def test_update_fundamentals(self):
table_name = 'iqfeed_fundamentals'
url = 'postgresql://postgres:postgres@localhost:5432/test'
con = psycopg2.connect(url)
con.autocommit = True
try:
cur = con.cursor()
cur.execute(create_json_data.format(table_name))
fundamentals = get_fundamentals({'IBM', 'AAPL', 'GOOG', 'MSFT'})
update_fundamentals(conn=con, fundamentals=fundamentals, table_name=table_name)
fund = request_fundamentals(con, symbol=['IBM', 'AAPL', 'GOOG'], table_name=table_name)
self.assertTrue(isinstance(fund, pd.DataFrame))
self.assertEqual(len(fund), 3)
finally:
con.cursor().execute("DROP TABLE IF EXISTS {0};".format(table_name))
if __name__ == '__main__':
unittest.main()
| 47.992126
| 235
| 0.588734
| 2,133
| 18,285
| 4.82888
| 0.096578
| 0.045437
| 0.029126
| 0.013981
| 0.836602
| 0.821748
| 0.808641
| 0.797864
| 0.793398
| 0.775146
| 0
| 0.023447
| 0.300246
| 18,285
| 380
| 236
| 48.118421
| 0.781555
| 0.004758
| 0
| 0.697761
| 0
| 0
| 0.085534
| 0.019252
| 0
| 0
| 0
| 0
| 0.149254
| 1
| 0.026119
| false
| 0
| 0.037313
| 0
| 0.067164
| 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
|
dcfda73a1a60904d3c75248e8a385f90860d61d2
| 307
|
py
|
Python
|
EgammaAnalysis/Configuration/python/EgammaAnalysis_SkimPaths_cff.py
|
nistefan/cmssw
|
ea13af97f7f2117a4f590a5e654e06ecd9825a5b
|
[
"Apache-2.0"
] | 1
|
2019-08-09T08:42:11.000Z
|
2019-08-09T08:42:11.000Z
|
EgammaAnalysis/Configuration/python/EgammaAnalysis_SkimPaths_cff.py
|
nistefan/cmssw
|
ea13af97f7f2117a4f590a5e654e06ecd9825a5b
|
[
"Apache-2.0"
] | null | null | null |
EgammaAnalysis/Configuration/python/EgammaAnalysis_SkimPaths_cff.py
|
nistefan/cmssw
|
ea13af97f7f2117a4f590a5e654e06ecd9825a5b
|
[
"Apache-2.0"
] | 1
|
2019-04-03T19:23:27.000Z
|
2019-04-03T19:23:27.000Z
|
import FWCore.ParameterSet.Config as cms
#
#
# Collection of all Skim paths for Egamma
#
#
#Egamma skims
from EgammaAnalysis.CSA07Skims.EgammaVeryHighEtPath_cff import *
from EgammaAnalysis.CSA07Skims.EgammaZPlusEMOrJetPath_cff import *
from EgammaAnalysis.CSA07Skims.EgammaWPlusEMOrJetPath_cff import *
| 23.615385
| 66
| 0.837134
| 33
| 307
| 7.69697
| 0.636364
| 0.212598
| 0.330709
| 0.212598
| 0.291339
| 0
| 0
| 0
| 0
| 0
| 0
| 0.021898
| 0.107492
| 307
| 12
| 67
| 25.583333
| 0.905109
| 0.166124
| 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
|
0d397c4113d5797102f2c5179fffb46a6a272d2d
| 31
|
py
|
Python
|
xignitegh/__init__.py
|
xignite-python/xignitegh
|
d7f53bfaeb8ee35bdc89f61e64408622426cd452
|
[
"MIT"
] | null | null | null |
xignitegh/__init__.py
|
xignite-python/xignitegh
|
d7f53bfaeb8ee35bdc89f61e64408622426cd452
|
[
"MIT"
] | null | null | null |
xignitegh/__init__.py
|
xignite-python/xignitegh
|
d7f53bfaeb8ee35bdc89f61e64408622426cd452
|
[
"MIT"
] | null | null | null |
from .xignitegh import Xignite
| 15.5
| 30
| 0.83871
| 4
| 31
| 6.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.129032
| 31
| 1
| 31
| 31
| 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
|
b4c0895b2cce68b6203afd5937fba2abec2ba78e
| 5,080
|
py
|
Python
|
content_interactions_stats/utils.py
|
aaboffill/django-content-interactions
|
8ea881e46cc6d5c375542939bb69d2980efdec23
|
[
"BSD-3-Clause"
] | null | null | null |
content_interactions_stats/utils.py
|
aaboffill/django-content-interactions
|
8ea881e46cc6d5c375542939bb69d2980efdec23
|
[
"BSD-3-Clause"
] | null | null | null |
content_interactions_stats/utils.py
|
aaboffill/django-content-interactions
|
8ea881e46cc6d5c375542939bb69d2980efdec23
|
[
"BSD-3-Clause"
] | null | null | null |
# coding=utf-8
from django.db.models import F
def item_like_process(item_id, item_content_type):
from models import Stats
stats_obj, created = Stats.objects.get_or_create(object_pk=item_id, content_type=item_content_type)
stats_obj.likes = F('likes')+1
stats_obj.save()
def item_dislike_process(item_id, item_content_type):
from models import Stats
stats_obj, created = Stats.objects.get_or_create(object_pk=item_id, content_type=item_content_type)
if not created:
stats_obj.likes = F('likes')-1
stats_obj.save()
def item_new_rating_process(item_id, item_content_type, rating):
from models import Stats
stats_obj, created = Stats.objects.get_or_create(object_pk=item_id, content_type=item_content_type)
stats_obj.ratings = F('ratings')+1
if rating == 5:
stats_obj.rating_5_count = F('rating_5_count')+1
elif rating == 4:
stats_obj.rating_4_count = F('rating_4_count')+1
elif rating == 3:
stats_obj.rating_3_count = F('rating_3_count')+1
elif rating == 2:
stats_obj.rating_2_count = F('rating_2_count')+1
elif rating == 1:
stats_obj.rating_1_count = F('rating_1_count')+1
stats_obj.save()
def item_updated_rating_process(item_id, item_content_type, old_rating, rating):
from models import Stats
stats_obj, created = Stats.objects.get_or_create(object_pk=item_id, content_type=item_content_type)
if not created and (old_rating != rating):
# remove ald rating
if old_rating == 5:
stats_obj.rating_5_count = F('rating_5_count')-1
elif old_rating == 4:
stats_obj.rating_4_count = F('rating_4_count')-1
elif old_rating == 3:
stats_obj.rating_3_count = F('rating_3_count')-1
elif old_rating == 2:
stats_obj.rating_2_count = F('rating_2_count')-1
elif old_rating == 1:
stats_obj.rating_1_count = F('rating_1_count')-1
# add new rating
if rating == 5:
stats_obj.rating_5_count = F('rating_5_count')+1
elif rating == 4:
stats_obj.rating_4_count = F('rating_4_count')+1
elif rating == 3:
stats_obj.rating_3_count = F('rating_3_count')+1
elif rating == 2:
stats_obj.rating_2_count = F('rating_2_count')+1
elif rating == 1:
stats_obj.rating_1_count = F('rating_1_count')+1
elif created:
stats_obj.ratings = F('ratings')+1
# add new rating
if rating == 5:
stats_obj.rating_5_count = F('rating_5_count')+1
elif rating == 4:
stats_obj.rating_4_count = F('rating_4_count')+1
elif rating == 3:
stats_obj.rating_3_count = F('rating_3_count')+1
elif rating == 2:
stats_obj.rating_2_count = F('rating_2_count')+1
elif rating == 1:
stats_obj.rating_1_count = F('rating_1_count')+1
stats_obj.save()
def item_marked_favorite_process(item_id, item_content_type):
from models import Stats
stats_obj, created = Stats.objects.get_or_create(object_pk=item_id, content_type=item_content_type)
stats_obj.favorite_marks = F('favorite_marks')+1
stats_obj.save()
def item_unmarked_favorite_process(item_id, item_content_type):
from models import Stats
stats_obj, created = Stats.objects.get_or_create(object_pk=item_id, content_type=item_content_type)
if not created:
stats_obj.favorite_marks = F('favorite_marks')-1
stats_obj.save()
def item_shared_process(item_id, item_content_type):
from models import Stats
stats_obj, created = Stats.objects.get_or_create(object_pk=item_id, content_type=item_content_type)
stats_obj.shares = F('shares')+1
stats_obj.save()
def item_visited_process(item_id, item_content_type):
from models import Stats
stats_obj, created = Stats.objects.get_or_create(object_pk=item_id, content_type=item_content_type)
stats_obj.visits = F('visits')+1
stats_obj.save()
def item_denounced_process(item_id, item_content_type):
from models import Stats
stats_obj, created = Stats.objects.get_or_create(object_pk=item_id, content_type=item_content_type)
stats_obj.denounces = F('denounces')+1
stats_obj.save()
def item_denounce_removed_process(item_id, item_content_type):
from models import Stats
stats_obj, created = Stats.objects.get_or_create(object_pk=item_id, content_type=item_content_type)
stats_obj.denounces = F('denounces')-1
stats_obj.save()
def item_got_comment_process(item_id, item_content_type):
from models import Stats
stats_obj, created = Stats.objects.get_or_create(object_pk=item_id, content_type=item_content_type)
stats_obj.comments = F('comments')+1
stats_obj.save()
def item_comment_deleted_process(item_id, item_content_type):
from models import Stats
stats_obj, created = Stats.objects.get_or_create(object_pk=item_id, content_type=item_content_type)
if not created:
stats_obj.comments = F('comments')-1
stats_obj.save()
| 37.62963
| 103
| 0.701772
| 784
| 5,080
| 4.167092
| 0.079082
| 0.137129
| 0.110193
| 0.062443
| 0.932048
| 0.928375
| 0.902051
| 0.881237
| 0.881237
| 0.862871
| 0
| 0.022901
| 0.200591
| 5,080
| 135
| 104
| 37.62963
| 0.781581
| 0.011811
| 0
| 0.669811
| 0
| 0
| 0.075359
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.113208
| false
| 0
| 0.122642
| 0
| 0.235849
| 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
|
b4d42c2b729596de6b3a27fa1ca7c1ab4e0dbfff
| 2,600
|
py
|
Python
|
django-proj/gencert/models.py
|
Nurul-GC/GCertificate
|
c58d5c6bb4500c11934da091a8f1fbee11da99e0
|
[
"BSD-3-Clause"
] | 1
|
2021-09-04T13:03:30.000Z
|
2021-09-04T13:03:30.000Z
|
django-proj/gencert/models.py
|
Nurul-GC/GCertificate
|
c58d5c6bb4500c11934da091a8f1fbee11da99e0
|
[
"BSD-3-Clause"
] | null | null | null |
django-proj/gencert/models.py
|
Nurul-GC/GCertificate
|
c58d5c6bb4500c11934da091a8f1fbee11da99e0
|
[
"BSD-3-Clause"
] | 1
|
2022-03-03T07:48:13.000Z
|
2022-03-03T07:48:13.000Z
|
# ******************************************************************************
# Copyright (c) 2021 Nurul-GC. *
# ******************************************************************************
from django.db import models
# Create your models here.
class CP(models.Model):
"""certificate of perticipation model"""
LANG = (
('English', 'English'),
('Português', 'Português')
)
TYPES = (
('Certificado de Participação', 'Certificado de Participação'),
('Certificate of Participation', 'Certificate of Participation')
)
logo = models.FileField(upload_to=f'media/logos/')
language = models.CharField(choices=LANG, max_length=10, help_text='Escolha o idioma do certificado!')
document_title = models.CharField(max_length=50, help_text='Digite um titulo para o documento!')
document_subject = models.CharField(choices=TYPES, max_length=30, help_text='Escolha o tema do certificado!')
company_name = models.CharField(max_length=50, help_text='Digite o nome da instituição emissora!')
student_name = models.CharField(max_length=50, help_text='Digite o nome do estudante!')
description = models.TextField(max_length=1000, help_text='Digite o conteudo descritivo e motivo desta certificação!')
def __str__(self):
return f"{self.student_name.name} certified by {self.company_name.name}"
class TC(models.Model):
"""training certificate model"""
LANG = (
('English', 'English'),
('Português', 'Português')
)
TYPES = (
('Training Certificate', 'Training Certificate'),
('Certificado de Formação', 'Certificado de Formação'),
)
logo = models.FileField(upload_to=f'media/logos/')
language = models.CharField(choices=LANG, max_length=10, help_text='Escolha o idioma do certificado!')
document_title = models.CharField(max_length=50, help_text='Digite um titulo para o documento!')
document_subject = models.CharField(choices=TYPES, max_length=30, help_text='Escolha o tema do certificado!')
company_name = models.CharField(max_length=50, help_text='Digite o nome da instituição emissora!')
student_name = models.CharField(max_length=50, help_text='Digite o nome do estudante!')
course_name = models.CharField(max_length=50, help_text='Digite o nome do curso!')
description = models.TextField(max_length=1000, help_text='Digite o conteudo descritivo e motivo desta certificação!')
def __str__(self):
return f"{self.student_name.name} certified by {self.company_name.name}"
| 50
| 122
| 0.654231
| 305
| 2,600
| 5.416393
| 0.278689
| 0.070823
| 0.076271
| 0.101695
| 0.794794
| 0.794794
| 0.794794
| 0.739104
| 0.739104
| 0.739104
| 0
| 0.015866
| 0.175769
| 2,600
| 51
| 123
| 50.980392
| 0.755016
| 0.124615
| 0
| 0.684211
| 0
| 0
| 0.383289
| 0.04244
| 0
| 0
| 0
| 0
| 0
| 1
| 0.052632
| false
| 0
| 0.026316
| 0.052632
| 0.684211
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 6
|
b4e119937a26d4fce5685276bfb1c8666535b542
| 177
|
py
|
Python
|
simulariumio/springsalad/__init__.py
|
allen-cell-animated/simularium-conversion
|
47ba9a5a8105cf5cd36592d859252df642b1f1f9
|
[
"Apache-2.0"
] | null | null | null |
simulariumio/springsalad/__init__.py
|
allen-cell-animated/simularium-conversion
|
47ba9a5a8105cf5cd36592d859252df642b1f1f9
|
[
"Apache-2.0"
] | null | null | null |
simulariumio/springsalad/__init__.py
|
allen-cell-animated/simularium-conversion
|
47ba9a5a8105cf5cd36592d859252df642b1f1f9
|
[
"Apache-2.0"
] | null | null | null |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from .springsalad_converter import SpringsaladConverter # noqa: F401
from .springsalad_data import SpringsaladData # noqa: F401
| 29.5
| 69
| 0.751412
| 21
| 177
| 6.238095
| 0.761905
| 0.229008
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.045752
| 0.135593
| 177
| 5
| 70
| 35.4
| 0.810458
| 0.361582
| 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
|
b4ea53d596fe2d3b961668e3a3637776c22ba150
| 10,031
|
py
|
Python
|
tests/networkapi_test.py
|
globocom/globomap-loader-napi
|
a3621e1396c14730d131315ae50ce2d7c1228765
|
[
"Apache-2.0"
] | 3
|
2017-08-31T13:35:49.000Z
|
2019-07-11T11:37:21.000Z
|
tests/networkapi_test.py
|
globocom/globomap-loader-napi
|
a3621e1396c14730d131315ae50ce2d7c1228765
|
[
"Apache-2.0"
] | 4
|
2017-09-06T22:34:49.000Z
|
2019-07-11T12:33:12.000Z
|
tests/networkapi_test.py
|
globocom/globomap-loader-napi
|
a3621e1396c14730d131315ae50ce2d7c1228765
|
[
"Apache-2.0"
] | 2
|
2017-09-06T20:46:33.000Z
|
2019-07-11T12:12:38.000Z
|
"""
Copyright 2018 Globo.com
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
import unittest2
from mock import patch
from globomap_driver_napi.networkapi import NetworkAPI
from globomap_driver_napi.networkapi import NetworkAPIClientError
class TestNetworkAPI(unittest2.TestCase):
"""Test using client networkapi"""
def test_get_vip(self):
"""Test assert called get vip"""
requests_mock = patch(
'networkapiclient.ClientFactory.ApiVipRequest.get').start()
requests_mock.return_value = {'vips': [{'id': 1}]}
napi = NetworkAPI()
data = napi.get_vip(1)
requests_mock.assert_called_once_with(ids=[1], kind='details')
self.assertDictEqual(data, {'id': 1})
def test_get_pool_by_member_id(self):
"""Test assert called get pool by member"""
requests_mock = patch(
'networkapiclient.ClientFactory.ApiPool.search').start()
requests_mock.return_value = {'server_pools': [{'id': 1}]}
napi = NetworkAPI()
data = napi.get_pool_by_member_id(1)
requests_mock.assert_called_once_with(
search={'extends_search': [{'serverpoolmember': 1}]}, kind='details')
self.assertDictEqual(data, {'id': 1})
def test_get_pool(self):
"""Test assert called get pool"""
requests_mock = patch(
'networkapiclient.ClientFactory.ApiPool.get').start()
requests_mock.return_value = {'server_pools': [{'id': 1}]}
napi = NetworkAPI()
data = napi.get_pool(1)
requests_mock.assert_called_once_with(ids=[1], kind='details')
self.assertDictEqual(data, {'id': 1})
def test_get_vip_by_portpool_id(self):
"""Test assert called get vip by port"""
requests_mock = patch(
'networkapiclient.ClientFactory.ApiVipRequest.search').start()
requests_mock.return_value = {'vips': [{'id': 1}]}
napi = NetworkAPI()
data = napi.get_vip_by_portpool_id(1)
requests_mock.assert_called_once_with(
search={'extends_search': [
{'viprequestport__viprequestportpool': 1}]},
kind='details')
self.assertDictEqual(data, {'id': 1})
def test_get_network_ipv4_id(self):
"""Test assert called get network v4"""
requests_mock = patch(
'networkapiclient.ClientFactory.ApiNetworkIPv4.get').start()
requests_mock.return_value = {'networks': [{'id': 1}]}
napi = NetworkAPI()
data = napi.get_network_ipv4_id(1)
requests_mock.assert_called_once_with(
ids=[1],
fields=['id', 'network_type__details',
'active', 'networkv4', 'vlan__basic']
)
self.assertDictEqual(data, {'id': 1})
def test_get_network_ipv6_id(self):
"""Test assert called get network v6"""
requests_mock = patch(
'networkapiclient.ClientFactory.ApiNetworkIPv6.get').start()
requests_mock.return_value = {'networks': [{'id': 1}]}
napi = NetworkAPI()
data = napi.get_network_ipv6_id(1)
requests_mock.assert_called_once_with(
ids=[1],
fields=['id', 'network_type__details',
'active', 'networkv6', 'vlan__basic']
)
self.assertDictEqual(data, {'id': 1})
def test_get_environment(self):
"""Test assert called get environment"""
requests_mock = patch(
'networkapiclient.ClientFactory.ApiEnvironment.get').start()
requests_mock.return_value = {'environments': [{'id': 1}]}
napi = NetworkAPI()
data = napi.get_environment(1)
requests_mock.assert_called_once_with(
ids=[1], include=['default_vrf__details',
'father_environment__basic'])
self.assertDictEqual(data, {'id': 1})
def test_get_vlan(self):
"""Test assert called get vlan"""
requests_mock = patch(
'networkapiclient.ClientFactory.ApiVlan.get').start()
requests_mock.return_value = {'vlans': [{'id': 1}]}
napi = NetworkAPI()
data = napi.get_vlan(1)
requests_mock.assert_called_once_with(
ids=[1],
include=['environment__basic']
)
self.assertDictEqual(data, {'id': 1})
def test_get_ipv4_by_ip_equipment_id(self):
"""Test assert called get ipv4 by ip eqpt"""
requests_mock = patch(
'networkapiclient.ClientFactory.ApiIPv4.search').start()
requests_mock.return_value = {'ips': [{'id': 1}]}
napi = NetworkAPI()
data = napi.get_ipv4_by_ip_equipment_id(1)
requests_mock.assert_called_once_with(
search={'extends_search': [{'ipequipamento': 1}]},
fields=['networkipv4', 'ip_formated']
)
self.assertDictEqual(data, {'id': 1})
def test_get_ipv6_by_ip_equipment_id(self):
"""Test assert called get ipv6 by ip eqpt"""
requests_mock = patch(
'networkapiclient.ClientFactory.ApiIPv6.search').start()
requests_mock.return_value = {'ips': [{'id': 1}]}
napi = NetworkAPI()
data = napi.get_ipv6_by_ip_equipment_id(1)
requests_mock.assert_called_once_with(
search={'extends_search': [{'ipv6equipament': 1}]},
fields=['networkipv6', 'ip_formated']
)
self.assertDictEqual(data, {'id': 1})
def test_get_equipment(self):
"""Test assert called get equipment"""
requests_mock = patch(
'networkapiclient.ClientFactory.ApiEquipment.get').start()
requests_mock.return_value = {'equipments': [{'id': 1}]}
napi = NetworkAPI()
data = napi.get_equipment(1)
requests_mock.assert_called_once_with(
ids=[1],
include=['equipment_type__details',
'ipv4__basic__networkipv4', 'ipv6__basic__networkipv6']
)
self.assertDictEqual(data, {'id': 1})
def test_exception_get_pool(self):
requests_mock = patch(
'networkapiclient.ClientFactory.ApiPool.get').start()
requests_mock.side_effect = NetworkAPIClientError('')
napi = NetworkAPI()
data = napi.get_pool(3)
self.assertEqual(data, [])
def test_exception_get_pool_by_member_id(self):
requests_mock = patch(
'networkapiclient.ClientFactory.ApiPool.search').start()
requests_mock.side_effect = NetworkAPIClientError('')
napi = NetworkAPI()
data = napi.get_pool_by_member_id(3)
self.assertEqual(data, [])
def test_exception_get_vip(self):
requests_mock = patch(
'networkapiclient.ClientFactory.ApiVipRequest.get').start()
requests_mock.side_effect = NetworkAPIClientError('')
napi = NetworkAPI()
data = napi.get_vip(3)
self.assertEqual(data, [])
def test_exception_get_vip_by_portpool_id(self):
requests_mock = patch(
'networkapiclient.ClientFactory.ApiVipRequest.search').start()
requests_mock.side_effect = NetworkAPIClientError('')
napi = NetworkAPI()
data = napi.get_vip_by_portpool_id(3)
self.assertEqual(data, [])
def test_exception_get_equipment(self):
requests_mock = patch(
'networkapiclient.ClientFactory.ApiEquipment.get').start()
requests_mock.side_effect = NetworkAPIClientError('')
napi = NetworkAPI()
data = napi.get_equipment(3)
self.assertEqual(data, [])
def test_exception_get_network_ipv4_id(self):
requests_mock = patch(
'networkapiclient.ClientFactory.ApiNetworkIPv4.get').start()
requests_mock.side_effect = NetworkAPIClientError('')
napi = NetworkAPI()
data = napi.get_network_ipv4_id(3)
self.assertEqual(data, [])
def test_exception_get_network_ipv6_id(self):
requests_mock = patch(
'networkapiclient.ClientFactory.ApiNetworkIPv6.get').start()
requests_mock.side_effect = NetworkAPIClientError('')
napi = NetworkAPI()
data = napi.get_network_ipv6_id(3)
self.assertEqual(data, [])
def test_exception_get_ipv4_by_ip_equipment_id(self):
requests_mock = patch(
'networkapiclient.ClientFactory.ApiIPv4.search').start()
requests_mock.side_effect = NetworkAPIClientError('')
napi = NetworkAPI()
data = napi.get_ipv4_by_ip_equipment_id(3)
self.assertEqual(data, [])
def test_exception_get_ipv6_by_ip_equipment_id(self):
requests_mock = patch(
'networkapiclient.ClientFactory.ApiIPv6.search').start()
requests_mock.side_effect = NetworkAPIClientError('')
napi = NetworkAPI()
data = napi.get_ipv6_by_ip_equipment_id(3)
self.assertEqual(data, [])
def test_exception_get_vlan(self):
requests_mock = patch(
'networkapiclient.ClientFactory.ApiVlan.get').start()
requests_mock.side_effect = NetworkAPIClientError('')
napi = NetworkAPI()
data = napi.get_vlan(3)
self.assertEqual(data, [])
def test_exception_get_environment(self):
requests_mock = patch(
'networkapiclient.ClientFactory.ApiEnvironment.get').start()
requests_mock.side_effect = NetworkAPIClientError('')
napi = NetworkAPI()
data = napi.get_environment(3)
self.assertEqual(data, [])
| 33.215232
| 81
| 0.634334
| 1,085
| 10,031
| 5.586175
| 0.141935
| 0.108893
| 0.061706
| 0.119782
| 0.846065
| 0.829401
| 0.776275
| 0.738492
| 0.720343
| 0.656327
| 0
| 0.01356
| 0.250125
| 10,031
| 301
| 82
| 33.325581
| 0.79221
| 0.094507
| 0
| 0.629442
| 0
| 0
| 0.176516
| 0.133111
| 0
| 0
| 0
| 0
| 0.167513
| 1
| 0.111675
| false
| 0
| 0.020305
| 0
| 0.137056
| 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
|
370245eb46b3d78a6658c94fe9720f31d963d0c3
| 3,129
|
py
|
Python
|
stocksdata/indices.py
|
LatticeData/StockDataPythonClient
|
cb6a6fe348af7efc9f396a8b8a36e3452eb3630a
|
[
"Apache-2.0"
] | 4
|
2021-08-09T03:37:41.000Z
|
2021-08-17T21:42:54.000Z
|
stocksdata/indices.py
|
LatticeData/StockDataPythonClient
|
cb6a6fe348af7efc9f396a8b8a36e3452eb3630a
|
[
"Apache-2.0"
] | null | null | null |
stocksdata/indices.py
|
LatticeData/StockDataPythonClient
|
cb6a6fe348af7efc9f396a8b8a36e3452eb3630a
|
[
"Apache-2.0"
] | 1
|
2021-08-24T22:50:42.000Z
|
2021-08-24T22:50:42.000Z
|
from stocksdata.util.ttlcache import daily_cache
from stocksdata.util.get import *
## indices ####################################################################################################################################
@daily_cache
def s_and_p_composition():
return get_json("/market/index/s-and-p-five-hundred").get("stocks")
@daily_cache
def nasdaq_composition():
return get_json("/market/index/nasdaq-composite").get("stocks")
@daily_cache
def russel_one_thousand_composition():
return get_json("/market/index/russel-one-thousand").get("stocks")
@daily_cache
def amex_oil_composition():
return get_json("/market/index/amex-oil-index").get("stocks")
@daily_cache
def djia_composition():
return get_json("/market/index/djia").get("stocks")
@daily_cache
def bbc_global_composition():
return get_json("/market/index/bbc-global-thirty").get("stocks")
@daily_cache
def ibovespa_composition():
return get_json("/market/index/ibovespa").get("stocks")
@daily_cache
def ftse100_composition():
return get_json("/market/index/ftse-one-hundred").get("stocks")
@daily_cache
def ftse250_composition():
return get_json("/market/index/ftse-two-fifty").get("stocks")
@daily_cache
def nifty_fifty_composition():
return get_json("/market/index/nifty-fifty").get("stocks")
@daily_cache
def djgt_fifty_composition():
return get_json("/market/index/dow-jones-global-titans-fifty").get("stocks")
@daily_cache
def dax_thirty_composition():
return get_json("/market/index/dax-thirty").get("stocks")
@daily_cache
def euro100_composition():
return get_json("/market/index/euro-next-one-hundred").get("stocks")
@daily_cache
def djta_composition():
return get_json("/market/index/down-jones-transportation-average").get("stocks")
@daily_cache
def djua_composition():
return get_json("/market/index/down-jones-utility-average").get("stocks")
@daily_cache
def nasdaq100_composition():
return get_json("/market/index/nasdaq-one-hundred").get("stocks")
@daily_cache
def phlx_semi_composition():
return get_json("/market/index/phlx-semiconductor").get("stocks")
@daily_cache
def phlx_gold_composition():
return get_json("/market/index/phlx-gold-and-silver").get("stocks")
@daily_cache
def nikkei225_composition():
return get_json("/market/index/nikkei-two-twenty-five").get("stocks")
@daily_cache
def omx_nordic_composition():
return get_json("/market/index/omx-nordic-forty").get("stocks")
@daily_cache
def nyse_arca_composition():
return get_json("/market/index/nyse-arca-major-market-index").get("stocks")
@daily_cache
def s_and_p_400():
return get_json("/market/index/s-and-p-four-hundred").get("stocks")
@daily_cache
def s_and_p_100():
return get_json("/market/index/s-and-p-one-hundred").get("stocks")
@daily_cache
def s_and_p_global_100():
return get_json("/market/index/s-and-p-global-one-hundred").get("stocks")
@daily_cache
def russel_2000_composition():
return get_json("/market/index/russel-two-thousand").get("stocks")
@daily_cache
def niftybank():
return get_json("/market/index/niftybank").get("stocks")
| 28.972222
| 143
| 0.715564
| 431
| 3,129
| 4.965197
| 0.169374
| 0.126168
| 0.157944
| 0.230841
| 0.791589
| 0.728972
| 0.390654
| 0.142523
| 0.061682
| 0
| 0
| 0.009811
| 0.087888
| 3,129
| 107
| 144
| 29.242991
| 0.740014
| 0.002237
| 0
| 0.325
| 0
| 0
| 0.332552
| 0.27428
| 0
| 0
| 0
| 0
| 0
| 1
| 0.325
| true
| 0
| 0.025
| 0.325
| 0.675
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 1
| 0
|
0
| 6
|
37125fc3aab221406d9eb5643d8daff7c6fd5e54
| 41
|
py
|
Python
|
cnn_example/config/__init__.py
|
4620511/cnn-example
|
b89b235d68569fac4769f50ee2f49ee16c750f08
|
[
"MIT"
] | 1
|
2019-02-15T18:06:34.000Z
|
2019-02-15T18:06:34.000Z
|
cnn_example/config/__init__.py
|
4620511/cnn-example
|
b89b235d68569fac4769f50ee2f49ee16c750f08
|
[
"MIT"
] | null | null | null |
cnn_example/config/__init__.py
|
4620511/cnn-example
|
b89b235d68569fac4769f50ee2f49ee16c750f08
|
[
"MIT"
] | null | null | null |
from .config import Config # noqa: F401
| 20.5
| 40
| 0.731707
| 6
| 41
| 5
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.090909
| 0.195122
| 41
| 1
| 41
| 41
| 0.818182
| 0.243902
| 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
|
3716214a35a72bf207b32c97da51cac5b38213be
| 207
|
py
|
Python
|
nose.py
|
RoadRunner11/roadrunner
|
d0f3cda83aa17974cb3d68f3f96adcfb7f05caf9
|
[
"Apache-2.0"
] | null | null | null |
nose.py
|
RoadRunner11/roadrunner
|
d0f3cda83aa17974cb3d68f3f96adcfb7f05caf9
|
[
"Apache-2.0"
] | null | null | null |
nose.py
|
RoadRunner11/roadrunner
|
d0f3cda83aa17974cb3d68f3f96adcfb7f05caf9
|
[
"Apache-2.0"
] | null | null | null |
from nose.tools import assert_equal
def get_string(x, y):
return str(x)+str(y)
print("passed")
assert_equal(get_string(4, 5), '45')
assert_equal(get_string('hello', 'world'), 'helloworld')
| 18.818182
| 57
| 0.671498
| 32
| 207
| 4.15625
| 0.65625
| 0.24812
| 0.210526
| 0.300752
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.023121
| 0.164251
| 207
| 10
| 58
| 20.7
| 0.745665
| 0
| 0
| 0
| 0
| 0
| 0.142132
| 0
| 0
| 0
| 0
| 0
| 0.5
| 1
| 0.166667
| false
| 0.166667
| 0.166667
| 0.166667
| 0.5
| 0.166667
| 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
| 1
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
|
0
| 6
|
371e7c650fa37e71272786050053b3df7fa1b51b
| 38
|
py
|
Python
|
cfnet/__init__.py
|
bchidest/CFNet
|
d8e73bd33cfd62edf76abed99efb9e4bdd7dbc48
|
[
"Apache-2.0"
] | 26
|
2019-06-02T06:18:21.000Z
|
2022-02-03T07:32:49.000Z
|
cfnet/__init__.py
|
JaspreetSinghMaan/CFNet
|
d8e73bd33cfd62edf76abed99efb9e4bdd7dbc48
|
[
"Apache-2.0"
] | null | null | null |
cfnet/__init__.py
|
JaspreetSinghMaan/CFNet
|
d8e73bd33cfd62edf76abed99efb9e4bdd7dbc48
|
[
"Apache-2.0"
] | 5
|
2019-03-11T08:22:47.000Z
|
2021-07-10T15:59:56.000Z
|
import network
import run
import data
| 9.5
| 14
| 0.842105
| 6
| 38
| 5.333333
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.157895
| 38
| 3
| 15
| 12.666667
| 1
| 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
|
372aef0e4ac8e9e811756461cded440a3ad502de
| 44
|
py
|
Python
|
surveys/forms/__init__.py
|
GeorgeVelikov/Surffee
|
1d89f423d9275aa34c5b51ebbf5457078cdc4d71
|
[
"MIT"
] | null | null | null |
surveys/forms/__init__.py
|
GeorgeVelikov/Surffee
|
1d89f423d9275aa34c5b51ebbf5457078cdc4d71
|
[
"MIT"
] | null | null | null |
surveys/forms/__init__.py
|
GeorgeVelikov/Surffee
|
1d89f423d9275aa34c5b51ebbf5457078cdc4d71
|
[
"MIT"
] | null | null | null |
from .surveys import *
from .users import *
| 14.666667
| 22
| 0.727273
| 6
| 44
| 5.333333
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.181818
| 44
| 2
| 23
| 22
| 0.888889
| 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
|
2e9705c55a72c8748549f02754d42cb0208cc237
| 4,959
|
py
|
Python
|
tests/test_cli_sugar.py
|
chrisgilmerproj/brewing
|
fd8251e5bf34c20342034187fb30d9fffc723aa8
|
[
"MIT"
] | 21
|
2016-08-16T17:34:17.000Z
|
2021-05-09T13:44:48.000Z
|
tests/test_cli_sugar.py
|
chrisgilmerproj/brewing
|
fd8251e5bf34c20342034187fb30d9fffc723aa8
|
[
"MIT"
] | 16
|
2016-11-16T17:07:12.000Z
|
2020-12-16T18:11:49.000Z
|
tests/test_cli_sugar.py
|
chrisgilmerproj/brewing
|
fd8251e5bf34c20342034187fb30d9fffc723aa8
|
[
"MIT"
] | 4
|
2016-08-16T16:40:49.000Z
|
2019-10-31T01:53:00.000Z
|
# -*- coding: utf-8 -*-
import unittest
from brew.cli.sugar import get_parser
from brew.cli.sugar import get_sugar_conversion
from brew.cli.sugar import main
class TestCliSugar(unittest.TestCase):
def setUp(self):
self.brix = 22.0
self.plato = 22.0
self.sg = 1.092
def test_get_sugar_conversion_brix_to_brix(self):
out = get_sugar_conversion(self.brix, None, None, u"b")
self.assertEquals(round(out, 1), self.brix)
def test_get_sugar_conversion_brix_to_plato(self):
out = get_sugar_conversion(self.brix, None, None, u"p")
self.assertEquals(round(out, 1), self.plato)
def test_get_sugar_conversion_brix_to_sg(self):
out = get_sugar_conversion(self.brix, None, None, u"s")
self.assertEquals(round(out, 3), self.sg)
def test_get_sugar_conversion_plato_to_brix(self):
out = get_sugar_conversion(None, self.plato, None, u"b")
self.assertEquals(round(out, 1), self.brix)
def test_get_sugar_conversion_plato_to_plato(self):
out = get_sugar_conversion(None, self.plato, None, u"p")
self.assertEquals(round(out, 1), self.plato)
def test_get_sugar_conversion_plato_to_sg(self):
out = get_sugar_conversion(None, self.plato, None, u"s")
self.assertEquals(round(out, 3), self.sg)
def test_get_sugar_conversion_sg_to_brix(self):
out = get_sugar_conversion(None, None, self.sg, u"b")
self.assertEquals(round(out, 1), self.brix)
def test_get_sugar_conversion_sg_to_plato(self):
out = get_sugar_conversion(None, None, self.sg, u"p")
self.assertEquals(round(out, 1), self.plato)
def test_get_sugar_conversion_sg_to_sg(self):
out = get_sugar_conversion(None, None, self.sg, u"s")
self.assertEquals(round(out, 3), self.sg)
def test_get_sugar_conversion_all_brix(self):
out = get_sugar_conversion(self.brix, None, None, None)
expected = u"SG\tPlato\tBrix\n1.092\t22.0\t22.0"
self.assertEquals(out, expected)
def test_get_sugar_conversion_all_plato(self):
out = get_sugar_conversion(None, self.plato, None, None)
expected = u"SG\tPlato\tBrix\n1.092\t22.0\t22.0"
self.assertEquals(out, expected)
def test_get_sugar_conversion_all_sg(self):
out = get_sugar_conversion(None, None, self.sg, None)
expected = u"SG\tPlato\tBrix\n1.092\t22.0\t22.0"
self.assertEquals(out, expected)
class TestCliArgparserSugar(unittest.TestCase):
def setUp(self):
self.parser = get_parser()
def test_get_parser_brix_in_none_out(self):
args = [u"-b", u"22.0"]
out = self.parser.parse_args(args)
expected = {u"brix": 22.0, u"plato": None, u"sg": None, u"out": None}
self.assertEquals(out.__dict__, expected)
def test_get_parser_plato_in_none_out(self):
args = [u"-p", u"22.0"]
out = self.parser.parse_args(args)
expected = {u"brix": None, u"plato": 22.0, u"sg": None, u"out": None}
self.assertEquals(out.__dict__, expected)
def test_get_parser_sg_in_none_out(self):
args = [u"-s", u"1.060"]
out = self.parser.parse_args(args)
expected = {u"brix": None, u"plato": None, u"sg": 1.060, u"out": None}
self.assertEquals(out.__dict__, expected)
def test_get_parser_sg_in_brix_out(self):
args = [u"-s", u"1.060", u"-o", u"b"]
out = self.parser.parse_args(args)
expected = {u"brix": None, u"plato": None, u"sg": 1.060, u"out": u"b"}
self.assertEquals(out.__dict__, expected)
class TestCliMainSugar(unittest.TestCase):
def setUp(self):
class Parser(object):
def __init__(self, output):
self.output = output
def parse_args(self):
class Args(object):
pass
args = Args()
if self.output:
for k, v in self.output.items():
setattr(args, k, v)
return args
def g_parser(output=None):
return Parser(output)
self.parser_fn = g_parser
self.main = main
def test_main_no_args(self):
args = {u"output": {u"brix": None, u"plato": None, u"sg": None, u"out": None}}
with self.assertRaises(SystemExit):
self.main(parser_fn=self.parser_fn, parser_kwargs=args)
def test_main_no_kwargs(self):
with self.assertRaises(AttributeError):
self.main(parser_fn=self.parser_fn)
def test_main_two_args(self):
args = {u"output": {u"brix": 22.0, u"plato": 22.0, u"sg": None, u"out": None}}
with self.assertRaises(SystemExit):
self.main(parser_fn=self.parser_fn, parser_kwargs=args)
def test_main_one_arg(self):
args = {u"output": {u"brix": 22.0, u"plato": None, u"sg": None, u"out": None}}
self.main(parser_fn=self.parser_fn, parser_kwargs=args)
| 36.733333
| 86
| 0.636015
| 731
| 4,959
| 4.079343
| 0.099863
| 0.067069
| 0.150905
| 0.060362
| 0.83501
| 0.807847
| 0.755198
| 0.714286
| 0.690141
| 0.686787
| 0
| 0.022913
| 0.234321
| 4,959
| 134
| 87
| 37.007463
| 0.762444
| 0.004235
| 0
| 0.303922
| 0
| 0
| 0.052066
| 0.020665
| 0
| 0
| 0
| 0
| 0.186275
| 1
| 0.254902
| false
| 0.009804
| 0.039216
| 0.009804
| 0.362745
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 6
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.