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
da0eb7121970c719157241f0e3005acdbf721883
202
py
Python
grax/__main__.py
jackd/grax
99baaea786c59c1f5fe4314ba26d04b9a69499d6
[ "Apache-2.0" ]
6
2021-02-18T08:21:02.000Z
2021-07-29T09:09:30.000Z
grax/__main__.py
jackd/grax
99baaea786c59c1f5fe4314ba26d04b9a69499d6
[ "Apache-2.0" ]
null
null
null
grax/__main__.py
jackd/grax
99baaea786c59c1f5fe4314ba26d04b9a69499d6
[ "Apache-2.0" ]
null
null
null
import huf.cli from absl import app import grax.config # pylint: disable=unused-import import grax.huf_utils # pylint: disable=unused-import if __name__ == "__main__": app.run(huf.cli.app_main)
22.444444
54
0.752475
31
202
4.580645
0.516129
0.084507
0.267606
0.352113
0
0
0
0
0
0
0
0
0.143564
202
8
55
25.25
0.820809
0.292079
0
0
0
0
0.057143
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
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
da49dc40829c326e4f8dae04904f108dc74b5fbe
56
py
Python
delayed_assert/__init__.py
pr4bh4sh/python-delayedssert
b1be71fa0a9714f4a1e7ff669264c8047aba2f1e
[ "Unlicense" ]
20
2019-08-02T12:42:40.000Z
2022-01-07T11:53:26.000Z
delayed_assert/__init__.py
pr4bh4sh/python-delayedssert
b1be71fa0a9714f4a1e7ff669264c8047aba2f1e
[ "Unlicense" ]
16
2019-08-27T12:19:30.000Z
2022-01-07T14:05:54.000Z
delayed_assert/__init__.py
pr4bh4sh/python-delayedssert
b1be71fa0a9714f4a1e7ff669264c8047aba2f1e
[ "Unlicense" ]
6
2019-10-09T19:05:38.000Z
2021-09-17T15:36:10.000Z
from .delayed_assert import expect, assert_expectations
28
55
0.875
7
56
6.714286
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.089286
56
1
56
56
0.921569
0
0
0
0
0
0
0
0
0
0
0
1
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
1
0
1
0
1
0
0
6
16f4e800765c56c3f2aef3526d0b5a702e0bc3d9
152
py
Python
src_nlp/tensorflow/toward_control/data/imdb/__init__.py
ashishpatel26/finch
bf2958c0f268575e5d51ad08fbc08b151cbea962
[ "MIT" ]
1
2019-02-12T09:22:00.000Z
2019-02-12T09:22:00.000Z
src_nlp/tensorflow/toward_control/data/imdb/__init__.py
loopzxl/finch
bf2958c0f268575e5d51ad08fbc08b151cbea962
[ "MIT" ]
null
null
null
src_nlp/tensorflow/toward_control/data/imdb/__init__.py
loopzxl/finch
bf2958c0f268575e5d51ad08fbc08b151cbea962
[ "MIT" ]
1
2020-10-15T21:34:17.000Z
2020-10-15T21:34:17.000Z
from .vae_pipeline import VAEDataLoader from .wake_sleep_pipeline import WakeSleepDataLoader from .discriminator_pipeline import DiscriminatorDataLoader
50.666667
59
0.907895
16
152
8.375
0.625
0.313433
0
0
0
0
0
0
0
0
0
0
0.072368
152
3
59
50.666667
0.950355
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
e56ce7a5da79ae9108f2d4441d4d0e5928aa2093
109
py
Python
lightRaven/utils/__init__.py
M0gician/lightRaven
edcaed1ffbfab95064fc2719f2e3f79375ce6f04
[ "MIT" ]
1
2020-12-16T07:41:44.000Z
2020-12-16T07:41:44.000Z
lightRaven/utils/__init__.py
M0gician/lightRaven
edcaed1ffbfab95064fc2719f2e3f79375ce6f04
[ "MIT" ]
null
null
null
lightRaven/utils/__init__.py
M0gician/lightRaven
edcaed1ffbfab95064fc2719f2e3f79375ce6f04
[ "MIT" ]
null
null
null
from .data_gen import generate_dataset, get_theta_perf, get_policy_perf from .safety_test import safety_test
36.333333
71
0.87156
18
109
4.833333
0.666667
0.229885
0
0
0
0
0
0
0
0
0
0
0.091743
109
2
72
54.5
0.878788
0
0
0
1
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
6
e5765b7f6c03edbfc1edb0c24c8cdbf8ff228236
20
py
Python
advanced_led_control/models/leds.py
weshouman/advanced_led_control
ecf9bd74cee90d7a6a94455adde9308a4c4f48bb
[ "MIT" ]
null
null
null
advanced_led_control/models/leds.py
weshouman/advanced_led_control
ecf9bd74cee90d7a6a94455adde9308a4c4f48bb
[ "MIT" ]
null
null
null
advanced_led_control/models/leds.py
weshouman/advanced_led_control
ecf9bd74cee90d7a6a94455adde9308a4c4f48bb
[ "MIT" ]
null
null
null
LED_1 = 0 LED_2 = 1
6.666667
9
0.6
6
20
1.666667
0.666667
0
0
0
0
0
0
0
0
0
0
0.285714
0.3
20
2
10
10
0.428571
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
1
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
e5e18dad2158b65c4230a4f93bb3a44e09ef817d
35
py
Python
03_GraphBasedPlanner/graph_ltpl/online_graph/__init__.py
f1tenth/ESweek2021_educationclassA3
7620a36d21c1824efba8a83f0671926bf8e028f3
[ "MIT" ]
15
2021-10-09T13:48:49.000Z
2022-03-27T04:36:44.000Z
03_GraphBasedPlanner/graph_ltpl/online_graph/__init__.py
yinflight/ESweek2021_educationclassA3
7a32bacdb7f3154a773d28b6b6abffdaa154a526
[ "MIT" ]
1
2021-11-27T01:47:25.000Z
2021-11-27T02:44:04.000Z
03_GraphBasedPlanner/graph_ltpl/online_graph/__init__.py
yinflight/ESweek2021_educationclassA3
7a32bacdb7f3154a773d28b6b6abffdaa154a526
[ "MIT" ]
2
2021-11-03T19:32:55.000Z
2021-11-27T02:43:13.000Z
import graph_ltpl.online_graph.src
17.5
34
0.885714
6
35
4.833333
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.057143
35
1
35
35
0.878788
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
e5e45896351155c56dca8c33d5e5b9f3e9411005
139
py
Python
whats_this/bin/pyWhat/what_call.py
roaldi/Whats-This
c98c27b88225094409bff8d2a826f6fba99ffe47
[ "Apache-2.0" ]
null
null
null
whats_this/bin/pyWhat/what_call.py
roaldi/Whats-This
c98c27b88225094409bff8d2a826f6fba99ffe47
[ "Apache-2.0" ]
null
null
null
whats_this/bin/pyWhat/what_call.py
roaldi/Whats-This
c98c27b88225094409bff8d2a826f6fba99ffe47
[ "Apache-2.0" ]
null
null
null
import pyWhat.regex_identifier def export_cli(text): ident = pyWhat.regex_identifier.RegexIdentifier() return ident.check(text)
17.375
53
0.769784
17
139
6.117647
0.705882
0.211538
0.403846
0
0
0
0
0
0
0
0
0
0.143885
139
7
54
19.857143
0.87395
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.25
0
0.75
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
1
0
0
0
0
1
0
0
6
f900449b614a206da7abbd737b02a52a10cf5d9a
62
py
Python
models/__init__.py
israelvf/snake_game
08932c570b843493aad0473c7d70ecf500344549
[ "MIT" ]
null
null
null
models/__init__.py
israelvf/snake_game
08932c570b843493aad0473c7d70ecf500344549
[ "MIT" ]
null
null
null
models/__init__.py
israelvf/snake_game
08932c570b843493aad0473c7d70ecf500344549
[ "MIT" ]
null
null
null
from models.apple import Apple from models.snake import Snake
20.666667
30
0.83871
10
62
5.2
0.5
0.384615
0
0
0
0
0
0
0
0
0
0
0.129032
62
2
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
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
005c05ca7972e1118074147ae629deeb87ef83b3
18
py
Python
examples/core/tools/__init__.py
zyh1999/pytorch-quantum
c00bd564a99001fee2fd6b30e5e34562ab981e28
[ "MIT" ]
98
2021-07-23T07:11:32.000Z
2021-12-19T14:04:58.000Z
examples/core/tools/__init__.py
zyh1999/pytorch-quantum
c00bd564a99001fee2fd6b30e5e34562ab981e28
[ "MIT" ]
2
2021-02-11T19:01:48.000Z
2021-04-04T20:29:57.000Z
examples/core/tools/__init__.py
zyh1999/pytorch-quantum
c00bd564a99001fee2fd6b30e5e34562ab981e28
[ "MIT" ]
12
2021-07-23T07:10:47.000Z
2021-12-16T23:44:44.000Z
from .es import *
9
17
0.666667
3
18
4
1
0
0
0
0
0
0
0
0
0
0
0
0.222222
18
1
18
18
0.857143
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
008b02c0ccf9a8f46721c3ad9ca6bdaccbf51164
20,461
py
Python
tests/asgard/workers/autoscaler/test_decision_component.py
b2wdigital/asgard-api
5444d81be33bf4af3c9cf5a2185c16ff10357034
[ "MIT" ]
3
2020-01-10T02:16:09.000Z
2020-02-19T18:42:37.000Z
tests/asgard/workers/autoscaler/test_decision_component.py
b2wdigital/asgard-api
5444d81be33bf4af3c9cf5a2185c16ff10357034
[ "MIT" ]
13
2020-01-15T18:22:35.000Z
2021-03-31T19:21:54.000Z
tests/asgard/workers/autoscaler/test_decision_component.py
b2wdigital/asgard-api
5444d81be33bf4af3c9cf5a2185c16ff10357034
[ "MIT" ]
6
2020-03-07T09:49:19.000Z
2021-07-25T03:14:10.000Z
from unittest.mock import NonCallableMock from asynctest import TestCase from asgard.workers.autoscaler.decision_events import DecisionEvents from asgard.workers.autoscaler.simple_decision_component import ( DecisionComponent, ) from asgard.workers.models.app_stats import AppStats from asgard.workers.models.scalable_app import ScalableApp class TestDecisionComponent(TestCase): async def test_scales_app_when_difference_greater_than_5_percent(self): apps = [ ScalableApp( "test", cpu_allocated=1.0, mem_allocated=1.0, cpu_threshold=0.5, mem_threshold=0.7, app_stats=AppStats(cpu_usage=0.4499, mem_usage=0.7501), ) ] decider = DecisionComponent() decisions = decider.decide_scaling_actions(apps) self.assertEqual(1, len(decisions)) self.assertEqual("test", decisions[0].id) async def test_does_not_scale_app_when_difference_less_than_5_percent(self): apps = [ ScalableApp( "test", cpu_allocated=1.0, mem_allocated=1.0, cpu_threshold=0.5, mem_threshold=0.7, app_stats=AppStats(cpu_usage=0.4501, mem_usage=0.7499), ) ] decider = DecisionComponent() decisions = decider.decide_scaling_actions(apps) self.assertEqual(0, len(decisions)) async def test_does_not_make_cpu_decision_when_cpu_is_ignored(self): apps = [ ScalableApp( "test", cpu_allocated=1.0, mem_allocated=1.0, cpu_threshold=None, mem_threshold=0.7, app_stats=AppStats(cpu_usage=0.8, mem_usage=0.3), ) ] decider = DecisionComponent() decisions = decider.decide_scaling_actions(apps) self.assertEqual(1, len(decisions), "makes decision for the app only") self.assertEqual("test", decisions[0].id, "returns the correct app") self.assertEqual(None, decisions[0].cpu, "does not return cpu decision") self.assertNotEqual(None, decisions[0].mem, "returns memory decision") async def test_does_not_make_memory_decision_when_memory_is_ignored(self): apps = [ ScalableApp( "test", cpu_allocated=1.0, mem_allocated=1.0, cpu_threshold=0.7, mem_threshold=None, app_stats=AppStats(cpu_usage=0.8, mem_usage=0.3), ) ] decider = DecisionComponent() decisions = decider.decide_scaling_actions(apps) self.assertEqual(1, len(decisions), "makes decision for the app only") self.assertEqual("test", decisions[0].id, "returns the correct app") self.assertNotEqual(None, decisions[0].cpu, "returns cpu decision") self.assertEqual( None, decisions[0].mem, "does not return memory decision" ) async def test_does_not_make_any_decision_when_everything_is_ignored(self): apps = [ ScalableApp( "test", cpu_allocated=1.0, mem_allocated=1.0, cpu_threshold=None, mem_threshold=None, app_stats=AppStats(cpu_usage=0.8, mem_usage=0.3), ) ] decider = DecisionComponent() decisions = decider.decide_scaling_actions(apps) self.assertEqual(0, len(decisions), "does not return any decisions") async def test_scales_cpu_and_mem_to_correct_value(self): apps = [ ScalableApp( "test1", cpu_allocated=3.5, mem_allocated=1.0, cpu_threshold=0.1, mem_threshold=0.1, app_stats=AppStats(cpu_usage=1.0, mem_usage=1.0), ), ScalableApp( "test2", cpu_allocated=3.5, mem_allocated=1.0, cpu_threshold=0.5, mem_threshold=0.7, app_stats=AppStats(cpu_usage=1.0, mem_usage=1.0), ), ] decider = DecisionComponent() decisions = decider.decide_scaling_actions(apps) self.assertEqual(2, len(decisions), "makes decisions for both apps") self.assertEqual( "test1", decisions[0].id, "returns correct apps in correct order" ) self.assertEqual( "test2", decisions[1].id, "returns correct apps in correct order" ) self.assertEqual(35, decisions[0].cpu, "decides correct values for cpu") self.assertEqual( 10, decisions[0].mem, "decides correct values for memory" ) self.assertEqual(7, decisions[1].cpu, "decides correct values for cpu") self.assertEqual( 1.4286, round(decisions[1].mem, 4), "decides correct values for memory", ) async def test_scales_memory_to_correct_value(self): apps = [ ScalableApp( "test", cpu_allocated=0.5, mem_allocated=128, mem_threshold=0.2, app_stats=AppStats(cpu_usage=0.4129, mem_usage=0.6262), ) ] decider = DecisionComponent() decisions = decider.decide_scaling_actions(apps) self.assertEqual(1, len(decisions), "did not return any decisions") self.assertEqual(400.768, decisions[0].mem) async def test_does_not_scale_cpu_below_min_scale_limit(self): min_cpu_limit = float("inf") max_cpu_limit = float("inf") apps = [ ScalableApp( "test", cpu_allocated=0.5, mem_allocated=128, cpu_threshold=0.6, app_stats=AppStats(cpu_usage=0.4129, mem_usage=0.6262), min_cpu_scale_limit=min_cpu_limit, max_cpu_scale_limit=max_cpu_limit, ) ] decider = DecisionComponent() decisions = decider.decide_scaling_actions(apps) self.assertEqual(1, len(decisions), "did not return any decisions") self.assertGreaterEqual( min_cpu_limit, decisions[0].cpu, "cpu value is less than the min limit", ) async def test_does_not_scale_mem_below_min_scale_limit(self): min_mem_limit = float("inf") max_mem_limit = float("inf") apps = [ ScalableApp( "test", cpu_allocated=0.5, mem_allocated=128, mem_threshold=0.5, app_stats=AppStats(cpu_usage=0.4129, mem_usage=0.35), min_mem_scale_limit=min_mem_limit, max_mem_scale_limit=max_mem_limit, ) ] decider = DecisionComponent() decisions = decider.decide_scaling_actions(apps) self.assertEqual(1, len(decisions), "did not return any decisions") self.assertGreaterEqual( min_mem_limit, decisions[0].mem, "mem value is less than the min limit", ) async def test_does_not_scale_mem_above_max_scale_limit(self): max_mem_limit = float("-inf") min_mem_limit = float("-inf") apps = [ ScalableApp( "test", cpu_allocated=0.5, mem_allocated=128, mem_threshold=0.5, app_stats=AppStats(cpu_usage=0.4129, mem_usage=0.8), max_mem_scale_limit=max_mem_limit, min_mem_scale_limit=min_mem_limit, ) ] decider = DecisionComponent() decisions = decider.decide_scaling_actions(apps) self.assertEqual(1, len(decisions), "did not return any decisions") self.assertLessEqual( max_mem_limit, decisions[0].mem, "mem value is greater than the max limit", ) async def test_does_not_scale_cpu_above_max_scale_limit(self): max_cpu_limit = float("-inf") min_cpu_limit = float("-inf") apps = [ ScalableApp( "test", cpu_allocated=0.5, mem_allocated=128, cpu_threshold=0.2, app_stats=AppStats(cpu_usage=0.4129, mem_usage=0.8), max_cpu_scale_limit=max_cpu_limit, min_cpu_scale_limit=min_cpu_limit, ) ] decider = DecisionComponent() decisions = decider.decide_scaling_actions(apps) self.assertEqual(1, len(decisions), "did not return any decisions") self.assertLessEqual( max_cpu_limit, decisions[0].cpu, "cpu value is greater than the max limit", ) async def test_does_not_make_decision_when_app_is_using_min_cpu_and_decision_would_downscale( self ): apps = [ ScalableApp( "test", cpu_allocated=0.5, mem_allocated=128, cpu_threshold=0.75, app_stats=AppStats(cpu_usage=0.1, mem_usage=0.8), min_cpu_scale_limit=0.5, ) ] decider = DecisionComponent() decisions = decider.decide_scaling_actions(apps) self.assertEqual(0, len(decisions), "a decision was made") async def test_does_not_make_decision_when_app_is_using_max_cpu_and_decision_would_upscale( self ): apps = [ ScalableApp( "test", cpu_allocated=0.5, mem_allocated=128, cpu_threshold=0.75, app_stats=AppStats(cpu_usage=1.0, mem_usage=0.8), max_cpu_scale_limit=0.5, ) ] decider = DecisionComponent() decisions = decider.decide_scaling_actions(apps) self.assertEqual(0, len(decisions), "a decision was made") async def test_does_not_make_decision_when_app_is_using_min_mem_and_decision_would_downscale( self ): apps = [ ScalableApp( "test", cpu_allocated=0.5, mem_allocated=128, mem_threshold=0.75, app_stats=AppStats(cpu_usage=0.1, mem_usage=0.2), min_mem_scale_limit=128, ) ] decider = DecisionComponent() decisions = decider.decide_scaling_actions(apps) self.assertEqual(0, len(decisions), "a decision was made") async def test_does_not_make_decision_when_app_is_using_max_mem_and_decision_would_upscale( self ): apps = [ ScalableApp( "test", cpu_allocated=0.5, mem_allocated=128, mem_threshold=0.75, app_stats=AppStats(cpu_usage=0.1, mem_usage=1.0), max_mem_scale_limit=128, ) ] decider = DecisionComponent() decisions = decider.decide_scaling_actions(apps) self.assertEqual(0, len(decisions), "a decision was made") async def test_does_not_make_decision_when_there_are_no_stats(self): apps = [ ScalableApp( "test", cpu_allocated=0.5, mem_allocated=128, cpu_threshold=0.2, app_stats=None, ) ] decider = DecisionComponent() decisions = decider.decide_scaling_actions(apps) self.assertEqual(0, len(decisions), "decision was made") async def test_logs_cpu_upscaling_decisions(self): apps = [ ScalableApp( "test", cpu_allocated=0.5, mem_allocated=128, cpu_threshold=0.2, app_stats=AppStats(cpu_usage=1.0, mem_usage=0.1), ) ] mock_logger = NonCallableMock() decider = DecisionComponent(logger=mock_logger) decisions = decider.decide_scaling_actions(apps) mock_logger.info.assert_called() logged_dict = mock_logger.info.call_args[0][0] self.assertIn("appname", logged_dict, "did not log correct app id") self.assertEqual( apps[0].id, logged_dict["appname"], "did not log correct app id" ) self.assertIn("event", logged_dict, "did not log an event") self.assertEqual( DecisionEvents.CPU_SCALE_UP, logged_dict["event"], "did not log correct event", ) self.assertIn( "previous_value", logged_dict, "did not log previous CPU value" ) self.assertEqual( logged_dict["previous_value"], apps[0].cpu_allocated, "did not log correct previous CPU value", ) self.assertIn("new_value", logged_dict, "did not log new CPU value") self.assertEqual( logged_dict["new_value"], decisions[0].cpu, "did not log correct new CPU value", ) async def test_logs_memory_upscaling_decisions(self): apps = [ ScalableApp( "test", cpu_allocated=0.5, mem_allocated=128, mem_threshold=0.2, app_stats=AppStats(cpu_usage=0.1, mem_usage=1.0), ) ] mock_logger = NonCallableMock() decider = DecisionComponent(logger=mock_logger) decisions = decider.decide_scaling_actions(apps) mock_logger.info.assert_called() logged_dict = mock_logger.info.call_args[0][0] self.assertIn("appname", logged_dict, "did not log correct app id") self.assertEqual( apps[0].id, logged_dict["appname"], "did not log correct app id" ) self.assertIn("event", logged_dict, "did not log an event") self.assertEqual( DecisionEvents.MEM_SCALE_UP, logged_dict["event"], "did not log correct event", ) self.assertIn( "previous_value", logged_dict, "did not log previous memory value" ) self.assertEqual( apps[0].mem_allocated, logged_dict["previous_value"], "did not log correct previous memory value", ) self.assertIn("new_value", logged_dict, "did not log new memory value") self.assertEqual( decisions[0].mem, logged_dict["new_value"], "did not log correct new memory value", ) def test_logs_cpu_downscaling_decisions(self): apps = [ ScalableApp( "test", cpu_allocated=0.5, mem_allocated=128, cpu_threshold=1, app_stats=AppStats(cpu_usage=0.1, mem_usage=0.1), ) ] mock_logger = NonCallableMock() decider = DecisionComponent(logger=mock_logger) decisions = decider.decide_scaling_actions(apps) mock_logger.info.assert_called() logged_dict = mock_logger.info.call_args[0][0] self.assertIn("appname", logged_dict, "did not log correct app id") self.assertEqual( apps[0].id, logged_dict["appname"], "did not log correct app id" ) self.assertIn("event", logged_dict, "did not log an event") self.assertEqual( DecisionEvents.CPU_SCALE_DOWN, logged_dict["event"], "did not log correct event", ) self.assertIn( "previous_value", logged_dict, "did not log previous CPU value" ) self.assertEqual( apps[0].cpu_allocated, logged_dict["previous_value"], "did not log correct previous CPU value", ) self.assertIn("new_value", logged_dict, "did not log new CPU value") self.assertEqual( decisions[0].cpu, logged_dict["new_value"], "did not log correct new CPU value", ) def test_logs_memory_downscaling_decisions(self): apps = [ ScalableApp( "test", cpu_allocated=0.5, mem_allocated=128, mem_threshold=1, app_stats=AppStats(cpu_usage=0.1, mem_usage=0.1), ) ] mock_logger = NonCallableMock() decider = DecisionComponent(logger=mock_logger) decisions = decider.decide_scaling_actions(apps) mock_logger.info.assert_called() logged_dict = mock_logger.info.call_args[0][0] self.assertIn("appname", logged_dict, "did not log correct app id") self.assertEqual( apps[0].id, logged_dict["appname"], "did not log correct app id" ) self.assertIn("event", logged_dict, "did not log an event") self.assertEqual( DecisionEvents.MEM_SCALE_DOWN, logged_dict["event"], "did not log correct event", ) self.assertIn( "previous_value", logged_dict, "did not log previous memory value" ) self.assertEqual( apps[0].mem_allocated, logged_dict["previous_value"], "did not log correct previous memory value", ) self.assertIn("new_value", logged_dict, "did not log new memory value") self.assertEqual( decisions[0].mem, logged_dict["new_value"], "did not log correct new memory value", ) def test_logs_cpu_and_memory_scaling_decisions(self): apps = [ ScalableApp( "test", cpu_allocated=0.5, mem_allocated=128, mem_threshold=1, cpu_threshold=0.2, app_stats=AppStats(cpu_usage=1.0, mem_usage=0.1), ) ] mock_logger = NonCallableMock() decider = DecisionComponent(logger=mock_logger) decisions = decider.decide_scaling_actions(apps) mock_logger.info.assert_called() logger_calls = [call[0][0] for call in mock_logger.info.call_args_list] self.assertEqual(len(logger_calls), 2, "did not call log.info 2 times") logger_calls.sort(key=lambda call: call["event"]) cpu_log_dict = logger_calls[0] mem_log_dict = logger_calls[1] self.assertIn("appname", cpu_log_dict, "did not log correct app id") self.assertEqual( mem_log_dict["appname"], apps[0].id, "did not log correct app id" ) self.assertIn("event", cpu_log_dict, "did not log an event") self.assertEqual( DecisionEvents.CPU_SCALE_UP, cpu_log_dict["event"], "did not log correct event", ) self.assertIn( "previous_value", cpu_log_dict, "did not log previous memory value" ) self.assertEqual( 0.5, cpu_log_dict["previous_value"], "did not log correct previous memory value", ) self.assertIn("new_value", cpu_log_dict, "did not log new memory value") self.assertEqual( decisions[0].cpu, cpu_log_dict["new_value"], "did not log correct new memory value", ) self.assertIn("appname", mem_log_dict, "did not log correct app id") self.assertEqual( apps[0].id, mem_log_dict["appname"], "did not log correct app id" ) self.assertIn("event", mem_log_dict, "did not log an event") self.assertEqual( DecisionEvents.MEM_SCALE_DOWN, mem_log_dict["event"], "did not log correct event", ) self.assertIn( "previous_value", mem_log_dict, "did not log previous memory value" ) self.assertEqual( apps[0].mem_allocated, mem_log_dict["previous_value"], "did not log correct previous memory value", ) self.assertIn("new_value", mem_log_dict, "did not log new memory value") self.assertEqual( decisions[0].mem, mem_log_dict["new_value"], "did not log correct new memory value", )
32.58121
97
0.568007
2,303
20,461
4.79201
0.063396
0.029358
0.039145
0.043494
0.883925
0.859007
0.831733
0.809351
0.784433
0.768757
0
0.027751
0.341332
20,461
627
98
32.633174
0.791126
0
0
0.646503
0
0
0.138361
0
0
0
0
0
0.166352
1
0.005671
false
0
0.011342
0
0.018904
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
008bb982795cf8dc2faeb1f37f5199132ad6afc0
213
py
Python
departure/board/renderer.py
Woll78/departure-python
86eccd40291ad560d5859a120dd6c99aa5c4bd12
[ "MIT" ]
4
2020-10-18T18:12:04.000Z
2022-03-31T19:13:08.000Z
departure/board/renderer.py
Woll78/departure-python
86eccd40291ad560d5859a120dd6c99aa5c4bd12
[ "MIT" ]
null
null
null
departure/board/renderer.py
Woll78/departure-python
86eccd40291ad560d5859a120dd6c99aa5c4bd12
[ "MIT" ]
1
2021-11-19T10:37:26.000Z
2021-11-19T10:37:26.000Z
class Renderer: def initialise(self): raise NotImplementedError() def render_frame(self, pixels): raise NotImplementedError() def terminate(self): raise NotImplementedError()
21.3
35
0.671362
19
213
7.473684
0.578947
0.507042
0.394366
0
0
0
0
0
0
0
0
0
0.248826
213
9
36
23.666667
0.8875
0
0
0.428571
0
0
0
0
0
0
0
0
0
1
0.428571
false
0
0
0
0.571429
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
1
0
0
0
0
1
0
0
6
0094b82a16dd3bc07f73b32a25e1fc2cb23a8a6f
138,281
py
Python
Task 2.9.1 Kung Fu : Chopping Chain Punch.py
varipon/Work-Plan-2.-Biomechanical-simulation-of-human
9c6bf4685189cb6970f6b36426250b08919f4801
[ "MIT" ]
null
null
null
Task 2.9.1 Kung Fu : Chopping Chain Punch.py
varipon/Work-Plan-2.-Biomechanical-simulation-of-human
9c6bf4685189cb6970f6b36426250b08919f4801
[ "MIT" ]
null
null
null
Task 2.9.1 Kung Fu : Chopping Chain Punch.py
varipon/Work-Plan-2.-Biomechanical-simulation-of-human
9c6bf4685189cb6970f6b36426250b08919f4801
[ "MIT" ]
null
null
null
# ================ # SOFTWARE LICENSE # ================ # The MIT License (MIT) # Copyright (c) 2018 Yutaka Sawai (Varipon) # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # ============================================================== # LICENSE FOR CONTENT PROCEDURALLY GENERATED USING THIS SOFTWARE # ============================================================== # All content procedurally generated by this software and its permutations # are licensed under Creative Commons Attribution By 3.0: # https://creativecommons.org/licenses/by/3.0/ #!/usr/bin/python import bpy from bpy import * import mathutils import math from mathutils import * from math import * class Formula: J = 18 #joint number #frame_start = bpy.context.scene.frame_start #frame_end = bpy.context.scene.frame_end #bpy.context.scene.frame_current = frame_end interval = 120 frame_start = 0 frame_end = 120 def __init__(self, P, A, move, part, helicity, start, end): # pivot factor self.P = P # scale factor self.A = A # name self.move = move # element self.part = part # element helicity self.helicity = helicity self.start = start self.end = end bpy.ops.object.mode_set(mode='OBJECT') # Create armature and object self.amt = bpy.data.armatures.new(move + '.' + part + '.' + helicity + '.data') self.rig = bpy.data.objects.new(move + '.' + part + '.' + helicity, self.amt) # Joints α(n) -> a[n], β(n) -> b[n], γ(n) -> y[n], δ(n) -> o[n] self.a = [0 for i in range(4)] # Joint α self.b = [0 for i in range(self.J)] # Joint β self.y = [0 for i in range(self.J)] # Joint γ self.o = [0 for i in range(self.J)] # Joint δ # Configuration Movement self.configMovement(self.P, self.A, self.J, self.a, self.b, self.y, self.o) # Construction Movement self.constructMovement(self.J, self.helicity, self.amt, self.rig, self.a, self.b, self.y, self.o) # Construction Rotation self.configRotation(self.rig, self.interval, self.frame_start, self.frame_end, self.start, self.end) # Configuration Linkage self.configLink(self.A, self.J, self.helicity, self.rig, self.move, self.part) # Construction Linkage self.constructLink(self.A, self.J, self.helicity, self.rig, self.move, self.part) def configMovement(self, P, A, J, a, b, y, o): mat_a = [0 for i in range(4)] # Joint α matrix mat_b = [0 for i in range(self.J)] # Joint β matrix mat_y = [0 for i in range(self.J)] # Joint γ matrix mat_o = [0 for i in range(self.J)] # Joint δ matrix a[1] = mathutils.Euler((P, A, 0), 'XYZ') print ("a1 =", a[1]) a[2] = mathutils.Euler((A, -A, 0), 'XYZ') print ("a2 =", a[2]) b[1] = mathutils.Euler((-A, A, 0), 'XYZ') print ("b1 =", b[1]) o[1] = mathutils.Euler((A, A, 0), 'XYZ') print ("o1 =", o[1]) B = A * 2 * sqrt (2) C = B + (B * sqrt (2)) D = C * sqrt (2) E = C + D a[0] = mathutils.Euler((-A - E + (D * 0.5), -A - (D * 0.5), 0), 'XYZ') print ("a0 =", a[0]) mat_a[0] = Matrix.Translation(a[0]) a[3] = mathutils.Euler((0-a[0].x, 0-a[0].y, 0-a[0].z), 'XYZ') print ("a3 =", a[3]) mat_a[3] = Matrix.Translation(a[3]) y[1] = mathutils.Euler((-A, -A, 0), 'XYZ') print ("y1 =", y[1]) mat_y[1] = Matrix.Translation(y[1]) ### pattern A b[2] = mathutils.Euler((a[0].x + E + (A * 2), a[0].y + (A * 2), 0), 'XYZ') print ("b2 =", b[2]) mat_b[2] = Matrix.Translation(b[2]) b[3] = mathutils.Euler((a[0].x + E - (D * 0.5), a[0].y - (A * 2), 0), 'XYZ') print ("b3 =", b[3]) mat_b[3] = Matrix.Translation(b[3]) y[2] = mathutils.Euler((a[0].x + E, a[0].y, 0), 'XYZ') print ("y2 =", y[2]) mat_y[2] = Matrix.Translation(y[2]) y[3] = mathutils.Euler((a[0].x + E - (D * 0.5), a[0].y - (D * 0.5), 0), 'XYZ') print ("y3 =", y[3]) mat_y[3] = Matrix.Translation(y[3]) o[2] = mathutils.Euler((a[0].x + E + (A * 2), a[0].y - (A * 2), 0), 'XYZ') print ("o2 =", o[2]) mat_o[2] = Matrix.Translation(o[2]) o[3] = mathutils.Euler((a[0].x + E - (D * 0.5) - (A * 2), a[0].y - (D * 0.5) - (A * 2), 0), 'XYZ') print ("o3 =", o[3]) mat_o[3] = Matrix.Translation(o[3]) ### pattern A end org_rot_mat = Matrix.Rotation(math.radians(0), 4, 'Z') # define the rotation rot_mat = Matrix.Rotation(math.radians(-45), 4, 'Z') for j in range(2, J - 2): mat_y[j + 2] = mat_a[0] * org_rot_mat * rot_mat * mat_a[3] * mat_y[j] # obj.matrix_world = mat_y[j + 2] # extract components back out of the matrix loc, rot, sca = mat_y[j + 2].decompose() y[j + 2] = mathutils.Euler(loc, 'XYZ') print("y"+str(j + 2)+" = ", y[j + 2], rot, sca) mat_b[j + 2] = mat_a[0] * org_rot_mat * rot_mat * mat_a[3] * mat_b[j] # obj.matrix_world = mat_b[j + 2] # extract components back out of the matrix loc, rot, sca = mat_b[j + 2].decompose() b[j + 2] = mathutils.Euler(loc, 'XYZ') print("b"+str(j + 2)+" = ", b[j + 2], rot, sca) mat_o[j + 2] = mat_a[0] * org_rot_mat * rot_mat * mat_a[3] * mat_o[j] # obj.matrix_world = mat_o[j + 2] # extract components back out of the matrix loc, rot, sca = mat_o[j + 2].decompose() o[j + 2] = mathutils.Euler(loc, 'XYZ') print("o"+str(j + 2)+" = ", o[j + 2], rot, sca) def constructMovement(self, J, helicity, amt, rig, a, b, y, o): # Linkages aa = [[0 for i in range(4)] for j in range(4)] # Link α(i) - α(j) ab = [[0 for i in range(4)] for j in range(4)] # Link α(i) - β(j) ya = [[0 for i in range(4)] for j in range(4)] # Link γ(i) - α(j) ao = [[0 for i in range(4)] for j in range(4)] # Link α(i) - δ(j) ob = [[0 for i in range(self.J)] for j in range(self.J)] # Link δ(i) - β(j) yy = [[0 for i in range(self.J)] for j in range(self.J)] # Link γ(i) - γ(j) by = [[0 for i in range(self.J)] for j in range(self.J)] # Link β(i) - γ(j) yo = [[0 for i in range(self.J)] for j in range(self.J)] # Link γ(i) - δ(j) rig.location = mathutils.Euler((0.0, 0.0, 0.0), 'XYZ') rig.show_x_ray = True amt.show_names = True # amt.draw_type = 'STICK' amt.draw_type = 'BBONE' # Link object to scene scn = bpy.context.scene scn.objects.link(rig) scn.objects.active = rig scn.update() # Edit bpy.ops.object.editmode_toggle() # Construction Linkage aa[2][1] = amt.edit_bones.new('a2a1') aa[2][1].head = a[2] aa[2][1].tail = a[1] ab[1][1] = amt.edit_bones.new('a1b1') ab[1][1].head = a[1] ab[1][1].tail = b[1] ab[1][1].parent = aa[2][1] by[1][1] = amt.edit_bones.new('b1y1') by[1][1].head = b[1] by[1][1].tail = y[1] by[1][1].parent = ab[1][1] by[1][1].use_inherit_rotation = False ya[1][2] = amt.edit_bones.new('y1a2') ya[1][2].head = y[1] ya[1][2].tail = a[2] ya[1][2].parent = by[1][1] ao[2][1] = amt.edit_bones.new('a2o1') ao[2][1].head = a[2] ao[2][1].tail = o[1] ao[2][1].parent = ya[1][2] ob[1][2] = amt.edit_bones.new('o1b2') ob[1][2].head = o[1] ob[1][2].tail = b[2] ob[1][2].parent = ao[2][1] yy[1][2] = amt.edit_bones.new('y1y2') yy[1][2].head = y[1] yy[1][2].tail = y[2] yy[1][2].parent = by[1][1] for j in range(2, J - 1): by[j][j] = amt.edit_bones.new('b'+ str(j) + 'y'+ str(j)) by[j][j].head = b[j] by[j][j].tail = y[j] by[j][j].parent = ob[j-1][j] yo[j][j] = amt.edit_bones.new('y'+ str(j) + 'o'+ str(j)) yo[j][j].head = y[j] yo[j][j].tail = o[j] yo[j][j].parent = yy[j-1][j] yy[j][j+1] = amt.edit_bones.new('y'+ str(j) + 'y'+ str(j+1)) yy[j][j+1].head = y[j] yy[j][j+1].tail = y[j+1] yy[j][j+1].parent = by[j][j] if j < (J-2): ob[j][j+1] = amt.edit_bones.new('o'+ str(j) + 'b'+ str(j+1)) ob[j][j+1].head = o[j] ob[j][j+1].tail = b[j+1] ob[j][j+1].parent = yo[j][j] # all bones select #bpy.ops.pose.select_all(action="SELECT") for b in amt.edit_bones: b.select = True if helicity == 'right': bpy.ops.armature.calculate_roll(type='GLOBAL_POS_Z') else: bpy.ops.armature.calculate_roll(type='GLOBAL_NEG_Z') # Bone constraints. Armature must be in pose mode. bpy.ops.object.mode_set(mode='POSE') # IK constraint cns = rig.pose.bones['y1a2'].constraints.new('IK') cns.name = 'Ik' cns.target = rig cns.subtarget = 'a2a1' cns.chain_count = 2 cns.use_stretch = False for j in range(2, J - 1): cns = rig.pose.bones['b'+str(j) +'y'+str(j)].constraints.new('IK') cns.name = 'Ik' cns.target = rig cns.subtarget = 'y'+str(j)+'o'+str(j) cns.iterations = 500 cns.chain_count = 2 cns.use_stretch = False bpy.ops.object.mode_set(mode='OBJECT') def configRotation(self, rig, interval, frame_start, frame_end, start, end): # Bone constraints. Armature must be in pose mode. bpy.ops.object.mode_set(mode='POSE') # key insert keyframe_insert_interval = interval rig.pose.bones["a1b1"].rotation_mode = 'XYZ' rig.pose.bones["a1b1"].rotation_euler.z = math.radians(start) rig.pose.bones["a1b1"].keyframe_insert(data_path="rotation_euler",frame=frame_start) rig.pose.bones["a1b1"].rotation_mode = 'XYZ' rig.pose.bones["a1b1"].rotation_euler.z = math.radians(end) rig.pose.bones["a1b1"].keyframe_insert(data_path="rotation_euler",frame=frame_end) for curve in bpy.context.active_object.animation_data.action.fcurves: cycles = curve.modifiers.new(type='CYCLES') cycles.mode_before = 'REPEAT_OFFSET' cycles.mode_after = 'REPEAT_OFFSET' for keyframe in curve.keyframe_points: keyframe.interpolation = 'LINEAR' bpy.ops.object.mode_set(mode='OBJECT') def configLink(self, A, J, helicity, rig, move, part): bpy.ops.object.mode_set(mode='OBJECT') Q = (0.18648+0.146446)*A # Z = -Q*2 Z = 0.0 obj_joint = bpy.data.objects["joint.gold.000"].copy() obj_joint.location = (0.0, 0.0, -Q*3+Z) obj_joint.scale = (A, A, A) obj_joint.name = "a2a1.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.silver.001"].copy() obj_joint.location = (0.0, 0.0, +Q+Z) obj_joint.scale = (A, A, A) obj_joint.name = "y1a2.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.copper.001"].copy() obj_joint.location = (0.0, 0.0, +Q*3+Z) obj_joint.scale = (A, A, A) obj_joint.name = "a2o1.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.blue.001"].copy() obj_joint.location = (0.0, 0.0, -Q*2+Z) obj_joint.scale = (A, A, A) obj_joint.name = "a1b1.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) for n in range(1, J - 1): if n <= (J-2): # Pattern 2 of by obj_joint = bpy.data.objects["joint.green.001"].copy() obj_joint.location = (0.0, 0.0, -Q + Q*((n+1) % 2)*4 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "b"+str(n)+"y"+str(n)+".mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # Pattern 2 of yy obj_joint = bpy.data.objects["joint.gold.00"+str(1 + (n+1) % 2)].copy() obj_joint.location = (0.0, 0.0, +Q*(1 - (n % 2))*2+Z) obj_joint.scale = (A, A, A) obj_joint.name = "y"+str(n)+"y"+str(n+1)+".mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) if n <= (J-3): # Pattern 1 of ob obj_joint = bpy.data.objects["joint.blue.001"].copy() obj_joint.location = (0.0, 0.0, -Q*2 + Q*(n % 2)*6 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "o"+str(n)+"b"+str(n+1)+".mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # Pattern 2 of yo obj_joint = bpy.data.objects["joint.copper.001"].copy() obj_joint.location = (0.0, 0.0, -Q + Q*((n+1) % 2)*4 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "y"+str(n+1)+"o"+str(n+1)+".mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) for ob in context.scene.objects: if "mesh" in ob.name: ob.select = True bpy.ops.object.make_single_user(type='SELECTED_OBJECTS', object=True, obdata=True, material=True, texture=True, animation=True) bpy.context.scene.cursor_location = (0.0, 0.0, 0.0) bpy.ops.object.origin_set(type='ORIGIN_CURSOR') def constructLink(self, A, J, helicity, rig, move, part): # Move and rotate the tip bone in pose mode bpy.context.scene.objects.active = rig Y = 1.1838*A for n in rig.pose.bones: if n.name != "o" + str(J-2) + "b" + str(J-1): # we can get the object from the pose bone obj = n.id_data matrix_final = obj.matrix_world * n.matrix # Create armature and object lnk = bpy.data.armatures.new(n.name[:len(n.name)]+'.data.' + helicity) lnk_rig = bpy.data.objects.new(n.name[:len(n.name)]+'.link.' + helicity, lnk) lnk_rig.location = mathutils.Euler((0.0, 0.0, 0.0), 'XYZ') # rig.show_x_ray = True lnk.show_names = True lnk.draw_type = 'STICK' # Link object to scene scn = bpy.context.scene scn.objects.link(lnk_rig) scn.objects.active = lnk_rig scn.update() # Create bones # mode='EDIT' bpy.ops.object.editmode_toggle() link = lnk.edit_bones.new(n.name[:len(n.name)]) link.head = (0, 0, 0) link.tail = (0, Y, 0) link_head = lnk.edit_bones.new('head') link_head.head = (0, 0, 0.1) link_head.tail = (0, 0, 0) link_head.parent = link link_head.use_inherit_scale = False link_tail = lnk.edit_bones.new('tail') link_tail.head = (0, Y, 0) link_tail.tail = (0, Y, -0.1) link_tail.parent = link link_tail.use_inherit_scale = False bpy.ops.object.mode_set(mode='OBJECT') ob = bpy.data.objects[n.name[:len(n.name)]+'.mesh.' + move + '.' + part +'.' + helicity] ob.location = mathutils.Euler((0, 0, 0), 'XYZ') # Give mesh object an armature modifier, using vertex groups but # not envelopes mod = ob.modifiers.new('MyRigModif', 'ARMATURE') mod.object = lnk_rig mod.use_bone_envelopes = False mod.use_vertex_groups = True # Bone constraints. Armature must be in pose mode. bpy.ops.object.mode_set(mode='POSE') # Copy rotation constraints Base -> Tip pBase = lnk_rig.pose.bones[n.name[:len(n.name)]] cns = pBase.constraints.new('COPY_LOCATION') cns.name = 'Copy_Location' cns.target = rig cns.subtarget = n.name[:len(n.name)] cns.owner_space = 'WORLD' cns.target_space = 'WORLD' # Copy rotation constraints Base -> Tip pBase = lnk_rig.pose.bones[n.name[:len(n.name)]] cns = pBase.constraints.new('COPY_ROTATION') cns.name = 'Copy_Rotation' cns.target = rig cns.subtarget = n.name[:len(n.name)] cns.owner_space = 'WORLD' cns.target_space = 'WORLD' # StretchTo constraint Mid -> Tip with influence 0.5 cns1 = pBase.constraints.new('STRETCH_TO') cns1.name = 'Stretch' cns1.target = rig cns1.subtarget = n.name[:len(n.name)] cns1.head_tail = 1 cns1.rest_length = Y cns1.influence = 1 cns1.keep_axis = 'PLANE_Z' cns1.volume = 'NO_VOLUME' bpy.ops.object.mode_set(mode='OBJECT') class Yaw(Formula): J = 7 #joint number #frame_start = bpy.context.scene.frame_start #frame_end = bpy.context.scene.frame_end #bpy.context.scene.frame_current = frame_end interval = 120 frame_start = 133 frame_end = 148 def __init__(self, P, A, move, part, helicity, start, end, yaw_loc, yaw_rot, pitch_loc, pitch_rot, pitch, body): # pivot factor self.P = P # scale factor self.A = A # name self.move = move # element self.part = part # element helicity self.helicity = helicity self.start = start self.end = end # yaw self.yaw_loc = yaw_loc self.yaw_rot = yaw_rot # pitch self.pitch_loc = pitch_loc self.pitch_rot = pitch_rot self.pitch = pitch self.body = body bpy.ops.object.mode_set(mode='OBJECT') # Create armature and object self.amt = bpy.data.armatures.new(move + '.' + part + '.' + helicity + '.data') self.rig = bpy.data.objects.new(move + '.' + part + '.' + helicity, self.amt) # Joints α(n) -> a[n], β(n) -> b[n], γ(n) -> y[n], δ(n) -> o[n] self.a = [0 for i in range(4)] # Joint α self.b = [0 for i in range(self.J)] # Joint β self.y = [0 for i in range(self.J)] # Joint γ self.o = [0 for i in range(self.J)] # Joint δ self.upper_b = [0 for i in range(self.J)] # Joint β matrix self.upper_y = [0 for i in range(self.J)] # Joint γ matrix self.upper_o = [0 for i in range(self.J)] # Joint δ matrix self.upper_w = [0 for i in range(self.J)] # Joint ω matrix self.lower_b = [0 for i in range(self.J)] # Joint β matrix self.lower_y = [0 for i in range(self.J)] # Joint γ matrix self.lower_w = [0 for i in range(2)] # Joint ω matrix self.lower_left_b = [0 for i in range(self.J)] # Joint β matrix self.lower_left_y = [0 for i in range(self.J)] # Joint γ matrix self.lower_left_o = [0 for i in range(self.J)] # Joint δ matrix self.lower_left_w = [0 for i in range(2)] # Joint ω matrix self.lower_right_b = [0 for i in range(self.J)] # Joint β matrix self.lower_right_y = [0 for i in range(self.J)] # Joint γ matrix self.lower_right_o = [0 for i in range(self.J)] # Joint δ matrix self.lower_right_w = [0 for i in range(2)] # Joint ω matrix # Configuration Movement self.configMovement(self.P, self.A, self.J, self.a, self.b, self.y, self.o, self.upper_b, self.upper_y, self.upper_o, self.upper_w, self.lower_b, self.lower_y, self.lower_w, self.lower_left_b, self.lower_left_y, self.lower_left_o, self.lower_left_w, self.lower_right_b, self.lower_right_y, self.lower_right_o, self.lower_right_w) # Construction Movement self.constructMovement(self.J, self.helicity, self.amt, self.rig, self.a, self.b, self.y, self.o, self.upper_b, self.upper_y, self.upper_o, self.upper_w, self.lower_b, self.lower_y, self.lower_w, self.lower_left_b, self.lower_left_y, self.lower_left_o, self.lower_left_w, self.lower_right_b, self.lower_right_y, self.lower_right_o, self.lower_right_w) # Parent set pitch to yaw self.setParent(self.helicity, self.move, self.rig, yaw_loc, yaw_rot, pitch_loc, pitch_rot, pitch, body) # Construction Rotation self.configRotation(self.rig, self.interval, self.frame_start, self.frame_end, self.start, self.end) # Configuration Linkage self.configLink(self.A * 0.25, self.J, self.helicity, self.rig, self.move, self.part) # Construction Linkage self.constructLink(self.A * 0.25, self.J, self.helicity, self.rig, self.move, self.part) def configMovement(self, P, A, J, a, b, y, o, upper_b, upper_y, upper_o, upper_w, lower_b, lower_y, lower_w, lower_left_b, lower_left_y, lower_left_o, lower_left_w, lower_right_b, lower_right_y, lower_right_o, lower_right_w): mat_a = [0 for i in range(4)] # Joint α matrix mat_b = [0 for i in range(self.J)] # Joint β matrix mat_y = [0 for i in range(self.J)] # Joint γ matrix mat_o = [0 for i in range(self.J)] # Joint δ matrix upper_mat_b = [0 for i in range(self.J)] # Joint β matrix upper_mat_y = [0 for i in range(self.J)] # Joint γ matrix upper_mat_o = [0 for i in range(self.J)] # Joint δ matrix upper_mat_w = [0 for i in range(self.J)] # Joint ω matrix lower_mat_b = [0 for i in range(self.J)] # Joint β matrix lower_mat_y = [0 for i in range(self.J)] # Joint γ matrix lower_mat_w = [0 for i in range(2)] # Joint ω matrix lower_left_mat_b = [0 for i in range(self.J)] # Joint β matrix lower_left_mat_y = [0 for i in range(self.J)] # Joint γ matrix lower_left_mat_o = [0 for i in range(self.J)] # Joint δ matrix lower_left_mat_w = [0 for i in range(2)] # Joint ω matrix lower_right_mat_b = [0 for i in range(self.J)] # Joint β matrix lower_right_mat_y = [0 for i in range(self.J)] # Joint γ matrix lower_right_mat_o = [0 for i in range(self.J)] # Joint δ matrix lower_right_mat_w = [0 for i in range(2)] # Joint ω matrix a[1] = mathutils.Euler((P, A, 0), 'XYZ') print ("a1 =", a[1]) a[2] = mathutils.Euler((A, -A, 0), 'XYZ') print ("a2 =", a[2]) b[1] = mathutils.Euler((-A, A, 0), 'XYZ') print ("b1 =", b[1]) y[1] = mathutils.Euler((-A, -A, 0), 'XYZ') print ("y1 =", y[1]) mat_y[1] = Matrix.Translation(y[1]) o[1] = mathutils.Euler((A, A, 0), 'XYZ') print ("o1 =", o[1]) upper_b[2] = mathutils.Euler((5.40939, -2.87735, 0), 'XYZ') print ("upper_b2 =", upper_b[2]) upper_mat_b[2] = Matrix.Translation(upper_b[2]) upper_y[2] = mathutils.Euler((4.39357, -2.95756, 0), 'XYZ') print ("upper_y2 =", upper_y[2]) upper_mat_y[2] = Matrix.Translation(upper_y[2]) upper_o[2] = mathutils.Euler((3.61516, -2.09638, 0), 'XYZ') print ("o2 =", o[2]) upper_mat_o[2] = Matrix.Translation(upper_o[2]) upper_w[1] = mathutils.Euler((4.39357, -2.95756, 23.2308), 'XYZ') print ("upper_w1 =", upper_w[1]) upper_mat_w[1] = Matrix.Translation(upper_w[1]) upper_w[2] = mathutils.Euler((8.19003, -8.48921, 2.42495), 'XYZ') print ("upper_w2 =", upper_w[2]) upper_mat_w[2] = Matrix.Translation(upper_w[2]) upper_w[3] = mathutils.Euler((13.3388, -1.17576, 2.42495), 'XYZ') print ("upper_w3 =", upper_w[3]) upper_mat_w[3] = Matrix.Translation(upper_w[3]) upper_w[4] = mathutils.Euler((13.3388, -1.17576, 30.6122), 'XYZ') print ("upper_w4 =", upper_w[4]) upper_mat_w[4] = Matrix.Translation(upper_w[4]) upper_w[5] = mathutils.Euler((13.3388, -1.17576, 29.9866), 'XYZ') print ("upper_w5 =", upper_w[5]) upper_mat_w[5] = Matrix.Translation(upper_w[5]) upper_w[6] = mathutils.Euler((13.3388, 0, 29.9866), 'XYZ') print ("upper_w6 =", upper_w[6]) upper_mat_w[6] = Matrix.Translation(upper_w[6]) lower_w[1] = mathutils.Euler((8.19003, -8.48921, 0), 'XYZ') print ("lower_w1 =", lower_w[1]) lower_mat_w[1] = Matrix.Translation(lower_w[1]) lower_b[2] = mathutils.Euler((5.72759, -6.1022, 0), 'XYZ') print ("lower_b2 =", lower_b[2]) lower_mat_b[2] = Matrix.Translation(lower_b[2]) lower_y[2] = mathutils.Euler((7.29866, -4.39351, 0), 'XYZ') print ("lower_y2 =", lower_y[2]) lower_mat_y[2] = Matrix.Translation(lower_y[2]) lower_left_o[2] = mathutils.Euler((0.333433, 8.17479, 0), 'XYZ') print ("lower_left_o2 =", lower_left_o[2]) lower_left_mat_o[2] = Matrix.Translation(lower_left_o[2]) lower_left_b[3] = mathutils.Euler((7.33373, 7.72061, 0), 'XYZ') print ("lower_left_b3 =", lower_left_b[3]) lower_left_mat_b[3] = Matrix.Translation(lower_left_b[3]) lower_left_y[3] = mathutils.Euler((-1.15831, 3.11248, 0), 'XYZ') print ("lower_left_y3 =", lower_left_y[3]) lower_left_mat_y[3] = Matrix.Translation(lower_left_y[3]) lower_left_o[3] = mathutils.Euler((-1.15831, 4.12125, 0), 'XYZ') print ("lower_left_o3 =", lower_left_o[3]) lower_left_mat_o[3] = Matrix.Translation(lower_left_o[3]) lower_left_w[1] = mathutils.Euler((3.02315, 8.00786, 0), 'XYZ') print ("lower_left_w1 =", lower_left_w[1]) lower_left_mat_w[1] = Matrix.Translation(lower_left_w[1]) lower_right_o[2] = mathutils.Euler((6.72417, -15.9045, 0), 'XYZ') print ("lower_right_o2 =", lower_right_o[2]) lower_right_mat_o[2] = Matrix.Translation(lower_right_o[2]) lower_right_b[3] = mathutils.Euler((13.0432, -17.9857, 0), 'XYZ') print ("lower_right_b3 =", lower_right_b[3]) lower_right_mat_b[3] = Matrix.Translation(lower_right_b[3]) lower_right_y[3] = mathutils.Euler((6.09549, -14.1632, 0), 'XYZ') print ("lower_right_y3 =", lower_right_y[3]) lower_right_mat_y[3] = Matrix.Translation(lower_right_y[3]) lower_right_o[3] = mathutils.Euler((5.79574, -15.2852, 0), 'XYZ') print ("lower_right_o3 =", lower_right_o[3]) lower_right_mat_o[3] = Matrix.Translation(lower_right_o[3]) lower_right_w[1] = mathutils.Euler((8.93583, -16.6329, 0), 'XYZ') print ("lower_right_w1 =", lower_right_w[1]) lower_right_mat_w[1] = Matrix.Translation(lower_right_w[1]) def constructMovement(self, J, helicity, amt, rig, a, b, y, o, upper_b, upper_y, upper_o, upper_w, lower_b, lower_y, lower_w, lower_left_b, lower_left_y, lower_left_o, lower_left_w, lower_right_b, lower_right_y, lower_right_o, lower_right_w): # Linkages aa = [[0 for i in range(4)] for j in range(4)] # Link α(i) - α(j) ab = [[0 for i in range(4)] for j in range(4)] # Link α(i) - β(j) ya = [[0 for i in range(4)] for j in range(4)] # Link γ(i) - α(j) ao = [[0 for i in range(4)] for j in range(4)] # Link α(i) - δ(j) ob = [[0 for i in range(self.J)] for j in range(self.J)] # Link δ(i) - β(j) yy = [[0 for i in range(self.J)] for j in range(self.J)] # Link γ(i) - γ(j) by = [[0 for i in range(self.J)] for j in range(self.J)] # Link β(i) - γ(j) yo = [[0 for i in range(self.J)] for j in range(self.J)] # Link γ(i) - δ(j) upper_ob = [[0 for i in range(self.J)] for j in range(self.J)] # Link δ(i) - β(j) upper_yy = [[0 for i in range(self.J)] for j in range(self.J)] # Link γ(i) - γ(j) upper_by = [[0 for i in range(self.J)] for j in range(self.J)] # Link β(i) - γ(j) upper_yo = [[0 for i in range(self.J)] for j in range(self.J)] # Link γ(i) - δ(j) upper_yw = [[0 for i in range(self.J)] for j in range(self.J)] # Link γ(i) - ω(j) upper_ww = [[0 for i in range(self.J)] for j in range(self.J)] # Link ω(i) - ω(j) lower_aw = [[0 for i in range(2)] for j in range(3)] # Link α(i) - ω(j) lower_ob = [[0 for i in range(self.J)] for j in range(self.J)] # Link δ(i) - β(j) lower_yy = [[0 for i in range(self.J)] for j in range(self.J)] # Link γ(i) - γ(j) lower_by = [[0 for i in range(self.J)] for j in range(self.J)] # Link β(i) - γ(j) lower_left_ob = [[0 for i in range(self.J)] for j in range(self.J)] # Link δ(i) - β(j) lower_left_yy = [[0 for i in range(self.J)] for j in range(self.J)] # Link γ(i) - γ(j) lower_left_by = [[0 for i in range(self.J)] for j in range(self.J)] # Link β(i) - γ(j) lower_left_yo = [[0 for i in range(self.J)] for j in range(self.J)] # Link γ(i) - δ(j) lower_left_wb = [[0 for i in range(self.J)] for j in range(2)] # Link β(i) - ω(j) lower_right_ob = [[0 for i in range(self.J)] for j in range(self.J)] # Link δ(i) - β(j) lower_right_yy = [[0 for i in range(self.J)] for j in range(self.J)] # Link γ(i) - γ(j) lower_right_by = [[0 for i in range(self.J)] for j in range(self.J)] # Link β(i) - γ(j) lower_right_yo = [[0 for i in range(self.J)] for j in range(self.J)] # Link γ(i) - δ(j) lower_right_wb = [[0 for i in range(self.J)] for j in range(2)] # Link β(i) - ω(j) rig.location = mathutils.Euler((0.0, 0.0, 0.0), 'XYZ') rig.show_x_ray = True amt.show_names = True # amt.draw_type = 'STICK' amt.draw_type = 'BBONE' # Link object to scene scn = bpy.context.scene scn.objects.link(rig) scn.objects.active = rig scn.update() # Edit bpy.ops.object.editmode_toggle() j = 1 # Construction Linkage aa[j+1][j] = amt.edit_bones.new('a' + str(j+1) + 'a' + str(j)) aa[j+1][j].head = a[j+1] aa[j+1][j].tail = a[j] ab[j][j] = amt.edit_bones.new('a' + str(j) + 'b' + str(j)) ab[j][j].head = a[j] ab[j][j].tail = b[j] ab[j][j].parent = aa[j+1][j] by[j][j] = amt.edit_bones.new('b' + str(j) + 'y' + str(j)) by[j][j].head = b[j] by[j][j].tail = y[j] by[j][j].parent = ab[j][j] by[j][j].use_inherit_rotation = False ya[j][j+1] = amt.edit_bones.new('y' + str(j) + 'a' + str(j+1)) ya[j][j+1].head = y[j] ya[j][j+1].tail = a[j+1] ya[j][j+1].parent = by[j][j] ao[j+1][j] = amt.edit_bones.new('a' + str(j+1) + 'o' + str(j)) ao[j+1][j].head = a[j+1] ao[j+1][j].tail = o[j] ao[j+1][j].parent = ya[j][j+1] upper_ob[j][j+1] = amt.edit_bones.new('o' + str(j) + 'b' + str(j+1) +'.upper') upper_ob[j][j+1].head = o[j] upper_ob[j][j+1].tail = upper_b[j+1] upper_ob[j][j+1].parent = ao[j+1][j] upper_yy[j][j+1] = amt.edit_bones.new('y' + str(j) + 'y' + str(j+1) +'.upper') upper_yy[j][j+1].head = y[j] upper_yy[j][j+1].tail = upper_y[j+1] upper_yy[j][j+1].parent = by[j][j] lower_ob[j][j+1] = amt.edit_bones.new('o' + str(j) + 'b' + str(j+1) +'.lower') lower_ob[j][j+1].head = o[j] lower_ob[j][j+1].tail = lower_b[j+1] lower_ob[j][j+1].parent = ao[j+1][j] lower_yy[j][j+1] = amt.edit_bones.new('y' + str(j) + 'y' + str(j+1) +'.lower') lower_yy[j][j+1].head = y[j] lower_yy[j][j+1].tail = lower_y[j+1] lower_yy[j][j+1].parent = by[j][j] lower_aw[j+1][j] = amt.edit_bones.new('a' + str(j+1) + 'w' + str(j) +'.lower') lower_aw[j+1][j].head = a[j+1] lower_aw[j+1][j].tail = lower_w[j] lower_aw[j+1][j].parent = aa[j+1][j] upper_ww[j][j+1] = amt.edit_bones.new('w' + str(j) + 'w' + str(j+1) +'.upper') upper_ww[j][j+1].head = lower_w[j] upper_ww[j][j+1].tail = upper_w[j+1] upper_ww[j][j+1].parent = lower_aw[j+1][j] j = 2 upper_ww[j][j+1] = amt.edit_bones.new('w' + str(j) + 'w' + str(j+1) +'.upper') upper_ww[j][j+1].head = upper_w[j] upper_ww[j][j+1].tail = upper_w[j+1] upper_ww[j][j+1].parent = upper_ww[j-1][j] upper_by[j][j] = amt.edit_bones.new('b'+ str(j) + 'y'+ str(j) +'.upper') upper_by[j][j].head = upper_b[j] upper_by[j][j].tail = upper_y[j] upper_by[j][j].parent = upper_ob[j-1][j] upper_yo[j][j] = amt.edit_bones.new('y'+ str(j) + 'o'+ str(j) +'.upper') upper_yo[j][j].head = upper_y[j] upper_yo[j][j].tail = upper_o[j] upper_yo[j][j].parent = upper_yy[j-1][j] upper_yw[j][j-1] = amt.edit_bones.new('y'+ str(j) + 'w'+ str(j-1) +'.upper') upper_yw[j][j-1].head = upper_y[j] upper_yw[j][j-1].tail = upper_w[j-1] upper_yw[j][j-1].parent = upper_by[j][j] lower_by[j][j] = amt.edit_bones.new('b'+ str(j) + 'y'+ str(j) + '.lower') lower_by[j][j].head = lower_b[j] lower_by[j][j].tail = lower_y[j] lower_by[j][j].parent = lower_ob[j-1][j] lower_left_yy[j][j+1] = amt.edit_bones.new('y' + str(j) + 'y' + str(j+1) +'.lower.left') lower_left_yy[j][j+1].head = lower_y[j] lower_left_yy[j][j+1].tail = lower_left_y[j+1] lower_left_yy[j][j+1].parent = lower_by[j][j] lower_left_yo[j][j] = amt.edit_bones.new('y'+ str(j) + 'o'+ str(j) +'.lower.left') lower_left_yo[j][j].head = lower_y[j] lower_left_yo[j][j].tail = lower_left_o[j] lower_left_yo[j][j].parent = lower_yy[j-1][j] lower_left_ob[j][j+1] = amt.edit_bones.new('o'+ str(j) + 'b'+ str(j+1) +'.lower.left') lower_left_ob[j][j+1].head = lower_left_o[j] lower_left_ob[j][j+1].tail = lower_left_b[j+1] lower_left_ob[j][j+1].parent = lower_left_yo[j][j] lower_right_yy[j][j+1] = amt.edit_bones.new('y' + str(j) + 'y' + str(j+1) +'.lower.right') lower_right_yy[j][j+1].head = lower_y[j] lower_right_yy[j][j+1].tail = lower_right_y[j+1] lower_right_yy[j][j+1].parent = lower_by[j][j] lower_right_yo[j][j] = amt.edit_bones.new('y'+ str(j) + 'o'+ str(j) +'.lower.right') lower_right_yo[j][j].head = lower_y[j] lower_right_yo[j][j].tail = lower_right_o[j] lower_right_yo[j][j].parent = lower_yy[j-1][j] lower_right_ob[j][j+1] = amt.edit_bones.new('o'+ str(j) + 'b'+ str(j+1) +'.lower.right') lower_right_ob[j][j+1].head = lower_right_o[j] lower_right_ob[j][j+1].tail = lower_right_b[j+1] lower_right_ob[j][j+1].parent = lower_right_yo[j][j] j = 3 upper_ww[j][j+1] = amt.edit_bones.new('w' + str(j) + 'w' + str(j+1) +'.upper') upper_ww[j][j+1].head = upper_w[j] upper_ww[j][j+1].tail = upper_w[j+1] upper_ww[j][j+1].parent = upper_ww[j-1][j] lower_left_by[j][j] = amt.edit_bones.new('b'+ str(j) + 'y'+ str(j) + '.lower.left') lower_left_by[j][j].head = lower_left_b[j] lower_left_by[j][j].tail = lower_left_y[j] lower_left_by[j][j].parent = lower_left_ob[j-1][j] lower_left_wb[1][j] = amt.edit_bones.new('w'+ str(1) + 'b'+ str(j) +'.lower.left') lower_left_wb[1][j].head = lower_left_w[1] lower_left_wb[1][j].tail = lower_left_b[j] lower_left_wb[1][j].parent = lower_left_ob[j-1][j] lower_left_yo[j][j] = amt.edit_bones.new('y'+ str(j) + 'o'+ str(j) +'.lower.left') lower_left_yo[j][j].head = lower_left_y[j] lower_left_yo[j][j].tail = lower_left_o[j] lower_left_yo[j][j].parent = lower_left_yy[j-1][j] lower_right_by[j][j] = amt.edit_bones.new('b'+ str(j) + 'y'+ str(j) + '.lower.right') lower_right_by[j][j].head = lower_right_b[j] lower_right_by[j][j].tail = lower_right_y[j] lower_right_by[j][j].parent = lower_right_ob[j-1][j] lower_right_wb[1][j] = amt.edit_bones.new('w'+ str(1) + 'b'+ str(j) +'.lower.right') lower_right_wb[1][j].head = lower_right_w[1] lower_right_wb[1][j].tail = lower_right_b[j] lower_right_wb[1][j].parent = lower_right_ob[j-1][j] lower_right_yo[j][j] = amt.edit_bones.new('y'+ str(j) + 'o'+ str(j) +'.lower.right') lower_right_yo[j][j].head = lower_right_y[j] lower_right_yo[j][j].tail = lower_right_o[j] lower_right_yo[j][j].parent = lower_right_yy[j-1][j] for j in range(4, 6): upper_ww[j][j+1] = amt.edit_bones.new('w' + str(j) + 'w' + str(j+1) +'.upper') upper_ww[j][j+1].head = upper_w[j] upper_ww[j][j+1].tail = upper_w[j+1] upper_ww[j][j+1].parent = upper_ww[j-1][j] # all bones select #bpy.ops.pose.select_all(action="SELECT") for b in amt.edit_bones: b.select = True if helicity == 'right': bpy.ops.armature.calculate_roll(type='GLOBAL_POS_Z') else: bpy.ops.armature.calculate_roll(type='GLOBAL_NEG_Z') # Bone constraints. Armature must be in pose mode. bpy.ops.object.mode_set(mode='POSE') # IK constraint cns = rig.pose.bones['y1a2'].constraints.new('IK') cns.name = 'Ik' cns.target = rig cns.subtarget = 'a2a1' cns.chain_count = 2 cns.use_stretch = False j = 2 cns = rig.pose.bones['b'+str(j) +'y'+str(j) +'.upper'].constraints.new('IK') cns.name = 'Ik' cns.target = rig cns.subtarget = 'y'+str(j)+'o'+str(j) +'.upper' cns.iterations = 500 cns.chain_count = 2 cns.use_stretch = False cns = rig.pose.bones['b'+str(j) +'y'+str(j) +'.lower'].constraints.new('IK') cns.name = 'Ik' cns.target = rig cns.subtarget = 'y'+str(j)+'o'+str(j) +'.lower.left' cns.iterations = 500 cns.chain_count = 2 cns.use_stretch = False j = 3 cns = rig.pose.bones['b'+str(j) +'y'+str(j) +'.lower.left'].constraints.new('IK') cns.name = 'Ik' cns.target = rig cns.subtarget = 'y'+str(j)+'o'+str(j) +'.lower.left' cns.iterations = 500 cns.chain_count = 2 cns.use_stretch = False cns = rig.pose.bones['b'+str(j) +'y'+str(j) +'.lower.right'].constraints.new('IK') cns.name = 'Ik' cns.target = rig cns.subtarget = 'y'+str(j)+'o'+str(j) +'.lower.right' cns.iterations = 500 cns.chain_count = 2 cns.use_stretch = False bpy.ops.object.mode_set(mode='OBJECT') def configLink(self, A, J, helicity, rig, move, part): bpy.ops.object.mode_set(mode='OBJECT') Q = (0.18648+0.146446)*A # Z = -Q*2 Z = 0.0 obj_joint = bpy.data.objects["joint.gold.000"].copy() obj_joint.location = (0.0, 0.0, -Q*3+Z) obj_joint.scale = (A, A, A) obj_joint.name = "a2a1.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.silver.001"].copy() obj_joint.location = (0.0, 0.0, +Q*1+Z) obj_joint.scale = (A, A, A) obj_joint.name = "y1a2.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.copper.001"].copy() obj_joint.location = (0.0, 0.0, +Q*3+Z) obj_joint.scale = (A, A, A) obj_joint.name = "a2o1.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.blue.001"].copy() obj_joint.location = (0.0, 0.0, -Q*2+Z) obj_joint.scale = (A, A, A) obj_joint.name = "a1b1.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) n = 1 # Pattern 2 of by obj_joint = bpy.data.objects["joint.green.001"].copy() obj_joint.location = (0.0, 0.0, -Q*1 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "b"+str(n)+"y"+str(n)+".mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # Pattern 1 of ob obj_joint = bpy.data.objects["joint.blue.001"].copy() obj_joint.location = (0.0, 0.0, +Q*2 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "o"+str(n)+"b"+str(n+1)+".upper.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # Pattern 2 of yy obj_joint = bpy.data.objects["joint.gold.B"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "y"+str(n)+"y"+str(n+1)+".upper.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # Pattern 1 of ob obj_joint = bpy.data.objects["joint.blue.A"].copy() obj_joint.location = (0.0, 0.0, +Q*4 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "o"+str(n)+"b"+str(n+1)+".lower.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # Pattern 2 of yy obj_joint = bpy.data.objects["joint.gold.C"].copy() obj_joint.location = (0.0, 0.0, -Q*2+Z) obj_joint.scale = (A, A, A) obj_joint.name = "y"+str(n)+"y"+str(n+1)+".lower.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.gold.B"].copy() obj_joint.location = (0.0, 0.0, +Q*2 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "a"+str(n+1)+"w"+str(n)+".lower.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.gold.A3"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "w"+str(n)+"w"+str(n+1)+".upper.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) n = 2 obj_joint = bpy.data.objects["joint.gold.B"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "w"+str(n)+"w"+str(n+1)+".upper.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # Pattern 2 of by obj_joint = bpy.data.objects["joint.green.A"].copy() obj_joint.location = (0.0, 0.0, -Q*1 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "b"+str(n)+"y"+str(n)+".upper.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # Pattern 2 of yo obj_joint = bpy.data.objects["joint.copper.001"].copy() obj_joint.location = (0.0, 0.0, +Q*1 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "y"+str(n)+"o"+str(n)+".upper.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # Pattern 2 of yo obj_joint = bpy.data.objects["joint.gold.D"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "y"+str(n)+"w"+str(n-1)+".upper.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # Pattern 2 of by obj_joint = bpy.data.objects["joint.green.001"].copy() obj_joint.location = (0.0, 0.0, +Q*7 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "b"+str(n)+"y"+str(n)+".lower.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # Pattern 2 of yy obj_joint = bpy.data.objects["joint.gold.B"].copy() obj_joint.location = (0.0, 0.0, +Q*6 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "y"+str(n)+"y"+str(n+1)+".lower.left.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # Pattern 2 of yo obj_joint = bpy.data.objects["joint.copper.001"].copy() obj_joint.location = (0.0, 0.0, +Q*5 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "y"+str(n)+"o"+str(n)+".lower.left.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # Pattern 1 of ob obj_joint = bpy.data.objects["joint.blue.001"].copy() obj_joint.location = (0.0, 0.0, +Q*6 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "o"+str(n)+"b"+str(n+1)+".lower.left.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # Pattern 2 of yy obj_joint = bpy.data.objects["joint.gold.B"].copy() obj_joint.location = (0.0, 0.0, +Q*6 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "y"+str(n)+"y"+str(n+1)+".lower.right.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # Pattern 2 of yo obj_joint = bpy.data.objects["joint.copper.001"].copy() obj_joint.location = (0.0, 0.0, +Q*5 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "y"+str(n)+"o"+str(n)+".lower.right.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # Pattern 1 of ob obj_joint = bpy.data.objects["joint.blue.001"].copy() obj_joint.location = (0.0, 0.0, +Q*6 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "o"+str(n)+"b"+str(n+1)+".lower.right.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) n = 3 obj_joint = bpy.data.objects["joint.gold.A2"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "w"+str(n)+"w"+str(n+1)+".upper.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # Pattern 2 of by obj_joint = bpy.data.objects["joint.green.001"].copy() obj_joint.location = (0.0, 0.0, +Q*7 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "b"+str(n)+"y"+str(n)+".lower.left.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # Pattern 1 of ob obj_joint = bpy.data.objects["joint.blue.C"].copy() obj_joint.location = (0.0, 0.0, +Q*1 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "w"+str(1)+"b"+str(n)+".lower.left.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # Pattern 2 of yo obj_joint = bpy.data.objects["joint.copper.001"].copy() obj_joint.location = (0.0, 0.0, +Q*8 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "y"+str(n)+"o"+str(n)+".lower.left.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # Pattern 2 of by obj_joint = bpy.data.objects["joint.green.001"].copy() obj_joint.location = (0.0, 0.0, +Q*7 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "b"+str(n)+"y"+str(n)+".lower.right.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # Pattern 1 of ob obj_joint = bpy.data.objects["joint.blue.C"].copy() obj_joint.location = (0.0, 0.0, +Q*1 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "w"+str(1)+"b"+str(n)+".lower.right.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # Pattern 2 of yo obj_joint = bpy.data.objects["joint.copper.001"].copy() obj_joint.location = (0.0, 0.0, +Q*8 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "y"+str(n)+"o"+str(n)+".lower.right.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) for n in range(4, 6): obj_joint = bpy.data.objects["joint.cursor"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "w"+str(n)+"w"+str(n+1)+".upper.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) for ob in context.scene.objects: if "mesh" in ob.name: ob.select = True bpy.ops.object.make_single_user(type='SELECTED_OBJECTS', object=True, obdata=True, material=True, texture=True, animation=True) bpy.context.scene.cursor_location = (0.0, 0.0, 0.0) bpy.ops.object.origin_set(type='ORIGIN_CURSOR') # Parent set fingers to arm def setParent(self, helicity, move, rig, yaw_loc, yaw_rot, pitch_loc, pitch_rot, pitch, body): # yaw position rig.location = yaw_loc rig.rotation_euler = yaw_rot # pitch position pitch.rig.location = pitch_loc pitch.rig.rotation_euler = pitch_rot # pitch to yaw bpy.ops.object.mode_set(mode='OBJECT') bpy.context.scene.frame_current = 0 bpy.ops.object.select_all(action='DESELECT') rig.select = True bpy.context.scene.objects.active = rig bpy.ops.object.editmode_toggle() parent_bone = 'y2w1.upper' # choose the bone name which you want to be the parent rig.data.edit_bones.active = rig.data.edit_bones[parent_bone] bpy.ops.object.mode_set(mode='OBJECT') bpy.ops.object.select_all(action='DESELECT') #deselect all objects pitch.rig.select = True rig.select = True bpy.context.scene.objects.active = rig #the active object will be the parent of all selected object bpy.ops.object.parent_set(type='BONE', keep_transform=True) bpy.ops.object.select_all(action='DESELECT') #deselect all objects # end j = 1 cns = body.rig.pose.bones['w' +str(j) +'w' +str(j+2)+'.upper.right'].constraints.new('IK') cns.name = 'Ik' cns.target = rig cns.subtarget = 'w5w6.upper' cns.chain_count = 1 cns.use_stretch = False cns = body.rig.pose.bones['w' +str(j) +'w' +str(j+2)+'.upper.left'].constraints.new('IK') cns.name = 'Ik' cns.target = rig cns.subtarget = 'w5w6.upper' cns.chain_count = 1 cns.use_stretch = False j = 2 cns = body.rig.pose.bones['w' +str(j) +'w' +str(j+1)+'.upper'].constraints.new('COPY_LOCATION') cns.name = 'Copy Location' cns.target = rig cns.subtarget = 'w4w5.upper' cns = body.rig.pose.bones['w' +str(j) +'w' +str(j+1)+'.upper'].constraints.new('IK') cns.name = 'Ik' cns.target = rig cns.subtarget = 'w5w6.upper' cns.chain_count = 1 cns.use_stretch = False cns = body.rig.pose.bones['w' +str(j) +'w' +str(j+1)+'.upper'].constraints.new('COPY_ROTATION') cns.name = 'Copy Rotation' cns.target = rig cns.subtarget = 'a2a1' cns.target_space = 'LOCAL' cns.owner_space = 'WORLD' j = 4 cns = body.rig.pose.bones['y'+str(j) +'y'+str(j+1)+'.lower.left'].constraints.new('IK') cns.name = 'Ik' cns.target = rig cns.subtarget = 'w1b3.lower.left' cns.pole_target = rig cns.pole_subtarget = 'o2b3.lower.left' cns.pole_angle = 0 cns.iterations = 500 cns.chain_count = 3 cns.use_stretch = False cns = body.rig.pose.bones['y'+str(j) +'y'+str(j+1)+'.lower.right'].constraints.new('IK') cns.name = 'Ik' cns.target = rig cns.subtarget = 'w1b3.lower.right' cns.pole_target = rig cns.pole_subtarget = 'o2b3.lower.right' cns.pole_angle = math.radians(180) cns.iterations = 500 cns.chain_count = 3 cns.use_stretch = False class Pitch(Formula): J = 2 #joint number #frame_start = bpy.context.scene.frame_start #frame_end = bpy.context.scene.frame_end #bpy.context.scene.frame_current = frame_end interval = 120 frame_start = 133 frame_end = 148 # Overriding def __init__(self, P, A, move, part, helicity, start, end, body_loc, body_rot, body): # pivot factor self.P = P # scale factor self.A = A # name self.move = move # element self.part = part # element helicity self.helicity = helicity self.start = start self.end = end # body self.body_loc = body_loc self.body_rot = body_rot self.body = body bpy.ops.object.mode_set(mode='OBJECT') # Create armature and object self.amt = bpy.data.armatures.new(move + '.' + part + '.' + helicity + '.data') self.rig = bpy.data.objects.new(move + '.' + part + '.' + helicity, self.amt) # Joints α(n) -> a[n], β(n) -> b[n], γ(n) -> y[n] self.a = [0 for i in range(4)] # Joint α self.b = [0 for i in range(self.J)] # Joint β self.y = [0 for i in range(self.J)] # Joint γ # Configuration Movement self.configMovement(self.P, self.A, self.J, self.a, self.b, self.y) # Construction Movement self.constructMovement(self.J, self.helicity, self.amt, self.rig, self.a, self.b, self.y) # Parent body to pitch self.setParent(self.helicity, self.move, self.rig, self.body_loc, self.body_rot, self.body) # Construction Rotation self.configRotation(self.rig, self.interval, self.frame_start, self.frame_end, self.start, self.end) # Configuration Linkage self.configLink(self.A*0.3, self.J, self.helicity, self.rig, self.move, self.part) # Construction Linkage self.constructLink(self.A*0.3, self.J, self.helicity, self.rig, self.move, self.part) def configMovement(self, P, A, J, a, b, y): mat_a = [0 for i in range(4)] # Joint α matrix mat_b = [0 for i in range(self.J)] # Joint β matrix mat_y = [0 for i in range(self.J)] # Joint γ matrix a[1] = mathutils.Euler((P, A, 0), 'XYZ') print ("a1 =", a[1]) a[2] = mathutils.Euler((A, -A, 0), 'XYZ') print ("a2 =", a[2]) b[1] = mathutils.Euler((-A, A, 0), 'XYZ') print ("b1 =", b[1]) y[1] = mathutils.Euler((-A, -A, 0), 'XYZ') print ("y1 =", y[1]) mat_y[1] = Matrix.Translation(y[1]) def constructMovement(self, J, helicity, amt, rig, a, b, y): # Linkages aa = [[0 for i in range(4)] for j in range(4)] # Link α(i) - α(j) ab = [[0 for i in range(4)] for j in range(4)] # Link α(i) - β(j) ya = [[0 for i in range(4)] for j in range(4)] # Link γ(i) - α(j) by = [[0 for i in range(self.J)] for j in range(self.J)] # Link β(i) - γ(j) rig.location = mathutils.Euler((0.0, 0.0, 0.0), 'XYZ') rig.show_x_ray = True amt.show_names = True # amt.draw_type = 'STICK' amt.draw_type = 'BBONE' # Link object to scene scn = bpy.context.scene scn.objects.link(rig) scn.objects.active = rig scn.update() # Edit bpy.ops.object.editmode_toggle() # Construction Linkage aa[2][1] = amt.edit_bones.new('a2a1') aa[2][1].head = a[2] aa[2][1].tail = a[1] ab[1][1] = amt.edit_bones.new('a1b1') ab[1][1].head = a[1] ab[1][1].tail = b[1] ab[1][1].parent = aa[2][1] by[1][1] = amt.edit_bones.new('b1y1') by[1][1].head = b[1] by[1][1].tail = y[1] by[1][1].parent = ab[1][1] by[1][1].use_inherit_rotation = False ya[1][2] = amt.edit_bones.new('y1a2') ya[1][2].head = y[1] ya[1][2].tail = a[2] ya[1][2].parent = by[1][1] # all bones select #bpy.ops.pose.select_all(action="SELECT") for b in amt.edit_bones: b.select = True if helicity == 'right': bpy.ops.armature.calculate_roll(type='GLOBAL_POS_Z') else: bpy.ops.armature.calculate_roll(type='GLOBAL_NEG_Z') # Bone constraints. Armature must be in pose mode. bpy.ops.object.mode_set(mode='POSE') # IK constraint cns = rig.pose.bones['y1a2'].constraints.new('IK') cns.name = 'Ik' cns.target = rig cns.subtarget = 'a2a1' cns.chain_count = 2 cns.use_stretch = False bpy.ops.object.mode_set(mode='OBJECT') def configLink(self, A, J, helicity, rig, move, part): bpy.ops.object.mode_set(mode='OBJECT') Q = (0.18648+0.146446)*A # Z = -Q*2 Z = 0.0 obj_joint = bpy.data.objects["joint.gold.000"].copy() obj_joint.location = (0.0, 0.0, -Q*3+Z) obj_joint.scale = (A, A, A) obj_joint.name = "a2a1.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.silver.A"].copy() obj_joint.location = (0.0, 0.0, +Q+Z) obj_joint.scale = (A, A, A) obj_joint.name = "y1a2.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.blue.001"].copy() obj_joint.location = (0.0, 0.0, -Q*2+Z) obj_joint.scale = (A, A, A) obj_joint.name = "a1b1.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) n = 1 obj_joint = bpy.data.objects["joint.green.001"].copy() obj_joint.location = (0.0, 0.0, -Q + Q*((n+1) % 2)*4 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "b"+str(n)+"y"+str(n)+".mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) for ob in context.scene.objects: if "mesh" in ob.name: ob.select = True bpy.ops.object.make_single_user(type='SELECTED_OBJECTS', object=True, obdata=True, material=True, texture=True, animation=True) bpy.context.scene.cursor_location = (0.0, 0.0, 0.0) bpy.ops.object.origin_set(type='ORIGIN_CURSOR') # Parent set fingers to arm def setParent(self, helicity, move, rig, body_loc, body_rot, body): # body position body.rig.location = body_loc body.rig.rotation_euler = body_rot # body to pitch bpy.ops.object.mode_set(mode='OBJECT') bpy.context.scene.frame_current = 0 bpy.ops.object.select_all(action='DESELECT') rig.select = True bpy.context.scene.objects.active = rig bpy.ops.object.editmode_toggle() parent_bone = 'b1y1' # choose the bone name which you want to be the parent rig.data.edit_bones.active = rig.data.edit_bones[parent_bone] bpy.ops.object.mode_set(mode='OBJECT') bpy.ops.object.select_all(action='DESELECT') #deselect all objects body.rig.select = True rig.select = True bpy.context.scene.objects.active = rig #the active object will be the parent of all selected object bpy.ops.object.parent_set(type='BONE', keep_transform=True) bpy.ops.object.select_all(action='DESELECT') #deselect all objects # end class Body(Formula): J = 7 #joint number #frame_start = bpy.context.scene.frame_start #frame_end = bpy.context.scene.frame_end #bpy.context.scene.frame_current = frame_end interval = 120 frame_start = 133 frame_end = 148 # Overriding def __init__(self, P, A, move, part, helicity, start, end, arm_left_loc, arm_left_rot, arm_left, arm_right_loc, arm_right_rot, arm_right): # pivot factor self.P = P # scale factor self.A = A # name self.move = move # element self.part = part # element helicity self.helicity = helicity self.start = start self.end = end bpy.ops.object.mode_set(mode='OBJECT') # Create armature and object self.amt = bpy.data.armatures.new(move + '.' + part + '.' + helicity + '.data') self.rig = bpy.data.objects.new(move + '.' + part + '.' + helicity, self.amt) self.arm_left_loc = arm_left_loc self.arm_left_rot = arm_left_rot self.arm_left = arm_left self.arm_right_loc = arm_right_loc self.arm_right_rot = arm_right_rot self.arm_right = arm_right # Centroid # Joints α(n) -> a[n], β(n) -> b[n], γ(n) -> y[n], δ(n) -> o[n] self.a = [0 for i in range(3)] # Joint α self.b = [0 for i in range(2)] # Joint β self.y = [0 for i in range(2)] # Joint γ self.o = [0 for i in range(2)] # Joint δ # Upper body # Joints α(n) -> a[n], β(n) -> b[n], γ(n) -> y[n], δ(n) -> o[n] self.upper_b = [0 for i in range(self.J)] # Joint β self.upper_y = [0 for i in range(self.J)] # Joint γ self.upper_o = [0 for i in range(self.J)] # Joint δ # Joints ω(n) -> w[n] self.upper_w = [0 for i in range(self.J)] # Joint ω # Left shoulder # Joints α(n) -> a[n], β(n) -> b[n], γ(n) -> y[n], δ(n) -> o[n] self.upper_left_b = [0 for i in range(self.J)] # Joint β self.upper_left_y = [0 for i in range(self.J)] # Joint γ self.upper_left_o = [0 for i in range(self.J)] # Joint δ self.upper_left_w = [0 for i in range(self.J)] # Joint ω matrix # Right shoulder # Joints α(n) -> a[n], β(n) -> b[n], γ(n) -> y[n], δ(n) -> o[n] self.upper_right_b = [0 for i in range(self.J)] # Joint β self.upper_right_y = [0 for i in range(self.J)] # Joint γ self.upper_right_o = [0 for i in range(self.J)] # Joint δ self.upper_right_w = [0 for i in range(self.J)] # Joint ω matrix # Lower body # Joints α(n) -> a[n], β(n) -> b[n], γ(n) -> y[n], δ(n) -> o[n] self.lower_b = [0 for i in range(self.J)] # Joint β self.lower_y = [0 for i in range(self.J)] # Joint γ self.lower_o = [0 for i in range(self.J)] # Joint δ # Joints ω(n) -> w[n] self.lower_w = [0 for i in range(self.J)] # Joint ω # Left leg # Joints α(n) -> a[n], β(n) -> b[n], γ(n) -> y[n], δ(n) -> o[n] self.lower_left_b = [0 for i in range(self.J)] # Joint β self.lower_left_y = [0 for i in range(self.J)] # Joint γ self.lower_left_o = [0 for i in range(self.J)] # Joint δ # Right leg # Joints α(n) -> a[n], β(n) -> b[n], γ(n) -> y[n], δ(n) -> o[n] self.lower_right_b = [0 for i in range(self.J)] # Joint β self.lower_right_y = [0 for i in range(self.J)] # Joint γ self.lower_right_o = [0 for i in range(self.J)] # Joint δ # gimbal self.gimbal_lower_left_o = [0 for i in range(self.J)] # Joint δ self.gimbal_lower_left_b = [0 for i in range(self.J)] # Joint β self.gimbal_lower_right_o = [0 for i in range(self.J)] # Joint δ self.gimbal_lower_right_b = [0 for i in range(self.J)] # Joint β # Configuration Movement self.configMovement(self.P, self.A, self.J, self.a, self.b, self.y, self.o, self.upper_b, self.upper_y, self.upper_o, self.upper_w, self.upper_left_b, self.upper_left_y, self.upper_left_o, self.upper_left_w, self.upper_right_b, self.upper_right_y, self.upper_right_o, self.upper_right_w, self.lower_b, self.lower_y, self.lower_o, self.lower_w, self.lower_left_b, self.lower_left_y, self.lower_left_o, self.lower_right_b, self.lower_right_y, self.lower_right_o, self.gimbal_lower_left_o, self.gimbal_lower_left_b, self.gimbal_lower_right_o, self.gimbal_lower_right_b) # Construction Movement self.constructMovement(self.J, self.amt, self.rig, self.a, self.b, self.y, self.o, self.upper_b, self.upper_y, self.upper_o, self.upper_w, self.upper_left_b, self.upper_left_y, self.upper_left_o, self.upper_left_w, self.upper_right_b, self.upper_right_y, self.upper_right_o, self.upper_right_w, self.lower_b, self.lower_y, self.lower_o, self.lower_w, self.lower_left_b, self.lower_left_y, self.lower_left_o, self.lower_right_b, self.lower_right_y, self.lower_right_o, self.gimbal_lower_left_o, self.gimbal_lower_left_b, self.gimbal_lower_right_o, self.gimbal_lower_right_b) # Parent set arms to body self.setParent(self.helicity, self.move, self.rig, self.arm_left_loc, self.arm_left_rot, self.arm_left, self.arm_right_loc, self.arm_right_rot, self.arm_right) # Construction Rotation self.configRotation(self.rig, self.interval, self.frame_start, self.frame_end, self.start, self.end) self.configLink(self.A*0.7, self.J, self.helicity, self.rig, self.move, self.part) # Construction Linkage self.constructLink(self.A*0.7, self.J, self.helicity, self.rig, self.move, self.part) # Overriding Configuration Movement def configMovement(self, P, A, J, a, b, y, o, upper_b, upper_y, upper_o, upper_w, upper_left_b, upper_left_y, upper_left_o, upper_left_w, upper_right_b, upper_right_y, upper_right_o, upper_right_w, lower_b, lower_y, lower_o, lower_w, lower_left_b, lower_left_y, lower_left_o, lower_right_b, lower_right_y, lower_right_o, gimbal_lower_left_o, gimbal_lower_left_b, gimbal_lower_right_o, gimbal_lower_right_b): a[1] = mathutils.Euler((P, A, 0), 'XYZ') print ("a1 =", a[1]) a[2] = mathutils.Euler((A, -A, 0), 'XYZ') print ("a2 =", a[2]) b[1] = mathutils.Euler((-A, A, 0), 'XYZ') print ("b1 =", b[1]) o[1] = mathutils.Euler((A, A, 0), 'XYZ') print ("o1 =", o[1]) y[1] = mathutils.Euler((-A, -A, 0), 'XYZ') print ("y1 =", y[1]) lower_b[2] = mathutils.Euler((1.35031, -1.93408, 0), 'XYZ') print ("b2.lower =", lower_b[2]) lower_o[2] = mathutils.Euler((-1.18173, -3.18999, 0), 'XYZ') print ("o2.lower =", lower_o[2]) lower_y[2] = mathutils.Euler((-0.761987, -3.11885, 0), 'XYZ') print ("y2.lower =", lower_y[2]) lower_y[3] = mathutils.Euler((-0.425565, -8.51839, 0), 'XYZ') print ("y3.lower =", lower_y[3]) lower_w[1] = mathutils.Euler((-0.425565, -8.51839, 2.50277), 'XYZ') print ("w1.lower =", lower_w[1]) lower_left_o[3] = mathutils.Euler((1.76787, -8.43042, 1.81914), 'XYZ') print ("o3.lower.left =", lower_left_o[3]) lower_left_b[4] = mathutils.Euler((1.76787, -19.2299, 5.0545), 'XYZ') print ("b4.lower.left =", lower_left_b[4]) lower_left_y[4] = mathutils.Euler((1.76787, -27.4568, 2.13126), 'XYZ') print ("y4.lower.left =", lower_left_y[4]) lower_left_y[5] = mathutils.Euler((1.76787, -29.0398, 4.39707), 'XYZ') print ("y5.lower.left =", lower_left_y[5]) gimbal_lower_left_o[3] = mathutils.Euler((1.87361, -8.51839, 2.50277), 'XYZ') print ("o3.gimbal.lower.left =", gimbal_lower_left_o[3]) gimbal_lower_left_b[4] = mathutils.Euler((1.87361, -19.7847, 2.50277), 'XYZ') print ("b4.gimbal.lower.left =", gimbal_lower_left_b[4]) lower_right_o[3] = mathutils.Euler((-2.89871, -8.60219, 1.75624), 'XYZ') print ("o3.lower.right =", lower_right_o[3]) lower_right_b[4] = mathutils.Euler((-2.89871, -19.3735, 5.04104), 'XYZ') print ("b4.lower.right =", lower_right_b[4]) lower_right_y[4] = mathutils.Euler((-2.89871, -27.5528, 1.98242), 'XYZ') print ("y4.lower.right =", lower_right_y[4]) lower_right_y[5] = mathutils.Euler((-2.89871, -29.1751, 4.22026), 'XYZ') print ("y5.lower.right =", lower_right_y[5]) gimbal_lower_right_o[3] = mathutils.Euler((-3.01028, -8.51839, 2.50277), 'XYZ') print ("o3.gimbal.lower.right =", gimbal_lower_right_o[3]) gimbal_lower_right_b[4] = mathutils.Euler((-3.01028, -19.7726, 2.50277), 'XYZ') print ("b4.gimbal.lower.right =", gimbal_lower_right_b[4]) upper_b[2] = mathutils.Euler((0.510293, 5.22315, 0), 'XYZ') print ("b2.upper =", upper_b[2]) upper_o[2] = mathutils.Euler((-1.65578, 4.62023, 0), 'XYZ') print ("o2.upper =", upper_o[2]) upper_y[2] = mathutils.Euler((-1.56747, 4.00093, 0), 'XYZ') print ("y2.upper =", upper_y[2]) upper_w[3] = mathutils.Euler((-1.56747, 4.00093, 9.05079), 'XYZ') print ("w3.upper =", upper_w[3]) upper_w[4] = mathutils.Euler((-1.65459, 3.99465, 9.05079), 'XYZ') print ("w4.upper =", upper_w[4]) upper_w[5] = mathutils.Euler((-1.65459, 3.99465, 1.61675), 'XYZ') print ("w5.upper =", upper_w[5]) upper_y[3] = mathutils.Euler((-1.65459, 4.6204, 0), 'XYZ') print ("y3.upper.left =", upper_y[3]) upper_w[2] = mathutils.Euler((-1.65459, 4.6204, 9.05079), 'XYZ') print ("w2.upper =", upper_w[2]) upper_o[3] = mathutils.Euler((-2.07892, 9.71201, 0), 'XYZ') print ("o3.upper =", upper_o[3]) upper_w[1] = mathutils.Euler((-2.07852, 9.71278, 0.712845), 'XYZ') print ("w1.upper =", upper_w[1]) upper_b[4] = mathutils.Euler((-2.07852, 10.4327, 0.669667), 'XYZ') print ("o3.upper =", upper_o[3]) upper_left_y[3] = mathutils.Euler((-1.65578, 4.62023, 0), 'XYZ') print ("y3.upper.left =", upper_left_y[3]) upper_left_b[3] = mathutils.Euler((2.04941, 4.82274, 0), 'XYZ') print ("b3.upper.left =", upper_left_b[3]) upper_left_y[2] = mathutils.Euler((-1.56747, 3.99717, 0), 'XYZ') print ("y2.upper.left =", upper_left_y[2]) upper_left_o[2] = mathutils.Euler((2.28887, 4.24878, 0), 'XYZ') print ("o2.upper.left =", upper_left_o[2]) upper_left_w[1] = mathutils.Euler((2.52833, 3.67482, 0), 'XYZ') print ("w1.upper.left =", upper_left_w[1]) upper_left_w[2] = mathutils.Euler((1.49581, 3.75702, 2.28162), 'XYZ') print ("w2.upper.left =", upper_left_w[2]) upper_left_w[3] = mathutils.Euler((0.480431, 3.83787, 4.52539), 'XYZ') print ("w3.upper.left =", upper_left_w[3]) upper_left_w[4] = mathutils.Euler((-0.54352, 3.9194, 6.78809), 'XYZ') print ("w4.upper.left =", upper_left_w[4]) upper_left_w[5] = mathutils.Euler((2.28863, 3.62687, 0), 'XYZ') print ("w5.upper.left =", upper_left_w[5]) upper_left_w[6] = mathutils.Euler((2.28863, 3.62687, 4.96987), 'XYZ') print ("w6.upper.left =", upper_left_w[6]) upper_right_y[3] = mathutils.Euler((-1.65578, 4.62023, 0), 'XYZ') print ("y3.upper.right =", upper_right_y[3]) upper_right_b[3] = mathutils.Euler((-5.45688, 3.83647, 0), 'XYZ') print ("b3.upper.right =", upper_right_b[3]) upper_right_y[2] = mathutils.Euler((-1.56747, 3.99717, 0), 'XYZ') print ("y2.upper.right =", upper_right_y[2]) upper_right_o[2] = mathutils.Euler((-5.37016, 3.21603, 0), 'XYZ') print ("o2.upper.right =", upper_right_o[2]) upper_right_w[1] = mathutils.Euler((-5.28344, 2.59559, 0), 'XYZ') print ("w1.upper.right =", upper_right_w[1]) upper_right_w[2] = mathutils.Euler((-4.36226, 2.94397, 2.24368), 'XYZ') print ("w2.upper.right =", upper_right_w[2]) upper_right_w[3] = mathutils.Euler((-3.42546, 3.29826, 4.52539), 'XYZ') print ("w3.upper.right =", upper_right_w[3]) upper_right_w[4] = mathutils.Euler((-2.49646, 3.64959, 6.78809), 'XYZ') print ("w4.upper.right =", upper_right_w[4]) upper_right_w[5] = mathutils.Euler((-5.37016, 2.58956, 0), 'XYZ') print ("w5.upper.right =", upper_right_w[5]) upper_right_w[6] = mathutils.Euler((-5.37016, 2.58956, 4.94216), 'XYZ') print ("w6.upper.right =", upper_right_w[6]) def constructMovement(self, J, amt, rig, a, b, y, o, upper_b, upper_y, upper_o, upper_w, upper_left_b, upper_left_y, upper_left_o, upper_left_w, upper_right_b, upper_right_y, upper_right_o, upper_right_w, lower_b, lower_y, lower_o, lower_w, lower_left_b, lower_left_y, lower_left_o, lower_right_b, lower_right_y, lower_right_o, gimbal_lower_left_o, gimbal_lower_left_b, gimbal_lower_right_o, gimbal_lower_right_b): # Linkages aa = [[0 for i in range(3)] for j in range(3)] # Link α(i) - α(j) ab = [[0 for i in range(3)] for j in range(3)] # Link α(i) - β(j) ya = [[0 for i in range(3)] for j in range(3)] # Link γ(i) - α(j) ao = [[0 for i in range(3)] for j in range(3)] # Link α(i) - δ(j) by = [[0 for i in range(2)] for j in range(2)] # Link β(i) - γ(j) upper_ob = [[0 for i in range(self.J)] for j in range(self.J)] # Link δ(i) - β(j) upper_yy = [[0 for i in range(self.J)] for j in range(self.J)] # Link γ(i) - γ(j) upper_by = [[0 for i in range(self.J)] for j in range(self.J)] # Link β(i) - γ(j) upper_yo = [[0 for i in range(self.J)] for j in range(self.J)] # Link γ(i) - δ(j) upper_ow = [[0 for i in range(self.J)] for j in range(self.J)] # Link γ(i) - δ(j) upper_ww = [[0 for i in range(self.J)] for j in range(self.J)] # Link γ(i) - δ(j) upper_left_ob = [[0 for i in range(self.J)] for j in range(self.J)] # Link δ(i) - β(j) upper_left_yy = [[0 for i in range(self.J)] for j in range(self.J)] # Link γ(i) - γ(j) upper_left_by = [[0 for i in range(self.J)] for j in range(self.J)] # Link β(i) - γ(j) upper_left_yo = [[0 for i in range(self.J)] for j in range(self.J)] # Link γ(i) - δ(j) upper_left_ow = [[0 for i in range(self.J)] for j in range(self.J)] # Link δ(i) - ω(j) upper_left_ww = [[0 for i in range(self.J)] for j in range(self.J)] # Link ω(i) - ω(j) upper_right_ob = [[0 for i in range(self.J)] for j in range(self.J)] # Link δ(i) - β(j) upper_right_yy = [[0 for i in range(self.J)] for j in range(self.J)] # Link γ(i) - γ(j) upper_right_by = [[0 for i in range(self.J)] for j in range(self.J)] # Link β(i) - γ(j) upper_right_yo = [[0 for i in range(self.J)] for j in range(self.J)] # Link γ(i) - δ(j) upper_right_ow = [[0 for i in range(self.J)] for j in range(self.J)] # Link δ(i) - ω(j) upper_right_ww = [[0 for i in range(self.J)] for j in range(self.J)] # Link ω(i) - ω(j) lower_ob = [[0 for i in range(self.J)] for j in range(self.J)] # Link δ(i) - β(j) lower_yy = [[0 for i in range(self.J)] for j in range(self.J)] # Link γ(i) - γ(j) lower_by = [[0 for i in range(self.J)] for j in range(self.J)] # Link β(i) - γ(j) lower_yo = [[0 for i in range(self.J)] for j in range(self.J)] # Link γ(i) - δ(j) lower_yw = [[0 for i in range(2)] for j in range(self.J)] # Link γ(i) - ω(j) lower_left_ob = [[0 for i in range(self.J)] for j in range(self.J)] # Link δ(i) - β(j) lower_left_yy = [[0 for i in range(self.J)] for j in range(self.J)] # Link γ(i) - δ(j) lower_left_by = [[0 for i in range(self.J)] for j in range(self.J)] # Link β(i) - γ(j) lower_left_yo = [[0 for i in range(self.J)] for j in range(self.J)] # Link γ(i) - γ(j) lower_right_ob = [[0 for i in range(self.J)] for j in range(self.J)] # Link δ(i) - β(j) lower_right_yy = [[0 for i in range(self.J)] for j in range(self.J)] # Link γ(i) - δ(j) lower_right_by = [[0 for i in range(self.J)] for j in range(self.J)] # Link β(i) - γ(j) lower_right_yo = [[0 for i in range(self.J)] for j in range(self.J)] # Link γ(i) - γ(j) gimbal_lower_left_yo = [[0 for i in range(self.J)] for j in range(self.J)] # Link δ(i) - β(j) gimbal_lower_left_ob = [[0 for i in range(self.J)] for j in range(self.J)] # Link δ(i) - β(j) gimbal_lower_right_yo = [[0 for i in range(self.J)] for j in range(self.J)] # Link δ(i) - β(j) gimbal_lower_right_ob = [[0 for i in range(self.J)] for j in range(self.J)] # Link δ(i) - β(j) gimbal_upper_left_ow = [[0 for i in range(self.J)] for j in range(self.J)] # Link δ(i) - ω(j) gimbal_upper_left_ww = [[0 for i in range(self.J)] for j in range(self.J)] # Link δ(i) - ω(j) gimbal_upper_right_ow = [[0 for i in range(self.J)] for j in range(self.J)] # Link δ(i) - ω(j) gimbal_upper_right_ww = [[0 for i in range(self.J)] for j in range(self.J)] # Link δ(i) - ω(j) rig.location = mathutils.Euler((0.0, 0.0, 0.0), 'XYZ') rig.show_x_ray = True amt.show_names = True # amt.draw_type = 'STICK' amt.draw_type = 'BBONE' # Link object to scene scn = bpy.context.scene scn.objects.link(rig) scn.objects.active = rig scn.update() # Edit bpy.ops.object.editmode_toggle() j = 1 # Construction Linkage aa[j+1][j] = amt.edit_bones.new('a'+ str(j+1)+'a'+ str(j)) aa[j+1][j].head = a[j+1] aa[j+1][j].tail = a[j] # aa[j+1][j].parent = by[j][j]_body ab[j][j] = amt.edit_bones.new('a'+ str(j)+'b'+ str(j)) ab[j][j].head = a[j] ab[j][j].tail = b[j] ab[j][j].parent = aa[j+1][j] by[j][j] = amt.edit_bones.new('b'+ str(j)+'y'+ str(j)) by[j][j].head = b[j] by[j][j].tail = y[j] by[j][j].parent = ab[j][j] by[j][j].use_inherit_rotation = False ya[j][j+1] = amt.edit_bones.new('y'+ str(j)+'a'+ str(j+1)) ya[j][j+1].head = y[j] ya[j][j+1].tail = a[j+1] ya[j][j+1].parent = by[j][j] ao[j+1][j] = amt.edit_bones.new('a'+ str(j+1)+'o'+str(j)) ao[j+1][j].head = a[j+1] ao[j+1][j].tail = o[j] ao[j+1][j].parent = ya[j][j+1] lower_ob[j][j+1] = amt.edit_bones.new('o'+ str(j)+'b'+ str(j+1)+'.lower') lower_ob[j][j+1].head = o[j] lower_ob[j][j+1].tail = lower_b[j+1] lower_ob[j][j+1].parent = ao[j+1][j] lower_yy[j][j+1] = amt.edit_bones.new('y'+ str(j)+'y'+ str(j+1)+'.lower') lower_yy[j][j+1].head = y[j] lower_yy[j][j+1].tail = lower_y[j+1] lower_yy[j][j+1].parent = by[j][j] upper_ob[j][j+1] = amt.edit_bones.new('o'+ str(j)+'b'+ str(j+1)+'.upper') upper_ob[j][j+1].head = o[j] upper_ob[j][j+1].tail = upper_b[j+1] upper_ob[j][j+1].parent = ao[j+1][j] upper_yy[j][j+1] = amt.edit_bones.new('y'+ str(j)+'y'+ str(j+1)+'.upper') upper_yy[j][j+1].head = y[j] upper_yy[j][j+1].tail = upper_y[j+1] upper_yy[j][j+1].parent = by[j][j] j = 2 lower_by[j][j] = amt.edit_bones.new('b'+ str(j) + 'y'+ str(j) + '.lower') lower_by[j][j].head = lower_b[j] lower_by[j][j].tail = lower_y[j] lower_by[j][j].parent = lower_ob[j-1][j] lower_yy[j][j+1] = amt.edit_bones.new('y'+ str(j) + 'y'+ str(j+1) + '.lower') lower_yy[j][j+1].head = lower_y[j] lower_yy[j][j+1].tail = lower_y[j+1] lower_yy[j][j+1].parent = lower_by[j][j] lower_yo[j][j] = amt.edit_bones.new('y'+ str(j) + 'o'+ str(j) + '.lower') lower_yo[j][j].head = lower_y[j] lower_yo[j][j].tail = lower_o[j] lower_yo[j][j].parent = lower_yy[j-1][j] upper_by[j][j] = amt.edit_bones.new('b'+ str(j) + 'y'+ str(j) + '.upper') upper_by[j][j].head = upper_b[j] upper_by[j][j].tail = upper_y[j] upper_by[j][j].parent = upper_ob[j-1][j] upper_yy[j][j+1] = amt.edit_bones.new('y'+ str(j) + 'y'+ str(j+1) + '.upper') upper_yy[j][j+1].head = upper_y[j] upper_yy[j][j+1].tail = upper_y[j+1] upper_yy[j][j+1].parent = upper_by[j][j] # upper w2w3 upper_ww[j][j+1] = amt.edit_bones.new('w'+ str(j) + 'w'+ str(j+1) + '.upper') upper_ww[j][j+1].head = upper_w[j] upper_ww[j][j+1].tail = upper_w[j+1] # upper_ww[j][j+1].parent = upper_yy[j][j+1] # left shoulder gimbal upper_left_yo[j][j] = amt.edit_bones.new('y'+ str(j) + 'o'+ str(j) + '.upper.left') upper_left_yo[j][j].head = upper_y[j] upper_left_yo[j][j].tail = upper_left_o[j] upper_left_yo[j][j].parent = upper_yy[j-1][j] upper_left_ob[j][j+1] = amt.edit_bones.new('o' + str(j) + 'b'+ str(j+1) + '.upper.left') upper_left_ob[j][j+1].head = upper_left_o[j] upper_left_ob[j][j+1].tail = upper_left_b[j+1] upper_left_ob[j][j+1].parent = upper_left_yo[j][j] # gimbal o2w5 gimbal_upper_left_ow[j][j+3] = amt.edit_bones.new('o' + str(j) + 'w'+ str(j+3) + '.gimbal.upper.left') gimbal_upper_left_ow[j][j+3].head = upper_left_o[j] gimbal_upper_left_ow[j][j+3].tail = upper_left_w[j+3] gimbal_upper_left_ow[j][j+3].parent = upper_left_ob[j][j+1] upper_left_ow[j][j-1] = amt.edit_bones.new('o' + str(j) + 'w'+ str(j-1) + '.upper.left') upper_left_ow[j][j-1].head = upper_left_o[j] upper_left_ow[j][j-1].tail = upper_left_w[j-1] upper_left_ow[j][j-1].parent = upper_left_ob[j][j+1] # w1w3 upper_left_ww[j-1][j+1] = amt.edit_bones.new('w' + str(j-1) + 'w'+ str(j+1) + '.upper.left') upper_left_ww[j-1][j+1].head = upper_left_w[j-1] upper_left_ww[j-1][j+1].tail = upper_left_w[j+1] upper_left_ww[j-1][j+1].parent = upper_left_ow[j][j-1] # left w3w2 upper_left_ww[j+1][j] = amt.edit_bones.new('w' + str(j+1) + 'w'+ str(j) + '.upper.left') upper_left_ww[j+1][j].head = upper_w[j+1] upper_left_ww[j+1][j].tail = upper_left_w[j] upper_left_ww[j+1][j].parent = upper_ww[j][j+1] # left w2w1 upper_left_ww[j][j-1] = amt.edit_bones.new('w' + str(j) + 'w'+ str(j-1) + '.upper.left') upper_left_ww[j][j-1].head = upper_left_w[j] upper_left_ww[j][j-1].tail = upper_left_w[j-1] upper_left_ww[j][j-1].parent = upper_left_ww[j+1][j] # left gimbal w2w4 gimbal_upper_left_ww[j][j+2] = amt.edit_bones.new('w' + str(j) + 'w'+ str(j+2) +'.gimbal.upper.left') gimbal_upper_left_ww[j][j+2].head = upper_w[j] gimbal_upper_left_ww[j][j+2].tail = upper_w[j+2] gimbal_upper_left_ww[j][j+2].parent = upper_ww[j][j+1] # right shoulder gimbal upper_right_yo[j][j] = amt.edit_bones.new('y'+ str(j) + 'o'+ str(j) + '.upper.right') upper_right_yo[j][j].head = upper_y[j] upper_right_yo[j][j].tail = upper_right_o[j] upper_right_yo[j][j].parent = upper_yy[j-1][j] upper_right_ob[j][j+1] = amt.edit_bones.new('o' + str(j) + 'b'+ str(j+1) + '.upper.right') upper_right_ob[j][j+1].head = upper_right_o[j] upper_right_ob[j][j+1].tail = upper_right_b[j+1] upper_right_ob[j][j+1].parent = upper_right_yo[j][j] # gimbal o2w5 gimbal_upper_right_ow[j][j+3] = amt.edit_bones.new('o' + str(j) + 'w'+ str(j+3) + '.gimbal.upper.right') gimbal_upper_right_ow[j][j+3].head = upper_right_o[j] gimbal_upper_right_ow[j][j+3].tail = upper_right_w[j+3] gimbal_upper_right_ow[j][j+3].parent = upper_right_ob[j][j+1] upper_right_ow[j][j-1] = amt.edit_bones.new('o' + str(j) + 'w'+ str(j-1) + '.upper.right') upper_right_ow[j][j-1].head = upper_right_o[j] upper_right_ow[j][j-1].tail = upper_right_w[j-1] upper_right_ow[j][j-1].parent = upper_right_ob[j][j+1] # w1w3 upper_right_ww[j-1][j+1] = amt.edit_bones.new('w' + str(j-1) + 'w'+ str(j+1) + '.upper.right') upper_right_ww[j-1][j+1].head = upper_right_w[j-1] upper_right_ww[j-1][j+1].tail = upper_right_w[j+1] upper_right_ww[j-1][j+1].parent = upper_right_ow[j][j-1] # right w3w2 upper_right_ww[j+1][j] = amt.edit_bones.new('w' + str(j+1) + 'w'+ str(j) + '.upper.right') upper_right_ww[j+1][j].head = upper_w[j+1] upper_right_ww[j+1][j].tail = upper_right_w[j] upper_right_ww[j+1][j].parent = upper_ww[j][j+1] # right w2w1 upper_right_ww[j][j-1] = amt.edit_bones.new('w' + str(j) + 'w'+ str(j-1) + '.upper.right') upper_right_ww[j][j-1].head = upper_right_w[j] upper_right_ww[j][j-1].tail = upper_right_w[j-1] upper_right_ww[j][j-1].parent = upper_right_ww[j+1][j] # right gimbal w2w4 gimbal_upper_right_ww[j][j+2] = amt.edit_bones.new('w' + str(j) + 'w'+ str(j+2) +'.gimbal.upper.right') gimbal_upper_right_ww[j][j+2].head = upper_w[j] gimbal_upper_right_ww[j][j+2].tail = upper_w[j+2] gimbal_upper_right_ww[j][j+2].parent = upper_ww[j][j+1] j = 3 lower_yw[j][1] = amt.edit_bones.new('y'+ str(j) + 'w'+ str(1) + '.lower') lower_yw[j][1].head = lower_y[j] lower_yw[j][1].tail = lower_w[1] lower_yw[j][1].parent = lower_yy[2][j] lower_left_yo[j][j] = amt.edit_bones.new('y'+ str(j) + 'o'+ str(j) + '.lower.left') lower_left_yo[j][j].head = lower_w[1] lower_left_yo[j][j].tail = lower_left_o[j] lower_left_yo[j][j].parent = lower_yw[j][1] lower_left_ob[j][j+1] = amt.edit_bones.new('o' + str(j) + 'b'+ str(j+1) + '.lower.left') lower_left_ob[j][j+1].head = lower_left_o[j] lower_left_ob[j][j+1].tail = lower_left_b[j+1] lower_left_ob[j][j+1].parent = lower_left_yo[j][j] lower_right_yo[j][j] = amt.edit_bones.new('y' + str(j) + 'o'+ str(j) +'.lower.right') lower_right_yo[j][j].head = lower_w[1] lower_right_yo[j][j].tail = lower_right_o[j] lower_right_yo[j][j].parent = lower_yw[j][1] lower_right_ob[j][j+1] = amt.edit_bones.new('o' + str(j) + 'b'+ str(j+1) +'.lower.right') lower_right_ob[j][j+1].head = lower_right_o[j] lower_right_ob[j][j+1].tail = lower_right_b[j+1] lower_right_ob[j][j+1].parent = lower_right_yo[j][j] # gimbal gimbal_lower_left_yo[j][j] = amt.edit_bones.new('y'+ str(j) + 'o'+ str(j) + '.gimbal.lower.left') gimbal_lower_left_yo[j][j].head = lower_w[1] gimbal_lower_left_yo[j][j].tail = gimbal_lower_left_o[j] gimbal_lower_left_yo[j][j].parent = lower_yw[j][1] gimbal_lower_left_ob[j][j+1] = amt.edit_bones.new('o' + str(j) + 'b'+ str(j+1) + '.gimbal.lower.left') gimbal_lower_left_ob[j][j+1].head = gimbal_lower_left_o[j] gimbal_lower_left_ob[j][j+1].tail = gimbal_lower_left_b[j+1] gimbal_lower_left_ob[j][j+1].parent = gimbal_lower_left_yo[j][j] gimbal_lower_right_yo[j][j] = amt.edit_bones.new('y' + str(j) + 'o'+ str(j) +'.gimbal.lower.right') gimbal_lower_right_yo[j][j].head = lower_w[1] gimbal_lower_right_yo[j][j].tail = gimbal_lower_right_o[j] gimbal_lower_right_yo[j][j].parent = lower_yw[j][1] gimbal_lower_right_ob[j][j+1] = amt.edit_bones.new('o' + str(j) + 'b'+ str(j+1) +'.gimbal.lower.right') gimbal_lower_right_ob[j][j+1].head = gimbal_lower_right_o[j] gimbal_lower_right_ob[j][j+1].tail = gimbal_lower_right_b[j+1] gimbal_lower_right_ob[j][j+1].parent = gimbal_lower_right_yo[j][j] # end upper_left_by[j][j] = amt.edit_bones.new('b'+ str(j) + 'y'+ str(j) + '.upper.left') upper_left_by[j][j].head = upper_left_b[j] upper_left_by[j][j].tail = upper_left_y[j] upper_left_by[j][j].parent = upper_left_ob[j-1][j] upper_right_by[j][j] = amt.edit_bones.new('b'+ str(j) + 'y'+ str(j) + '.upper.right') upper_right_by[j][j].head = upper_right_b[j] upper_right_by[j][j].tail = upper_right_y[j] upper_right_by[j][j].parent = upper_right_ob[j-1][j] upper_yo[j][j] = amt.edit_bones.new('y'+ str(j) + 'o'+ str(j) + '.upper') upper_yo[j][j].head = upper_y[j] upper_yo[j][j].tail = upper_o[j] upper_yo[j][j].parent = upper_yy[j-1][j] upper_ob[j][j+1] = amt.edit_bones.new('o' + str(j) + 'b'+ str(j+1) + '.upper') upper_ob[j][j+1].head = upper_w[1] upper_ob[j][j+1].tail = upper_b[j+1] upper_ob[j][j+1].parent = upper_yo[j][j] upper_left_ww[j][j+1] = amt.edit_bones.new('w' + str(j) + 'w'+ str(j+1) + '.upper.left') upper_left_ww[j][j+1].head = upper_left_w[j] upper_left_ww[j][j+1].tail = upper_left_w[j+1] upper_left_ww[j][j+1].parent = upper_left_ww[j-2][j] upper_right_ww[j][j+1] = amt.edit_bones.new('w' + str(j) + 'w'+ str(j+1) + '.upper.right') upper_right_ww[j][j+1].head = upper_right_w[j] upper_right_ww[j][j+1].tail = upper_right_w[j+1] upper_right_ww[j][j+1].parent = upper_right_ww[j-2][j] j = 4 lower_left_by[j][j] = amt.edit_bones.new('b' + str(j) + 'y' + str(j) +'.lower.left') lower_left_by[j][j].head = lower_left_b[j] lower_left_by[j][j].tail = lower_left_y[j] lower_left_by[j][j].parent = lower_left_ob[j-1][j] lower_left_yy[j][j+1] = amt.edit_bones.new('y' + str(j) + 'y' + str(j+1) +'.lower.left') lower_left_yy[j][j+1].head = lower_left_y[j] lower_left_yy[j][j+1].tail = lower_left_y[j+1] lower_left_yy[j][j+1].parent = lower_left_by[j][j] # gimbal w4w5 gimbal_upper_left_ww[j][j+1] = amt.edit_bones.new('w' + str(j) + 'w'+ str(j+1) +'.gimbal.upper.left') gimbal_upper_left_ww[j][j+1].head = upper_w[j] gimbal_upper_left_ww[j][j+1].tail = upper_w[j+1] gimbal_upper_left_ww[j][j+1].parent = gimbal_upper_left_ww[j-2][j] lower_right_by[j][j] = amt.edit_bones.new('b' + str(j) + 'y' + str(j) +'.lower.right') lower_right_by[j][j].head = lower_right_b[j] lower_right_by[j][j].tail = lower_right_y[j] lower_right_by[j][j].parent = lower_right_ob[j-1][j] lower_right_yy[j][j+1] = amt.edit_bones.new('y' + str(j) + 'y' + str(j+1) +'.lower.right') lower_right_yy[j][j+1].head = lower_right_y[j] lower_right_yy[j][j+1].tail = lower_right_y[j+1] lower_right_yy[j][j+1].parent = lower_right_by[j][j] # gimbal w4w5 gimbal_upper_right_ww[j][j+1] = amt.edit_bones.new('w' + str(j) + 'w'+ str(j+1) +'.gimbal.upper.right') gimbal_upper_right_ww[j][j+1].head = upper_w[j] gimbal_upper_right_ww[j][j+1].tail = upper_w[j+1] gimbal_upper_right_ww[j][j+1].parent = gimbal_upper_right_ww[j-2][j] j = 5 # gimbal w5w6 gimbal_upper_left_ww[j][j+1] = amt.edit_bones.new('w' + str(j) + 'w'+ str(j+1) + '.gimbal.upper.left') gimbal_upper_left_ww[j][j+1].head = upper_left_w[j] gimbal_upper_left_ww[j][j+1].tail = upper_left_w[j+1] gimbal_upper_left_ww[j][j+1].parent = gimbal_upper_left_ow[j-3][j] gimbal_upper_right_ww[j][j+1] = amt.edit_bones.new('w' + str(j) + 'w'+ str(j+1) + '.gimbal.upper.right') gimbal_upper_right_ww[j][j+1].head = upper_right_w[j] gimbal_upper_right_ww[j][j+1].tail = upper_right_w[j+1] gimbal_upper_right_ww[j][j+1].parent = gimbal_upper_right_ow[j-3][j] # all bones select #bpy.ops.pose.select_all(action="SELECT") for b in amt.edit_bones: b.select = True bpy.ops.armature.calculate_roll(type='GLOBAL_NEG_Z') for b in amt.edit_bones: b.select = False amt.edit_bones["o3b4.lower.left"].select = True amt.edit_bones["b4y4.lower.left"].select = True amt.edit_bones["y4y5.lower.left"].select = True bpy.ops.armature.calculate_roll(type='GLOBAL_NEG_X') for b in amt.edit_bones: b.select = False amt.edit_bones["o3b4.lower.right"].select = True amt.edit_bones["b4y4.lower.right"].select = True amt.edit_bones["y4y5.lower.right"].select = True bpy.ops.armature.calculate_roll(type='GLOBAL_POS_X') # Bone constraints. Armature must be in pose mode. bpy.ops.object.mode_set(mode='POSE') # IK constraint j = 1 cns = rig.pose.bones['y' +str(j) +'a' +str(j+1)].constraints.new('IK') cns.name = 'Ik' cns.target = rig cns.subtarget = 'a'+str(j+1)+'a'+str(j) cns.chain_count = 2 cns.use_stretch = False j = 2 cns = rig.pose.bones['b'+str(j) +'y'+str(j)+'.lower'].constraints.new('IK') cns.name = 'Ik' cns.target = rig cns.subtarget = 'y'+str(j)+'o'+str(j)+'.lower' cns.iterations = 500 cns.chain_count = 2 cns.use_stretch = False cns = rig.pose.bones['b'+str(j) +'y'+str(j)+'.upper'].constraints.new('IK') cns.name = 'Ik' cns.target = rig cns.subtarget = 'y'+str(j)+'o'+str(j)+'.upper.left' cns.iterations = 500 cns.chain_count = 2 cns.use_stretch = False cns = rig.pose.bones['w' +str(j+1) +'w' +str(j)+'.upper.left'].constraints.new('IK') cns.name = 'Ik' cns.target = rig cns.subtarget = 'w' +str(j-1) +'w' +str(j+1)+'.upper.left' cns.chain_count = 1 cns.use_stretch = False cns = rig.pose.bones['w' +str(j+1) +'w' +str(j)+'.upper.right'].constraints.new('IK') cns.name = 'Ik' cns.target = rig cns.subtarget = 'w' +str(j-1) +'w' +str(j+1)+'.upper.right' cns.chain_count = 1 cns.use_stretch = False j = 3 cns = rig.pose.bones['b'+str(j) +'y'+str(j)+'.upper.left'].constraints.new('IK') cns.name = 'Ik' cns.target = rig cns.subtarget = 'y'+str(j)+'o'+str(j)+'.upper' cns.iterations = 500 cns.chain_count = 2 cns.use_stretch = False cns = rig.pose.bones['b'+str(j) +'y'+str(j)+'.upper.right'].constraints.new('IK') cns.name = 'Ik' cns.target = rig cns.subtarget = 'y'+str(j)+'o'+str(j)+'.upper' cns.iterations = 500 cns.chain_count = 2 cns.use_stretch = False cns = rig.pose.bones['o'+str(j) +'b'+str(j+1)+'.gimbal.lower.left'].constraints.new('IK') cns.name = 'Ik' cns.target = rig cns.subtarget = 'b'+str(j+1)+'y'+str(j+1)+'.lower.left' cns.pole_target = rig cns.pole_subtarget = 'o'+str(j)+'b'+str(j+1)+'.lower.left' cns.pole_angle = 0 cns.iterations = 500 cns.chain_count = 2 cns.use_stretch = False cns = rig.pose.bones['o'+str(j) +'b'+str(j+1)+'.gimbal.lower.right'].constraints.new('IK') cns.name = 'Ik' cns.target = rig cns.subtarget = 'b'+str(j+1)+'y'+str(j+1)+'.lower.right' cns.pole_target = rig cns.pole_subtarget = 'o'+str(j)+'b'+str(j+1)+'.lower.right' cns.pole_angle = math.radians(180) cns.iterations = 500 cns.chain_count = 2 cns.use_stretch = False j = 4 cns = rig.pose.bones['w'+str(j) +'w'+str(j+1)+'.gimbal.upper.left'].constraints.new('IK') cns.name = 'Ik' cns.target = rig cns.subtarget = 'w'+str(j-2)+'w'+str(j-3)+'.upper.left' cns.pole_target = rig cns.pole_subtarget = 'w'+str(j-1)+'w'+str(j-2)+'.upper.left' cns.pole_angle = math.radians(-90) cns.iterations = 500 cns.chain_count = 2 cns.use_stretch = False cns = rig.pose.bones['w'+str(j) +'w'+str(j+1)+'.gimbal.upper.right'].constraints.new('IK') cns.name = 'Ik' cns.target = rig cns.subtarget = 'w'+str(j-2)+'w'+str(j-3)+'.upper.right' cns.pole_target = rig cns.pole_subtarget = 'w'+str(j-1)+'w'+str(j-2)+'.upper.right' cns.pole_angle = math.radians(-90) cns.iterations = 500 cns.chain_count = 2 cns.use_stretch = False j = 5 cns = rig.pose.bones['w'+str(j) +'w'+str(j+1)+'.gimbal.upper.left'].constraints.new('IK') cns.name = 'Ik' cns.target = rig cns.subtarget = 'w'+str(j-2)+'w'+str(j-1)+'.upper.left' cns.pole_target = rig cns.pole_subtarget = 'w'+str(j-4)+'w'+str(j-2)+'.upper.left' cns.pole_angle = math.radians(90) cns.iterations = 500 cns.chain_count = 2 cns.use_stretch = False cns = rig.pose.bones['w'+str(j) +'w'+str(j+1)+'.gimbal.upper.right'].constraints.new('IK') cns.name = 'Ik' cns.target = rig cns.subtarget = 'w'+str(j-2)+'w'+str(j-1)+'.upper.right' cns.pole_target = rig cns.pole_subtarget = 'w'+str(j-4)+'w'+str(j-2)+'.upper.right' cns.pole_angle = math.radians(90) cns.iterations = 500 cns.chain_count = 2 cns.use_stretch = False bpy.ops.object.mode_set(mode='OBJECT') def configLink(self, A, J, helicity, rig, move, part): bpy.ops.object.mode_set(mode='OBJECT') Q = (0.18648+0.146446)*A # Z = -Q*2 Z = 0.0 n = 1 obj_joint = bpy.data.objects["joint.gold.E"].copy() obj_joint.location = (0.0, 0.0, -Q*3+Z) obj_joint.scale = (A, A, A) obj_joint.name = 'a'+ str(n+1)+'a'+ str(n)+ ".mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.blue.001"].copy() obj_joint.location = (0.0, 0.0, -Q*2+Z) obj_joint.scale = (A, A, A) obj_joint.name = 'a'+ str(n)+'b'+ str(n)+ ".mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.green.001"].copy() obj_joint.location = (0.0, 0.0, -Q + Q*((n+1) % 2)*4 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "b"+str(n)+"y"+str(n)+".mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.silver.001"].copy() obj_joint.location = (0.0, 0.0, +Q+Z) obj_joint.scale = (A, A, A) obj_joint.name = 'y'+ str(n)+'a'+ str(n+1)+".mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.copper.001"].copy() obj_joint.location = (0.0, 0.0, +Q*3+Z) obj_joint.scale = (A, A, A) obj_joint.name = 'a'+ str(n+1)+'o'+ str(n)+".mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.blue.001"].copy() obj_joint.location = (0.0, 0.0, -Q*2 + Q*(n % 2)*6 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "o"+str(n)+"b"+str(n+1)+".lower.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.gold.00"+str(1 + (n+1) % 2)].copy() obj_joint.location = (0.0, 0.0, +Q*(1 - (n % 2))*2+Z) obj_joint.scale = (A, A, A) obj_joint.name = "y"+str(n)+"y"+str(n+1)+".lower.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.blue.001"].copy() obj_joint.location = (0.0, 0.0, -Q*2 + Q*(n % 2)*4 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "o"+str(n)+"b"+str(n+1)+".upper.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.gold.00"+str(1 + (n+1) % 2)].copy() obj_joint.location = (0.0, 0.0, +Q*(1 - (n % 2))*2+Z) obj_joint.scale = (A, A, A) obj_joint.name = "y"+str(n)+"y"+str(n+1)+".upper.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) n = 2 obj_joint = bpy.data.objects["joint.green.001"].copy() obj_joint.location = (0.0, 0.0, -Q + Q*((n+1) % 2)*4 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "b"+str(n)+"y"+str(n)+".lower.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.gold.00"+str(1 + (n+1) % 2)].copy() obj_joint.location = (0.0, 0.0, +Q*(1 - (n % 2))*2+Z) obj_joint.scale = (A, A, A) obj_joint.name = "y"+str(n)+"y"+str(n+1)+".lower.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.copper.001"].copy() obj_joint.location = (0.0, 0.0, -Q + Q*(n % 2)*4 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "y"+str(n)+"o"+str(n)+".lower.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.green.001"].copy() obj_joint.location = (0.0, 0.0, -Q + Q*((n+1) % 2)*4 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "b"+str(n)+"y"+str(n)+".upper.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.gold.00"+str(1 + (n+1) % 2)].copy() obj_joint.location = (0.0, 0.0, +Q*(1 - (n % 2))*2+Z) obj_joint.scale = (A, A, A) obj_joint.name = "y"+str(n)+"y"+str(n+1)+".upper.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.copper.001"].copy() obj_joint.location = (0.0, 0.0, -Q + Q*(n % 2)*4 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "y"+str(n)+"o"+str(n)+".upper.left.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.blue.001"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "o"+str(n)+"b"+str(n+1)+".upper.left.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.copper.001"].copy() obj_joint.location = (0.0, 0.0, -Q + Q*(n % 2)*4 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "y"+str(n)+"o"+str(n)+".upper.right.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.blue.001"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "o"+str(n)+"b"+str(n+1)+".upper.right.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.gold.B.R"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "o"+str(n)+"w"+str(n-1)+".upper.left.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.cursor"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "w"+str(n-1)+"w"+str(n+1)+".upper.left.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.cursor"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "w"+str(n+1)+"w"+str(n+2)+".upper.left.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # w2w5.gimbal obj_joint = bpy.data.objects["joint.gold.g1.y.C.R2"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "o"+str(n)+"w"+str(n+3)+".gimbal.upper.left.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # w5w6.gimbal obj_joint = bpy.data.objects["joint.silver.g1.z.C.R2"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "w"+str(n+3)+"w"+str(n+4)+".gimbal.upper.left.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.gold.B.L"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "o"+str(n)+"w"+str(n-1)+".upper.right.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.cursor"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "w"+str(n-1)+"w"+str(n+1)+".upper.right.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.cursor"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "w"+str(n+1)+"w"+str(n+2)+".upper.right.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # w2w5.gimbal obj_joint = bpy.data.objects["joint.gold.g1.y.C.L2"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "o"+str(n)+"w"+str(n+3)+".gimbal.upper.right.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # w5w6.gimbal obj_joint = bpy.data.objects["joint.silver.g1.z.C.L2"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "w"+str(n+3)+"w"+str(n+4)+".gimbal.upper.right.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # w2w3.upper obj_joint = bpy.data.objects["joint.gold.B2"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "w"+str(n)+"w"+str(n+1)+".upper.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # w2w4.gimbal.upper.left obj_joint = bpy.data.objects["joint.gold.g1.y.C.L"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "w"+str(n)+"w"+str(n+2)+".gimbal.upper.left.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # w4w5.gimbal.upper.left obj_joint = bpy.data.objects["joint.silver.g1.z.C.L"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "w"+str(n+2)+"w"+str(n+3)+".gimbal.upper.left.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # w3w2.upper.left obj_joint = bpy.data.objects["joint.cursor"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "w"+str(n+1)+"w"+str(n)+".upper.left.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # w2w1.upper.left obj_joint = bpy.data.objects["joint.cursor"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "w"+str(n)+"w"+str(n-1)+".upper.left.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # w2w4.gimbal.upper.right obj_joint = bpy.data.objects["joint.gold.g1.y.C.R"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "w"+str(n)+"w"+str(n+2)+".gimbal.upper.right.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # w4w5.gimbal.upper.right obj_joint = bpy.data.objects["joint.silver.g1.z.C.R"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "w"+str(n+2)+"w"+str(n+3)+".gimbal.upper.right.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # w3w2.upper.right obj_joint = bpy.data.objects["joint.cursor"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "w"+str(n+1)+"w"+str(n)+".upper.right.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) # w2w1.upper.right obj_joint = bpy.data.objects["joint.cursor"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "w"+str(n)+"w"+str(n-1)+".upper.right.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) n = 3 obj_joint = bpy.data.objects["joint.gold.A"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "y"+str(n)+"w"+str(1)+".lower.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.copper.A"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "y"+str(n)+"o"+str(n)+".lower.left.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.blue.B"].copy() # obj_joint.location = (0.0, 0.0, -Q*2 + Q*(n % 2)*6 +Z) obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "o"+str(n)+"b"+str(n+1)+".lower.left.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.copper.A"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "y"+str(n)+"o"+str(n)+".lower.right.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.blue.B"].copy() # obj_joint.location = (0.0, 0.0, -Q*2 + Q*(n % 2)*6 +Z) obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "o"+str(n)+"b"+str(n+1)+".lower.right.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.copper.g1.y.B"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "y"+str(n)+"o"+str(n)+".gimbal.lower.left.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.blue.g1.z.B"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "o"+str(n)+"b"+str(n+1)+".gimbal.lower.left.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.copper.g1.y.B"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "y"+str(n)+"o"+str(n)+".gimbal.lower.right.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.blue.g1.z.B"].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "o"+str(n)+"b"+str(n+1)+".gimbal.lower.right.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.green.001"].copy() obj_joint.location = (0.0, 0.0, -Q + Q*((n+1) % 2)*4 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "b"+str(n)+"y"+str(n)+".upper.left.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.green.001"].copy() obj_joint.location = (0.0, 0.0, -Q + Q*((n+1) % 2)*4 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "b"+str(n)+"y"+str(n)+".upper.right.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.copper.001"].copy() obj_joint.location = (0.0, 0.0, -Q + Q*(n % 2)*4 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "y"+str(n)+"o"+str(n)+".upper.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.blue.001"].copy() obj_joint.location = (0.0, 0.0, -Q*2 + Q*(n % 2)*6 +Z) obj_joint.scale = (A, A, A) obj_joint.name = "o"+str(n)+"b"+str(n+1)+".upper.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) n = 4 obj_joint = bpy.data.objects["joint.green.001"].copy() obj_joint.location = (0.0, 0.0, Q +Z) obj_joint.scale = (A, A, A) obj_joint.name = "b"+str(n)+"y"+str(n)+".lower.left.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.gold.00"+str(1 + (n+1) % 2)].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "y"+str(n)+"y"+str(n+1)+".lower.left.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.green.001"].copy() obj_joint.location = (0.0, 0.0, Q +Z) obj_joint.scale = (A, A, A) obj_joint.name = "b"+str(n)+"y"+str(n)+".lower.right.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) obj_joint = bpy.data.objects["joint.gold.00"+str(1 + (n+1) % 2)].copy() obj_joint.location = (0.0, 0.0, 0.0) obj_joint.scale = (A, A, A) obj_joint.name = "y"+str(n)+"y"+str(n+1)+".lower.right.mesh." + move + '.' + part +'.' + helicity bpy.context.scene.objects.link(obj_joint) for ob in context.scene.objects: if "mesh" in ob.name: ob.select = True bpy.ops.object.make_single_user(type='SELECTED_OBJECTS', object=True, obdata=True, material=True, texture=True, animation=True) bpy.context.scene.cursor_location = (0.0, 0.0, 0.0) bpy.ops.object.origin_set(type='ORIGIN_CURSOR') # Parent set arms to body def setParent(self, helicity, move, rig, arm_left_loc, arm_left_rot, arm_left, arm_right_loc, arm_right_rot, arm_right): bpy.ops.object.mode_set(mode='OBJECT') bpy.context.scene.frame_current = 0 # arm left bpy.ops.object.select_all(action='DESELECT') rig.select = True bpy.context.scene.objects.active = rig bpy.ops.object.editmode_toggle() # parent_bone = 'o2b3.upper.left' # choose the bone name which you want to be the parent parent_bone = 'o2w5.gimbal.upper.left' # choose the bone name which you want to be the parent rig.data.edit_bones.active = rig.data.edit_bones[parent_bone] bpy.ops.object.mode_set(mode='OBJECT') bpy.ops.object.select_all(action='DESELECT') #deselect all objects arm_left.rig.select = True rig.select = True bpy.context.scene.objects.active = rig #the active object will be the parent of all selected object bpy.ops.object.parent_set(type='BONE', keep_transform=True) # arm left end # arm right bpy.ops.object.select_all(action='DESELECT') #deselect all objects rig.select = True bpy.context.scene.objects.active = rig bpy.ops.object.editmode_toggle() # parent_bone = 'o2b3.upper.right' # choose the bone name which you want to be the parent parent_bone = 'o2w5.gimbal.upper.right' # choose the bone name which you want to be the parent rig.data.edit_bones.active = rig.data.edit_bones[parent_bone] bpy.ops.object.mode_set(mode='OBJECT') bpy.ops.object.select_all(action='DESELECT') #deselect all objects arm_right.rig.select = True rig.select = True bpy.context.scene.objects.active = rig #the active object will be the parent of all selected object bpy.ops.object.parent_set(type='BONE', keep_transform=True) # arm right end bpy.ops.object.select_all(action='DESELECT') #deselect all objects # arms position arm_left.rig.location = arm_left_loc arm_left.rig.rotation_euler = arm_left_rot arm_right.rig.location = arm_right_loc arm_right.rig.rotation_euler = arm_right_rot class Arm(Formula): J = 5 #joint number #frame_start = bpy.context.scene.frame_start #frame_end = bpy.context.scene.frame_end #bpy.context.scene.frame_current = frame_end interval = 120 frame_start = 133 frame_end = 148 # Overriding def __init__(self, P, A, move, part, helicity, start, end, fingers_loc, fingers_rot, middle_finger): # pivot factor self.P = P # scale factor self.A = A # name self.move = move # element self.part = part # element helicity self.helicity = helicity self.start = start self.end = end # fingers position self.fingers_loc = fingers_loc self.fingers_rot = fingers_rot # middle_finger self.middle_finger = middle_finger bpy.ops.object.mode_set(mode='OBJECT') # Create armature and object self.amt = bpy.data.armatures.new(move + '.' + part + '.' + helicity + '.data') self.rig = bpy.data.objects.new(move + '.' + part + '.' + helicity, self.amt) # Joints self.a = [0 for i in range(4)] # Joint α self.b = [0 for i in range(self.J)] # Joint β self.y = [0 for i in range(self.J)] # Joint γ self.o = [0 for i in range(self.J)] # Joint δ # Configuration Movement self.configMovement(self.P, self.A, self.J, self.a, self.b, self.y, self.o) # Construction Movement self.constructMovement(self.J, self.helicity, self.amt, self.rig, self.a, self.b, self.y, self.o) # Parent set fingers to arm self.setParent(self.helicity, self.move, self.rig, self.fingers_loc, self.fingers_rot, self.middle_finger) # Construction Rotation self.configRotation(self.rig, self.interval, self.frame_start, self.frame_end, self.start, self.end) # Configuration Linkage self.configLink(self.A, self.J, self.helicity, self.rig, self.move, self.part) # Construction Linkage self.constructLink(self.A, self.J, self.helicity, self.rig, self.move, self.part) # Overriding Configuration Movement def configMovement(self, P, A, J, a, b, y, o): a[1] = mathutils.Euler((P, A, 0), 'XYZ') print ("a1 =", a[1]) a[2] = mathutils.Euler((A, -A, 0), 'XYZ') print ("a2 =", a[2]) b[1] = mathutils.Euler((-A, A, 0), 'XYZ') print ("b1 =", b[1]) o[1] = mathutils.Euler((A, A, 0), 'XYZ') print ("o1 =", o[1]) B = A * 2 * sqrt (2) C = B + (B * sqrt (2)) D = C * sqrt (2) E = C + D y[1] = mathutils.Euler((-A, -A, 0), 'XYZ') print ("y1 =", y[1]) b[2] = mathutils.Euler((5.36277, -3.83599, 0), 'XYZ') print ("b2 =", b[2]) b[3] = mathutils.Euler((8.70172, -3.80032, 0), 'XYZ') print ("b3 =", b[3]) y[2] = mathutils.Euler((4.45922, -4.71667, 0), 'XYZ') print ("y2 =", y[2]) y[3] = mathutils.Euler((9.98465, -3.94095, 0), 'XYZ') print ("y3 =", y[3]) o[2] = mathutils.Euler((3.97637, -4.57217, 0), 'XYZ') print ("o2 =", o[2]) o[3] = mathutils.Euler((10.0529, -4.3022, 0), 'XYZ') print ("o3 =", o[3]) y[4] = mathutils.Euler((10.8499, -3.82056, 0), 'XYZ') print ("y4 =", y[4]) # Parent set fingers to arm def setParent(self, helicity, move, rig, fingers_loc, fingers_rot, middle_finger): bpy.ops.object.mode_set(mode='OBJECT') bpy.context.scene.frame_current = 0 bpy.ops.object.select_all(action='DESELECT') rig.select = True bpy.context.scene.objects.active = rig bpy.ops.object.editmode_toggle() parent_bone = 'y3y4' # choose the bone name which you want to be the parent rig.data.edit_bones.active = rig.data.edit_bones[parent_bone] bpy.ops.object.mode_set(mode='OBJECT') bpy.ops.object.select_all(action='DESELECT') #deselect all objects middle_finger.rig.select = True # bpy.data.objects[move+'.middle.'+ helicity].select = True rig.select = True bpy.context.scene.objects.active = rig #the active object will be the parent of all selected object bpy.ops.object.parent_set(type='BONE', keep_transform=True) bpy.ops.object.select_all(action='DESELECT') #deselect all objects # fingers position middle_finger.rig.location.x += fingers_loc[0] middle_finger.rig.location.y += fingers_loc[1] middle_finger.rig.location.z += fingers_loc[2] middle_finger.rig.rotation_euler = fingers_rot class Finger(Formula): J = 6 #joint number #frame_start = bpy.context.scene.frame_start #frame_end = bpy.context.scene.frame_end #bpy.context.scene.frame_current = frame_end interval = 120 frame_start = 0 frame_end = 120 # Overriding def __init__(self, P, A, move, part, helicity, start, end, y2, y3, y4, y5): # pivot factor self.P = P # scale factor self.A = A # name self.move = move # element self.part = part # element helicity self.helicity = helicity self.start = start self.end = end # phalanx length self.y2 = y2 self.y3 = y3 self.y4 = y4 self.y5 = y5 bpy.ops.object.mode_set(mode='OBJECT') # Create armature and object self.amt = bpy.data.armatures.new(move + '.' + part + '.' + helicity + '.data') self.rig = bpy.data.objects.new(move + '.' + part + '.' + helicity, self.amt) # Joints self.a = [0 for i in range(4)] # Joint α self.b = [0 for i in range(self.J)] # Joint β self.y = [0 for i in range(self.J)] # Joint γ self.o = [0 for i in range(self.J)] # Joint δ # Configuration Movement self.configMovement(self.P, self.A, self.J, self.a, self.b, self.y, self.o, self.y2, self.y3, self.y4, self.y5) # Construction Movement self.constructMovement(self.J, self.helicity, self.amt, self.rig, self.a, self.b, self.y, self.o) # Construction Rotation self.configRotation(self.rig, self.interval, self.frame_start, self.frame_end, self.start, self.end) # Configuration Linkage self.configLink(self.A, self.J, self.helicity, self.rig, self.move, self.part) # Construction Linkage self.constructLink(self.A, self.J, self.helicity, self.rig, self.move, self.part) # Overriding Configuration Movement def configMovement(self, P, A, J, a, b, y, o, y2, y3, y4, y5): a[1] = mathutils.Euler((P, A, 0), 'XYZ') print ("a1 =", a[1]) a[2] = mathutils.Euler((A, -A, 0), 'XYZ') print ("a2 =", a[2]) b[1] = mathutils.Euler((-A, A, 0), 'XYZ') print ("b1 =", b[1]) o[1] = mathutils.Euler((A, A, 0), 'XYZ') print ("o1 =", o[1]) B = A * 2 * sqrt (2) C = B + (B * sqrt (2)) D = C * sqrt (2) E = C + D y[1] = mathutils.Euler((-A, -A, 0), 'XYZ') print ("y1 =", y[1]) y[2] = y2 print ("y2 =", y[2]) y[3] = y3 print ("y3 =", y[3]) y[4] = y4 print ("y4 =", y[4]) y[5] = y5 print ("y5 =", y[5]) b[2] = mathutils.Euler((y[2].x+0.10012, y[2].y+0.170067, 0), 'XYZ') print ("b2 =", b[2]) b[3] = mathutils.Euler((y[3].x-0.12471, y[3].y-0.03395, 0), 'XYZ') print ("b3 =", b[3]) b[4] = mathutils.Euler((y[4].x-0.11426, y[4].y-0.03342, 0), 'XYZ') print ("b4 =", b[4]) o[2] = mathutils.Euler((y[2].x+0.09016, y[2].y+0.142795, 0), 'XYZ') print ("o2 =", o[2]) o[3] = mathutils.Euler((y[3].x+0.07367, y[3].y+0.09711, 0), 'XYZ') print ("o3 =", o[3]) o[4] = mathutils.Euler((y[4].x+0.00899, y[4].y+0.03297, 0), 'XYZ') print ("o4 =", o[4]) def formula(): # pivot factor P = 0 # scale factor A = 1 # name move = 'formula' # element part = 'universe' # left or right helicity = 'left' start = 0 end = start+360 formula = Formula(P, A, move, part, helicity, start, end) def hands(): # name move = 'kungfu' # scale factor A = 0.107 # pivot factor P = -0.048266 # finger element part = 'middle' # phalanx length y2 = mathutils.Euler((1.427, -1.08668, 0), 'XYZ') y3 = mathutils.Euler((2.15534, -1.56395, 0), 'XYZ') y4 = mathutils.Euler((2.67012, -1.90121, 0), 'XYZ') y5 = mathutils.Euler((2.90459, -2.05473, 0), 'XYZ') # config nonlocal global middle_left global middle_right # left finger element helicity = 'left' start = 720-124 end = start middle_left = Finger(P, A, move, part, helicity, start, end, y2, y3, y4, y5) middle_left.rig.location = (0, 0, 0) middle_left.rig.rotation_euler = mathutils.Euler((math.radians(0), math.radians(0), math.radians(0)), 'XYZ') # right finger element helicity = 'right' start = 124 end = start middle_right = Finger(P, A, move, part, helicity, start, end, y2, y3, y4, y5) middle_right.rig.location = (0, 0, 0) middle_right.rig.rotation_euler = mathutils.Euler((math.radians(180-0), math.radians(0), math.radians(0)), 'XYZ') # finger element part = 'ring' y2 = mathutils.Euler((1.36978, -1.04933, 0), 'XYZ') y3 = mathutils.Euler((2.16696, -1.57161, 0), 'XYZ') y4 = mathutils.Euler((2.63809, -1.8803, 0), 'XYZ') y5 = mathutils.Euler((2.87256, -2.03382, 0), 'XYZ') # left finger element helicity = 'left' start = 720-124 end = start ring_left = Finger(P, A, move, part, helicity, start, end, y2, y3, y4, y5) ring_left.rig.location = (-0.010689, 0.001192, 0.241051) ring_left.rig.rotation_euler = mathutils.Euler((math.radians(-5.10153), math.radians(-1.70737), math.radians(0.02464)), 'XYZ') # right finger element helicity = 'right' start = 124 end = start ring_right = Finger(P, A, move, part, helicity, start, end, y2, y3, y4, y5) ring_right.rig.location = (-0.010689, -0.001192, 0.241051) ring_right.rig.rotation_euler = mathutils.Euler((math.radians(180+5.10153), math.radians(-1.70737), math.radians(-0.02464)), 'XYZ') # finger element part = 'little' y2 = mathutils.Euler((1.45986, -1.08525, 0), 'XYZ') y3 = mathutils.Euler((2.10861, -1.50077, 0), 'XYZ') y4 = mathutils.Euler((2.5324, -1.77219, 0), 'XYZ') y5 = mathutils.Euler((2.72302, -1.89418, 0), 'XYZ') # left finger element helicity = 'left' start = 720-124 end = start little_left = Finger(P, A, move, part, helicity, start, end, y2, y3, y4, y5) little_left.rig.location = (-0.020568, 0.002289, 0.463882) little_left.rig.rotation_euler = mathutils.Euler((math.radians(-10.1646), math.radians(-2.09755), math.radians(-0.518101)), 'XYZ') # right finger element helicity = 'right' start = 124 end = start little_right = Finger(P, A, move, part, helicity, start, end, y2, y3, y4, y5) little_right.rig.location = (-0.020568, -0.002289, 0.463882) little_right.rig.rotation_euler = mathutils.Euler((math.radians(180+10.1646), math.radians(-2.09755), math.radians(0.518101)), 'XYZ') # finger element part = 'index' y2 = mathutils.Euler((1.36561, -1.0465, 0), 'XYZ') y3 = mathutils.Euler((2.0559, -1.49887, 0), 'XYZ') y4 = mathutils.Euler((2.52701, -1.80756, 0), 'XYZ') y5 = mathutils.Euler((2.76149, -1.96108, 0), 'XYZ') # left finger element helicity = 'left' start = 720-124 end = start index_left = Finger(P, A, move, part, helicity, start, end, y2, y3, y4, y5) index_left.rig.location = (0.012703, -0.00141, -0.286505) index_left.rig.rotation_euler = mathutils.Euler((math.radians(2.53073), math.radians(2.85122), math.radians(0.320067)), 'XYZ') # right finger element helicity = 'right' start = 124 end = start index_right = Finger(P, A, move, part, helicity, start, end, y2, y3, y4, y5) index_right.rig.location = (0.012703, 0.00141, -0.286505) index_right.rig.rotation_euler = mathutils.Euler((math.radians(180-2.53073), math.radians(2.85122), math.radians(-0.320067)), 'XYZ') # finger element P = -0.075869 #pivot factor start = 124 end = start part = 'thumb' y2 = mathutils.Euler((0.265988, -0.219792, 0), 'XYZ') y3 = mathutils.Euler((1.0999, -0.768173, 0), 'XYZ') y4 = mathutils.Euler((1.71494, -1.17263, 0), 'XYZ') y5 = mathutils.Euler((1.97601, -1.3443, 0), 'XYZ') # left finger element helicity = 'left' start = 720-124 end = start thumb_left = Finger(P, A, move, part, helicity, start, end, y2, y3, y4, y5) thumb_left.rig.location = (0.009956, -0.090396, -0.3247) thumb_left.rig.rotation_euler = mathutils.Euler((math.radians(87.8968), math.radians(-3.16487), math.radians(-23.1096)), 'XYZ') # right finger element helicity = 'right' start = 124 end = start thumb_right = Finger(P, A, move, part, helicity, start, end, y2, y3, y4, y5) thumb_right.rig.location = (0.009956, 0.090396, -0.3247) thumb_right.rig.rotation_euler = mathutils.Euler((math.radians(180-87.8968), math.radians(-3.16487), math.radians(23.1096)), 'XYZ') # Parent set four fingers to middle finger bpy.ops.object.mode_set(mode='OBJECT') bpy.context.scene.frame_current = 0 # left hand bpy.ops.object.select_all(action='DESELECT') middle_left.rig.select = True bpy.context.scene.objects.active = middle_left.rig bpy.ops.object.editmode_toggle() parent_bone = 'a2a1' # choose the bone name which you want to be the parent middle_left.rig.data.edit_bones.active = middle_left.rig.data.edit_bones[parent_bone] bpy.ops.object.mode_set(mode='OBJECT') bpy.ops.object.select_all(action='DESELECT') #deselect all objects ring_left.rig.select = True little_left.rig.select = True index_left.rig.select = True thumb_left.rig.select = True middle_left.rig.select = True bpy.context.scene.objects.active = middle_left.rig #the active object will be the parent of all selected object bpy.ops.object.parent_set(type='BONE', keep_transform=True) # right hand bpy.ops.object.select_all(action='DESELECT') #deselect all objects middle_right.rig.select = True bpy.context.scene.objects.active = middle_right.rig bpy.ops.object.editmode_toggle() parent_bone = 'a2a1' # choose the bone name which you want to be the parent middle_right.rig.data.edit_bones.active = middle_right.rig.data.edit_bones[parent_bone] bpy.ops.object.mode_set(mode='OBJECT') bpy.ops.object.select_all(action='DESELECT') #deselect all objects ring_right.rig.select = True little_right.rig.select = True index_right.rig.select = True thumb_right.rig.select = True middle_right.rig.select = True bpy.context.scene.objects.active = middle_right.rig #the active object will be the parent of all selected object bpy.ops.object.parent_set(type='BONE', keep_transform=True) bpy.ops.object.select_all(action='DESELECT') #deselect all objects def arms(): # scale factor A = 0.473 # pivot factor P = (A * 0.5) # name move = 'kungfu' # arm element part = 'arm' # left arm element helicity = 'left' start = -1138-67+180 end = start+360 fingers_loc = (9.93914, -3.98605, 0.102497) fingers_rot = mathutils.Euler((math.radians(71.0974), math.radians(-37.0012), math.radians(24.6771)), 'XYZ') global middle_left middle_finger = middle_left global arm_left arm_left = Arm(P, A, move, part, helicity, start, end, fingers_loc, fingers_rot, middle_finger) # right arm element helicity = 'right' start = 720-(-1138-67) end = start-360 fingers_loc = (9.93914, -3.98605, 0.102497) fingers_rot = mathutils.Euler((math.radians(-47.5806), math.radians(41.2298), math.radians(26.8721)), 'XYZ') global middle_right middle_finger = middle_right global arm_right arm_right = Arm(P, A, move, part, helicity, start, end, fingers_loc, fingers_rot, middle_finger) def body(): # scale factor A = 1 # pivot factor P = -(A * 0.724843) # name move = 'kungfu' # arm element part = 'body' # helicity of element helicity = 'right' start = 720 - 425 end = start + 360 # start = 295 # end = 632.6244 global arm_left global arm_right arm_left_loc = (2.74172, 4.13548, -0.088542) arm_left_rot = mathutils.Euler((math.radians(-120.006), math.radians(-53.0662), math.radians(148.417)), 'XYZ') arm_right_loc = (-5.56559, 3.16373, -0.440029) arm_right_rot = mathutils.Euler((math.radians(110.568), math.radians(-134.792), math.radians(-131.795)), 'XYZ') global body body = Body(P, A, move, part, helicity, start, end, arm_left_loc, arm_left_rot, arm_left, arm_right_loc, arm_right_rot, arm_right) def pitch(): # scale factor A = 2 # pivot factor P = -1.65 # name move = 'kungfu' # arm element part = 'pitch' # helicity of element helicity = 'left' start = -3170.27 end = -2450.27 global body body_loc = (-2.02365, 1.5293, -2.88764) body_rot = mathutils.Euler((math.radians(11.0558), math.radians(95.1801), math.radians(60.6234)), 'XYZ') global pitch pitch = Pitch(P, A, move, part, helicity, start, end, body_loc, body_rot, body) def yaw(): # scale factor A = 5 # pivot factor P = -4.6 # name move = 'kungfu' # arm element part = 'yaw' # helicity of element helicity = 'left' start = 2084+95 end = 1724+95 global pitch pitch_loc = (-0.588748, -2.53526, 25.8234) pitch_rot = mathutils.Euler((math.radians(90.0), math.radians(45.0), math.radians(-125.0)), 'XYZ') global body yaw_loc = (5.13868, -0.546263, 1.65167) yaw_rot = mathutils.Euler((math.radians(0.0), math.radians(0.0), math.radians(0.0-104.719)), 'XYZ') yaw = Yaw(P, A, move, part, helicity, start, end, yaw_loc, yaw_rot, pitch_loc, pitch_rot, pitch, body) def main(origin): # formula() hands() arms() body() #roll pitch() yaw() if __name__ == "__main__": # renaming of corrada objects # for ob in context.scene.objects: # if "joint_" in ob.name: # ob.name = ob.name.replace("_", ".") main((0,0,0))
38.157009
137
0.560815
22,415
138,281
3.323846
0.032746
0.051756
0.012684
0.032696
0.887201
0.853323
0.807379
0.786025
0.771985
0.754953
0
0.050025
0.260571
138,281
3,623
138
38.167541
0.678628
0.088465
0
0.631715
0
0
0.064185
0.003722
0
0
0
0
0
1
0.014181
false
0
0.002578
0
0.029652
0.054577
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
00f1a90195dc859aa38834bb2958b9eb7af2fd6f
84
py
Python
dask/dataframe/io/parquet/__init__.py
Juanlu001/dask
ba29ba377ae71e5a90fa5ef5198c7d317b45c06a
[ "BSD-3-Clause" ]
9,684
2016-02-12T16:09:21.000Z
2022-03-31T19:38:26.000Z
dask/dataframe/io/parquet/__init__.py
Juanlu001/dask
ba29ba377ae71e5a90fa5ef5198c7d317b45c06a
[ "BSD-3-Clause" ]
7,059
2016-02-11T18:32:45.000Z
2022-03-31T22:12:40.000Z
dask/dataframe/io/parquet/__init__.py
Juanlu001/dask
ba29ba377ae71e5a90fa5ef5198c7d317b45c06a
[ "BSD-3-Clause" ]
1,794
2016-02-13T23:28:39.000Z
2022-03-30T14:33:19.000Z
from .core import create_metadata_file, read_parquet, read_parquet_part, to_parquet
42
83
0.869048
13
84
5.153846
0.769231
0.328358
0
0
0
0
0
0
0
0
0
0
0.083333
84
1
84
84
0.87013
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
dafbc3bec26a74b4d432d63450fc177a7ba0d8ac
103
py
Python
common/views.py
vanflymen/Twenty-One
1b425dd11a53b135ead5e6d721980b22f4a54672
[ "MIT" ]
3
2017-01-06T20:01:12.000Z
2021-04-07T10:59:26.000Z
common/views.py
vanflymen/Twenty-One
1b425dd11a53b135ead5e6d721980b22f4a54672
[ "MIT" ]
null
null
null
common/views.py
vanflymen/Twenty-One
1b425dd11a53b135ead5e6d721980b22f4a54672
[ "MIT" ]
2
2019-09-17T18:36:56.000Z
2021-04-17T13:48:31.000Z
from django.shortcuts import render, redirect def index(request): return redirect('habit:index')
17.166667
45
0.757282
13
103
6
0.846154
0
0
0
0
0
0
0
0
0
0
0
0.145631
103
5
46
20.6
0.886364
0
0
0
0
0
0.106796
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
9757253d8495985fe04a747cc7fc9f38d1b08559
16,968
py
Python
servicedirectory/src/sd-api/classes/tests/tests_serializers.py
ealogar/servicedirectory
fb4f4bfa8b499b93c03af589ef2f34c08a830b17
[ "Apache-2.0" ]
null
null
null
servicedirectory/src/sd-api/classes/tests/tests_serializers.py
ealogar/servicedirectory
fb4f4bfa8b499b93c03af589ef2f34c08a830b17
[ "Apache-2.0" ]
null
null
null
servicedirectory/src/sd-api/classes/tests/tests_serializers.py
ealogar/servicedirectory
fb4f4bfa8b499b93c03af589ef2f34c08a830b17
[ "Apache-2.0" ]
null
null
null
''' (c) Copyright 2013 Telefonica, I+D. Printed in Spain (Europe). All Rights Reserved. The copyright to the software program(s) is property of Telefonica I+D. The program(s) may be used and or copied only with the express written consent of Telefonica I+D or in accordance with the terms and conditions stipulated in the agreement/contract under which the program(s) have been supplied. ''' from unittest import TestCase from mock import MagicMock, patch from commons.json_schema_validator.schema_reader import SchemaField from bson.objectid import ObjectId from classes.serializers import ServiceInstanceSerializer, ServiceClassCollectionSerializer,\ ServiceClassItemSerializer from commons.json_schema_validator.schema_reader import SchemaReader from re import match class InstancesSerializerTests(TestCase): def setUp(self): super(InstancesSerializerTests, self).setUp() mock_schema_instance = MagicMock(name='mock_schema_instance') mock_schema_instance.return_value = [ SchemaField(name='uri', field_type='string', required=True, min_length=1, max_length=2048), SchemaField(name='version', field_type='string', required=True, min_length=1, max_length=256), SchemaField(name='environment', field_type='string', required=False, min_length=1, max_length=512, default='production'), SchemaField(name='class_name', field_type='string', required=True, min_length=1, max_length=512) ] # mock schema instance schema_reader = SchemaReader() self.patcher_validate = patch.object(schema_reader, 'validate_object') # @UndefinedVariable self.patcher_schema = patch.object(schema_reader, # @UndefinedVariable 'get_schema_fields', mock_schema_instance) self.patcher_schema.start() self.patcher_validate.start() def tearDown(self): self.patcher_schema.stop() self.patcher_validate.stop() def test_deserialize_instance_should_work(self): serializer = ServiceInstanceSerializer(data={'uri': 'url_test', 'version': '1.0', 'environment': 'test', 'class_name': 'test_class'}) self.assertEquals(True, serializer.is_valid(), "Serialization invalid") def test_serialize_valid_instance_should_work(self): id_ = ObjectId() serializer = ServiceInstanceSerializer({'uri': 'url_test', 'version': '1.0', 'environment': 'test', 'class_name': 'test_class', '_id': id_}) self.assertEquals(serializer.data['id'], str(id_)) def test_deserialize_instance_empty_params_should_return_invalid(self): serializer = ServiceInstanceSerializer(data={'uri': '', 'version': '1.0', 'environment': 'test', 'class_name': 'test_class'}) self.assertEquals(False, serializer.is_valid(), "Deserialization invalid") self.assertEquals(serializer.errors['uri'][0], 'invalid') serializer = ServiceInstanceSerializer(data={'uri': 'url_test', 'version': '', 'environment': 'test', 'class_name': 'test_class'}) self.assertEquals(False, serializer.is_valid(), "Deserialization invalid") self.assertEquals(serializer.errors['version'][0], 'invalid') serializer = ServiceInstanceSerializer(data={'uri': 'url_test', 'version': '1.0', 'environment': 'test', 'class_name': ''}) self.assertEquals(False, serializer.is_valid(), "Deserialization invalid") self.assertEquals(serializer.errors['class_name'][0], 'invalid') def test_deserialize_instance_null_required_params_should_return_required(self): serializer = ServiceInstanceSerializer(data={'version': '1.0', 'environment': 'test', 'class_name': 'test_class'}) self.assertEquals(False, serializer.is_valid(), "Deserialization invalid") self.assertEquals(serializer.errors['uri'][0], 'required') serializer = ServiceInstanceSerializer(data={'version': '1.0', 'environment': 'test', 'class_name': 'test_class', 'uri': None}) self.assertEquals(False, serializer.is_valid(), "Deserialization invalid") self.assertEquals(serializer.errors['uri'][0], 'required') serializer = ServiceInstanceSerializer(data={'uri': 'url_test', 'environment': 'test', 'class_name': 'test_class'}) self.assertEquals(False, serializer.is_valid(), "Deserialization invalid") self.assertEquals(serializer.errors['version'][0], 'required') serializer = ServiceInstanceSerializer(data={'uri': 'url_test', 'version': '1.0', 'environment': 'test'}) self.assertEquals(False, serializer.is_valid(), "Deserialization invalid") self.assertEquals(serializer.errors['class_name'][0], 'required') def test_deserialize_instance_large_params_should_return_invalid(self): serializer = ServiceInstanceSerializer(data={'uri': 'a' * 2500, 'version': '1.0', 'environment': 'test', 'class_name': 'test_class'}) self.assertEquals(False, serializer.is_valid(), "Deserialization invalid") self.assertEquals(serializer.errors['uri'][0], 'invalid') serializer = ServiceInstanceSerializer(data={'uri': 'url_test', 'version': 'v' * 300, 'environment': 'test', 'class_name': 'test_class'}) self.assertEquals(False, serializer.is_valid(), "Deserialization invalid") self.assertEquals(serializer.errors['version'][0], 'invalid') serializer = ServiceInstanceSerializer(data={'uri': 'url_test', 'version': '1.0', 'environment': 'test', 'class_name': 'a' * 600}) self.assertEquals(False, serializer.is_valid(), "Deserialization invalid") self.assertEquals(serializer.errors['class_name'][0], 'invalid') def test_deserialize_instance_with_attributes_should_work(self): serializer = ServiceInstanceSerializer(data={'uri': 'url_test', 'version': '1.0', 'environment': 'test', 'class_name': 'test_class', 'attributes': {'key': 'keyvalue'}}) self.assertEquals(True, serializer.is_valid(), "Serialization invalid") def test_deserialize_several_instances_with_attributes_should_work(self): serializer_lists = [ {'uri': 'url_test', 'version': '1.0', 'environment': 'test', 'class_name': 'test_class', 'attributes': {'key': 'keyvalue'}}, {'uri': 'url_test2', 'version': '1.0', 'environment': 'test', 'class_name': 'test_class', 'attributes': {'key_dos': 'keyvalue'}} ] serializer = ServiceInstanceSerializer(data=serializer_lists, many=True) self.assertEquals(True, serializer.is_valid(), "Serialization invalid") # Ensure that attributes keys are not included when null data is given self.assertTrue('key_dos' not in serializer.data[0]['attributes'], 'key_dos is present in attributes') self.assertTrue('key' not in serializer.data[1]['attributes'], 'key is present in attributes') def test_deserialize_instance_with_invalid_attributes_should_give_error(self): serializer = ServiceInstanceSerializer(data={'uri': 'url_test', 'version': '1.0', 'environment': 'test', 'class_name': 'test_class', 'attributes': {'key': 1}}) self.assertEquals(False, serializer.is_valid()) self.assertEquals("Invalid parameter value: 1", serializer.errors['attributes'][0], 'Invalid error message') def test_deserialize_instance_with_uppercase_attributes_should_give_error(self): serializer = ServiceInstanceSerializer(data={'uri': 'url_test', 'version': '1.0', 'environment': 'test', 'class_name': 'test_class', 'attributes': {'KEY': '1'}}) self.assertEquals(False, serializer.is_valid()) self.assertEquals("Invalid parameter value: KEY", serializer.errors['attributes'][0], 'Invalid error message') def test_deserialize_instance_with_null_attributes_should_give_error(self): serializer = ServiceInstanceSerializer(data={'uri': 'url_test', 'version': '1.0', 'environment': 'test', 'class_name': 'test_class', 'attributes': None }) self.assertEquals(False, serializer.is_valid()) self.assertEquals("Invalid parameter value: null", serializer.errors['attributes'][0], 'Invalid error message') def test_deserialize_instance_with_bad_format_attributes_should_give_error(self): serializer = ServiceInstanceSerializer(data={'uri': 'url_test', 'version': '1.0', 'environment': 'test', 'class_name': 'test_class', 'attributes': 25 }) self.assertEquals(False, serializer.is_valid()) self.assertEquals("Invalid parameter value: 25", serializer.errors['attributes'][0], 'Invalid error message') def test_deserialize_instance_with_wrong_size_attributes_should_give_error(self): attributes = dict((str(e), str(e)) for e in range(129)) serializer = ServiceInstanceSerializer(data={'uri': 'url_test', 'version': '1.0', 'environment': 'test', 'class_name': 'test_class', 'attributes': attributes }) self.assertEquals(False, serializer.is_valid()) self.assertTrue(match("Invalid parameter value: {*", serializer.errors['attributes'][0])) def test_deserialize_instance_with_wrong_key_size_attributes_should_give_error(self): attributes = {'': 'value'} serializer = ServiceInstanceSerializer(data={'uri': 'url_test', 'version': '1.0', 'environment': 'test', 'class_name': 'test_class', 'attributes': attributes }) self.assertEquals(False, serializer.is_valid()) self.assertTrue(match("Invalid parameter value: empty-string", serializer.errors['attributes'][0])) attributes = {'k' * 513: 'value'} serializer = ServiceInstanceSerializer(data={'uri': 'url_test', 'version': '1.0', 'environment': 'test', 'class_name': 'test_class', 'attributes': attributes }) self.assertEquals(False, serializer.is_valid()) self.assertTrue(match("Invalid parameter value: {0}".format('k' * 513), serializer.errors['attributes'][0])) def test_deserialize_instance_with_wrong_value_size_attributes_should_give_error(self): attributes = {'kye': ''} serializer = ServiceInstanceSerializer(data={'uri': 'url_test', 'version': '1.0', 'environment': 'test', 'class_name': 'test_class', 'attributes': attributes }) self.assertEquals(False, serializer.is_valid()) self.assertTrue(match("invalid", serializer.errors['attributes'][0]['kye'][0])) attributes = {'key': 'k' * 513} serializer = ServiceInstanceSerializer(data={'uri': 'url_test', 'version': '1.0', 'environment': 'test', 'class_name': 'test_class', 'attributes': attributes }) self.assertEquals(False, serializer.is_valid()) self.assertTrue(match("invalid", serializer.errors['attributes'][0]['key'][0])) def test_deserialize_instance_with_bad_format_url_should_give_error(self): serializer = ServiceInstanceSerializer(data={'uri': 1, 'version': '1.0', 'environment': 'test', 'class_name': 'test_class'}) self.assertEquals(False, serializer.is_valid()) self.assertEquals("invalid", serializer.errors['uri'][0], 'Invalid error message') def test_deserialize_instance_with_empty_string_environment_should_give_error(self): serializer = ServiceInstanceSerializer(data={'uri': "http", 'version': '1.0', 'environment': '', 'class_name': 'test_class'}) self.assertEquals(False, serializer.is_valid()) self.assertEquals("invalid", serializer.errors['environment'][0], 'Invalid error message') class ClassesSerializerTests(TestCase): def setUp(self): super(ClassesSerializerTests, self).setUp() mock_schema_instance = MagicMock(name='mock_schema_instance') mock_schema_instance.return_value = [ SchemaField(name='_id', field_type='string', required=True, min_length=1, max_length=512), SchemaField(name='description', field_type='string', required=False), SchemaField(name='default_version', field_type='string', required=True, min_length=1, max_length=256) ] mock_get_schema_fields = MagicMock(name='mock_get_schema') mock_get_schema_fields.return_value = mock_schema_instance # mock schema instance schema_reader = SchemaReader() self.patcher_validate = patch.object(schema_reader, 'validate_object') # @UndefinedVariable self.patcher_schema = patch.object(schema_reader, # @UndefinedVariable 'get_schema_fields', mock_schema_instance) self.patcher_schema.start() self.patcher_validate.start() def tearDown(self): self.patcher_schema.stop() self.patcher_validate.stop() def test_deserialize_class_should_work(self): # We need to do import here in order generic patches work serializer = ServiceClassCollectionSerializer(data={'class_name': 'class_test', 'default_version': '1.0', 'description': 'test'}) self.assertEquals(True, serializer.is_valid(), "Serialization invalid") def test_deserialize_class_empty_class_name_should_give_error_invalid(self): # We need to do import here in order generic patches work serializer = ServiceClassCollectionSerializer(data={'class_name': '', 'version': '1.0', 'description': 'test'}) self.assertEquals(False, serializer.is_valid(), "Serialization invalid") self.assertEquals(u"invalid", serializer.errors['class_name'][0], 'Invalid error message') def test_deserialize_class_null_class_name_should_give_required_error(self): # We need to do import here in order generic patches work serializer = ServiceClassCollectionSerializer(data={'default_version': '1.0', 'description': 'test'}) self.assertEquals(False, serializer.is_valid(), "Serialization invalid") self.assertEquals(u"required", serializer.errors['class_name'][0], 'Invalid error message') def test_deserialize_class_large_user_ne_should_give_invalid_error(self): # We need to do import here in order generic patches work serializer = ServiceClassCollectionSerializer(data={'class_name': 'a' * 600, 'default_version': '1.0', 'description': 'test'}) self.assertEquals(False, serializer.is_valid(), "Serialization invalid") self.assertEquals(u"invalid", serializer.errors['class_name'][0], 'Invalid error message') def test_serialize_class_item_should_return_class_name(self): # We need to do import here in order generic patches work serializer = ServiceClassItemSerializer({'_id': 'my_class', 'default_version': '1.0', 'description': 'test'}) self.assertTrue('class_name' in serializer.data, 'class_name not returned')
59.328671
119
0.605787
1,631
16,968
6.077866
0.112201
0.077474
0.025421
0.058106
0.80571
0.791688
0.781802
0.759609
0.726924
0.707556
0
0.012016
0.274104
16,968
285
120
59.536842
0.792807
0.050212
0
0.565789
0
0
0.198733
0
0
0
0
0
0.245614
1
0.109649
false
0
0.030702
0
0.149123
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
97896605f94b2b9815b4eec103d0e79022b4737e
29
py
Python
07_debug_exceptions_testing/entropy/__init__.py
UWSEDS/lecture-materials
42f24ce191efc4a193ac4a84e067519045f7f7c3
[ "BSD-2-Clause" ]
null
null
null
07_debug_exceptions_testing/entropy/__init__.py
UWSEDS/lecture-materials
42f24ce191efc4a193ac4a84e067519045f7f7c3
[ "BSD-2-Clause" ]
null
null
null
07_debug_exceptions_testing/entropy/__init__.py
UWSEDS/lecture-materials
42f24ce191efc4a193ac4a84e067519045f7f7c3
[ "BSD-2-Clause" ]
4
2020-10-09T01:07:19.000Z
2020-12-11T23:11:35.000Z
from .entropy import entropy
14.5
28
0.827586
4
29
6
0.75
0
0
0
0
0
0
0
0
0
0
0
0.137931
29
1
29
29
0.96
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
8ae7cffe61a2e3b67f1d98d3ccd23249c93da3f8
2,790
py
Python
CEC/ideal_F.py
ZongSingHuang/Metaheuristic-benchmark
a454ee02ffe206d925a6193a60cf6bcb772213a0
[ "MIT" ]
null
null
null
CEC/ideal_F.py
ZongSingHuang/Metaheuristic-benchmark
a454ee02ffe206d925a6193a60cf6bcb772213a0
[ "MIT" ]
null
null
null
CEC/ideal_F.py
ZongSingHuang/Metaheuristic-benchmark
a454ee02ffe206d925a6193a60cf6bcb772213a0
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ Created on Thu Aug 26 15:01:28 2021 @author: zongsing.huang """ def Sphere(): return 0.0 def Rastrigin(): return 0.0 def Ackley(): return 0.0 def Griewank(): return 0.0 def Schwefel_P222(): return 0.0 def Rosenbrock(): return 0.0 def Sehwwefel_P221(): return 0.0 def Quartic(): return 0.0 def Schwefel_P12(): return 0.0 def Penalized1(): return 0.0 def Penalized2(): return 0.0 def Schwefel_226(D): return -418.982887272433799807913601398*D def Step(): return 0 def Kowalik(): return 0.00030748610 def ShekelFoxholes(): return 0.998003837794449325873406851315 def GoldsteinPrice(): return 3 def Shekel(m=5): if m==5: return -10.1532 if m==7: return -10.4029 if m==10: return -10.5364 def Branin(): return 0.39788735772973816 def Hartmann3(): return -3.86278214782076 def SixHumpCamelBack(): return -1.031628453489877 def Hartmann6(): return -3.32236801141551 def Zakharov(): return 0.0 def SumSquares(): return 0.0 def Alpine(): return 0.0 def Michalewicz(D): if D==1: return -0.801303410098552549 if D==2: return -1.80130341009855321 if D==5: return -4.687658 if D==10: return -9.66015 def Exponential(): return -1.0 def Schaffer(): return 0.0 def BentCigar(): return 0.0 def Bohachevsky1(): return 0.0 def Elliptic(): return 0.0 def DropWave(): return -1.0 def CosineMixture(D): return -0.1*D def Ellipsoidal(): return 0.0 def LevyandMontalvo1(): return 0.0 #%% def Easom(): return -1.0 def SumofDifferentPower(): return 0.0 def LevyandMontalvo2(): return 0.0 def Holzman(): return 0.0 def XinSheYang1(): return -1.0 def XinSheYang6(): return -1.0 def Beale(): return 0.0 def Shubert(): return -186.7309 def InvertedCosineMixture(): return 0.0 def Salomon(): return 0.0 def Matyas(): return 0.0 def Leon(): return 0.0 def Paviani(): return -45.7784684040686 def Sinusoidal(): return -3.5 def ktablet(): return 0.0 def NoncontinuousRastrigin(): return 0.0 def Fletcher(): pass def Levy(): return 0.0 def Davis(): return 0.0 def Pathological(): return 0.0 def Schwefel_P220(): return 0.0 def Booth(): return 0.0 def Zettl(): return -0.003791237220468656 def PowellQuartic(): return 0.0 def Tablet(): return 0.0 def Brown(): return 0.0 def ChungReynolds(): return 0.0 def Csendes(): return 0.0 def Bohachevsky2(): return 0.0 def Bohachevsky3(): return 0.0 def Colville(): return 0.0 def BartelsConn(): return 1.0 def Bird(): return -106.7645367198034
12.624434
45
0.62043
394
2,790
4.380711
0.307107
0.202781
0.199305
0.274044
0.044032
0
0
0
0
0
0
0.2
0.258065
2,790
221
46
12.624434
0.633816
0.030466
0
0.328767
0
0
0
0
0
0
0
0
0
1
0.458904
false
0.006849
0
0.438356
0.945205
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
1
0
0
0
1
1
0
0
6
8af3e0b2f22116348f4996e037e2fc3b8297536e
256
py
Python
hubspot/marketing/transactional/api/__init__.py
Ronfer/hubspot-api-python
1c87274ecbba4aa3c7728f890ccc6e77b2b6d2e4
[ "Apache-2.0" ]
117
2020-04-06T08:22:53.000Z
2022-03-18T03:41:29.000Z
hubspot/marketing/transactional/api/__init__.py
Ronfer/hubspot-api-python
1c87274ecbba4aa3c7728f890ccc6e77b2b6d2e4
[ "Apache-2.0" ]
62
2020-04-06T16:21:06.000Z
2022-03-17T16:50:44.000Z
hubspot/marketing/transactional/api/__init__.py
Ronfer/hubspot-api-python
1c87274ecbba4aa3c7728f890ccc6e77b2b6d2e4
[ "Apache-2.0" ]
45
2020-04-06T16:13:52.000Z
2022-03-30T21:33:17.000Z
from __future__ import absolute_import # flake8: noqa # import apis into api package from hubspot.marketing.transactional.api.public_smtp_tokens_api import PublicSmtpTokensApi from hubspot.marketing.transactional.api.single_send_api import SingleSendApi
32
90
0.867188
33
256
6.424242
0.606061
0.103774
0.188679
0.311321
0.339623
0
0
0
0
0
0
0.004292
0.089844
256
7
91
36.571429
0.905579
0.160156
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
8afe00c79d21ea37a05f2b67de714d2fc75b4224
182
py
Python
microsetta_private_api/db/hotfix_vioscreen.py
charles-cowart/microsetta-private-api
96d3c09c8e30e00c87ce82c5e7d16ba4eb93ce74
[ "BSD-3-Clause" ]
4
2020-02-28T22:40:42.000Z
2021-03-01T03:31:04.000Z
microsetta_private_api/db/hotfix_vioscreen.py
charles-cowart/microsetta-private-api
96d3c09c8e30e00c87ce82c5e7d16ba4eb93ce74
[ "BSD-3-Clause" ]
248
2019-12-30T17:05:25.000Z
2022-03-09T02:46:46.000Z
microsetta_private_api/db/hotfix_vioscreen.py
charles-cowart/microsetta-private-api
96d3c09c8e30e00c87ce82c5e7d16ba4eb93ce74
[ "BSD-3-Clause" ]
9
2019-10-29T04:50:27.000Z
2021-11-30T19:02:03.000Z
from microsetta_private_api.LEGACY.sql_connection import TRN from microsetta_private_api.db.migration_support import MigrationSupport with TRN: MigrationSupport.migrate_82(TRN)
30.333333
72
0.868132
24
182
6.291667
0.666667
0.18543
0.278146
0.317881
0
0
0
0
0
0
0
0.012048
0.087912
182
5
73
36.4
0.89759
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
c1224345de63ec3ed3cc8056a60b06018916b8bc
64
py
Python
inverter.py
JDJGInc/JDJGBotSupreme
fd8a5679f05cb90ebec8dbfc297445f9773ebe5f
[ "MIT" ]
4
2020-07-10T04:02:23.000Z
2021-02-13T16:38:54.000Z
inverter.py
JDJGInc/JDJGBotSupreme
fd8a5679f05cb90ebec8dbfc297445f9773ebe5f
[ "MIT" ]
3
2021-07-13T15:38:39.000Z
2022-02-15T15:17:17.000Z
inverter.py
johndpope/JDJGBotSupreme
64fde0e169811e1866eb29174ac5dd8e052d830a
[ "MIT" ]
2
2020-08-01T11:15:09.000Z
2022-02-15T11:46:22.000Z
from PIL import Image,ImageOps def invert(image): return image
21.333333
30
0.796875
10
64
5.1
0.8
0
0
0
0
0
0
0
0
0
0
0
0.140625
64
3
31
21.333333
0.927273
0
0
0
0
0
0
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
c169aac9f971b8706f81fbd94ca68908c42e196e
78
py
Python
balderdash/__init__.py
charleskubicek/balderdash
0ddd1ac2ed7de1fff7afd41697d32220e3a41779
[ "Apache-2.0" ]
5
2015-06-29T10:47:11.000Z
2020-12-19T20:22:26.000Z
balderdash/__init__.py
charleskubicek/balderdash
0ddd1ac2ed7de1fff7afd41697d32220e3a41779
[ "Apache-2.0" ]
5
2016-02-16T20:51:24.000Z
2021-04-08T09:29:07.000Z
balderdash/__init__.py
charleskubicek/balderdash
0ddd1ac2ed7de1fff7afd41697d32220e3a41779
[ "Apache-2.0" ]
7
2016-02-16T10:21:37.000Z
2021-04-07T16:38:53.000Z
# coding=utf-8 from . import kibana as kibana from . import grafana as grafana
26
32
0.769231
13
78
4.615385
0.615385
0.333333
0
0
0
0
0
0
0
0
0
0.015385
0.166667
78
3
32
26
0.907692
0.153846
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
c1a5616f018e69445da384d988ac242347244509
83
py
Python
Object detection and depth estimation/catkin_ws/devel/lib/python2.7/dist-packages/race/msg/__init__.py
UF-f1tenth/F1tenth-UFL
93b0a822c67b2b425664642955342138e65974f4
[ "Apache-2.0" ]
null
null
null
Object detection and depth estimation/catkin_ws/devel/lib/python2.7/dist-packages/race/msg/__init__.py
UF-f1tenth/F1tenth-UFL
93b0a822c67b2b425664642955342138e65974f4
[ "Apache-2.0" ]
null
null
null
Object detection and depth estimation/catkin_ws/devel/lib/python2.7/dist-packages/race/msg/__init__.py
UF-f1tenth/F1tenth-UFL
93b0a822c67b2b425664642955342138e65974f4
[ "Apache-2.0" ]
null
null
null
from ._drive_param import * from ._drive_values import * from ._pid_input import *
20.75
28
0.783133
12
83
4.916667
0.583333
0.305085
0
0
0
0
0
0
0
0
0
0
0.144578
83
3
29
27.666667
0.830986
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
c1b0c75304a7d207e5218cc2a9572573d4093ac9
49
py
Python
social/backends/uber.py
raccoongang/python-social-auth
81c0a542d158772bd3486d31834c10af5d5f08b0
[ "BSD-3-Clause" ]
1,987
2015-01-01T16:12:45.000Z
2022-03-29T14:24:25.000Z
social/backends/uber.py
raccoongang/python-social-auth
81c0a542d158772bd3486d31834c10af5d5f08b0
[ "BSD-3-Clause" ]
731
2015-01-01T22:55:25.000Z
2022-03-10T15:07:51.000Z
virtual/lib/python3.6/site-packages/social/backends/uber.py
dennismwaniki67/awards
80ed10541f5f751aee5f8285ab1ad54cfecba95f
[ "MIT" ]
1,082
2015-01-01T16:27:26.000Z
2022-03-22T21:18:33.000Z
from social_core.backends.uber import UberOAuth2
24.5
48
0.877551
7
49
6
1
0
0
0
0
0
0
0
0
0
0
0.022222
0.081633
49
1
49
49
0.911111
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
c1d56551c42a54a66b94ebd084f374696dfbd562
15,119
py
Python
off_django/migrations/0001_initial.py
klorophyl/openfoodfacts-django
696e701355af9911e726c5579eacca8989f4c629
[ "Apache-2.0" ]
1
2022-02-02T19:54:34.000Z
2022-02-02T19:54:34.000Z
off_django/migrations/0001_initial.py
klorophyl/openfoodfacts-django
696e701355af9911e726c5579eacca8989f4c629
[ "Apache-2.0" ]
null
null
null
off_django/migrations/0001_initial.py
klorophyl/openfoodfacts-django
696e701355af9911e726c5579eacca8989f4c629
[ "Apache-2.0" ]
1
2021-12-27T20:40:18.000Z
2021-12-27T20:40:18.000Z
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import off_django.models_extensions class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='OFFFood', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('code', models.TextField(default=None, null=True, db_index=True)), ('url', models.TextField(default=None, null=True)), ('creator', models.TextField(default=None, null=True)), ('created_t', models.IntegerField(default=None, null=True)), ('created_datetime', models.DateTimeField(default=None, null=True)), ('last_modified_t', models.IntegerField(default=None, null=True)), ('last_modified_datetime', models.DateTimeField(default=None, null=True)), ('product_name', models.TextField(default=None, null=True)), ('generic_name', models.TextField(default=None, null=True)), ('quantity', models.TextField(default=None, null=True)), ('packaging', off_django.models_extensions.ListField(default=None, null=True)), ('packaging_tags', off_django.models_extensions.ListField(default=None, null=True)), ('brands', off_django.models_extensions.ListField(default=None, null=True)), ('brands_tags', off_django.models_extensions.ListField(default=None, null=True)), ('categories', off_django.models_extensions.ListField(default=None, null=True)), ('categories_en', off_django.models_extensions.ListField(default=None, null=True)), ('categories_tags', off_django.models_extensions.ListField(default=None, null=True)), ('origins', off_django.models_extensions.ListField(default=None, null=True)), ('origins_tags', off_django.models_extensions.ListField(default=None, null=True)), ('manufacturing_places', off_django.models_extensions.ListField(default=None, null=True)), ('manufacturing_places_tags', off_django.models_extensions.ListField(default=None, null=True)), ('labels', off_django.models_extensions.ListField(default=None, null=True)), ('labels_en', off_django.models_extensions.ListField(default=None, null=True)), ('labels_tags', off_django.models_extensions.ListField(default=None, null=True)), ('emb_codes', models.TextField(default=None, null=True)), ('emb_codes_tags', off_django.models_extensions.ListField(default=None, null=True)), ('first_packaging_code_geo', off_django.models_extensions.ListField(default=None, null=True)), ('cities', off_django.models_extensions.ListField(default=None, null=True)), ('cities_tags', off_django.models_extensions.ListField(default=None, null=True)), ('purchase_places', off_django.models_extensions.ListField(default=None, null=True)), ('stores', off_django.models_extensions.ListField(default=None, null=True)), ('countries', off_django.models_extensions.ListField(default=None, null=True)), ('countries_en', off_django.models_extensions.ListField(default=None, null=True)), ('countries_tags', off_django.models_extensions.ListField(default=None, null=True)), ('ingredients_text', off_django.models_extensions.ListField(default=None, null=True)), ('traces', off_django.models_extensions.ListField(default=None, null=True)), ('traces_en', off_django.models_extensions.ListField(default=None, null=True)), ('traces_tags', off_django.models_extensions.ListField(default=None, null=True)), ('additives', off_django.models_extensions.ListField(default=None, null=True)), ('additives_en', off_django.models_extensions.ListField(default=None, null=True)), ('additives_n', models.IntegerField(default=None, null=True)), ('additives_tags', off_django.models_extensions.ListField(default=None, null=True)), ('allergens', off_django.models_extensions.ListField(default=None, null=True)), ('allergens_en', off_django.models_extensions.ListField(default=None, null=True)), ('image_small_url', models.TextField(default=None, null=True)), ('image_url', models.TextField(default=None, null=True)), ('ingredients_from_palm_oil', off_django.models_extensions.ListField(default=None, null=True)), ('ingredients_from_palm_oil_n', models.IntegerField(default=None, null=True)), ('ingredients_from_palm_oil_tags', off_django.models_extensions.ListField(default=None, null=True)), ('ingredients_that_may_be_from_palm_oil', off_django.models_extensions.ListField(default=None, null=True)), ('ingredients_that_may_be_from_palm_oil_n', models.IntegerField(default=None, null=True)), ('ingredients_that_may_be_from_palm_oil_tags', off_django.models_extensions.ListField(default=None, null=True)), ('main_category', models.TextField(default=None, null=True)), ('main_category_en', models.TextField(default=None, null=True)), ('no_nutriments', models.TextField(default=None, null=True)), ('nutrition_grade_fr', models.CharField(default=None, max_length=1, null=True)), ('nutrition_grade_uk', models.CharField(default=None, max_length=1, null=True)), ('pnns_groups_1', models.TextField(default=None, null=True)), ('pnns_groups_2', models.TextField(default=None, null=True)), ('serving_size', models.TextField(default=None, null=True)), ('states', off_django.models_extensions.ListField(default=None, null=True)), ('states_en', off_django.models_extensions.ListField(default=None, null=True)), ('states_tags', off_django.models_extensions.ListField(default=None, null=True)), ('_alpha_linolenic_acid_100g', models.FloatField(default=None, null=True)), ('_arachidic_acid_100g', models.FloatField(default=None, null=True)), ('_arachidonic_acid_100g', models.FloatField(default=None, null=True)), ('_behenic_acid_100g', models.FloatField(default=None, null=True)), ('_butyric_acid_100g', models.FloatField(default=None, null=True)), ('_capric_acid_100g', models.FloatField(default=None, null=True)), ('_caproic_acid_100g', models.FloatField(default=None, null=True)), ('_caprylic_acid_100g', models.FloatField(default=None, null=True)), ('_cerotic_acid_100g', models.FloatField(default=None, null=True)), ('_dihomo_gamma_linolenic_acid_100g', models.FloatField(default=None, null=True)), ('_docosahexaenoic_acid_100g', models.FloatField(default=None, null=True)), ('_eicosapentaenoic_acid_100g', models.FloatField(default=None, null=True)), ('_elaidic_acid_100g', models.FloatField(default=None, null=True)), ('_erucic_acid_100g', models.FloatField(default=None, null=True)), ('_fructose_100g', models.FloatField(default=None, null=True)), ('_gamma_linolenic_acid_100g', models.FloatField(default=None, null=True)), ('_glucose_100g', models.FloatField(default=None, null=True)), ('_gondoic_acid_100g', models.FloatField(default=None, null=True)), ('_lactose_100g', models.FloatField(default=None, null=True)), ('_lauric_acid_100g', models.FloatField(default=None, null=True)), ('_lignoceric_acid_100g', models.FloatField(default=None, null=True)), ('_linoleic_acid_100g', models.FloatField(default=None, null=True)), ('_maltodextrins_100g', models.FloatField(default=None, null=True)), ('_maltose_100g', models.FloatField(default=None, null=True)), ('_mead_acid_100g', models.FloatField(default=None, null=True)), ('_melissic_acid_100g', models.FloatField(default=None, null=True)), ('_montanic_acid_100g', models.FloatField(default=None, null=True)), ('_myristic_acid_100g', models.FloatField(default=None, null=True)), ('_nervonic_acid_100g', models.FloatField(default=None, null=True)), ('_oleic_acid_100g', models.FloatField(default=None, null=True)), ('_palmitic_acid_100g', models.FloatField(default=None, null=True)), ('_stearic_acid_100g', models.FloatField(default=None, null=True)), ('_sucrose_100g', models.FloatField(default=None, null=True)), ('alcohol_100g', models.FloatField(default=None, null=True)), ('beta_carotene_100g', models.FloatField(default=None, null=True)), ('beta_glucan_100g', models.FloatField(default=None, null=True)), ('bicarbonate_100g', models.FloatField(default=None, null=True)), ('biotin_100g', models.FloatField(default=None, null=True)), ('caffeine_100g', models.FloatField(default=None, null=True)), ('calcium_100g', models.FloatField(default=None, null=True)), ('carbohydrates_100g', models.FloatField(default=None, null=True)), ('carbon_footprint_100g', models.FloatField(default=None, null=True)), ('carnitine_100g', models.FloatField(default=None, null=True)), ('casein_100g', models.FloatField(default=None, null=True)), ('chloride_100g', models.FloatField(default=None, null=True)), ('chlorophyl_100g', models.FloatField(default=None, null=True)), ('cholesterol_100g', models.FloatField(default=None, null=True)), ('choline_100g', models.FloatField(default=None, null=True)), ('chromium_100g', models.FloatField(default=None, null=True)), ('cocoa_100g', models.FloatField(default=None, null=True)), ('collagen_meat_protein_ratio_100g', models.FloatField(default=None, null=True)), ('copper_100g', models.FloatField(default=None, null=True)), ('energy_100g', models.FloatField(default=None, null=True)), ('energy_from_fat_100g', models.FloatField(default=None, null=True)), ('fat_100g', models.FloatField(default=None, null=True)), ('fiber_100g', models.FloatField(default=None, null=True)), ('fluoride_100g', models.FloatField(default=None, null=True)), ('folates_100g', models.FloatField(default=None, null=True)), ('fruits_vegetables_nuts_100g', models.FloatField(default=None, null=True)), ('fruits_vegetables_nuts_estimate_100g', models.FloatField(default=None, null=True)), ('glycemic_index_100g', models.FloatField(default=None, null=True)), ('inositol_100g', models.FloatField(default=None, null=True)), ('iodine_100g', models.FloatField(default=None, null=True)), ('iron_100g', models.FloatField(default=None, null=True)), ('magnesium_100g', models.FloatField(default=None, null=True)), ('manganese_100g', models.FloatField(default=None, null=True)), ('molybdenum_100g', models.FloatField(default=None, null=True)), ('monounsaturated_fat_100g', models.FloatField(default=None, null=True)), ('nucleotides_100g', models.FloatField(default=None, null=True)), ('nutrition_score_fr_100g', models.FloatField(default=None, null=True)), ('nutrition_score_uk_100g', models.FloatField(default=None, null=True)), ('omega_3_fat_100g', models.FloatField(default=None, null=True)), ('omega_6_fat_100g', models.FloatField(default=None, null=True)), ('omega_9_fat_100g', models.FloatField(default=None, null=True)), ('pantothenic_acid_100g', models.FloatField(default=None, null=True)), ('ph_100g', models.FloatField(default=None, null=True)), ('phosphorus_100g', models.FloatField(default=None, null=True)), ('phylloquinone_100g', models.FloatField(default=None, null=True)), ('polyols_100g', models.FloatField(default=None, null=True)), ('polyunsaturated_fat_100g', models.FloatField(default=None, null=True)), ('potassium_100g', models.FloatField(default=None, null=True)), ('proteins_100g', models.FloatField(default=None, null=True)), ('salt_100g', models.FloatField(default=None, null=True)), ('saturated_fat_100g', models.FloatField(default=None, null=True)), ('selenium_100g', models.FloatField(default=None, null=True)), ('serum_proteins_100g', models.FloatField(default=None, null=True)), ('silica_100g', models.FloatField(default=None, null=True)), ('sodium_100g', models.FloatField(default=None, null=True)), ('starch_100g', models.FloatField(default=None, null=True)), ('sugars_100g', models.FloatField(default=None, null=True)), ('taurine_100g', models.FloatField(default=None, null=True)), ('trans_fat_100g', models.FloatField(default=None, null=True)), ('vitamin_a_100g', models.FloatField(default=None, null=True)), ('vitamin_b12_100g', models.FloatField(default=None, null=True)), ('vitamin_b1_100g', models.FloatField(default=None, null=True)), ('vitamin_b2_100g', models.FloatField(default=None, null=True)), ('vitamin_b6_100g', models.FloatField(default=None, null=True)), ('vitamin_b9_100g', models.FloatField(default=None, null=True)), ('vitamin_c_100g', models.FloatField(default=None, null=True)), ('vitamin_d_100g', models.FloatField(default=None, null=True)), ('vitamin_e_100g', models.FloatField(default=None, null=True)), ('vitamin_k_100g', models.FloatField(default=None, null=True)), ('vitamin_pp_100g', models.FloatField(default=None, null=True)), ('water_hardness_100g', models.FloatField(default=None, null=True)), ('zinc_100g', models.FloatField(default=None, null=True)), ], options={ 'verbose_name': 'OFFFood - Model for Open Food Facts food product', }, ), ]
78.744792
128
0.636484
1,619
15,119
5.704756
0.136504
0.200087
0.269597
0.34149
0.869749
0.862603
0.818861
0.579905
0.343872
0.301321
0
0.028007
0.223031
15,119
191
129
79.157068
0.758236
0.001389
0
0
0
0
0.176272
0.045244
0
0
0
0
0
1
0
false
0
0.016216
0
0.032432
0.005405
0
0
0
null
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
de01db1620da02a39d9df1806996099ebff78cb8
407
py
Python
dependencies/dependency.py
elondon/TheDeployer
0d36f064f55244145aa5859d914a7257fa758b89
[ "MIT" ]
null
null
null
dependencies/dependency.py
elondon/TheDeployer
0d36f064f55244145aa5859d914a7257fa758b89
[ "MIT" ]
null
null
null
dependencies/dependency.py
elondon/TheDeployer
0d36f064f55244145aa5859d914a7257fa758b89
[ "MIT" ]
null
null
null
from abc import ABCMeta, abstractmethod class Dependency: def __init__(self, dep_config): self.dependency_name = dep_config['name'] self.config = dep_config __metaclass__ = ABCMeta @abstractmethod def install(self): pass @abstractmethod def configure(self): pass @abstractmethod def uninstall(self): pass @abstractmethod def update(self): pass
18.5
49
0.683047
44
407
6.045455
0.431818
0.255639
0.24812
0.281955
0
0
0
0
0
0
0
0
0.240786
407
21
50
19.380952
0.860841
0
0
0.285714
0
0
0.009828
0
0
0
0
0
0
1
0.357143
false
0.285714
0.071429
0
0.571429
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
1
0
1
0
0
1
0
0
6
de02b7c9044490329822c8cd7ebbf5d677cb294c
231
py
Python
tests/classes/nonnull_user.py
Jesse-Yung/jsonclasses
d40c52aec42bcb978a80ceb98b93ab38134dc790
[ "MIT" ]
50
2021-08-18T08:08:04.000Z
2022-03-20T07:23:26.000Z
tests/classes/nonnull_user.py
Jesse-Yung/jsonclasses
d40c52aec42bcb978a80ceb98b93ab38134dc790
[ "MIT" ]
1
2021-02-21T03:18:09.000Z
2021-03-08T01:07:52.000Z
tests/classes/nonnull_user.py
Jesse-Yung/jsonclasses
d40c52aec42bcb978a80ceb98b93ab38134dc790
[ "MIT" ]
8
2021-07-01T02:39:15.000Z
2021-12-10T02:20:18.000Z
from __future__ import annotations from jsonclasses import jsonclass, types @jsonclass class NonnullUser: name: str = types.str.writenonnull.required nickname: str = types.str.writenonnull.default('KuiPêkBvang').required
25.666667
74
0.792208
26
231
6.884615
0.615385
0.089385
0.122905
0.256983
0
0
0
0
0
0
0
0
0.12987
231
8
75
28.875
0.890547
0
0
0
0
0
0.047619
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.833333
0
1
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
a9ba6628be23e35f0ea7a772bc88739c445be057
22,960
py
Python
tests/tests.py
nitely/sakaio
b43a0f96d0f2ab72f38d8dea69a480570742498b
[ "MIT" ]
1
2018-09-08T21:42:38.000Z
2018-09-08T21:42:38.000Z
tests/tests.py
nitely/sakaio
b43a0f96d0f2ab72f38d8dea69a480570742498b
[ "MIT" ]
null
null
null
tests/tests.py
nitely/sakaio
b43a0f96d0f2ab72f38d8dea69a480570742498b
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- import asyncio import logging import asynctest import unittest import sakaio from sakaio.sakaio import _chain_exceptions class WasteException(Exception): pass class SomeOtherException(Exception): pass async def waste_cycles(cycles): for _ in range(cycles): await asyncio.sleep(0) def call_later(cycles, callback): async def _call_later(): await waste_cycles(cycles) callback() loop = asyncio.get_event_loop() return loop.create_task(_call_later()) # XXX make public? class Waster: """Waste event loop cycles""" def __init__(self): self.completion_order = [] self.cancelled = [] async def waste(self, name, *, cycles, raise_err=False, ignore_cancel=False): """ Waste cycles, record execution order, raise some exception and ignore cancellation """ try: await waste_cycles(cycles) except asyncio.CancelledError: if not ignore_cancel: self.cancelled.append(name) raise await waste_cycles(cycles) if raise_err: raise WasteException(str(name)) self.completion_order.append(name) return name class ChainExceptionsTest(unittest.TestCase): def test_chain(self): try: raise SomeOtherException('A') except SomeOtherException as err: ex1 = err try: raise SomeOtherException('B') except SomeOtherException as err: ex2 = err err = _chain_exceptions([ex1, ex2]) self.assertEqual(err, ex2) self.assertEqual(err.__context__, ex1) self.assertIsNone(err.__context__.__context__) with self.assertRaises(SomeOtherException): raise err def test_chain_nested(self): try: raise SomeOtherException('A') except SomeOtherException as err: ex1 = err try: raise SomeOtherException('B') except SomeOtherException as err: ex2 = err try: raise SomeOtherException('C') except SomeOtherException as err: ex3 = err err = _chain_exceptions([ex2, ex3]) self.assertEqual(err, ex3) self.assertEqual(err.__context__, ex2) self.assertEqual(err.__context__.__context__, ex1) self.assertIsNone(err.__context__.__context__.__context__) with self.assertRaises(SomeOtherException): raise err def test_chain_from(self): try: raise SomeOtherException('A') except SomeOtherException as err: ex1 = err try: raise SomeOtherException('B') from ex1 except SomeOtherException as err: ex2 = err err = _chain_exceptions([ex2]) self.assertEqual(err, ex2) self.assertEqual(err.__context__, ex1) self.assertIsNone(err.__context__.__context__) with self.assertRaises(SomeOtherException): raise err def test_chain_simple(self): try: raise SomeOtherException('A') except SomeOtherException as err: ex1 = err err = _chain_exceptions([ex1, ex1]) self.assertEqual(err, ex1) self.assertIsNone(err.__context__) with self.assertRaises(SomeOtherException): raise err def test_chain_dups(self): try: raise SomeOtherException('A') except SomeOtherException as err: ex1 = err try: raise SomeOtherException('B') except SomeOtherException as err: ex2 = err err = _chain_exceptions([ex1, ex2, ex1, ex2]) self.assertEqual(err, ex2) self.assertEqual(err.__context__, ex1) self.assertIsNone(err.__context__.__context__) with self.assertRaises(SomeOtherException): raise err def test_chain_dups_nested(self): try: raise SomeOtherException('A') except SomeOtherException as err: ex1 = err try: raise SomeOtherException('B') except SomeOtherException as err: ex2 = err err = _chain_exceptions([ex1, ex2, ex1, ex2]) self.assertEqual(err, ex2) self.assertEqual(err.__context__, ex1) self.assertIsNone(err.__context__.__context__) with self.assertRaises(SomeOtherException): raise err def test_chain_dups_from(self): try: raise SomeOtherException('A') except SomeOtherException as err: ex1 = err try: raise SomeOtherException('B') from ex1 except SomeOtherException as err: ex2 = err err = _chain_exceptions([ex2, ex2]) self.assertEqual(err, ex2) self.assertEqual(err.__cause__, ex1) self.assertEqual(err.__context__, ex1) self.assertIsNone(err.__context__.__context__) with self.assertRaises(SomeOtherException): raise err class ConcurrentSequentialTest(asynctest.TestCase): def setUp(self): self.waster = Waster() async def test_concurrent(self): """ Should run the coros concurrently and\ return the results in the coros order """ results = await sakaio.concurrent( self.waster.waste('A', cycles=20), self.waster.waste('B', cycles=10), self.waster.waste('C', cycles=30), self.waster.waste('D', cycles=40), self.waster.waste('E', cycles=15)) self.assertEqual(results, [ 'A', 'B', 'C', 'D', 'E']) self.assertEqual(self.waster.completion_order, [ 'B', 'E', 'A', 'C', 'D']) async def test_sequential(self): """ Should run the coros sequentially and\ return the results in the coros order """ results = await sakaio.sequential( self.waster.waste('A', cycles=20), self.waster.waste('B', cycles=10), self.waster.waste('C', cycles=30), self.waster.waste('D', cycles=40), self.waster.waste('E', cycles=15)) self.assertEqual(results, [ 'A', 'B', 'C', 'D', 'E']) self.assertEqual(self.waster.completion_order, [ 'A', 'B', 'C', 'D', 'E']) async def test_sequential_concurrent(self): """ Should run coros sequentially/concurrently as given """ results = await sakaio.concurrent( self.waster.waste("A", cycles=30), self.waster.waste("B", cycles=20), sakaio.sequential( self.waster.waste("C", cycles=40), sakaio.concurrent( self.waster.waste("D", cycles=50), self.waster.waste("E", cycles=20)), self.waster.waste("F", cycles=10))) self.assertEqual(results, [ 'A', 'B', 'C', 'D', 'E', 'F']) self.assertEqual(self.waster.completion_order, [ 'B', 'A', 'C', 'E', 'D', 'F']) async def test_concurrent_err(self): with self.assertRaises(WasteException) as cm: await sakaio.concurrent( self.waster.waste('Z', cycles=300, raise_err=True, ignore_cancel=True), self.waster.waste('X', cycles=200, ignore_cancel=True), self.waster.waste('A', cycles=20), self.waster.waste('B', cycles=10), self.waster.waste('C', cycles=30, raise_err=True), self.waster.waste('D', cycles=40), # won't run self.waster.waste('E', cycles=15)) self.assertIsInstance(cm.exception, WasteException) self.assertEqual(str(cm.exception), "Z") self.assertIsInstance(cm.exception.__context__, WasteException) self.assertEqual(str(cm.exception.__context__), "C") self.assertIsNone(cm.exception.__context__.__context__) self.assertEqual(self.waster.completion_order, [ 'B', 'E', 'A', 'X']) async def test_concurrent_err_ret(self): results = await sakaio.concurrent( self.waster.waste('A', cycles=20), self.waster.waste('B', cycles=10), self.waster.waste('C', cycles=30, raise_err=True), self.waster.waste('D', cycles=40), self.waster.waste('E', cycles=15), exception_handling=sakaio.RETURN_EXCEPTIONS) self.assertEqual(results[:2], [ 'A', 'B']) self.assertTrue(isinstance(results[2], WasteException)) self.assertEqual(results[3:], [ 'D', 'E']) self.assertEqual(self.waster.completion_order, [ 'B', 'E', 'A', 'D']) async def test_concurrent_cancel_inner(self): c_task = self.loop.create_task( self.waster.waste('C', cycles=30)) call_later(cycles=15, callback=c_task.cancel) task = self.loop.create_task(sakaio.concurrent( self.waster.waste('X', cycles=200, ignore_cancel=True), self.waster.waste('A', cycles=20), self.waster.waste('B', cycles=10), c_task, self.waster.waste('D', cycles=40), self.waster.waste('E', cycles=15))) # Same behaviour as asyncio.gather with self.assertRaises(asyncio.CancelledError): await task self.assertTrue(task.cancelled()) self.assertEqual(self.waster.completion_order, ['B', 'E', 'A', 'D', 'X']) async def test_concurrent_cancel_inner_ret(self): c_task = self.loop.create_task( self.waster.waste('C', cycles=30)) call_later(cycles=15, callback=c_task.cancel) results = await sakaio.concurrent( self.waster.waste('A', cycles=20), self.waster.waste('B', cycles=10), c_task, self.waster.waste('D', cycles=40), self.waster.waste('E', cycles=15), exception_handling=sakaio.RETURN_EXCEPTIONS) self.assertEqual(results[:2], [ 'A', 'B']) self.assertIsInstance(results[2], asyncio.CancelledError) self.assertEqual(results[3:], [ 'D', 'E']) self.assertEqual(self.waster.completion_order, [ 'B', 'E', 'A', 'D']) async def test_concurrent_cancel_outer(self): task = self.loop.create_task(sakaio.concurrent( self.waster.waste('X', cycles=200, ignore_cancel=True), self.waster.waste('A', cycles=20), self.waster.waste('B', cycles=10), self.waster.waste('C', cycles=30), self.waster.waste('D', cycles=40), self.waster.waste('E', cycles=15))) call_later(cycles=5, callback=task.cancel) with self.assertRaises(asyncio.CancelledError): await task self.assertTrue(task.cancelled()) self.assertEqual(self.waster.completion_order, ['X']) async def test_concurrent_cancel_outer_ret(self): task = self.loop.create_task(sakaio.concurrent( self.waster.waste('X', cycles=200, ignore_cancel=True), self.waster.waste('A', cycles=20), self.waster.waste('B', cycles=10), self.waster.waste('C', cycles=30), self.waster.waste('D', cycles=40), self.waster.waste('E', cycles=15), exception_handling=sakaio.RETURN_EXCEPTIONS)) call_later(cycles=5, callback=task.cancel) with self.assertRaises(asyncio.CancelledError): await task self.assertTrue(task.cancelled()) self.assertEqual(self.waster.completion_order, ['X']) async def test_sequential_err(self): with self.assertRaises(WasteException): await sakaio.sequential( self.waster.waste('A', cycles=20), self.waster.waste('B', cycles=10), self.waster.waste('C', cycles=30, raise_err=True), self.waster.waste('D', cycles=40), # won't run self.waster.waste('E', cycles=15)) # won't run await waste_cycles(200) self.assertEqual(self.waster.completion_order, [ 'A', 'B']) async def test_sequential_err_ret(self): results = await sakaio.sequential( self.waster.waste('A', cycles=20), self.waster.waste('B', cycles=10), self.waster.waste('C', cycles=30, raise_err=True), self.waster.waste('D', cycles=40), self.waster.waste('E', cycles=15), return_exceptions=True) await waste_cycles(200) self.assertEqual(results[:2], [ 'A', 'B']) self.assertIsInstance(results[2], WasteException) self.assertEqual(results[3:], [ 'D', 'E']) self.assertEqual(self.waster.completion_order, [ 'A', 'B', 'D', 'E']) async def test_sequential_cancel_inner(self): c_task = self.loop.create_task( self.waster.waste('C', cycles=30)) task = self.loop.create_task(sakaio.sequential( self.waster.waste('A', cycles=20), self.waster.waste('B', cycles=10), c_task, self.waster.waste('D', cycles=40), self.waster.waste('E', cycles=15))) await waste_cycles(12) c_task.cancel() with self.assertRaises(asyncio.CancelledError): await task self.assertTrue(task.cancelled()) self.assertEqual(self.waster.completion_order, ['A', 'B', 'D', 'E']) async def test_sequential_cancel_inner_ret(self): c_task = self.loop.create_task( self.waster.waste('C', cycles=30)) task = sakaio.sequential( self.waster.waste('A', cycles=20), self.waster.waste('B', cycles=10), c_task, self.waster.waste('D', cycles=40), self.waster.waste('E', cycles=15), return_exceptions=True) await waste_cycles(5) c_task.cancel() results = await task await waste_cycles(200) self.assertEqual(len(results), 5) self.assertEqual(results[:2], [ 'A', 'B']) print(results[2]) self.assertIsInstance(results[2], asyncio.CancelledError) self.assertEqual(results[3:], [ 'D', 'E']) self.assertEqual(self.waster.completion_order, [ 'A', 'B', 'D', 'E']) async def test_sequential_cancel_outer(self): task = self.loop.create_task(sakaio.sequential( self.waster.waste('A', cycles=20), self.waster.waste('B', cycles=10), self.waster.waste('C', cycles=30), self.waster.waste('D', cycles=40), self.waster.waste('E', cycles=15))) await waste_cycles(5) task.cancel() with self.assertRaises(asyncio.CancelledError): await task await waste_cycles(200) self.assertEqual(self.waster.completion_order, []) async def test_sequential_cancel_outer_ret(self): task = self.loop.create_task(sakaio.sequential( self.waster.waste('A', cycles=20), self.waster.waste('B', cycles=10), self.waster.waste('C', cycles=30), self.waster.waste('D', cycles=40), self.waster.waste('E', cycles=15), return_exceptions=True)) await waste_cycles(5) task.cancel() with self.assertRaises(asyncio.CancelledError): await task await waste_cycles(200) self.assertEqual(self.waster.completion_order, []) async def test_gather_behaviour(self): task_c = self.loop.create_task(self.waster.waste('C', cycles=30)) call_later(cycles=10, callback=task_c.cancel) async def gather(): await asyncio.gather( self.waster.waste('A', cycles=20), self.waster.waste('B', cycles=10), task_c, self.waster.waste('D', cycles=40), self.waster.waste('E', cycles=15)) task = self.loop.create_task(gather()) with self.assertRaises(asyncio.CancelledError): await task await waste_cycles(200) self.assertTrue(task.cancelled()) self.assertEqual(self.waster.completion_order, ['B', 'E', 'A', 'D']) async def test_gather_behaviour_ret(self): task_c = self.loop.create_task(self.waster.waste('C', cycles=30)) task = asyncio.gather( self.waster.waste('A', cycles=20), self.waster.waste('B', cycles=10), task_c, self.waster.waste('D', cycles=40), self.waster.waste('E', cycles=15), return_exceptions=True) await waste_cycles(5) task_c.cancel() result = await task await waste_cycles(200) self.assertEqual(result[:2], ['A', 'B']) self.assertIsInstance(result[2], asyncio.CancelledError) self.assertEqual(result[3:], ['D', 'E']) self.assertEqual(self.waster.completion_order, ['B', 'E', 'A', 'D']) class TaskGuardTest(asynctest.TestCase): def setUp(self): self.waster = Waster() async def test_guard(self): loop = asyncio.get_event_loop() async with sakaio.TaskGuard(loop) as guard: guard.create_task(self.waster.waste('C', cycles=30)) guard.create_task(self.waster.waste('A', cycles=10)) guard.create_task(self.waster.waste('B', cycles=20)) self.assertEqual(self.waster.completion_order, ['A', 'B', 'C']) async def test_guard_err(self): loop = asyncio.get_event_loop() with self.assertRaises(WasteException): async with sakaio.TaskGuard(loop) as guard: guard.create_task(self.waster.waste('D', cycles=200, ignore_cancel=True)) guard.create_task(self.waster.waste('C', cycles=30)) # will get cancelled guard.create_task(self.waster.waste('A', cycles=10)) guard.create_task(self.waster.waste('B', cycles=20, raise_err=True)) self.assertEqual(self.waster.completion_order, ['A', 'D']) async def test_guard_err_outside_err(self): loop = asyncio.get_event_loop() with self.assertRaises(WasteException): async with sakaio.TaskGuard(loop) as guard: # all get cancelled guard.create_task(self.waster.waste('D', cycles=200, ignore_cancel=True)) guard.create_task(self.waster.waste('C', cycles=30)) guard.create_task(self.waster.waste('A', cycles=10)) guard.create_task(self.waster.waste('B', cycles=20)) await waste_cycles(1) raise WasteException() self.assertEqual(self.waster.completion_order, ['D']) async def test_guard_err_inside_err(self): loop = asyncio.get_event_loop() with self.assertRaises(WasteException) as cm: async with sakaio.TaskGuard(loop) as guard: guard.create_task(self.waster.waste('D', cycles=200, ignore_cancel=True)) guard.create_task(self.waster.waste('C', cycles=30)) guard.create_task(self.waster.waste('A', cycles=10)) t = guard.create_task(self.waster.waste('B', cycles=20, raise_err=True)) await t # raises raise SomeOtherException("should not raise this") self.assertIsNone(cm.exception.__context__) # No SomeOtherException self.assertEqual(self.waster.completion_order, ['A', 'D']) async def test_guard_err_mixed_err(self): loop = asyncio.get_event_loop() with self.assertRaises(SomeOtherException) as cm: async with sakaio.TaskGuard(loop) as guard: guard.create_task(self.waster.waste('D', cycles=200, ignore_cancel=True)) guard.create_task(self.waster.waste('C', cycles=30)) # gets cancelled guard.create_task(self.waster.waste('A', cycles=10)) t = guard.create_task(self.waster.waste('B', cycles=20, raise_err=True)) await asyncio.wait([t], loop=loop) raise SomeOtherException() # gets raised as well self.assertIsInstance(cm.exception.__context__, WasteException) self.assertEqual(self.waster.completion_order, ['A', 'D']) async def test_guard_cancel_some_task(self): loop = asyncio.get_event_loop() async with sakaio.TaskGuard(loop) as guard: guard.create_task(self.waster.waste('C', cycles=30)) guard.create_task(self.waster.waste('A', cycles=10)) t = guard.create_task(self.waster.waste('B', cycles=20)) t.cancel() self.assertEqual(self.waster.completion_order, ['A', 'C']) async def test_guard_cancel_outer_task(self): async def task_guard(): loop = asyncio.get_event_loop() async with sakaio.TaskGuard(loop) as guard: guard.create_task(self.waster.waste('D', cycles=200, ignore_cancel=True)) guard.create_task(self.waster.waste('C', cycles=30)) guard.create_task(self.waster.waste('A', cycles=10)) guard.create_task(self.waster.waste('B', cycles=20)) task = self.loop.create_task(task_guard()) call_later(cycles=15, callback=task.cancel) await asyncio.wait([task], loop=self.loop) self.assertTrue(task.cancelled()) self.assertEqual(self.waster.completion_order, ['A', 'D']) class CancelAllTasksTest(asynctest.TestCase): def setUp(self): self.waster = Waster() async def test_cancel_all_tasks(self): loop = asyncio.get_event_loop() t1 = loop.create_task(self.waster.waste('A', cycles=100)) t2 = loop.create_task(self.waster.waste('B', cycles=200)) assert t1 and t2 # shut up lint await waste_cycles(10) await sakaio.cancel_all_tasks(raise_timeout_error=True) self.assertEqual(self.waster.cancelled, ['A', 'B']) self.assertFalse(self.waster.completion_order) async def test_cancel_all_tasks_timeout(self): terminate = False async def never_ending(): nonlocal terminate while True: try: await waste_cycles(1) except asyncio.CancelledError: pass if terminate: return loop = asyncio.get_event_loop() t1 = loop.create_task(never_ending()) await waste_cycles(10) with self.assertRaises(asyncio.TimeoutError), \ self.assertLogs('sakaio', logging.WARNING): await sakaio.cancel_all_tasks(timeout=0, raise_timeout_error=True) terminate = True await t1 if __name__ == '__main__': asynctest.main()
38.202995
90
0.591289
2,631
22,960
5
0.062714
0.112505
0.13569
0.054884
0.842797
0.787685
0.757963
0.737666
0.714557
0.697453
0
0.022303
0.283319
22,960
600
91
38.266667
0.77715
0.010453
0
0.693676
0
0
0.012513
0
0
0
0
0
0.203557
1
0.023715
false
0.005929
0.011858
0
0.055336
0.001976
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
a9e073e10fabe88b3d31671d9108961f0105c28b
52,683
py
Python
tests/test_elasticsearch.py
campagnucci/querido-diario-api
6d44baa4b2d60b0762dc72cbf3ce7170298c11a8
[ "MIT" ]
null
null
null
tests/test_elasticsearch.py
campagnucci/querido-diario-api
6d44baa4b2d60b0762dc72cbf3ce7170298c11a8
[ "MIT" ]
null
null
null
tests/test_elasticsearch.py
campagnucci/querido-diario-api
6d44baa4b2d60b0762dc72cbf3ce7170298c11a8
[ "MIT" ]
null
null
null
from datetime import date, timedelta, datetime from unittest import TestCase, skip, skipIf, skipUnless from unittest.mock import patch, MagicMock import os import unittest import uuid import time import elasticsearch from index import ElasticSearchDataMapper, create_elasticsearch_data_mapper from gazettes import GazetteDataGateway, Gazette FILE_ENDPOINT = "http://test.com" class ElasticSearchInterfaceTest(TestCase): @patch("elasticsearch.Elasticsearch") def test_create_elasticsearch_mapper(self, es_mock): mapper = create_elasticsearch_data_mapper("localhost", "gazettes") self.assertIsInstance(mapper, GazetteDataGateway) @patch("elasticsearch.Elasticsearch") @unittest.expectedFailure def test_create_elasticsearch_mapper_should_fail_without_host(self, es_mock): create_elasticsearch_data_mapper() @patch("elasticsearch.Elasticsearch") def test_create_elasticsearch_mapper_without_host(self, es_mock): with self.assertRaisesRegex(Exception, "Missing host") as cm: mapper = create_elasticsearch_data_mapper("", "gazettes") @patch("elasticsearch.Elasticsearch") def test_create_elasticsearch_mapper_without_index_name(self, es_mock): with self.assertRaisesRegex(Exception, "Missing index name") as cm: mapper = create_elasticsearch_data_mapper("localhost") def configure_es_mock_to_return_itself_in_the_es_constructor( self, es_mock, indices_mock ): es_mock.indices = indices_mock es_mock.return_value = es_mock @patch("elasticsearch.Elasticsearch") @patch("elasticsearch.client.IndicesClient") def test_create_elasticsearch_mapper_using_non_existing_index_should_fail( self, indices_mock, es_mock ): indices_mock.exists.return_value = False self.configure_es_mock_to_return_itself_in_the_es_constructor( es_mock, indices_mock ) with self.assertRaisesRegex(Exception, "Index does not exist") as cm: create_elasticsearch_data_mapper("localhost", "zpto") class ElasticSearchBaseTestCase(TestCase): INDEX = "gazettes" _data = [] def build_expected_query( self, since=None, until=None, keywords=None, territory_id=None, offset=0, size=10, ): query = { "query": {"bool": {"must": [], "should": [],}}, "from": offset, "size": size, "sort": [{"date": {"order": "desc"}}], "highlight": { "fields": { "source_text": { "fragment_size": 150, "number_of_fragments": 1, "type": "unified", "pre_tags": [""], "post_tags": [""], } } }, } date_query = {"range": {"date": {}}} if since: date_query["range"]["date"]["gte"] = since.strftime("%Y-%m-%d") if until: date_query["range"]["date"]["lte"] = until.strftime("%Y-%m-%d") if since or until: query["query"]["bool"]["must"].append(date_query) if territory_id: query["query"]["bool"]["must"].append( {"term": {"territory_id": territory_id}} ) if since or until or territory_id: return query return {"query": {"match_none": {}}} def setUp(self): self.es_mock = self.create_patch("elasticsearch.Elasticsearch") self.indices_mock = self.create_patch("elasticsearch.client.IndicesClient") self.generate_data() self._mapper = ElasticSearchDataMapper("localhost", self.INDEX) self.configure_es_mock_to_return_itself_in_the_es_constructor() self.set_mock_search_return() def create_patch(self, name): patcher = patch(name) self.addCleanup(patcher.stop) return patcher.start() def configure_es_mock_to_return_itself_in_the_es_constructor(self): self.es_mock.indices = self.indices_mock self.es_mock = self.es_mock.return_value def set_mock_search_return(self): hits = [ { "_index": "", "_type": "_doc", "_id": hit["file_checksum"], "_score": None, "_source": hit, "highlight": {"source_text": []}, } for hit in self._data ] self.es_mock.search.return_value = { "took": 4, "timed_out": False, "_shards": {"total": 1, "successful": 1, "skipped": 0, "failed": 0}, "hits": { "total": {"value": len(self._data), "relation": "eq"}, "max_score": None, "hits": hits, }, } def get_latest_gazettes_files(self, gazettes_count): self._data.sort(reverse=True, key=lambda x: x["date"]) return [ Gazette( d["territory_id"], datetime.strptime(d["date"], "%Y-%m-%d").date(), d["url"], d["file_checksum"], d["territory_name"], d["state_code"], d["highlight_texts"], d["edition_number"], d["is_extra_edition"], ) for d in self._data[:gazettes_count] ] def get_expected_document_page(self, page_number, page_size): end_slice = start_slice + page_size total_documents = len(self._data) expected_gazettes = self.get_latest_gazettes_files(total_documents) return expected_gazettes[start_slice:end_slice] class ElasticSearchDataMapperTest(ElasticSearchBaseTestCase): TERRITORY_ID1 = "3304557" TERRITORY_ID2 = "4205902" TERRITORY_ID3 = "4205919" TERRITORY_ID4 = "4205920" maxDiff = None def generate_data(self): week_ago = date.today() - timedelta(days=7) day = timedelta(days=1) self._data = [ { "source_text": "This is a fake gazette content", "date": datetime.strftime(date.today(), "%Y-%m-%d"), "edition_number": None, "is_extra_edition": False, "power": "executive", "file_checksum": "2566f0e0ff98d899ee0633da64bc65e5", "file_path": "3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "url": f"{FILE_ENDPOINT}/3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "file_url": "https://doweb.rio.rj.gov.br/portal/edicoes/download/4067", "scraped_at": "2020-10-30T07:04:29.796347", "created_at": "2020-10-30T07:05:33.094289", "territory_id": self.TERRITORY_ID1, "territory_name": "Rio de Janeiro", "state_code": "RJ", "edition_number": "123.456", "is_extra_edition": False, "highlight_texts": [], }, { "source_text": "This is a fake gazette content", "date": datetime.strftime(date.today() - day, "%Y-%m-%d"), "edition_number": None, "is_extra_edition": False, "power": "executive", "file_checksum": "2566f0e0ff98d899ee0633da64bc65e52", "file_path": "3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "url": f"{FILE_ENDPOINT}/3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "file_url": "https://doweb.rio.rj.gov.br/portal/edicoes/download/4067", "scraped_at": "2020-10-30T07:04:29.796347", "created_at": "2020-10-30T07:05:33.094289", "territory_id": self.TERRITORY_ID2, "territory_name": "Rio de Janeiro", "state_code": "RJ", "edition_number": "123.456", "is_extra_edition": False, "highlight_texts": [], }, { "source_text": "This is a fake gazette content", "date": datetime.strftime(date.today() + day, "%Y-%m-%d"), "edition_number": None, "is_extra_edition": False, "power": "executive", "file_checksum": "2566f0e0ff98d899ee0633da64bc65e53", "file_path": "3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "url": f"{FILE_ENDPOINT}/3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "file_url": "https://doweb.rio.rj.gov.br/portal/edicoes/download/4067", "scraped_at": "2020-10-30T07:04:29.796347", "created_at": "2020-10-30T07:05:33.094289", "territory_id": self.TERRITORY_ID2, "territory_name": "Rio de Janeiro", "state_code": "RJ", "edition_number": "123.456", "is_extra_edition": False, "highlight_texts": [], }, { "source_text": "This is a fake gazette content. anotherkeyword", "date": datetime.strftime(date.today() - day, "%Y-%m-%d"), "edition_number": None, "is_extra_edition": False, "power": "executive", "file_checksum": "2566f0e0ff98d899ee0633da64bc65e54", "file_path": "3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "url": f"{FILE_ENDPOINT}/3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "file_url": "https://doweb.rio.rj.gov.br/portal/edicoes/download/4067", "scraped_at": "2020-10-30T07:04:29.796347", "created_at": "2020-10-30T07:05:33.094289", "territory_id": self.TERRITORY_ID1, "territory_name": "Rio de Janeiro", "state_code": "RJ", "edition_number": "123.456", "is_extra_edition": False, "highlight_texts": [], }, { "source_text": "This is a fake gazette content. keyword1", "date": datetime.strftime(date.today() + day, "%Y-%m-%d"), "edition_number": None, "is_extra_edition": False, "power": "executive", "file_checksum": "2566f0e0ff98d899ee0633da64bc65e55", "file_path": "3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "url": f"{FILE_ENDPOINT}/3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "file_url": "https://doweb.rio.rj.gov.br/portal/edicoes/download/4067", "scraped_at": "2020-10-30T07:04:29.796347", "created_at": "2020-10-30T07:05:33.094289", "territory_id": self.TERRITORY_ID2, "territory_name": "Rio de Janeiro", "state_code": "RJ", "edition_number": "123.456", "is_extra_edition": False, "highlight_texts": [], }, { "source_text": "This is a fake gazette with some keywork which is: 000.000.000-00", "date": datetime.strftime(date.today(), "%Y-%m-%d"), "edition_number": None, "is_extra_edition": False, "power": "executive", "file_checksum": "2566f0e0ff98d899ee0633da64bc65e56", "file_path": "3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "url": f"{FILE_ENDPOINT}/3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "file_url": "https://doweb.rio.rj.gov.br/portal/edicoes/download/4067", "scraped_at": "2020-10-30T07:04:29.796347", "created_at": "2020-10-30T07:05:33.094289", "territory_id": self.TERRITORY_ID1, "territory_name": "Rio de Janeiro", "state_code": "RJ", "edition_number": "123.456", "is_extra_edition": False, "highlight_texts": [], }, { "source_text": "This is a fake gazette content from ID 6", "date": datetime.strftime(week_ago - day, "%Y-%m-%d"), "edition_number": None, "is_extra_edition": False, "power": "executive", "file_checksum": "2566f0e0ff98d899ee0633da64bc65e57", "file_path": "3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "url": f"{FILE_ENDPOINT}/3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "file_url": "https://doweb.rio.rj.gov.br/portal/edicoes/download/4067", "scraped_at": "2020-10-30T07:04:29.796347", "created_at": "2020-10-30T07:05:33.094289", "territory_id": self.TERRITORY_ID3, "territory_name": "Rio de Janeiro", "state_code": "RJ", "edition_number": "123.456", "is_extra_edition": False, "highlight_texts": [], }, { "source_text": "This is a fake gazette content from ID 7", "date": datetime.strftime(week_ago, "%Y-%m-%d"), "edition_number": None, "is_extra_edition": False, "power": "executive", "file_checksum": "2566f0e0ff98d899ee0633da64bc65e58", "file_path": "3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "url": f"{FILE_ENDPOINT}/3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "file_url": "https://doweb.rio.rj.gov.br/portal/edicoes/download/4067", "scraped_at": "2020-10-30T07:04:29.796347", "created_at": "2020-10-30T07:05:33.094289", "territory_id": self.TERRITORY_ID3, "territory_name": "Rio de Janeiro", "state_code": "RJ", "edition_number": "123.456", "is_extra_edition": False, "highlight_texts": [], }, { "source_text": "This is a fake gazette content from ID 8", "date": datetime.strftime(week_ago + day, "%Y-%m-%d"), "edition_number": None, "is_extra_edition": False, "power": "executive", "file_checksum": "2566f0e0ff98d899ee0633da64bc65e59", "file_path": "3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "url": f"{FILE_ENDPOINT}/3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "file_url": "https://doweb.rio.rj.gov.br/portal/edicoes/download/4067", "scraped_at": "2020-10-30T07:04:29.796347", "created_at": "2020-10-30T07:05:33.094289", "territory_id": self.TERRITORY_ID3, "territory_name": "Rio de Janeiro", "state_code": "RJ", "edition_number": "123.456", "is_extra_edition": False, "highlight_texts": [], }, { "source_text": "This is a fake gazette content from ID 9", "date": datetime.strftime(week_ago - day, "%Y-%m-%d"), "edition_number": None, "is_extra_edition": False, "power": "executive", "file_checksum": "2566f0e0ff98d899ee0633da64bc65e510", "file_path": "3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "url": f"{FILE_ENDPOINT}/3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "file_url": "https://doweb.rio.rj.gov.br/portal/edicoes/download/4067", "scraped_at": "2020-10-30T07:04:29.796347", "created_at": "2020-10-30T07:05:33.094289", "territory_id": self.TERRITORY_ID4, "territory_name": "Rio de Janeiro", "state_code": "RJ", "edition_number": "123.456", "is_extra_edition": False, "highlight_texts": [], }, { "source_text": "This is a fake gazette content from ID 10", "date": datetime.strftime(week_ago, "%Y-%m-%d"), "edition_number": None, "is_extra_edition": False, "power": "executive", "file_checksum": "2566f0e0ff98d899ee0633da64bc65e511", "file_path": "3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "url": f"{FILE_ENDPOINT}/3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "file_url": "https://doweb.rio.rj.gov.br/portal/edicoes/download/4067", "scraped_at": "2020-10-30T07:04:29.796347", "created_at": "2020-10-30T07:05:33.094289", "territory_id": self.TERRITORY_ID4, "territory_name": "Rio de Janeiro", "state_code": "RJ", "edition_number": "123.456", "is_extra_edition": False, "highlight_texts": [], }, { "source_text": "This is a fake gazette content from ID 11", "date": datetime.strftime(week_ago + day, "%Y-%m-%d"), "edition_number": None, "is_extra_edition": False, "power": "executive", "file_checksum": "2566f0e0ff98d899ee0633da64bc65e512", "file_path": "3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "url": f"{FILE_ENDPOINT}/3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "file_url": "https://doweb.rio.rj.gov.br/portal/edicoes/download/4067", "scraped_at": "2020-10-30T07:04:29.796347", "created_at": "2020-10-30T07:05:33.094289", "territory_id": self.TERRITORY_ID4, "territory_name": "Rio de Janeiro", "state_code": "RJ", "edition_number": "123.456", "is_extra_edition": False, "highlight_texts": [], }, ] def assert_basic_function_calls( self, since=None, until=None, keywords=None, territory_id=None, offset=0, size=10, ): expected_query = self.build_expected_query( since=since, until=until, keywords=keywords, territory_id=territory_id, offset=offset, size=size, ) self.es_mock.search.assert_called_with(body=expected_query, index=self.INDEX) def test_get_none_gazettes(self): self._data = [] self.set_mock_search_return() gazettes = self._mapper.get_gazettes()[1] self.assert_basic_function_calls() self.assertEqual(0, len(gazettes)) def test_return_gazette_objects(self): week_ago = date.today() - timedelta(days=7) day = timedelta(days=1) gazettes = self._mapper.get_gazettes(since=week_ago - day)[1] self.assert_basic_function_calls(since=week_ago - day) self.assertGreater(len(gazettes), 0) for gazette in gazettes: self.assertIsInstance(gazette, Gazette) def test_gazettes_fields(self): week_ago = date.today() - timedelta(days=7) day = timedelta(days=1) gazettes = self._mapper.get_gazettes(since=week_ago - day)[1] self.assert_basic_function_calls(since=week_ago - day) for g in gazettes: self.assertIsInstance(g.territory_id, str) self.assertIsInstance(g.url, str) self.assertIsInstance(g.date, date) def test_return_get_gazettes_sort_by_date_in_descending_order(self): two_weeks_ago = date.today() - timedelta(days=14) gazettes = self._mapper.get_gazettes(since=two_weeks_ago)[1] expected_gazettes = [ Gazette( d["territory_id"], d["date"], d["url"], d["territory_name"], d["state_code"], d["highlight_texts"], d["edition_number"], d["is_extra_edition"], ) for d in self._data ] self.assert_basic_function_calls(since=two_weeks_ago) self.assertGreater(len(gazettes), 0) self.assertGreater(gazettes[0].date, gazettes[-1].date) def set_empty_es_return(self): self._data = [] self.set_mock_search_return() def set_search_results_returned_by_date( self, since=None, until=None, territory_id=None, keywords=None ): """ Define the entries returned by the ES mock in the search method call and return a list of Gazettes object of those entries """ data = self._data if since: data = [ d for d in data if datetime.strptime(d["date"], "%Y-%m-%d").date() >= since ] if until: data = [ d for d in data if datetime.strptime(d["date"], "%Y-%m-%d").date() <= until ] if territory_id: data = [d for d in data if d["territory_id"] == territory_id] if keywords: for keyword in keywords: data = [d for d in data if keyword in d["source_text"]] self._data = data self.set_mock_search_return() expected_gazettes = [ Gazette( d["territory_id"], datetime.strptime(d["date"], "%Y-%m-%d").date(), d["url"], d["file_checksum"], d["territory_name"], d["state_code"], d["highlight_texts"], d["edition_number"], d["is_extra_edition"], ) for d in self._data ] return expected_gazettes def test_search_gazettes_since_date(self): today = date.today() expected_gazettes = self.set_search_results_returned_by_date(since=today) gazettes = self._mapper.get_gazettes(since=today)[1] self.assert_basic_function_calls(since=today) self.assertCountEqual(gazettes, expected_gazettes) def test_search_gazettes_until_date(self): yesterday = date.today() - timedelta(days=1) expected_gazettes = self.set_search_results_returned_by_date(until=yesterday) gazettes = self._mapper.get_gazettes(until=yesterday)[1] self.assert_basic_function_calls(until=yesterday) self.assertCountEqual(gazettes, expected_gazettes) def test_search_gazettes_by_territory_id(self): expected_gazettes = self.set_search_results_returned_by_date( territory_id=self.TERRITORY_ID1 ) gazettes = self._mapper.get_gazettes(territory_id=self.TERRITORY_ID1)[1] self.assert_basic_function_calls(territory_id=self.TERRITORY_ID1) self.assertCountEqual(gazettes, expected_gazettes) def test_search_gazettes_by_territory_id_and_dates(self): week_ago = date.today() - timedelta(days=7) day = timedelta(days=1) expected_gazettes = self.set_search_results_returned_by_date( territory_id=self.TERRITORY_ID4, since=week_ago - day, until=week_ago + day ) gazettes = self._mapper.get_gazettes( territory_id=self.TERRITORY_ID4, since=week_ago - day, until=week_ago + day )[1] self.assert_basic_function_calls( territory_id=self.TERRITORY_ID4, since=week_ago - day, until=week_ago + day ) self.assertCountEqual(gazettes, expected_gazettes) def test_get_gazettes_by_keywords(self): expected_gazettes = self.set_search_results_returned_by_date( keywords=["000.000.000-00"] ) gazettes = self._mapper.get_gazettes(keywords=["000.000.000-00"])[1] self.assertCountEqual(gazettes, expected_gazettes) expected_gazettes = self.set_search_results_returned_by_date( keywords=["anotherkeyword"] ) gazettes = self._mapper.get_gazettes(keywords=["anotherkeyword"])[1] self.assertCountEqual(gazettes, expected_gazettes) expected_gazettes = self.set_search_results_returned_by_date( keywords=["keyword1"] ) gazettes = self._mapper.get_gazettes(keywords=["keyword1"])[1] self.assertCountEqual(gazettes, expected_gazettes) def test_get_gazettes_by_invalid_since_date(self): self.set_empty_es_return() two_months_future = date.today() + timedelta(weeks=8) gazettes = self._mapper.get_gazettes(since=two_months_future)[1] self.assertEqual(0, len(gazettes), msg="No gazettes should be return ") def test_get_gazettes_by_invalid_until_date(self): self.set_empty_es_return() two_months_ago = date.today() - timedelta(weeks=8) gazettes = self._mapper.get_gazettes(until=two_months_ago)[1] self.assertEqual(0, len(gazettes), msg="No gazettes should be return ") def test_from_and_size_fields(self): today = date.today() self._mapper.get_gazettes(until=today, offset=5, size=15) self.assert_basic_function_calls(until=today, offset=5, size=15) def is_running_integration_tests(): return os.environ.get("RUN_INTEGRATION_TESTS", 0) == "1" class ElasticSearchIntegrationBaseTestCase(TestCase): _data = [] def delete_index(self): for attempt in range(3): try: self._es.indices.delete( index=self.INDEX, ignore_unavailable=True, timeout="30s" ) self._es.indices.refresh() return except Exception as e: time.sleep(10) def create_index(self): for attempt in range(3): try: self._es.indices.create( index=self.INDEX, body={"mappings": {"properties": {"date": {"type": "date"}}}}, timeout="30s", ) self._es.indices.refresh() return except Exception as e: time.sleep(10) def recreate_index(self): self.delete_index() self.create_index() def try_push_data_to_index(self, bulk_data): for attempt in range(3): try: self._es.bulk(bulk_data, index=self.INDEX, refresh=True, timeout="30s") return except Exception as e: time.sleep(10) def add_data_on_index(self): bulk_data = [] for gazette in self._data: bulk_data.append( {"index": {"_index": self.INDEX, "_id": gazette["file_checksum"]}} ) bulk_data.append(gazette) self.try_push_data_to_index(bulk_data) def setUp(self): self._es = elasticsearch.Elasticsearch(hosts=["localhost"]) self.recreate_index() self.generate_data() self.add_data_on_index() self._mapper = create_elasticsearch_data_mapper("localhost", self.INDEX) def tearDown(self): self._es.close() def get_latest_gazettes_files(self, gazettes_count): self._data.sort(reverse=True, key=lambda x: x["date"]) return [ Gazette( d["territory_id"], datetime.strptime(d["date"], "%Y-%m-%d").date(), d["url"], d["file_checksum"], d["territory_name"], d["state_code"], d["highlight_texts"], d["edition_number"], d["is_extra_edition"], ) for d in self._data[:gazettes_count] ] def get_expected_document_page(self, offset, size): total_documents = len(self._data) expected_gazettes = self.get_latest_gazettes_files(total_documents) return expected_gazettes[offset : offset + size] @skipUnless(is_running_integration_tests(), "Integration tests disable") class ElasticSearchDataMapperPaginationTest(ElasticSearchIntegrationBaseTestCase): INDEX = "gazettes_pagination" TERRITORY_ID = "3304557" maxDiff = None def generate_data(self): if len(self._data) > 0: return for days_old in range(50): self.create_new_fake_gazette(days_old) def create_new_fake_gazette(self, days_old: int): document_uuid = str(uuid.uuid1()) document_date = date.today() - timedelta(days=days_old) gazette = { "source_text": "This is a fake gazette content", "date": datetime.strftime(document_date, "%Y-%m-%d"), "edition_number": None, "is_extra_edition": False, "power": "executive", "file_checksum": document_uuid, "file_path": f"3304557/2019-02-26/{document_uuid}", "url": f"{FILE_ENDPOINT}/3304557/2019-02-26/{document_uuid}", "file_url": "https://doweb.rio.rj.gov.br/portal/edicoes/download/4067", "scraped_at": "2020-10-30T07:04:29.796347", "created_at": "2020-10-30T07:05:33.094289", "territory_id": self.TERRITORY_ID, "territory_name": "Rio de Janeiro", "state_code": "RJ", "highlight_texts": [], } self._data.append(gazette) def assert_basic_function_calls( self, since=None, until=None, keywords=None, territory_id=None, offset=0, size=10, ): expected_query = self.build_expected_query( since=since, until=until, keywords=keywords, territory_id=territory_id, offset=offset, size=size, ) self.es_mock.search.assert_called_with(body=expected_query, index=self.INDEX) def test_page_size(self): gazettes = self._mapper.get_gazettes( territory_id=self.TERRITORY_ID, offset=0, size=10 )[1] self.assertEqual(10, len(gazettes), msg="Invalid page size.") gazettes = self._mapper.get_gazettes( territory_id=self.TERRITORY_ID, offset=0, size=20 )[1] self.assertEqual(20, len(gazettes), msg="Invalid page size.") gazettes = self._mapper.get_gazettes( territory_id=self.TERRITORY_ID, offset=0, size=30 )[1] self.assertEqual(30, len(gazettes), msg="Invalid page size.") def test_pages_should_return_gazette_items(self): gazettes = self._mapper.get_gazettes( territory_id=self.TERRITORY_ID, offset=0, size=10 )[1] self.assertNotEqual(0, len(gazettes)) for gazette in gazettes: self.assertIsInstance(gazette, Gazette) def test_first_page_should_return_latest_gazettes(self): page_size = 10 gazettes = self._mapper.get_gazettes( territory_id=self.TERRITORY_ID, offset=0, size=page_size )[1] self.assertCountEqual(gazettes, self.get_expected_document_page(0, page_size)) def test_consecutive_page_items_should_have_older_dates(self): page_size = 10 first_page = self._mapper.get_gazettes( territory_id=self.TERRITORY_ID, offset=0, size=page_size )[1] second_page = self._mapper.get_gazettes( territory_id=self.TERRITORY_ID, offset=page_size, size=page_size )[1] expected_gazettes = self.get_latest_gazettes_files(20) self.assertCountEqual(first_page, expected_gazettes[:page_size]) self.assertCountEqual(second_page, expected_gazettes[page_size:]) def test_get_switching_between_gazettes_pages(self): page_size = 10 first_page = self._mapper.get_gazettes( territory_id=self.TERRITORY_ID, offset=0, size=page_size )[1] second_page = self._mapper.get_gazettes( territory_id=self.TERRITORY_ID, offset=page_size, size=page_size )[1] first_page_second_time = self._mapper.get_gazettes( territory_id=self.TERRITORY_ID, offset=0, size=page_size )[1] second_page_second_time = self._mapper.get_gazettes( territory_id=self.TERRITORY_ID, offset=page_size, size=page_size )[1] expected_second_page = self.get_expected_document_page(page_size, page_size) expected_first_page = self.get_expected_document_page(0, page_size) self.assertCountEqual( first_page, expected_first_page, msg="Unexpected first page" ) self.assertCountEqual( second_page, expected_second_page, msg="Unexpected second page" ) self.assertCountEqual( first_page_second_time, expected_first_page, msg="Unexpected first page" ) self.assertCountEqual( second_page_second_time, expected_second_page, msg="Unexpected second page" ) self.assertCountEqual( first_page, first_page_second_time, msg="Page request second time is different from the first one", ) self.assertCountEqual( second_page, second_page_second_time, msg="Page request second time is different from the first one", ) def test_get_page_does_not_exist(self): _, gazettes = self._mapper.get_gazettes( territory_id=self.TERRITORY_ID, offset=99 ) self.assertCountEqual( [], gazettes, msg="When requesting a page that does not exists. Not gazettes should be return", ) def test_get_all_pages_available(self): page_size = 10 total_documents = len(self._data) for page_number in range(int(total_documents / page_size)): page = self._mapper.get_gazettes( territory_id=self.TERRITORY_ID, offset=page_size * page_number, size=page_size, )[1] expected_page = self.get_expected_document_page( page_size * page_number, page_size ) self.assertCountEqual( page, expected_page, msg=f"Page {page_number} is not right", ) @skipUnless(is_running_integration_tests(), "Integration tests disable") class ElasticSearchDataMapperKeywordTest(ElasticSearchIntegrationBaseTestCase): INDEX = "gazettes_keywords" def generate_data(self): week_ago = date.today() - timedelta(days=7) day = timedelta(days=1) self._data = [ { "source_text": "This is a fake gazette content. prefeitura", "date": date.today(), "edition_number": None, "is_extra_edition": False, "power": "executive", "file_checksum": "2566f0e0ff98d899ee0633da64bc65e5", "file_path": "3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "url": f"{FILE_ENDPOINT}/3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "file_url": "https://doweb.rio.rj.gov.br/portal/edicoes/download/4067", "scraped_at": "2020-10-30T07:04:29.796347", "created_at": "2020-10-30T07:05:33.094289", "territory_id": "3304557", "processed": False, "territory_name": "Rio de Janeiro", "state_code": "RJ", "highlight_texts": [], }, { "source_text": "This is a fake gazette content. prefeitura foobar xpto piraporinha", "date": date.today() - day, "edition_number": None, "is_extra_edition": False, "power": "executive", "file_checksum": "2566f0e0ff98d899ee0633da64bc65e51", "file_path": "3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "url": f"{FILE_ENDPOINT}/3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "file_url": "https://doweb.rio.rj.gov.br/portal/edicoes/download/4067", "scraped_at": "2020-10-30T07:04:29.796347", "created_at": "2020-10-30T07:05:33.094289", "territory_id": "3304557", "processed": False, "territory_name": "Rio de Janeiro", "state_code": "RJ", "highlight_texts": [], }, { "source_text": "This is a fake gazette content. prefeitura, piraporinha and cafundo", "date": date.today() + day, "edition_number": None, "is_extra_edition": False, "power": "executive", "file_checksum": "2566f0e0ff98d899ee0633da64bc65e52", "file_path": "3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "url": f"{FILE_ENDPOINT}/3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "file_url": "https://doweb.rio.rj.gov.br/portal/edicoes/download/4067", "scraped_at": "2020-10-30T07:04:29.796347", "created_at": "2020-10-30T07:05:33.094289", "territory_id": "3304557", "processed": False, "territory_name": "Rio de Janeiro", "state_code": "RJ", "highlight_texts": [], }, { "source_text": "This is a fake gazette content. piraporinha and cafundo", "date": date.today() + day, "edition_number": None, "is_extra_edition": False, "power": "executive", "file_checksum": "2566f0e0ff98d899ee0633da64bc65e53", "file_path": "3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "url": f"{FILE_ENDPOINT}/3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "file_url": "https://doweb.rio.rj.gov.br/portal/edicoes/download/4067", "scraped_at": "2020-10-30T07:04:29.796347", "created_at": "2020-10-30T07:05:33.094289", "territory_id": "3304557", "processed": False, "territory_name": "Rio de Janeiro", "state_code": "RJ", "highlight_texts": [], }, ] def test_get_gazettes_by_keywords_does_not_exist_return_nothing(self): _, gazettes = self._mapper.get_gazettes(keywords=["wasd1234xxx"]) self.assertEqual(0, len(gazettes), msg="No gazettes should be return ") def test_get_gazettes_return_only_documents_containing_all_keywords(self): _, gazettes = self._mapper.get_gazettes(keywords=["prefeitura"]) self.assertEqual( 3, len(gazettes), msg="3 gazettes should be returned because has the keyword 'prefeitura'", ) _, gazettes = self._mapper.get_gazettes(keywords=["piraporinha"]) self.assertEqual( 3, len(gazettes), msg="3 gazettes should be returned because has the keyword 'piraporinha'", ) _, gazettes = self._mapper.get_gazettes(keywords=["piraporinha", "cafundo"]) self.assertEqual(2, len(gazettes), msg="Only 2 gazettes should be return") class Elasticsearch(TestCase): def setUp(self): self.host = "localhost" self.index = "gazettes" self.search_result_json = { "took": 4, "timed_out": False, "_shards": {"total": 1, "successful": 1, "skipped": 0, "failed": 0}, "hits": { "total": {"value": 8, "relation": "eq"}, "max_score": None, "hits": [ { "_index": "gazettes", "_type": "_doc", "_id": "2566f0e0ff98d899ee0633da64bc65e52", "_score": None, "_source": { "source_text": "This is a fake gazette content", "date": "2021-01-07", "edition_number": "123.456", "is_extra_edition": False, "power": "executive", "file_checksum": "2566f0e0ff98d899ee0633da64bc65e52", "file_path": "3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "url": "http://test.com/3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "file_url": "https://doweb.rio.rj.gov.br/portal/edicoes/download/4067", "scraped_at": "2020-10-30T07:04:29.796347", "created_at": "2020-10-30T07:05:33.094289", "territory_id": "4205902", "territory_name": "Rio de Janeiro", "state_code": "RJ", }, "highlight": {"source_text": []}, "sort": [1609977600000], }, { "_index": "gazettes", "_type": "_doc", "_id": "2566f0e0ff98d899ee0633da64bc65e54", "_score": None, "_source": { "source_text": "This is a fake gazette content. anotherkeyword", "date": "2021-01-07", "edition_number": "123.456", "is_extra_edition": False, "power": "executive", "file_checksum": "2566f0e0ff98d899ee0633da64bc65e54", "file_path": "3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "url": "http://test.com/3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "file_url": "https://doweb.rio.rj.gov.br/portal/edicoes/download/4067", "scraped_at": "2020-10-30T07:04:29.796347", "created_at": "2020-10-30T07:05:33.094289", "territory_id": "3304557", "territory_name": "Rio de Janeiro", "state_code": "RJ", }, "highlight": {"source_text": []}, "sort": [1609977600000], }, { "_index": "gazettes", "_type": "_doc", "_id": "2566f0e0ff98d899ee0633da64bc65e59", "_score": None, "_source": { "source_text": "This is a fake gazette content from ID 8", "date": "2021-01-02", "edition_number": "123.456", "is_extra_edition": False, "power": "executive", "file_checksum": "2566f0e0ff98d899ee0633da64bc65e59", "file_path": "3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "url": "http://test.com/3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "file_url": "https://doweb.rio.rj.gov.br/portal/edicoes/download/4067", "scraped_at": "2020-10-30T07:04:29.796347", "created_at": "2020-10-30T07:05:33.094289", "territory_id": "4205919", "territory_name": "Rio de Janeiro", "state_code": "RJ", }, "highlight": {"source_text": []}, "sort": [1609545600000], }, { "_index": "gazettes", "_type": "_doc", "_id": "2566f0e0ff98d899ee0633da64bc65e512", "_score": None, "_source": { "source_text": "This is a fake gazette content from ID 11", "date": "2021-01-02", "edition_number": "123.456", "is_extra_edition": False, "power": "executive", "file_checksum": "2566f0e0ff98d899ee0633da64bc65e512", "file_path": "3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "url": "http://test.com/3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "file_url": "https://doweb.rio.rj.gov.br/portal/edicoes/download/4067", "scraped_at": "2020-10-30T07:04:29.796347", "created_at": "2020-10-30T07:05:33.094289", "territory_id": "4205920", "territory_name": "Rio de Janeiro", "state_code": "RJ", }, "highlight": {"source_text": []}, "sort": [1609545600000], }, { "_index": "gazettes", "_type": "_doc", "_id": "2566f0e0ff98d899ee0633da64bc65e58", "_score": None, "_source": { "source_text": "This is a fake gazette content from ID 7", "date": "2021-01-01", "edition_number": "123.456", "is_extra_edition": False, "power": "executive", "file_checksum": "2566f0e0ff98d899ee0633da64bc65e58", "file_path": "3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "url": "http://test.com/3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "file_url": "https://doweb.rio.rj.gov.br/portal/edicoes/download/4067", "scraped_at": "2020-10-30T07:04:29.796347", "created_at": "2020-10-30T07:05:33.094289", "territory_id": "4205919", "territory_name": "Rio de Janeiro", "state_code": "RJ", }, "highlight": {"source_text": []}, "sort": [1609459200000], }, { "_index": "gazettes", "_type": "_doc", "_id": "2566f0e0ff98d899ee0633da64bc65e511", "_score": None, "_source": { "source_text": "This is a fake gazette content from ID 10", "date": "2021-01-01", "edition_number": "123.456", "is_extra_edition": False, "power": "executive", "file_checksum": "2566f0e0ff98d899ee0633da64bc65e511", "file_path": "3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "url": "http://test.com/3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "file_url": "https://doweb.rio.rj.gov.br/portal/edicoes/download/4067", "scraped_at": "2020-10-30T07:04:29.796347", "created_at": "2020-10-30T07:05:33.094289", "territory_id": "4205920", "territory_name": "Rio de Janeiro", "state_code": "RJ", }, "highlight": {"source_text": []}, "sort": [1609459200000], }, { "_index": "gazettes", "_type": "_doc", "_id": "2566f0e0ff98d899ee0633da64bc65e57", "_score": None, "_source": { "source_text": "This is a fake gazette content from ID 6", "date": "2020-12-31", "edition_number": "123.456", "is_extra_edition": False, "power": "executive", "file_checksum": "2566f0e0ff98d899ee0633da64bc65e57", "file_path": "3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "url": "http://test.com/3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "file_url": "https://doweb.rio.rj.gov.br/portal/edicoes/download/4067", "scraped_at": "2020-10-30T07:04:29.796347", "created_at": "2020-10-30T07:05:33.094289", "territory_id": "4205919", "territory_name": "Rio de Janeiro", "state_code": "RJ", }, "highlight": {"source_text": []}, "sort": [1609372800000], }, { "_index": "gazettes", "_type": "_doc", "_id": "2566f0e0ff98d899ee0633da64bc65e510", "_score": None, "_source": { "source_text": "This is a fake gazette content from ID 9", "date": "2020-12-31", "edition_number": "123.456", "is_extra_edition": False, "power": "executive", "file_checksum": "2566f0e0ff98d899ee0633da64bc65e510", "file_path": "3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "url": "http://test.com/3304557/2019-02-26/c942328486185aa09ec19a7c723b3a33847258ee", "file_url": "https://doweb.rio.rj.gov.br/portal/edicoes/download/4067", "scraped_at": "2020-10-30T07:04:29.796347", "created_at": "2020-10-30T07:05:33.094289", "territory_id": "4205920", "territory_name": "Rio de Janeiro", "state_code": "RJ", }, "highlight": {"source_text": []}, "sort": [1609372800000], }, ], }, } def test_elasticsearch_data_mapper_creation(self): with patch("elasticsearch.Elasticsearch") as es_mock: es = ElasticSearchDataMapper(self.host, self.index) es._es.indices.exists.assert_called_once() @patch("elasticsearch.Elasticsearch") def test_get_total_number_items(self, es_mock): es = ElasticSearchDataMapper(self.host, self.index) total_items = es.get_total_number_items(self.search_result_json) self.assertEqual(total_items, 8) @patch("elasticsearch.Elasticsearch") def test_total_number_of_items_found_return(self, es_mock): es_mock.search.return_value = self.search_result_json es = ElasticSearchDataMapper(self.host, self.index) es._es = es_mock total_items, _ = es.get_gazettes("4205920", None, None, None, 1, 4) self.assertEqual(total_items, 8)
44.420742
113
0.540326
5,102
52,683
5.329675
0.071933
0.032767
0.023904
0.027582
0.813989
0.768314
0.73746
0.721462
0.70267
0.677994
0
0.131611
0.342482
52,683
1,185
114
44.458228
0.653378
0.002316
0
0.639374
0
0
0.30743
0.102705
0
0
0
0
0.052438
1
0.051518
false
0
0.0092
0.00092
0.090156
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
a9f5362ecd776f81de7ab829aac7a2945d67005e
83
py
Python
test-juicyapi.py
The-New-Fork/python-blocknotify
56733218c0231044e859a967f767a6674b4ac85e
[ "Apache-2.0" ]
1
2021-10-01T15:54:51.000Z
2021-10-01T15:54:51.000Z
test-juicyapi.py
The-New-Fork/python-blocknotify
56733218c0231044e859a967f767a6674b4ac85e
[ "Apache-2.0" ]
null
null
null
test-juicyapi.py
The-New-Fork/python-blocknotify
56733218c0231044e859a967f767a6674b4ac85e
[ "Apache-2.0" ]
1
2021-07-22T08:11:50.000Z
2021-07-22T08:11:50.000Z
from dotenv import load_dotenv import json import pytest load_dotenv(verbose=True)
16.6
30
0.855422
13
83
5.307692
0.615385
0.347826
0
0
0
0
0
0
0
0
0
0
0.108434
83
4
31
20.75
0.932432
0
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
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
e726515d41cb1364005ba231d31143f8b5ff6ff2
4,185
py
Python
qtcurate/connect.py
quantxt/qtcurate-sdk-python
7c60a97c808381680889b2934aa5146e9303274e
[ "Apache-2.0" ]
null
null
null
qtcurate/connect.py
quantxt/qtcurate-sdk-python
7c60a97c808381680889b2934aa5146e9303274e
[ "Apache-2.0" ]
null
null
null
qtcurate/connect.py
quantxt/qtcurate-sdk-python
7c60a97c808381680889b2934aa5146e9303274e
[ "Apache-2.0" ]
null
null
null
import requests from qtcurate.exceptions import QtConnectionError, QtRestApiError, QtArgumentError def connect(method: str, uri: str, headers: str, data_type: str = None, data=None) -> requests.Response: s = requests.Session() res = None if data_type not in [None, "data", "files", "params"]: raise QtArgumentError("Unknown data type. params, data and files are allowed") if method.lower() == 'get': if data_type is None: try: res = s.get(uri, headers=headers) except requests.exceptions.RequestException as e: raise QtConnectionError(f"Connection error: {e}") if res.status_code not in [200, 201, 202, 204]: raise QtRestApiError(f"HTTP error: Full authentication is required to access this resource. " f"HTTP status code: {res.status_code}. Server message: {res.json()}") elif data_type == "params": try: res = s.get(uri, headers=headers, params=data) except requests.exceptions.RequestException as e: raise QtConnectionError(f"Connection error: {e}") if res.status_code not in [200, 201, 202, 204]: raise QtRestApiError(f"HTTP error: Full authentication is required to access this resource. " f"HTTP status code: {res.status_code}. Server message: {res.json()}") elif method.lower() == "delete": try: res = s.delete(uri, headers=headers) except requests.exceptions.RequestException as e: raise QtConnectionError(f"Connection error: {e}") if res.status_code not in [200, 201, 202, 204]: raise QtRestApiError(f"HTTP error: Full authentication is required to access this resource. " f"HTTP status code: {res.status_code}. Server message: {res.json()}") elif method.lower() == "post": if data_type == "data": try: res = s.post(uri, headers=headers, data=data) except requests.exceptions.RequestException as e: raise QtConnectionError(f"Connection error: {e}") if res.status_code not in [200, 201, 202, 204]: raise QtRestApiError(f"HTTP error: Full authentication is required to access this resource. " f"HTTP status code: {res.status_code}. Server message: {res.json()}") elif data_type == "files": try: res = s.post(uri, headers=headers, files=data) except requests.exceptions.RequestException as e: raise QtConnectionError(f"Connection error: {e}") if res.status_code not in [200, 201, 202, 204]: raise QtRestApiError(f"HTTP error: Full authentication is required to access this resource. " f"HTTP status code: {res.status_code}. Server message: {res.json()}") elif method.lower() == "put": if data_type == "data": try: res = s.put(uri, headers=headers, data=data) except requests.exceptions.RequestException as e: raise QtConnectionError(f"Connection error: {e}") if res.status_code not in [200, 201, 202, 204]: raise QtRestApiError(f"HTTP error: Full authentication is required to access this resource. " f"HTTP status code: {res.status_code}. Server message: {res.json()}") elif data_type == "files": try: res = s.put(uri, headers=headers, files=data) except requests.exceptions.RequestException as e: raise QtConnectionError(f"Connection error: {e}") if res.status_code not in [200, 201, 202, 204]: raise QtRestApiError(f"HTTP error: Full authentication is required to access this resource. " f"HTTP status code: {res.status_code}. Server message: {res.json()}") else: raise QtArgumentError("Unknown data type. data and files are allowed") return res
57.328767
109
0.586619
485
4,185
5.016495
0.134021
0.086313
0.074805
0.115084
0.873407
0.826552
0.826552
0.788327
0.788327
0.788327
0
0.029248
0.31374
4,185
72
110
58.125
0.817897
0
0
0.666667
0
0
0.295818
0
0
0
0
0
0
1
0.014493
false
0
0.028986
0
0.057971
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
e76cf5dc2081760dd0826fdc592e01ef3836af6a
226
py
Python
Actions/actioninterface.py
dz1domin/bachelors
8be6b67535afd19a1bc9a116b26efa427a8a1e8c
[ "MIT" ]
null
null
null
Actions/actioninterface.py
dz1domin/bachelors
8be6b67535afd19a1bc9a116b26efa427a8a1e8c
[ "MIT" ]
null
null
null
Actions/actioninterface.py
dz1domin/bachelors
8be6b67535afd19a1bc9a116b26efa427a8a1e8c
[ "MIT" ]
1
2020-02-27T18:15:21.000Z
2020-02-27T18:15:21.000Z
import abc class ActionInterface(abc.ABC): def do_action(self, moduleResult, runtimeOptions): pass def setup(self, runtimeOptions): pass def finish(self, runtimeOptions): pass
18.833333
55
0.628319
23
226
6.130435
0.565217
0.382979
0.297872
0
0
0
0
0
0
0
0
0
0.29646
226
12
56
18.833333
0.886792
0
0
0.375
0
0
0
0
0
0
0
0
0
1
0.375
false
0.375
0.125
0
0.625
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
6
e790fe1d9f57f21c9976c765a89d1abcf8c85a37
196
py
Python
cuddly-chameleons/cuddly_chameleons/retro_news/admin.py
Vthechamp22/summer-code-jam-2021
0a8bf1f22f6c73300891fd779da36efd8e1304c1
[ "MIT" ]
40
2020-08-02T07:38:22.000Z
2021-07-26T01:46:50.000Z
cuddly-chameleons/cuddly_chameleons/retro_news/admin.py
Vthechamp22/summer-code-jam-2021
0a8bf1f22f6c73300891fd779da36efd8e1304c1
[ "MIT" ]
134
2020-07-31T12:15:45.000Z
2020-12-13T04:42:19.000Z
cuddly-chameleons/cuddly_chameleons/retro_news/admin.py
ks129/summer-code-jam-2020
819ac854269af8ef482c83f851c39c1887a27c5b
[ "MIT" ]
101
2020-07-31T12:00:47.000Z
2021-11-01T09:06:58.000Z
from django.contrib import admin from .models import ArticleComment, CustomUser, BlogArticle admin.site.register(CustomUser) admin.site.register(BlogArticle) admin.site.register(ArticleComment)
24.5
59
0.841837
23
196
7.173913
0.478261
0.163636
0.309091
0.339394
0
0
0
0
0
0
0
0
0.076531
196
7
60
28
0.911602
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.4
0
0.4
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
6
e79ffd2fb5e9e4e1399072bc4a42d0def78e33c0
41
py
Python
src/vitalert/alerts/__init__.py
Vitalert/vitalert-python
6ee91063412320cb561634de73ad8522a1453c50
[ "MIT" ]
null
null
null
src/vitalert/alerts/__init__.py
Vitalert/vitalert-python
6ee91063412320cb561634de73ad8522a1453c50
[ "MIT" ]
null
null
null
src/vitalert/alerts/__init__.py
Vitalert/vitalert-python
6ee91063412320cb561634de73ad8522a1453c50
[ "MIT" ]
null
null
null
from vitalert.alerts.alerts import Alerts
41
41
0.878049
6
41
6
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.073171
41
1
41
41
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
e7c9c8cdb07c2a7ba7ec32b98bab75f28c11cdc5
92
py
Python
kcore_migrate/backends/asyncpg.py
tigeraniya/migrate
40c9e5b252953001440bf9bd3922ab8b66ca6af3
[ "MIT" ]
null
null
null
kcore_migrate/backends/asyncpg.py
tigeraniya/migrate
40c9e5b252953001440bf9bd3922ab8b66ca6af3
[ "MIT" ]
null
null
null
kcore_migrate/backends/asyncpg.py
tigeraniya/migrate
40c9e5b252953001440bf9bd3922ab8b66ca6af3
[ "MIT" ]
null
null
null
from .. ibackend import IMigrationBackend class AsyncpgBackend(IMigrationBackend): pass
23
41
0.815217
8
92
9.375
0.875
0
0
0
0
0
0
0
0
0
0
0
0.130435
92
4
42
23
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
99eaf549c150852e17bcedce00f255e94fb76efd
39
py
Python
main.py
HeeYong4496/test
a72411bf62c25b9c18c9f20d6785a0d35fa230f2
[ "Apache-2.0" ]
1
2021-11-04T14:04:17.000Z
2021-11-04T14:04:17.000Z
main.py
HeeYong4496/HeeYong4496
8d7793dd8f3fe3db21eda3b7086921b1b1c97308
[ "Apache-2.0" ]
null
null
null
main.py
HeeYong4496/HeeYong4496
8d7793dd8f3fe3db21eda3b7086921b1b1c97308
[ "Apache-2.0" ]
null
null
null
print("Hello") print("Hello Seoul")
6.5
20
0.641026
5
39
5
0.6
0.8
0
0
0
0
0
0
0
0
0
0
0.153846
39
5
21
7.8
0.757576
0
0
0
0
0
0.432432
0
0
0
0
0
0
1
0
true
0
0
0
0
1
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
0
0
0
1
0
6
413269c6c31e60634d6c00521d05c10c359a01dd
118
py
Python
service/__init__.py
tmby1314/BlogSite
5b1da0e4eb9829d010d6d9a5c0d4e5b89586f8f5
[ "Apache-2.0" ]
null
null
null
service/__init__.py
tmby1314/BlogSite
5b1da0e4eb9829d010d6d9a5c0d4e5b89586f8f5
[ "Apache-2.0" ]
null
null
null
service/__init__.py
tmby1314/BlogSite
5b1da0e4eb9829d010d6d9a5c0d4e5b89586f8f5
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- # @Time : 2017/11/16 23:43 # @Author : zhaoshun # @Email : tmby1314@163.com """ """
14.75
30
0.5
15
118
3.933333
1
0
0
0
0
0
0
0
0
0
0
0.227273
0.254237
118
7
31
16.857143
0.443182
0.847458
0
null
0
null
0
0
null
0
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
1
0
0
1
0
0
1
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
6
419d969f556fcd8bc224ae680db81ee03fb3ff74
27
py
Python
src/euler_python_package/euler_python/medium/p220.py
wilsonify/euler
5214b776175e6d76a7c6d8915d0e062d189d9b79
[ "MIT" ]
null
null
null
src/euler_python_package/euler_python/medium/p220.py
wilsonify/euler
5214b776175e6d76a7c6d8915d0e062d189d9b79
[ "MIT" ]
null
null
null
src/euler_python_package/euler_python/medium/p220.py
wilsonify/euler
5214b776175e6d76a7c6d8915d0e062d189d9b79
[ "MIT" ]
null
null
null
def problem220(): pass
9
17
0.62963
3
27
5.666667
1
0
0
0
0
0
0
0
0
0
0
0.15
0.259259
27
2
18
13.5
0.7
0
0
0
0
0
0
0
0
0
0
0
0
1
0.5
true
0.5
0
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
1
0
0
0
0
0
6
68f6b62260e6b604ffaebfffb5a1ef8b555e1322
6,494
py
Python
tools/miso/psi_estimators.py
globusgenomics/galaxy
7caf74d9700057587b3e3434c64e82c5b16540f1
[ "CC-BY-3.0" ]
1
2021-02-05T13:19:58.000Z
2021-02-05T13:19:58.000Z
tools/miso/psi_estimators.py
globusgenomics/galaxy
7caf74d9700057587b3e3434c64e82c5b16540f1
[ "CC-BY-3.0" ]
null
null
null
tools/miso/psi_estimators.py
globusgenomics/galaxy
7caf74d9700057587b3e3434c64e82c5b16540f1
[ "CC-BY-3.0" ]
null
null
null
from scipy import * from numpy import * def curr_psi(NI, NE, skipped_exon_len, read_len, overhang_len, min_reads=0): """ Compute the Psi value. \Psi = DI / (DI + DE) NI is: number of reads in upstream inclusion jxn + number of reads in downstream inclusion jxn + number of body reads in the skipped exon itself (for a skipped exon event, for example.) Note that NI + NE <= min_reads. Return 'n/a' if this is not met. """ if (NI + NE) < min_reads: raise Exception, "curr_psi: min_reads not satisfied." # First term of DI's denominator accounts for body reads, the # second for the two junctions (upstream, downstream) if skipped_exon_len - read_len < 0: raise Exception, "curr_psi: Exon too short for read length." DI = float(NI) / float((skipped_exon_len - read_len + 1) + 2*(read_len + 1 - (2*overhang_len))) # Denominator of DE accounts for the number of positions that our # read (minus the overhang) can be aligned to two adjacent # junctions DE = float(NE) / float(read_len + 1 - (2*overhang_len)) if DI == 0 and DE == 0: raise Exception, "curr_psi undefined." psi = float(DI) / float(DI + DE) if psi > 1 or psi < 0: raise Exception, "Psi out of bounds [0, 1]." return psi def get_psi_densities(NI, NE, skipped_exon_len, read_len, overhang_len): DI = float(NI) / float((skipped_exon_len - read_len + 1) + 2*(read_len + 1 - (2*overhang_len))) DE = float(NE) / float(read_len + 1 - (2*overhang_len)) return DI, DE def curr_psi_one_incjxn(NI, NE, skipped_exon_len, read_len, overhang_len, min_reads=0): """ Compute the Psi value, using only one inclusion junction as the source of inclusion reads. \Psi = DI / (DI + DE) NI is: number of reads in upstream inclusion jxn + number of reads in downstream inclusion jxn + number of body reads in the skipped exon itself (for a skipped exon event, for example.) Note that NI + NE <= min_reads. Return 'n/a' if this is not met. """ if (NI + NE) < min_reads: return 'n/a' DI = float(NI) / float(read_len + 1 - (2*overhang_len)) # Denominator of DE accounts for the number of positions that our # read (minus the overhang) can be aligned to two adjacent # junctions DE = float(NE) / float(read_len + 1 - (2*overhang_len)) ## Temporary # if DI == 0 and DE == 0: # return 0 if DI == 0 and DE == 0: print NI, NE print "Estimator not defined for DI = 0, DE = 0." # return NaN psi = float(DI) / float(DI + DE) return psi def curr_psi_bodyinc(NI, NE, skipped_exon_len, read_len, overhang_len, min_reads=0): """ Compute the Psi value, using only body reads from skipped exon as source of inclusion reads. \Psi = DI / (DI + DE) NI is: number of reads in upstream inclusion jxn + number of reads in downstream inclusion jxn + number of body reads in the skipped exon itself (for a skipped exon event, for example.) Note that NI + NE <= min_reads. Return 'n/a' if this is not met. """ if (NI + NE) < min_reads: return 'n/a' # First term of DI's denominator accounts for body reads, the # second for the two junctions (upstream, downstream) DI = float(NI) / float(skipped_exon_len - read_len + 1) # Denominator of DE accounts for the number of positions that our # read (minus the overhang) can be aligned to two adjacent # junctions DE = float(NE) / float(read_len + 1 - (2*overhang_len)) if DI == 0 and DE == 0: return 0 psi = float(DI) / float(DI + DE) return psi def curr_psi_both_incjxns(NI, NE, skipped_exon_len, read_len, overhang_len, min_reads=0): """ Compute the Psi value, using both inclusion junctions as source of inclusion reads. \Psi = DI / (DI + DE) NI is: number of reads in upstream inclusion jxn + number of reads in downstream inclusion jxn + number of body reads in the skipped exon itself (for a skipped exon event, for example.) Note that NI + NE <= min_reads. Return 'n/a' if this is not met. """ if (NI + NE) < min_reads: return 'n/a' # First term of DI's denominator accounts for body reads, the # second for the two junctions (upstream, downstream) DI = float(NI) / float((read_len + 1 - (2*overhang_len)) + (read_len + 1 - (2*overhang_len))) # Denominator of DE accounts for the number of positions that our # read (minus the overhang) can be aligned to two adjacent # junctions DE = float(NE) / float(read_len + 1 - (2*overhang_len)) if DI == 0 and DE == 0: return 0 psi = float(DI) / float(DI + DE) return psi def psi_bayes(n1, n2, nb, iso1_len, iso2_len, read_len, overhang_len, num_exons=3): """ The MAP/MLE estimator for \Psi, based on a mixture model with uniform prior on \Psi. """ p1 = 1/float((iso1_len - read_len + 1) - 4*(overhang_len-1)) p2 = 1/float((iso2_len - read_len + 1) - 2*(overhang_len-1)) if n1 == 0 and n2 == 0: raise Exception, "Psi Bayes undefined for n1, n2 == 0." psi = (n1*p1 + nb*p1 - 2*n1*p2 - n2*p2 - nb*p2 + sqrt(4*n1*p2*(n1*p1 + n2*p1 + nb*p1 - n1*p2 - n2*p2 - nb*p2) + power((-n1*p1 - nb*p1 + 2*n1*p2 + n2*p2 + nb*p2),2)))/(2*(n1*p1 + n2*p1 + nb*p1 - n1*p2 - n2*p2 - nb*p2)) return psi def transformed_psi_bayes(n1, n2, nb, iso1_len, iso2_len, read_len, overhang_len, num_exons=3): """ Transformed MAP/MLE estimator for \Psi, taking into account lengths of isoforms. """ if (n1 == 0 and n2 == 0) or (nb == 0): raise Exception, "transformed_psi_bayes not defined with: n1=%d, n2=%d, nb=%d" %(n1, n2, nb) psi_bayes_estimate = psi_bayes(n1, n2, nb, iso1_len, iso2_len, read_len, overhang_len, num_exons) ## ## Shouldn't take into account overhang, since it wasn't sampled with ## overhangs in mind ## num_positions_iso1 = (iso1_len - read_len + 1) num_positions_iso2 = (iso2_len - read_len + 1) trans_psi_bayes = (num_positions_iso2*psi_bayes_estimate)/(num_positions_iso1-num_positions_iso1*psi_bayes_estimate + num_positions_iso2*psi_bayes_estimate) return trans_psi_bayes
41.628205
161
0.621035
1,014
6,494
3.845168
0.130178
0.046679
0.043601
0.030008
0.794819
0.747884
0.718133
0.712234
0.707617
0.698384
0
0.030599
0.275331
6,494
155
162
41.896774
0.797918
0.15522
0
0.446154
0
0
0.076411
0.006078
0
0
0
0
0
0
null
null
0
0.030769
null
null
0.030769
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
1
0
0
0
0
0
0
0
0
6
ec00ae13223155e091718ebe8d9619e62c2b089f
31
py
Python
a38/__init__.py
tappoz/python-a38
12d817d82f57019b818f4fd9a76ae1cffd955af7
[ "Apache-2.0" ]
null
null
null
a38/__init__.py
tappoz/python-a38
12d817d82f57019b818f4fd9a76ae1cffd955af7
[ "Apache-2.0" ]
null
null
null
a38/__init__.py
tappoz/python-a38
12d817d82f57019b818f4fd9a76ae1cffd955af7
[ "Apache-2.0" ]
null
null
null
from .fattura import * # noqa
15.5
30
0.677419
4
31
5.25
1
0
0
0
0
0
0
0
0
0
0
0
0.225806
31
1
31
31
0.875
0.129032
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
ec2e785f4019da6bb42b504c5bf11c80bef18cb3
143,150
py
Python
satellite_combos.py
mfkiwl/snapshot-gnss-algorithms
4ee4a7874f6b69db08506bf50d4b44ae2aee0bea
[ "0BSD" ]
8
2021-06-19T20:39:17.000Z
2022-01-14T01:29:54.000Z
satellite_combos.py
zhufengGNSS/snapshot-gnss-algorithms
d9ca013c3738926b71abc3c0df55f7f34ece2fe3
[ "0BSD" ]
null
null
null
satellite_combos.py
zhufengGNSS/snapshot-gnss-algorithms
d9ca013c3738926b71abc3c0df55f7f34ece2fe3
[ "0BSD" ]
4
2021-06-26T13:18:20.000Z
2022-02-14T11:01:39.000Z
# -*- coding: utf-8 -*- """ Get specific pre-computed index combinations without itertools.combiantions(). Author: Jonas Beuchert """ import numpy as np storage = {} def get_combos(n, k): """Get all combinations of indices. Choose k elements from indices 0...n-1. Inputs: n - Total number of indices k - Number of indices to choose Outputs: combos - 2D NumPy array with all combinations with k elements Author: Jonas Beuchert """ if n not in storage: # Create storage for later use storage[n] = {} # Check if entry exists already if k not in storage[n]: if n == 15 and k == 1: storage[n][k] = np.array( [[0],[1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12],[13],[14]] ) elif n == 15 and k == 2: storage[n][k] = np.array( [[0,1],[0,2],[0,3],[0,4],[0,5],[0,6],[0,7],[0,8],[0,9],[0,10],[0,11],[0,12],[0,13],[0,14],[1,2],[1,3],[1,4],[1,5],[1,6],[1,7],[1,8],[1,9],[1,10],[1,11],[1,12],[1,13],[1,14],[2,3],[2,4],[2,5],[2,6],[2,7],[2,8],[2,9],[2,10],[2,11],[2,12],[2,13],[2,14],[3,4],[3,5],[3,6],[3,7],[3,8],[3,9],[3,10],[3,11],[3,12],[3,13],[3,14],[4,5],[4,6],[4,7],[4,8],[4,9],[4,10],[4,11],[4,12],[4,13],[4,14],[5,6],[5,7],[5,8],[5,9],[5,10],[5,11],[5,12],[5,13],[5,14],[6,7],[6,8],[6,9],[6,10],[6,11],[6,12],[6,13],[6,14],[7,8],[7,9],[7,10],[7,11],[7,12],[7,13],[7,14],[8,9],[8,10],[8,11],[8,12],[8,13],[8,14],[9,10],[9,11],[9,12],[9,13],[9,14],[10,11],[10,12],[10,13],[10,14],[11,12],[11,13],[11,14],[12,13],[12,14],[13,14]] ) elif n == 15 and k == 3: storage[n][k] = np.array( [[0,1,2],[0,1,3],[0,1,4],[0,1,5],[0,1,6],[0,1,7],[0,1,8],[0,1,9],[0,1,10],[0,1,11],[0,1,12],[0,1,13],[0,1,14],[0,2,3],[0,2,4],[0,2,5],[0,2,6],[0,2,7],[0,2,8],[0,2,9],[0,2,10],[0,2,11],[0,2,12],[0,2,13],[0,2,14],[0,3,4],[0,3,5],[0,3,6],[0,3,7],[0,3,8],[0,3,9],[0,3,10],[0,3,11],[0,3,12],[0,3,13],[0,3,14],[0,4,5],[0,4,6],[0,4,7],[0,4,8],[0,4,9],[0,4,10],[0,4,11],[0,4,12],[0,4,13],[0,4,14],[0,5,6],[0,5,7],[0,5,8],[0,5,9],[0,5,10],[0,5,11],[0,5,12],[0,5,13],[0,5,14],[0,6,7],[0,6,8],[0,6,9],[0,6,10],[0,6,11],[0,6,12],[0,6,13],[0,6,14],[0,7,8],[0,7,9],[0,7,10],[0,7,11],[0,7,12],[0,7,13],[0,7,14],[0,8,9],[0,8,10],[0,8,11],[0,8,12],[0,8,13],[0,8,14],[0,9,10],[0,9,11],[0,9,12],[0,9,13],[0,9,14],[0,10,11],[0,10,12],[0,10,13],[0,10,14],[0,11,12],[0,11,13],[0,11,14],[0,12,13],[0,12,14],[0,13,14],[1,2,3],[1,2,4],[1,2,5],[1,2,6],[1,2,7],[1,2,8],[1,2,9],[1,2,10],[1,2,11],[1,2,12],[1,2,13],[1,2,14],[1,3,4],[1,3,5],[1,3,6],[1,3,7],[1,3,8],[1,3,9],[1,3,10],[1,3,11],[1,3,12],[1,3,13],[1,3,14],[1,4,5],[1,4,6],[1,4,7],[1,4,8],[1,4,9],[1,4,10],[1,4,11],[1,4,12],[1,4,13],[1,4,14],[1,5,6],[1,5,7],[1,5,8],[1,5,9],[1,5,10],[1,5,11],[1,5,12],[1,5,13],[1,5,14],[1,6,7],[1,6,8],[1,6,9],[1,6,10],[1,6,11],[1,6,12],[1,6,13],[1,6,14],[1,7,8],[1,7,9],[1,7,10],[1,7,11],[1,7,12],[1,7,13],[1,7,14],[1,8,9],[1,8,10],[1,8,11],[1,8,12],[1,8,13],[1,8,14],[1,9,10],[1,9,11],[1,9,12],[1,9,13],[1,9,14],[1,10,11],[1,10,12],[1,10,13],[1,10,14],[1,11,12],[1,11,13],[1,11,14],[1,12,13],[1,12,14],[1,13,14],[2,3,4],[2,3,5],[2,3,6],[2,3,7],[2,3,8],[2,3,9],[2,3,10],[2,3,11],[2,3,12],[2,3,13],[2,3,14],[2,4,5],[2,4,6],[2,4,7],[2,4,8],[2,4,9],[2,4,10],[2,4,11],[2,4,12],[2,4,13],[2,4,14],[2,5,6],[2,5,7],[2,5,8],[2,5,9],[2,5,10],[2,5,11],[2,5,12],[2,5,13],[2,5,14],[2,6,7],[2,6,8],[2,6,9],[2,6,10],[2,6,11],[2,6,12],[2,6,13],[2,6,14],[2,7,8],[2,7,9],[2,7,10],[2,7,11],[2,7,12],[2,7,13],[2,7,14],[2,8,9],[2,8,10],[2,8,11],[2,8,12],[2,8,13],[2,8,14],[2,9,10],[2,9,11],[2,9,12],[2,9,13],[2,9,14],[2,10,11],[2,10,12],[2,10,13],[2,10,14],[2,11,12],[2,11,13],[2,11,14],[2,12,13],[2,12,14],[2,13,14],[3,4,5],[3,4,6],[3,4,7],[3,4,8],[3,4,9],[3,4,10],[3,4,11],[3,4,12],[3,4,13],[3,4,14],[3,5,6],[3,5,7],[3,5,8],[3,5,9],[3,5,10],[3,5,11],[3,5,12],[3,5,13],[3,5,14],[3,6,7],[3,6,8],[3,6,9],[3,6,10],[3,6,11],[3,6,12],[3,6,13],[3,6,14],[3,7,8],[3,7,9],[3,7,10],[3,7,11],[3,7,12],[3,7,13],[3,7,14],[3,8,9],[3,8,10],[3,8,11],[3,8,12],[3,8,13],[3,8,14],[3,9,10],[3,9,11],[3,9,12],[3,9,13],[3,9,14],[3,10,11],[3,10,12],[3,10,13],[3,10,14],[3,11,12],[3,11,13],[3,11,14],[3,12,13],[3,12,14],[3,13,14],[4,5,6],[4,5,7],[4,5,8],[4,5,9],[4,5,10],[4,5,11],[4,5,12],[4,5,13],[4,5,14],[4,6,7],[4,6,8],[4,6,9],[4,6,10],[4,6,11],[4,6,12],[4,6,13],[4,6,14],[4,7,8],[4,7,9],[4,7,10],[4,7,11],[4,7,12],[4,7,13],[4,7,14],[4,8,9],[4,8,10],[4,8,11],[4,8,12],[4,8,13],[4,8,14],[4,9,10],[4,9,11],[4,9,12],[4,9,13],[4,9,14],[4,10,11],[4,10,12],[4,10,13],[4,10,14],[4,11,12],[4,11,13],[4,11,14],[4,12,13],[4,12,14],[4,13,14],[5,6,7],[5,6,8],[5,6,9],[5,6,10],[5,6,11],[5,6,12],[5,6,13],[5,6,14],[5,7,8],[5,7,9],[5,7,10],[5,7,11],[5,7,12],[5,7,13],[5,7,14],[5,8,9],[5,8,10],[5,8,11],[5,8,12],[5,8,13],[5,8,14],[5,9,10],[5,9,11],[5,9,12],[5,9,13],[5,9,14],[5,10,11],[5,10,12],[5,10,13],[5,10,14],[5,11,12],[5,11,13],[5,11,14],[5,12,13],[5,12,14],[5,13,14],[6,7,8],[6,7,9],[6,7,10],[6,7,11],[6,7,12],[6,7,13],[6,7,14],[6,8,9],[6,8,10],[6,8,11],[6,8,12],[6,8,13],[6,8,14],[6,9,10],[6,9,11],[6,9,12],[6,9,13],[6,9,14],[6,10,11],[6,10,12],[6,10,13],[6,10,14],[6,11,12],[6,11,13],[6,11,14],[6,12,13],[6,12,14],[6,13,14],[7,8,9],[7,8,10],[7,8,11],[7,8,12],[7,8,13],[7,8,14],[7,9,10],[7,9,11],[7,9,12],[7,9,13],[7,9,14],[7,10,11],[7,10,12],[7,10,13],[7,10,14],[7,11,12],[7,11,13],[7,11,14],[7,12,13],[7,12,14],[7,13,14],[8,9,10],[8,9,11],[8,9,12],[8,9,13],[8,9,14],[8,10,11],[8,10,12],[8,10,13],[8,10,14],[8,11,12],[8,11,13],[8,11,14],[8,12,13],[8,12,14],[8,13,14],[9,10,11],[9,10,12],[9,10,13],[9,10,14],[9,11,12],[9,11,13],[9,11,14],[9,12,13],[9,12,14],[9,13,14],[10,11,12],[10,11,13],[10,11,14],[10,12,13],[10,12,14],[10,13,14],[11,12,13],[11,12,14],[11,13,14],[12,13,14]] ) elif n == 15 and k == 4: storage[n][k] = np.array( [[0,1,2,3],[0,1,2,4],[0,1,2,5],[0,1,2,6],[0,1,2,7],[0,1,2,8],[0,1,2,9],[0,1,2,10],[0,1,2,11],[0,1,2,12],[0,1,2,13],[0,1,2,14],[0,1,3,4],[0,1,3,5],[0,1,3,6],[0,1,3,7],[0,1,3,8],[0,1,3,9],[0,1,3,10],[0,1,3,11],[0,1,3,12],[0,1,3,13],[0,1,3,14],[0,1,4,5],[0,1,4,6],[0,1,4,7],[0,1,4,8],[0,1,4,9],[0,1,4,10],[0,1,4,11],[0,1,4,12],[0,1,4,13],[0,1,4,14],[0,1,5,6],[0,1,5,7],[0,1,5,8],[0,1,5,9],[0,1,5,10],[0,1,5,11],[0,1,5,12],[0,1,5,13],[0,1,5,14],[0,1,6,7],[0,1,6,8],[0,1,6,9],[0,1,6,10],[0,1,6,11],[0,1,6,12],[0,1,6,13],[0,1,6,14],[0,1,7,8],[0,1,7,9],[0,1,7,10],[0,1,7,11],[0,1,7,12],[0,1,7,13],[0,1,7,14],[0,1,8,9],[0,1,8,10],[0,1,8,11],[0,1,8,12],[0,1,8,13],[0,1,8,14],[0,1,9,10],[0,1,9,11],[0,1,9,12],[0,1,9,13],[0,1,9,14],[0,1,10,11],[0,1,10,12],[0,1,10,13],[0,1,10,14],[0,1,11,12],[0,1,11,13],[0,1,11,14],[0,1,12,13],[0,1,12,14],[0,1,13,14],[0,2,3,4],[0,2,3,5],[0,2,3,6],[0,2,3,7],[0,2,3,8],[0,2,3,9],[0,2,3,10],[0,2,3,11],[0,2,3,12],[0,2,3,13],[0,2,3,14],[0,2,4,5],[0,2,4,6],[0,2,4,7],[0,2,4,8],[0,2,4,9],[0,2,4,10],[0,2,4,11],[0,2,4,12],[0,2,4,13],[0,2,4,14],[0,2,5,6],[0,2,5,7],[0,2,5,8],[0,2,5,9],[0,2,5,10],[0,2,5,11],[0,2,5,12],[0,2,5,13],[0,2,5,14],[0,2,6,7],[0,2,6,8],[0,2,6,9],[0,2,6,10],[0,2,6,11],[0,2,6,12],[0,2,6,13],[0,2,6,14],[0,2,7,8],[0,2,7,9],[0,2,7,10],[0,2,7,11],[0,2,7,12],[0,2,7,13],[0,2,7,14],[0,2,8,9],[0,2,8,10],[0,2,8,11],[0,2,8,12],[0,2,8,13],[0,2,8,14],[0,2,9,10],[0,2,9,11],[0,2,9,12],[0,2,9,13],[0,2,9,14],[0,2,10,11],[0,2,10,12],[0,2,10,13],[0,2,10,14],[0,2,11,12],[0,2,11,13],[0,2,11,14],[0,2,12,13],[0,2,12,14],[0,2,13,14],[0,3,4,5],[0,3,4,6],[0,3,4,7],[0,3,4,8],[0,3,4,9],[0,3,4,10],[0,3,4,11],[0,3,4,12],[0,3,4,13],[0,3,4,14],[0,3,5,6],[0,3,5,7],[0,3,5,8],[0,3,5,9],[0,3,5,10],[0,3,5,11],[0,3,5,12],[0,3,5,13],[0,3,5,14],[0,3,6,7],[0,3,6,8],[0,3,6,9],[0,3,6,10],[0,3,6,11],[0,3,6,12],[0,3,6,13],[0,3,6,14],[0,3,7,8],[0,3,7,9],[0,3,7,10],[0,3,7,11],[0,3,7,12],[0,3,7,13],[0,3,7,14],[0,3,8,9],[0,3,8,10],[0,3,8,11],[0,3,8,12],[0,3,8,13],[0,3,8,14],[0,3,9,10],[0,3,9,11],[0,3,9,12],[0,3,9,13],[0,3,9,14],[0,3,10,11],[0,3,10,12],[0,3,10,13],[0,3,10,14],[0,3,11,12],[0,3,11,13],[0,3,11,14],[0,3,12,13],[0,3,12,14],[0,3,13,14],[0,4,5,6],[0,4,5,7],[0,4,5,8],[0,4,5,9],[0,4,5,10],[0,4,5,11],[0,4,5,12],[0,4,5,13],[0,4,5,14],[0,4,6,7],[0,4,6,8],[0,4,6,9],[0,4,6,10],[0,4,6,11],[0,4,6,12],[0,4,6,13],[0,4,6,14],[0,4,7,8],[0,4,7,9],[0,4,7,10],[0,4,7,11],[0,4,7,12],[0,4,7,13],[0,4,7,14],[0,4,8,9],[0,4,8,10],[0,4,8,11],[0,4,8,12],[0,4,8,13],[0,4,8,14],[0,4,9,10],[0,4,9,11],[0,4,9,12],[0,4,9,13],[0,4,9,14],[0,4,10,11],[0,4,10,12],[0,4,10,13],[0,4,10,14],[0,4,11,12],[0,4,11,13],[0,4,11,14],[0,4,12,13],[0,4,12,14],[0,4,13,14],[0,5,6,7],[0,5,6,8],[0,5,6,9],[0,5,6,10],[0,5,6,11],[0,5,6,12],[0,5,6,13],[0,5,6,14],[0,5,7,8],[0,5,7,9],[0,5,7,10],[0,5,7,11],[0,5,7,12],[0,5,7,13],[0,5,7,14],[0,5,8,9],[0,5,8,10],[0,5,8,11],[0,5,8,12],[0,5,8,13],[0,5,8,14],[0,5,9,10],[0,5,9,11],[0,5,9,12],[0,5,9,13],[0,5,9,14],[0,5,10,11],[0,5,10,12],[0,5,10,13],[0,5,10,14],[0,5,11,12],[0,5,11,13],[0,5,11,14],[0,5,12,13],[0,5,12,14],[0,5,13,14],[0,6,7,8],[0,6,7,9],[0,6,7,10],[0,6,7,11],[0,6,7,12],[0,6,7,13],[0,6,7,14],[0,6,8,9],[0,6,8,10],[0,6,8,11],[0,6,8,12],[0,6,8,13],[0,6,8,14],[0,6,9,10],[0,6,9,11],[0,6,9,12],[0,6,9,13],[0,6,9,14],[0,6,10,11],[0,6,10,12],[0,6,10,13],[0,6,10,14],[0,6,11,12],[0,6,11,13],[0,6,11,14],[0,6,12,13],[0,6,12,14],[0,6,13,14],[0,7,8,9],[0,7,8,10],[0,7,8,11],[0,7,8,12],[0,7,8,13],[0,7,8,14],[0,7,9,10],[0,7,9,11],[0,7,9,12],[0,7,9,13],[0,7,9,14],[0,7,10,11],[0,7,10,12],[0,7,10,13],[0,7,10,14],[0,7,11,12],[0,7,11,13],[0,7,11,14],[0,7,12,13],[0,7,12,14],[0,7,13,14],[0,8,9,10],[0,8,9,11],[0,8,9,12],[0,8,9,13],[0,8,9,14],[0,8,10,11],[0,8,10,12],[0,8,10,13],[0,8,10,14],[0,8,11,12],[0,8,11,13],[0,8,11,14],[0,8,12,13],[0,8,12,14],[0,8,13,14],[0,9,10,11],[0,9,10,12],[0,9,10,13],[0,9,10,14],[0,9,11,12],[0,9,11,13],[0,9,11,14],[0,9,12,13],[0,9,12,14],[0,9,13,14],[0,10,11,12],[0,10,11,13],[0,10,11,14],[0,10,12,13],[0,10,12,14],[0,10,13,14],[0,11,12,13],[0,11,12,14],[0,11,13,14],[0,12,13,14],[1,2,3,4],[1,2,3,5],[1,2,3,6],[1,2,3,7],[1,2,3,8],[1,2,3,9],[1,2,3,10],[1,2,3,11],[1,2,3,12],[1,2,3,13],[1,2,3,14],[1,2,4,5],[1,2,4,6],[1,2,4,7],[1,2,4,8],[1,2,4,9],[1,2,4,10],[1,2,4,11],[1,2,4,12],[1,2,4,13],[1,2,4,14],[1,2,5,6],[1,2,5,7],[1,2,5,8],[1,2,5,9],[1,2,5,10],[1,2,5,11],[1,2,5,12],[1,2,5,13],[1,2,5,14],[1,2,6,7],[1,2,6,8],[1,2,6,9],[1,2,6,10],[1,2,6,11],[1,2,6,12],[1,2,6,13],[1,2,6,14],[1,2,7,8],[1,2,7,9],[1,2,7,10],[1,2,7,11],[1,2,7,12],[1,2,7,13],[1,2,7,14],[1,2,8,9],[1,2,8,10],[1,2,8,11],[1,2,8,12],[1,2,8,13],[1,2,8,14],[1,2,9,10],[1,2,9,11],[1,2,9,12],[1,2,9,13],[1,2,9,14],[1,2,10,11],[1,2,10,12],[1,2,10,13],[1,2,10,14],[1,2,11,12],[1,2,11,13],[1,2,11,14],[1,2,12,13],[1,2,12,14],[1,2,13,14],[1,3,4,5],[1,3,4,6],[1,3,4,7],[1,3,4,8],[1,3,4,9],[1,3,4,10],[1,3,4,11],[1,3,4,12],[1,3,4,13],[1,3,4,14],[1,3,5,6],[1,3,5,7],[1,3,5,8],[1,3,5,9],[1,3,5,10],[1,3,5,11],[1,3,5,12],[1,3,5,13],[1,3,5,14],[1,3,6,7],[1,3,6,8],[1,3,6,9],[1,3,6,10],[1,3,6,11],[1,3,6,12],[1,3,6,13],[1,3,6,14],[1,3,7,8],[1,3,7,9],[1,3,7,10],[1,3,7,11],[1,3,7,12],[1,3,7,13],[1,3,7,14],[1,3,8,9],[1,3,8,10],[1,3,8,11],[1,3,8,12],[1,3,8,13],[1,3,8,14],[1,3,9,10],[1,3,9,11],[1,3,9,12],[1,3,9,13],[1,3,9,14],[1,3,10,11],[1,3,10,12],[1,3,10,13],[1,3,10,14],[1,3,11,12],[1,3,11,13],[1,3,11,14],[1,3,12,13],[1,3,12,14],[1,3,13,14],[1,4,5,6],[1,4,5,7],[1,4,5,8],[1,4,5,9],[1,4,5,10],[1,4,5,11],[1,4,5,12],[1,4,5,13],[1,4,5,14],[1,4,6,7],[1,4,6,8],[1,4,6,9],[1,4,6,10],[1,4,6,11],[1,4,6,12],[1,4,6,13],[1,4,6,14],[1,4,7,8],[1,4,7,9],[1,4,7,10],[1,4,7,11],[1,4,7,12],[1,4,7,13],[1,4,7,14],[1,4,8,9],[1,4,8,10],[1,4,8,11],[1,4,8,12],[1,4,8,13],[1,4,8,14],[1,4,9,10],[1,4,9,11],[1,4,9,12],[1,4,9,13],[1,4,9,14],[1,4,10,11],[1,4,10,12],[1,4,10,13],[1,4,10,14],[1,4,11,12],[1,4,11,13],[1,4,11,14],[1,4,12,13],[1,4,12,14],[1,4,13,14],[1,5,6,7],[1,5,6,8],[1,5,6,9],[1,5,6,10],[1,5,6,11],[1,5,6,12],[1,5,6,13],[1,5,6,14],[1,5,7,8],[1,5,7,9],[1,5,7,10],[1,5,7,11],[1,5,7,12],[1,5,7,13],[1,5,7,14],[1,5,8,9],[1,5,8,10],[1,5,8,11],[1,5,8,12],[1,5,8,13],[1,5,8,14],[1,5,9,10],[1,5,9,11],[1,5,9,12],[1,5,9,13],[1,5,9,14],[1,5,10,11],[1,5,10,12],[1,5,10,13],[1,5,10,14],[1,5,11,12],[1,5,11,13],[1,5,11,14],[1,5,12,13],[1,5,12,14],[1,5,13,14],[1,6,7,8],[1,6,7,9],[1,6,7,10],[1,6,7,11],[1,6,7,12],[1,6,7,13],[1,6,7,14],[1,6,8,9],[1,6,8,10],[1,6,8,11],[1,6,8,12],[1,6,8,13],[1,6,8,14],[1,6,9,10],[1,6,9,11],[1,6,9,12],[1,6,9,13],[1,6,9,14],[1,6,10,11],[1,6,10,12],[1,6,10,13],[1,6,10,14],[1,6,11,12],[1,6,11,13],[1,6,11,14],[1,6,12,13],[1,6,12,14],[1,6,13,14],[1,7,8,9],[1,7,8,10],[1,7,8,11],[1,7,8,12],[1,7,8,13],[1,7,8,14],[1,7,9,10],[1,7,9,11],[1,7,9,12],[1,7,9,13],[1,7,9,14],[1,7,10,11],[1,7,10,12],[1,7,10,13],[1,7,10,14],[1,7,11,12],[1,7,11,13],[1,7,11,14],[1,7,12,13],[1,7,12,14],[1,7,13,14],[1,8,9,10],[1,8,9,11],[1,8,9,12],[1,8,9,13],[1,8,9,14],[1,8,10,11],[1,8,10,12],[1,8,10,13],[1,8,10,14],[1,8,11,12],[1,8,11,13],[1,8,11,14],[1,8,12,13],[1,8,12,14],[1,8,13,14],[1,9,10,11],[1,9,10,12],[1,9,10,13],[1,9,10,14],[1,9,11,12],[1,9,11,13],[1,9,11,14],[1,9,12,13],[1,9,12,14],[1,9,13,14],[1,10,11,12],[1,10,11,13],[1,10,11,14],[1,10,12,13],[1,10,12,14],[1,10,13,14],[1,11,12,13],[1,11,12,14],[1,11,13,14],[1,12,13,14],[2,3,4,5],[2,3,4,6],[2,3,4,7],[2,3,4,8],[2,3,4,9],[2,3,4,10],[2,3,4,11],[2,3,4,12],[2,3,4,13],[2,3,4,14],[2,3,5,6],[2,3,5,7],[2,3,5,8],[2,3,5,9],[2,3,5,10],[2,3,5,11],[2,3,5,12],[2,3,5,13],[2,3,5,14],[2,3,6,7],[2,3,6,8],[2,3,6,9],[2,3,6,10],[2,3,6,11],[2,3,6,12],[2,3,6,13],[2,3,6,14],[2,3,7,8],[2,3,7,9],[2,3,7,10],[2,3,7,11],[2,3,7,12],[2,3,7,13],[2,3,7,14],[2,3,8,9],[2,3,8,10],[2,3,8,11],[2,3,8,12],[2,3,8,13],[2,3,8,14],[2,3,9,10],[2,3,9,11],[2,3,9,12],[2,3,9,13],[2,3,9,14],[2,3,10,11],[2,3,10,12],[2,3,10,13],[2,3,10,14],[2,3,11,12],[2,3,11,13],[2,3,11,14],[2,3,12,13],[2,3,12,14],[2,3,13,14],[2,4,5,6],[2,4,5,7],[2,4,5,8],[2,4,5,9],[2,4,5,10],[2,4,5,11],[2,4,5,12],[2,4,5,13],[2,4,5,14],[2,4,6,7],[2,4,6,8],[2,4,6,9],[2,4,6,10],[2,4,6,11],[2,4,6,12],[2,4,6,13],[2,4,6,14],[2,4,7,8],[2,4,7,9],[2,4,7,10],[2,4,7,11],[2,4,7,12],[2,4,7,13],[2,4,7,14],[2,4,8,9],[2,4,8,10],[2,4,8,11],[2,4,8,12],[2,4,8,13],[2,4,8,14],[2,4,9,10],[2,4,9,11],[2,4,9,12],[2,4,9,13],[2,4,9,14],[2,4,10,11],[2,4,10,12],[2,4,10,13],[2,4,10,14],[2,4,11,12],[2,4,11,13],[2,4,11,14],[2,4,12,13],[2,4,12,14],[2,4,13,14],[2,5,6,7],[2,5,6,8],[2,5,6,9],[2,5,6,10],[2,5,6,11],[2,5,6,12],[2,5,6,13],[2,5,6,14],[2,5,7,8],[2,5,7,9],[2,5,7,10],[2,5,7,11],[2,5,7,12],[2,5,7,13],[2,5,7,14],[2,5,8,9],[2,5,8,10],[2,5,8,11],[2,5,8,12],[2,5,8,13],[2,5,8,14],[2,5,9,10],[2,5,9,11],[2,5,9,12],[2,5,9,13],[2,5,9,14],[2,5,10,11],[2,5,10,12],[2,5,10,13],[2,5,10,14],[2,5,11,12],[2,5,11,13],[2,5,11,14],[2,5,12,13],[2,5,12,14],[2,5,13,14],[2,6,7,8],[2,6,7,9],[2,6,7,10],[2,6,7,11],[2,6,7,12],[2,6,7,13],[2,6,7,14],[2,6,8,9],[2,6,8,10],[2,6,8,11],[2,6,8,12],[2,6,8,13],[2,6,8,14],[2,6,9,10],[2,6,9,11],[2,6,9,12],[2,6,9,13],[2,6,9,14],[2,6,10,11],[2,6,10,12],[2,6,10,13],[2,6,10,14],[2,6,11,12],[2,6,11,13],[2,6,11,14],[2,6,12,13],[2,6,12,14],[2,6,13,14],[2,7,8,9],[2,7,8,10],[2,7,8,11],[2,7,8,12],[2,7,8,13],[2,7,8,14],[2,7,9,10],[2,7,9,11],[2,7,9,12],[2,7,9,13],[2,7,9,14],[2,7,10,11],[2,7,10,12],[2,7,10,13],[2,7,10,14],[2,7,11,12],[2,7,11,13],[2,7,11,14],[2,7,12,13],[2,7,12,14],[2,7,13,14],[2,8,9,10],[2,8,9,11],[2,8,9,12],[2,8,9,13],[2,8,9,14],[2,8,10,11],[2,8,10,12],[2,8,10,13],[2,8,10,14],[2,8,11,12],[2,8,11,13],[2,8,11,14],[2,8,12,13],[2,8,12,14],[2,8,13,14],[2,9,10,11],[2,9,10,12],[2,9,10,13],[2,9,10,14],[2,9,11,12],[2,9,11,13],[2,9,11,14],[2,9,12,13],[2,9,12,14],[2,9,13,14],[2,10,11,12],[2,10,11,13],[2,10,11,14],[2,10,12,13],[2,10,12,14],[2,10,13,14],[2,11,12,13],[2,11,12,14],[2,11,13,14],[2,12,13,14],[3,4,5,6],[3,4,5,7],[3,4,5,8],[3,4,5,9],[3,4,5,10],[3,4,5,11],[3,4,5,12],[3,4,5,13],[3,4,5,14],[3,4,6,7],[3,4,6,8],[3,4,6,9],[3,4,6,10],[3,4,6,11],[3,4,6,12],[3,4,6,13],[3,4,6,14],[3,4,7,8],[3,4,7,9],[3,4,7,10],[3,4,7,11],[3,4,7,12],[3,4,7,13],[3,4,7,14],[3,4,8,9],[3,4,8,10],[3,4,8,11],[3,4,8,12],[3,4,8,13],[3,4,8,14],[3,4,9,10],[3,4,9,11],[3,4,9,12],[3,4,9,13],[3,4,9,14],[3,4,10,11],[3,4,10,12],[3,4,10,13],[3,4,10,14],[3,4,11,12],[3,4,11,13],[3,4,11,14],[3,4,12,13],[3,4,12,14],[3,4,13,14],[3,5,6,7],[3,5,6,8],[3,5,6,9],[3,5,6,10],[3,5,6,11],[3,5,6,12],[3,5,6,13],[3,5,6,14],[3,5,7,8],[3,5,7,9],[3,5,7,10],[3,5,7,11],[3,5,7,12],[3,5,7,13],[3,5,7,14],[3,5,8,9],[3,5,8,10],[3,5,8,11],[3,5,8,12],[3,5,8,13],[3,5,8,14],[3,5,9,10],[3,5,9,11],[3,5,9,12],[3,5,9,13],[3,5,9,14],[3,5,10,11],[3,5,10,12],[3,5,10,13],[3,5,10,14],[3,5,11,12],[3,5,11,13],[3,5,11,14],[3,5,12,13],[3,5,12,14],[3,5,13,14],[3,6,7,8],[3,6,7,9],[3,6,7,10],[3,6,7,11],[3,6,7,12],[3,6,7,13],[3,6,7,14],[3,6,8,9],[3,6,8,10],[3,6,8,11],[3,6,8,12],[3,6,8,13],[3,6,8,14],[3,6,9,10],[3,6,9,11],[3,6,9,12],[3,6,9,13],[3,6,9,14],[3,6,10,11],[3,6,10,12],[3,6,10,13],[3,6,10,14],[3,6,11,12],[3,6,11,13],[3,6,11,14],[3,6,12,13],[3,6,12,14],[3,6,13,14],[3,7,8,9],[3,7,8,10],[3,7,8,11],[3,7,8,12],[3,7,8,13],[3,7,8,14],[3,7,9,10],[3,7,9,11],[3,7,9,12],[3,7,9,13],[3,7,9,14],[3,7,10,11],[3,7,10,12],[3,7,10,13],[3,7,10,14],[3,7,11,12],[3,7,11,13],[3,7,11,14],[3,7,12,13],[3,7,12,14],[3,7,13,14],[3,8,9,10],[3,8,9,11],[3,8,9,12],[3,8,9,13],[3,8,9,14],[3,8,10,11],[3,8,10,12],[3,8,10,13],[3,8,10,14],[3,8,11,12],[3,8,11,13],[3,8,11,14],[3,8,12,13],[3,8,12,14],[3,8,13,14],[3,9,10,11],[3,9,10,12],[3,9,10,13],[3,9,10,14],[3,9,11,12],[3,9,11,13],[3,9,11,14],[3,9,12,13],[3,9,12,14],[3,9,13,14],[3,10,11,12],[3,10,11,13],[3,10,11,14],[3,10,12,13],[3,10,12,14],[3,10,13,14],[3,11,12,13],[3,11,12,14],[3,11,13,14],[3,12,13,14],[4,5,6,7],[4,5,6,8],[4,5,6,9],[4,5,6,10],[4,5,6,11],[4,5,6,12],[4,5,6,13],[4,5,6,14],[4,5,7,8],[4,5,7,9],[4,5,7,10],[4,5,7,11],[4,5,7,12],[4,5,7,13],[4,5,7,14],[4,5,8,9],[4,5,8,10],[4,5,8,11],[4,5,8,12],[4,5,8,13],[4,5,8,14],[4,5,9,10],[4,5,9,11],[4,5,9,12],[4,5,9,13],[4,5,9,14],[4,5,10,11],[4,5,10,12],[4,5,10,13],[4,5,10,14],[4,5,11,12],[4,5,11,13],[4,5,11,14],[4,5,12,13],[4,5,12,14],[4,5,13,14],[4,6,7,8],[4,6,7,9],[4,6,7,10],[4,6,7,11],[4,6,7,12],[4,6,7,13],[4,6,7,14],[4,6,8,9],[4,6,8,10],[4,6,8,11],[4,6,8,12],[4,6,8,13],[4,6,8,14],[4,6,9,10],[4,6,9,11],[4,6,9,12],[4,6,9,13],[4,6,9,14],[4,6,10,11],[4,6,10,12],[4,6,10,13],[4,6,10,14],[4,6,11,12],[4,6,11,13],[4,6,11,14],[4,6,12,13],[4,6,12,14],[4,6,13,14],[4,7,8,9],[4,7,8,10],[4,7,8,11],[4,7,8,12],[4,7,8,13],[4,7,8,14],[4,7,9,10],[4,7,9,11],[4,7,9,12],[4,7,9,13],[4,7,9,14],[4,7,10,11],[4,7,10,12],[4,7,10,13],[4,7,10,14],[4,7,11,12],[4,7,11,13],[4,7,11,14],[4,7,12,13],[4,7,12,14],[4,7,13,14],[4,8,9,10],[4,8,9,11],[4,8,9,12],[4,8,9,13],[4,8,9,14],[4,8,10,11],[4,8,10,12],[4,8,10,13],[4,8,10,14],[4,8,11,12],[4,8,11,13],[4,8,11,14],[4,8,12,13],[4,8,12,14],[4,8,13,14],[4,9,10,11],[4,9,10,12],[4,9,10,13],[4,9,10,14],[4,9,11,12],[4,9,11,13],[4,9,11,14],[4,9,12,13],[4,9,12,14],[4,9,13,14],[4,10,11,12],[4,10,11,13],[4,10,11,14],[4,10,12,13],[4,10,12,14],[4,10,13,14],[4,11,12,13],[4,11,12,14],[4,11,13,14],[4,12,13,14],[5,6,7,8],[5,6,7,9],[5,6,7,10],[5,6,7,11],[5,6,7,12],[5,6,7,13],[5,6,7,14],[5,6,8,9],[5,6,8,10],[5,6,8,11],[5,6,8,12],[5,6,8,13],[5,6,8,14],[5,6,9,10],[5,6,9,11],[5,6,9,12],[5,6,9,13],[5,6,9,14],[5,6,10,11],[5,6,10,12],[5,6,10,13],[5,6,10,14],[5,6,11,12],[5,6,11,13],[5,6,11,14],[5,6,12,13],[5,6,12,14],[5,6,13,14],[5,7,8,9],[5,7,8,10],[5,7,8,11],[5,7,8,12],[5,7,8,13],[5,7,8,14],[5,7,9,10],[5,7,9,11],[5,7,9,12],[5,7,9,13],[5,7,9,14],[5,7,10,11],[5,7,10,12],[5,7,10,13],[5,7,10,14],[5,7,11,12],[5,7,11,13],[5,7,11,14],[5,7,12,13],[5,7,12,14],[5,7,13,14],[5,8,9,10],[5,8,9,11],[5,8,9,12],[5,8,9,13],[5,8,9,14],[5,8,10,11],[5,8,10,12],[5,8,10,13],[5,8,10,14],[5,8,11,12],[5,8,11,13],[5,8,11,14],[5,8,12,13],[5,8,12,14],[5,8,13,14],[5,9,10,11],[5,9,10,12],[5,9,10,13],[5,9,10,14],[5,9,11,12],[5,9,11,13],[5,9,11,14],[5,9,12,13],[5,9,12,14],[5,9,13,14],[5,10,11,12],[5,10,11,13],[5,10,11,14],[5,10,12,13],[5,10,12,14],[5,10,13,14],[5,11,12,13],[5,11,12,14],[5,11,13,14],[5,12,13,14],[6,7,8,9],[6,7,8,10],[6,7,8,11],[6,7,8,12],[6,7,8,13],[6,7,8,14],[6,7,9,10],[6,7,9,11],[6,7,9,12],[6,7,9,13],[6,7,9,14],[6,7,10,11],[6,7,10,12],[6,7,10,13],[6,7,10,14],[6,7,11,12],[6,7,11,13],[6,7,11,14],[6,7,12,13],[6,7,12,14],[6,7,13,14],[6,8,9,10],[6,8,9,11],[6,8,9,12],[6,8,9,13],[6,8,9,14],[6,8,10,11],[6,8,10,12],[6,8,10,13],[6,8,10,14],[6,8,11,12],[6,8,11,13],[6,8,11,14],[6,8,12,13],[6,8,12,14],[6,8,13,14],[6,9,10,11],[6,9,10,12],[6,9,10,13],[6,9,10,14],[6,9,11,12],[6,9,11,13],[6,9,11,14],[6,9,12,13],[6,9,12,14],[6,9,13,14],[6,10,11,12],[6,10,11,13],[6,10,11,14],[6,10,12,13],[6,10,12,14],[6,10,13,14],[6,11,12,13],[6,11,12,14],[6,11,13,14],[6,12,13,14],[7,8,9,10],[7,8,9,11],[7,8,9,12],[7,8,9,13],[7,8,9,14],[7,8,10,11],[7,8,10,12],[7,8,10,13],[7,8,10,14],[7,8,11,12],[7,8,11,13],[7,8,11,14],[7,8,12,13],[7,8,12,14],[7,8,13,14],[7,9,10,11],[7,9,10,12],[7,9,10,13],[7,9,10,14],[7,9,11,12],[7,9,11,13],[7,9,11,14],[7,9,12,13],[7,9,12,14],[7,9,13,14],[7,10,11,12],[7,10,11,13],[7,10,11,14],[7,10,12,13],[7,10,12,14],[7,10,13,14],[7,11,12,13],[7,11,12,14],[7,11,13,14],[7,12,13,14],[8,9,10,11],[8,9,10,12],[8,9,10,13],[8,9,10,14],[8,9,11,12],[8,9,11,13],[8,9,11,14],[8,9,12,13],[8,9,12,14],[8,9,13,14],[8,10,11,12],[8,10,11,13],[8,10,11,14],[8,10,12,13],[8,10,12,14],[8,10,13,14],[8,11,12,13],[8,11,12,14],[8,11,13,14],[8,12,13,14],[9,10,11,12],[9,10,11,13],[9,10,11,14],[9,10,12,13],[9,10,12,14],[9,10,13,14],[9,11,12,13],[9,11,12,14],[9,11,13,14],[9,12,13,14],[10,11,12,13],[10,11,12,14],[10,11,13,14],[10,12,13,14],[11,12,13,14]] ) elif n == 15 and k == 5: storage[n][k] = np.array( [[0,1,2,3,4],[0,1,2,3,5],[0,1,2,3,6],[0,1,2,3,7],[0,1,2,3,8],[0,1,2,3,9],[0,1,2,3,10],[0,1,2,3,11],[0,1,2,3,12],[0,1,2,3,13],[0,1,2,3,14],[0,1,2,4,5],[0,1,2,4,6],[0,1,2,4,7],[0,1,2,4,8],[0,1,2,4,9],[0,1,2,4,10],[0,1,2,4,11],[0,1,2,4,12],[0,1,2,4,13],[0,1,2,4,14],[0,1,2,5,6],[0,1,2,5,7],[0,1,2,5,8],[0,1,2,5,9],[0,1,2,5,10],[0,1,2,5,11],[0,1,2,5,12],[0,1,2,5,13],[0,1,2,5,14],[0,1,2,6,7],[0,1,2,6,8],[0,1,2,6,9],[0,1,2,6,10],[0,1,2,6,11],[0,1,2,6,12],[0,1,2,6,13],[0,1,2,6,14],[0,1,2,7,8],[0,1,2,7,9],[0,1,2,7,10],[0,1,2,7,11],[0,1,2,7,12],[0,1,2,7,13],[0,1,2,7,14],[0,1,2,8,9],[0,1,2,8,10],[0,1,2,8,11],[0,1,2,8,12],[0,1,2,8,13],[0,1,2,8,14],[0,1,2,9,10],[0,1,2,9,11],[0,1,2,9,12],[0,1,2,9,13],[0,1,2,9,14],[0,1,2,10,11],[0,1,2,10,12],[0,1,2,10,13],[0,1,2,10,14],[0,1,2,11,12],[0,1,2,11,13],[0,1,2,11,14],[0,1,2,12,13],[0,1,2,12,14],[0,1,2,13,14],[0,1,3,4,5],[0,1,3,4,6],[0,1,3,4,7],[0,1,3,4,8],[0,1,3,4,9],[0,1,3,4,10],[0,1,3,4,11],[0,1,3,4,12],[0,1,3,4,13],[0,1,3,4,14],[0,1,3,5,6],[0,1,3,5,7],[0,1,3,5,8],[0,1,3,5,9],[0,1,3,5,10],[0,1,3,5,11],[0,1,3,5,12],[0,1,3,5,13],[0,1,3,5,14],[0,1,3,6,7],[0,1,3,6,8],[0,1,3,6,9],[0,1,3,6,10],[0,1,3,6,11],[0,1,3,6,12],[0,1,3,6,13],[0,1,3,6,14],[0,1,3,7,8],[0,1,3,7,9],[0,1,3,7,10],[0,1,3,7,11],[0,1,3,7,12],[0,1,3,7,13],[0,1,3,7,14],[0,1,3,8,9],[0,1,3,8,10],[0,1,3,8,11],[0,1,3,8,12],[0,1,3,8,13],[0,1,3,8,14],[0,1,3,9,10],[0,1,3,9,11],[0,1,3,9,12],[0,1,3,9,13],[0,1,3,9,14],[0,1,3,10,11],[0,1,3,10,12],[0,1,3,10,13],[0,1,3,10,14],[0,1,3,11,12],[0,1,3,11,13],[0,1,3,11,14],[0,1,3,12,13],[0,1,3,12,14],[0,1,3,13,14],[0,1,4,5,6],[0,1,4,5,7],[0,1,4,5,8],[0,1,4,5,9],[0,1,4,5,10],[0,1,4,5,11],[0,1,4,5,12],[0,1,4,5,13],[0,1,4,5,14],[0,1,4,6,7],[0,1,4,6,8],[0,1,4,6,9],[0,1,4,6,10],[0,1,4,6,11],[0,1,4,6,12],[0,1,4,6,13],[0,1,4,6,14],[0,1,4,7,8],[0,1,4,7,9],[0,1,4,7,10],[0,1,4,7,11],[0,1,4,7,12],[0,1,4,7,13],[0,1,4,7,14],[0,1,4,8,9],[0,1,4,8,10],[0,1,4,8,11],[0,1,4,8,12],[0,1,4,8,13],[0,1,4,8,14],[0,1,4,9,10],[0,1,4,9,11],[0,1,4,9,12],[0,1,4,9,13],[0,1,4,9,14],[0,1,4,10,11],[0,1,4,10,12],[0,1,4,10,13],[0,1,4,10,14],[0,1,4,11,12],[0,1,4,11,13],[0,1,4,11,14],[0,1,4,12,13],[0,1,4,12,14],[0,1,4,13,14],[0,1,5,6,7],[0,1,5,6,8],[0,1,5,6,9],[0,1,5,6,10],[0,1,5,6,11],[0,1,5,6,12],[0,1,5,6,13],[0,1,5,6,14],[0,1,5,7,8],[0,1,5,7,9],[0,1,5,7,10],[0,1,5,7,11],[0,1,5,7,12],[0,1,5,7,13],[0,1,5,7,14],[0,1,5,8,9],[0,1,5,8,10],[0,1,5,8,11],[0,1,5,8,12],[0,1,5,8,13],[0,1,5,8,14],[0,1,5,9,10],[0,1,5,9,11],[0,1,5,9,12],[0,1,5,9,13],[0,1,5,9,14],[0,1,5,10,11],[0,1,5,10,12],[0,1,5,10,13],[0,1,5,10,14],[0,1,5,11,12],[0,1,5,11,13],[0,1,5,11,14],[0,1,5,12,13],[0,1,5,12,14],[0,1,5,13,14],[0,1,6,7,8],[0,1,6,7,9],[0,1,6,7,10],[0,1,6,7,11],[0,1,6,7,12],[0,1,6,7,13],[0,1,6,7,14],[0,1,6,8,9],[0,1,6,8,10],[0,1,6,8,11],[0,1,6,8,12],[0,1,6,8,13],[0,1,6,8,14],[0,1,6,9,10],[0,1,6,9,11],[0,1,6,9,12],[0,1,6,9,13],[0,1,6,9,14],[0,1,6,10,11],[0,1,6,10,12],[0,1,6,10,13],[0,1,6,10,14],[0,1,6,11,12],[0,1,6,11,13],[0,1,6,11,14],[0,1,6,12,13],[0,1,6,12,14],[0,1,6,13,14],[0,1,7,8,9],[0,1,7,8,10],[0,1,7,8,11],[0,1,7,8,12],[0,1,7,8,13],[0,1,7,8,14],[0,1,7,9,10],[0,1,7,9,11],[0,1,7,9,12],[0,1,7,9,13],[0,1,7,9,14],[0,1,7,10,11],[0,1,7,10,12],[0,1,7,10,13],[0,1,7,10,14],[0,1,7,11,12],[0,1,7,11,13],[0,1,7,11,14],[0,1,7,12,13],[0,1,7,12,14],[0,1,7,13,14],[0,1,8,9,10],[0,1,8,9,11],[0,1,8,9,12],[0,1,8,9,13],[0,1,8,9,14],[0,1,8,10,11],[0,1,8,10,12],[0,1,8,10,13],[0,1,8,10,14],[0,1,8,11,12],[0,1,8,11,13],[0,1,8,11,14],[0,1,8,12,13],[0,1,8,12,14],[0,1,8,13,14],[0,1,9,10,11],[0,1,9,10,12],[0,1,9,10,13],[0,1,9,10,14],[0,1,9,11,12],[0,1,9,11,13],[0,1,9,11,14],[0,1,9,12,13],[0,1,9,12,14],[0,1,9,13,14],[0,1,10,11,12],[0,1,10,11,13],[0,1,10,11,14],[0,1,10,12,13],[0,1,10,12,14],[0,1,10,13,14],[0,1,11,12,13],[0,1,11,12,14],[0,1,11,13,14],[0,1,12,13,14],[0,2,3,4,5],[0,2,3,4,6],[0,2,3,4,7],[0,2,3,4,8],[0,2,3,4,9],[0,2,3,4,10],[0,2,3,4,11],[0,2,3,4,12],[0,2,3,4,13],[0,2,3,4,14],[0,2,3,5,6],[0,2,3,5,7],[0,2,3,5,8],[0,2,3,5,9],[0,2,3,5,10],[0,2,3,5,11],[0,2,3,5,12],[0,2,3,5,13],[0,2,3,5,14],[0,2,3,6,7],[0,2,3,6,8],[0,2,3,6,9],[0,2,3,6,10],[0,2,3,6,11],[0,2,3,6,12],[0,2,3,6,13],[0,2,3,6,14],[0,2,3,7,8],[0,2,3,7,9],[0,2,3,7,10],[0,2,3,7,11],[0,2,3,7,12],[0,2,3,7,13],[0,2,3,7,14],[0,2,3,8,9],[0,2,3,8,10],[0,2,3,8,11],[0,2,3,8,12],[0,2,3,8,13],[0,2,3,8,14],[0,2,3,9,10],[0,2,3,9,11],[0,2,3,9,12],[0,2,3,9,13],[0,2,3,9,14],[0,2,3,10,11],[0,2,3,10,12],[0,2,3,10,13],[0,2,3,10,14],[0,2,3,11,12],[0,2,3,11,13],[0,2,3,11,14],[0,2,3,12,13],[0,2,3,12,14],[0,2,3,13,14],[0,2,4,5,6],[0,2,4,5,7],[0,2,4,5,8],[0,2,4,5,9],[0,2,4,5,10],[0,2,4,5,11],[0,2,4,5,12],[0,2,4,5,13],[0,2,4,5,14],[0,2,4,6,7],[0,2,4,6,8],[0,2,4,6,9],[0,2,4,6,10],[0,2,4,6,11],[0,2,4,6,12],[0,2,4,6,13],[0,2,4,6,14],[0,2,4,7,8],[0,2,4,7,9],[0,2,4,7,10],[0,2,4,7,11],[0,2,4,7,12],[0,2,4,7,13],[0,2,4,7,14],[0,2,4,8,9],[0,2,4,8,10],[0,2,4,8,11],[0,2,4,8,12],[0,2,4,8,13],[0,2,4,8,14],[0,2,4,9,10],[0,2,4,9,11],[0,2,4,9,12],[0,2,4,9,13],[0,2,4,9,14],[0,2,4,10,11],[0,2,4,10,12],[0,2,4,10,13],[0,2,4,10,14],[0,2,4,11,12],[0,2,4,11,13],[0,2,4,11,14],[0,2,4,12,13],[0,2,4,12,14],[0,2,4,13,14],[0,2,5,6,7],[0,2,5,6,8],[0,2,5,6,9],[0,2,5,6,10],[0,2,5,6,11],[0,2,5,6,12],[0,2,5,6,13],[0,2,5,6,14],[0,2,5,7,8],[0,2,5,7,9],[0,2,5,7,10],[0,2,5,7,11],[0,2,5,7,12],[0,2,5,7,13],[0,2,5,7,14],[0,2,5,8,9],[0,2,5,8,10],[0,2,5,8,11],[0,2,5,8,12],[0,2,5,8,13],[0,2,5,8,14],[0,2,5,9,10],[0,2,5,9,11],[0,2,5,9,12],[0,2,5,9,13],[0,2,5,9,14],[0,2,5,10,11],[0,2,5,10,12],[0,2,5,10,13],[0,2,5,10,14],[0,2,5,11,12],[0,2,5,11,13],[0,2,5,11,14],[0,2,5,12,13],[0,2,5,12,14],[0,2,5,13,14],[0,2,6,7,8],[0,2,6,7,9],[0,2,6,7,10],[0,2,6,7,11],[0,2,6,7,12],[0,2,6,7,13],[0,2,6,7,14],[0,2,6,8,9],[0,2,6,8,10],[0,2,6,8,11],[0,2,6,8,12],[0,2,6,8,13],[0,2,6,8,14],[0,2,6,9,10],[0,2,6,9,11],[0,2,6,9,12],[0,2,6,9,13],[0,2,6,9,14],[0,2,6,10,11],[0,2,6,10,12],[0,2,6,10,13],[0,2,6,10,14],[0,2,6,11,12],[0,2,6,11,13],[0,2,6,11,14],[0,2,6,12,13],[0,2,6,12,14],[0,2,6,13,14],[0,2,7,8,9],[0,2,7,8,10],[0,2,7,8,11],[0,2,7,8,12],[0,2,7,8,13],[0,2,7,8,14],[0,2,7,9,10],[0,2,7,9,11],[0,2,7,9,12],[0,2,7,9,13],[0,2,7,9,14],[0,2,7,10,11],[0,2,7,10,12],[0,2,7,10,13],[0,2,7,10,14],[0,2,7,11,12],[0,2,7,11,13],[0,2,7,11,14],[0,2,7,12,13],[0,2,7,12,14],[0,2,7,13,14],[0,2,8,9,10],[0,2,8,9,11],[0,2,8,9,12],[0,2,8,9,13],[0,2,8,9,14],[0,2,8,10,11],[0,2,8,10,12],[0,2,8,10,13],[0,2,8,10,14],[0,2,8,11,12],[0,2,8,11,13],[0,2,8,11,14],[0,2,8,12,13],[0,2,8,12,14],[0,2,8,13,14],[0,2,9,10,11],[0,2,9,10,12],[0,2,9,10,13],[0,2,9,10,14],[0,2,9,11,12],[0,2,9,11,13],[0,2,9,11,14],[0,2,9,12,13],[0,2,9,12,14],[0,2,9,13,14],[0,2,10,11,12],[0,2,10,11,13],[0,2,10,11,14],[0,2,10,12,13],[0,2,10,12,14],[0,2,10,13,14],[0,2,11,12,13],[0,2,11,12,14],[0,2,11,13,14],[0,2,12,13,14],[0,3,4,5,6],[0,3,4,5,7],[0,3,4,5,8],[0,3,4,5,9],[0,3,4,5,10],[0,3,4,5,11],[0,3,4,5,12],[0,3,4,5,13],[0,3,4,5,14],[0,3,4,6,7],[0,3,4,6,8],[0,3,4,6,9],[0,3,4,6,10],[0,3,4,6,11],[0,3,4,6,12],[0,3,4,6,13],[0,3,4,6,14],[0,3,4,7,8],[0,3,4,7,9],[0,3,4,7,10],[0,3,4,7,11],[0,3,4,7,12],[0,3,4,7,13],[0,3,4,7,14],[0,3,4,8,9],[0,3,4,8,10],[0,3,4,8,11],[0,3,4,8,12],[0,3,4,8,13],[0,3,4,8,14],[0,3,4,9,10],[0,3,4,9,11],[0,3,4,9,12],[0,3,4,9,13],[0,3,4,9,14],[0,3,4,10,11],[0,3,4,10,12],[0,3,4,10,13],[0,3,4,10,14],[0,3,4,11,12],[0,3,4,11,13],[0,3,4,11,14],[0,3,4,12,13],[0,3,4,12,14],[0,3,4,13,14],[0,3,5,6,7],[0,3,5,6,8],[0,3,5,6,9],[0,3,5,6,10],[0,3,5,6,11],[0,3,5,6,12],[0,3,5,6,13],[0,3,5,6,14],[0,3,5,7,8],[0,3,5,7,9],[0,3,5,7,10],[0,3,5,7,11],[0,3,5,7,12],[0,3,5,7,13],[0,3,5,7,14],[0,3,5,8,9],[0,3,5,8,10],[0,3,5,8,11],[0,3,5,8,12],[0,3,5,8,13],[0,3,5,8,14],[0,3,5,9,10],[0,3,5,9,11],[0,3,5,9,12],[0,3,5,9,13],[0,3,5,9,14],[0,3,5,10,11],[0,3,5,10,12],[0,3,5,10,13],[0,3,5,10,14],[0,3,5,11,12],[0,3,5,11,13],[0,3,5,11,14],[0,3,5,12,13],[0,3,5,12,14],[0,3,5,13,14],[0,3,6,7,8],[0,3,6,7,9],[0,3,6,7,10],[0,3,6,7,11],[0,3,6,7,12],[0,3,6,7,13],[0,3,6,7,14],[0,3,6,8,9],[0,3,6,8,10],[0,3,6,8,11],[0,3,6,8,12],[0,3,6,8,13],[0,3,6,8,14],[0,3,6,9,10],[0,3,6,9,11],[0,3,6,9,12],[0,3,6,9,13],[0,3,6,9,14],[0,3,6,10,11],[0,3,6,10,12],[0,3,6,10,13],[0,3,6,10,14],[0,3,6,11,12],[0,3,6,11,13],[0,3,6,11,14],[0,3,6,12,13],[0,3,6,12,14],[0,3,6,13,14],[0,3,7,8,9],[0,3,7,8,10],[0,3,7,8,11],[0,3,7,8,12],[0,3,7,8,13],[0,3,7,8,14],[0,3,7,9,10],[0,3,7,9,11],[0,3,7,9,12],[0,3,7,9,13],[0,3,7,9,14],[0,3,7,10,11],[0,3,7,10,12],[0,3,7,10,13],[0,3,7,10,14],[0,3,7,11,12],[0,3,7,11,13],[0,3,7,11,14],[0,3,7,12,13],[0,3,7,12,14],[0,3,7,13,14],[0,3,8,9,10],[0,3,8,9,11],[0,3,8,9,12],[0,3,8,9,13],[0,3,8,9,14],[0,3,8,10,11],[0,3,8,10,12],[0,3,8,10,13],[0,3,8,10,14],[0,3,8,11,12],[0,3,8,11,13],[0,3,8,11,14],[0,3,8,12,13],[0,3,8,12,14],[0,3,8,13,14],[0,3,9,10,11],[0,3,9,10,12],[0,3,9,10,13],[0,3,9,10,14],[0,3,9,11,12],[0,3,9,11,13],[0,3,9,11,14],[0,3,9,12,13],[0,3,9,12,14],[0,3,9,13,14],[0,3,10,11,12],[0,3,10,11,13],[0,3,10,11,14],[0,3,10,12,13],[0,3,10,12,14],[0,3,10,13,14],[0,3,11,12,13],[0,3,11,12,14],[0,3,11,13,14],[0,3,12,13,14],[0,4,5,6,7],[0,4,5,6,8],[0,4,5,6,9],[0,4,5,6,10],[0,4,5,6,11],[0,4,5,6,12],[0,4,5,6,13],[0,4,5,6,14],[0,4,5,7,8],[0,4,5,7,9],[0,4,5,7,10],[0,4,5,7,11],[0,4,5,7,12],[0,4,5,7,13],[0,4,5,7,14],[0,4,5,8,9],[0,4,5,8,10],[0,4,5,8,11],[0,4,5,8,12],[0,4,5,8,13],[0,4,5,8,14],[0,4,5,9,10],[0,4,5,9,11],[0,4,5,9,12],[0,4,5,9,13],[0,4,5,9,14],[0,4,5,10,11],[0,4,5,10,12],[0,4,5,10,13],[0,4,5,10,14],[0,4,5,11,12],[0,4,5,11,13],[0,4,5,11,14],[0,4,5,12,13],[0,4,5,12,14],[0,4,5,13,14],[0,4,6,7,8],[0,4,6,7,9],[0,4,6,7,10],[0,4,6,7,11],[0,4,6,7,12],[0,4,6,7,13],[0,4,6,7,14],[0,4,6,8,9],[0,4,6,8,10],[0,4,6,8,11],[0,4,6,8,12],[0,4,6,8,13],[0,4,6,8,14],[0,4,6,9,10],[0,4,6,9,11],[0,4,6,9,12],[0,4,6,9,13],[0,4,6,9,14],[0,4,6,10,11],[0,4,6,10,12],[0,4,6,10,13],[0,4,6,10,14],[0,4,6,11,12],[0,4,6,11,13],[0,4,6,11,14],[0,4,6,12,13],[0,4,6,12,14],[0,4,6,13,14],[0,4,7,8,9],[0,4,7,8,10],[0,4,7,8,11],[0,4,7,8,12],[0,4,7,8,13],[0,4,7,8,14],[0,4,7,9,10],[0,4,7,9,11],[0,4,7,9,12],[0,4,7,9,13],[0,4,7,9,14],[0,4,7,10,11],[0,4,7,10,12],[0,4,7,10,13],[0,4,7,10,14],[0,4,7,11,12],[0,4,7,11,13],[0,4,7,11,14],[0,4,7,12,13],[0,4,7,12,14],[0,4,7,13,14],[0,4,8,9,10],[0,4,8,9,11],[0,4,8,9,12],[0,4,8,9,13],[0,4,8,9,14],[0,4,8,10,11],[0,4,8,10,12],[0,4,8,10,13],[0,4,8,10,14],[0,4,8,11,12],[0,4,8,11,13],[0,4,8,11,14],[0,4,8,12,13],[0,4,8,12,14],[0,4,8,13,14],[0,4,9,10,11],[0,4,9,10,12],[0,4,9,10,13],[0,4,9,10,14],[0,4,9,11,12],[0,4,9,11,13],[0,4,9,11,14],[0,4,9,12,13],[0,4,9,12,14],[0,4,9,13,14],[0,4,10,11,12],[0,4,10,11,13],[0,4,10,11,14],[0,4,10,12,13],[0,4,10,12,14],[0,4,10,13,14],[0,4,11,12,13],[0,4,11,12,14],[0,4,11,13,14],[0,4,12,13,14],[0,5,6,7,8],[0,5,6,7,9],[0,5,6,7,10],[0,5,6,7,11],[0,5,6,7,12],[0,5,6,7,13],[0,5,6,7,14],[0,5,6,8,9],[0,5,6,8,10],[0,5,6,8,11],[0,5,6,8,12],[0,5,6,8,13],[0,5,6,8,14],[0,5,6,9,10],[0,5,6,9,11],[0,5,6,9,12],[0,5,6,9,13],[0,5,6,9,14],[0,5,6,10,11],[0,5,6,10,12],[0,5,6,10,13],[0,5,6,10,14],[0,5,6,11,12],[0,5,6,11,13],[0,5,6,11,14],[0,5,6,12,13],[0,5,6,12,14],[0,5,6,13,14],[0,5,7,8,9],[0,5,7,8,10],[0,5,7,8,11],[0,5,7,8,12],[0,5,7,8,13],[0,5,7,8,14],[0,5,7,9,10],[0,5,7,9,11],[0,5,7,9,12],[0,5,7,9,13],[0,5,7,9,14],[0,5,7,10,11],[0,5,7,10,12],[0,5,7,10,13],[0,5,7,10,14],[0,5,7,11,12],[0,5,7,11,13],[0,5,7,11,14],[0,5,7,12,13],[0,5,7,12,14],[0,5,7,13,14],[0,5,8,9,10],[0,5,8,9,11],[0,5,8,9,12],[0,5,8,9,13],[0,5,8,9,14],[0,5,8,10,11],[0,5,8,10,12],[0,5,8,10,13],[0,5,8,10,14],[0,5,8,11,12],[0,5,8,11,13],[0,5,8,11,14],[0,5,8,12,13],[0,5,8,12,14],[0,5,8,13,14],[0,5,9,10,11],[0,5,9,10,12],[0,5,9,10,13],[0,5,9,10,14],[0,5,9,11,12],[0,5,9,11,13],[0,5,9,11,14],[0,5,9,12,13],[0,5,9,12,14],[0,5,9,13,14],[0,5,10,11,12],[0,5,10,11,13],[0,5,10,11,14],[0,5,10,12,13],[0,5,10,12,14],[0,5,10,13,14],[0,5,11,12,13],[0,5,11,12,14],[0,5,11,13,14],[0,5,12,13,14],[0,6,7,8,9],[0,6,7,8,10],[0,6,7,8,11],[0,6,7,8,12],[0,6,7,8,13],[0,6,7,8,14],[0,6,7,9,10],[0,6,7,9,11],[0,6,7,9,12],[0,6,7,9,13],[0,6,7,9,14],[0,6,7,10,11],[0,6,7,10,12],[0,6,7,10,13],[0,6,7,10,14],[0,6,7,11,12],[0,6,7,11,13],[0,6,7,11,14],[0,6,7,12,13],[0,6,7,12,14],[0,6,7,13,14],[0,6,8,9,10],[0,6,8,9,11],[0,6,8,9,12],[0,6,8,9,13],[0,6,8,9,14],[0,6,8,10,11],[0,6,8,10,12],[0,6,8,10,13],[0,6,8,10,14],[0,6,8,11,12],[0,6,8,11,13],[0,6,8,11,14],[0,6,8,12,13],[0,6,8,12,14],[0,6,8,13,14],[0,6,9,10,11],[0,6,9,10,12],[0,6,9,10,13],[0,6,9,10,14],[0,6,9,11,12],[0,6,9,11,13],[0,6,9,11,14],[0,6,9,12,13],[0,6,9,12,14],[0,6,9,13,14],[0,6,10,11,12],[0,6,10,11,13],[0,6,10,11,14],[0,6,10,12,13],[0,6,10,12,14],[0,6,10,13,14],[0,6,11,12,13],[0,6,11,12,14],[0,6,11,13,14],[0,6,12,13,14],[0,7,8,9,10],[0,7,8,9,11],[0,7,8,9,12],[0,7,8,9,13],[0,7,8,9,14],[0,7,8,10,11],[0,7,8,10,12],[0,7,8,10,13],[0,7,8,10,14],[0,7,8,11,12],[0,7,8,11,13],[0,7,8,11,14],[0,7,8,12,13],[0,7,8,12,14],[0,7,8,13,14],[0,7,9,10,11],[0,7,9,10,12],[0,7,9,10,13],[0,7,9,10,14],[0,7,9,11,12],[0,7,9,11,13],[0,7,9,11,14],[0,7,9,12,13],[0,7,9,12,14],[0,7,9,13,14],[0,7,10,11,12],[0,7,10,11,13],[0,7,10,11,14],[0,7,10,12,13],[0,7,10,12,14],[0,7,10,13,14],[0,7,11,12,13],[0,7,11,12,14],[0,7,11,13,14],[0,7,12,13,14],[0,8,9,10,11],[0,8,9,10,12],[0,8,9,10,13],[0,8,9,10,14],[0,8,9,11,12],[0,8,9,11,13],[0,8,9,11,14],[0,8,9,12,13],[0,8,9,12,14],[0,8,9,13,14],[0,8,10,11,12],[0,8,10,11,13],[0,8,10,11,14],[0,8,10,12,13],[0,8,10,12,14],[0,8,10,13,14],[0,8,11,12,13],[0,8,11,12,14],[0,8,11,13,14],[0,8,12,13,14],[0,9,10,11,12],[0,9,10,11,13],[0,9,10,11,14],[0,9,10,12,13],[0,9,10,12,14],[0,9,10,13,14],[0,9,11,12,13],[0,9,11,12,14],[0,9,11,13,14],[0,9,12,13,14],[0,10,11,12,13],[0,10,11,12,14],[0,10,11,13,14],[0,10,12,13,14],[0,11,12,13,14],[1,2,3,4,5],[1,2,3,4,6],[1,2,3,4,7],[1,2,3,4,8],[1,2,3,4,9],[1,2,3,4,10],[1,2,3,4,11],[1,2,3,4,12],[1,2,3,4,13],[1,2,3,4,14],[1,2,3,5,6],[1,2,3,5,7],[1,2,3,5,8],[1,2,3,5,9],[1,2,3,5,10],[1,2,3,5,11],[1,2,3,5,12],[1,2,3,5,13],[1,2,3,5,14],[1,2,3,6,7],[1,2,3,6,8],[1,2,3,6,9],[1,2,3,6,10],[1,2,3,6,11],[1,2,3,6,12],[1,2,3,6,13],[1,2,3,6,14],[1,2,3,7,8],[1,2,3,7,9],[1,2,3,7,10],[1,2,3,7,11],[1,2,3,7,12],[1,2,3,7,13],[1,2,3,7,14],[1,2,3,8,9],[1,2,3,8,10],[1,2,3,8,11],[1,2,3,8,12],[1,2,3,8,13],[1,2,3,8,14],[1,2,3,9,10],[1,2,3,9,11],[1,2,3,9,12],[1,2,3,9,13],[1,2,3,9,14],[1,2,3,10,11],[1,2,3,10,12],[1,2,3,10,13],[1,2,3,10,14],[1,2,3,11,12],[1,2,3,11,13],[1,2,3,11,14],[1,2,3,12,13],[1,2,3,12,14],[1,2,3,13,14],[1,2,4,5,6],[1,2,4,5,7],[1,2,4,5,8],[1,2,4,5,9],[1,2,4,5,10],[1,2,4,5,11],[1,2,4,5,12],[1,2,4,5,13],[1,2,4,5,14],[1,2,4,6,7],[1,2,4,6,8],[1,2,4,6,9],[1,2,4,6,10],[1,2,4,6,11],[1,2,4,6,12],[1,2,4,6,13],[1,2,4,6,14],[1,2,4,7,8],[1,2,4,7,9],[1,2,4,7,10],[1,2,4,7,11],[1,2,4,7,12],[1,2,4,7,13],[1,2,4,7,14],[1,2,4,8,9],[1,2,4,8,10],[1,2,4,8,11],[1,2,4,8,12],[1,2,4,8,13],[1,2,4,8,14],[1,2,4,9,10],[1,2,4,9,11],[1,2,4,9,12],[1,2,4,9,13],[1,2,4,9,14],[1,2,4,10,11],[1,2,4,10,12],[1,2,4,10,13],[1,2,4,10,14],[1,2,4,11,12],[1,2,4,11,13],[1,2,4,11,14],[1,2,4,12,13],[1,2,4,12,14],[1,2,4,13,14],[1,2,5,6,7],[1,2,5,6,8],[1,2,5,6,9],[1,2,5,6,10],[1,2,5,6,11],[1,2,5,6,12],[1,2,5,6,13],[1,2,5,6,14],[1,2,5,7,8],[1,2,5,7,9],[1,2,5,7,10],[1,2,5,7,11],[1,2,5,7,12],[1,2,5,7,13],[1,2,5,7,14],[1,2,5,8,9],[1,2,5,8,10],[1,2,5,8,11],[1,2,5,8,12],[1,2,5,8,13],[1,2,5,8,14],[1,2,5,9,10],[1,2,5,9,11],[1,2,5,9,12],[1,2,5,9,13],[1,2,5,9,14],[1,2,5,10,11],[1,2,5,10,12],[1,2,5,10,13],[1,2,5,10,14],[1,2,5,11,12],[1,2,5,11,13],[1,2,5,11,14],[1,2,5,12,13],[1,2,5,12,14],[1,2,5,13,14],[1,2,6,7,8],[1,2,6,7,9],[1,2,6,7,10],[1,2,6,7,11],[1,2,6,7,12],[1,2,6,7,13],[1,2,6,7,14],[1,2,6,8,9],[1,2,6,8,10],[1,2,6,8,11],[1,2,6,8,12],[1,2,6,8,13],[1,2,6,8,14],[1,2,6,9,10],[1,2,6,9,11],[1,2,6,9,12],[1,2,6,9,13],[1,2,6,9,14],[1,2,6,10,11],[1,2,6,10,12],[1,2,6,10,13],[1,2,6,10,14],[1,2,6,11,12],[1,2,6,11,13],[1,2,6,11,14],[1,2,6,12,13],[1,2,6,12,14],[1,2,6,13,14],[1,2,7,8,9],[1,2,7,8,10],[1,2,7,8,11],[1,2,7,8,12],[1,2,7,8,13],[1,2,7,8,14],[1,2,7,9,10],[1,2,7,9,11],[1,2,7,9,12],[1,2,7,9,13],[1,2,7,9,14],[1,2,7,10,11],[1,2,7,10,12],[1,2,7,10,13],[1,2,7,10,14],[1,2,7,11,12],[1,2,7,11,13],[1,2,7,11,14],[1,2,7,12,13],[1,2,7,12,14],[1,2,7,13,14],[1,2,8,9,10],[1,2,8,9,11],[1,2,8,9,12],[1,2,8,9,13],[1,2,8,9,14],[1,2,8,10,11],[1,2,8,10,12],[1,2,8,10,13],[1,2,8,10,14],[1,2,8,11,12],[1,2,8,11,13],[1,2,8,11,14],[1,2,8,12,13],[1,2,8,12,14],[1,2,8,13,14],[1,2,9,10,11],[1,2,9,10,12],[1,2,9,10,13],[1,2,9,10,14],[1,2,9,11,12],[1,2,9,11,13],[1,2,9,11,14],[1,2,9,12,13],[1,2,9,12,14],[1,2,9,13,14],[1,2,10,11,12],[1,2,10,11,13],[1,2,10,11,14],[1,2,10,12,13],[1,2,10,12,14],[1,2,10,13,14],[1,2,11,12,13],[1,2,11,12,14],[1,2,11,13,14],[1,2,12,13,14],[1,3,4,5,6],[1,3,4,5,7],[1,3,4,5,8],[1,3,4,5,9],[1,3,4,5,10],[1,3,4,5,11],[1,3,4,5,12],[1,3,4,5,13],[1,3,4,5,14],[1,3,4,6,7],[1,3,4,6,8],[1,3,4,6,9],[1,3,4,6,10],[1,3,4,6,11],[1,3,4,6,12],[1,3,4,6,13],[1,3,4,6,14],[1,3,4,7,8],[1,3,4,7,9],[1,3,4,7,10],[1,3,4,7,11],[1,3,4,7,12],[1,3,4,7,13],[1,3,4,7,14],[1,3,4,8,9],[1,3,4,8,10],[1,3,4,8,11],[1,3,4,8,12],[1,3,4,8,13],[1,3,4,8,14],[1,3,4,9,10],[1,3,4,9,11],[1,3,4,9,12],[1,3,4,9,13],[1,3,4,9,14],[1,3,4,10,11],[1,3,4,10,12],[1,3,4,10,13],[1,3,4,10,14],[1,3,4,11,12],[1,3,4,11,13],[1,3,4,11,14],[1,3,4,12,13],[1,3,4,12,14],[1,3,4,13,14],[1,3,5,6,7],[1,3,5,6,8],[1,3,5,6,9],[1,3,5,6,10],[1,3,5,6,11],[1,3,5,6,12],[1,3,5,6,13],[1,3,5,6,14],[1,3,5,7,8],[1,3,5,7,9],[1,3,5,7,10],[1,3,5,7,11],[1,3,5,7,12],[1,3,5,7,13],[1,3,5,7,14],[1,3,5,8,9],[1,3,5,8,10],[1,3,5,8,11],[1,3,5,8,12],[1,3,5,8,13],[1,3,5,8,14],[1,3,5,9,10],[1,3,5,9,11],[1,3,5,9,12],[1,3,5,9,13],[1,3,5,9,14],[1,3,5,10,11],[1,3,5,10,12],[1,3,5,10,13],[1,3,5,10,14],[1,3,5,11,12],[1,3,5,11,13],[1,3,5,11,14],[1,3,5,12,13],[1,3,5,12,14],[1,3,5,13,14],[1,3,6,7,8],[1,3,6,7,9],[1,3,6,7,10],[1,3,6,7,11],[1,3,6,7,12],[1,3,6,7,13],[1,3,6,7,14],[1,3,6,8,9],[1,3,6,8,10],[1,3,6,8,11],[1,3,6,8,12],[1,3,6,8,13],[1,3,6,8,14],[1,3,6,9,10],[1,3,6,9,11],[1,3,6,9,12],[1,3,6,9,13],[1,3,6,9,14],[1,3,6,10,11],[1,3,6,10,12],[1,3,6,10,13],[1,3,6,10,14],[1,3,6,11,12],[1,3,6,11,13],[1,3,6,11,14],[1,3,6,12,13],[1,3,6,12,14],[1,3,6,13,14],[1,3,7,8,9],[1,3,7,8,10],[1,3,7,8,11],[1,3,7,8,12],[1,3,7,8,13],[1,3,7,8,14],[1,3,7,9,10],[1,3,7,9,11],[1,3,7,9,12],[1,3,7,9,13],[1,3,7,9,14],[1,3,7,10,11],[1,3,7,10,12],[1,3,7,10,13],[1,3,7,10,14],[1,3,7,11,12],[1,3,7,11,13],[1,3,7,11,14],[1,3,7,12,13],[1,3,7,12,14],[1,3,7,13,14],[1,3,8,9,10],[1,3,8,9,11],[1,3,8,9,12],[1,3,8,9,13],[1,3,8,9,14],[1,3,8,10,11],[1,3,8,10,12],[1,3,8,10,13],[1,3,8,10,14],[1,3,8,11,12],[1,3,8,11,13],[1,3,8,11,14],[1,3,8,12,13],[1,3,8,12,14],[1,3,8,13,14],[1,3,9,10,11],[1,3,9,10,12],[1,3,9,10,13],[1,3,9,10,14],[1,3,9,11,12],[1,3,9,11,13],[1,3,9,11,14],[1,3,9,12,13],[1,3,9,12,14],[1,3,9,13,14],[1,3,10,11,12],[1,3,10,11,13],[1,3,10,11,14],[1,3,10,12,13],[1,3,10,12,14],[1,3,10,13,14],[1,3,11,12,13],[1,3,11,12,14],[1,3,11,13,14],[1,3,12,13,14],[1,4,5,6,7],[1,4,5,6,8],[1,4,5,6,9],[1,4,5,6,10],[1,4,5,6,11],[1,4,5,6,12],[1,4,5,6,13],[1,4,5,6,14],[1,4,5,7,8],[1,4,5,7,9],[1,4,5,7,10],[1,4,5,7,11],[1,4,5,7,12],[1,4,5,7,13],[1,4,5,7,14],[1,4,5,8,9],[1,4,5,8,10],[1,4,5,8,11],[1,4,5,8,12],[1,4,5,8,13],[1,4,5,8,14],[1,4,5,9,10],[1,4,5,9,11],[1,4,5,9,12],[1,4,5,9,13],[1,4,5,9,14],[1,4,5,10,11],[1,4,5,10,12],[1,4,5,10,13],[1,4,5,10,14],[1,4,5,11,12],[1,4,5,11,13],[1,4,5,11,14],[1,4,5,12,13],[1,4,5,12,14],[1,4,5,13,14],[1,4,6,7,8],[1,4,6,7,9],[1,4,6,7,10],[1,4,6,7,11],[1,4,6,7,12],[1,4,6,7,13],[1,4,6,7,14],[1,4,6,8,9],[1,4,6,8,10],[1,4,6,8,11],[1,4,6,8,12],[1,4,6,8,13],[1,4,6,8,14],[1,4,6,9,10],[1,4,6,9,11],[1,4,6,9,12],[1,4,6,9,13],[1,4,6,9,14],[1,4,6,10,11],[1,4,6,10,12],[1,4,6,10,13],[1,4,6,10,14],[1,4,6,11,12],[1,4,6,11,13],[1,4,6,11,14],[1,4,6,12,13],[1,4,6,12,14],[1,4,6,13,14],[1,4,7,8,9],[1,4,7,8,10],[1,4,7,8,11],[1,4,7,8,12],[1,4,7,8,13],[1,4,7,8,14],[1,4,7,9,10],[1,4,7,9,11],[1,4,7,9,12],[1,4,7,9,13],[1,4,7,9,14],[1,4,7,10,11],[1,4,7,10,12],[1,4,7,10,13],[1,4,7,10,14],[1,4,7,11,12],[1,4,7,11,13],[1,4,7,11,14],[1,4,7,12,13],[1,4,7,12,14],[1,4,7,13,14],[1,4,8,9,10],[1,4,8,9,11],[1,4,8,9,12],[1,4,8,9,13],[1,4,8,9,14],[1,4,8,10,11],[1,4,8,10,12],[1,4,8,10,13],[1,4,8,10,14],[1,4,8,11,12],[1,4,8,11,13],[1,4,8,11,14],[1,4,8,12,13],[1,4,8,12,14],[1,4,8,13,14],[1,4,9,10,11],[1,4,9,10,12],[1,4,9,10,13],[1,4,9,10,14],[1,4,9,11,12],[1,4,9,11,13],[1,4,9,11,14],[1,4,9,12,13],[1,4,9,12,14],[1,4,9,13,14],[1,4,10,11,12],[1,4,10,11,13],[1,4,10,11,14],[1,4,10,12,13],[1,4,10,12,14],[1,4,10,13,14],[1,4,11,12,13],[1,4,11,12,14],[1,4,11,13,14],[1,4,12,13,14],[1,5,6,7,8],[1,5,6,7,9],[1,5,6,7,10],[1,5,6,7,11],[1,5,6,7,12],[1,5,6,7,13],[1,5,6,7,14],[1,5,6,8,9],[1,5,6,8,10],[1,5,6,8,11],[1,5,6,8,12],[1,5,6,8,13],[1,5,6,8,14],[1,5,6,9,10],[1,5,6,9,11],[1,5,6,9,12],[1,5,6,9,13],[1,5,6,9,14],[1,5,6,10,11],[1,5,6,10,12],[1,5,6,10,13],[1,5,6,10,14],[1,5,6,11,12],[1,5,6,11,13],[1,5,6,11,14],[1,5,6,12,13],[1,5,6,12,14],[1,5,6,13,14],[1,5,7,8,9],[1,5,7,8,10],[1,5,7,8,11],[1,5,7,8,12],[1,5,7,8,13],[1,5,7,8,14],[1,5,7,9,10],[1,5,7,9,11],[1,5,7,9,12],[1,5,7,9,13],[1,5,7,9,14],[1,5,7,10,11],[1,5,7,10,12],[1,5,7,10,13],[1,5,7,10,14],[1,5,7,11,12],[1,5,7,11,13],[1,5,7,11,14],[1,5,7,12,13],[1,5,7,12,14],[1,5,7,13,14],[1,5,8,9,10],[1,5,8,9,11],[1,5,8,9,12],[1,5,8,9,13],[1,5,8,9,14],[1,5,8,10,11],[1,5,8,10,12],[1,5,8,10,13],[1,5,8,10,14],[1,5,8,11,12],[1,5,8,11,13],[1,5,8,11,14],[1,5,8,12,13],[1,5,8,12,14],[1,5,8,13,14],[1,5,9,10,11],[1,5,9,10,12],[1,5,9,10,13],[1,5,9,10,14],[1,5,9,11,12],[1,5,9,11,13],[1,5,9,11,14],[1,5,9,12,13],[1,5,9,12,14],[1,5,9,13,14],[1,5,10,11,12],[1,5,10,11,13],[1,5,10,11,14],[1,5,10,12,13],[1,5,10,12,14],[1,5,10,13,14],[1,5,11,12,13],[1,5,11,12,14],[1,5,11,13,14],[1,5,12,13,14],[1,6,7,8,9],[1,6,7,8,10],[1,6,7,8,11],[1,6,7,8,12],[1,6,7,8,13],[1,6,7,8,14],[1,6,7,9,10],[1,6,7,9,11],[1,6,7,9,12],[1,6,7,9,13],[1,6,7,9,14],[1,6,7,10,11],[1,6,7,10,12],[1,6,7,10,13],[1,6,7,10,14],[1,6,7,11,12],[1,6,7,11,13],[1,6,7,11,14],[1,6,7,12,13],[1,6,7,12,14],[1,6,7,13,14],[1,6,8,9,10],[1,6,8,9,11],[1,6,8,9,12],[1,6,8,9,13],[1,6,8,9,14],[1,6,8,10,11],[1,6,8,10,12],[1,6,8,10,13],[1,6,8,10,14],[1,6,8,11,12],[1,6,8,11,13],[1,6,8,11,14],[1,6,8,12,13],[1,6,8,12,14],[1,6,8,13,14],[1,6,9,10,11],[1,6,9,10,12],[1,6,9,10,13],[1,6,9,10,14],[1,6,9,11,12],[1,6,9,11,13],[1,6,9,11,14],[1,6,9,12,13],[1,6,9,12,14],[1,6,9,13,14],[1,6,10,11,12],[1,6,10,11,13],[1,6,10,11,14],[1,6,10,12,13],[1,6,10,12,14],[1,6,10,13,14],[1,6,11,12,13],[1,6,11,12,14],[1,6,11,13,14],[1,6,12,13,14],[1,7,8,9,10],[1,7,8,9,11],[1,7,8,9,12],[1,7,8,9,13],[1,7,8,9,14],[1,7,8,10,11],[1,7,8,10,12],[1,7,8,10,13],[1,7,8,10,14],[1,7,8,11,12],[1,7,8,11,13],[1,7,8,11,14],[1,7,8,12,13],[1,7,8,12,14],[1,7,8,13,14],[1,7,9,10,11],[1,7,9,10,12],[1,7,9,10,13],[1,7,9,10,14],[1,7,9,11,12],[1,7,9,11,13],[1,7,9,11,14],[1,7,9,12,13],[1,7,9,12,14],[1,7,9,13,14],[1,7,10,11,12],[1,7,10,11,13],[1,7,10,11,14],[1,7,10,12,13],[1,7,10,12,14],[1,7,10,13,14],[1,7,11,12,13],[1,7,11,12,14],[1,7,11,13,14],[1,7,12,13,14],[1,8,9,10,11],[1,8,9,10,12],[1,8,9,10,13],[1,8,9,10,14],[1,8,9,11,12],[1,8,9,11,13],[1,8,9,11,14],[1,8,9,12,13],[1,8,9,12,14],[1,8,9,13,14],[1,8,10,11,12],[1,8,10,11,13],[1,8,10,11,14],[1,8,10,12,13],[1,8,10,12,14],[1,8,10,13,14],[1,8,11,12,13],[1,8,11,12,14],[1,8,11,13,14],[1,8,12,13,14],[1,9,10,11,12],[1,9,10,11,13],[1,9,10,11,14],[1,9,10,12,13],[1,9,10,12,14],[1,9,10,13,14],[1,9,11,12,13],[1,9,11,12,14],[1,9,11,13,14],[1,9,12,13,14],[1,10,11,12,13],[1,10,11,12,14],[1,10,11,13,14],[1,10,12,13,14],[1,11,12,13,14],[2,3,4,5,6],[2,3,4,5,7],[2,3,4,5,8],[2,3,4,5,9],[2,3,4,5,10],[2,3,4,5,11],[2,3,4,5,12],[2,3,4,5,13],[2,3,4,5,14],[2,3,4,6,7],[2,3,4,6,8],[2,3,4,6,9],[2,3,4,6,10],[2,3,4,6,11],[2,3,4,6,12],[2,3,4,6,13],[2,3,4,6,14],[2,3,4,7,8],[2,3,4,7,9],[2,3,4,7,10],[2,3,4,7,11],[2,3,4,7,12],[2,3,4,7,13],[2,3,4,7,14],[2,3,4,8,9],[2,3,4,8,10],[2,3,4,8,11],[2,3,4,8,12],[2,3,4,8,13],[2,3,4,8,14],[2,3,4,9,10],[2,3,4,9,11],[2,3,4,9,12],[2,3,4,9,13],[2,3,4,9,14],[2,3,4,10,11],[2,3,4,10,12],[2,3,4,10,13],[2,3,4,10,14],[2,3,4,11,12],[2,3,4,11,13],[2,3,4,11,14],[2,3,4,12,13],[2,3,4,12,14],[2,3,4,13,14],[2,3,5,6,7],[2,3,5,6,8],[2,3,5,6,9],[2,3,5,6,10],[2,3,5,6,11],[2,3,5,6,12],[2,3,5,6,13],[2,3,5,6,14],[2,3,5,7,8],[2,3,5,7,9],[2,3,5,7,10],[2,3,5,7,11],[2,3,5,7,12],[2,3,5,7,13],[2,3,5,7,14],[2,3,5,8,9],[2,3,5,8,10],[2,3,5,8,11],[2,3,5,8,12],[2,3,5,8,13],[2,3,5,8,14],[2,3,5,9,10],[2,3,5,9,11],[2,3,5,9,12],[2,3,5,9,13],[2,3,5,9,14],[2,3,5,10,11],[2,3,5,10,12],[2,3,5,10,13],[2,3,5,10,14],[2,3,5,11,12],[2,3,5,11,13],[2,3,5,11,14],[2,3,5,12,13],[2,3,5,12,14],[2,3,5,13,14],[2,3,6,7,8],[2,3,6,7,9],[2,3,6,7,10],[2,3,6,7,11],[2,3,6,7,12],[2,3,6,7,13],[2,3,6,7,14],[2,3,6,8,9],[2,3,6,8,10],[2,3,6,8,11],[2,3,6,8,12],[2,3,6,8,13],[2,3,6,8,14],[2,3,6,9,10],[2,3,6,9,11],[2,3,6,9,12],[2,3,6,9,13],[2,3,6,9,14],[2,3,6,10,11],[2,3,6,10,12],[2,3,6,10,13],[2,3,6,10,14],[2,3,6,11,12],[2,3,6,11,13],[2,3,6,11,14],[2,3,6,12,13],[2,3,6,12,14],[2,3,6,13,14],[2,3,7,8,9],[2,3,7,8,10],[2,3,7,8,11],[2,3,7,8,12],[2,3,7,8,13],[2,3,7,8,14],[2,3,7,9,10],[2,3,7,9,11],[2,3,7,9,12],[2,3,7,9,13],[2,3,7,9,14],[2,3,7,10,11],[2,3,7,10,12],[2,3,7,10,13],[2,3,7,10,14],[2,3,7,11,12],[2,3,7,11,13],[2,3,7,11,14],[2,3,7,12,13],[2,3,7,12,14],[2,3,7,13,14],[2,3,8,9,10],[2,3,8,9,11],[2,3,8,9,12],[2,3,8,9,13],[2,3,8,9,14],[2,3,8,10,11],[2,3,8,10,12],[2,3,8,10,13],[2,3,8,10,14],[2,3,8,11,12],[2,3,8,11,13],[2,3,8,11,14],[2,3,8,12,13],[2,3,8,12,14],[2,3,8,13,14],[2,3,9,10,11],[2,3,9,10,12],[2,3,9,10,13],[2,3,9,10,14],[2,3,9,11,12],[2,3,9,11,13],[2,3,9,11,14],[2,3,9,12,13],[2,3,9,12,14],[2,3,9,13,14],[2,3,10,11,12],[2,3,10,11,13],[2,3,10,11,14],[2,3,10,12,13],[2,3,10,12,14],[2,3,10,13,14],[2,3,11,12,13],[2,3,11,12,14],[2,3,11,13,14],[2,3,12,13,14],[2,4,5,6,7],[2,4,5,6,8],[2,4,5,6,9],[2,4,5,6,10],[2,4,5,6,11],[2,4,5,6,12],[2,4,5,6,13],[2,4,5,6,14],[2,4,5,7,8],[2,4,5,7,9],[2,4,5,7,10],[2,4,5,7,11],[2,4,5,7,12],[2,4,5,7,13],[2,4,5,7,14],[2,4,5,8,9],[2,4,5,8,10],[2,4,5,8,11],[2,4,5,8,12],[2,4,5,8,13],[2,4,5,8,14],[2,4,5,9,10],[2,4,5,9,11],[2,4,5,9,12],[2,4,5,9,13],[2,4,5,9,14],[2,4,5,10,11],[2,4,5,10,12],[2,4,5,10,13],[2,4,5,10,14],[2,4,5,11,12],[2,4,5,11,13],[2,4,5,11,14],[2,4,5,12,13],[2,4,5,12,14],[2,4,5,13,14],[2,4,6,7,8],[2,4,6,7,9],[2,4,6,7,10],[2,4,6,7,11],[2,4,6,7,12],[2,4,6,7,13],[2,4,6,7,14],[2,4,6,8,9],[2,4,6,8,10],[2,4,6,8,11],[2,4,6,8,12],[2,4,6,8,13],[2,4,6,8,14],[2,4,6,9,10],[2,4,6,9,11],[2,4,6,9,12],[2,4,6,9,13],[2,4,6,9,14],[2,4,6,10,11],[2,4,6,10,12],[2,4,6,10,13],[2,4,6,10,14],[2,4,6,11,12],[2,4,6,11,13],[2,4,6,11,14],[2,4,6,12,13],[2,4,6,12,14],[2,4,6,13,14],[2,4,7,8,9],[2,4,7,8,10],[2,4,7,8,11],[2,4,7,8,12],[2,4,7,8,13],[2,4,7,8,14],[2,4,7,9,10],[2,4,7,9,11],[2,4,7,9,12],[2,4,7,9,13],[2,4,7,9,14],[2,4,7,10,11],[2,4,7,10,12],[2,4,7,10,13],[2,4,7,10,14],[2,4,7,11,12],[2,4,7,11,13],[2,4,7,11,14],[2,4,7,12,13],[2,4,7,12,14],[2,4,7,13,14],[2,4,8,9,10],[2,4,8,9,11],[2,4,8,9,12],[2,4,8,9,13],[2,4,8,9,14],[2,4,8,10,11],[2,4,8,10,12],[2,4,8,10,13],[2,4,8,10,14],[2,4,8,11,12],[2,4,8,11,13],[2,4,8,11,14],[2,4,8,12,13],[2,4,8,12,14],[2,4,8,13,14],[2,4,9,10,11],[2,4,9,10,12],[2,4,9,10,13],[2,4,9,10,14],[2,4,9,11,12],[2,4,9,11,13],[2,4,9,11,14],[2,4,9,12,13],[2,4,9,12,14],[2,4,9,13,14],[2,4,10,11,12],[2,4,10,11,13],[2,4,10,11,14],[2,4,10,12,13],[2,4,10,12,14],[2,4,10,13,14],[2,4,11,12,13],[2,4,11,12,14],[2,4,11,13,14],[2,4,12,13,14],[2,5,6,7,8],[2,5,6,7,9],[2,5,6,7,10],[2,5,6,7,11],[2,5,6,7,12],[2,5,6,7,13],[2,5,6,7,14],[2,5,6,8,9],[2,5,6,8,10],[2,5,6,8,11],[2,5,6,8,12],[2,5,6,8,13],[2,5,6,8,14],[2,5,6,9,10],[2,5,6,9,11],[2,5,6,9,12],[2,5,6,9,13],[2,5,6,9,14],[2,5,6,10,11],[2,5,6,10,12],[2,5,6,10,13],[2,5,6,10,14],[2,5,6,11,12],[2,5,6,11,13],[2,5,6,11,14],[2,5,6,12,13],[2,5,6,12,14],[2,5,6,13,14],[2,5,7,8,9],[2,5,7,8,10],[2,5,7,8,11],[2,5,7,8,12],[2,5,7,8,13],[2,5,7,8,14],[2,5,7,9,10],[2,5,7,9,11],[2,5,7,9,12],[2,5,7,9,13],[2,5,7,9,14],[2,5,7,10,11],[2,5,7,10,12],[2,5,7,10,13],[2,5,7,10,14],[2,5,7,11,12],[2,5,7,11,13],[2,5,7,11,14],[2,5,7,12,13],[2,5,7,12,14],[2,5,7,13,14],[2,5,8,9,10],[2,5,8,9,11],[2,5,8,9,12],[2,5,8,9,13],[2,5,8,9,14],[2,5,8,10,11],[2,5,8,10,12],[2,5,8,10,13],[2,5,8,10,14],[2,5,8,11,12],[2,5,8,11,13],[2,5,8,11,14],[2,5,8,12,13],[2,5,8,12,14],[2,5,8,13,14],[2,5,9,10,11],[2,5,9,10,12],[2,5,9,10,13],[2,5,9,10,14],[2,5,9,11,12],[2,5,9,11,13],[2,5,9,11,14],[2,5,9,12,13],[2,5,9,12,14],[2,5,9,13,14],[2,5,10,11,12],[2,5,10,11,13],[2,5,10,11,14],[2,5,10,12,13],[2,5,10,12,14],[2,5,10,13,14],[2,5,11,12,13],[2,5,11,12,14],[2,5,11,13,14],[2,5,12,13,14],[2,6,7,8,9],[2,6,7,8,10],[2,6,7,8,11],[2,6,7,8,12],[2,6,7,8,13],[2,6,7,8,14],[2,6,7,9,10],[2,6,7,9,11],[2,6,7,9,12],[2,6,7,9,13],[2,6,7,9,14],[2,6,7,10,11],[2,6,7,10,12],[2,6,7,10,13],[2,6,7,10,14],[2,6,7,11,12],[2,6,7,11,13],[2,6,7,11,14],[2,6,7,12,13],[2,6,7,12,14],[2,6,7,13,14],[2,6,8,9,10],[2,6,8,9,11],[2,6,8,9,12],[2,6,8,9,13],[2,6,8,9,14],[2,6,8,10,11],[2,6,8,10,12],[2,6,8,10,13],[2,6,8,10,14],[2,6,8,11,12],[2,6,8,11,13],[2,6,8,11,14],[2,6,8,12,13],[2,6,8,12,14],[2,6,8,13,14],[2,6,9,10,11],[2,6,9,10,12],[2,6,9,10,13],[2,6,9,10,14],[2,6,9,11,12],[2,6,9,11,13],[2,6,9,11,14],[2,6,9,12,13],[2,6,9,12,14],[2,6,9,13,14],[2,6,10,11,12],[2,6,10,11,13],[2,6,10,11,14],[2,6,10,12,13],[2,6,10,12,14],[2,6,10,13,14],[2,6,11,12,13],[2,6,11,12,14],[2,6,11,13,14],[2,6,12,13,14],[2,7,8,9,10],[2,7,8,9,11],[2,7,8,9,12],[2,7,8,9,13],[2,7,8,9,14],[2,7,8,10,11],[2,7,8,10,12],[2,7,8,10,13],[2,7,8,10,14],[2,7,8,11,12],[2,7,8,11,13],[2,7,8,11,14],[2,7,8,12,13],[2,7,8,12,14],[2,7,8,13,14],[2,7,9,10,11],[2,7,9,10,12],[2,7,9,10,13],[2,7,9,10,14],[2,7,9,11,12],[2,7,9,11,13],[2,7,9,11,14],[2,7,9,12,13],[2,7,9,12,14],[2,7,9,13,14],[2,7,10,11,12],[2,7,10,11,13],[2,7,10,11,14],[2,7,10,12,13],[2,7,10,12,14],[2,7,10,13,14],[2,7,11,12,13],[2,7,11,12,14],[2,7,11,13,14],[2,7,12,13,14],[2,8,9,10,11],[2,8,9,10,12],[2,8,9,10,13],[2,8,9,10,14],[2,8,9,11,12],[2,8,9,11,13],[2,8,9,11,14],[2,8,9,12,13],[2,8,9,12,14],[2,8,9,13,14],[2,8,10,11,12],[2,8,10,11,13],[2,8,10,11,14],[2,8,10,12,13],[2,8,10,12,14],[2,8,10,13,14],[2,8,11,12,13],[2,8,11,12,14],[2,8,11,13,14],[2,8,12,13,14],[2,9,10,11,12],[2,9,10,11,13],[2,9,10,11,14],[2,9,10,12,13],[2,9,10,12,14],[2,9,10,13,14],[2,9,11,12,13],[2,9,11,12,14],[2,9,11,13,14],[2,9,12,13,14],[2,10,11,12,13],[2,10,11,12,14],[2,10,11,13,14],[2,10,12,13,14],[2,11,12,13,14],[3,4,5,6,7],[3,4,5,6,8],[3,4,5,6,9],[3,4,5,6,10],[3,4,5,6,11],[3,4,5,6,12],[3,4,5,6,13],[3,4,5,6,14],[3,4,5,7,8],[3,4,5,7,9],[3,4,5,7,10],[3,4,5,7,11],[3,4,5,7,12],[3,4,5,7,13],[3,4,5,7,14],[3,4,5,8,9],[3,4,5,8,10],[3,4,5,8,11],[3,4,5,8,12],[3,4,5,8,13],[3,4,5,8,14],[3,4,5,9,10],[3,4,5,9,11],[3,4,5,9,12],[3,4,5,9,13],[3,4,5,9,14],[3,4,5,10,11],[3,4,5,10,12],[3,4,5,10,13],[3,4,5,10,14],[3,4,5,11,12],[3,4,5,11,13],[3,4,5,11,14],[3,4,5,12,13],[3,4,5,12,14],[3,4,5,13,14],[3,4,6,7,8],[3,4,6,7,9],[3,4,6,7,10],[3,4,6,7,11],[3,4,6,7,12],[3,4,6,7,13],[3,4,6,7,14],[3,4,6,8,9],[3,4,6,8,10],[3,4,6,8,11],[3,4,6,8,12],[3,4,6,8,13],[3,4,6,8,14],[3,4,6,9,10],[3,4,6,9,11],[3,4,6,9,12],[3,4,6,9,13],[3,4,6,9,14],[3,4,6,10,11],[3,4,6,10,12],[3,4,6,10,13],[3,4,6,10,14],[3,4,6,11,12],[3,4,6,11,13],[3,4,6,11,14],[3,4,6,12,13],[3,4,6,12,14],[3,4,6,13,14],[3,4,7,8,9],[3,4,7,8,10],[3,4,7,8,11],[3,4,7,8,12],[3,4,7,8,13],[3,4,7,8,14],[3,4,7,9,10],[3,4,7,9,11],[3,4,7,9,12],[3,4,7,9,13],[3,4,7,9,14],[3,4,7,10,11],[3,4,7,10,12],[3,4,7,10,13],[3,4,7,10,14],[3,4,7,11,12],[3,4,7,11,13],[3,4,7,11,14],[3,4,7,12,13],[3,4,7,12,14],[3,4,7,13,14],[3,4,8,9,10],[3,4,8,9,11],[3,4,8,9,12],[3,4,8,9,13],[3,4,8,9,14],[3,4,8,10,11],[3,4,8,10,12],[3,4,8,10,13],[3,4,8,10,14],[3,4,8,11,12],[3,4,8,11,13],[3,4,8,11,14],[3,4,8,12,13],[3,4,8,12,14],[3,4,8,13,14],[3,4,9,10,11],[3,4,9,10,12],[3,4,9,10,13],[3,4,9,10,14],[3,4,9,11,12],[3,4,9,11,13],[3,4,9,11,14],[3,4,9,12,13],[3,4,9,12,14],[3,4,9,13,14],[3,4,10,11,12],[3,4,10,11,13],[3,4,10,11,14],[3,4,10,12,13],[3,4,10,12,14],[3,4,10,13,14],[3,4,11,12,13],[3,4,11,12,14],[3,4,11,13,14],[3,4,12,13,14],[3,5,6,7,8],[3,5,6,7,9],[3,5,6,7,10],[3,5,6,7,11],[3,5,6,7,12],[3,5,6,7,13],[3,5,6,7,14],[3,5,6,8,9],[3,5,6,8,10],[3,5,6,8,11],[3,5,6,8,12],[3,5,6,8,13],[3,5,6,8,14],[3,5,6,9,10],[3,5,6,9,11],[3,5,6,9,12],[3,5,6,9,13],[3,5,6,9,14],[3,5,6,10,11],[3,5,6,10,12],[3,5,6,10,13],[3,5,6,10,14],[3,5,6,11,12],[3,5,6,11,13],[3,5,6,11,14],[3,5,6,12,13],[3,5,6,12,14],[3,5,6,13,14],[3,5,7,8,9],[3,5,7,8,10],[3,5,7,8,11],[3,5,7,8,12],[3,5,7,8,13],[3,5,7,8,14],[3,5,7,9,10],[3,5,7,9,11],[3,5,7,9,12],[3,5,7,9,13],[3,5,7,9,14],[3,5,7,10,11],[3,5,7,10,12],[3,5,7,10,13],[3,5,7,10,14],[3,5,7,11,12],[3,5,7,11,13],[3,5,7,11,14],[3,5,7,12,13],[3,5,7,12,14],[3,5,7,13,14],[3,5,8,9,10],[3,5,8,9,11],[3,5,8,9,12],[3,5,8,9,13],[3,5,8,9,14],[3,5,8,10,11],[3,5,8,10,12],[3,5,8,10,13],[3,5,8,10,14],[3,5,8,11,12],[3,5,8,11,13],[3,5,8,11,14],[3,5,8,12,13],[3,5,8,12,14],[3,5,8,13,14],[3,5,9,10,11],[3,5,9,10,12],[3,5,9,10,13],[3,5,9,10,14],[3,5,9,11,12],[3,5,9,11,13],[3,5,9,11,14],[3,5,9,12,13],[3,5,9,12,14],[3,5,9,13,14],[3,5,10,11,12],[3,5,10,11,13],[3,5,10,11,14],[3,5,10,12,13],[3,5,10,12,14],[3,5,10,13,14],[3,5,11,12,13],[3,5,11,12,14],[3,5,11,13,14],[3,5,12,13,14],[3,6,7,8,9],[3,6,7,8,10],[3,6,7,8,11],[3,6,7,8,12],[3,6,7,8,13],[3,6,7,8,14],[3,6,7,9,10],[3,6,7,9,11],[3,6,7,9,12],[3,6,7,9,13],[3,6,7,9,14],[3,6,7,10,11],[3,6,7,10,12],[3,6,7,10,13],[3,6,7,10,14],[3,6,7,11,12],[3,6,7,11,13],[3,6,7,11,14],[3,6,7,12,13],[3,6,7,12,14],[3,6,7,13,14],[3,6,8,9,10],[3,6,8,9,11],[3,6,8,9,12],[3,6,8,9,13],[3,6,8,9,14],[3,6,8,10,11],[3,6,8,10,12],[3,6,8,10,13],[3,6,8,10,14],[3,6,8,11,12],[3,6,8,11,13],[3,6,8,11,14],[3,6,8,12,13],[3,6,8,12,14],[3,6,8,13,14],[3,6,9,10,11],[3,6,9,10,12],[3,6,9,10,13],[3,6,9,10,14],[3,6,9,11,12],[3,6,9,11,13],[3,6,9,11,14],[3,6,9,12,13],[3,6,9,12,14],[3,6,9,13,14],[3,6,10,11,12],[3,6,10,11,13],[3,6,10,11,14],[3,6,10,12,13],[3,6,10,12,14],[3,6,10,13,14],[3,6,11,12,13],[3,6,11,12,14],[3,6,11,13,14],[3,6,12,13,14],[3,7,8,9,10],[3,7,8,9,11],[3,7,8,9,12],[3,7,8,9,13],[3,7,8,9,14],[3,7,8,10,11],[3,7,8,10,12],[3,7,8,10,13],[3,7,8,10,14],[3,7,8,11,12],[3,7,8,11,13],[3,7,8,11,14],[3,7,8,12,13],[3,7,8,12,14],[3,7,8,13,14],[3,7,9,10,11],[3,7,9,10,12],[3,7,9,10,13],[3,7,9,10,14],[3,7,9,11,12],[3,7,9,11,13],[3,7,9,11,14],[3,7,9,12,13],[3,7,9,12,14],[3,7,9,13,14],[3,7,10,11,12],[3,7,10,11,13],[3,7,10,11,14],[3,7,10,12,13],[3,7,10,12,14],[3,7,10,13,14],[3,7,11,12,13],[3,7,11,12,14],[3,7,11,13,14],[3,7,12,13,14],[3,8,9,10,11],[3,8,9,10,12],[3,8,9,10,13],[3,8,9,10,14],[3,8,9,11,12],[3,8,9,11,13],[3,8,9,11,14],[3,8,9,12,13],[3,8,9,12,14],[3,8,9,13,14],[3,8,10,11,12],[3,8,10,11,13],[3,8,10,11,14],[3,8,10,12,13],[3,8,10,12,14],[3,8,10,13,14],[3,8,11,12,13],[3,8,11,12,14],[3,8,11,13,14],[3,8,12,13,14],[3,9,10,11,12],[3,9,10,11,13],[3,9,10,11,14],[3,9,10,12,13],[3,9,10,12,14],[3,9,10,13,14],[3,9,11,12,13],[3,9,11,12,14],[3,9,11,13,14],[3,9,12,13,14],[3,10,11,12,13],[3,10,11,12,14],[3,10,11,13,14],[3,10,12,13,14],[3,11,12,13,14],[4,5,6,7,8],[4,5,6,7,9],[4,5,6,7,10],[4,5,6,7,11],[4,5,6,7,12],[4,5,6,7,13],[4,5,6,7,14],[4,5,6,8,9],[4,5,6,8,10],[4,5,6,8,11],[4,5,6,8,12],[4,5,6,8,13],[4,5,6,8,14],[4,5,6,9,10],[4,5,6,9,11],[4,5,6,9,12],[4,5,6,9,13],[4,5,6,9,14],[4,5,6,10,11],[4,5,6,10,12],[4,5,6,10,13],[4,5,6,10,14],[4,5,6,11,12],[4,5,6,11,13],[4,5,6,11,14],[4,5,6,12,13],[4,5,6,12,14],[4,5,6,13,14],[4,5,7,8,9],[4,5,7,8,10],[4,5,7,8,11],[4,5,7,8,12],[4,5,7,8,13],[4,5,7,8,14],[4,5,7,9,10],[4,5,7,9,11],[4,5,7,9,12],[4,5,7,9,13],[4,5,7,9,14],[4,5,7,10,11],[4,5,7,10,12],[4,5,7,10,13],[4,5,7,10,14],[4,5,7,11,12],[4,5,7,11,13],[4,5,7,11,14],[4,5,7,12,13],[4,5,7,12,14],[4,5,7,13,14],[4,5,8,9,10],[4,5,8,9,11],[4,5,8,9,12],[4,5,8,9,13],[4,5,8,9,14],[4,5,8,10,11],[4,5,8,10,12],[4,5,8,10,13],[4,5,8,10,14],[4,5,8,11,12],[4,5,8,11,13],[4,5,8,11,14],[4,5,8,12,13],[4,5,8,12,14],[4,5,8,13,14],[4,5,9,10,11],[4,5,9,10,12],[4,5,9,10,13],[4,5,9,10,14],[4,5,9,11,12],[4,5,9,11,13],[4,5,9,11,14],[4,5,9,12,13],[4,5,9,12,14],[4,5,9,13,14],[4,5,10,11,12],[4,5,10,11,13],[4,5,10,11,14],[4,5,10,12,13],[4,5,10,12,14],[4,5,10,13,14],[4,5,11,12,13],[4,5,11,12,14],[4,5,11,13,14],[4,5,12,13,14],[4,6,7,8,9],[4,6,7,8,10],[4,6,7,8,11],[4,6,7,8,12],[4,6,7,8,13],[4,6,7,8,14],[4,6,7,9,10],[4,6,7,9,11],[4,6,7,9,12],[4,6,7,9,13],[4,6,7,9,14],[4,6,7,10,11],[4,6,7,10,12],[4,6,7,10,13],[4,6,7,10,14],[4,6,7,11,12],[4,6,7,11,13],[4,6,7,11,14],[4,6,7,12,13],[4,6,7,12,14],[4,6,7,13,14],[4,6,8,9,10],[4,6,8,9,11],[4,6,8,9,12],[4,6,8,9,13],[4,6,8,9,14],[4,6,8,10,11],[4,6,8,10,12],[4,6,8,10,13],[4,6,8,10,14],[4,6,8,11,12],[4,6,8,11,13],[4,6,8,11,14],[4,6,8,12,13],[4,6,8,12,14],[4,6,8,13,14],[4,6,9,10,11],[4,6,9,10,12],[4,6,9,10,13],[4,6,9,10,14],[4,6,9,11,12],[4,6,9,11,13],[4,6,9,11,14],[4,6,9,12,13],[4,6,9,12,14],[4,6,9,13,14],[4,6,10,11,12],[4,6,10,11,13],[4,6,10,11,14],[4,6,10,12,13],[4,6,10,12,14],[4,6,10,13,14],[4,6,11,12,13],[4,6,11,12,14],[4,6,11,13,14],[4,6,12,13,14],[4,7,8,9,10],[4,7,8,9,11],[4,7,8,9,12],[4,7,8,9,13],[4,7,8,9,14],[4,7,8,10,11],[4,7,8,10,12],[4,7,8,10,13],[4,7,8,10,14],[4,7,8,11,12],[4,7,8,11,13],[4,7,8,11,14],[4,7,8,12,13],[4,7,8,12,14],[4,7,8,13,14],[4,7,9,10,11],[4,7,9,10,12],[4,7,9,10,13],[4,7,9,10,14],[4,7,9,11,12],[4,7,9,11,13],[4,7,9,11,14],[4,7,9,12,13],[4,7,9,12,14],[4,7,9,13,14],[4,7,10,11,12],[4,7,10,11,13],[4,7,10,11,14],[4,7,10,12,13],[4,7,10,12,14],[4,7,10,13,14],[4,7,11,12,13],[4,7,11,12,14],[4,7,11,13,14],[4,7,12,13,14],[4,8,9,10,11],[4,8,9,10,12],[4,8,9,10,13],[4,8,9,10,14],[4,8,9,11,12],[4,8,9,11,13],[4,8,9,11,14],[4,8,9,12,13],[4,8,9,12,14],[4,8,9,13,14],[4,8,10,11,12],[4,8,10,11,13],[4,8,10,11,14],[4,8,10,12,13],[4,8,10,12,14],[4,8,10,13,14],[4,8,11,12,13],[4,8,11,12,14],[4,8,11,13,14],[4,8,12,13,14],[4,9,10,11,12],[4,9,10,11,13],[4,9,10,11,14],[4,9,10,12,13],[4,9,10,12,14],[4,9,10,13,14],[4,9,11,12,13],[4,9,11,12,14],[4,9,11,13,14],[4,9,12,13,14],[4,10,11,12,13],[4,10,11,12,14],[4,10,11,13,14],[4,10,12,13,14],[4,11,12,13,14],[5,6,7,8,9],[5,6,7,8,10],[5,6,7,8,11],[5,6,7,8,12],[5,6,7,8,13],[5,6,7,8,14],[5,6,7,9,10],[5,6,7,9,11],[5,6,7,9,12],[5,6,7,9,13],[5,6,7,9,14],[5,6,7,10,11],[5,6,7,10,12],[5,6,7,10,13],[5,6,7,10,14],[5,6,7,11,12],[5,6,7,11,13],[5,6,7,11,14],[5,6,7,12,13],[5,6,7,12,14],[5,6,7,13,14],[5,6,8,9,10],[5,6,8,9,11],[5,6,8,9,12],[5,6,8,9,13],[5,6,8,9,14],[5,6,8,10,11],[5,6,8,10,12],[5,6,8,10,13],[5,6,8,10,14],[5,6,8,11,12],[5,6,8,11,13],[5,6,8,11,14],[5,6,8,12,13],[5,6,8,12,14],[5,6,8,13,14],[5,6,9,10,11],[5,6,9,10,12],[5,6,9,10,13],[5,6,9,10,14],[5,6,9,11,12],[5,6,9,11,13],[5,6,9,11,14],[5,6,9,12,13],[5,6,9,12,14],[5,6,9,13,14],[5,6,10,11,12],[5,6,10,11,13],[5,6,10,11,14],[5,6,10,12,13],[5,6,10,12,14],[5,6,10,13,14],[5,6,11,12,13],[5,6,11,12,14],[5,6,11,13,14],[5,6,12,13,14],[5,7,8,9,10],[5,7,8,9,11],[5,7,8,9,12],[5,7,8,9,13],[5,7,8,9,14],[5,7,8,10,11],[5,7,8,10,12],[5,7,8,10,13],[5,7,8,10,14],[5,7,8,11,12],[5,7,8,11,13],[5,7,8,11,14],[5,7,8,12,13],[5,7,8,12,14],[5,7,8,13,14],[5,7,9,10,11],[5,7,9,10,12],[5,7,9,10,13],[5,7,9,10,14],[5,7,9,11,12],[5,7,9,11,13],[5,7,9,11,14],[5,7,9,12,13],[5,7,9,12,14],[5,7,9,13,14],[5,7,10,11,12],[5,7,10,11,13],[5,7,10,11,14],[5,7,10,12,13],[5,7,10,12,14],[5,7,10,13,14],[5,7,11,12,13],[5,7,11,12,14],[5,7,11,13,14],[5,7,12,13,14],[5,8,9,10,11],[5,8,9,10,12],[5,8,9,10,13],[5,8,9,10,14],[5,8,9,11,12],[5,8,9,11,13],[5,8,9,11,14],[5,8,9,12,13],[5,8,9,12,14],[5,8,9,13,14],[5,8,10,11,12],[5,8,10,11,13],[5,8,10,11,14],[5,8,10,12,13],[5,8,10,12,14],[5,8,10,13,14],[5,8,11,12,13],[5,8,11,12,14],[5,8,11,13,14],[5,8,12,13,14],[5,9,10,11,12],[5,9,10,11,13],[5,9,10,11,14],[5,9,10,12,13],[5,9,10,12,14],[5,9,10,13,14],[5,9,11,12,13],[5,9,11,12,14],[5,9,11,13,14],[5,9,12,13,14],[5,10,11,12,13],[5,10,11,12,14],[5,10,11,13,14],[5,10,12,13,14],[5,11,12,13,14],[6,7,8,9,10],[6,7,8,9,11],[6,7,8,9,12],[6,7,8,9,13],[6,7,8,9,14],[6,7,8,10,11],[6,7,8,10,12],[6,7,8,10,13],[6,7,8,10,14],[6,7,8,11,12],[6,7,8,11,13],[6,7,8,11,14],[6,7,8,12,13],[6,7,8,12,14],[6,7,8,13,14],[6,7,9,10,11],[6,7,9,10,12],[6,7,9,10,13],[6,7,9,10,14],[6,7,9,11,12],[6,7,9,11,13],[6,7,9,11,14],[6,7,9,12,13],[6,7,9,12,14],[6,7,9,13,14],[6,7,10,11,12],[6,7,10,11,13],[6,7,10,11,14],[6,7,10,12,13],[6,7,10,12,14],[6,7,10,13,14],[6,7,11,12,13],[6,7,11,12,14],[6,7,11,13,14],[6,7,12,13,14],[6,8,9,10,11],[6,8,9,10,12],[6,8,9,10,13],[6,8,9,10,14],[6,8,9,11,12],[6,8,9,11,13],[6,8,9,11,14],[6,8,9,12,13],[6,8,9,12,14],[6,8,9,13,14],[6,8,10,11,12],[6,8,10,11,13],[6,8,10,11,14],[6,8,10,12,13],[6,8,10,12,14],[6,8,10,13,14],[6,8,11,12,13],[6,8,11,12,14],[6,8,11,13,14],[6,8,12,13,14],[6,9,10,11,12],[6,9,10,11,13],[6,9,10,11,14],[6,9,10,12,13],[6,9,10,12,14],[6,9,10,13,14],[6,9,11,12,13],[6,9,11,12,14],[6,9,11,13,14],[6,9,12,13,14],[6,10,11,12,13],[6,10,11,12,14],[6,10,11,13,14],[6,10,12,13,14],[6,11,12,13,14],[7,8,9,10,11],[7,8,9,10,12],[7,8,9,10,13],[7,8,9,10,14],[7,8,9,11,12],[7,8,9,11,13],[7,8,9,11,14],[7,8,9,12,13],[7,8,9,12,14],[7,8,9,13,14],[7,8,10,11,12],[7,8,10,11,13],[7,8,10,11,14],[7,8,10,12,13],[7,8,10,12,14],[7,8,10,13,14],[7,8,11,12,13],[7,8,11,12,14],[7,8,11,13,14],[7,8,12,13,14],[7,9,10,11,12],[7,9,10,11,13],[7,9,10,11,14],[7,9,10,12,13],[7,9,10,12,14],[7,9,10,13,14],[7,9,11,12,13],[7,9,11,12,14],[7,9,11,13,14],[7,9,12,13,14],[7,10,11,12,13],[7,10,11,12,14],[7,10,11,13,14],[7,10,12,13,14],[7,11,12,13,14],[8,9,10,11,12],[8,9,10,11,13],[8,9,10,11,14],[8,9,10,12,13],[8,9,10,12,14],[8,9,10,13,14],[8,9,11,12,13],[8,9,11,12,14],[8,9,11,13,14],[8,9,12,13,14],[8,10,11,12,13],[8,10,11,12,14],[8,10,11,13,14],[8,10,12,13,14],[8,11,12,13,14],[9,10,11,12,13],[9,10,11,12,14],[9,10,11,13,14],[9,10,12,13,14],[9,11,12,13,14],[10,11,12,13,14]] ) elif n == 15 and k == 6: storage[n][k] = np.array( [[0,1,2,3,4,5],[0,1,2,3,4,6],[0,1,2,3,4,7],[0,1,2,3,4,8],[0,1,2,3,4,9],[0,1,2,3,4,10],[0,1,2,3,4,11],[0,1,2,3,4,12],[0,1,2,3,4,13],[0,1,2,3,4,14],[0,1,2,3,5,6],[0,1,2,3,5,7],[0,1,2,3,5,8],[0,1,2,3,5,9],[0,1,2,3,5,10],[0,1,2,3,5,11],[0,1,2,3,5,12],[0,1,2,3,5,13],[0,1,2,3,5,14],[0,1,2,3,6,7],[0,1,2,3,6,8],[0,1,2,3,6,9],[0,1,2,3,6,10],[0,1,2,3,6,11],[0,1,2,3,6,12],[0,1,2,3,6,13],[0,1,2,3,6,14],[0,1,2,3,7,8],[0,1,2,3,7,9],[0,1,2,3,7,10],[0,1,2,3,7,11],[0,1,2,3,7,12],[0,1,2,3,7,13],[0,1,2,3,7,14],[0,1,2,3,8,9],[0,1,2,3,8,10],[0,1,2,3,8,11],[0,1,2,3,8,12],[0,1,2,3,8,13],[0,1,2,3,8,14],[0,1,2,3,9,10],[0,1,2,3,9,11],[0,1,2,3,9,12],[0,1,2,3,9,13],[0,1,2,3,9,14],[0,1,2,3,10,11],[0,1,2,3,10,12],[0,1,2,3,10,13],[0,1,2,3,10,14],[0,1,2,3,11,12],[0,1,2,3,11,13],[0,1,2,3,11,14],[0,1,2,3,12,13],[0,1,2,3,12,14],[0,1,2,3,13,14],[0,1,2,4,5,6],[0,1,2,4,5,7],[0,1,2,4,5,8],[0,1,2,4,5,9],[0,1,2,4,5,10],[0,1,2,4,5,11],[0,1,2,4,5,12],[0,1,2,4,5,13],[0,1,2,4,5,14],[0,1,2,4,6,7],[0,1,2,4,6,8],[0,1,2,4,6,9],[0,1,2,4,6,10],[0,1,2,4,6,11],[0,1,2,4,6,12],[0,1,2,4,6,13],[0,1,2,4,6,14],[0,1,2,4,7,8],[0,1,2,4,7,9],[0,1,2,4,7,10],[0,1,2,4,7,11],[0,1,2,4,7,12],[0,1,2,4,7,13],[0,1,2,4,7,14],[0,1,2,4,8,9],[0,1,2,4,8,10],[0,1,2,4,8,11],[0,1,2,4,8,12],[0,1,2,4,8,13],[0,1,2,4,8,14],[0,1,2,4,9,10],[0,1,2,4,9,11],[0,1,2,4,9,12],[0,1,2,4,9,13],[0,1,2,4,9,14],[0,1,2,4,10,11],[0,1,2,4,10,12],[0,1,2,4,10,13],[0,1,2,4,10,14],[0,1,2,4,11,12],[0,1,2,4,11,13],[0,1,2,4,11,14],[0,1,2,4,12,13],[0,1,2,4,12,14],[0,1,2,4,13,14],[0,1,2,5,6,7],[0,1,2,5,6,8],[0,1,2,5,6,9],[0,1,2,5,6,10],[0,1,2,5,6,11],[0,1,2,5,6,12],[0,1,2,5,6,13],[0,1,2,5,6,14],[0,1,2,5,7,8],[0,1,2,5,7,9],[0,1,2,5,7,10],[0,1,2,5,7,11],[0,1,2,5,7,12],[0,1,2,5,7,13],[0,1,2,5,7,14],[0,1,2,5,8,9],[0,1,2,5,8,10],[0,1,2,5,8,11],[0,1,2,5,8,12],[0,1,2,5,8,13],[0,1,2,5,8,14],[0,1,2,5,9,10],[0,1,2,5,9,11],[0,1,2,5,9,12],[0,1,2,5,9,13],[0,1,2,5,9,14],[0,1,2,5,10,11],[0,1,2,5,10,12],[0,1,2,5,10,13],[0,1,2,5,10,14],[0,1,2,5,11,12],[0,1,2,5,11,13],[0,1,2,5,11,14],[0,1,2,5,12,13],[0,1,2,5,12,14],[0,1,2,5,13,14],[0,1,2,6,7,8],[0,1,2,6,7,9],[0,1,2,6,7,10],[0,1,2,6,7,11],[0,1,2,6,7,12],[0,1,2,6,7,13],[0,1,2,6,7,14],[0,1,2,6,8,9],[0,1,2,6,8,10],[0,1,2,6,8,11],[0,1,2,6,8,12],[0,1,2,6,8,13],[0,1,2,6,8,14],[0,1,2,6,9,10],[0,1,2,6,9,11],[0,1,2,6,9,12],[0,1,2,6,9,13],[0,1,2,6,9,14],[0,1,2,6,10,11],[0,1,2,6,10,12],[0,1,2,6,10,13],[0,1,2,6,10,14],[0,1,2,6,11,12],[0,1,2,6,11,13],[0,1,2,6,11,14],[0,1,2,6,12,13],[0,1,2,6,12,14],[0,1,2,6,13,14],[0,1,2,7,8,9],[0,1,2,7,8,10],[0,1,2,7,8,11],[0,1,2,7,8,12],[0,1,2,7,8,13],[0,1,2,7,8,14],[0,1,2,7,9,10],[0,1,2,7,9,11],[0,1,2,7,9,12],[0,1,2,7,9,13],[0,1,2,7,9,14],[0,1,2,7,10,11],[0,1,2,7,10,12],[0,1,2,7,10,13],[0,1,2,7,10,14],[0,1,2,7,11,12],[0,1,2,7,11,13],[0,1,2,7,11,14],[0,1,2,7,12,13],[0,1,2,7,12,14],[0,1,2,7,13,14],[0,1,2,8,9,10],[0,1,2,8,9,11],[0,1,2,8,9,12],[0,1,2,8,9,13],[0,1,2,8,9,14],[0,1,2,8,10,11],[0,1,2,8,10,12],[0,1,2,8,10,13],[0,1,2,8,10,14],[0,1,2,8,11,12],[0,1,2,8,11,13],[0,1,2,8,11,14],[0,1,2,8,12,13],[0,1,2,8,12,14],[0,1,2,8,13,14],[0,1,2,9,10,11],[0,1,2,9,10,12],[0,1,2,9,10,13],[0,1,2,9,10,14],[0,1,2,9,11,12],[0,1,2,9,11,13],[0,1,2,9,11,14],[0,1,2,9,12,13],[0,1,2,9,12,14],[0,1,2,9,13,14],[0,1,2,10,11,12],[0,1,2,10,11,13],[0,1,2,10,11,14],[0,1,2,10,12,13],[0,1,2,10,12,14],[0,1,2,10,13,14],[0,1,2,11,12,13],[0,1,2,11,12,14],[0,1,2,11,13,14],[0,1,2,12,13,14],[0,1,3,4,5,6],[0,1,3,4,5,7],[0,1,3,4,5,8],[0,1,3,4,5,9],[0,1,3,4,5,10],[0,1,3,4,5,11],[0,1,3,4,5,12],[0,1,3,4,5,13],[0,1,3,4,5,14],[0,1,3,4,6,7],[0,1,3,4,6,8],[0,1,3,4,6,9],[0,1,3,4,6,10],[0,1,3,4,6,11],[0,1,3,4,6,12],[0,1,3,4,6,13],[0,1,3,4,6,14],[0,1,3,4,7,8],[0,1,3,4,7,9],[0,1,3,4,7,10],[0,1,3,4,7,11],[0,1,3,4,7,12],[0,1,3,4,7,13],[0,1,3,4,7,14],[0,1,3,4,8,9],[0,1,3,4,8,10],[0,1,3,4,8,11],[0,1,3,4,8,12],[0,1,3,4,8,13],[0,1,3,4,8,14],[0,1,3,4,9,10],[0,1,3,4,9,11],[0,1,3,4,9,12],[0,1,3,4,9,13],[0,1,3,4,9,14],[0,1,3,4,10,11],[0,1,3,4,10,12],[0,1,3,4,10,13],[0,1,3,4,10,14],[0,1,3,4,11,12],[0,1,3,4,11,13],[0,1,3,4,11,14],[0,1,3,4,12,13],[0,1,3,4,12,14],[0,1,3,4,13,14],[0,1,3,5,6,7],[0,1,3,5,6,8],[0,1,3,5,6,9],[0,1,3,5,6,10],[0,1,3,5,6,11],[0,1,3,5,6,12],[0,1,3,5,6,13],[0,1,3,5,6,14],[0,1,3,5,7,8],[0,1,3,5,7,9],[0,1,3,5,7,10],[0,1,3,5,7,11],[0,1,3,5,7,12],[0,1,3,5,7,13],[0,1,3,5,7,14],[0,1,3,5,8,9],[0,1,3,5,8,10],[0,1,3,5,8,11],[0,1,3,5,8,12],[0,1,3,5,8,13],[0,1,3,5,8,14],[0,1,3,5,9,10],[0,1,3,5,9,11],[0,1,3,5,9,12],[0,1,3,5,9,13],[0,1,3,5,9,14],[0,1,3,5,10,11],[0,1,3,5,10,12],[0,1,3,5,10,13],[0,1,3,5,10,14],[0,1,3,5,11,12],[0,1,3,5,11,13],[0,1,3,5,11,14],[0,1,3,5,12,13],[0,1,3,5,12,14],[0,1,3,5,13,14],[0,1,3,6,7,8],[0,1,3,6,7,9],[0,1,3,6,7,10],[0,1,3,6,7,11],[0,1,3,6,7,12],[0,1,3,6,7,13],[0,1,3,6,7,14],[0,1,3,6,8,9],[0,1,3,6,8,10],[0,1,3,6,8,11],[0,1,3,6,8,12],[0,1,3,6,8,13],[0,1,3,6,8,14],[0,1,3,6,9,10],[0,1,3,6,9,11],[0,1,3,6,9,12],[0,1,3,6,9,13],[0,1,3,6,9,14],[0,1,3,6,10,11],[0,1,3,6,10,12],[0,1,3,6,10,13],[0,1,3,6,10,14],[0,1,3,6,11,12],[0,1,3,6,11,13],[0,1,3,6,11,14],[0,1,3,6,12,13],[0,1,3,6,12,14],[0,1,3,6,13,14],[0,1,3,7,8,9],[0,1,3,7,8,10],[0,1,3,7,8,11],[0,1,3,7,8,12],[0,1,3,7,8,13],[0,1,3,7,8,14],[0,1,3,7,9,10],[0,1,3,7,9,11],[0,1,3,7,9,12],[0,1,3,7,9,13],[0,1,3,7,9,14],[0,1,3,7,10,11],[0,1,3,7,10,12],[0,1,3,7,10,13],[0,1,3,7,10,14],[0,1,3,7,11,12],[0,1,3,7,11,13],[0,1,3,7,11,14],[0,1,3,7,12,13],[0,1,3,7,12,14],[0,1,3,7,13,14],[0,1,3,8,9,10],[0,1,3,8,9,11],[0,1,3,8,9,12],[0,1,3,8,9,13],[0,1,3,8,9,14],[0,1,3,8,10,11],[0,1,3,8,10,12],[0,1,3,8,10,13],[0,1,3,8,10,14],[0,1,3,8,11,12],[0,1,3,8,11,13],[0,1,3,8,11,14],[0,1,3,8,12,13],[0,1,3,8,12,14],[0,1,3,8,13,14],[0,1,3,9,10,11],[0,1,3,9,10,12],[0,1,3,9,10,13],[0,1,3,9,10,14],[0,1,3,9,11,12],[0,1,3,9,11,13],[0,1,3,9,11,14],[0,1,3,9,12,13],[0,1,3,9,12,14],[0,1,3,9,13,14],[0,1,3,10,11,12],[0,1,3,10,11,13],[0,1,3,10,11,14],[0,1,3,10,12,13],[0,1,3,10,12,14],[0,1,3,10,13,14],[0,1,3,11,12,13],[0,1,3,11,12,14],[0,1,3,11,13,14],[0,1,3,12,13,14],[0,1,4,5,6,7],[0,1,4,5,6,8],[0,1,4,5,6,9],[0,1,4,5,6,10],[0,1,4,5,6,11],[0,1,4,5,6,12],[0,1,4,5,6,13],[0,1,4,5,6,14],[0,1,4,5,7,8],[0,1,4,5,7,9],[0,1,4,5,7,10],[0,1,4,5,7,11],[0,1,4,5,7,12],[0,1,4,5,7,13],[0,1,4,5,7,14],[0,1,4,5,8,9],[0,1,4,5,8,10],[0,1,4,5,8,11],[0,1,4,5,8,12],[0,1,4,5,8,13],[0,1,4,5,8,14],[0,1,4,5,9,10],[0,1,4,5,9,11],[0,1,4,5,9,12],[0,1,4,5,9,13],[0,1,4,5,9,14],[0,1,4,5,10,11],[0,1,4,5,10,12],[0,1,4,5,10,13],[0,1,4,5,10,14],[0,1,4,5,11,12],[0,1,4,5,11,13],[0,1,4,5,11,14],[0,1,4,5,12,13],[0,1,4,5,12,14],[0,1,4,5,13,14],[0,1,4,6,7,8],[0,1,4,6,7,9],[0,1,4,6,7,10],[0,1,4,6,7,11],[0,1,4,6,7,12],[0,1,4,6,7,13],[0,1,4,6,7,14],[0,1,4,6,8,9],[0,1,4,6,8,10],[0,1,4,6,8,11],[0,1,4,6,8,12],[0,1,4,6,8,13],[0,1,4,6,8,14],[0,1,4,6,9,10],[0,1,4,6,9,11],[0,1,4,6,9,12],[0,1,4,6,9,13],[0,1,4,6,9,14],[0,1,4,6,10,11],[0,1,4,6,10,12],[0,1,4,6,10,13],[0,1,4,6,10,14],[0,1,4,6,11,12],[0,1,4,6,11,13],[0,1,4,6,11,14],[0,1,4,6,12,13],[0,1,4,6,12,14],[0,1,4,6,13,14],[0,1,4,7,8,9],[0,1,4,7,8,10],[0,1,4,7,8,11],[0,1,4,7,8,12],[0,1,4,7,8,13],[0,1,4,7,8,14],[0,1,4,7,9,10],[0,1,4,7,9,11],[0,1,4,7,9,12],[0,1,4,7,9,13],[0,1,4,7,9,14],[0,1,4,7,10,11],[0,1,4,7,10,12],[0,1,4,7,10,13],[0,1,4,7,10,14],[0,1,4,7,11,12],[0,1,4,7,11,13],[0,1,4,7,11,14],[0,1,4,7,12,13],[0,1,4,7,12,14],[0,1,4,7,13,14],[0,1,4,8,9,10],[0,1,4,8,9,11],[0,1,4,8,9,12],[0,1,4,8,9,13],[0,1,4,8,9,14],[0,1,4,8,10,11],[0,1,4,8,10,12],[0,1,4,8,10,13],[0,1,4,8,10,14],[0,1,4,8,11,12],[0,1,4,8,11,13],[0,1,4,8,11,14],[0,1,4,8,12,13],[0,1,4,8,12,14],[0,1,4,8,13,14],[0,1,4,9,10,11],[0,1,4,9,10,12],[0,1,4,9,10,13],[0,1,4,9,10,14],[0,1,4,9,11,12],[0,1,4,9,11,13],[0,1,4,9,11,14],[0,1,4,9,12,13],[0,1,4,9,12,14],[0,1,4,9,13,14],[0,1,4,10,11,12],[0,1,4,10,11,13],[0,1,4,10,11,14],[0,1,4,10,12,13],[0,1,4,10,12,14],[0,1,4,10,13,14],[0,1,4,11,12,13],[0,1,4,11,12,14],[0,1,4,11,13,14],[0,1,4,12,13,14],[0,1,5,6,7,8],[0,1,5,6,7,9],[0,1,5,6,7,10],[0,1,5,6,7,11],[0,1,5,6,7,12],[0,1,5,6,7,13],[0,1,5,6,7,14],[0,1,5,6,8,9],[0,1,5,6,8,10],[0,1,5,6,8,11],[0,1,5,6,8,12],[0,1,5,6,8,13],[0,1,5,6,8,14],[0,1,5,6,9,10],[0,1,5,6,9,11],[0,1,5,6,9,12],[0,1,5,6,9,13],[0,1,5,6,9,14],[0,1,5,6,10,11],[0,1,5,6,10,12],[0,1,5,6,10,13],[0,1,5,6,10,14],[0,1,5,6,11,12],[0,1,5,6,11,13],[0,1,5,6,11,14],[0,1,5,6,12,13],[0,1,5,6,12,14],[0,1,5,6,13,14],[0,1,5,7,8,9],[0,1,5,7,8,10],[0,1,5,7,8,11],[0,1,5,7,8,12],[0,1,5,7,8,13],[0,1,5,7,8,14],[0,1,5,7,9,10],[0,1,5,7,9,11],[0,1,5,7,9,12],[0,1,5,7,9,13],[0,1,5,7,9,14],[0,1,5,7,10,11],[0,1,5,7,10,12],[0,1,5,7,10,13],[0,1,5,7,10,14],[0,1,5,7,11,12],[0,1,5,7,11,13],[0,1,5,7,11,14],[0,1,5,7,12,13],[0,1,5,7,12,14],[0,1,5,7,13,14],[0,1,5,8,9,10],[0,1,5,8,9,11],[0,1,5,8,9,12],[0,1,5,8,9,13],[0,1,5,8,9,14],[0,1,5,8,10,11],[0,1,5,8,10,12],[0,1,5,8,10,13],[0,1,5,8,10,14],[0,1,5,8,11,12],[0,1,5,8,11,13],[0,1,5,8,11,14],[0,1,5,8,12,13],[0,1,5,8,12,14],[0,1,5,8,13,14],[0,1,5,9,10,11],[0,1,5,9,10,12],[0,1,5,9,10,13],[0,1,5,9,10,14],[0,1,5,9,11,12],[0,1,5,9,11,13],[0,1,5,9,11,14],[0,1,5,9,12,13],[0,1,5,9,12,14],[0,1,5,9,13,14],[0,1,5,10,11,12],[0,1,5,10,11,13],[0,1,5,10,11,14],[0,1,5,10,12,13],[0,1,5,10,12,14],[0,1,5,10,13,14],[0,1,5,11,12,13],[0,1,5,11,12,14],[0,1,5,11,13,14],[0,1,5,12,13,14],[0,1,6,7,8,9],[0,1,6,7,8,10],[0,1,6,7,8,11],[0,1,6,7,8,12],[0,1,6,7,8,13],[0,1,6,7,8,14],[0,1,6,7,9,10],[0,1,6,7,9,11],[0,1,6,7,9,12],[0,1,6,7,9,13],[0,1,6,7,9,14],[0,1,6,7,10,11],[0,1,6,7,10,12],[0,1,6,7,10,13],[0,1,6,7,10,14],[0,1,6,7,11,12],[0,1,6,7,11,13],[0,1,6,7,11,14],[0,1,6,7,12,13],[0,1,6,7,12,14],[0,1,6,7,13,14],[0,1,6,8,9,10],[0,1,6,8,9,11],[0,1,6,8,9,12],[0,1,6,8,9,13],[0,1,6,8,9,14],[0,1,6,8,10,11],[0,1,6,8,10,12],[0,1,6,8,10,13],[0,1,6,8,10,14],[0,1,6,8,11,12],[0,1,6,8,11,13],[0,1,6,8,11,14],[0,1,6,8,12,13],[0,1,6,8,12,14],[0,1,6,8,13,14],[0,1,6,9,10,11],[0,1,6,9,10,12],[0,1,6,9,10,13],[0,1,6,9,10,14],[0,1,6,9,11,12],[0,1,6,9,11,13],[0,1,6,9,11,14],[0,1,6,9,12,13],[0,1,6,9,12,14],[0,1,6,9,13,14],[0,1,6,10,11,12],[0,1,6,10,11,13],[0,1,6,10,11,14],[0,1,6,10,12,13],[0,1,6,10,12,14],[0,1,6,10,13,14],[0,1,6,11,12,13],[0,1,6,11,12,14],[0,1,6,11,13,14],[0,1,6,12,13,14],[0,1,7,8,9,10],[0,1,7,8,9,11],[0,1,7,8,9,12],[0,1,7,8,9,13],[0,1,7,8,9,14],[0,1,7,8,10,11],[0,1,7,8,10,12],[0,1,7,8,10,13],[0,1,7,8,10,14],[0,1,7,8,11,12],[0,1,7,8,11,13],[0,1,7,8,11,14],[0,1,7,8,12,13],[0,1,7,8,12,14],[0,1,7,8,13,14],[0,1,7,9,10,11],[0,1,7,9,10,12],[0,1,7,9,10,13],[0,1,7,9,10,14],[0,1,7,9,11,12],[0,1,7,9,11,13],[0,1,7,9,11,14],[0,1,7,9,12,13],[0,1,7,9,12,14],[0,1,7,9,13,14],[0,1,7,10,11,12],[0,1,7,10,11,13],[0,1,7,10,11,14],[0,1,7,10,12,13],[0,1,7,10,12,14],[0,1,7,10,13,14],[0,1,7,11,12,13],[0,1,7,11,12,14],[0,1,7,11,13,14],[0,1,7,12,13,14],[0,1,8,9,10,11],[0,1,8,9,10,12],[0,1,8,9,10,13],[0,1,8,9,10,14],[0,1,8,9,11,12],[0,1,8,9,11,13],[0,1,8,9,11,14],[0,1,8,9,12,13],[0,1,8,9,12,14],[0,1,8,9,13,14],[0,1,8,10,11,12],[0,1,8,10,11,13],[0,1,8,10,11,14],[0,1,8,10,12,13],[0,1,8,10,12,14],[0,1,8,10,13,14],[0,1,8,11,12,13],[0,1,8,11,12,14],[0,1,8,11,13,14],[0,1,8,12,13,14],[0,1,9,10,11,12],[0,1,9,10,11,13],[0,1,9,10,11,14],[0,1,9,10,12,13],[0,1,9,10,12,14],[0,1,9,10,13,14],[0,1,9,11,12,13],[0,1,9,11,12,14],[0,1,9,11,13,14],[0,1,9,12,13,14],[0,1,10,11,12,13],[0,1,10,11,12,14],[0,1,10,11,13,14],[0,1,10,12,13,14],[0,1,11,12,13,14],[0,2,3,4,5,6],[0,2,3,4,5,7],[0,2,3,4,5,8],[0,2,3,4,5,9],[0,2,3,4,5,10],[0,2,3,4,5,11],[0,2,3,4,5,12],[0,2,3,4,5,13],[0,2,3,4,5,14],[0,2,3,4,6,7],[0,2,3,4,6,8],[0,2,3,4,6,9],[0,2,3,4,6,10],[0,2,3,4,6,11],[0,2,3,4,6,12],[0,2,3,4,6,13],[0,2,3,4,6,14],[0,2,3,4,7,8],[0,2,3,4,7,9],[0,2,3,4,7,10],[0,2,3,4,7,11],[0,2,3,4,7,12],[0,2,3,4,7,13],[0,2,3,4,7,14],[0,2,3,4,8,9],[0,2,3,4,8,10],[0,2,3,4,8,11],[0,2,3,4,8,12],[0,2,3,4,8,13],[0,2,3,4,8,14],[0,2,3,4,9,10],[0,2,3,4,9,11],[0,2,3,4,9,12],[0,2,3,4,9,13],[0,2,3,4,9,14],[0,2,3,4,10,11],[0,2,3,4,10,12],[0,2,3,4,10,13],[0,2,3,4,10,14],[0,2,3,4,11,12],[0,2,3,4,11,13],[0,2,3,4,11,14],[0,2,3,4,12,13],[0,2,3,4,12,14],[0,2,3,4,13,14],[0,2,3,5,6,7],[0,2,3,5,6,8],[0,2,3,5,6,9],[0,2,3,5,6,10],[0,2,3,5,6,11],[0,2,3,5,6,12],[0,2,3,5,6,13],[0,2,3,5,6,14],[0,2,3,5,7,8],[0,2,3,5,7,9],[0,2,3,5,7,10],[0,2,3,5,7,11],[0,2,3,5,7,12],[0,2,3,5,7,13],[0,2,3,5,7,14],[0,2,3,5,8,9],[0,2,3,5,8,10],[0,2,3,5,8,11],[0,2,3,5,8,12],[0,2,3,5,8,13],[0,2,3,5,8,14],[0,2,3,5,9,10],[0,2,3,5,9,11],[0,2,3,5,9,12],[0,2,3,5,9,13],[0,2,3,5,9,14],[0,2,3,5,10,11],[0,2,3,5,10,12],[0,2,3,5,10,13],[0,2,3,5,10,14],[0,2,3,5,11,12],[0,2,3,5,11,13],[0,2,3,5,11,14],[0,2,3,5,12,13],[0,2,3,5,12,14],[0,2,3,5,13,14],[0,2,3,6,7,8],[0,2,3,6,7,9],[0,2,3,6,7,10],[0,2,3,6,7,11],[0,2,3,6,7,12],[0,2,3,6,7,13],[0,2,3,6,7,14],[0,2,3,6,8,9],[0,2,3,6,8,10],[0,2,3,6,8,11],[0,2,3,6,8,12],[0,2,3,6,8,13],[0,2,3,6,8,14],[0,2,3,6,9,10],[0,2,3,6,9,11],[0,2,3,6,9,12],[0,2,3,6,9,13],[0,2,3,6,9,14],[0,2,3,6,10,11],[0,2,3,6,10,12],[0,2,3,6,10,13],[0,2,3,6,10,14],[0,2,3,6,11,12],[0,2,3,6,11,13],[0,2,3,6,11,14],[0,2,3,6,12,13],[0,2,3,6,12,14],[0,2,3,6,13,14],[0,2,3,7,8,9],[0,2,3,7,8,10],[0,2,3,7,8,11],[0,2,3,7,8,12],[0,2,3,7,8,13],[0,2,3,7,8,14],[0,2,3,7,9,10],[0,2,3,7,9,11],[0,2,3,7,9,12],[0,2,3,7,9,13],[0,2,3,7,9,14],[0,2,3,7,10,11],[0,2,3,7,10,12],[0,2,3,7,10,13],[0,2,3,7,10,14],[0,2,3,7,11,12],[0,2,3,7,11,13],[0,2,3,7,11,14],[0,2,3,7,12,13],[0,2,3,7,12,14],[0,2,3,7,13,14],[0,2,3,8,9,10],[0,2,3,8,9,11],[0,2,3,8,9,12],[0,2,3,8,9,13],[0,2,3,8,9,14],[0,2,3,8,10,11],[0,2,3,8,10,12],[0,2,3,8,10,13],[0,2,3,8,10,14],[0,2,3,8,11,12],[0,2,3,8,11,13],[0,2,3,8,11,14],[0,2,3,8,12,13],[0,2,3,8,12,14],[0,2,3,8,13,14],[0,2,3,9,10,11],[0,2,3,9,10,12],[0,2,3,9,10,13],[0,2,3,9,10,14],[0,2,3,9,11,12],[0,2,3,9,11,13],[0,2,3,9,11,14],[0,2,3,9,12,13],[0,2,3,9,12,14],[0,2,3,9,13,14],[0,2,3,10,11,12],[0,2,3,10,11,13],[0,2,3,10,11,14],[0,2,3,10,12,13],[0,2,3,10,12,14],[0,2,3,10,13,14],[0,2,3,11,12,13],[0,2,3,11,12,14],[0,2,3,11,13,14],[0,2,3,12,13,14],[0,2,4,5,6,7],[0,2,4,5,6,8],[0,2,4,5,6,9],[0,2,4,5,6,10],[0,2,4,5,6,11],[0,2,4,5,6,12],[0,2,4,5,6,13],[0,2,4,5,6,14],[0,2,4,5,7,8],[0,2,4,5,7,9],[0,2,4,5,7,10],[0,2,4,5,7,11],[0,2,4,5,7,12],[0,2,4,5,7,13],[0,2,4,5,7,14],[0,2,4,5,8,9],[0,2,4,5,8,10],[0,2,4,5,8,11],[0,2,4,5,8,12],[0,2,4,5,8,13],[0,2,4,5,8,14],[0,2,4,5,9,10],[0,2,4,5,9,11],[0,2,4,5,9,12],[0,2,4,5,9,13],[0,2,4,5,9,14],[0,2,4,5,10,11],[0,2,4,5,10,12],[0,2,4,5,10,13],[0,2,4,5,10,14],[0,2,4,5,11,12],[0,2,4,5,11,13],[0,2,4,5,11,14],[0,2,4,5,12,13],[0,2,4,5,12,14],[0,2,4,5,13,14],[0,2,4,6,7,8],[0,2,4,6,7,9],[0,2,4,6,7,10],[0,2,4,6,7,11],[0,2,4,6,7,12],[0,2,4,6,7,13],[0,2,4,6,7,14],[0,2,4,6,8,9],[0,2,4,6,8,10],[0,2,4,6,8,11],[0,2,4,6,8,12],[0,2,4,6,8,13],[0,2,4,6,8,14],[0,2,4,6,9,10],[0,2,4,6,9,11],[0,2,4,6,9,12],[0,2,4,6,9,13],[0,2,4,6,9,14],[0,2,4,6,10,11],[0,2,4,6,10,12],[0,2,4,6,10,13],[0,2,4,6,10,14],[0,2,4,6,11,12],[0,2,4,6,11,13],[0,2,4,6,11,14],[0,2,4,6,12,13],[0,2,4,6,12,14],[0,2,4,6,13,14],[0,2,4,7,8,9],[0,2,4,7,8,10],[0,2,4,7,8,11],[0,2,4,7,8,12],[0,2,4,7,8,13],[0,2,4,7,8,14],[0,2,4,7,9,10],[0,2,4,7,9,11],[0,2,4,7,9,12],[0,2,4,7,9,13],[0,2,4,7,9,14],[0,2,4,7,10,11],[0,2,4,7,10,12],[0,2,4,7,10,13],[0,2,4,7,10,14],[0,2,4,7,11,12],[0,2,4,7,11,13],[0,2,4,7,11,14],[0,2,4,7,12,13],[0,2,4,7,12,14],[0,2,4,7,13,14],[0,2,4,8,9,10],[0,2,4,8,9,11],[0,2,4,8,9,12],[0,2,4,8,9,13],[0,2,4,8,9,14],[0,2,4,8,10,11],[0,2,4,8,10,12],[0,2,4,8,10,13],[0,2,4,8,10,14],[0,2,4,8,11,12],[0,2,4,8,11,13],[0,2,4,8,11,14],[0,2,4,8,12,13],[0,2,4,8,12,14],[0,2,4,8,13,14],[0,2,4,9,10,11],[0,2,4,9,10,12],[0,2,4,9,10,13],[0,2,4,9,10,14],[0,2,4,9,11,12],[0,2,4,9,11,13],[0,2,4,9,11,14],[0,2,4,9,12,13],[0,2,4,9,12,14],[0,2,4,9,13,14],[0,2,4,10,11,12],[0,2,4,10,11,13],[0,2,4,10,11,14],[0,2,4,10,12,13],[0,2,4,10,12,14],[0,2,4,10,13,14],[0,2,4,11,12,13],[0,2,4,11,12,14],[0,2,4,11,13,14],[0,2,4,12,13,14],[0,2,5,6,7,8],[0,2,5,6,7,9],[0,2,5,6,7,10],[0,2,5,6,7,11],[0,2,5,6,7,12],[0,2,5,6,7,13],[0,2,5,6,7,14],[0,2,5,6,8,9],[0,2,5,6,8,10],[0,2,5,6,8,11],[0,2,5,6,8,12],[0,2,5,6,8,13],[0,2,5,6,8,14],[0,2,5,6,9,10],[0,2,5,6,9,11],[0,2,5,6,9,12],[0,2,5,6,9,13],[0,2,5,6,9,14],[0,2,5,6,10,11],[0,2,5,6,10,12],[0,2,5,6,10,13],[0,2,5,6,10,14],[0,2,5,6,11,12],[0,2,5,6,11,13],[0,2,5,6,11,14],[0,2,5,6,12,13],[0,2,5,6,12,14],[0,2,5,6,13,14],[0,2,5,7,8,9],[0,2,5,7,8,10],[0,2,5,7,8,11],[0,2,5,7,8,12],[0,2,5,7,8,13],[0,2,5,7,8,14],[0,2,5,7,9,10],[0,2,5,7,9,11],[0,2,5,7,9,12],[0,2,5,7,9,13],[0,2,5,7,9,14],[0,2,5,7,10,11],[0,2,5,7,10,12],[0,2,5,7,10,13],[0,2,5,7,10,14],[0,2,5,7,11,12],[0,2,5,7,11,13],[0,2,5,7,11,14],[0,2,5,7,12,13],[0,2,5,7,12,14],[0,2,5,7,13,14],[0,2,5,8,9,10],[0,2,5,8,9,11],[0,2,5,8,9,12],[0,2,5,8,9,13],[0,2,5,8,9,14],[0,2,5,8,10,11],[0,2,5,8,10,12],[0,2,5,8,10,13],[0,2,5,8,10,14],[0,2,5,8,11,12],[0,2,5,8,11,13],[0,2,5,8,11,14],[0,2,5,8,12,13],[0,2,5,8,12,14],[0,2,5,8,13,14],[0,2,5,9,10,11],[0,2,5,9,10,12],[0,2,5,9,10,13],[0,2,5,9,10,14],[0,2,5,9,11,12],[0,2,5,9,11,13],[0,2,5,9,11,14],[0,2,5,9,12,13],[0,2,5,9,12,14],[0,2,5,9,13,14],[0,2,5,10,11,12],[0,2,5,10,11,13],[0,2,5,10,11,14],[0,2,5,10,12,13],[0,2,5,10,12,14],[0,2,5,10,13,14],[0,2,5,11,12,13],[0,2,5,11,12,14],[0,2,5,11,13,14],[0,2,5,12,13,14],[0,2,6,7,8,9],[0,2,6,7,8,10],[0,2,6,7,8,11],[0,2,6,7,8,12],[0,2,6,7,8,13],[0,2,6,7,8,14],[0,2,6,7,9,10],[0,2,6,7,9,11],[0,2,6,7,9,12],[0,2,6,7,9,13],[0,2,6,7,9,14],[0,2,6,7,10,11],[0,2,6,7,10,12],[0,2,6,7,10,13],[0,2,6,7,10,14],[0,2,6,7,11,12],[0,2,6,7,11,13],[0,2,6,7,11,14],[0,2,6,7,12,13],[0,2,6,7,12,14],[0,2,6,7,13,14],[0,2,6,8,9,10],[0,2,6,8,9,11],[0,2,6,8,9,12],[0,2,6,8,9,13],[0,2,6,8,9,14],[0,2,6,8,10,11],[0,2,6,8,10,12],[0,2,6,8,10,13],[0,2,6,8,10,14],[0,2,6,8,11,12],[0,2,6,8,11,13],[0,2,6,8,11,14],[0,2,6,8,12,13],[0,2,6,8,12,14],[0,2,6,8,13,14],[0,2,6,9,10,11],[0,2,6,9,10,12],[0,2,6,9,10,13],[0,2,6,9,10,14],[0,2,6,9,11,12],[0,2,6,9,11,13],[0,2,6,9,11,14],[0,2,6,9,12,13],[0,2,6,9,12,14],[0,2,6,9,13,14],[0,2,6,10,11,12],[0,2,6,10,11,13],[0,2,6,10,11,14],[0,2,6,10,12,13],[0,2,6,10,12,14],[0,2,6,10,13,14],[0,2,6,11,12,13],[0,2,6,11,12,14],[0,2,6,11,13,14],[0,2,6,12,13,14],[0,2,7,8,9,10],[0,2,7,8,9,11],[0,2,7,8,9,12],[0,2,7,8,9,13],[0,2,7,8,9,14],[0,2,7,8,10,11],[0,2,7,8,10,12],[0,2,7,8,10,13],[0,2,7,8,10,14],[0,2,7,8,11,12],[0,2,7,8,11,13],[0,2,7,8,11,14],[0,2,7,8,12,13],[0,2,7,8,12,14],[0,2,7,8,13,14],[0,2,7,9,10,11],[0,2,7,9,10,12],[0,2,7,9,10,13],[0,2,7,9,10,14],[0,2,7,9,11,12],[0,2,7,9,11,13],[0,2,7,9,11,14],[0,2,7,9,12,13],[0,2,7,9,12,14],[0,2,7,9,13,14],[0,2,7,10,11,12],[0,2,7,10,11,13],[0,2,7,10,11,14],[0,2,7,10,12,13],[0,2,7,10,12,14],[0,2,7,10,13,14],[0,2,7,11,12,13],[0,2,7,11,12,14],[0,2,7,11,13,14],[0,2,7,12,13,14],[0,2,8,9,10,11],[0,2,8,9,10,12],[0,2,8,9,10,13],[0,2,8,9,10,14],[0,2,8,9,11,12],[0,2,8,9,11,13],[0,2,8,9,11,14],[0,2,8,9,12,13],[0,2,8,9,12,14],[0,2,8,9,13,14],[0,2,8,10,11,12],[0,2,8,10,11,13],[0,2,8,10,11,14],[0,2,8,10,12,13],[0,2,8,10,12,14],[0,2,8,10,13,14],[0,2,8,11,12,13],[0,2,8,11,12,14],[0,2,8,11,13,14],[0,2,8,12,13,14],[0,2,9,10,11,12],[0,2,9,10,11,13],[0,2,9,10,11,14],[0,2,9,10,12,13],[0,2,9,10,12,14],[0,2,9,10,13,14],[0,2,9,11,12,13],[0,2,9,11,12,14],[0,2,9,11,13,14],[0,2,9,12,13,14],[0,2,10,11,12,13],[0,2,10,11,12,14],[0,2,10,11,13,14],[0,2,10,12,13,14],[0,2,11,12,13,14],[0,3,4,5,6,7],[0,3,4,5,6,8],[0,3,4,5,6,9],[0,3,4,5,6,10],[0,3,4,5,6,11],[0,3,4,5,6,12],[0,3,4,5,6,13],[0,3,4,5,6,14],[0,3,4,5,7,8],[0,3,4,5,7,9],[0,3,4,5,7,10],[0,3,4,5,7,11],[0,3,4,5,7,12],[0,3,4,5,7,13],[0,3,4,5,7,14],[0,3,4,5,8,9],[0,3,4,5,8,10],[0,3,4,5,8,11],[0,3,4,5,8,12],[0,3,4,5,8,13],[0,3,4,5,8,14],[0,3,4,5,9,10],[0,3,4,5,9,11],[0,3,4,5,9,12],[0,3,4,5,9,13],[0,3,4,5,9,14],[0,3,4,5,10,11],[0,3,4,5,10,12],[0,3,4,5,10,13],[0,3,4,5,10,14],[0,3,4,5,11,12],[0,3,4,5,11,13],[0,3,4,5,11,14],[0,3,4,5,12,13],[0,3,4,5,12,14],[0,3,4,5,13,14],[0,3,4,6,7,8],[0,3,4,6,7,9],[0,3,4,6,7,10],[0,3,4,6,7,11],[0,3,4,6,7,12],[0,3,4,6,7,13],[0,3,4,6,7,14],[0,3,4,6,8,9],[0,3,4,6,8,10],[0,3,4,6,8,11],[0,3,4,6,8,12],[0,3,4,6,8,13],[0,3,4,6,8,14],[0,3,4,6,9,10],[0,3,4,6,9,11],[0,3,4,6,9,12],[0,3,4,6,9,13],[0,3,4,6,9,14],[0,3,4,6,10,11],[0,3,4,6,10,12],[0,3,4,6,10,13],[0,3,4,6,10,14],[0,3,4,6,11,12],[0,3,4,6,11,13],[0,3,4,6,11,14],[0,3,4,6,12,13],[0,3,4,6,12,14],[0,3,4,6,13,14],[0,3,4,7,8,9],[0,3,4,7,8,10],[0,3,4,7,8,11],[0,3,4,7,8,12],[0,3,4,7,8,13],[0,3,4,7,8,14],[0,3,4,7,9,10],[0,3,4,7,9,11],[0,3,4,7,9,12],[0,3,4,7,9,13],[0,3,4,7,9,14],[0,3,4,7,10,11],[0,3,4,7,10,12],[0,3,4,7,10,13],[0,3,4,7,10,14],[0,3,4,7,11,12],[0,3,4,7,11,13],[0,3,4,7,11,14],[0,3,4,7,12,13],[0,3,4,7,12,14],[0,3,4,7,13,14],[0,3,4,8,9,10],[0,3,4,8,9,11],[0,3,4,8,9,12],[0,3,4,8,9,13],[0,3,4,8,9,14],[0,3,4,8,10,11],[0,3,4,8,10,12],[0,3,4,8,10,13],[0,3,4,8,10,14],[0,3,4,8,11,12],[0,3,4,8,11,13],[0,3,4,8,11,14],[0,3,4,8,12,13],[0,3,4,8,12,14],[0,3,4,8,13,14],[0,3,4,9,10,11],[0,3,4,9,10,12],[0,3,4,9,10,13],[0,3,4,9,10,14],[0,3,4,9,11,12],[0,3,4,9,11,13],[0,3,4,9,11,14],[0,3,4,9,12,13],[0,3,4,9,12,14],[0,3,4,9,13,14],[0,3,4,10,11,12],[0,3,4,10,11,13],[0,3,4,10,11,14],[0,3,4,10,12,13],[0,3,4,10,12,14],[0,3,4,10,13,14],[0,3,4,11,12,13],[0,3,4,11,12,14],[0,3,4,11,13,14],[0,3,4,12,13,14],[0,3,5,6,7,8],[0,3,5,6,7,9],[0,3,5,6,7,10],[0,3,5,6,7,11],[0,3,5,6,7,12],[0,3,5,6,7,13],[0,3,5,6,7,14],[0,3,5,6,8,9],[0,3,5,6,8,10],[0,3,5,6,8,11],[0,3,5,6,8,12],[0,3,5,6,8,13],[0,3,5,6,8,14],[0,3,5,6,9,10],[0,3,5,6,9,11],[0,3,5,6,9,12],[0,3,5,6,9,13],[0,3,5,6,9,14],[0,3,5,6,10,11],[0,3,5,6,10,12],[0,3,5,6,10,13],[0,3,5,6,10,14],[0,3,5,6,11,12],[0,3,5,6,11,13],[0,3,5,6,11,14],[0,3,5,6,12,13],[0,3,5,6,12,14],[0,3,5,6,13,14],[0,3,5,7,8,9],[0,3,5,7,8,10],[0,3,5,7,8,11],[0,3,5,7,8,12],[0,3,5,7,8,13],[0,3,5,7,8,14],[0,3,5,7,9,10],[0,3,5,7,9,11],[0,3,5,7,9,12],[0,3,5,7,9,13],[0,3,5,7,9,14],[0,3,5,7,10,11],[0,3,5,7,10,12],[0,3,5,7,10,13],[0,3,5,7,10,14],[0,3,5,7,11,12],[0,3,5,7,11,13],[0,3,5,7,11,14],[0,3,5,7,12,13],[0,3,5,7,12,14],[0,3,5,7,13,14],[0,3,5,8,9,10],[0,3,5,8,9,11],[0,3,5,8,9,12],[0,3,5,8,9,13],[0,3,5,8,9,14],[0,3,5,8,10,11],[0,3,5,8,10,12],[0,3,5,8,10,13],[0,3,5,8,10,14],[0,3,5,8,11,12],[0,3,5,8,11,13],[0,3,5,8,11,14],[0,3,5,8,12,13],[0,3,5,8,12,14],[0,3,5,8,13,14],[0,3,5,9,10,11],[0,3,5,9,10,12],[0,3,5,9,10,13],[0,3,5,9,10,14],[0,3,5,9,11,12],[0,3,5,9,11,13],[0,3,5,9,11,14],[0,3,5,9,12,13],[0,3,5,9,12,14],[0,3,5,9,13,14],[0,3,5,10,11,12],[0,3,5,10,11,13],[0,3,5,10,11,14],[0,3,5,10,12,13],[0,3,5,10,12,14],[0,3,5,10,13,14],[0,3,5,11,12,13],[0,3,5,11,12,14],[0,3,5,11,13,14],[0,3,5,12,13,14],[0,3,6,7,8,9],[0,3,6,7,8,10],[0,3,6,7,8,11],[0,3,6,7,8,12],[0,3,6,7,8,13],[0,3,6,7,8,14],[0,3,6,7,9,10],[0,3,6,7,9,11],[0,3,6,7,9,12],[0,3,6,7,9,13],[0,3,6,7,9,14],[0,3,6,7,10,11],[0,3,6,7,10,12],[0,3,6,7,10,13],[0,3,6,7,10,14],[0,3,6,7,11,12],[0,3,6,7,11,13],[0,3,6,7,11,14],[0,3,6,7,12,13],[0,3,6,7,12,14],[0,3,6,7,13,14],[0,3,6,8,9,10],[0,3,6,8,9,11],[0,3,6,8,9,12],[0,3,6,8,9,13],[0,3,6,8,9,14],[0,3,6,8,10,11],[0,3,6,8,10,12],[0,3,6,8,10,13],[0,3,6,8,10,14],[0,3,6,8,11,12],[0,3,6,8,11,13],[0,3,6,8,11,14],[0,3,6,8,12,13],[0,3,6,8,12,14],[0,3,6,8,13,14],[0,3,6,9,10,11],[0,3,6,9,10,12],[0,3,6,9,10,13],[0,3,6,9,10,14],[0,3,6,9,11,12],[0,3,6,9,11,13],[0,3,6,9,11,14],[0,3,6,9,12,13],[0,3,6,9,12,14],[0,3,6,9,13,14],[0,3,6,10,11,12],[0,3,6,10,11,13],[0,3,6,10,11,14],[0,3,6,10,12,13],[0,3,6,10,12,14],[0,3,6,10,13,14],[0,3,6,11,12,13],[0,3,6,11,12,14],[0,3,6,11,13,14],[0,3,6,12,13,14],[0,3,7,8,9,10],[0,3,7,8,9,11],[0,3,7,8,9,12],[0,3,7,8,9,13],[0,3,7,8,9,14],[0,3,7,8,10,11],[0,3,7,8,10,12],[0,3,7,8,10,13],[0,3,7,8,10,14],[0,3,7,8,11,12],[0,3,7,8,11,13],[0,3,7,8,11,14],[0,3,7,8,12,13],[0,3,7,8,12,14],[0,3,7,8,13,14],[0,3,7,9,10,11],[0,3,7,9,10,12],[0,3,7,9,10,13],[0,3,7,9,10,14],[0,3,7,9,11,12],[0,3,7,9,11,13],[0,3,7,9,11,14],[0,3,7,9,12,13],[0,3,7,9,12,14],[0,3,7,9,13,14],[0,3,7,10,11,12],[0,3,7,10,11,13],[0,3,7,10,11,14],[0,3,7,10,12,13],[0,3,7,10,12,14],[0,3,7,10,13,14],[0,3,7,11,12,13],[0,3,7,11,12,14],[0,3,7,11,13,14],[0,3,7,12,13,14],[0,3,8,9,10,11],[0,3,8,9,10,12],[0,3,8,9,10,13],[0,3,8,9,10,14],[0,3,8,9,11,12],[0,3,8,9,11,13],[0,3,8,9,11,14],[0,3,8,9,12,13],[0,3,8,9,12,14],[0,3,8,9,13,14],[0,3,8,10,11,12],[0,3,8,10,11,13],[0,3,8,10,11,14],[0,3,8,10,12,13],[0,3,8,10,12,14],[0,3,8,10,13,14],[0,3,8,11,12,13],[0,3,8,11,12,14],[0,3,8,11,13,14],[0,3,8,12,13,14],[0,3,9,10,11,12],[0,3,9,10,11,13],[0,3,9,10,11,14],[0,3,9,10,12,13],[0,3,9,10,12,14],[0,3,9,10,13,14],[0,3,9,11,12,13],[0,3,9,11,12,14],[0,3,9,11,13,14],[0,3,9,12,13,14],[0,3,10,11,12,13],[0,3,10,11,12,14],[0,3,10,11,13,14],[0,3,10,12,13,14],[0,3,11,12,13,14],[0,4,5,6,7,8],[0,4,5,6,7,9],[0,4,5,6,7,10],[0,4,5,6,7,11],[0,4,5,6,7,12],[0,4,5,6,7,13],[0,4,5,6,7,14],[0,4,5,6,8,9],[0,4,5,6,8,10],[0,4,5,6,8,11],[0,4,5,6,8,12],[0,4,5,6,8,13],[0,4,5,6,8,14],[0,4,5,6,9,10],[0,4,5,6,9,11],[0,4,5,6,9,12],[0,4,5,6,9,13],[0,4,5,6,9,14],[0,4,5,6,10,11],[0,4,5,6,10,12],[0,4,5,6,10,13],[0,4,5,6,10,14],[0,4,5,6,11,12],[0,4,5,6,11,13],[0,4,5,6,11,14],[0,4,5,6,12,13],[0,4,5,6,12,14],[0,4,5,6,13,14],[0,4,5,7,8,9],[0,4,5,7,8,10],[0,4,5,7,8,11],[0,4,5,7,8,12],[0,4,5,7,8,13],[0,4,5,7,8,14],[0,4,5,7,9,10],[0,4,5,7,9,11],[0,4,5,7,9,12],[0,4,5,7,9,13],[0,4,5,7,9,14],[0,4,5,7,10,11],[0,4,5,7,10,12],[0,4,5,7,10,13],[0,4,5,7,10,14],[0,4,5,7,11,12],[0,4,5,7,11,13],[0,4,5,7,11,14],[0,4,5,7,12,13],[0,4,5,7,12,14],[0,4,5,7,13,14],[0,4,5,8,9,10],[0,4,5,8,9,11],[0,4,5,8,9,12],[0,4,5,8,9,13],[0,4,5,8,9,14],[0,4,5,8,10,11],[0,4,5,8,10,12],[0,4,5,8,10,13],[0,4,5,8,10,14],[0,4,5,8,11,12],[0,4,5,8,11,13],[0,4,5,8,11,14],[0,4,5,8,12,13],[0,4,5,8,12,14],[0,4,5,8,13,14],[0,4,5,9,10,11],[0,4,5,9,10,12],[0,4,5,9,10,13],[0,4,5,9,10,14],[0,4,5,9,11,12],[0,4,5,9,11,13],[0,4,5,9,11,14],[0,4,5,9,12,13],[0,4,5,9,12,14],[0,4,5,9,13,14],[0,4,5,10,11,12],[0,4,5,10,11,13],[0,4,5,10,11,14],[0,4,5,10,12,13],[0,4,5,10,12,14],[0,4,5,10,13,14],[0,4,5,11,12,13],[0,4,5,11,12,14],[0,4,5,11,13,14],[0,4,5,12,13,14],[0,4,6,7,8,9],[0,4,6,7,8,10],[0,4,6,7,8,11],[0,4,6,7,8,12],[0,4,6,7,8,13],[0,4,6,7,8,14],[0,4,6,7,9,10],[0,4,6,7,9,11],[0,4,6,7,9,12],[0,4,6,7,9,13],[0,4,6,7,9,14],[0,4,6,7,10,11],[0,4,6,7,10,12],[0,4,6,7,10,13],[0,4,6,7,10,14],[0,4,6,7,11,12],[0,4,6,7,11,13],[0,4,6,7,11,14],[0,4,6,7,12,13],[0,4,6,7,12,14],[0,4,6,7,13,14],[0,4,6,8,9,10],[0,4,6,8,9,11],[0,4,6,8,9,12],[0,4,6,8,9,13],[0,4,6,8,9,14],[0,4,6,8,10,11],[0,4,6,8,10,12],[0,4,6,8,10,13],[0,4,6,8,10,14],[0,4,6,8,11,12],[0,4,6,8,11,13],[0,4,6,8,11,14],[0,4,6,8,12,13],[0,4,6,8,12,14],[0,4,6,8,13,14],[0,4,6,9,10,11],[0,4,6,9,10,12],[0,4,6,9,10,13],[0,4,6,9,10,14],[0,4,6,9,11,12],[0,4,6,9,11,13],[0,4,6,9,11,14],[0,4,6,9,12,13],[0,4,6,9,12,14],[0,4,6,9,13,14],[0,4,6,10,11,12],[0,4,6,10,11,13],[0,4,6,10,11,14],[0,4,6,10,12,13],[0,4,6,10,12,14],[0,4,6,10,13,14],[0,4,6,11,12,13],[0,4,6,11,12,14],[0,4,6,11,13,14],[0,4,6,12,13,14],[0,4,7,8,9,10],[0,4,7,8,9,11],[0,4,7,8,9,12],[0,4,7,8,9,13],[0,4,7,8,9,14],[0,4,7,8,10,11],[0,4,7,8,10,12],[0,4,7,8,10,13],[0,4,7,8,10,14],[0,4,7,8,11,12],[0,4,7,8,11,13],[0,4,7,8,11,14],[0,4,7,8,12,13],[0,4,7,8,12,14],[0,4,7,8,13,14],[0,4,7,9,10,11],[0,4,7,9,10,12],[0,4,7,9,10,13],[0,4,7,9,10,14],[0,4,7,9,11,12],[0,4,7,9,11,13],[0,4,7,9,11,14],[0,4,7,9,12,13],[0,4,7,9,12,14],[0,4,7,9,13,14],[0,4,7,10,11,12],[0,4,7,10,11,13],[0,4,7,10,11,14],[0,4,7,10,12,13],[0,4,7,10,12,14],[0,4,7,10,13,14],[0,4,7,11,12,13],[0,4,7,11,12,14],[0,4,7,11,13,14],[0,4,7,12,13,14],[0,4,8,9,10,11],[0,4,8,9,10,12],[0,4,8,9,10,13],[0,4,8,9,10,14],[0,4,8,9,11,12],[0,4,8,9,11,13],[0,4,8,9,11,14],[0,4,8,9,12,13],[0,4,8,9,12,14],[0,4,8,9,13,14],[0,4,8,10,11,12],[0,4,8,10,11,13],[0,4,8,10,11,14],[0,4,8,10,12,13],[0,4,8,10,12,14],[0,4,8,10,13,14],[0,4,8,11,12,13],[0,4,8,11,12,14],[0,4,8,11,13,14],[0,4,8,12,13,14],[0,4,9,10,11,12],[0,4,9,10,11,13],[0,4,9,10,11,14],[0,4,9,10,12,13],[0,4,9,10,12,14],[0,4,9,10,13,14],[0,4,9,11,12,13],[0,4,9,11,12,14],[0,4,9,11,13,14],[0,4,9,12,13,14],[0,4,10,11,12,13],[0,4,10,11,12,14],[0,4,10,11,13,14],[0,4,10,12,13,14],[0,4,11,12,13,14],[0,5,6,7,8,9],[0,5,6,7,8,10],[0,5,6,7,8,11],[0,5,6,7,8,12],[0,5,6,7,8,13],[0,5,6,7,8,14],[0,5,6,7,9,10],[0,5,6,7,9,11],[0,5,6,7,9,12],[0,5,6,7,9,13],[0,5,6,7,9,14],[0,5,6,7,10,11],[0,5,6,7,10,12],[0,5,6,7,10,13],[0,5,6,7,10,14],[0,5,6,7,11,12],[0,5,6,7,11,13],[0,5,6,7,11,14],[0,5,6,7,12,13],[0,5,6,7,12,14],[0,5,6,7,13,14],[0,5,6,8,9,10],[0,5,6,8,9,11],[0,5,6,8,9,12],[0,5,6,8,9,13],[0,5,6,8,9,14],[0,5,6,8,10,11],[0,5,6,8,10,12],[0,5,6,8,10,13],[0,5,6,8,10,14],[0,5,6,8,11,12],[0,5,6,8,11,13],[0,5,6,8,11,14],[0,5,6,8,12,13],[0,5,6,8,12,14],[0,5,6,8,13,14],[0,5,6,9,10,11],[0,5,6,9,10,12],[0,5,6,9,10,13],[0,5,6,9,10,14],[0,5,6,9,11,12],[0,5,6,9,11,13],[0,5,6,9,11,14],[0,5,6,9,12,13],[0,5,6,9,12,14],[0,5,6,9,13,14],[0,5,6,10,11,12],[0,5,6,10,11,13],[0,5,6,10,11,14],[0,5,6,10,12,13],[0,5,6,10,12,14],[0,5,6,10,13,14],[0,5,6,11,12,13],[0,5,6,11,12,14],[0,5,6,11,13,14],[0,5,6,12,13,14],[0,5,7,8,9,10],[0,5,7,8,9,11],[0,5,7,8,9,12],[0,5,7,8,9,13],[0,5,7,8,9,14],[0,5,7,8,10,11],[0,5,7,8,10,12],[0,5,7,8,10,13],[0,5,7,8,10,14],[0,5,7,8,11,12],[0,5,7,8,11,13],[0,5,7,8,11,14],[0,5,7,8,12,13],[0,5,7,8,12,14],[0,5,7,8,13,14],[0,5,7,9,10,11],[0,5,7,9,10,12],[0,5,7,9,10,13],[0,5,7,9,10,14],[0,5,7,9,11,12],[0,5,7,9,11,13],[0,5,7,9,11,14],[0,5,7,9,12,13],[0,5,7,9,12,14],[0,5,7,9,13,14],[0,5,7,10,11,12],[0,5,7,10,11,13],[0,5,7,10,11,14],[0,5,7,10,12,13],[0,5,7,10,12,14],[0,5,7,10,13,14],[0,5,7,11,12,13],[0,5,7,11,12,14],[0,5,7,11,13,14],[0,5,7,12,13,14],[0,5,8,9,10,11],[0,5,8,9,10,12],[0,5,8,9,10,13],[0,5,8,9,10,14],[0,5,8,9,11,12],[0,5,8,9,11,13],[0,5,8,9,11,14],[0,5,8,9,12,13],[0,5,8,9,12,14],[0,5,8,9,13,14],[0,5,8,10,11,12],[0,5,8,10,11,13],[0,5,8,10,11,14],[0,5,8,10,12,13],[0,5,8,10,12,14],[0,5,8,10,13,14],[0,5,8,11,12,13],[0,5,8,11,12,14],[0,5,8,11,13,14],[0,5,8,12,13,14],[0,5,9,10,11,12],[0,5,9,10,11,13],[0,5,9,10,11,14],[0,5,9,10,12,13],[0,5,9,10,12,14],[0,5,9,10,13,14],[0,5,9,11,12,13],[0,5,9,11,12,14],[0,5,9,11,13,14],[0,5,9,12,13,14],[0,5,10,11,12,13],[0,5,10,11,12,14],[0,5,10,11,13,14],[0,5,10,12,13,14],[0,5,11,12,13,14],[0,6,7,8,9,10],[0,6,7,8,9,11],[0,6,7,8,9,12],[0,6,7,8,9,13],[0,6,7,8,9,14],[0,6,7,8,10,11],[0,6,7,8,10,12],[0,6,7,8,10,13],[0,6,7,8,10,14],[0,6,7,8,11,12],[0,6,7,8,11,13],[0,6,7,8,11,14],[0,6,7,8,12,13],[0,6,7,8,12,14],[0,6,7,8,13,14],[0,6,7,9,10,11],[0,6,7,9,10,12],[0,6,7,9,10,13],[0,6,7,9,10,14],[0,6,7,9,11,12],[0,6,7,9,11,13],[0,6,7,9,11,14],[0,6,7,9,12,13],[0,6,7,9,12,14],[0,6,7,9,13,14],[0,6,7,10,11,12],[0,6,7,10,11,13],[0,6,7,10,11,14],[0,6,7,10,12,13],[0,6,7,10,12,14],[0,6,7,10,13,14],[0,6,7,11,12,13],[0,6,7,11,12,14],[0,6,7,11,13,14],[0,6,7,12,13,14],[0,6,8,9,10,11],[0,6,8,9,10,12],[0,6,8,9,10,13],[0,6,8,9,10,14],[0,6,8,9,11,12],[0,6,8,9,11,13],[0,6,8,9,11,14],[0,6,8,9,12,13],[0,6,8,9,12,14],[0,6,8,9,13,14],[0,6,8,10,11,12],[0,6,8,10,11,13],[0,6,8,10,11,14],[0,6,8,10,12,13],[0,6,8,10,12,14],[0,6,8,10,13,14],[0,6,8,11,12,13],[0,6,8,11,12,14],[0,6,8,11,13,14],[0,6,8,12,13,14],[0,6,9,10,11,12],[0,6,9,10,11,13],[0,6,9,10,11,14],[0,6,9,10,12,13],[0,6,9,10,12,14],[0,6,9,10,13,14],[0,6,9,11,12,13],[0,6,9,11,12,14],[0,6,9,11,13,14],[0,6,9,12,13,14],[0,6,10,11,12,13],[0,6,10,11,12,14],[0,6,10,11,13,14],[0,6,10,12,13,14],[0,6,11,12,13,14],[0,7,8,9,10,11],[0,7,8,9,10,12],[0,7,8,9,10,13],[0,7,8,9,10,14],[0,7,8,9,11,12],[0,7,8,9,11,13],[0,7,8,9,11,14],[0,7,8,9,12,13],[0,7,8,9,12,14],[0,7,8,9,13,14],[0,7,8,10,11,12],[0,7,8,10,11,13],[0,7,8,10,11,14],[0,7,8,10,12,13],[0,7,8,10,12,14],[0,7,8,10,13,14],[0,7,8,11,12,13],[0,7,8,11,12,14],[0,7,8,11,13,14],[0,7,8,12,13,14],[0,7,9,10,11,12],[0,7,9,10,11,13],[0,7,9,10,11,14],[0,7,9,10,12,13],[0,7,9,10,12,14],[0,7,9,10,13,14],[0,7,9,11,12,13],[0,7,9,11,12,14],[0,7,9,11,13,14],[0,7,9,12,13,14],[0,7,10,11,12,13],[0,7,10,11,12,14],[0,7,10,11,13,14],[0,7,10,12,13,14],[0,7,11,12,13,14],[0,8,9,10,11,12],[0,8,9,10,11,13],[0,8,9,10,11,14],[0,8,9,10,12,13],[0,8,9,10,12,14],[0,8,9,10,13,14],[0,8,9,11,12,13],[0,8,9,11,12,14],[0,8,9,11,13,14],[0,8,9,12,13,14],[0,8,10,11,12,13],[0,8,10,11,12,14],[0,8,10,11,13,14],[0,8,10,12,13,14],[0,8,11,12,13,14],[0,9,10,11,12,13],[0,9,10,11,12,14],[0,9,10,11,13,14],[0,9,10,12,13,14],[0,9,11,12,13,14],[0,10,11,12,13,14],[1,2,3,4,5,6],[1,2,3,4,5,7],[1,2,3,4,5,8],[1,2,3,4,5,9],[1,2,3,4,5,10],[1,2,3,4,5,11],[1,2,3,4,5,12],[1,2,3,4,5,13],[1,2,3,4,5,14],[1,2,3,4,6,7],[1,2,3,4,6,8],[1,2,3,4,6,9],[1,2,3,4,6,10],[1,2,3,4,6,11],[1,2,3,4,6,12],[1,2,3,4,6,13],[1,2,3,4,6,14],[1,2,3,4,7,8],[1,2,3,4,7,9],[1,2,3,4,7,10],[1,2,3,4,7,11],[1,2,3,4,7,12],[1,2,3,4,7,13],[1,2,3,4,7,14],[1,2,3,4,8,9],[1,2,3,4,8,10],[1,2,3,4,8,11],[1,2,3,4,8,12],[1,2,3,4,8,13],[1,2,3,4,8,14],[1,2,3,4,9,10],[1,2,3,4,9,11],[1,2,3,4,9,12],[1,2,3,4,9,13],[1,2,3,4,9,14],[1,2,3,4,10,11],[1,2,3,4,10,12],[1,2,3,4,10,13],[1,2,3,4,10,14],[1,2,3,4,11,12],[1,2,3,4,11,13],[1,2,3,4,11,14],[1,2,3,4,12,13],[1,2,3,4,12,14],[1,2,3,4,13,14],[1,2,3,5,6,7],[1,2,3,5,6,8],[1,2,3,5,6,9],[1,2,3,5,6,10],[1,2,3,5,6,11],[1,2,3,5,6,12],[1,2,3,5,6,13],[1,2,3,5,6,14],[1,2,3,5,7,8],[1,2,3,5,7,9],[1,2,3,5,7,10],[1,2,3,5,7,11],[1,2,3,5,7,12],[1,2,3,5,7,13],[1,2,3,5,7,14],[1,2,3,5,8,9],[1,2,3,5,8,10],[1,2,3,5,8,11],[1,2,3,5,8,12],[1,2,3,5,8,13],[1,2,3,5,8,14],[1,2,3,5,9,10],[1,2,3,5,9,11],[1,2,3,5,9,12],[1,2,3,5,9,13],[1,2,3,5,9,14],[1,2,3,5,10,11],[1,2,3,5,10,12],[1,2,3,5,10,13],[1,2,3,5,10,14],[1,2,3,5,11,12],[1,2,3,5,11,13],[1,2,3,5,11,14],[1,2,3,5,12,13],[1,2,3,5,12,14],[1,2,3,5,13,14],[1,2,3,6,7,8],[1,2,3,6,7,9],[1,2,3,6,7,10],[1,2,3,6,7,11],[1,2,3,6,7,12],[1,2,3,6,7,13],[1,2,3,6,7,14],[1,2,3,6,8,9],[1,2,3,6,8,10],[1,2,3,6,8,11],[1,2,3,6,8,12],[1,2,3,6,8,13],[1,2,3,6,8,14],[1,2,3,6,9,10],[1,2,3,6,9,11],[1,2,3,6,9,12],[1,2,3,6,9,13],[1,2,3,6,9,14],[1,2,3,6,10,11],[1,2,3,6,10,12],[1,2,3,6,10,13],[1,2,3,6,10,14],[1,2,3,6,11,12],[1,2,3,6,11,13],[1,2,3,6,11,14],[1,2,3,6,12,13],[1,2,3,6,12,14],[1,2,3,6,13,14],[1,2,3,7,8,9],[1,2,3,7,8,10],[1,2,3,7,8,11],[1,2,3,7,8,12],[1,2,3,7,8,13],[1,2,3,7,8,14],[1,2,3,7,9,10],[1,2,3,7,9,11],[1,2,3,7,9,12],[1,2,3,7,9,13],[1,2,3,7,9,14],[1,2,3,7,10,11],[1,2,3,7,10,12],[1,2,3,7,10,13],[1,2,3,7,10,14],[1,2,3,7,11,12],[1,2,3,7,11,13],[1,2,3,7,11,14],[1,2,3,7,12,13],[1,2,3,7,12,14],[1,2,3,7,13,14],[1,2,3,8,9,10],[1,2,3,8,9,11],[1,2,3,8,9,12],[1,2,3,8,9,13],[1,2,3,8,9,14],[1,2,3,8,10,11],[1,2,3,8,10,12],[1,2,3,8,10,13],[1,2,3,8,10,14],[1,2,3,8,11,12],[1,2,3,8,11,13],[1,2,3,8,11,14],[1,2,3,8,12,13],[1,2,3,8,12,14],[1,2,3,8,13,14],[1,2,3,9,10,11],[1,2,3,9,10,12],[1,2,3,9,10,13],[1,2,3,9,10,14],[1,2,3,9,11,12],[1,2,3,9,11,13],[1,2,3,9,11,14],[1,2,3,9,12,13],[1,2,3,9,12,14],[1,2,3,9,13,14],[1,2,3,10,11,12],[1,2,3,10,11,13],[1,2,3,10,11,14],[1,2,3,10,12,13],[1,2,3,10,12,14],[1,2,3,10,13,14],[1,2,3,11,12,13],[1,2,3,11,12,14],[1,2,3,11,13,14],[1,2,3,12,13,14],[1,2,4,5,6,7],[1,2,4,5,6,8],[1,2,4,5,6,9],[1,2,4,5,6,10],[1,2,4,5,6,11],[1,2,4,5,6,12],[1,2,4,5,6,13],[1,2,4,5,6,14],[1,2,4,5,7,8],[1,2,4,5,7,9],[1,2,4,5,7,10],[1,2,4,5,7,11],[1,2,4,5,7,12],[1,2,4,5,7,13],[1,2,4,5,7,14],[1,2,4,5,8,9],[1,2,4,5,8,10],[1,2,4,5,8,11],[1,2,4,5,8,12],[1,2,4,5,8,13],[1,2,4,5,8,14],[1,2,4,5,9,10],[1,2,4,5,9,11],[1,2,4,5,9,12],[1,2,4,5,9,13],[1,2,4,5,9,14],[1,2,4,5,10,11],[1,2,4,5,10,12],[1,2,4,5,10,13],[1,2,4,5,10,14],[1,2,4,5,11,12],[1,2,4,5,11,13],[1,2,4,5,11,14],[1,2,4,5,12,13],[1,2,4,5,12,14],[1,2,4,5,13,14],[1,2,4,6,7,8],[1,2,4,6,7,9],[1,2,4,6,7,10],[1,2,4,6,7,11],[1,2,4,6,7,12],[1,2,4,6,7,13],[1,2,4,6,7,14],[1,2,4,6,8,9],[1,2,4,6,8,10],[1,2,4,6,8,11],[1,2,4,6,8,12],[1,2,4,6,8,13],[1,2,4,6,8,14],[1,2,4,6,9,10],[1,2,4,6,9,11],[1,2,4,6,9,12],[1,2,4,6,9,13],[1,2,4,6,9,14],[1,2,4,6,10,11],[1,2,4,6,10,12],[1,2,4,6,10,13],[1,2,4,6,10,14],[1,2,4,6,11,12],[1,2,4,6,11,13],[1,2,4,6,11,14],[1,2,4,6,12,13],[1,2,4,6,12,14],[1,2,4,6,13,14],[1,2,4,7,8,9],[1,2,4,7,8,10],[1,2,4,7,8,11],[1,2,4,7,8,12],[1,2,4,7,8,13],[1,2,4,7,8,14],[1,2,4,7,9,10],[1,2,4,7,9,11],[1,2,4,7,9,12],[1,2,4,7,9,13],[1,2,4,7,9,14],[1,2,4,7,10,11],[1,2,4,7,10,12],[1,2,4,7,10,13],[1,2,4,7,10,14],[1,2,4,7,11,12],[1,2,4,7,11,13],[1,2,4,7,11,14],[1,2,4,7,12,13],[1,2,4,7,12,14],[1,2,4,7,13,14],[1,2,4,8,9,10],[1,2,4,8,9,11],[1,2,4,8,9,12],[1,2,4,8,9,13],[1,2,4,8,9,14],[1,2,4,8,10,11],[1,2,4,8,10,12],[1,2,4,8,10,13],[1,2,4,8,10,14],[1,2,4,8,11,12],[1,2,4,8,11,13],[1,2,4,8,11,14],[1,2,4,8,12,13],[1,2,4,8,12,14],[1,2,4,8,13,14],[1,2,4,9,10,11],[1,2,4,9,10,12],[1,2,4,9,10,13],[1,2,4,9,10,14],[1,2,4,9,11,12],[1,2,4,9,11,13],[1,2,4,9,11,14],[1,2,4,9,12,13],[1,2,4,9,12,14],[1,2,4,9,13,14],[1,2,4,10,11,12],[1,2,4,10,11,13],[1,2,4,10,11,14],[1,2,4,10,12,13],[1,2,4,10,12,14],[1,2,4,10,13,14],[1,2,4,11,12,13],[1,2,4,11,12,14],[1,2,4,11,13,14],[1,2,4,12,13,14],[1,2,5,6,7,8],[1,2,5,6,7,9],[1,2,5,6,7,10],[1,2,5,6,7,11],[1,2,5,6,7,12],[1,2,5,6,7,13],[1,2,5,6,7,14],[1,2,5,6,8,9],[1,2,5,6,8,10],[1,2,5,6,8,11],[1,2,5,6,8,12],[1,2,5,6,8,13],[1,2,5,6,8,14],[1,2,5,6,9,10],[1,2,5,6,9,11],[1,2,5,6,9,12],[1,2,5,6,9,13],[1,2,5,6,9,14],[1,2,5,6,10,11],[1,2,5,6,10,12],[1,2,5,6,10,13],[1,2,5,6,10,14],[1,2,5,6,11,12],[1,2,5,6,11,13],[1,2,5,6,11,14],[1,2,5,6,12,13],[1,2,5,6,12,14],[1,2,5,6,13,14],[1,2,5,7,8,9],[1,2,5,7,8,10],[1,2,5,7,8,11],[1,2,5,7,8,12],[1,2,5,7,8,13],[1,2,5,7,8,14],[1,2,5,7,9,10],[1,2,5,7,9,11],[1,2,5,7,9,12],[1,2,5,7,9,13],[1,2,5,7,9,14],[1,2,5,7,10,11],[1,2,5,7,10,12],[1,2,5,7,10,13],[1,2,5,7,10,14],[1,2,5,7,11,12],[1,2,5,7,11,13],[1,2,5,7,11,14],[1,2,5,7,12,13],[1,2,5,7,12,14],[1,2,5,7,13,14],[1,2,5,8,9,10],[1,2,5,8,9,11],[1,2,5,8,9,12],[1,2,5,8,9,13],[1,2,5,8,9,14],[1,2,5,8,10,11],[1,2,5,8,10,12],[1,2,5,8,10,13],[1,2,5,8,10,14],[1,2,5,8,11,12],[1,2,5,8,11,13],[1,2,5,8,11,14],[1,2,5,8,12,13],[1,2,5,8,12,14],[1,2,5,8,13,14],[1,2,5,9,10,11],[1,2,5,9,10,12],[1,2,5,9,10,13],[1,2,5,9,10,14],[1,2,5,9,11,12],[1,2,5,9,11,13],[1,2,5,9,11,14],[1,2,5,9,12,13],[1,2,5,9,12,14],[1,2,5,9,13,14],[1,2,5,10,11,12],[1,2,5,10,11,13],[1,2,5,10,11,14],[1,2,5,10,12,13],[1,2,5,10,12,14],[1,2,5,10,13,14],[1,2,5,11,12,13],[1,2,5,11,12,14],[1,2,5,11,13,14],[1,2,5,12,13,14],[1,2,6,7,8,9],[1,2,6,7,8,10],[1,2,6,7,8,11],[1,2,6,7,8,12],[1,2,6,7,8,13],[1,2,6,7,8,14],[1,2,6,7,9,10],[1,2,6,7,9,11],[1,2,6,7,9,12],[1,2,6,7,9,13],[1,2,6,7,9,14],[1,2,6,7,10,11],[1,2,6,7,10,12],[1,2,6,7,10,13],[1,2,6,7,10,14],[1,2,6,7,11,12],[1,2,6,7,11,13],[1,2,6,7,11,14],[1,2,6,7,12,13],[1,2,6,7,12,14],[1,2,6,7,13,14],[1,2,6,8,9,10],[1,2,6,8,9,11],[1,2,6,8,9,12],[1,2,6,8,9,13],[1,2,6,8,9,14],[1,2,6,8,10,11],[1,2,6,8,10,12],[1,2,6,8,10,13],[1,2,6,8,10,14],[1,2,6,8,11,12],[1,2,6,8,11,13],[1,2,6,8,11,14],[1,2,6,8,12,13],[1,2,6,8,12,14],[1,2,6,8,13,14],[1,2,6,9,10,11],[1,2,6,9,10,12],[1,2,6,9,10,13],[1,2,6,9,10,14],[1,2,6,9,11,12],[1,2,6,9,11,13],[1,2,6,9,11,14],[1,2,6,9,12,13],[1,2,6,9,12,14],[1,2,6,9,13,14],[1,2,6,10,11,12],[1,2,6,10,11,13],[1,2,6,10,11,14],[1,2,6,10,12,13],[1,2,6,10,12,14],[1,2,6,10,13,14],[1,2,6,11,12,13],[1,2,6,11,12,14],[1,2,6,11,13,14],[1,2,6,12,13,14],[1,2,7,8,9,10],[1,2,7,8,9,11],[1,2,7,8,9,12],[1,2,7,8,9,13],[1,2,7,8,9,14],[1,2,7,8,10,11],[1,2,7,8,10,12],[1,2,7,8,10,13],[1,2,7,8,10,14],[1,2,7,8,11,12],[1,2,7,8,11,13],[1,2,7,8,11,14],[1,2,7,8,12,13],[1,2,7,8,12,14],[1,2,7,8,13,14],[1,2,7,9,10,11],[1,2,7,9,10,12],[1,2,7,9,10,13],[1,2,7,9,10,14],[1,2,7,9,11,12],[1,2,7,9,11,13],[1,2,7,9,11,14],[1,2,7,9,12,13],[1,2,7,9,12,14],[1,2,7,9,13,14],[1,2,7,10,11,12],[1,2,7,10,11,13],[1,2,7,10,11,14],[1,2,7,10,12,13],[1,2,7,10,12,14],[1,2,7,10,13,14],[1,2,7,11,12,13],[1,2,7,11,12,14],[1,2,7,11,13,14],[1,2,7,12,13,14],[1,2,8,9,10,11],[1,2,8,9,10,12],[1,2,8,9,10,13],[1,2,8,9,10,14],[1,2,8,9,11,12],[1,2,8,9,11,13],[1,2,8,9,11,14],[1,2,8,9,12,13],[1,2,8,9,12,14],[1,2,8,9,13,14],[1,2,8,10,11,12],[1,2,8,10,11,13],[1,2,8,10,11,14],[1,2,8,10,12,13],[1,2,8,10,12,14],[1,2,8,10,13,14],[1,2,8,11,12,13],[1,2,8,11,12,14],[1,2,8,11,13,14],[1,2,8,12,13,14],[1,2,9,10,11,12],[1,2,9,10,11,13],[1,2,9,10,11,14],[1,2,9,10,12,13],[1,2,9,10,12,14],[1,2,9,10,13,14],[1,2,9,11,12,13],[1,2,9,11,12,14],[1,2,9,11,13,14],[1,2,9,12,13,14],[1,2,10,11,12,13],[1,2,10,11,12,14],[1,2,10,11,13,14],[1,2,10,12,13,14],[1,2,11,12,13,14],[1,3,4,5,6,7],[1,3,4,5,6,8],[1,3,4,5,6,9],[1,3,4,5,6,10],[1,3,4,5,6,11],[1,3,4,5,6,12],[1,3,4,5,6,13],[1,3,4,5,6,14],[1,3,4,5,7,8],[1,3,4,5,7,9],[1,3,4,5,7,10],[1,3,4,5,7,11],[1,3,4,5,7,12],[1,3,4,5,7,13],[1,3,4,5,7,14],[1,3,4,5,8,9],[1,3,4,5,8,10],[1,3,4,5,8,11],[1,3,4,5,8,12],[1,3,4,5,8,13],[1,3,4,5,8,14],[1,3,4,5,9,10],[1,3,4,5,9,11],[1,3,4,5,9,12],[1,3,4,5,9,13],[1,3,4,5,9,14],[1,3,4,5,10,11],[1,3,4,5,10,12],[1,3,4,5,10,13],[1,3,4,5,10,14],[1,3,4,5,11,12],[1,3,4,5,11,13],[1,3,4,5,11,14],[1,3,4,5,12,13],[1,3,4,5,12,14],[1,3,4,5,13,14],[1,3,4,6,7,8],[1,3,4,6,7,9],[1,3,4,6,7,10],[1,3,4,6,7,11],[1,3,4,6,7,12],[1,3,4,6,7,13],[1,3,4,6,7,14],[1,3,4,6,8,9],[1,3,4,6,8,10],[1,3,4,6,8,11],[1,3,4,6,8,12],[1,3,4,6,8,13],[1,3,4,6,8,14],[1,3,4,6,9,10],[1,3,4,6,9,11],[1,3,4,6,9,12],[1,3,4,6,9,13],[1,3,4,6,9,14],[1,3,4,6,10,11],[1,3,4,6,10,12],[1,3,4,6,10,13],[1,3,4,6,10,14],[1,3,4,6,11,12],[1,3,4,6,11,13],[1,3,4,6,11,14],[1,3,4,6,12,13],[1,3,4,6,12,14],[1,3,4,6,13,14],[1,3,4,7,8,9],[1,3,4,7,8,10],[1,3,4,7,8,11],[1,3,4,7,8,12],[1,3,4,7,8,13],[1,3,4,7,8,14],[1,3,4,7,9,10],[1,3,4,7,9,11],[1,3,4,7,9,12],[1,3,4,7,9,13],[1,3,4,7,9,14],[1,3,4,7,10,11],[1,3,4,7,10,12],[1,3,4,7,10,13],[1,3,4,7,10,14],[1,3,4,7,11,12],[1,3,4,7,11,13],[1,3,4,7,11,14],[1,3,4,7,12,13],[1,3,4,7,12,14],[1,3,4,7,13,14],[1,3,4,8,9,10],[1,3,4,8,9,11],[1,3,4,8,9,12],[1,3,4,8,9,13],[1,3,4,8,9,14],[1,3,4,8,10,11],[1,3,4,8,10,12],[1,3,4,8,10,13],[1,3,4,8,10,14],[1,3,4,8,11,12],[1,3,4,8,11,13],[1,3,4,8,11,14],[1,3,4,8,12,13],[1,3,4,8,12,14],[1,3,4,8,13,14],[1,3,4,9,10,11],[1,3,4,9,10,12],[1,3,4,9,10,13],[1,3,4,9,10,14],[1,3,4,9,11,12],[1,3,4,9,11,13],[1,3,4,9,11,14],[1,3,4,9,12,13],[1,3,4,9,12,14],[1,3,4,9,13,14],[1,3,4,10,11,12],[1,3,4,10,11,13],[1,3,4,10,11,14],[1,3,4,10,12,13],[1,3,4,10,12,14],[1,3,4,10,13,14],[1,3,4,11,12,13],[1,3,4,11,12,14],[1,3,4,11,13,14],[1,3,4,12,13,14],[1,3,5,6,7,8],[1,3,5,6,7,9],[1,3,5,6,7,10],[1,3,5,6,7,11],[1,3,5,6,7,12],[1,3,5,6,7,13],[1,3,5,6,7,14],[1,3,5,6,8,9],[1,3,5,6,8,10],[1,3,5,6,8,11],[1,3,5,6,8,12],[1,3,5,6,8,13],[1,3,5,6,8,14],[1,3,5,6,9,10],[1,3,5,6,9,11],[1,3,5,6,9,12],[1,3,5,6,9,13],[1,3,5,6,9,14],[1,3,5,6,10,11],[1,3,5,6,10,12],[1,3,5,6,10,13],[1,3,5,6,10,14],[1,3,5,6,11,12],[1,3,5,6,11,13],[1,3,5,6,11,14],[1,3,5,6,12,13],[1,3,5,6,12,14],[1,3,5,6,13,14],[1,3,5,7,8,9],[1,3,5,7,8,10],[1,3,5,7,8,11],[1,3,5,7,8,12],[1,3,5,7,8,13],[1,3,5,7,8,14],[1,3,5,7,9,10],[1,3,5,7,9,11],[1,3,5,7,9,12],[1,3,5,7,9,13],[1,3,5,7,9,14],[1,3,5,7,10,11],[1,3,5,7,10,12],[1,3,5,7,10,13],[1,3,5,7,10,14],[1,3,5,7,11,12],[1,3,5,7,11,13],[1,3,5,7,11,14],[1,3,5,7,12,13],[1,3,5,7,12,14],[1,3,5,7,13,14],[1,3,5,8,9,10],[1,3,5,8,9,11],[1,3,5,8,9,12],[1,3,5,8,9,13],[1,3,5,8,9,14],[1,3,5,8,10,11],[1,3,5,8,10,12],[1,3,5,8,10,13],[1,3,5,8,10,14],[1,3,5,8,11,12],[1,3,5,8,11,13],[1,3,5,8,11,14],[1,3,5,8,12,13],[1,3,5,8,12,14],[1,3,5,8,13,14],[1,3,5,9,10,11],[1,3,5,9,10,12],[1,3,5,9,10,13],[1,3,5,9,10,14],[1,3,5,9,11,12],[1,3,5,9,11,13],[1,3,5,9,11,14],[1,3,5,9,12,13],[1,3,5,9,12,14],[1,3,5,9,13,14],[1,3,5,10,11,12],[1,3,5,10,11,13],[1,3,5,10,11,14],[1,3,5,10,12,13],[1,3,5,10,12,14],[1,3,5,10,13,14],[1,3,5,11,12,13],[1,3,5,11,12,14],[1,3,5,11,13,14],[1,3,5,12,13,14],[1,3,6,7,8,9],[1,3,6,7,8,10],[1,3,6,7,8,11],[1,3,6,7,8,12],[1,3,6,7,8,13],[1,3,6,7,8,14],[1,3,6,7,9,10],[1,3,6,7,9,11],[1,3,6,7,9,12],[1,3,6,7,9,13],[1,3,6,7,9,14],[1,3,6,7,10,11],[1,3,6,7,10,12],[1,3,6,7,10,13],[1,3,6,7,10,14],[1,3,6,7,11,12],[1,3,6,7,11,13],[1,3,6,7,11,14],[1,3,6,7,12,13],[1,3,6,7,12,14],[1,3,6,7,13,14],[1,3,6,8,9,10],[1,3,6,8,9,11],[1,3,6,8,9,12],[1,3,6,8,9,13],[1,3,6,8,9,14],[1,3,6,8,10,11],[1,3,6,8,10,12],[1,3,6,8,10,13],[1,3,6,8,10,14],[1,3,6,8,11,12],[1,3,6,8,11,13],[1,3,6,8,11,14],[1,3,6,8,12,13],[1,3,6,8,12,14],[1,3,6,8,13,14],[1,3,6,9,10,11],[1,3,6,9,10,12],[1,3,6,9,10,13],[1,3,6,9,10,14],[1,3,6,9,11,12],[1,3,6,9,11,13],[1,3,6,9,11,14],[1,3,6,9,12,13],[1,3,6,9,12,14],[1,3,6,9,13,14],[1,3,6,10,11,12],[1,3,6,10,11,13],[1,3,6,10,11,14],[1,3,6,10,12,13],[1,3,6,10,12,14],[1,3,6,10,13,14],[1,3,6,11,12,13],[1,3,6,11,12,14],[1,3,6,11,13,14],[1,3,6,12,13,14],[1,3,7,8,9,10],[1,3,7,8,9,11],[1,3,7,8,9,12],[1,3,7,8,9,13],[1,3,7,8,9,14],[1,3,7,8,10,11],[1,3,7,8,10,12],[1,3,7,8,10,13],[1,3,7,8,10,14],[1,3,7,8,11,12],[1,3,7,8,11,13],[1,3,7,8,11,14],[1,3,7,8,12,13],[1,3,7,8,12,14],[1,3,7,8,13,14],[1,3,7,9,10,11],[1,3,7,9,10,12],[1,3,7,9,10,13],[1,3,7,9,10,14],[1,3,7,9,11,12],[1,3,7,9,11,13],[1,3,7,9,11,14],[1,3,7,9,12,13],[1,3,7,9,12,14],[1,3,7,9,13,14],[1,3,7,10,11,12],[1,3,7,10,11,13],[1,3,7,10,11,14],[1,3,7,10,12,13],[1,3,7,10,12,14],[1,3,7,10,13,14],[1,3,7,11,12,13],[1,3,7,11,12,14],[1,3,7,11,13,14],[1,3,7,12,13,14],[1,3,8,9,10,11],[1,3,8,9,10,12],[1,3,8,9,10,13],[1,3,8,9,10,14],[1,3,8,9,11,12],[1,3,8,9,11,13],[1,3,8,9,11,14],[1,3,8,9,12,13],[1,3,8,9,12,14],[1,3,8,9,13,14],[1,3,8,10,11,12],[1,3,8,10,11,13],[1,3,8,10,11,14],[1,3,8,10,12,13],[1,3,8,10,12,14],[1,3,8,10,13,14],[1,3,8,11,12,13],[1,3,8,11,12,14],[1,3,8,11,13,14],[1,3,8,12,13,14],[1,3,9,10,11,12],[1,3,9,10,11,13],[1,3,9,10,11,14],[1,3,9,10,12,13],[1,3,9,10,12,14],[1,3,9,10,13,14],[1,3,9,11,12,13],[1,3,9,11,12,14],[1,3,9,11,13,14],[1,3,9,12,13,14],[1,3,10,11,12,13],[1,3,10,11,12,14],[1,3,10,11,13,14],[1,3,10,12,13,14],[1,3,11,12,13,14],[1,4,5,6,7,8],[1,4,5,6,7,9],[1,4,5,6,7,10],[1,4,5,6,7,11],[1,4,5,6,7,12],[1,4,5,6,7,13],[1,4,5,6,7,14],[1,4,5,6,8,9],[1,4,5,6,8,10],[1,4,5,6,8,11],[1,4,5,6,8,12],[1,4,5,6,8,13],[1,4,5,6,8,14],[1,4,5,6,9,10],[1,4,5,6,9,11],[1,4,5,6,9,12],[1,4,5,6,9,13],[1,4,5,6,9,14],[1,4,5,6,10,11],[1,4,5,6,10,12],[1,4,5,6,10,13],[1,4,5,6,10,14],[1,4,5,6,11,12],[1,4,5,6,11,13],[1,4,5,6,11,14],[1,4,5,6,12,13],[1,4,5,6,12,14],[1,4,5,6,13,14],[1,4,5,7,8,9],[1,4,5,7,8,10],[1,4,5,7,8,11],[1,4,5,7,8,12],[1,4,5,7,8,13],[1,4,5,7,8,14],[1,4,5,7,9,10],[1,4,5,7,9,11],[1,4,5,7,9,12],[1,4,5,7,9,13],[1,4,5,7,9,14],[1,4,5,7,10,11],[1,4,5,7,10,12],[1,4,5,7,10,13],[1,4,5,7,10,14],[1,4,5,7,11,12],[1,4,5,7,11,13],[1,4,5,7,11,14],[1,4,5,7,12,13],[1,4,5,7,12,14],[1,4,5,7,13,14],[1,4,5,8,9,10],[1,4,5,8,9,11],[1,4,5,8,9,12],[1,4,5,8,9,13],[1,4,5,8,9,14],[1,4,5,8,10,11],[1,4,5,8,10,12],[1,4,5,8,10,13],[1,4,5,8,10,14],[1,4,5,8,11,12],[1,4,5,8,11,13],[1,4,5,8,11,14],[1,4,5,8,12,13],[1,4,5,8,12,14],[1,4,5,8,13,14],[1,4,5,9,10,11],[1,4,5,9,10,12],[1,4,5,9,10,13],[1,4,5,9,10,14],[1,4,5,9,11,12],[1,4,5,9,11,13],[1,4,5,9,11,14],[1,4,5,9,12,13],[1,4,5,9,12,14],[1,4,5,9,13,14],[1,4,5,10,11,12],[1,4,5,10,11,13],[1,4,5,10,11,14],[1,4,5,10,12,13],[1,4,5,10,12,14],[1,4,5,10,13,14],[1,4,5,11,12,13],[1,4,5,11,12,14],[1,4,5,11,13,14],[1,4,5,12,13,14],[1,4,6,7,8,9],[1,4,6,7,8,10],[1,4,6,7,8,11],[1,4,6,7,8,12],[1,4,6,7,8,13],[1,4,6,7,8,14],[1,4,6,7,9,10],[1,4,6,7,9,11],[1,4,6,7,9,12],[1,4,6,7,9,13],[1,4,6,7,9,14],[1,4,6,7,10,11],[1,4,6,7,10,12],[1,4,6,7,10,13],[1,4,6,7,10,14],[1,4,6,7,11,12],[1,4,6,7,11,13],[1,4,6,7,11,14],[1,4,6,7,12,13],[1,4,6,7,12,14],[1,4,6,7,13,14],[1,4,6,8,9,10],[1,4,6,8,9,11],[1,4,6,8,9,12],[1,4,6,8,9,13],[1,4,6,8,9,14],[1,4,6,8,10,11],[1,4,6,8,10,12],[1,4,6,8,10,13],[1,4,6,8,10,14],[1,4,6,8,11,12],[1,4,6,8,11,13],[1,4,6,8,11,14],[1,4,6,8,12,13],[1,4,6,8,12,14],[1,4,6,8,13,14],[1,4,6,9,10,11],[1,4,6,9,10,12],[1,4,6,9,10,13],[1,4,6,9,10,14],[1,4,6,9,11,12],[1,4,6,9,11,13],[1,4,6,9,11,14],[1,4,6,9,12,13],[1,4,6,9,12,14],[1,4,6,9,13,14],[1,4,6,10,11,12],[1,4,6,10,11,13],[1,4,6,10,11,14],[1,4,6,10,12,13],[1,4,6,10,12,14],[1,4,6,10,13,14],[1,4,6,11,12,13],[1,4,6,11,12,14],[1,4,6,11,13,14],[1,4,6,12,13,14],[1,4,7,8,9,10],[1,4,7,8,9,11],[1,4,7,8,9,12],[1,4,7,8,9,13],[1,4,7,8,9,14],[1,4,7,8,10,11],[1,4,7,8,10,12],[1,4,7,8,10,13],[1,4,7,8,10,14],[1,4,7,8,11,12],[1,4,7,8,11,13],[1,4,7,8,11,14],[1,4,7,8,12,13],[1,4,7,8,12,14],[1,4,7,8,13,14],[1,4,7,9,10,11],[1,4,7,9,10,12],[1,4,7,9,10,13],[1,4,7,9,10,14],[1,4,7,9,11,12],[1,4,7,9,11,13],[1,4,7,9,11,14],[1,4,7,9,12,13],[1,4,7,9,12,14],[1,4,7,9,13,14],[1,4,7,10,11,12],[1,4,7,10,11,13],[1,4,7,10,11,14],[1,4,7,10,12,13],[1,4,7,10,12,14],[1,4,7,10,13,14],[1,4,7,11,12,13],[1,4,7,11,12,14],[1,4,7,11,13,14],[1,4,7,12,13,14],[1,4,8,9,10,11],[1,4,8,9,10,12],[1,4,8,9,10,13],[1,4,8,9,10,14],[1,4,8,9,11,12],[1,4,8,9,11,13],[1,4,8,9,11,14],[1,4,8,9,12,13],[1,4,8,9,12,14],[1,4,8,9,13,14],[1,4,8,10,11,12],[1,4,8,10,11,13],[1,4,8,10,11,14],[1,4,8,10,12,13],[1,4,8,10,12,14],[1,4,8,10,13,14],[1,4,8,11,12,13],[1,4,8,11,12,14],[1,4,8,11,13,14],[1,4,8,12,13,14],[1,4,9,10,11,12],[1,4,9,10,11,13],[1,4,9,10,11,14],[1,4,9,10,12,13],[1,4,9,10,12,14],[1,4,9,10,13,14],[1,4,9,11,12,13],[1,4,9,11,12,14],[1,4,9,11,13,14],[1,4,9,12,13,14],[1,4,10,11,12,13],[1,4,10,11,12,14],[1,4,10,11,13,14],[1,4,10,12,13,14],[1,4,11,12,13,14],[1,5,6,7,8,9],[1,5,6,7,8,10],[1,5,6,7,8,11],[1,5,6,7,8,12],[1,5,6,7,8,13],[1,5,6,7,8,14],[1,5,6,7,9,10],[1,5,6,7,9,11],[1,5,6,7,9,12],[1,5,6,7,9,13],[1,5,6,7,9,14],[1,5,6,7,10,11],[1,5,6,7,10,12],[1,5,6,7,10,13],[1,5,6,7,10,14],[1,5,6,7,11,12],[1,5,6,7,11,13],[1,5,6,7,11,14],[1,5,6,7,12,13],[1,5,6,7,12,14],[1,5,6,7,13,14],[1,5,6,8,9,10],[1,5,6,8,9,11],[1,5,6,8,9,12],[1,5,6,8,9,13],[1,5,6,8,9,14],[1,5,6,8,10,11],[1,5,6,8,10,12],[1,5,6,8,10,13],[1,5,6,8,10,14],[1,5,6,8,11,12],[1,5,6,8,11,13],[1,5,6,8,11,14],[1,5,6,8,12,13],[1,5,6,8,12,14],[1,5,6,8,13,14],[1,5,6,9,10,11],[1,5,6,9,10,12],[1,5,6,9,10,13],[1,5,6,9,10,14],[1,5,6,9,11,12],[1,5,6,9,11,13],[1,5,6,9,11,14],[1,5,6,9,12,13],[1,5,6,9,12,14],[1,5,6,9,13,14],[1,5,6,10,11,12],[1,5,6,10,11,13],[1,5,6,10,11,14],[1,5,6,10,12,13],[1,5,6,10,12,14],[1,5,6,10,13,14],[1,5,6,11,12,13],[1,5,6,11,12,14],[1,5,6,11,13,14],[1,5,6,12,13,14],[1,5,7,8,9,10],[1,5,7,8,9,11],[1,5,7,8,9,12],[1,5,7,8,9,13],[1,5,7,8,9,14],[1,5,7,8,10,11],[1,5,7,8,10,12],[1,5,7,8,10,13],[1,5,7,8,10,14],[1,5,7,8,11,12],[1,5,7,8,11,13],[1,5,7,8,11,14],[1,5,7,8,12,13],[1,5,7,8,12,14],[1,5,7,8,13,14],[1,5,7,9,10,11],[1,5,7,9,10,12],[1,5,7,9,10,13],[1,5,7,9,10,14],[1,5,7,9,11,12],[1,5,7,9,11,13],[1,5,7,9,11,14],[1,5,7,9,12,13],[1,5,7,9,12,14],[1,5,7,9,13,14],[1,5,7,10,11,12],[1,5,7,10,11,13],[1,5,7,10,11,14],[1,5,7,10,12,13],[1,5,7,10,12,14],[1,5,7,10,13,14],[1,5,7,11,12,13],[1,5,7,11,12,14],[1,5,7,11,13,14],[1,5,7,12,13,14],[1,5,8,9,10,11],[1,5,8,9,10,12],[1,5,8,9,10,13],[1,5,8,9,10,14],[1,5,8,9,11,12],[1,5,8,9,11,13],[1,5,8,9,11,14],[1,5,8,9,12,13],[1,5,8,9,12,14],[1,5,8,9,13,14],[1,5,8,10,11,12],[1,5,8,10,11,13],[1,5,8,10,11,14],[1,5,8,10,12,13],[1,5,8,10,12,14],[1,5,8,10,13,14],[1,5,8,11,12,13],[1,5,8,11,12,14],[1,5,8,11,13,14],[1,5,8,12,13,14],[1,5,9,10,11,12],[1,5,9,10,11,13],[1,5,9,10,11,14],[1,5,9,10,12,13],[1,5,9,10,12,14],[1,5,9,10,13,14],[1,5,9,11,12,13],[1,5,9,11,12,14],[1,5,9,11,13,14],[1,5,9,12,13,14],[1,5,10,11,12,13],[1,5,10,11,12,14],[1,5,10,11,13,14],[1,5,10,12,13,14],[1,5,11,12,13,14],[1,6,7,8,9,10],[1,6,7,8,9,11],[1,6,7,8,9,12],[1,6,7,8,9,13],[1,6,7,8,9,14],[1,6,7,8,10,11],[1,6,7,8,10,12],[1,6,7,8,10,13],[1,6,7,8,10,14],[1,6,7,8,11,12],[1,6,7,8,11,13],[1,6,7,8,11,14],[1,6,7,8,12,13],[1,6,7,8,12,14],[1,6,7,8,13,14],[1,6,7,9,10,11],[1,6,7,9,10,12],[1,6,7,9,10,13],[1,6,7,9,10,14],[1,6,7,9,11,12],[1,6,7,9,11,13],[1,6,7,9,11,14],[1,6,7,9,12,13],[1,6,7,9,12,14],[1,6,7,9,13,14],[1,6,7,10,11,12],[1,6,7,10,11,13],[1,6,7,10,11,14],[1,6,7,10,12,13],[1,6,7,10,12,14],[1,6,7,10,13,14],[1,6,7,11,12,13],[1,6,7,11,12,14],[1,6,7,11,13,14],[1,6,7,12,13,14],[1,6,8,9,10,11],[1,6,8,9,10,12],[1,6,8,9,10,13],[1,6,8,9,10,14],[1,6,8,9,11,12],[1,6,8,9,11,13],[1,6,8,9,11,14],[1,6,8,9,12,13],[1,6,8,9,12,14],[1,6,8,9,13,14],[1,6,8,10,11,12],[1,6,8,10,11,13],[1,6,8,10,11,14],[1,6,8,10,12,13],[1,6,8,10,12,14],[1,6,8,10,13,14],[1,6,8,11,12,13],[1,6,8,11,12,14],[1,6,8,11,13,14],[1,6,8,12,13,14],[1,6,9,10,11,12],[1,6,9,10,11,13],[1,6,9,10,11,14],[1,6,9,10,12,13],[1,6,9,10,12,14],[1,6,9,10,13,14],[1,6,9,11,12,13],[1,6,9,11,12,14],[1,6,9,11,13,14],[1,6,9,12,13,14],[1,6,10,11,12,13],[1,6,10,11,12,14],[1,6,10,11,13,14],[1,6,10,12,13,14],[1,6,11,12,13,14],[1,7,8,9,10,11],[1,7,8,9,10,12],[1,7,8,9,10,13],[1,7,8,9,10,14],[1,7,8,9,11,12],[1,7,8,9,11,13],[1,7,8,9,11,14],[1,7,8,9,12,13],[1,7,8,9,12,14],[1,7,8,9,13,14],[1,7,8,10,11,12],[1,7,8,10,11,13],[1,7,8,10,11,14],[1,7,8,10,12,13],[1,7,8,10,12,14],[1,7,8,10,13,14],[1,7,8,11,12,13],[1,7,8,11,12,14],[1,7,8,11,13,14],[1,7,8,12,13,14],[1,7,9,10,11,12],[1,7,9,10,11,13],[1,7,9,10,11,14],[1,7,9,10,12,13],[1,7,9,10,12,14],[1,7,9,10,13,14],[1,7,9,11,12,13],[1,7,9,11,12,14],[1,7,9,11,13,14],[1,7,9,12,13,14],[1,7,10,11,12,13],[1,7,10,11,12,14],[1,7,10,11,13,14],[1,7,10,12,13,14],[1,7,11,12,13,14],[1,8,9,10,11,12],[1,8,9,10,11,13],[1,8,9,10,11,14],[1,8,9,10,12,13],[1,8,9,10,12,14],[1,8,9,10,13,14],[1,8,9,11,12,13],[1,8,9,11,12,14],[1,8,9,11,13,14],[1,8,9,12,13,14],[1,8,10,11,12,13],[1,8,10,11,12,14],[1,8,10,11,13,14],[1,8,10,12,13,14],[1,8,11,12,13,14],[1,9,10,11,12,13],[1,9,10,11,12,14],[1,9,10,11,13,14],[1,9,10,12,13,14],[1,9,11,12,13,14],[1,10,11,12,13,14],[2,3,4,5,6,7],[2,3,4,5,6,8],[2,3,4,5,6,9],[2,3,4,5,6,10],[2,3,4,5,6,11],[2,3,4,5,6,12],[2,3,4,5,6,13],[2,3,4,5,6,14],[2,3,4,5,7,8],[2,3,4,5,7,9],[2,3,4,5,7,10],[2,3,4,5,7,11],[2,3,4,5,7,12],[2,3,4,5,7,13],[2,3,4,5,7,14],[2,3,4,5,8,9],[2,3,4,5,8,10],[2,3,4,5,8,11],[2,3,4,5,8,12],[2,3,4,5,8,13],[2,3,4,5,8,14],[2,3,4,5,9,10],[2,3,4,5,9,11],[2,3,4,5,9,12],[2,3,4,5,9,13],[2,3,4,5,9,14],[2,3,4,5,10,11],[2,3,4,5,10,12],[2,3,4,5,10,13],[2,3,4,5,10,14],[2,3,4,5,11,12],[2,3,4,5,11,13],[2,3,4,5,11,14],[2,3,4,5,12,13],[2,3,4,5,12,14],[2,3,4,5,13,14],[2,3,4,6,7,8],[2,3,4,6,7,9],[2,3,4,6,7,10],[2,3,4,6,7,11],[2,3,4,6,7,12],[2,3,4,6,7,13],[2,3,4,6,7,14],[2,3,4,6,8,9],[2,3,4,6,8,10],[2,3,4,6,8,11],[2,3,4,6,8,12],[2,3,4,6,8,13],[2,3,4,6,8,14],[2,3,4,6,9,10],[2,3,4,6,9,11],[2,3,4,6,9,12],[2,3,4,6,9,13],[2,3,4,6,9,14],[2,3,4,6,10,11],[2,3,4,6,10,12],[2,3,4,6,10,13],[2,3,4,6,10,14],[2,3,4,6,11,12],[2,3,4,6,11,13],[2,3,4,6,11,14],[2,3,4,6,12,13],[2,3,4,6,12,14],[2,3,4,6,13,14],[2,3,4,7,8,9],[2,3,4,7,8,10],[2,3,4,7,8,11],[2,3,4,7,8,12],[2,3,4,7,8,13],[2,3,4,7,8,14],[2,3,4,7,9,10],[2,3,4,7,9,11],[2,3,4,7,9,12],[2,3,4,7,9,13],[2,3,4,7,9,14],[2,3,4,7,10,11],[2,3,4,7,10,12],[2,3,4,7,10,13],[2,3,4,7,10,14],[2,3,4,7,11,12],[2,3,4,7,11,13],[2,3,4,7,11,14],[2,3,4,7,12,13],[2,3,4,7,12,14],[2,3,4,7,13,14],[2,3,4,8,9,10],[2,3,4,8,9,11],[2,3,4,8,9,12],[2,3,4,8,9,13],[2,3,4,8,9,14],[2,3,4,8,10,11],[2,3,4,8,10,12],[2,3,4,8,10,13],[2,3,4,8,10,14],[2,3,4,8,11,12],[2,3,4,8,11,13],[2,3,4,8,11,14],[2,3,4,8,12,13],[2,3,4,8,12,14],[2,3,4,8,13,14],[2,3,4,9,10,11],[2,3,4,9,10,12],[2,3,4,9,10,13],[2,3,4,9,10,14],[2,3,4,9,11,12],[2,3,4,9,11,13],[2,3,4,9,11,14],[2,3,4,9,12,13],[2,3,4,9,12,14],[2,3,4,9,13,14],[2,3,4,10,11,12],[2,3,4,10,11,13],[2,3,4,10,11,14],[2,3,4,10,12,13],[2,3,4,10,12,14],[2,3,4,10,13,14],[2,3,4,11,12,13],[2,3,4,11,12,14],[2,3,4,11,13,14],[2,3,4,12,13,14],[2,3,5,6,7,8],[2,3,5,6,7,9],[2,3,5,6,7,10],[2,3,5,6,7,11],[2,3,5,6,7,12],[2,3,5,6,7,13],[2,3,5,6,7,14],[2,3,5,6,8,9],[2,3,5,6,8,10],[2,3,5,6,8,11],[2,3,5,6,8,12],[2,3,5,6,8,13],[2,3,5,6,8,14],[2,3,5,6,9,10],[2,3,5,6,9,11],[2,3,5,6,9,12],[2,3,5,6,9,13],[2,3,5,6,9,14],[2,3,5,6,10,11],[2,3,5,6,10,12],[2,3,5,6,10,13],[2,3,5,6,10,14],[2,3,5,6,11,12],[2,3,5,6,11,13],[2,3,5,6,11,14],[2,3,5,6,12,13],[2,3,5,6,12,14],[2,3,5,6,13,14],[2,3,5,7,8,9],[2,3,5,7,8,10],[2,3,5,7,8,11],[2,3,5,7,8,12],[2,3,5,7,8,13],[2,3,5,7,8,14],[2,3,5,7,9,10],[2,3,5,7,9,11],[2,3,5,7,9,12],[2,3,5,7,9,13],[2,3,5,7,9,14],[2,3,5,7,10,11],[2,3,5,7,10,12],[2,3,5,7,10,13],[2,3,5,7,10,14],[2,3,5,7,11,12],[2,3,5,7,11,13],[2,3,5,7,11,14],[2,3,5,7,12,13],[2,3,5,7,12,14],[2,3,5,7,13,14],[2,3,5,8,9,10],[2,3,5,8,9,11],[2,3,5,8,9,12],[2,3,5,8,9,13],[2,3,5,8,9,14],[2,3,5,8,10,11],[2,3,5,8,10,12],[2,3,5,8,10,13],[2,3,5,8,10,14],[2,3,5,8,11,12],[2,3,5,8,11,13],[2,3,5,8,11,14],[2,3,5,8,12,13],[2,3,5,8,12,14],[2,3,5,8,13,14],[2,3,5,9,10,11],[2,3,5,9,10,12],[2,3,5,9,10,13],[2,3,5,9,10,14],[2,3,5,9,11,12],[2,3,5,9,11,13],[2,3,5,9,11,14],[2,3,5,9,12,13],[2,3,5,9,12,14],[2,3,5,9,13,14],[2,3,5,10,11,12],[2,3,5,10,11,13],[2,3,5,10,11,14],[2,3,5,10,12,13],[2,3,5,10,12,14],[2,3,5,10,13,14],[2,3,5,11,12,13],[2,3,5,11,12,14],[2,3,5,11,13,14],[2,3,5,12,13,14],[2,3,6,7,8,9],[2,3,6,7,8,10],[2,3,6,7,8,11],[2,3,6,7,8,12],[2,3,6,7,8,13],[2,3,6,7,8,14],[2,3,6,7,9,10],[2,3,6,7,9,11],[2,3,6,7,9,12],[2,3,6,7,9,13],[2,3,6,7,9,14],[2,3,6,7,10,11],[2,3,6,7,10,12],[2,3,6,7,10,13],[2,3,6,7,10,14],[2,3,6,7,11,12],[2,3,6,7,11,13],[2,3,6,7,11,14],[2,3,6,7,12,13],[2,3,6,7,12,14],[2,3,6,7,13,14],[2,3,6,8,9,10],[2,3,6,8,9,11],[2,3,6,8,9,12],[2,3,6,8,9,13],[2,3,6,8,9,14],[2,3,6,8,10,11],[2,3,6,8,10,12],[2,3,6,8,10,13],[2,3,6,8,10,14],[2,3,6,8,11,12],[2,3,6,8,11,13],[2,3,6,8,11,14],[2,3,6,8,12,13],[2,3,6,8,12,14],[2,3,6,8,13,14],[2,3,6,9,10,11],[2,3,6,9,10,12],[2,3,6,9,10,13],[2,3,6,9,10,14],[2,3,6,9,11,12],[2,3,6,9,11,13],[2,3,6,9,11,14],[2,3,6,9,12,13],[2,3,6,9,12,14],[2,3,6,9,13,14],[2,3,6,10,11,12],[2,3,6,10,11,13],[2,3,6,10,11,14],[2,3,6,10,12,13],[2,3,6,10,12,14],[2,3,6,10,13,14],[2,3,6,11,12,13],[2,3,6,11,12,14],[2,3,6,11,13,14],[2,3,6,12,13,14],[2,3,7,8,9,10],[2,3,7,8,9,11],[2,3,7,8,9,12],[2,3,7,8,9,13],[2,3,7,8,9,14],[2,3,7,8,10,11],[2,3,7,8,10,12],[2,3,7,8,10,13],[2,3,7,8,10,14],[2,3,7,8,11,12],[2,3,7,8,11,13],[2,3,7,8,11,14],[2,3,7,8,12,13],[2,3,7,8,12,14],[2,3,7,8,13,14],[2,3,7,9,10,11],[2,3,7,9,10,12],[2,3,7,9,10,13],[2,3,7,9,10,14],[2,3,7,9,11,12],[2,3,7,9,11,13],[2,3,7,9,11,14],[2,3,7,9,12,13],[2,3,7,9,12,14],[2,3,7,9,13,14],[2,3,7,10,11,12],[2,3,7,10,11,13],[2,3,7,10,11,14],[2,3,7,10,12,13],[2,3,7,10,12,14],[2,3,7,10,13,14],[2,3,7,11,12,13],[2,3,7,11,12,14],[2,3,7,11,13,14],[2,3,7,12,13,14],[2,3,8,9,10,11],[2,3,8,9,10,12],[2,3,8,9,10,13],[2,3,8,9,10,14],[2,3,8,9,11,12],[2,3,8,9,11,13],[2,3,8,9,11,14],[2,3,8,9,12,13],[2,3,8,9,12,14],[2,3,8,9,13,14],[2,3,8,10,11,12],[2,3,8,10,11,13],[2,3,8,10,11,14],[2,3,8,10,12,13],[2,3,8,10,12,14],[2,3,8,10,13,14],[2,3,8,11,12,13],[2,3,8,11,12,14],[2,3,8,11,13,14],[2,3,8,12,13,14],[2,3,9,10,11,12],[2,3,9,10,11,13],[2,3,9,10,11,14],[2,3,9,10,12,13],[2,3,9,10,12,14],[2,3,9,10,13,14],[2,3,9,11,12,13],[2,3,9,11,12,14],[2,3,9,11,13,14],[2,3,9,12,13,14],[2,3,10,11,12,13],[2,3,10,11,12,14],[2,3,10,11,13,14],[2,3,10,12,13,14],[2,3,11,12,13,14],[2,4,5,6,7,8],[2,4,5,6,7,9],[2,4,5,6,7,10],[2,4,5,6,7,11],[2,4,5,6,7,12],[2,4,5,6,7,13],[2,4,5,6,7,14],[2,4,5,6,8,9],[2,4,5,6,8,10],[2,4,5,6,8,11],[2,4,5,6,8,12],[2,4,5,6,8,13],[2,4,5,6,8,14],[2,4,5,6,9,10],[2,4,5,6,9,11],[2,4,5,6,9,12],[2,4,5,6,9,13],[2,4,5,6,9,14],[2,4,5,6,10,11],[2,4,5,6,10,12],[2,4,5,6,10,13],[2,4,5,6,10,14],[2,4,5,6,11,12],[2,4,5,6,11,13],[2,4,5,6,11,14],[2,4,5,6,12,13],[2,4,5,6,12,14],[2,4,5,6,13,14],[2,4,5,7,8,9],[2,4,5,7,8,10],[2,4,5,7,8,11],[2,4,5,7,8,12],[2,4,5,7,8,13],[2,4,5,7,8,14],[2,4,5,7,9,10],[2,4,5,7,9,11],[2,4,5,7,9,12],[2,4,5,7,9,13],[2,4,5,7,9,14],[2,4,5,7,10,11],[2,4,5,7,10,12],[2,4,5,7,10,13],[2,4,5,7,10,14],[2,4,5,7,11,12],[2,4,5,7,11,13],[2,4,5,7,11,14],[2,4,5,7,12,13],[2,4,5,7,12,14],[2,4,5,7,13,14],[2,4,5,8,9,10],[2,4,5,8,9,11],[2,4,5,8,9,12],[2,4,5,8,9,13],[2,4,5,8,9,14],[2,4,5,8,10,11],[2,4,5,8,10,12],[2,4,5,8,10,13],[2,4,5,8,10,14],[2,4,5,8,11,12],[2,4,5,8,11,13],[2,4,5,8,11,14],[2,4,5,8,12,13],[2,4,5,8,12,14],[2,4,5,8,13,14],[2,4,5,9,10,11],[2,4,5,9,10,12],[2,4,5,9,10,13],[2,4,5,9,10,14],[2,4,5,9,11,12],[2,4,5,9,11,13],[2,4,5,9,11,14],[2,4,5,9,12,13],[2,4,5,9,12,14],[2,4,5,9,13,14],[2,4,5,10,11,12],[2,4,5,10,11,13],[2,4,5,10,11,14],[2,4,5,10,12,13],[2,4,5,10,12,14],[2,4,5,10,13,14],[2,4,5,11,12,13],[2,4,5,11,12,14],[2,4,5,11,13,14],[2,4,5,12,13,14],[2,4,6,7,8,9],[2,4,6,7,8,10],[2,4,6,7,8,11],[2,4,6,7,8,12],[2,4,6,7,8,13],[2,4,6,7,8,14],[2,4,6,7,9,10],[2,4,6,7,9,11],[2,4,6,7,9,12],[2,4,6,7,9,13],[2,4,6,7,9,14],[2,4,6,7,10,11],[2,4,6,7,10,12],[2,4,6,7,10,13],[2,4,6,7,10,14],[2,4,6,7,11,12],[2,4,6,7,11,13],[2,4,6,7,11,14],[2,4,6,7,12,13],[2,4,6,7,12,14],[2,4,6,7,13,14],[2,4,6,8,9,10],[2,4,6,8,9,11],[2,4,6,8,9,12],[2,4,6,8,9,13],[2,4,6,8,9,14],[2,4,6,8,10,11],[2,4,6,8,10,12],[2,4,6,8,10,13],[2,4,6,8,10,14],[2,4,6,8,11,12],[2,4,6,8,11,13],[2,4,6,8,11,14],[2,4,6,8,12,13],[2,4,6,8,12,14],[2,4,6,8,13,14],[2,4,6,9,10,11],[2,4,6,9,10,12],[2,4,6,9,10,13],[2,4,6,9,10,14],[2,4,6,9,11,12],[2,4,6,9,11,13],[2,4,6,9,11,14],[2,4,6,9,12,13],[2,4,6,9,12,14],[2,4,6,9,13,14],[2,4,6,10,11,12],[2,4,6,10,11,13],[2,4,6,10,11,14],[2,4,6,10,12,13],[2,4,6,10,12,14],[2,4,6,10,13,14],[2,4,6,11,12,13],[2,4,6,11,12,14],[2,4,6,11,13,14],[2,4,6,12,13,14],[2,4,7,8,9,10],[2,4,7,8,9,11],[2,4,7,8,9,12],[2,4,7,8,9,13],[2,4,7,8,9,14],[2,4,7,8,10,11],[2,4,7,8,10,12],[2,4,7,8,10,13],[2,4,7,8,10,14],[2,4,7,8,11,12],[2,4,7,8,11,13],[2,4,7,8,11,14],[2,4,7,8,12,13],[2,4,7,8,12,14],[2,4,7,8,13,14],[2,4,7,9,10,11],[2,4,7,9,10,12],[2,4,7,9,10,13],[2,4,7,9,10,14],[2,4,7,9,11,12],[2,4,7,9,11,13],[2,4,7,9,11,14],[2,4,7,9,12,13],[2,4,7,9,12,14],[2,4,7,9,13,14],[2,4,7,10,11,12],[2,4,7,10,11,13],[2,4,7,10,11,14],[2,4,7,10,12,13],[2,4,7,10,12,14],[2,4,7,10,13,14],[2,4,7,11,12,13],[2,4,7,11,12,14],[2,4,7,11,13,14],[2,4,7,12,13,14],[2,4,8,9,10,11],[2,4,8,9,10,12],[2,4,8,9,10,13],[2,4,8,9,10,14],[2,4,8,9,11,12],[2,4,8,9,11,13],[2,4,8,9,11,14],[2,4,8,9,12,13],[2,4,8,9,12,14],[2,4,8,9,13,14],[2,4,8,10,11,12],[2,4,8,10,11,13],[2,4,8,10,11,14],[2,4,8,10,12,13],[2,4,8,10,12,14],[2,4,8,10,13,14],[2,4,8,11,12,13],[2,4,8,11,12,14],[2,4,8,11,13,14],[2,4,8,12,13,14],[2,4,9,10,11,12],[2,4,9,10,11,13],[2,4,9,10,11,14],[2,4,9,10,12,13],[2,4,9,10,12,14],[2,4,9,10,13,14],[2,4,9,11,12,13],[2,4,9,11,12,14],[2,4,9,11,13,14],[2,4,9,12,13,14],[2,4,10,11,12,13],[2,4,10,11,12,14],[2,4,10,11,13,14],[2,4,10,12,13,14],[2,4,11,12,13,14],[2,5,6,7,8,9],[2,5,6,7,8,10],[2,5,6,7,8,11],[2,5,6,7,8,12],[2,5,6,7,8,13],[2,5,6,7,8,14],[2,5,6,7,9,10],[2,5,6,7,9,11],[2,5,6,7,9,12],[2,5,6,7,9,13],[2,5,6,7,9,14],[2,5,6,7,10,11],[2,5,6,7,10,12],[2,5,6,7,10,13],[2,5,6,7,10,14],[2,5,6,7,11,12],[2,5,6,7,11,13],[2,5,6,7,11,14],[2,5,6,7,12,13],[2,5,6,7,12,14],[2,5,6,7,13,14],[2,5,6,8,9,10],[2,5,6,8,9,11],[2,5,6,8,9,12],[2,5,6,8,9,13],[2,5,6,8,9,14],[2,5,6,8,10,11],[2,5,6,8,10,12],[2,5,6,8,10,13],[2,5,6,8,10,14],[2,5,6,8,11,12],[2,5,6,8,11,13],[2,5,6,8,11,14],[2,5,6,8,12,13],[2,5,6,8,12,14],[2,5,6,8,13,14],[2,5,6,9,10,11],[2,5,6,9,10,12],[2,5,6,9,10,13],[2,5,6,9,10,14],[2,5,6,9,11,12],[2,5,6,9,11,13],[2,5,6,9,11,14],[2,5,6,9,12,13],[2,5,6,9,12,14],[2,5,6,9,13,14],[2,5,6,10,11,12],[2,5,6,10,11,13],[2,5,6,10,11,14],[2,5,6,10,12,13],[2,5,6,10,12,14],[2,5,6,10,13,14],[2,5,6,11,12,13],[2,5,6,11,12,14],[2,5,6,11,13,14],[2,5,6,12,13,14],[2,5,7,8,9,10],[2,5,7,8,9,11],[2,5,7,8,9,12],[2,5,7,8,9,13],[2,5,7,8,9,14],[2,5,7,8,10,11],[2,5,7,8,10,12],[2,5,7,8,10,13],[2,5,7,8,10,14],[2,5,7,8,11,12],[2,5,7,8,11,13],[2,5,7,8,11,14],[2,5,7,8,12,13],[2,5,7,8,12,14],[2,5,7,8,13,14],[2,5,7,9,10,11],[2,5,7,9,10,12],[2,5,7,9,10,13],[2,5,7,9,10,14],[2,5,7,9,11,12],[2,5,7,9,11,13],[2,5,7,9,11,14],[2,5,7,9,12,13],[2,5,7,9,12,14],[2,5,7,9,13,14],[2,5,7,10,11,12],[2,5,7,10,11,13],[2,5,7,10,11,14],[2,5,7,10,12,13],[2,5,7,10,12,14],[2,5,7,10,13,14],[2,5,7,11,12,13],[2,5,7,11,12,14],[2,5,7,11,13,14],[2,5,7,12,13,14],[2,5,8,9,10,11],[2,5,8,9,10,12],[2,5,8,9,10,13],[2,5,8,9,10,14],[2,5,8,9,11,12],[2,5,8,9,11,13],[2,5,8,9,11,14],[2,5,8,9,12,13],[2,5,8,9,12,14],[2,5,8,9,13,14],[2,5,8,10,11,12],[2,5,8,10,11,13],[2,5,8,10,11,14],[2,5,8,10,12,13],[2,5,8,10,12,14],[2,5,8,10,13,14],[2,5,8,11,12,13],[2,5,8,11,12,14],[2,5,8,11,13,14],[2,5,8,12,13,14],[2,5,9,10,11,12],[2,5,9,10,11,13],[2,5,9,10,11,14],[2,5,9,10,12,13],[2,5,9,10,12,14],[2,5,9,10,13,14],[2,5,9,11,12,13],[2,5,9,11,12,14],[2,5,9,11,13,14],[2,5,9,12,13,14],[2,5,10,11,12,13],[2,5,10,11,12,14],[2,5,10,11,13,14],[2,5,10,12,13,14],[2,5,11,12,13,14],[2,6,7,8,9,10],[2,6,7,8,9,11],[2,6,7,8,9,12],[2,6,7,8,9,13],[2,6,7,8,9,14],[2,6,7,8,10,11],[2,6,7,8,10,12],[2,6,7,8,10,13],[2,6,7,8,10,14],[2,6,7,8,11,12],[2,6,7,8,11,13],[2,6,7,8,11,14],[2,6,7,8,12,13],[2,6,7,8,12,14],[2,6,7,8,13,14],[2,6,7,9,10,11],[2,6,7,9,10,12],[2,6,7,9,10,13],[2,6,7,9,10,14],[2,6,7,9,11,12],[2,6,7,9,11,13],[2,6,7,9,11,14],[2,6,7,9,12,13],[2,6,7,9,12,14],[2,6,7,9,13,14],[2,6,7,10,11,12],[2,6,7,10,11,13],[2,6,7,10,11,14],[2,6,7,10,12,13],[2,6,7,10,12,14],[2,6,7,10,13,14],[2,6,7,11,12,13],[2,6,7,11,12,14],[2,6,7,11,13,14],[2,6,7,12,13,14],[2,6,8,9,10,11],[2,6,8,9,10,12],[2,6,8,9,10,13],[2,6,8,9,10,14],[2,6,8,9,11,12],[2,6,8,9,11,13],[2,6,8,9,11,14],[2,6,8,9,12,13],[2,6,8,9,12,14],[2,6,8,9,13,14],[2,6,8,10,11,12],[2,6,8,10,11,13],[2,6,8,10,11,14],[2,6,8,10,12,13],[2,6,8,10,12,14],[2,6,8,10,13,14],[2,6,8,11,12,13],[2,6,8,11,12,14],[2,6,8,11,13,14],[2,6,8,12,13,14],[2,6,9,10,11,12],[2,6,9,10,11,13],[2,6,9,10,11,14],[2,6,9,10,12,13],[2,6,9,10,12,14],[2,6,9,10,13,14],[2,6,9,11,12,13],[2,6,9,11,12,14],[2,6,9,11,13,14],[2,6,9,12,13,14],[2,6,10,11,12,13],[2,6,10,11,12,14],[2,6,10,11,13,14],[2,6,10,12,13,14],[2,6,11,12,13,14],[2,7,8,9,10,11],[2,7,8,9,10,12],[2,7,8,9,10,13],[2,7,8,9,10,14],[2,7,8,9,11,12],[2,7,8,9,11,13],[2,7,8,9,11,14],[2,7,8,9,12,13],[2,7,8,9,12,14],[2,7,8,9,13,14],[2,7,8,10,11,12],[2,7,8,10,11,13],[2,7,8,10,11,14],[2,7,8,10,12,13],[2,7,8,10,12,14],[2,7,8,10,13,14],[2,7,8,11,12,13],[2,7,8,11,12,14],[2,7,8,11,13,14],[2,7,8,12,13,14],[2,7,9,10,11,12],[2,7,9,10,11,13],[2,7,9,10,11,14],[2,7,9,10,12,13],[2,7,9,10,12,14],[2,7,9,10,13,14],[2,7,9,11,12,13],[2,7,9,11,12,14],[2,7,9,11,13,14],[2,7,9,12,13,14],[2,7,10,11,12,13],[2,7,10,11,12,14],[2,7,10,11,13,14],[2,7,10,12,13,14],[2,7,11,12,13,14],[2,8,9,10,11,12],[2,8,9,10,11,13],[2,8,9,10,11,14],[2,8,9,10,12,13],[2,8,9,10,12,14],[2,8,9,10,13,14],[2,8,9,11,12,13],[2,8,9,11,12,14],[2,8,9,11,13,14],[2,8,9,12,13,14],[2,8,10,11,12,13],[2,8,10,11,12,14],[2,8,10,11,13,14],[2,8,10,12,13,14],[2,8,11,12,13,14],[2,9,10,11,12,13],[2,9,10,11,12,14],[2,9,10,11,13,14],[2,9,10,12,13,14],[2,9,11,12,13,14],[2,10,11,12,13,14],[3,4,5,6,7,8],[3,4,5,6,7,9],[3,4,5,6,7,10],[3,4,5,6,7,11],[3,4,5,6,7,12],[3,4,5,6,7,13],[3,4,5,6,7,14],[3,4,5,6,8,9],[3,4,5,6,8,10],[3,4,5,6,8,11],[3,4,5,6,8,12],[3,4,5,6,8,13],[3,4,5,6,8,14],[3,4,5,6,9,10],[3,4,5,6,9,11],[3,4,5,6,9,12],[3,4,5,6,9,13],[3,4,5,6,9,14],[3,4,5,6,10,11],[3,4,5,6,10,12],[3,4,5,6,10,13],[3,4,5,6,10,14],[3,4,5,6,11,12],[3,4,5,6,11,13],[3,4,5,6,11,14],[3,4,5,6,12,13],[3,4,5,6,12,14],[3,4,5,6,13,14],[3,4,5,7,8,9],[3,4,5,7,8,10],[3,4,5,7,8,11],[3,4,5,7,8,12],[3,4,5,7,8,13],[3,4,5,7,8,14],[3,4,5,7,9,10],[3,4,5,7,9,11],[3,4,5,7,9,12],[3,4,5,7,9,13],[3,4,5,7,9,14],[3,4,5,7,10,11],[3,4,5,7,10,12],[3,4,5,7,10,13],[3,4,5,7,10,14],[3,4,5,7,11,12],[3,4,5,7,11,13],[3,4,5,7,11,14],[3,4,5,7,12,13],[3,4,5,7,12,14],[3,4,5,7,13,14],[3,4,5,8,9,10],[3,4,5,8,9,11],[3,4,5,8,9,12],[3,4,5,8,9,13],[3,4,5,8,9,14],[3,4,5,8,10,11],[3,4,5,8,10,12],[3,4,5,8,10,13],[3,4,5,8,10,14],[3,4,5,8,11,12],[3,4,5,8,11,13],[3,4,5,8,11,14],[3,4,5,8,12,13],[3,4,5,8,12,14],[3,4,5,8,13,14],[3,4,5,9,10,11],[3,4,5,9,10,12],[3,4,5,9,10,13],[3,4,5,9,10,14],[3,4,5,9,11,12],[3,4,5,9,11,13],[3,4,5,9,11,14],[3,4,5,9,12,13],[3,4,5,9,12,14],[3,4,5,9,13,14],[3,4,5,10,11,12],[3,4,5,10,11,13],[3,4,5,10,11,14],[3,4,5,10,12,13],[3,4,5,10,12,14],[3,4,5,10,13,14],[3,4,5,11,12,13],[3,4,5,11,12,14],[3,4,5,11,13,14],[3,4,5,12,13,14],[3,4,6,7,8,9],[3,4,6,7,8,10],[3,4,6,7,8,11],[3,4,6,7,8,12],[3,4,6,7,8,13],[3,4,6,7,8,14],[3,4,6,7,9,10],[3,4,6,7,9,11],[3,4,6,7,9,12],[3,4,6,7,9,13],[3,4,6,7,9,14],[3,4,6,7,10,11],[3,4,6,7,10,12],[3,4,6,7,10,13],[3,4,6,7,10,14],[3,4,6,7,11,12],[3,4,6,7,11,13],[3,4,6,7,11,14],[3,4,6,7,12,13],[3,4,6,7,12,14],[3,4,6,7,13,14],[3,4,6,8,9,10],[3,4,6,8,9,11],[3,4,6,8,9,12],[3,4,6,8,9,13],[3,4,6,8,9,14],[3,4,6,8,10,11],[3,4,6,8,10,12],[3,4,6,8,10,13],[3,4,6,8,10,14],[3,4,6,8,11,12],[3,4,6,8,11,13],[3,4,6,8,11,14],[3,4,6,8,12,13],[3,4,6,8,12,14],[3,4,6,8,13,14],[3,4,6,9,10,11],[3,4,6,9,10,12],[3,4,6,9,10,13],[3,4,6,9,10,14],[3,4,6,9,11,12],[3,4,6,9,11,13],[3,4,6,9,11,14],[3,4,6,9,12,13],[3,4,6,9,12,14],[3,4,6,9,13,14],[3,4,6,10,11,12],[3,4,6,10,11,13],[3,4,6,10,11,14],[3,4,6,10,12,13],[3,4,6,10,12,14],[3,4,6,10,13,14],[3,4,6,11,12,13],[3,4,6,11,12,14],[3,4,6,11,13,14],[3,4,6,12,13,14],[3,4,7,8,9,10],[3,4,7,8,9,11],[3,4,7,8,9,12],[3,4,7,8,9,13],[3,4,7,8,9,14],[3,4,7,8,10,11],[3,4,7,8,10,12],[3,4,7,8,10,13],[3,4,7,8,10,14],[3,4,7,8,11,12],[3,4,7,8,11,13],[3,4,7,8,11,14],[3,4,7,8,12,13],[3,4,7,8,12,14],[3,4,7,8,13,14],[3,4,7,9,10,11],[3,4,7,9,10,12],[3,4,7,9,10,13],[3,4,7,9,10,14],[3,4,7,9,11,12],[3,4,7,9,11,13],[3,4,7,9,11,14],[3,4,7,9,12,13],[3,4,7,9,12,14],[3,4,7,9,13,14],[3,4,7,10,11,12],[3,4,7,10,11,13],[3,4,7,10,11,14],[3,4,7,10,12,13],[3,4,7,10,12,14],[3,4,7,10,13,14],[3,4,7,11,12,13],[3,4,7,11,12,14],[3,4,7,11,13,14],[3,4,7,12,13,14],[3,4,8,9,10,11],[3,4,8,9,10,12],[3,4,8,9,10,13],[3,4,8,9,10,14],[3,4,8,9,11,12],[3,4,8,9,11,13],[3,4,8,9,11,14],[3,4,8,9,12,13],[3,4,8,9,12,14],[3,4,8,9,13,14],[3,4,8,10,11,12],[3,4,8,10,11,13],[3,4,8,10,11,14],[3,4,8,10,12,13],[3,4,8,10,12,14],[3,4,8,10,13,14],[3,4,8,11,12,13],[3,4,8,11,12,14],[3,4,8,11,13,14],[3,4,8,12,13,14],[3,4,9,10,11,12],[3,4,9,10,11,13],[3,4,9,10,11,14],[3,4,9,10,12,13],[3,4,9,10,12,14],[3,4,9,10,13,14],[3,4,9,11,12,13],[3,4,9,11,12,14],[3,4,9,11,13,14],[3,4,9,12,13,14],[3,4,10,11,12,13],[3,4,10,11,12,14],[3,4,10,11,13,14],[3,4,10,12,13,14],[3,4,11,12,13,14],[3,5,6,7,8,9],[3,5,6,7,8,10],[3,5,6,7,8,11],[3,5,6,7,8,12],[3,5,6,7,8,13],[3,5,6,7,8,14],[3,5,6,7,9,10],[3,5,6,7,9,11],[3,5,6,7,9,12],[3,5,6,7,9,13],[3,5,6,7,9,14],[3,5,6,7,10,11],[3,5,6,7,10,12],[3,5,6,7,10,13],[3,5,6,7,10,14],[3,5,6,7,11,12],[3,5,6,7,11,13],[3,5,6,7,11,14],[3,5,6,7,12,13],[3,5,6,7,12,14],[3,5,6,7,13,14],[3,5,6,8,9,10],[3,5,6,8,9,11],[3,5,6,8,9,12],[3,5,6,8,9,13],[3,5,6,8,9,14],[3,5,6,8,10,11],[3,5,6,8,10,12],[3,5,6,8,10,13],[3,5,6,8,10,14],[3,5,6,8,11,12],[3,5,6,8,11,13],[3,5,6,8,11,14],[3,5,6,8,12,13],[3,5,6,8,12,14],[3,5,6,8,13,14],[3,5,6,9,10,11],[3,5,6,9,10,12],[3,5,6,9,10,13],[3,5,6,9,10,14],[3,5,6,9,11,12],[3,5,6,9,11,13],[3,5,6,9,11,14],[3,5,6,9,12,13],[3,5,6,9,12,14],[3,5,6,9,13,14],[3,5,6,10,11,12],[3,5,6,10,11,13],[3,5,6,10,11,14],[3,5,6,10,12,13],[3,5,6,10,12,14],[3,5,6,10,13,14],[3,5,6,11,12,13],[3,5,6,11,12,14],[3,5,6,11,13,14],[3,5,6,12,13,14],[3,5,7,8,9,10],[3,5,7,8,9,11],[3,5,7,8,9,12],[3,5,7,8,9,13],[3,5,7,8,9,14],[3,5,7,8,10,11],[3,5,7,8,10,12],[3,5,7,8,10,13],[3,5,7,8,10,14],[3,5,7,8,11,12],[3,5,7,8,11,13],[3,5,7,8,11,14],[3,5,7,8,12,13],[3,5,7,8,12,14],[3,5,7,8,13,14],[3,5,7,9,10,11],[3,5,7,9,10,12],[3,5,7,9,10,13],[3,5,7,9,10,14],[3,5,7,9,11,12],[3,5,7,9,11,13],[3,5,7,9,11,14],[3,5,7,9,12,13],[3,5,7,9,12,14],[3,5,7,9,13,14],[3,5,7,10,11,12],[3,5,7,10,11,13],[3,5,7,10,11,14],[3,5,7,10,12,13],[3,5,7,10,12,14],[3,5,7,10,13,14],[3,5,7,11,12,13],[3,5,7,11,12,14],[3,5,7,11,13,14],[3,5,7,12,13,14],[3,5,8,9,10,11],[3,5,8,9,10,12],[3,5,8,9,10,13],[3,5,8,9,10,14],[3,5,8,9,11,12],[3,5,8,9,11,13],[3,5,8,9,11,14],[3,5,8,9,12,13],[3,5,8,9,12,14],[3,5,8,9,13,14],[3,5,8,10,11,12],[3,5,8,10,11,13],[3,5,8,10,11,14],[3,5,8,10,12,13],[3,5,8,10,12,14],[3,5,8,10,13,14],[3,5,8,11,12,13],[3,5,8,11,12,14],[3,5,8,11,13,14],[3,5,8,12,13,14],[3,5,9,10,11,12],[3,5,9,10,11,13],[3,5,9,10,11,14],[3,5,9,10,12,13],[3,5,9,10,12,14],[3,5,9,10,13,14],[3,5,9,11,12,13],[3,5,9,11,12,14],[3,5,9,11,13,14],[3,5,9,12,13,14],[3,5,10,11,12,13],[3,5,10,11,12,14],[3,5,10,11,13,14],[3,5,10,12,13,14],[3,5,11,12,13,14],[3,6,7,8,9,10],[3,6,7,8,9,11],[3,6,7,8,9,12],[3,6,7,8,9,13],[3,6,7,8,9,14],[3,6,7,8,10,11],[3,6,7,8,10,12],[3,6,7,8,10,13],[3,6,7,8,10,14],[3,6,7,8,11,12],[3,6,7,8,11,13],[3,6,7,8,11,14],[3,6,7,8,12,13],[3,6,7,8,12,14],[3,6,7,8,13,14],[3,6,7,9,10,11],[3,6,7,9,10,12],[3,6,7,9,10,13],[3,6,7,9,10,14],[3,6,7,9,11,12],[3,6,7,9,11,13],[3,6,7,9,11,14],[3,6,7,9,12,13],[3,6,7,9,12,14],[3,6,7,9,13,14],[3,6,7,10,11,12],[3,6,7,10,11,13],[3,6,7,10,11,14],[3,6,7,10,12,13],[3,6,7,10,12,14],[3,6,7,10,13,14],[3,6,7,11,12,13],[3,6,7,11,12,14],[3,6,7,11,13,14],[3,6,7,12,13,14],[3,6,8,9,10,11],[3,6,8,9,10,12],[3,6,8,9,10,13],[3,6,8,9,10,14],[3,6,8,9,11,12],[3,6,8,9,11,13],[3,6,8,9,11,14],[3,6,8,9,12,13],[3,6,8,9,12,14],[3,6,8,9,13,14],[3,6,8,10,11,12],[3,6,8,10,11,13],[3,6,8,10,11,14],[3,6,8,10,12,13],[3,6,8,10,12,14],[3,6,8,10,13,14],[3,6,8,11,12,13],[3,6,8,11,12,14],[3,6,8,11,13,14],[3,6,8,12,13,14],[3,6,9,10,11,12],[3,6,9,10,11,13],[3,6,9,10,11,14],[3,6,9,10,12,13],[3,6,9,10,12,14],[3,6,9,10,13,14],[3,6,9,11,12,13],[3,6,9,11,12,14],[3,6,9,11,13,14],[3,6,9,12,13,14],[3,6,10,11,12,13],[3,6,10,11,12,14],[3,6,10,11,13,14],[3,6,10,12,13,14],[3,6,11,12,13,14],[3,7,8,9,10,11],[3,7,8,9,10,12],[3,7,8,9,10,13],[3,7,8,9,10,14],[3,7,8,9,11,12],[3,7,8,9,11,13],[3,7,8,9,11,14],[3,7,8,9,12,13],[3,7,8,9,12,14],[3,7,8,9,13,14],[3,7,8,10,11,12],[3,7,8,10,11,13],[3,7,8,10,11,14],[3,7,8,10,12,13],[3,7,8,10,12,14],[3,7,8,10,13,14],[3,7,8,11,12,13],[3,7,8,11,12,14],[3,7,8,11,13,14],[3,7,8,12,13,14],[3,7,9,10,11,12],[3,7,9,10,11,13],[3,7,9,10,11,14],[3,7,9,10,12,13],[3,7,9,10,12,14],[3,7,9,10,13,14],[3,7,9,11,12,13],[3,7,9,11,12,14],[3,7,9,11,13,14],[3,7,9,12,13,14],[3,7,10,11,12,13],[3,7,10,11,12,14],[3,7,10,11,13,14],[3,7,10,12,13,14],[3,7,11,12,13,14],[3,8,9,10,11,12],[3,8,9,10,11,13],[3,8,9,10,11,14],[3,8,9,10,12,13],[3,8,9,10,12,14],[3,8,9,10,13,14],[3,8,9,11,12,13],[3,8,9,11,12,14],[3,8,9,11,13,14],[3,8,9,12,13,14],[3,8,10,11,12,13],[3,8,10,11,12,14],[3,8,10,11,13,14],[3,8,10,12,13,14],[3,8,11,12,13,14],[3,9,10,11,12,13],[3,9,10,11,12,14],[3,9,10,11,13,14],[3,9,10,12,13,14],[3,9,11,12,13,14],[3,10,11,12,13,14],[4,5,6,7,8,9],[4,5,6,7,8,10],[4,5,6,7,8,11],[4,5,6,7,8,12],[4,5,6,7,8,13],[4,5,6,7,8,14],[4,5,6,7,9,10],[4,5,6,7,9,11],[4,5,6,7,9,12],[4,5,6,7,9,13],[4,5,6,7,9,14],[4,5,6,7,10,11],[4,5,6,7,10,12],[4,5,6,7,10,13],[4,5,6,7,10,14],[4,5,6,7,11,12],[4,5,6,7,11,13],[4,5,6,7,11,14],[4,5,6,7,12,13],[4,5,6,7,12,14],[4,5,6,7,13,14],[4,5,6,8,9,10],[4,5,6,8,9,11],[4,5,6,8,9,12],[4,5,6,8,9,13],[4,5,6,8,9,14],[4,5,6,8,10,11],[4,5,6,8,10,12],[4,5,6,8,10,13],[4,5,6,8,10,14],[4,5,6,8,11,12],[4,5,6,8,11,13],[4,5,6,8,11,14],[4,5,6,8,12,13],[4,5,6,8,12,14],[4,5,6,8,13,14],[4,5,6,9,10,11],[4,5,6,9,10,12],[4,5,6,9,10,13],[4,5,6,9,10,14],[4,5,6,9,11,12],[4,5,6,9,11,13],[4,5,6,9,11,14],[4,5,6,9,12,13],[4,5,6,9,12,14],[4,5,6,9,13,14],[4,5,6,10,11,12],[4,5,6,10,11,13],[4,5,6,10,11,14],[4,5,6,10,12,13],[4,5,6,10,12,14],[4,5,6,10,13,14],[4,5,6,11,12,13],[4,5,6,11,12,14],[4,5,6,11,13,14],[4,5,6,12,13,14],[4,5,7,8,9,10],[4,5,7,8,9,11],[4,5,7,8,9,12],[4,5,7,8,9,13],[4,5,7,8,9,14],[4,5,7,8,10,11],[4,5,7,8,10,12],[4,5,7,8,10,13],[4,5,7,8,10,14],[4,5,7,8,11,12],[4,5,7,8,11,13],[4,5,7,8,11,14],[4,5,7,8,12,13],[4,5,7,8,12,14],[4,5,7,8,13,14],[4,5,7,9,10,11],[4,5,7,9,10,12],[4,5,7,9,10,13],[4,5,7,9,10,14],[4,5,7,9,11,12],[4,5,7,9,11,13],[4,5,7,9,11,14],[4,5,7,9,12,13],[4,5,7,9,12,14],[4,5,7,9,13,14],[4,5,7,10,11,12],[4,5,7,10,11,13],[4,5,7,10,11,14],[4,5,7,10,12,13],[4,5,7,10,12,14],[4,5,7,10,13,14],[4,5,7,11,12,13],[4,5,7,11,12,14],[4,5,7,11,13,14],[4,5,7,12,13,14],[4,5,8,9,10,11],[4,5,8,9,10,12],[4,5,8,9,10,13],[4,5,8,9,10,14],[4,5,8,9,11,12],[4,5,8,9,11,13],[4,5,8,9,11,14],[4,5,8,9,12,13],[4,5,8,9,12,14],[4,5,8,9,13,14],[4,5,8,10,11,12],[4,5,8,10,11,13],[4,5,8,10,11,14],[4,5,8,10,12,13],[4,5,8,10,12,14],[4,5,8,10,13,14],[4,5,8,11,12,13],[4,5,8,11,12,14],[4,5,8,11,13,14],[4,5,8,12,13,14],[4,5,9,10,11,12],[4,5,9,10,11,13],[4,5,9,10,11,14],[4,5,9,10,12,13],[4,5,9,10,12,14],[4,5,9,10,13,14],[4,5,9,11,12,13],[4,5,9,11,12,14],[4,5,9,11,13,14],[4,5,9,12,13,14],[4,5,10,11,12,13],[4,5,10,11,12,14],[4,5,10,11,13,14],[4,5,10,12,13,14],[4,5,11,12,13,14],[4,6,7,8,9,10],[4,6,7,8,9,11],[4,6,7,8,9,12],[4,6,7,8,9,13],[4,6,7,8,9,14],[4,6,7,8,10,11],[4,6,7,8,10,12],[4,6,7,8,10,13],[4,6,7,8,10,14],[4,6,7,8,11,12],[4,6,7,8,11,13],[4,6,7,8,11,14],[4,6,7,8,12,13],[4,6,7,8,12,14],[4,6,7,8,13,14],[4,6,7,9,10,11],[4,6,7,9,10,12],[4,6,7,9,10,13],[4,6,7,9,10,14],[4,6,7,9,11,12],[4,6,7,9,11,13],[4,6,7,9,11,14],[4,6,7,9,12,13],[4,6,7,9,12,14],[4,6,7,9,13,14],[4,6,7,10,11,12],[4,6,7,10,11,13],[4,6,7,10,11,14],[4,6,7,10,12,13],[4,6,7,10,12,14],[4,6,7,10,13,14],[4,6,7,11,12,13],[4,6,7,11,12,14],[4,6,7,11,13,14],[4,6,7,12,13,14],[4,6,8,9,10,11],[4,6,8,9,10,12],[4,6,8,9,10,13],[4,6,8,9,10,14],[4,6,8,9,11,12],[4,6,8,9,11,13],[4,6,8,9,11,14],[4,6,8,9,12,13],[4,6,8,9,12,14],[4,6,8,9,13,14],[4,6,8,10,11,12],[4,6,8,10,11,13],[4,6,8,10,11,14],[4,6,8,10,12,13],[4,6,8,10,12,14],[4,6,8,10,13,14],[4,6,8,11,12,13],[4,6,8,11,12,14],[4,6,8,11,13,14],[4,6,8,12,13,14],[4,6,9,10,11,12],[4,6,9,10,11,13],[4,6,9,10,11,14],[4,6,9,10,12,13],[4,6,9,10,12,14],[4,6,9,10,13,14],[4,6,9,11,12,13],[4,6,9,11,12,14],[4,6,9,11,13,14],[4,6,9,12,13,14],[4,6,10,11,12,13],[4,6,10,11,12,14],[4,6,10,11,13,14],[4,6,10,12,13,14],[4,6,11,12,13,14],[4,7,8,9,10,11],[4,7,8,9,10,12],[4,7,8,9,10,13],[4,7,8,9,10,14],[4,7,8,9,11,12],[4,7,8,9,11,13],[4,7,8,9,11,14],[4,7,8,9,12,13],[4,7,8,9,12,14],[4,7,8,9,13,14],[4,7,8,10,11,12],[4,7,8,10,11,13],[4,7,8,10,11,14],[4,7,8,10,12,13],[4,7,8,10,12,14],[4,7,8,10,13,14],[4,7,8,11,12,13],[4,7,8,11,12,14],[4,7,8,11,13,14],[4,7,8,12,13,14],[4,7,9,10,11,12],[4,7,9,10,11,13],[4,7,9,10,11,14],[4,7,9,10,12,13],[4,7,9,10,12,14],[4,7,9,10,13,14],[4,7,9,11,12,13],[4,7,9,11,12,14],[4,7,9,11,13,14],[4,7,9,12,13,14],[4,7,10,11,12,13],[4,7,10,11,12,14],[4,7,10,11,13,14],[4,7,10,12,13,14],[4,7,11,12,13,14],[4,8,9,10,11,12],[4,8,9,10,11,13],[4,8,9,10,11,14],[4,8,9,10,12,13],[4,8,9,10,12,14],[4,8,9,10,13,14],[4,8,9,11,12,13],[4,8,9,11,12,14],[4,8,9,11,13,14],[4,8,9,12,13,14],[4,8,10,11,12,13],[4,8,10,11,12,14],[4,8,10,11,13,14],[4,8,10,12,13,14],[4,8,11,12,13,14],[4,9,10,11,12,13],[4,9,10,11,12,14],[4,9,10,11,13,14],[4,9,10,12,13,14],[4,9,11,12,13,14],[4,10,11,12,13,14],[5,6,7,8,9,10],[5,6,7,8,9,11],[5,6,7,8,9,12],[5,6,7,8,9,13],[5,6,7,8,9,14],[5,6,7,8,10,11],[5,6,7,8,10,12],[5,6,7,8,10,13],[5,6,7,8,10,14],[5,6,7,8,11,12],[5,6,7,8,11,13],[5,6,7,8,11,14],[5,6,7,8,12,13],[5,6,7,8,12,14],[5,6,7,8,13,14],[5,6,7,9,10,11],[5,6,7,9,10,12],[5,6,7,9,10,13],[5,6,7,9,10,14],[5,6,7,9,11,12],[5,6,7,9,11,13],[5,6,7,9,11,14],[5,6,7,9,12,13],[5,6,7,9,12,14],[5,6,7,9,13,14],[5,6,7,10,11,12],[5,6,7,10,11,13],[5,6,7,10,11,14],[5,6,7,10,12,13],[5,6,7,10,12,14],[5,6,7,10,13,14],[5,6,7,11,12,13],[5,6,7,11,12,14],[5,6,7,11,13,14],[5,6,7,12,13,14],[5,6,8,9,10,11],[5,6,8,9,10,12],[5,6,8,9,10,13],[5,6,8,9,10,14],[5,6,8,9,11,12],[5,6,8,9,11,13],[5,6,8,9,11,14],[5,6,8,9,12,13],[5,6,8,9,12,14],[5,6,8,9,13,14],[5,6,8,10,11,12],[5,6,8,10,11,13],[5,6,8,10,11,14],[5,6,8,10,12,13],[5,6,8,10,12,14],[5,6,8,10,13,14],[5,6,8,11,12,13],[5,6,8,11,12,14],[5,6,8,11,13,14],[5,6,8,12,13,14],[5,6,9,10,11,12],[5,6,9,10,11,13],[5,6,9,10,11,14],[5,6,9,10,12,13],[5,6,9,10,12,14],[5,6,9,10,13,14],[5,6,9,11,12,13],[5,6,9,11,12,14],[5,6,9,11,13,14],[5,6,9,12,13,14],[5,6,10,11,12,13],[5,6,10,11,12,14],[5,6,10,11,13,14],[5,6,10,12,13,14],[5,6,11,12,13,14],[5,7,8,9,10,11],[5,7,8,9,10,12],[5,7,8,9,10,13],[5,7,8,9,10,14],[5,7,8,9,11,12],[5,7,8,9,11,13],[5,7,8,9,11,14],[5,7,8,9,12,13],[5,7,8,9,12,14],[5,7,8,9,13,14],[5,7,8,10,11,12],[5,7,8,10,11,13],[5,7,8,10,11,14],[5,7,8,10,12,13],[5,7,8,10,12,14],[5,7,8,10,13,14],[5,7,8,11,12,13],[5,7,8,11,12,14],[5,7,8,11,13,14],[5,7,8,12,13,14],[5,7,9,10,11,12],[5,7,9,10,11,13],[5,7,9,10,11,14],[5,7,9,10,12,13],[5,7,9,10,12,14],[5,7,9,10,13,14],[5,7,9,11,12,13],[5,7,9,11,12,14],[5,7,9,11,13,14],[5,7,9,12,13,14],[5,7,10,11,12,13],[5,7,10,11,12,14],[5,7,10,11,13,14],[5,7,10,12,13,14],[5,7,11,12,13,14],[5,8,9,10,11,12],[5,8,9,10,11,13],[5,8,9,10,11,14],[5,8,9,10,12,13],[5,8,9,10,12,14],[5,8,9,10,13,14],[5,8,9,11,12,13],[5,8,9,11,12,14],[5,8,9,11,13,14],[5,8,9,12,13,14],[5,8,10,11,12,13],[5,8,10,11,12,14],[5,8,10,11,13,14],[5,8,10,12,13,14],[5,8,11,12,13,14],[5,9,10,11,12,13],[5,9,10,11,12,14],[5,9,10,11,13,14],[5,9,10,12,13,14],[5,9,11,12,13,14],[5,10,11,12,13,14],[6,7,8,9,10,11],[6,7,8,9,10,12],[6,7,8,9,10,13],[6,7,8,9,10,14],[6,7,8,9,11,12],[6,7,8,9,11,13],[6,7,8,9,11,14],[6,7,8,9,12,13],[6,7,8,9,12,14],[6,7,8,9,13,14],[6,7,8,10,11,12],[6,7,8,10,11,13],[6,7,8,10,11,14],[6,7,8,10,12,13],[6,7,8,10,12,14],[6,7,8,10,13,14],[6,7,8,11,12,13],[6,7,8,11,12,14],[6,7,8,11,13,14],[6,7,8,12,13,14],[6,7,9,10,11,12],[6,7,9,10,11,13],[6,7,9,10,11,14],[6,7,9,10,12,13],[6,7,9,10,12,14],[6,7,9,10,13,14],[6,7,9,11,12,13],[6,7,9,11,12,14],[6,7,9,11,13,14],[6,7,9,12,13,14],[6,7,10,11,12,13],[6,7,10,11,12,14],[6,7,10,11,13,14],[6,7,10,12,13,14],[6,7,11,12,13,14],[6,8,9,10,11,12],[6,8,9,10,11,13],[6,8,9,10,11,14],[6,8,9,10,12,13],[6,8,9,10,12,14],[6,8,9,10,13,14],[6,8,9,11,12,13],[6,8,9,11,12,14],[6,8,9,11,13,14],[6,8,9,12,13,14],[6,8,10,11,12,13],[6,8,10,11,12,14],[6,8,10,11,13,14],[6,8,10,12,13,14],[6,8,11,12,13,14],[6,9,10,11,12,13],[6,9,10,11,12,14],[6,9,10,11,13,14],[6,9,10,12,13,14],[6,9,11,12,13,14],[6,10,11,12,13,14],[7,8,9,10,11,12],[7,8,9,10,11,13],[7,8,9,10,11,14],[7,8,9,10,12,13],[7,8,9,10,12,14],[7,8,9,10,13,14],[7,8,9,11,12,13],[7,8,9,11,12,14],[7,8,9,11,13,14],[7,8,9,12,13,14],[7,8,10,11,12,13],[7,8,10,11,12,14],[7,8,10,11,13,14],[7,8,10,12,13,14],[7,8,11,12,13,14],[7,9,10,11,12,13],[7,9,10,11,12,14],[7,9,10,11,13,14],[7,9,10,12,13,14],[7,9,11,12,13,14],[7,10,11,12,13,14],[8,9,10,11,12,13],[8,9,10,11,12,14],[8,9,10,11,13,14],[8,9,10,12,13,14],[8,9,11,12,13,14],[8,10,11,12,13,14],[9,10,11,12,13,14]] ) else: print( """ n={} and k={} not supported by acceleration. Choose n=15 and k=1...6 for speed-up.""".format(n, k) ) from itertools import combinations # Cannot use pre-calculated values sat_combinations = combinations(iter(np.arange(n)), k) storage[n][k] = np.array([*sat_combinations]) return storage[n][k]
2,202.307692
80,097
0.490751
52,298
143,150
1.343225
0.001549
0.031147
0.012812
0.003872
0.891698
0.198995
0.072757
0.021808
0.005694
0.001523
0
0.48784
0.004988
143,150
64
80,098
2,236.71875
0.00535
0.003269
0
0.157895
0
0
0
0
0
0
0
0
0
1
0.026316
false
0
0.052632
0
0.105263
0.026316
0
0
1
null
0
0
0
1
0
0
0
0
0
0
1
0
0
0
1
1
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
6b5712570b1d5a8538faaac0922b05fbae2d1054
189
py
Python
bip_utils/bip/conf/bip84/__init__.py
MIPPLTeam/bip_utils
c66446e7ac3879d2cf6308c5b8eb7f7705292660
[ "MIT" ]
149
2020-05-15T08:11:43.000Z
2022-03-29T16:34:42.000Z
bip_utils/bip/conf/bip84/__init__.py
MIPPLTeam/bip_utils
c66446e7ac3879d2cf6308c5b8eb7f7705292660
[ "MIT" ]
41
2020-04-03T15:57:56.000Z
2022-03-31T08:25:11.000Z
bip_utils/bip/conf/bip84/__init__.py
MIPPLTeam/bip_utils
c66446e7ac3879d2cf6308c5b8eb7f7705292660
[ "MIT" ]
55
2020-04-03T17:05:15.000Z
2022-03-24T12:43:42.000Z
from bip_utils.bip.conf.bip84.bip84_coins import Bip84Coins from bip_utils.bip.conf.bip84.bip84_conf import Bip84Conf from bip_utils.bip.conf.bip84.bip84_conf_getter import Bip84ConfGetter
47.25
70
0.873016
31
189
5.096774
0.354839
0.132911
0.227848
0.28481
0.601266
0.601266
0.601266
0.417722
0
0
0
0.101695
0.063492
189
3
71
63
0.79096
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
6b65510013770dc24b57a454e8258f4463ebcfc6
13,832
py
Python
frites/simulations/sim_local_mi.py
StanSStanman/frites
53f4745979dc2e7b27145cd63eab6a82fe893ec7
[ "BSD-3-Clause" ]
35
2019-10-09T11:01:29.000Z
2022-03-12T02:24:39.000Z
frites/simulations/sim_local_mi.py
StanSStanman/frites
53f4745979dc2e7b27145cd63eab6a82fe893ec7
[ "BSD-3-Clause" ]
14
2020-12-05T09:26:00.000Z
2022-01-17T08:24:06.000Z
frites/simulations/sim_local_mi.py
StanSStanman/frites
53f4745979dc2e7b27145cd63eab6a82fe893ec7
[ "BSD-3-Clause" ]
13
2021-01-06T12:58:47.000Z
2022-03-09T14:55:24.000Z
"""Simulate local representation of mutual information.""" import numpy as np """ ############################################################################### I(C; C) ############################################################################### - MI between two continuous variables - Single / Multi subjects simulations """ def sim_local_cc_ms(n_subjects, random_state=None, **kwargs): """Multi-subjects simulations for computing local MI (CC). This function can be used for simulating local representations of mutual information between two continuous variables (CC) across multiple subjects. Parameters ---------- n_subjects : int Number of subjects kwargs : dict | {} Additional arguments are send to the function :func:`sim_local_cc_ss` Returns ------- x : list List length n_subjects composed of data arrays each one with a shape of (n_epochs, n_channels, n_times) y : list List of length n_subjects composed of regressor arrays each one with a shape of (n_epochs) roi : list List of length n_subjects composed of roi arrays each one with a shape of (n_roi) times : array_like Time vector """ # get the default cluster indices and covariance cl_index = kwargs.get('cl_index', [40, 60]) cl_cov = kwargs.get('cl_cov', [.8]) cl_sgn = kwargs.get('cl_sgn', [1]) # repeat if not equal to subject length if len(cl_index) != n_subjects: cl_index = [cl_index] * n_subjects if len(cl_cov) != n_subjects: cl_cov = [cl_cov] * n_subjects if len(cl_sgn) != n_subjects: cl_sgn = cl_sgn * n_subjects if not isinstance(random_state, int): random_state = np.random.randint(1000) # now generate the data x, y, roi = [], [], [] for n_s in range(n_subjects): # re-inject the indices and covariance kwargs['cl_index'] = cl_index[n_s] kwargs['cl_cov'] = cl_cov[n_s] kwargs['cl_sgn'] = cl_sgn[n_s] # generate the data of a single subject _x, _y, _roi, times = sim_local_cc_ss(random_state=random_state + n_s, **kwargs) # merge data x += [_x] y += [_y] roi += [_roi] return x, y, roi, times def sim_local_cc_ss(n_epochs=10, n_times=100, n_roi=1, cl_index=[40, 60], cl_cov=[.8], cl_sgn=1, random_state=None): """Single-subject simulations for computing local MI (CC). This function can be used for simulating local representations of mutual information between two continuous variables (CC) for a single subject. Parameters ---------- n_epochs : int | 30 Number of trials n_times : int | 100 Number of time points n_roi : int | 1 Number of ROI cl_index : array_like | [40, 60] Sample indices where the clusters are located. Should be an array of shape (n_clusters, 2) cl_cov : array_like | [.8] Covariance level between the data and the regressor variable. Should be an array of shape (n_clusters,) cl_sgn : {-1, 1} Sign of the correlation. Use -1 for anti-correlated variables and 1 for correlated variables random_state : int | None Random state (use it for reproducibility) Returns ------- x : array_like Data array of shape (n_epochs, n_channels, n_times) y : array_like Regressor array of shape (n_epochs,) roi : array_like Array of ROI names of shape (n_roi,) times : array_like Time vector of shape (n_times,) """ random_state = np.random.randint(100) if not isinstance( random_state, int) else random_state rnd = np.random.RandomState(random_state) # ------------------------------------------------------------------------- # Pick random n_roi roi = np.array([f"roi_{k}" for k in range(n_roi)]) # ------------------------------------------------------------------------- # check cluster types cl_index, cl_cov = np.atleast_2d(cl_index), np.asarray(cl_cov) assert (cl_index.shape[-1] == 2) and (cl_cov.ndim == 1) assert cl_sgn in [-1, 1] if cl_index.shape[0] == 1: cl_index = np.tile(cl_index, (n_roi, 1)) if cl_cov.shape[0] == 1: cl_cov = np.repeat(cl_cov, n_roi) assert (cl_index.shape == (n_roi, 2)) and (cl_cov.shape == (n_roi,)) # ------------------------------------------------------------------------- # Built a random dataset x = rnd.randn(n_epochs, n_roi, n_times) y = rnd.randn(n_epochs).reshape(-1, 1) # ------------------------------------------------------------------------- # Introduce a correlation between the data and the regressor for num, (idx, cov) in enumerate(zip(cl_index, cl_cov)): if not np.isfinite(cov): continue # noqa # define correlation strength t_len = idx[1] - idx[0] epsilon = np.sqrt((1. - cov ** 2) / cov ** 2) # Generate noise rnd_noise = np.random.RandomState(random_state + num + 1) noise = epsilon * rnd_noise.randn(n_epochs, t_len) x[:, num, idx[0]:idx[1]] = cl_sgn * y + noise times = np.arange(n_times) return x, y.ravel(), roi, times """ ############################################################################### I(C; D) ############################################################################### - MI between a continuous and a discret variable - Single / Multi subjects simulations """ def sim_local_cd_ms(n_subjects, **kwargs): """Multi-subjects simulations for computing local MI (CD). This function can be used for simulating local representations of mutual information between a continuous and a discret variables (CD) for a single subject. Parameters ---------- n_subjects : int Number of subjects kwargs : dict | {} Additional arguments are send to the function :func:`sim_local_cd_ss` Returns ------- x : list List length n_subjects composed of data arrays each one with a shape of (n_epochs, n_channels, n_times) y : list List of length n_subjects composed of regressor arrays each one with a shape of (n_epochs) roi : list List of length n_subjects composed of roi arrays each one with a shape of (n_roi) times : array_like Time vector of shape (n_times,) """ # get the default cluster indices and covariance cl_index = kwargs.get('cl_index', [40, 60]) cl_cov = kwargs.get('cl_cov', [.8]) # repeat if not equal to subject length if len(cl_index) != n_subjects: cl_index = [cl_index] * n_subjects if len(cl_cov) != n_subjects: cl_cov = [cl_cov] * n_subjects # now generate the data x, y, roi = [], [], [] for n_s in range(n_subjects): # re-inject the indices and covariance kwargs['cl_index'] = cl_index[n_s] kwargs['cl_cov'] = cl_cov[n_s] # generate the data of a single subject _x, _y, _roi, times = sim_local_cd_ss(random_state=n_s, **kwargs) # merge data x += [_x] y += [_y] roi += [_roi] return x, y, roi, times def sim_local_cd_ss(n_conditions=2, n_epochs=10, n_times=100, n_roi=1, cl_index=[40, 60], cl_cov=[.8], random_state=None): """Single-subject simulations for computing local MI (CD). This function can be used for simulating local representations of mutual information between a continuous and a discret variable (CD) for a single subject. Parameters ---------- n_conditions : int | 2 Number of conditions n_epochs : int | 30 Number of trials n_times : int | 100 Number of time points n_roi : int | 1 Number of ROI cl_index : array_like | [40, 60] Sample indices where the clusters are located. Should be an array of shape (n_clusters, 2) cl_cov : array_like | [.8] Covariance level between the data and the regressor variable. Should be an array of shape (n_clusters,) random_state : int | None Random state (use it for reproducibility) Returns ------- x : array_like Data array of shape (n_epochs, n_channels, n_times) y : array_like Condition array of shape (n_epochs,) roi : array_like Array of ROI names of shape (n_roi,) times : array_like Time vector of shape (n_times,) """ random_state = np.random.randint(100) if not isinstance( random_state, int) else random_state rnd = np.random.RandomState(random_state) # ------------------------------------------------------------------------- # Pick random n_roi roi = np.array([f"roi_{k}" for k in range(n_roi)]) # ------------------------------------------------------------------------- # check cluster types cl_index, cl_cov = np.atleast_2d(cl_index), np.asarray(cl_cov) assert (cl_index.shape[-1] == 2) and (cl_cov.ndim == 1) if cl_index.shape[0] == 1: cl_index = np.tile(cl_index, (n_roi, 1)) if cl_cov.shape[0] == 1: cl_cov = np.repeat(cl_cov, n_roi) assert (cl_index.shape == (n_roi, 2)) and (cl_cov.shape == (n_roi,)) # ------------------------------------------------------------------------- # linearly spaced values taken from a gaussian distribution res = 100 pick_up = np.linspace(0, res - 1, n_conditions).astype(int) values = np.sort(rnd.randn(res))[pick_up] # regressor variable y_regr = np.repeat(values, np.round(n_epochs, n_conditions)) y_regr = rnd.permutation(y_regr)[0:n_epochs] # condition variable _, y = np.unique(y_regr, return_inverse=True) y_regr = y_regr.reshape(-1, 1) x = rnd.randn(n_epochs, n_roi, n_times) # ------------------------------------------------------------------------- # Introduce a correlation between the data and the regressor for num, (idx, cov) in enumerate(zip(cl_index, cl_cov)): # define correlation strength t_len = idx[1] - idx[0] epsilon = np.sqrt((1. - cov ** 2) / cov ** 2) # Generate noise rnd_noise = np.random.RandomState(random_state + num + 1) noise = epsilon * rnd_noise.randn(n_epochs, t_len) x[:, num, idx[0]:idx[1]] = y_regr + noise times = np.arange(n_times) return x, y.astype(int), roi, times """ ############################################################################### I(C; C | D) ############################################################################### - MI between two continuous variables conditioned by a discret variable - Single / Multi subjects simulations """ def sim_local_ccd_ms(n_subjects, **kwargs): """Multi-subjects simulations for computing local MI (CCD). This function can be used for simulating local representations of mutual information between two continuous variables conditioned by a third discret one (CCD) across multiple subjects. Parameters ---------- n_subjects : int Number of subjects kwargs : dict | {} Additional arguments are send to the function :func:`sim_local_ccd_ss` Returns ------- x : list List length n_subjects composed of data arrays each one with a shape of (n_epochs, n_channels, n_times) y : list List of length n_subjects composed of regressor arrays each one with a shape of (n_epochs) z : array_like Condition array of shape (n_epochs,) roi : list List of length n_subjects composed of roi arrays each one with a shape of (n_roi) times : array_like Time vector """ n_c = kwargs.get('n_conditions', 2) if 'n_conditions' in list(kwargs.keys()): kwargs.pop('n_conditions') x, y, roi, times = sim_local_cc_ms(n_subjects, **kwargs) n_e = len(y[0]) z = [np.random.randint(0, n_c, (n_e,)) for k in range(n_subjects)] return x, y, z, roi, times def sim_local_ccd_ss(n_epochs=10, n_times=100, n_roi=1, n_conditions=2, cl_index=[40, 60], cl_cov=[.8], random_state=None): """Single-subject simulations for computing local MI (CC). This function can be used for simulating local representations of mutual information between two continuous variables conditioned by a third discret one (CCD) for a single subject. Parameters ---------- n_epochs : int | 30 Number of trials n_times : int | 100 Number of time points n_roi : int | 1 Number of ROI n_conditions : int | 2 Number of conditions cl_index : array_like | [40, 60] Sample indices where the clusters are located. Should be an array of shape (n_clusters, 2) cl_cov : array_like | [.8] Covariance level between the data and the regressor variable. Should be an array of shape (n_clusters,) random_state : int | None Random state (use it for reproducibility) Returns ------- x : array_like Data array of shape (n_epochs, n_channels, n_times) y : array_like Regressor array of shape (n_epochs,) z : array_like Condition array of shape (n_epochs,) roi : array_like Array of ROI names of shape (n_roi,) times : array_like Time vector of shape (n_times,) """ x, y, roi, times = sim_local_cc_ss( n_epochs=n_epochs, n_times=n_times, n_roi=n_roi, cl_index=cl_index, cl_cov=cl_cov, random_state=random_state) z = np.random.randint(0, n_conditions, (n_epochs,)) return x, y, z, roi, times
35.557841
79
0.575839
1,890
13,832
4.028042
0.103175
0.03494
0.022068
0.023906
0.883357
0.867595
0.850256
0.817943
0.812032
0.796795
0
0.0147
0.257374
13,832
388
80
35.649485
0.726441
0.502024
0
0.623853
0
0
0.022523
0
0
0
0
0
0.045872
1
0.055046
false
0
0.009174
0
0.119266
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
6bd3ca0cad733c32f5d86cb834a679ac4561669b
178
py
Python
python/8kyu/sort_and_star.py
Sigmanificient/codewars
b34df4bf55460d312b7ddf121b46a707b549387a
[ "MIT" ]
3
2021-06-08T01:57:13.000Z
2021-06-26T10:52:47.000Z
python/8kyu/sort_and_star.py
Sigmanificient/codewars
b34df4bf55460d312b7ddf121b46a707b549387a
[ "MIT" ]
null
null
null
python/8kyu/sort_and_star.py
Sigmanificient/codewars
b34df4bf55460d312b7ddf121b46a707b549387a
[ "MIT" ]
2
2021-06-10T21:20:13.000Z
2021-06-30T10:13:26.000Z
"""Kata url: https://www.codewars.com/kata/57cfdf34902f6ba3d300001e.""" from typing import List def two_sort(array: List[str]) -> str: return '***'.join(sorted(array)[0])
22.25
71
0.685393
24
178
5.041667
0.833333
0
0
0
0
0
0
0
0
0
0
0.101911
0.117978
178
7
72
25.428571
0.66879
0.365169
0
0
0
0
0.028037
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
6beceb207208ae3ace01806f4b04047a7539c555
33
py
Python
object_detection2/data/__init__.py
vghost2008/wml
d0c5a1da6c228e321ae59a563e9ac84aa66266ff
[ "MIT" ]
6
2019-12-10T17:18:56.000Z
2022-03-01T01:00:35.000Z
object_detection2/data/__init__.py
vghost2008/wml
d0c5a1da6c228e321ae59a563e9ac84aa66266ff
[ "MIT" ]
2
2021-08-25T16:16:01.000Z
2022-02-10T05:21:19.000Z
object_detection2/data/__init__.py
vghost2008/wml
d0c5a1da6c228e321ae59a563e9ac84aa66266ff
[ "MIT" ]
2
2019-12-07T09:57:35.000Z
2021-09-06T04:58:10.000Z
from . import buildin_dataprocess
33
33
0.878788
4
33
7
1
0
0
0
0
0
0
0
0
0
0
0
0.090909
33
1
33
33
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
d40d04ebf5316f8b1731bf9cd0ea41ec32233b6a
29,646
py
Python
pybind/slxos/v16r_1_00b/mpls_state/statistics_oam/__init__.py
shivharis/pybind
4e1c6d54b9fd722ccec25546ba2413d79ce337e6
[ "Apache-2.0" ]
null
null
null
pybind/slxos/v16r_1_00b/mpls_state/statistics_oam/__init__.py
shivharis/pybind
4e1c6d54b9fd722ccec25546ba2413d79ce337e6
[ "Apache-2.0" ]
null
null
null
pybind/slxos/v16r_1_00b/mpls_state/statistics_oam/__init__.py
shivharis/pybind
4e1c6d54b9fd722ccec25546ba2413d79ce337e6
[ "Apache-2.0" ]
1
2021-11-05T22:15:42.000Z
2021-11-05T22:15:42.000Z
from operator import attrgetter import pyangbind.lib.xpathhelper as xpathhelper from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType from pyangbind.lib.base import PybindBase from decimal import Decimal from bitarray import bitarray import __builtin__ import return_codes class statistics_oam(PybindBase): """ This class was auto-generated by the PythonClass plugin for PYANG from YANG module brocade-mpls-operational - based on the path /mpls-state/statistics-oam. Each member element of the container is represented as a class variable - with a specific YANG type. YANG Description: OAM packet statistics """ __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_rest_name', '_extmethods', '__usr_ping_count','__usr_traceroute_count','__echo_req_sent_count','__echo_req_received_count','__echo_req_timeout_count','__echo_resp_sent_count','__echo_resp_received_count','__return_codes',) _yang_name = 'statistics-oam' _rest_name = 'statistics-oam' _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): path_helper_ = kwargs.pop("path_helper", None) if path_helper_ is False: self._path_helper = False elif path_helper_ is not None and isinstance(path_helper_, xpathhelper.YANGPathHelper): self._path_helper = path_helper_ elif hasattr(self, "_parent"): path_helper_ = getattr(self._parent, "_path_helper", False) self._path_helper = path_helper_ else: self._path_helper = False extmethods = kwargs.pop("extmethods", None) if extmethods is False: self._extmethods = False elif extmethods is not None and isinstance(extmethods, dict): self._extmethods = extmethods elif hasattr(self, "_parent"): extmethods = getattr(self._parent, "_extmethods", None) self._extmethods = extmethods else: self._extmethods = False self.__echo_req_timeout_count = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="echo-req-timeout-count", rest_name="echo-req-timeout-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='uint32', is_config=False) self.__usr_traceroute_count = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="usr-traceroute-count", rest_name="usr-traceroute-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='uint32', is_config=False) self.__return_codes = YANGDynClass(base=YANGListType("number",return_codes.return_codes, yang_name="return-codes", rest_name="return-codes", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='number', extensions={u'tailf-common': {u'callpoint': u'mpls-statistics-oam-retcode', u'cli-suppress-show-path': None}}), is_container='list', yang_name="return-codes", rest_name="return-codes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'callpoint': u'mpls-statistics-oam-retcode', u'cli-suppress-show-path': None}}, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='list', is_config=False) self.__echo_resp_received_count = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="echo-resp-received-count", rest_name="echo-resp-received-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='uint32', is_config=False) self.__echo_req_sent_count = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="echo-req-sent-count", rest_name="echo-req-sent-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='uint32', is_config=False) self.__echo_req_received_count = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="echo-req-received-count", rest_name="echo-req-received-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='uint32', is_config=False) self.__echo_resp_sent_count = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="echo-resp-sent-count", rest_name="echo-resp-sent-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='uint32', is_config=False) self.__usr_ping_count = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="usr-ping-count", rest_name="usr-ping-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='uint32', is_config=False) load = kwargs.pop("load", None) if args: if len(args) > 1: raise TypeError("cannot create a YANG container with >1 argument") all_attr = True for e in self._pyangbind_elements: if not hasattr(args[0], e): all_attr = False break if not all_attr: raise ValueError("Supplied object did not have the correct attributes") for e in self._pyangbind_elements: nobj = getattr(args[0], e) if nobj._changed() is False: continue setmethod = getattr(self, "_set_%s" % e) if load is None: setmethod(getattr(args[0], e)) else: setmethod(getattr(args[0], e), load=load) def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: return [u'mpls-state', u'statistics-oam'] def _rest_path(self): if hasattr(self, "_parent"): if self._rest_name: return self._parent._rest_path()+[self._rest_name] else: return self._parent._rest_path() else: return [u'mpls-state', u'statistics-oam'] def _get_usr_ping_count(self): """ Getter method for usr_ping_count, mapped from YANG variable /mpls_state/statistics_oam/usr_ping_count (uint32) YANG Description: Count of user initiated ping requests """ return self.__usr_ping_count def _set_usr_ping_count(self, v, load=False): """ Setter method for usr_ping_count, mapped from YANG variable /mpls_state/statistics_oam/usr_ping_count (uint32) If this variable is read-only (config: false) in the source YANG file, then _set_usr_ping_count is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_usr_ping_count() directly. YANG Description: Count of user initiated ping requests """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="usr-ping-count", rest_name="usr-ping-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='uint32', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """usr_ping_count must be of a type compatible with uint32""", 'defined-type': "uint32", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="usr-ping-count", rest_name="usr-ping-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='uint32', is_config=False)""", }) self.__usr_ping_count = t if hasattr(self, '_set'): self._set() def _unset_usr_ping_count(self): self.__usr_ping_count = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="usr-ping-count", rest_name="usr-ping-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='uint32', is_config=False) def _get_usr_traceroute_count(self): """ Getter method for usr_traceroute_count, mapped from YANG variable /mpls_state/statistics_oam/usr_traceroute_count (uint32) YANG Description: Count of user initiated traceroute requests """ return self.__usr_traceroute_count def _set_usr_traceroute_count(self, v, load=False): """ Setter method for usr_traceroute_count, mapped from YANG variable /mpls_state/statistics_oam/usr_traceroute_count (uint32) If this variable is read-only (config: false) in the source YANG file, then _set_usr_traceroute_count is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_usr_traceroute_count() directly. YANG Description: Count of user initiated traceroute requests """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="usr-traceroute-count", rest_name="usr-traceroute-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='uint32', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """usr_traceroute_count must be of a type compatible with uint32""", 'defined-type': "uint32", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="usr-traceroute-count", rest_name="usr-traceroute-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='uint32', is_config=False)""", }) self.__usr_traceroute_count = t if hasattr(self, '_set'): self._set() def _unset_usr_traceroute_count(self): self.__usr_traceroute_count = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="usr-traceroute-count", rest_name="usr-traceroute-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='uint32', is_config=False) def _get_echo_req_sent_count(self): """ Getter method for echo_req_sent_count, mapped from YANG variable /mpls_state/statistics_oam/echo_req_sent_count (uint32) YANG Description: Count of MPLS Echo requests sent """ return self.__echo_req_sent_count def _set_echo_req_sent_count(self, v, load=False): """ Setter method for echo_req_sent_count, mapped from YANG variable /mpls_state/statistics_oam/echo_req_sent_count (uint32) If this variable is read-only (config: false) in the source YANG file, then _set_echo_req_sent_count is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_echo_req_sent_count() directly. YANG Description: Count of MPLS Echo requests sent """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="echo-req-sent-count", rest_name="echo-req-sent-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='uint32', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """echo_req_sent_count must be of a type compatible with uint32""", 'defined-type': "uint32", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="echo-req-sent-count", rest_name="echo-req-sent-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='uint32', is_config=False)""", }) self.__echo_req_sent_count = t if hasattr(self, '_set'): self._set() def _unset_echo_req_sent_count(self): self.__echo_req_sent_count = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="echo-req-sent-count", rest_name="echo-req-sent-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='uint32', is_config=False) def _get_echo_req_received_count(self): """ Getter method for echo_req_received_count, mapped from YANG variable /mpls_state/statistics_oam/echo_req_received_count (uint32) YANG Description: Count of MPLS Echo requests received """ return self.__echo_req_received_count def _set_echo_req_received_count(self, v, load=False): """ Setter method for echo_req_received_count, mapped from YANG variable /mpls_state/statistics_oam/echo_req_received_count (uint32) If this variable is read-only (config: false) in the source YANG file, then _set_echo_req_received_count is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_echo_req_received_count() directly. YANG Description: Count of MPLS Echo requests received """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="echo-req-received-count", rest_name="echo-req-received-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='uint32', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """echo_req_received_count must be of a type compatible with uint32""", 'defined-type': "uint32", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="echo-req-received-count", rest_name="echo-req-received-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='uint32', is_config=False)""", }) self.__echo_req_received_count = t if hasattr(self, '_set'): self._set() def _unset_echo_req_received_count(self): self.__echo_req_received_count = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="echo-req-received-count", rest_name="echo-req-received-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='uint32', is_config=False) def _get_echo_req_timeout_count(self): """ Getter method for echo_req_timeout_count, mapped from YANG variable /mpls_state/statistics_oam/echo_req_timeout_count (uint32) YANG Description: Count of MPLS Echo requests timedout """ return self.__echo_req_timeout_count def _set_echo_req_timeout_count(self, v, load=False): """ Setter method for echo_req_timeout_count, mapped from YANG variable /mpls_state/statistics_oam/echo_req_timeout_count (uint32) If this variable is read-only (config: false) in the source YANG file, then _set_echo_req_timeout_count is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_echo_req_timeout_count() directly. YANG Description: Count of MPLS Echo requests timedout """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="echo-req-timeout-count", rest_name="echo-req-timeout-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='uint32', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """echo_req_timeout_count must be of a type compatible with uint32""", 'defined-type': "uint32", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="echo-req-timeout-count", rest_name="echo-req-timeout-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='uint32', is_config=False)""", }) self.__echo_req_timeout_count = t if hasattr(self, '_set'): self._set() def _unset_echo_req_timeout_count(self): self.__echo_req_timeout_count = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="echo-req-timeout-count", rest_name="echo-req-timeout-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='uint32', is_config=False) def _get_echo_resp_sent_count(self): """ Getter method for echo_resp_sent_count, mapped from YANG variable /mpls_state/statistics_oam/echo_resp_sent_count (uint32) YANG Description: Count of MPLS Echo responses sent """ return self.__echo_resp_sent_count def _set_echo_resp_sent_count(self, v, load=False): """ Setter method for echo_resp_sent_count, mapped from YANG variable /mpls_state/statistics_oam/echo_resp_sent_count (uint32) If this variable is read-only (config: false) in the source YANG file, then _set_echo_resp_sent_count is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_echo_resp_sent_count() directly. YANG Description: Count of MPLS Echo responses sent """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="echo-resp-sent-count", rest_name="echo-resp-sent-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='uint32', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """echo_resp_sent_count must be of a type compatible with uint32""", 'defined-type': "uint32", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="echo-resp-sent-count", rest_name="echo-resp-sent-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='uint32', is_config=False)""", }) self.__echo_resp_sent_count = t if hasattr(self, '_set'): self._set() def _unset_echo_resp_sent_count(self): self.__echo_resp_sent_count = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="echo-resp-sent-count", rest_name="echo-resp-sent-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='uint32', is_config=False) def _get_echo_resp_received_count(self): """ Getter method for echo_resp_received_count, mapped from YANG variable /mpls_state/statistics_oam/echo_resp_received_count (uint32) YANG Description: Count of MPLS Echo responses received """ return self.__echo_resp_received_count def _set_echo_resp_received_count(self, v, load=False): """ Setter method for echo_resp_received_count, mapped from YANG variable /mpls_state/statistics_oam/echo_resp_received_count (uint32) If this variable is read-only (config: false) in the source YANG file, then _set_echo_resp_received_count is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_echo_resp_received_count() directly. YANG Description: Count of MPLS Echo responses received """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="echo-resp-received-count", rest_name="echo-resp-received-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='uint32', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """echo_resp_received_count must be of a type compatible with uint32""", 'defined-type': "uint32", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="echo-resp-received-count", rest_name="echo-resp-received-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='uint32', is_config=False)""", }) self.__echo_resp_received_count = t if hasattr(self, '_set'): self._set() def _unset_echo_resp_received_count(self): self.__echo_resp_received_count = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="echo-resp-received-count", rest_name="echo-resp-received-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='uint32', is_config=False) def _get_return_codes(self): """ Getter method for return_codes, mapped from YANG variable /mpls_state/statistics_oam/return_codes (list) YANG Description: OAM packet statistics return code """ return self.__return_codes def _set_return_codes(self, v, load=False): """ Setter method for return_codes, mapped from YANG variable /mpls_state/statistics_oam/return_codes (list) If this variable is read-only (config: false) in the source YANG file, then _set_return_codes is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_return_codes() directly. YANG Description: OAM packet statistics return code """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=YANGListType("number",return_codes.return_codes, yang_name="return-codes", rest_name="return-codes", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='number', extensions={u'tailf-common': {u'callpoint': u'mpls-statistics-oam-retcode', u'cli-suppress-show-path': None}}), is_container='list', yang_name="return-codes", rest_name="return-codes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'callpoint': u'mpls-statistics-oam-retcode', u'cli-suppress-show-path': None}}, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='list', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """return_codes must be of a type compatible with list""", 'defined-type': "list", 'generated-type': """YANGDynClass(base=YANGListType("number",return_codes.return_codes, yang_name="return-codes", rest_name="return-codes", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='number', extensions={u'tailf-common': {u'callpoint': u'mpls-statistics-oam-retcode', u'cli-suppress-show-path': None}}), is_container='list', yang_name="return-codes", rest_name="return-codes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'callpoint': u'mpls-statistics-oam-retcode', u'cli-suppress-show-path': None}}, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='list', is_config=False)""", }) self.__return_codes = t if hasattr(self, '_set'): self._set() def _unset_return_codes(self): self.__return_codes = YANGDynClass(base=YANGListType("number",return_codes.return_codes, yang_name="return-codes", rest_name="return-codes", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='number', extensions={u'tailf-common': {u'callpoint': u'mpls-statistics-oam-retcode', u'cli-suppress-show-path': None}}), is_container='list', yang_name="return-codes", rest_name="return-codes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'callpoint': u'mpls-statistics-oam-retcode', u'cli-suppress-show-path': None}}, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='list', is_config=False) usr_ping_count = __builtin__.property(_get_usr_ping_count) usr_traceroute_count = __builtin__.property(_get_usr_traceroute_count) echo_req_sent_count = __builtin__.property(_get_echo_req_sent_count) echo_req_received_count = __builtin__.property(_get_echo_req_received_count) echo_req_timeout_count = __builtin__.property(_get_echo_req_timeout_count) echo_resp_sent_count = __builtin__.property(_get_echo_resp_sent_count) echo_resp_received_count = __builtin__.property(_get_echo_resp_received_count) return_codes = __builtin__.property(_get_return_codes) _pyangbind_elements = {'usr_ping_count': usr_ping_count, 'usr_traceroute_count': usr_traceroute_count, 'echo_req_sent_count': echo_req_sent_count, 'echo_req_received_count': echo_req_received_count, 'echo_req_timeout_count': echo_req_timeout_count, 'echo_resp_sent_count': echo_resp_sent_count, 'echo_resp_received_count': echo_resp_received_count, 'return_codes': return_codes, }
73.563275
786
0.756864
4,095
29,646
5.180464
0.047619
0.040539
0.047516
0.030546
0.909588
0.881069
0.864806
0.850146
0.831338
0.799661
0
0.018432
0.117925
29,646
402
787
73.746269
0.792811
0.172941
0
0.475983
0
0.034935
0.373005
0.220204
0
0
0
0
0
1
0.117904
false
0
0.039301
0
0.275109
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
2e17319608f88884574f4d9f2eec350031f2d290
20
py
Python
pywork/py1.py
infinityman8/pythonwork-uni
8ba7f341573f3031710d1bf4d91849508aa81bf8
[ "MIT" ]
null
null
null
pywork/py1.py
infinityman8/pythonwork-uni
8ba7f341573f3031710d1bf4d91849508aa81bf8
[ "MIT" ]
null
null
null
pywork/py1.py
infinityman8/pythonwork-uni
8ba7f341573f3031710d1bf4d91849508aa81bf8
[ "MIT" ]
null
null
null
x=4 y=5 a=3(x+y)
5
9
0.4
8
20
1
0.75
0
0
0
0
0
0
0
0
0
0
0.214286
0.3
20
3
10
6.666667
0.357143
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
1
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
2e352d4498a933b27cc6dc7695b09136bb4e78ce
2,716
py
Python
src/pytorch_yard/avalanche/scenarios.py
karolpiczak/pytorch-yard
1bf2515ffdf63365af87dffecc0e393b4a24ec0f
[ "MIT" ]
null
null
null
src/pytorch_yard/avalanche/scenarios.py
karolpiczak/pytorch-yard
1bf2515ffdf63365af87dffecc0e393b4a24ec0f
[ "MIT" ]
null
null
null
src/pytorch_yard/avalanche/scenarios.py
karolpiczak/pytorch-yard
1bf2515ffdf63365af87dffecc0e393b4a24ec0f
[ "MIT" ]
null
null
null
from typing import Any, Tuple, cast import torch import torch.utils.data from avalanche.benchmarks.generators.benchmark_generators import nc_benchmark from avalanche.benchmarks.scenarios.new_classes.nc_scenario import NCScenario def incremental_task( train: torch.utils.data.Dataset[torch.Tensor], test: torch.utils.data.Dataset[torch.Tensor], transform: Any, n_experiences: int, n_classes: int, ) -> Tuple[NCScenario, int]: """ Incremental task setup. Task labels are provided, classes from `0` to `n_classes` split over `n_experiences` (without remapping). Most commonly used with a multi-head setup, where each head is trained on a different experience. """ benchmark = nc_benchmark( train_dataset=cast(Any, train), test_dataset=cast(Any, test), n_experiences=n_experiences, task_labels=True, fixed_class_order=range(n_classes), class_ids_from_zero_in_each_exp=True, train_transform=transform, eval_transform=transform, ) n_output_classes = n_classes // n_experiences return benchmark, n_output_classes def incremental_domain( train: torch.utils.data.Dataset[torch.Tensor], test: torch.utils.data.Dataset[torch.Tensor], transform: Any, n_experiences: int, n_classes: int, ) -> Tuple[NCScenario, int]: """ Incremental domain setup. No task labels, classes are remapped to `0, ..., effective_n_classes`, where `effective_n_classes` is the number of classes per single experience. """ benchmark = nc_benchmark( train_dataset=cast(Any, train), test_dataset=cast(Any, test), n_experiences=n_experiences, task_labels=False, fixed_class_order=range(n_classes), class_ids_from_zero_in_each_exp=True, train_transform=transform, eval_transform=transform, ) n_output_classes = n_classes // n_experiences return benchmark, n_output_classes def incremental_class( train: torch.utils.data.Dataset[torch.Tensor], test: torch.utils.data.Dataset[torch.Tensor], transform: Any, n_experiences: int, n_classes: int, ) -> Tuple[NCScenario, int]: """ Incremental class setup. No task labels, classes from `0` to `n_classes` split over `n_experiences` (without remapping). """ benchmark = nc_benchmark( train_dataset=cast(Any, train), test_dataset=cast(Any, test), n_experiences=n_experiences, task_labels=False, fixed_class_order=range(n_classes), train_transform=transform, eval_transform=transform, ) n_output_classes = n_classes return benchmark, n_output_classes
28.291667
109
0.697717
341
2,716
5.313783
0.222874
0.086093
0.054084
0.069536
0.76766
0.729029
0.729029
0.729029
0.729029
0.729029
0
0.001401
0.211708
2,716
95
110
28.589474
0.844932
0.192931
0
0.786885
0
0
0
0
0
0
0
0
0
1
0.04918
false
0
0.081967
0
0.180328
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
2e39a457a24758f095aeb213ba1555d1c57cdc96
36
py
Python
core/__init__.py
KJook/KJSerial
b362d2a968b60732241214acffb846d93edc3d3f
[ "MIT" ]
1
2022-03-18T05:46:54.000Z
2022-03-18T05:46:54.000Z
core/__init__.py
KJook/KJSerial
b362d2a968b60732241214acffb846d93edc3d3f
[ "MIT" ]
null
null
null
core/__init__.py
KJook/KJSerial
b362d2a968b60732241214acffb846d93edc3d3f
[ "MIT" ]
1
2022-03-22T02:46:48.000Z
2022-03-22T02:46:48.000Z
from .s import getPortList, myserial
36
36
0.833333
5
36
6
1
0
0
0
0
0
0
0
0
0
0
0
0.111111
36
1
36
36
0.9375
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
2e6985c41102764af81fb1c8d486c4ef6ad10277
26
py
Python
environment/__init__.py
mbed92/soft-grip
4399a4ab719bf29303769de33977a037624d864d
[ "MIT" ]
5
2020-01-19T08:55:55.000Z
2021-07-08T13:12:24.000Z
environment/__init__.py
mbed92/soft-grip
4399a4ab719bf29303769de33977a037624d864d
[ "MIT" ]
null
null
null
environment/__init__.py
mbed92/soft-grip
4399a4ab719bf29303769de33977a037624d864d
[ "MIT" ]
1
2020-06-28T08:20:33.000Z
2020-06-28T08:20:33.000Z
from .manenv import ManEnv
26
26
0.846154
4
26
5.5
0.75
0
0
0
0
0
0
0
0
0
0
0
0.115385
26
1
26
26
0.956522
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
2e8523ba350a4bfdeff9803111fe3876e7501841
100
py
Python
src/gsc/utils.py
nguyen-ngoc-thach/gitlab-search-command-tools
ead603b1139c5ddf2f6b963bda0a5b0b384fac67
[ "Apache-2.0" ]
8
2021-12-19T12:03:59.000Z
2022-03-15T12:03:51.000Z
src/gsc/utils.py
nguyen-ngoc-thach/git-search-command
ead603b1139c5ddf2f6b963bda0a5b0b384fac67
[ "Apache-2.0" ]
null
null
null
src/gsc/utils.py
nguyen-ngoc-thach/git-search-command
ead603b1139c5ddf2f6b963bda0a5b0b384fac67
[ "Apache-2.0" ]
null
null
null
import re def is_valid_environment_name(name: str): return re.match("^[A-Za-z0-9_-]*$", name)
16.666667
45
0.67
17
100
3.705882
0.823529
0
0
0
0
0
0
0
0
0
0
0.023256
0.14
100
5
46
20
0.709302
0
0
0
0
0
0.16
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
5cf7f080c5d2d781faa0a7ba7fdb5db5d208471b
3,982
py
Python
lane_detection_utils/lane_args_utils.py
syeda27/MonoRARP
71415d9fc71bc636ac1f5de1a90f033b4e519538
[ "MIT" ]
2
2020-07-22T07:05:01.000Z
2021-11-27T13:28:03.000Z
lane_detection_utils/lane_args_utils.py
syeda27/MonoRARP
71415d9fc71bc636ac1f5de1a90f033b4e519538
[ "MIT" ]
null
null
null
lane_detection_utils/lane_args_utils.py
syeda27/MonoRARP
71415d9fc71bc636ac1f5de1a90f033b4e519538
[ "MIT" ]
null
null
null
""" There are so many variables related to the lane detector, that I think it makes sense to create a set of classes for them... """ import numpy as np class scan_region_output_args: def __init__(self): #Initializing vectors to be used for collection of the lines inside the region self.rx1 = np.zeros(100) self.rx2 = np.zeros(100) self.ry1 = np.zeros(100) self.ry2 = np.zeros(100) #Initializing vector for angle collection self.angles = np.zeros(100) self.count_angles_per_region = 0 def print(self): print( self.rx1, self.rx2, self.ry1, self.angles, self.count_angles_per_region ) def initialize_lane_detector_members(lane_detector_object): lane_detector_object.mux_lane_vec_previous = np.zeros(40) lane_detector_object.muy_lane_vec_previous = np.zeros(40) lane_detector_object.base_ptx_lane_vec_previous = np.zeros(40) lane_detector_object.base_pty_lane_vec_previous = np.zeros(40) lane_detector_object.mux_lane_vec_aggregated = np.zeros(40) lane_detector_object.muy_lane_vec_aggregated = np.zeros(40) lane_detector_object.base_ptx_lane_vec_aggregated = np.zeros(40) lane_detector_object.base_pty_lane_vec_aggregated = np.zeros(40) lane_detector_object.count_lanes_average_vec = 0 lane_detector_object.mux_lane_vec_average = np.zeros(4000) lane_detector_object.muy_lane_vec_average = np.zeros(4000) lane_detector_object.base_ptx_lane_vec_average = np.zeros(4000) lane_detector_object.base_pty_lane_vec_average = np.zeros(4000) lane_detector_object.count_lanes_average_vec2 = 0 lane_detector_object.mux_lane_vec_average2 = np.zeros(4000) lane_detector_object.muy_lane_vec_average2 = np.zeros(4000) lane_detector_object.base_ptx_lane_vec_average2 = np.zeros(4000) lane_detector_object.base_pty_lane_vec_average2 = np.zeros(4000) lane_detector_object.count_lane_group1 = 0 lane_detector_object.count_lane_group2 = 0 lane_detector_object.white_mark_hit = 0 lane_detector_object.count_road_nomark = 0 lane_detector_object.capture_frameindex_for_speed = 0 lane_detector_object.frameindex_for_speed_previous = 0 lane_detector_object.frameindex_for_speed = 0 lane_detector_object.count_scanned_lines_reverse_for_speed_previous = 0 lane_detector_object.count_scanned_lines_reverse_for_speed = 0 lane_detector_object.white_mark_hit_1 = 0 lane_detector_object.count_road_nomark_1 = 0 lane_detector_object.capture_frameindex_for_speed_1 = 0 lane_detector_object.frameindex_for_speed_previous_1 = 0 lane_detector_object.frameindex_for_speed_1 = 0 lane_detector_object.count_scanned_lines_reverse_for_speed_previous_1 = 0 lane_detector_object.count_scanned_lines_reverse_for_speed_1 = 0 lane_detector_object.base_ptx_lane_vec_final1 = 0 lane_detector_object.base_pty_lane_vec_final1 = 0 lane_detector_object.mux_lane_vec_final1 = 0 lane_detector_object.muy_lane_vec_final1 = 0 lane_detector_object.base_ptx_lane_vec_final2 = 0 lane_detector_object.base_pty_lane_vec_final2 = 0 lane_detector_object.mux_lane_vec_final2 = 0 lane_detector_object.muy_lane_vec_final2 = 0 lane_detector_object.mux_lane_vec_final1_previous = 0 lane_detector_object.muy_lane_vec_final1_previous = 0 lane_detector_object.base_ptx_lane_vec_final1_previous = 0 lane_detector_object.base_pty_lane_vec_final1_previous = 0 lane_detector_object.mux_lane_vec_final2_previous = 0 lane_detector_object.muy_lane_vec_final2_previous = 0 lane_detector_object.base_ptx_lane_vec_final2_previous = 0 lane_detector_object.base_pty_lane_vec_final2_previous = 0 lane_detector_object.x1_lane_group1 = 0 lane_detector_object.x1_lane_group2 = 0 lane_detector_object.initial_frame_was_processed_flag = 0 lane_detector_object.first_reading_available_flag = 0
41.051546
86
0.7888
606
3,982
4.655116
0.158416
0.242467
0.350939
0.249202
0.817086
0.797944
0.742999
0.664303
0.504431
0.2609
0
0.042598
0.156956
3,982
96
87
41.479167
0.797736
0.060773
0
0
0
0
0
0
0
0
0
0
0
1
0.041667
false
0
0.013889
0
0.069444
0.027778
0
0
0
null
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
cf1838dd66d05579fc3ee4e65a14791d302ec69e
24,059
py
Python
kgcnn/layers/conv/attention.py
the16thpythonist/gcnn_keras
27d794095b684333d93149c825d84b85df8c30ff
[ "MIT" ]
47
2021-03-10T10:15:42.000Z
2022-03-14T00:53:40.000Z
kgcnn/layers/conv/attention.py
the16thpythonist/gcnn_keras
27d794095b684333d93149c825d84b85df8c30ff
[ "MIT" ]
36
2021-05-06T15:06:51.000Z
2022-03-02T13:06:16.000Z
kgcnn/layers/conv/attention.py
the16thpythonist/gcnn_keras
27d794095b684333d93149c825d84b85df8c30ff
[ "MIT" ]
11
2021-04-05T02:14:27.000Z
2022-03-02T03:25:52.000Z
import tensorflow as tf # import tensorflow.keras as ks from kgcnn.layers.base import GraphBaseLayer from kgcnn.layers.gather import GatherNodesIngoing, GatherNodesOutgoing, GatherState from kgcnn.layers.modules import DenseEmbedding, ActivationEmbedding, LazyConcatenate from kgcnn.layers.pooling import PoolingNodes from kgcnn.layers.pooling import PoolingNodesAttention, PoolingLocalEdgesAttention @tf.keras.utils.register_keras_serializable(package='kgcnn', name='AttentionHeadGAT') class AttentionHeadGAT(GraphBaseLayer): r"""Computes the attention head according to `GAT <https://arxiv.org/abs/1710.10903>`_ . The attention coefficients are computed by :math:`a_{ij} = \sigma(a^T W n_i || W n_j)`, optionally by :math:`a_{ij} = \sigma( W n_i || W n_j || e_{ij})` with edges :math:`e_{ij}`. The attention is obtained by :math:`\alpha_{ij} = \text{softmax}_j (a_{ij})`. And the messages are pooled by :math:`m_i = \sum_j \alpha_{ij} W n_j`. If the graph has no self-loops, they must be added beforehand or use external skip connections. And optionally passed through an activation :math:`h_i = \sigma(\sum_j \alpha_{ij} W n_j)`. An edge is defined by index tuple :math:`(i, j)` with the direction of the connection from :math:`j` to :math:`i`. Args: units (int): Units for the linear trafo of node features before attention. use_edge_features (bool): Append edge features to attention computation. Default is False. use_final_activation (bool): Whether to apply the final activation for the output. has_self_loops (bool): If the graph has self-loops. Not used here. Default is True. activation (str): Activation. Default is {"class_name": "kgcnn>leaky_relu", "config": {"alpha": 0.2}}, use_bias (bool): Use bias. Default is True. kernel_regularizer: Kernel regularization. Default is None. bias_regularizer: Bias regularization. Default is None. activity_regularizer: Activity regularization. Default is None. kernel_constraint: Kernel constrains. Default is None. bias_constraint: Bias constrains. Default is None. kernel_initializer: Initializer for kernels. Default is 'glorot_uniform'. bias_initializer: Initializer for bias. Default is 'zeros'. """ def __init__(self, units, use_edge_features=False, use_final_activation=True, has_self_loops=True, activation='kgcnn>leaky_relu', use_bias=True, kernel_regularizer=None, bias_regularizer=None, activity_regularizer=None, kernel_constraint=None, bias_constraint=None, kernel_initializer='glorot_uniform', bias_initializer='zeros', **kwargs): """Initialize layer.""" super(AttentionHeadGAT, self).__init__(**kwargs) self.use_edge_features = use_edge_features self.use_final_activation = use_final_activation self.has_self_loops = has_self_loops self.units = int(units) self.use_bias = use_bias kernel_args = {"kernel_regularizer": kernel_regularizer, "activity_regularizer": activity_regularizer, "bias_regularizer": bias_regularizer, "kernel_constraint": kernel_constraint, "bias_constraint": bias_constraint, "kernel_initializer": kernel_initializer, "bias_initializer": bias_initializer} self.lay_linear_trafo = DenseEmbedding(units, activation="linear", use_bias=use_bias, **kernel_args) self.lay_alpha = DenseEmbedding(1, activation=activation, use_bias=False, **kernel_args) self.lay_gather_in = GatherNodesIngoing() self.lay_gather_out = GatherNodesOutgoing() self.lay_concat = LazyConcatenate(axis=-1) self.lay_pool_attention = PoolingLocalEdgesAttention() if self.use_final_activation: self.lay_final_activ = ActivationEmbedding(activation=activation) def build(self, input_shape): """Build layer.""" super(AttentionHeadGAT, self).build(input_shape) def call(self, inputs, **kwargs): """Forward pass. Args: inputs (list): of [node, edges, edge_indices] - nodes (tf.RaggedTensor): Node embeddings of shape (batch, [N], F) - edges (tf.RaggedTensor): Edge or message embeddings of shape (batch, [M], F) - edge_indices (tf.RaggedTensor): Edge indices referring to nodes of shape (batch, [M], 2) Returns: tf.RaggedTensor: Embedding tensor of pooled edge attentions for each node. """ node, edge, edge_index = inputs w_n = self.lay_linear_trafo(node, **kwargs) wn_in = self.lay_gather_in([w_n, edge_index], **kwargs) wn_out = self.lay_gather_out([w_n, edge_index], **kwargs) if self.use_edge_features: e_ij = self.lay_concat([wn_in, wn_out, edge], **kwargs) else: e_ij = self.lay_concat([wn_in, wn_out], **kwargs) a_ij = self.lay_alpha(e_ij, **kwargs) # Should be dimension (batch*None,1) h_i = self.lay_pool_attention([node, wn_out, a_ij, edge_index], **kwargs) if self.use_final_activation: h_i = self.lay_final_activ(h_i, **kwargs) return h_i def get_config(self): """Update layer config.""" config = super(AttentionHeadGAT, self).get_config() config.update({"use_edge_features": self.use_edge_features, "use_bias": self.use_bias, "units": self.units, "has_self_loops": self.has_self_loops, "use_final_activation": self.use_final_activation}) conf_sub = self.lay_alpha.get_config() for x in ["kernel_regularizer", "activity_regularizer", "bias_regularizer", "kernel_constraint", "bias_constraint", "kernel_initializer", "bias_initializer", "activation"]: config.update({x: conf_sub[x]}) return config @tf.keras.utils.register_keras_serializable(package='kgcnn', name='AttentionHeadGATV2') class AttentionHeadGATV2(GraphBaseLayer): r"""Computes the modified attention head according to `GATv2 <https://arxiv.org/pdf/2105.14491.pdf>`_ . The attention coefficients are computed by :math:`a_{ij} = a^T \sigma( W [n_i || n_j] )`, optionally by :math:`a_{ij} = a^T \sigma( W [n_i || n_j || e_{ij}] )` with edges :math:`e_{ij}`. The attention is obtained by :math:`\alpha_{ij} = \text{softmax}_j (a_{ij})`. And the messages are pooled by :math:`m_i = \sum_j \alpha_{ij} e_{ij}`. If the graph has no self-loops, they must be added beforehand or use external skip connections. And optionally passed through an activation :math:`h_i = \sigma(\sum_j \alpha_{ij} e_{ij})`. An edge is defined by index tuple :math:`(i, j)` with the direction of the connection from :math:`j` to :math:`i`. Args: units (int): Units for the linear trafo of node features before attention. use_edge_features (bool): Append edge features to attention computation. Default is False. use_final_activation (bool): Whether to apply the final activation for the output. has_self_loops (bool): If the graph has self-loops. Not used here. Default is True. activation (str): Activation. Default is {"class_name": "kgcnn>leaky_relu", "config": {"alpha": 0.2}}, use_bias (bool): Use bias. Default is True. kernel_regularizer: Kernel regularization. Default is None. bias_regularizer: Bias regularization. Default is None. activity_regularizer: Activity regularization. Default is None. kernel_constraint: Kernel constrains. Default is None. bias_constraint: Bias constrains. Default is None. kernel_initializer: Initializer for kernels. Default is 'glorot_uniform'. bias_initializer: Initializer for bias. Default is 'zeros'. """ def __init__(self, units, use_edge_features=False, use_final_activation=True, has_self_loops=True, activation='kgcnn>leaky_relu', use_bias=True, kernel_regularizer=None, bias_regularizer=None, activity_regularizer=None, kernel_constraint=None, bias_constraint=None, kernel_initializer='glorot_uniform', bias_initializer='zeros', **kwargs): """Initialize layer.""" super(AttentionHeadGATV2, self).__init__(**kwargs) self.use_edge_features = use_edge_features self.use_final_activation = use_final_activation self.has_self_loops = has_self_loops self.units = int(units) self.use_bias = use_bias kernel_args = {"kernel_regularizer": kernel_regularizer, "activity_regularizer": activity_regularizer, "bias_regularizer": bias_regularizer, "kernel_constraint": kernel_constraint, "bias_constraint": bias_constraint, "kernel_initializer": kernel_initializer, "bias_initializer": bias_initializer} self.lay_linear_trafo = DenseEmbedding(units, activation="linear", use_bias=use_bias, **kernel_args) self.lay_alpha_activation = DenseEmbedding(units, activation=activation, use_bias=use_bias, **kernel_args) self.lay_alpha = DenseEmbedding(1, activation="linear", use_bias=False, **kernel_args) self.lay_gather_in = GatherNodesIngoing() self.lay_gather_out = GatherNodesOutgoing() self.lay_concat = LazyConcatenate(axis=-1) self.lay_pool_attention = PoolingLocalEdgesAttention() if self.use_final_activation: self.lay_final_activ = ActivationEmbedding(activation=activation) def build(self, input_shape): """Build layer.""" super(AttentionHeadGATV2, self).build(input_shape) def call(self, inputs, **kwargs): """Forward pass. Args: inputs (list): of [node, edges, edge_indices] - nodes (tf.RaggedTensor): Node embeddings of shape (batch, [N], F) - edges (tf.RaggedTensor): Edge or message embeddings of shape (batch, [M], F) - edge_indices (tf.RaggedTensor): Edge indices referring to nodes of shape (batch, [M], 2) Returns: tf.RaggedTensor: Embedding tensor of pooled edge attentions for each node. """ node, edge, edge_index = inputs w_n = self.lay_linear_trafo(node, **kwargs) n_in = self.lay_gather_in([node, edge_index], **kwargs) n_out = self.lay_gather_out([node, edge_index], **kwargs) wn_out = self.lay_gather_out([w_n, edge_index], **kwargs) if self.use_edge_features: e_ij = self.lay_concat([n_in, n_out, edge], **kwargs) else: e_ij = self.lay_concat([n_in, n_out], **kwargs) a_ij = self.lay_alpha_activation(e_ij, **kwargs) a_ij = self.lay_alpha(a_ij, **kwargs) h_i = self.lay_pool_attention([node, wn_out, a_ij, edge_index], **kwargs) if self.use_final_activation: h_i = self.lay_final_activ(h_i, **kwargs) return h_i def get_config(self): """Update layer config.""" config = super(AttentionHeadGATV2, self).get_config() config.update({"use_edge_features": self.use_edge_features, "use_bias": self.use_bias, "units": self.units, "has_self_loops": self.has_self_loops, "use_final_activation": self.use_final_activation}) conf_sub = self.lay_alpha_activation.get_config() for x in ["kernel_regularizer", "activity_regularizer", "bias_regularizer", "kernel_constraint", "bias_constraint", "kernel_initializer", "bias_initializer", "activation"]: config.update({x: conf_sub[x]}) return config @tf.keras.utils.register_keras_serializable(package='kgcnn', name='AttentiveHeadFP') class AttentiveHeadFP(GraphBaseLayer): r"""Computes the attention head for `Attentive FP <https://doi.org/10.1021/acs.jmedchem.9b00959>`_ model. The attention coefficients are computed by :math:`a_{ij} = \sigma_1( W_1 [h_i || h_j] )`. The initial representation :math:`h_i` and :math:`h_j` must be calculated beforehand. The attention is obtained by :math:`\alpha_{ij} = \text{softmax}_j (a_{ij})`. And finally pooled for context :math:`C_i = \sigma_2(\sum_j \alpha_{ij} W_2 h_j)`. An edge is defined by index tuple :math:`(i, j)` with the direction of the connection from :math:`j` to :math:`i`. Args: units (int): Units for the linear trafo of node features before attention. use_edge_features (bool): Append edge features to attention computation. Default is False. activation (str): Activation. Default is {"class_name": "kgcnn>leaky_relu", "config": {"alpha": 0.2}}. activation_context (str): Activation function for context. Default is "elu". use_bias (bool): Use bias. Default is True. kernel_regularizer: Kernel regularization. Default is None. bias_regularizer: Bias regularization. Default is None. activity_regularizer: Activity regularization. Default is None. kernel_constraint: Kernel constrains. Default is None. bias_constraint: Bias constrains. Default is None. kernel_initializer: Initializer for kernels. Default is 'glorot_uniform'. bias_initializer: Initializer for bias. Default is 'zeros'. """ def __init__(self, units, use_edge_features=False, activation='kgcnn>leaky_relu', activation_context="elu", use_bias=True, kernel_regularizer=None, bias_regularizer=None, activity_regularizer=None, kernel_constraint=None, bias_constraint=None, kernel_initializer='glorot_uniform', bias_initializer='zeros', **kwargs): """Initialize layer.""" super(AttentiveHeadFP, self).__init__(**kwargs) self.use_edge_features = use_edge_features self.units = int(units) self.use_bias = use_bias kernel_args = {"kernel_regularizer": kernel_regularizer, "activity_regularizer": activity_regularizer, "bias_regularizer": bias_regularizer, "kernel_constraint": kernel_constraint, "bias_constraint": bias_constraint, "kernel_initializer": kernel_initializer, "bias_initializer": bias_initializer} self.lay_linear_trafo = DenseEmbedding(units, activation="linear", use_bias=use_bias, **kernel_args) self.lay_alpha_activation = DenseEmbedding(units, activation=activation, use_bias=use_bias, **kernel_args) self.lay_alpha = DenseEmbedding(1, activation="linear", use_bias=False, **kernel_args) self.lay_gather_in = GatherNodesIngoing() self.lay_gather_out = GatherNodesOutgoing() self.lay_concat = LazyConcatenate(axis=-1) self.lay_pool_attention = PoolingLocalEdgesAttention() self.lay_final_activ = ActivationEmbedding(activation=activation_context) if use_edge_features: self.lay_fc1 = DenseEmbedding(units, activation=activation, use_bias=use_bias, **kernel_args) self.lay_fc2 = DenseEmbedding(units, activation=activation, use_bias=use_bias, **kernel_args) self.lay_concat_edge = LazyConcatenate(axis=-1) def build(self, input_shape): """Build layer.""" super(AttentiveHeadFP, self).build(input_shape) def call(self, inputs, **kwargs): """Forward pass. Args: inputs (list): of [node, edges, edge_indices] - nodes (tf.RaggedTensor): Node embeddings of shape (batch, [N], F) - edges (tf.RaggedTensor): Edge or message embeddings of shape (batch, [M], F) - edge_indices (tf.RaggedTensor): Edge indices referring to nodes of shape (batch, [M], 2) Returns: tf.RaggedTensor: Hidden tensor of pooled edge attentions for each node. """ node, edge, edge_index = inputs if self.use_edge_features: n_in = self.lay_gather_in([node, edge_index], **kwargs) n_out = self.lay_gather_out([node, edge_index], **kwargs) n_in = self.lay_fc1(n_in, **kwargs) n_out = self.lay_concat_edge([n_out, edge], **kwargs) n_out = self.lay_fc2(n_out, **kwargs) else: n_in = self.lay_gather_in([node, edge_index], **kwargs) n_out = self.lay_gather_out([node, edge_index], **kwargs) wn_out = self.lay_linear_trafo(n_out, **kwargs) e_ij = self.lay_concat([n_in, n_out], **kwargs) e_ij = self.lay_alpha_activation(e_ij, **kwargs) # Maybe uses GAT original definition. # a_ij = e_ij a_ij = self.lay_alpha(e_ij, **kwargs) # Should be dimension (batch,None,1) not fully clear in original paper. n_i = self.lay_pool_attention([node, wn_out, a_ij, edge_index], **kwargs) out = self.lay_final_activ(n_i, **kwargs) return out def get_config(self): """Update layer config.""" config = super(AttentiveHeadFP, self).get_config() config.update({"use_edge_features": self.use_edge_features, "use_bias": self.use_bias, "units": self.units}) conf_sub = self.lay_alpha_activation.get_config() for x in ["kernel_regularizer", "activity_regularizer", "bias_regularizer", "kernel_constraint", "bias_constraint", "kernel_initializer", "bias_initializer", "activation"]: config.update({x: conf_sub[x]}) conf_context = self.lay_final_activ.get_config() config.update({"activation_context": conf_context["activation"]}) return config @tf.keras.utils.register_keras_serializable(package='kgcnn', name='PoolingNodesAttentive') class PoolingNodesAttentive(GraphBaseLayer): r"""Computes the attentive pooling for node embeddings for `Attentive FP <https://doi.org/10.1021/acs.jmedchem.9b00959>`_ model. Args: units (int): Units for the linear trafo of node features before attention. pooling_method(str): Initial pooling before iteration. Default is "sum". depth (int): Number of iterations for graph embedding. Default is 3. activation (str): Activation. Default is {"class_name": "kgcnn>leaky_relu", "config": {"alpha": 0.2}}. activation_context (str): Activation function for context. Default is "elu". use_bias (bool): Use bias. Default is True. kernel_regularizer: Kernel regularization. Default is None. bias_regularizer: Bias regularization. Default is None. activity_regularizer: Activity regularization. Default is None. kernel_constraint: Kernel constrains. Default is None. bias_constraint: Bias constrains. Default is None. kernel_initializer: Initializer for kernels. Default is 'glorot_uniform'. bias_initializer: Initializer for bias. Default is 'zeros'. """ def __init__(self, units, depth=3, pooling_method="sum", activation='kgcnn>leaky_relu', activation_context="elu", use_bias=True, kernel_regularizer=None, bias_regularizer=None, activity_regularizer=None, kernel_constraint=None, bias_constraint=None, kernel_initializer='glorot_uniform', bias_initializer='zeros', recurrent_activation='sigmoid', recurrent_initializer='orthogonal', recurrent_regularizer=None, recurrent_constraint=None, dropout=0.0, recurrent_dropout=0.0, reset_after=True, **kwargs): """Initialize layer.""" super(PoolingNodesAttentive, self).__init__(**kwargs) self.pooling_method = pooling_method self.depth = depth self.units = int(units) kernel_args = {"use_bias": use_bias, "kernel_regularizer": kernel_regularizer, "activity_regularizer": activity_regularizer, "bias_regularizer": bias_regularizer, "kernel_constraint": kernel_constraint, "bias_constraint": bias_constraint, "kernel_initializer": kernel_initializer, "bias_initializer": bias_initializer} gru_args = {"recurrent_activation": recurrent_activation, "use_bias": use_bias, "kernel_initializer": kernel_initializer, "recurrent_initializer": recurrent_initializer, "bias_initializer": bias_initializer, "kernel_regularizer": kernel_regularizer, "recurrent_regularizer": recurrent_regularizer, "bias_regularizer": bias_regularizer, "kernel_constraint": kernel_constraint, "recurrent_constraint": recurrent_constraint, "bias_constraint": bias_constraint, "dropout": dropout, "recurrent_dropout": recurrent_dropout, "reset_after": reset_after} self.lay_linear_trafo = DenseEmbedding(units, activation="linear", **kernel_args) self.lay_alpha = DenseEmbedding(1, activation=activation, **kernel_args) self.lay_gather_s = GatherState() self.lay_concat = LazyConcatenate(axis=-1) self.lay_pool_start = PoolingNodes(pooling_method=self.pooling_method) self.lay_pool_attention = PoolingNodesAttention() self.lay_final_activ = ActivationEmbedding(activation=activation_context) self.lay_gru = tf.keras.layers.GRUCell(units=units, activation="tanh", **gru_args) def build(self, input_shape): """Build layer.""" super(PoolingNodesAttentive, self).build(input_shape) def call(self, inputs, **kwargs): """Forward pass. Args: inputs: nodes - nodes (tf.RaggedTensor): Node features of shape (batch, [N], F) Returns: tf.Tensor: Hidden tensor of pooled node attentions of shape (batch, F). """ node = inputs h = self.lay_pool_start(node, **kwargs) wn = self.lay_linear_trafo(node, **kwargs) for _ in range(self.depth): hv = self.lay_gather_s([h, node], **kwargs) ev = self.lay_concat([hv, node], **kwargs) av = self.lay_alpha(ev, **kwargs) cont = self.lay_pool_attention([wn, av], **kwargs) cont = self.lay_final_activ(cont, **kwargs) h, _ = self.lay_gru(cont, h, **kwargs) out = h return out def get_config(self): """Update layer config.""" config = super(PoolingNodesAttentive, self).get_config() config.update({"units": self.units, "depth": self.depth, "pooling_method": self.pooling_method}) conf_sub = self.lay_alpha.get_config() for x in ["kernel_regularizer", "activity_regularizer", "bias_regularizer", "kernel_constraint", "bias_constraint", "kernel_initializer", "bias_initializer", "activation", "use_bias"]: config.update({x: conf_sub[x]}) conf_context = self.lay_final_activ.get_config() config.update({"activation_context": conf_context["activation"]}) conf_gru = self.lay_gru.get_config() for x in ["recurrent_activation", "recurrent_initializer", "recurrent_regularizer", "recurrent_constraint", "dropout", "recurrent_dropout", "reset_after"]: config.update({x: conf_gru[x]}) return config
52.18872
118
0.648614
2,837
24,059
5.24392
0.085301
0.037642
0.022182
0.021779
0.838274
0.807824
0.796733
0.793103
0.771661
0.74874
0
0.00464
0.247475
24,059
460
119
52.302174
0.817067
0.320088
0
0.672662
0
0
0.120594
0.006693
0
0
0
0
0
1
0.057554
false
0
0.021583
0
0.122302
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
cf1cf7524a2c06bc22de20e8dfef11835b0184e6
68
py
Python
app/handlers/private/__init__.py
s-klimov/meal_bo
f74898c179a8551c8ec8df147aabc659496c610e
[ "MIT" ]
1
2022-02-20T06:16:01.000Z
2022-02-20T06:16:01.000Z
app/handlers/private/__init__.py
s-klimov/meal_bot
f74898c179a8551c8ec8df147aabc659496c610e
[ "MIT" ]
null
null
null
app/handlers/private/__init__.py
s-klimov/meal_bot
f74898c179a8551c8ec8df147aabc659496c610e
[ "MIT" ]
null
null
null
from .start import * from .mealtime import * from .barcode import *
17
23
0.735294
9
68
5.555556
0.555556
0.4
0
0
0
0
0
0
0
0
0
0
0.176471
68
3
24
22.666667
0.892857
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
d859b67e8cfb846781768f9c494950d50174353a
184
py
Python
src/onevision/cv/imgproc/shape/__init__.py
phlong3105/onevision
90552b64df7213e7fbe23c80ffd8a89583289433
[ "MIT" ]
2
2022-03-28T09:46:38.000Z
2022-03-28T14:12:32.000Z
src/onevision/cv/imgproc/shape/__init__.py
phlong3105/onevision
90552b64df7213e7fbe23c80ffd8a89583289433
[ "MIT" ]
null
null
null
src/onevision/cv/imgproc/shape/__init__.py
phlong3105/onevision
90552b64df7213e7fbe23c80ffd8a89583289433
[ "MIT" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- """ """ from __future__ import annotations from .anchor import * from .box import * from .box_convert import * from .distance import *
14.153846
34
0.673913
24
184
4.958333
0.625
0.252101
0.218487
0
0
0
0
0
0
0
0
0.006579
0.173913
184
12
35
15.333333
0.776316
0.228261
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
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
d872bbaefeeb88ae8d049c5721e279ae29a15333
41
py
Python
droput_authentication/droput_auth/controller/__init__.py
hosein-yousefii/DROPUT
99a714f03a92b14228a3691ca6568ece0f0ea48c
[ "Apache-2.0" ]
2
2022-03-17T08:08:07.000Z
2022-03-17T21:38:54.000Z
droput_authentication/droput_auth/controller/__init__.py
hosein-yousefii/DROPUT
99a714f03a92b14228a3691ca6568ece0f0ea48c
[ "Apache-2.0" ]
null
null
null
droput_authentication/droput_auth/controller/__init__.py
hosein-yousefii/DROPUT
99a714f03a92b14228a3691ca6568ece0f0ea48c
[ "Apache-2.0" ]
null
null
null
from droput_auth.controller import apiv1
20.5
40
0.878049
6
41
5.833333
1
0
0
0
0
0
0
0
0
0
0
0.027027
0.097561
41
1
41
41
0.918919
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
d8c4a22d18eb603fa4043bdddf331105c53a55b7
14,667
py
Python
chupacabra_server/app/tests/tic_tac_toe/test_tic_tac_toe.py
lopez86/chupacabra
4f40eb770b57bfc01b68013b24c523d7056e4f5b
[ "MIT" ]
null
null
null
chupacabra_server/app/tests/tic_tac_toe/test_tic_tac_toe.py
lopez86/chupacabra
4f40eb770b57bfc01b68013b24c523d7056e4f5b
[ "MIT" ]
null
null
null
chupacabra_server/app/tests/tic_tac_toe/test_tic_tac_toe.py
lopez86/chupacabra
4f40eb770b57bfc01b68013b24c523d7056e4f5b
[ "MIT" ]
null
null
null
import unittest import arrow from chupacabra_client.protos.game_structs_pb2 import ( Coordinate, Coordinates, GamePieceMove, Move, PlayerInfo ) import numpy as np from tic_tac_toe import tic_tac_toe_game class TestTicTacToeGame(unittest.TestCase): def test__init(self): with self.assertRaises(AssertionError): tic_tac_toe_game.TicTacToeInternalState('', [], [], 0, 0) with self.assertRaises(AssertionError): tic_tac_toe_game.TicTacToeInternalState( '1', [], [PlayerInfo(), PlayerInfo()], 0, 0 ) with self.assertRaises(AssertionError): tic_tac_toe_game.TicTacToeInternalState( '1', ['1', '2'], [], 0, 0 ) with self.assertRaises(AssertionError): tic_tac_toe_game.TicTacToeInternalState( '1', ['1', '2'], [PlayerInfo(), PlayerInfo()], 0, 0, board=[1, 2, 3] ) with self.assertRaises(AssertionError): tic_tac_toe_game.TicTacToeInternalState( '1', ['1', '2'], [PlayerInfo(), PlayerInfo()], 0, 0, board=np.zeros([3, 3], dtype=np.float32) ) with self.assertRaises(AssertionError): tic_tac_toe_game.TicTacToeInternalState( '1', ['1', '2'], [PlayerInfo(), PlayerInfo()], 0, 0, board=np.zeros([2, 2], dtype=np.int8) ) with self.assertRaises(AssertionError): tic_tac_toe_game.TicTacToeInternalState( '1', ['1', '2'], [PlayerInfo(), PlayerInfo()], 0, 0, mode='Illegal mode' ) with self.assertRaises(AssertionError): tic_tac_toe_game.TicTacToeInternalState( '1', ['1', '2'], [PlayerInfo(), PlayerInfo()], 0, 0, turn=2 ) state = tic_tac_toe_game.TicTacToeInternalState( '1', ['1', '2'], [PlayerInfo(), PlayerInfo()], 0, 0, turn=None, winner=1, board=np.zeros([3, 3], dtype=np.int8) ) self.assertEqual(1, state.winner) self.assertEqual(0, state.turn) def test_serialize_state(self): state = tic_tac_toe_game.TicTacToeInternalState( '1', ['1', '2'], [PlayerInfo(), PlayerInfo()], 5, 6, ) serialized = tic_tac_toe_game.serialize_state(state) deserialized = tic_tac_toe_game.deserialize_state(serialized) self.assertEqual('1', deserialized.id) self.assertEqual(['1', '2'], deserialized.player_ids) self.assertEqual(6, deserialized.game_expiration_time) self.assertEqual(5, deserialized.turn_expiration_time) def test__validate_game_state(self): expiration_time = arrow.utcnow().timestamp + 3600 players = [ PlayerInfo(username='player1'), PlayerInfo(username='player2') ] player_ids = ['1', '2'] state = tic_tac_toe_game.TicTacToeInternalState( 'a', player_ids, players, expiration_time, expiration_time, turn=0) validated, message = tic_tac_toe_game._validate_game_state(state, '1') self.assertTrue(validated) self.assertEqual('', message) state = tic_tac_toe_game.TicTacToeInternalState( 'a', player_ids, players, expiration_time, expiration_time, turn=0) validated, message = tic_tac_toe_game._validate_game_state(state, '2') self.assertFalse(validated) self.assertEqual(tic_tac_toe_game.CANNOT_MOVE_MESSAGE, message) state = tic_tac_toe_game.TicTacToeInternalState( 'a', player_ids, players, expiration_time, expiration_time, turn=0, mode=tic_tac_toe_game.FINISHED_MODE ) validated, message = tic_tac_toe_game._validate_game_state(state, '2') self.assertFalse(validated) self.assertEqual(tic_tac_toe_game.NOT_IN_PLAY_MODE_MESSAGE, message) def test__validate_and_extract_coordinates(self): # A good move move = Move( piece_moves=[ GamePieceMove( locations=[ Coordinates( values=[ Coordinate(name='x', value=0), Coordinate(name='y', value=1) ] ) ] ) ] ) coordinates, message = tic_tac_toe_game._validate_and_extract_coordinates(move) expected_coordinates = { 'x': 0, 'y': 1 } self.assertEqual(expected_coordinates, coordinates) self.assertEqual('', message) move = Move( piece_moves=[ GamePieceMove( locations=[ Coordinates( values=[ Coordinate(name='x', value=5), Coordinate(name='y', value=1) ] ) ] ) ] ) coordinates, message = tic_tac_toe_game._validate_and_extract_coordinates(move) self.assertEqual({}, coordinates) self.assertEqual(tic_tac_toe_game.ILLEGAL_MOVE_MESSAGE, message) move = Move( piece_moves=[ GamePieceMove( locations=[ Coordinates( values=[ Coordinate(name='x', value=0), ] ) ] ) ] ) coordinates, message = tic_tac_toe_game._validate_and_extract_coordinates(move) self.assertEqual({}, coordinates) self.assertEqual(tic_tac_toe_game.ILLEGAL_MOVE_MESSAGE, message) move = Move( piece_moves=[ GamePieceMove( locations=[ Coordinates( values=[ Coordinate(name='x', value=1), Coordinate(name='y', value=1), Coordinate(name='z', value=0) ] ) ] ) ] ) coordinates, message = tic_tac_toe_game._validate_and_extract_coordinates(move) self.assertEqual({}, coordinates) self.assertEqual(tic_tac_toe_game.ILLEGAL_MOVE_MESSAGE, message) move = Move( piece_moves=[ GamePieceMove( locations=[ Coordinates( values=[ Coordinate(name='x', value=5), Coordinate(name='z', value=1) ] ) ] ) ] ) coordinates, message = tic_tac_toe_game._validate_and_extract_coordinates(move) self.assertEqual({}, coordinates) self.assertEqual(tic_tac_toe_game.ILLEGAL_MOVE_MESSAGE, message) move = Move( piece_moves=[ GamePieceMove( locations=[ Coordinates( values=[ Coordinate(name='x', value=0), Coordinate(name='y', value=1) ] ), ] * 2 ) ] ) coordinates, message = tic_tac_toe_game._validate_and_extract_coordinates(move) self.assertEqual({}, coordinates) self.assertEqual(tic_tac_toe_game.ILLEGAL_MOVE_MESSAGE, message) move = Move( piece_moves=[ GamePieceMove( locations=[ Coordinates( values=[ Coordinate(name='x', value=0), Coordinate(name='y', value=1) ] ), ] ) ] * 2 ) coordinates, message = tic_tac_toe_game._validate_and_extract_coordinates(move) self.assertEqual({}, coordinates) self.assertEqual(tic_tac_toe_game.ILLEGAL_MOVE_MESSAGE, message) def test__check_for_game_over(self): board = np.array([[0, 0, 0], [0, 0, 0], [0, 0, 0]]) game_over, winner = tic_tac_toe_game._check_for_game_over(board) self.assertEqual(game_over, False) self.assertEqual(winner, -1) board = np.array([[1, -1, 1], [-1, 0, 1], [0, 0, -1]]) game_over, winner = tic_tac_toe_game._check_for_game_over(board) self.assertEqual(game_over, False) self.assertEqual(winner, -1) # Games with winners (may not necessarily be actual valid states) board = np.array([[1, 1, 1], [0, -1, 0], [-1, 0, -1]]) game_over, winner = tic_tac_toe_game._check_for_game_over(board) self.assertEqual(game_over, True) self.assertEqual(winner, 0) board = np.array([[0, 1, -1], [0, 1, 0], [-1, 1, 0]]) game_over, winner = tic_tac_toe_game._check_for_game_over(board) self.assertEqual(game_over, True) self.assertEqual(winner, 0) board = np.array([[0, -1, 0], [0, -1, 1], [1, -1, 0]]) game_over, winner = tic_tac_toe_game._check_for_game_over(board) self.assertEqual(game_over, True) self.assertEqual(winner, 1) board = np.array([[-1, 0, 1], [0, 1, 0], [1, -1, 0]]) game_over, winner = tic_tac_toe_game._check_for_game_over(board) self.assertEqual(game_over, True) self.assertEqual(winner, 0) # A tie board = np.array([[1, -1, 1], [1, -1, 1], [-1, 1, -1]]) game_over, winner = tic_tac_toe_game._check_for_game_over(board) self.assertEqual(game_over, True) self.assertEqual(winner, -1) def test_make_move(self): good_time = arrow.utcnow().timestamp + 3600 state = tic_tac_toe_game.TicTacToeInternalState( '1', ['1', '2'], [PlayerInfo(), PlayerInfo()], 0, 0, turn=0 ) move = Move( piece_moves=[ GamePieceMove( locations=[ Coordinates( values=[ Coordinate(name='x', value=0), Coordinate(name='y', value=0) ] ), ] ) ] ) result = tic_tac_toe_game.make_move( state, move, '3' ) self.assertEqual((tic_tac_toe_game.CANNOT_MOVE_MESSAGE, None), result) result = tic_tac_toe_game.make_move( state, move, '1' ) self.assertEqual(np.sum(state.board), np.sum(result[1].board)) self.assertEqual(tic_tac_toe_game.FINISHED_MODE, result[1].mode) # Good turn time, bad game time state = tic_tac_toe_game.TicTacToeInternalState( '1', ['1', '2'], [PlayerInfo(), PlayerInfo()], good_time, 0, turn=0 ) result = tic_tac_toe_game.make_move( state, move, '1' ) self.assertEqual(np.sum(state.board), np.sum(result[1].board)) self.assertEqual(tic_tac_toe_game.FINISHED_MODE, result[1].mode) state = tic_tac_toe_game.TicTacToeInternalState( '1', ['1', '2'], [PlayerInfo(), PlayerInfo()], good_time, good_time, turn=0 ) message, new_state = tic_tac_toe_game.make_move( state, move, '1' ) self.assertEqual( 0, np.sum( np.array( [[1, 0, 0], [0, 0, 0], [0, 0, 0]], dtype=np.int8 ) - new_state.board ) ) bad_move = Move( piece_moves=[ GamePieceMove( locations=[ Coordinates( values=[ Coordinate(name='x', value=0), Coordinate(name='z', value=0) ] ), ] ) ] ) _, new_state = tic_tac_toe_game.make_move( state, bad_move, '1' ) self.assertIsNone(new_state) state = tic_tac_toe_game.TicTacToeInternalState( '1', ['1', '2'], [PlayerInfo(), PlayerInfo()], good_time, good_time, turn=0, board=np.array( [[1, 0, 0], [0, 0, 0], [0, 0, 0]], dtype=np.int8 ) ) _, new_state = tic_tac_toe_game.make_move( state, move, '1' ) self.assertIsNone(new_state) state = tic_tac_toe_game.TicTacToeInternalState( '1', ['1', '2'], [PlayerInfo(), PlayerInfo()], good_time, good_time, turn=0, board=np.array( [[0, 1, 1], [0, 0, 0], [0, 0, 0]], dtype=np.int8 ) ) _, new_state = tic_tac_toe_game.make_move( state, move, '1' ) self.assertEqual(tic_tac_toe_game.FINISHED_MODE, new_state.mode) self.assertEqual(0, new_state.winner)
32.024017
87
0.462262
1,323
14,667
4.852608
0.0839
0.05514
0.08271
0.117445
0.819782
0.803738
0.797196
0.788941
0.778037
0.752336
0
0.029483
0.43574
14,667
457
88
32.094092
0.746254
0.007568
0
0.627737
0
0
0.007147
0
0
0
0
0
0.141119
1
0.014599
false
0
0.012165
0
0.029197
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
d8ee37f6824e7aeda4d362ee6e6415e7389842a6
158
py
Python
misago/users/serializers/__init__.py
HenryChenV/iJiangNan
68f156d264014939f0302222e16e3125119dd3e3
[ "MIT" ]
1
2017-07-25T03:04:36.000Z
2017-07-25T03:04:36.000Z
misago/users/serializers/__init__.py
HenryChenV/iJiangNan
68f156d264014939f0302222e16e3125119dd3e3
[ "MIT" ]
null
null
null
misago/users/serializers/__init__.py
HenryChenV/iJiangNan
68f156d264014939f0302222e16e3125119dd3e3
[ "MIT" ]
null
null
null
from .ban import * from .moderation import * from .options import * from .rank import * from .user import * from .auth import * from .usernamechange import *
19.75
29
0.734177
21
158
5.52381
0.428571
0.517241
0
0
0
0
0
0
0
0
0
0
0.177215
158
7
30
22.571429
0.892308
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
2b3ab9ed13c04ed37dd0536218b0e4f13cb3cea3
544
py
Python
utils.py
taufikxu/Tools
ca693967197cf64444c39064b5db9fa5911676e0
[ "MIT" ]
2
2020-07-07T01:39:42.000Z
2021-09-06T03:46:05.000Z
utils.py
taufikxu/Tools
ca693967197cf64444c39064b5db9fa5911676e0
[ "MIT" ]
null
null
null
utils.py
taufikxu/Tools
ca693967197cf64444c39064b5db9fa5911676e0
[ "MIT" ]
null
null
null
import sys from tqdm import tqdm from tqdm import trange def xrange(iters, prefix=None, Epoch=None, **kwargs): if Epoch is not None and prefix is None: prefix = "Epoch " + str(Epoch) return trange(int(iters), file=sys.stdout, leave=False, dynamic_ncols=True, desc=prefix, **kwargs) def range_iterator(iters, prefix=None, Epoch=None, **kwargs): if Epoch is not None and prefix is None: prefix = "Epoch " + str(Epoch) return tqdm(iters, file=sys.stdout, leave=False, dynamic_ncols=True, desc=prefix, **kwargs)
34
102
0.698529
82
544
4.597561
0.353659
0.04244
0.074271
0.106101
0.774536
0.774536
0.774536
0.774536
0.774536
0.774536
0
0
0.183824
544
15
103
36.266667
0.849099
0
0
0.363636
0
0
0.022059
0
0
0
0
0
0
1
0.181818
false
0
0.272727
0
0.636364
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
2b5de1b4dcab807ff21112a0ea3a32773b16d82c
54
py
Python
imagespawner/__init__.py
accre/jupyter-imagespawner
ecc18455b2475b095f649e4a3cd057785c3a04da
[ "BSD-3-Clause" ]
null
null
null
imagespawner/__init__.py
accre/jupyter-imagespawner
ecc18455b2475b095f649e4a3cd057785c3a04da
[ "BSD-3-Clause" ]
null
null
null
imagespawner/__init__.py
accre/jupyter-imagespawner
ecc18455b2475b095f649e4a3cd057785c3a04da
[ "BSD-3-Clause" ]
null
null
null
from .imagespawner import MarathonImageChooserSpawner
27
53
0.907407
4
54
12.25
1
0
0
0
0
0
0
0
0
0
0
0
0.074074
54
1
54
54
0.98
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
2b66f458102e8fefe058c40d80dc33c21875168c
86
py
Python
src/data/__init__.py
salosyatov/football_stat
a8cb68cd648f65f8dbb383b8795cbd8b0dbac5d3
[ "FTL" ]
null
null
null
src/data/__init__.py
salosyatov/football_stat
a8cb68cd648f65f8dbb383b8795cbd8b0dbac5d3
[ "FTL" ]
null
null
null
src/data/__init__.py
salosyatov/football_stat
a8cb68cd648f65f8dbb383b8795cbd8b0dbac5d3
[ "FTL" ]
null
null
null
from .cache_images import cache_images from .make_dataset import split_train_val_data
28.666667
46
0.883721
14
86
5
0.714286
0.314286
0
0
0
0
0
0
0
0
0
0
0.093023
86
2
47
43
0.897436
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
99431f67fba8398ed31ef7a279c692ddc14e1c3a
18
py
Python
models/__init__.py
x-zho14/VisionPermutator
e825c8aecb277cad71e9b23a58b0d565b3ac78eb
[ "MIT" ]
142
2021-06-23T15:11:11.000Z
2022-03-27T13:26:49.000Z
models/__init__.py
x-zho14/VisionPermutator
e825c8aecb277cad71e9b23a58b0d565b3ac78eb
[ "MIT" ]
7
2021-07-20T03:32:59.000Z
2021-11-18T07:40:46.000Z
models/__init__.py
x-zho14/VisionPermutator
e825c8aecb277cad71e9b23a58b0d565b3ac78eb
[ "MIT" ]
20
2021-06-25T03:09:02.000Z
2022-02-14T06:51:26.000Z
from .vip import *
18
18
0.722222
3
18
4.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.166667
18
1
18
18
0.866667
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
996355fa8cf9215c4f2b68e4cd7bcb6beddc27ad
139
py
Python
library/lib_study/145_frameworks_shlex.py
gottaegbert/penter
8cbb6be3c4bf67c7c69fa70e597bfbc3be4f0a2d
[ "MIT" ]
13
2020-01-04T07:37:38.000Z
2021-08-31T05:19:58.000Z
library/lib_study/145_frameworks_shlex.py
gottaegbert/penter
8cbb6be3c4bf67c7c69fa70e597bfbc3be4f0a2d
[ "MIT" ]
3
2020-06-05T22:42:53.000Z
2020-08-24T07:18:54.000Z
library/lib_study/145_frameworks_shlex.py
gottaegbert/penter
8cbb6be3c4bf67c7c69fa70e597bfbc3be4f0a2d
[ "MIT" ]
9
2020-10-19T04:53:06.000Z
2021-08-31T05:20:01.000Z
import shlex # 3.8 print(shlex.join(['echo', '-n', 'Multiple words'])) import shlex, subprocess subprocess.Popen(shlex.split('ls -l /'))
19.857143
57
0.676259
20
139
4.7
0.75
0.234043
0
0
0
0
0
0
0
0
0
0.01626
0.115108
139
6
58
23.166667
0.747967
0.395683
0
0
0
0
0.08642
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
9990944ee57b4da1272372e46210ae6fc3dac7d4
42
py
Python
models/__init__.py
Lanping-Tech/Enhanced-VIT
90a0516f3b6f926d758f1f72b09ab20b60f722ea
[ "Apache-2.0" ]
null
null
null
models/__init__.py
Lanping-Tech/Enhanced-VIT
90a0516f3b6f926d758f1f72b09ab20b60f722ea
[ "Apache-2.0" ]
null
null
null
models/__init__.py
Lanping-Tech/Enhanced-VIT
90a0516f3b6f926d758f1f72b09ab20b60f722ea
[ "Apache-2.0" ]
null
null
null
from .vit import ViT from .resvit import *
21
21
0.761905
7
42
4.571429
0.571429
0
0
0
0
0
0
0
0
0
0
0
0.166667
42
2
21
21
0.914286
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
99935a5d4f968a4b441568350faddf9c099b7f5d
49
py
Python
ddf_utils/model/__init__.py
semio/ddf_utils
e10c4cb6dc7722415a5863579a552cc7b7e3668d
[ "MIT" ]
2
2016-11-23T12:28:15.000Z
2019-03-04T16:06:25.000Z
ddf_utils/model/__init__.py
semio/ddf_utils
e10c4cb6dc7722415a5863579a552cc7b7e3668d
[ "MIT" ]
124
2016-07-14T13:39:41.000Z
2021-12-24T01:45:23.000Z
ddf_utils/model/__init__.py
semio/ddf_utils
e10c4cb6dc7722415a5863579a552cc7b7e3668d
[ "MIT" ]
1
2016-11-30T23:42:56.000Z
2016-11-30T23:42:56.000Z
from .ddf import DDF from .package import DDFcsv
16.333333
27
0.795918
8
49
4.875
0.625
0
0
0
0
0
0
0
0
0
0
0
0.163265
49
2
28
24.5
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
99a63fa91495ded0ecb4bc0dbc8e92070b4ea199
105
py
Python
components/zerodop/GPUgeo2rdr/__init__.py
vincentschut/isce2
1557a05b7b6a3e65abcfc32f89c982ccc9b65e3c
[ "ECL-2.0", "Apache-2.0" ]
1,133
2022-01-07T21:24:57.000Z
2022-01-07T21:33:08.000Z
components/zerodop/GPUgeo2rdr/__init__.py
vincentschut/isce2
1557a05b7b6a3e65abcfc32f89c982ccc9b65e3c
[ "ECL-2.0", "Apache-2.0" ]
276
2019-02-10T07:18:28.000Z
2022-03-31T21:45:55.000Z
components/zerodop/GPUgeo2rdr/__init__.py
vincentschut/isce2
1557a05b7b6a3e65abcfc32f89c982ccc9b65e3c
[ "ECL-2.0", "Apache-2.0" ]
235
2019-02-10T05:00:53.000Z
2022-03-18T07:37:24.000Z
#!/usr/bin/env python def createGeo2rdr(): from .GPUgeo2rdr import PyGeo2rdr return PyGeo2rdr()
17.5
37
0.714286
12
105
6.25
0.916667
0
0
0
0
0
0
0
0
0
0
0.046512
0.180952
105
5
38
21
0.825581
0.190476
0
0
0
0
0
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
41d7e9d736891a3dfc9a495779130c14ae930706
38
py
Python
convnet_web/handlers/__init__.py
tech-team/convnet
ee401c29349e163a95a868304e120de215158e37
[ "MIT" ]
null
null
null
convnet_web/handlers/__init__.py
tech-team/convnet
ee401c29349e163a95a868304e120de215158e37
[ "MIT" ]
null
null
null
convnet_web/handlers/__init__.py
tech-team/convnet
ee401c29349e163a95a868304e120de215158e37
[ "MIT" ]
null
null
null
from pages import * from api import *
12.666667
19
0.736842
6
38
4.666667
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.210526
38
2
20
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
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
41dfb215c38c25ef73e517eea3417e70e53c95a4
61
py
Python
alento_bot/core_module/core_cog/__init__.py
alentoghostflame/StupidAlentoBot
c024bfb79a9ecb0d9fda5ddc4e361a0cb878baba
[ "MIT" ]
1
2021-12-12T02:50:20.000Z
2021-12-12T02:50:20.000Z
alento_bot/core_module/core_cog/__init__.py
alentoghostflame/StupidAlentoBot
c024bfb79a9ecb0d9fda5ddc4e361a0cb878baba
[ "MIT" ]
17
2020-02-07T23:40:36.000Z
2020-12-22T16:38:44.000Z
alento_bot/core_module/core_cog/__init__.py
alentoghostflame/StupidAlentoBot
c024bfb79a9ecb0d9fda5ddc4e361a0cb878baba
[ "MIT" ]
null
null
null
from alento_bot.core_module.core_cog.core_cog import CoreCog
30.5
60
0.885246
11
61
4.545455
0.727273
0.28
0
0
0
0
0
0
0
0
0
0
0.065574
61
1
61
61
0.877193
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
41fc02c2426cd4aba597ba25b93495425c31f5e6
43
py
Python
adlib/utils/validation.py
xyvivian/adlib
79a93baa8aa542080bbf55734168eb89317df83c
[ "MIT" ]
null
null
null
adlib/utils/validation.py
xyvivian/adlib
79a93baa8aa542080bbf55734168eb89317df83c
[ "MIT" ]
null
null
null
adlib/utils/validation.py
xyvivian/adlib
79a93baa8aa542080bbf55734168eb89317df83c
[ "MIT" ]
null
null
null
from typing import List import numpy as np
14.333333
23
0.813953
8
43
4.375
0.875
0
0
0
0
0
0
0
0
0
0
0
0.186047
43
2
24
21.5
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
513898b33cf50a40d2d3ced0cf4b02f0098f184c
42
py
Python
beauty_bot/database_management/__init__.py
blue945u/beauty_bot
ddf56cd759b0b838d602dcb3c6a5c83df19eb3c0
[ "MIT" ]
null
null
null
beauty_bot/database_management/__init__.py
blue945u/beauty_bot
ddf56cd759b0b838d602dcb3c6a5c83df19eb3c0
[ "MIT" ]
null
null
null
beauty_bot/database_management/__init__.py
blue945u/beauty_bot
ddf56cd759b0b838d602dcb3c6a5c83df19eb3c0
[ "MIT" ]
null
null
null
from .data_base_tool import PixnetDatabase
42
42
0.904762
6
42
6
1
0
0
0
0
0
0
0
0
0
0
0
0.071429
42
1
42
42
0.923077
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
515f7ff6e17f2e79e6202817e2bae7bf78e7a9c6
126
py
Python
Pacotes/pacote_v1.py
VictorMello1993/CursoPythonUdemy
d3e2e542a7c3d3f9635f2b88d0e75ab4fa84236d
[ "MIT" ]
null
null
null
Pacotes/pacote_v1.py
VictorMello1993/CursoPythonUdemy
d3e2e542a7c3d3f9635f2b88d0e75ab4fa84236d
[ "MIT" ]
4
2021-04-08T21:54:09.000Z
2022-02-10T14:35:13.000Z
Pacotes/pacote_v1.py
VictorMello1993/CursoPythonUdemy
d3e2e542a7c3d3f9635f2b88d0e75ab4fa84236d
[ "MIT" ]
null
null
null
# Importando um módulo criado no pacote 'pacote1' from pacote1 import modulo1 print(type(modulo1)) print(modulo1.soma(2, 3))
25.2
49
0.769841
19
126
5.105263
0.789474
0.247423
0
0
0
0
0
0
0
0
0
0.063636
0.126984
126
5
50
25.2
0.818182
0.373016
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
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
1
0
1
0
0
1
0
6
5a9eaf81b1ea47c9f768b4adbb931a0ee4b90e1d
27,326
py
Python
tests/open_alchemy/schemas/artifacts/property_/test_relationship.py
MihailMiller/OpenAlchemy
55b751c58ca50706ebc46262f50addb7dec34278
[ "Apache-2.0" ]
40
2019-11-05T06:50:35.000Z
2022-03-09T01:34:57.000Z
tests/open_alchemy/schemas/artifacts/property_/test_relationship.py
MihailMiller/OpenAlchemy
55b751c58ca50706ebc46262f50addb7dec34278
[ "Apache-2.0" ]
178
2019-11-03T04:10:38.000Z
2022-03-31T00:07:17.000Z
tests/open_alchemy/schemas/artifacts/property_/test_relationship.py
MihailMiller/OpenAlchemy
55b751c58ca50706ebc46262f50addb7dec34278
[ "Apache-2.0" ]
17
2019-11-04T07:22:46.000Z
2022-03-23T05:29:49.000Z
"""Tests for retrieving artifacts for a relationship property.""" import functools import pytest from open_alchemy import types from open_alchemy.schemas import artifacts GET_TESTS = [ pytest.param( True, {"$ref": "#/components/schemas/RefSchema"}, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "required", True, artifacts.types.ManyToOneRelationshipPropertyArtifacts, id="required True", ), pytest.param( False, {"$ref": "#/components/schemas/RefSchema"}, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "required", False, artifacts.types.ManyToOneRelationshipPropertyArtifacts, id="required False", ), pytest.param( None, {"$ref": "#/components/schemas/RefSchema"}, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "type", types.PropertyType.RELATIONSHIP, artifacts.types.ManyToOneRelationshipPropertyArtifacts, id="property type", ), pytest.param( None, {"$ref": "#/components/schemas/RefSchema"}, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "sub_type", types.RelationshipType.MANY_TO_ONE, artifacts.types.ManyToOneRelationshipPropertyArtifacts, id="sub type many-to-one", ), pytest.param( None, {"$ref": "#/components/schemas/RefSchema"}, { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "x-uselist": False, } }, "sub_type", types.RelationshipType.ONE_TO_ONE, artifacts.types.OneToOneRelationshipPropertyArtifacts, id="sub type one-to-one", ), pytest.param( None, {"type": "array", "items": {"$ref": "#/components/schemas/RefSchema"}}, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "sub_type", types.RelationshipType.ONE_TO_MANY, artifacts.types.OneToManyRelationshipPropertyArtifacts, id="sub type one-to-many", ), pytest.param( None, {"type": "array", "items": {"$ref": "#/components/schemas/RefSchema"}}, { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "x-secondary": "secondary_1", } }, "sub_type", types.RelationshipType.MANY_TO_MANY, artifacts.types.ManyToManyRelationshipPropertyArtifacts, id="sub type many-to-many", ), pytest.param( None, {"$ref": "#/components/schemas/RefSchema"}, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "parent", "RefSchema", artifacts.types.ManyToOneRelationshipPropertyArtifacts, id="parent many-to-one", ), pytest.param( None, {"$ref": "#/components/schemas/RefSchema"}, { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "x-uselist": False, } }, "parent", "RefSchema", artifacts.types.OneToOneRelationshipPropertyArtifacts, id="parent one-to-one", ), pytest.param( None, {"type": "array", "items": {"$ref": "#/components/schemas/RefSchema"}}, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "parent", "RefSchema", artifacts.types.OneToManyRelationshipPropertyArtifacts, id="parent one-to-many", ), pytest.param( None, {"type": "array", "items": {"$ref": "#/components/schemas/RefSchema"}}, { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "x-secondary": "secondary_1", } }, "parent", "RefSchema", artifacts.types.ManyToManyRelationshipPropertyArtifacts, id="parent many-to-many", ), pytest.param( None, {"$ref": "#/components/schemas/RefSchema"}, { "RefSchema": { "type": "array", "items": {"$ref": "#/components/schemas/RefRefSchema"}, }, "RefRefSchema": {"type": "object"}, }, "parent", "RefRefSchema", artifacts.types.OneToManyRelationshipPropertyArtifacts, id="$ref items one-to-many", ), pytest.param( None, { "allOf": [ {"type": "array", "items": {"$ref": "#/components/schemas/RefSchema"}} ] }, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "parent", "RefSchema", artifacts.types.OneToManyRelationshipPropertyArtifacts, id="allOf items one-to-many", ), pytest.param( None, {"$ref": "#/components/schemas/RefSchema"}, { "RefSchema": { "type": "array", "items": {"$ref": "#/components/schemas/RefRefSchema"}, }, "RefRefSchema": {"type": "object", "x-secondary": "secondary_1"}, }, "parent", "RefRefSchema", artifacts.types.ManyToManyRelationshipPropertyArtifacts, id="$ref items one-to-many", ), pytest.param( None, { "allOf": [ {"type": "array", "items": {"$ref": "#/components/schemas/RefSchema"}} ] }, { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "x-secondary": "secondary_1", } }, "parent", "RefSchema", artifacts.types.ManyToManyRelationshipPropertyArtifacts, id="allOf items one-to-many", ), pytest.param( None, {"$ref": "#/components/schemas/RefSchema"}, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "schema", {"type": "object", "x-de-$ref": "RefSchema"}, artifacts.types.ManyToOneRelationshipPropertyArtifacts, id="schema many-to-one", ), pytest.param( None, { "allOf": [ {"$ref": "#/components/schemas/RefSchema"}, {"description": "description 1"}, ] }, { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "description": "description 2", } }, "schema", {"type": "object", "x-de-$ref": "RefSchema", "description": "description 1"}, artifacts.types.ManyToOneRelationshipPropertyArtifacts, id="schema description prefer local many-to-one", ), pytest.param( None, {"allOf": [{"$ref": "#/components/schemas/RefSchema"}, {"nullable": True}]}, { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "nullable": False, } }, "schema", {"type": "object", "x-de-$ref": "RefSchema", "nullable": True}, artifacts.types.ManyToOneRelationshipPropertyArtifacts, id="schema nullable prefer local many-to-one", ), pytest.param( None, {"allOf": [{"$ref": "#/components/schemas/RefSchema"}, {"writeOnly": True}]}, { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "writeOnly": False, } }, "schema", {"type": "object", "x-de-$ref": "RefSchema", "writeOnly": True}, artifacts.types.ManyToOneRelationshipPropertyArtifacts, id="schema writeOnly prefer local many-to-one", ), pytest.param( None, {"$ref": "#/components/schemas/RefSchema"}, { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "x-uselist": False, } }, "schema", {"type": "object", "x-de-$ref": "RefSchema"}, artifacts.types.OneToOneRelationshipPropertyArtifacts, id="schema one-to-one", ), pytest.param( None, {"type": "array", "items": {"$ref": "#/components/schemas/RefSchema"}}, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "schema", {"type": "array", "items": {"type": "object", "x-de-$ref": "RefSchema"}}, artifacts.types.OneToManyRelationshipPropertyArtifacts, id="schema one-to-many", ), pytest.param( None, { "allOf": [ {"type": "array", "items": {"$ref": "#/components/schemas/RefSchema"}}, {"description": "description 1"}, ] }, { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "description": "description 2", } }, "schema", { "type": "array", "items": {"type": "object", "x-de-$ref": "RefSchema"}, "description": "description 1", }, artifacts.types.OneToManyRelationshipPropertyArtifacts, id="schema description one-to-many", ), pytest.param( None, { "allOf": [ {"type": "array", "items": {"$ref": "#/components/schemas/RefSchema"}}, {"writeOnly": True}, ] }, { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "writeOnly": False, } }, "schema", { "type": "array", "items": {"type": "object", "x-de-$ref": "RefSchema"}, "writeOnly": True, }, artifacts.types.OneToManyRelationshipPropertyArtifacts, id="schema writeOnly one-to-many", ), pytest.param( None, {"type": "array", "items": {"$ref": "#/components/schemas/RefSchema"}}, { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "x-secondary": "secondary_1", } }, "schema", {"type": "array", "items": {"type": "object", "x-de-$ref": "RefSchema"}}, artifacts.types.ManyToManyRelationshipPropertyArtifacts, id="schema many-to-many", ), pytest.param( None, {"$ref": "#/components/schemas/RefSchema"}, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "backref_property", None, artifacts.types.ManyToOneRelationshipPropertyArtifacts, id="backref undefined", ), pytest.param( None, { "allOf": [ {"$ref": "#/components/schemas/RefSchema"}, {"x-backref": "backref_1"}, ] }, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "backref_property", "backref_1", artifacts.types.ManyToOneRelationshipPropertyArtifacts, id="backref many-to-one", ), pytest.param( None, { "allOf": [ {"$ref": "#/components/schemas/RefSchema"}, {"x-backref": "backref_1"}, ] }, { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "x-backref": "backref_2", } }, "backref_property", "backref_1", artifacts.types.ManyToOneRelationshipPropertyArtifacts, id="backref prefer local many-to-one", ), pytest.param( None, {"$ref": "#/components/schemas/RefSchema"}, { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "x-backref": "backref_1", "x-uselist": False, } }, "backref_property", "backref_1", artifacts.types.OneToOneRelationshipPropertyArtifacts, id="backref one-to-one", ), pytest.param( None, {"type": "array", "items": {"$ref": "#/components/schemas/RefSchema"}}, { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "x-backref": "backref_1", } }, "backref_property", "backref_1", artifacts.types.OneToManyRelationshipPropertyArtifacts, id="backref one-to-many", ), pytest.param( None, {"type": "array", "items": {"$ref": "#/components/schemas/RefSchema"}}, { "RefSchema": { "type": "object", "x-backref": "backref_1", "x-secondary": "secondary_1", } }, "backref_property", "backref_1", artifacts.types.ManyToManyRelationshipPropertyArtifacts, id="backref many-to-many", ), pytest.param( None, {"$ref": "#/components/schemas/RefSchema"}, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "kwargs", None, artifacts.types.ManyToOneRelationshipPropertyArtifacts, id="kwargs undefined", ), pytest.param( None, { "allOf": [ {"$ref": "#/components/schemas/RefSchema"}, {"x-kwargs": {"key_1": "value 1"}}, ] }, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "kwargs", {"key_1": "value 1"}, artifacts.types.ManyToOneRelationshipPropertyArtifacts, id="kwargs many-to-one", ), pytest.param( None, {"$ref": "#/components/schemas/RefSchema"}, { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "x-kwargs": {"key_2": "value 2"}, } }, "kwargs", None, artifacts.types.ManyToOneRelationshipPropertyArtifacts, id="kwargs on parent many-to-one", ), pytest.param( None, { "allOf": [ {"$ref": "#/components/schemas/RefSchema"}, {"x-kwargs": {"key_1": "value 1"}}, ] }, { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "x-uselist": False, } }, "kwargs", {"key_1": "value 1"}, artifacts.types.OneToOneRelationshipPropertyArtifacts, id="kwargs one-to-one", ), pytest.param( None, { "type": "array", "items": { "allOf": [ {"$ref": "#/components/schemas/RefSchema"}, {"x-kwargs": {"key_1": "value 1"}}, ] }, }, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "kwargs", {"key_1": "value 1"}, artifacts.types.OneToManyRelationshipPropertyArtifacts, id="kwargs one-to-many", ), pytest.param( None, { "type": "array", "items": { "allOf": [ {"$ref": "#/components/schemas/RefSchema"}, {"x-kwargs": {"key_1": "value 1"}}, ] }, }, { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "x-secondary": "secondary_1", } }, "kwargs", {"key_1": "value 1"}, artifacts.types.ManyToManyRelationshipPropertyArtifacts, id="kwargs many-to-many", ), pytest.param( None, {"$ref": "#/components/schemas/RefSchema"}, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "write_only", None, artifacts.types.ManyToOneRelationshipPropertyArtifacts, id="writeOnly undefined", ), pytest.param( None, {"allOf": [{"$ref": "#/components/schemas/RefSchema"}, {"writeOnly": True}]}, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "write_only", True, artifacts.types.ManyToOneRelationshipPropertyArtifacts, id="writeOnly many-to-one", ), pytest.param( None, {"$ref": "#/components/schemas/RefSchema"}, { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "writeOnly": True, } }, "write_only", None, artifacts.types.ManyToOneRelationshipPropertyArtifacts, id="writeOnly many-to-one skip_ref", ), pytest.param( None, {"allOf": [{"$ref": "#/components/schemas/RefSchema"}, {"writeOnly": False}]}, { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "x-uselist": False, } }, "write_only", False, artifacts.types.OneToOneRelationshipPropertyArtifacts, id="writeOnly one-to-one", ), pytest.param( None, { "writeOnly": True, "type": "array", "items": {"$ref": "#/components/schemas/RefSchema"}, }, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "write_only", True, artifacts.types.OneToManyRelationshipPropertyArtifacts, id="writeOnly one-to-many", ), pytest.param( None, { "writeOnly": True, "type": "array", "items": {"$ref": "#/components/schemas/RefSchema"}, }, { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "x-secondary": "secondary_1", } }, "write_only", True, artifacts.types.ManyToManyRelationshipPropertyArtifacts, id="writeOnly many-to-many", ), pytest.param( None, {"$ref": "#/components/schemas/RefSchema"}, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "description", None, artifacts.types.ManyToOneRelationshipPropertyArtifacts, id="description undefined", ), pytest.param( None, { "allOf": [ {"$ref": "#/components/schemas/RefSchema"}, {"description": "description 1"}, ] }, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "description", "description 1", artifacts.types.ManyToOneRelationshipPropertyArtifacts, id="description many-to-one", ), pytest.param( None, {"$ref": "#/components/schemas/RefSchema"}, { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "description": "description 1", } }, "description", None, artifacts.types.ManyToOneRelationshipPropertyArtifacts, id="description many-to-one skip_ref", ), pytest.param( None, { "allOf": [ {"$ref": "#/components/schemas/RefSchema"}, {"description": "description 2"}, ] }, { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "x-uselist": False, } }, "description", "description 2", artifacts.types.OneToOneRelationshipPropertyArtifacts, id="description one-to-one", ), pytest.param( None, { "description": "description 1", "type": "array", "items": {"$ref": "#/components/schemas/RefSchema"}, }, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "description", "description 1", artifacts.types.OneToManyRelationshipPropertyArtifacts, id="description one-to-many", ), pytest.param( None, { "description": "description 1", "type": "array", "items": {"$ref": "#/components/schemas/RefSchema"}, }, { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "x-secondary": "secondary_1", } }, "description", "description 1", artifacts.types.ManyToManyRelationshipPropertyArtifacts, id="description many-to-many", ), pytest.param( None, {"$ref": "#/components/schemas/RefSchema"}, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "foreign_key", "ref_schema.id", artifacts.types.ManyToOneRelationshipPropertyArtifacts, id="foreign key many-to-one", ), pytest.param( None, { "allOf": [ {"$ref": "#/components/schemas/RefSchema"}, {"x-foreign-key-column": "name"}, ] }, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "foreign_key", "ref_schema.name", artifacts.types.ManyToOneRelationshipPropertyArtifacts, id="foreign key set many-to-one", ), pytest.param( None, {"$ref": "#/components/schemas/RefSchema"}, { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "x-uselist": False, } }, "foreign_key", "ref_schema.id", artifacts.types.OneToOneRelationshipPropertyArtifacts, id="foreign key one-to-one", ), pytest.param( None, {"type": "array", "items": {"$ref": "#/components/schemas/RefSchema"}}, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "foreign_key", "schema.id", artifacts.types.OneToManyRelationshipPropertyArtifacts, id="foreign key one-to-many", ), pytest.param( None, {"$ref": "#/components/schemas/RefSchema"}, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "foreign_key_property", "ref_schema_id", artifacts.types.ManyToOneRelationshipPropertyArtifacts, id="foreign key property many-to-one", ), pytest.param( None, { "allOf": [ {"$ref": "#/components/schemas/RefSchema"}, {"x-foreign-key-column": "name"}, ] }, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "foreign_key_property", "ref_schema_name", artifacts.types.ManyToOneRelationshipPropertyArtifacts, id="foreign key property set many-to-one", ), pytest.param( None, {"$ref": "#/components/schemas/RefSchema"}, { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "x-uselist": False, } }, "foreign_key_property", "ref_schema_id", artifacts.types.OneToOneRelationshipPropertyArtifacts, id="foreign key property one-to-one", ), pytest.param( None, {"type": "array", "items": {"$ref": "#/components/schemas/RefSchema"}}, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "foreign_key_property", "schema_ref_schema_id", artifacts.types.OneToManyRelationshipPropertyArtifacts, id="foreign key property one-to-many", ), pytest.param( None, {"$ref": "#/components/schemas/RefSchema"}, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "nullable", None, artifacts.types.ManyToOneRelationshipPropertyArtifacts, id="nullable undefined", ), pytest.param( None, {"allOf": [{"$ref": "#/components/schemas/RefSchema"}, {"nullable": True}]}, {"RefSchema": {"type": "object", "x-tablename": "ref_schema"}}, "nullable", True, artifacts.types.ManyToOneRelationshipPropertyArtifacts, id="nullable many-to-one", ), pytest.param( None, {"$ref": "#/components/schemas/RefSchema"}, { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "nullable": True, } }, "nullable", True, artifacts.types.ManyToOneRelationshipPropertyArtifacts, id="nullable many-to-one on reference", ), pytest.param( None, {"allOf": [{"$ref": "#/components/schemas/RefSchema"}, {"nullable": False}]}, { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "x-uselist": False, } }, "nullable", False, artifacts.types.OneToOneRelationshipPropertyArtifacts, id="nullable one-to-one", ), pytest.param( None, {"type": "array", "items": {"$ref": "#/components/schemas/RefSchema"}}, {"RefSchema": {"type": "object", "x-secondary": "secondary_1"}}, "secondary", "secondary_1", artifacts.types.ManyToManyRelationshipPropertyArtifacts, id="secondary many-to-many", ), pytest.param( None, { "type": "array", "items": { "allOf": [ {"$ref": "#/components/schemas/RefSchema"}, {"x-secondary": "secondary_1"}, ] }, }, {"RefSchema": {"type": "object", "x-secondary": "secondary_2"}}, "secondary", "secondary_1", artifacts.types.ManyToManyRelationshipPropertyArtifacts, id="secondary prefer local many-to-many", ), ] @pytest.mark.parametrize( "required, schema, schemas, key, expected_value, expected_type", GET_TESTS ) @pytest.mark.schemas @pytest.mark.artifacts def test_get(required, schema, schemas, key, expected_value, expected_type): """ GIVEN schema, schemas, key and expected value WHEN get is called with the schema and schemas THEN the returned artifacts has the expected value behind the key. """ parent_schema = {"x-tablename": "schema"} property_name = "ref_schema" returned_artifacts = artifacts.property_.relationship.get( schemas, parent_schema, property_name, schema, required ) assert isinstance(returned_artifacts, expected_type) value = functools.reduce(getattr, key.split("."), returned_artifacts) assert value == expected_value
30.668911
87
0.490632
2,074
27,326
6.386692
0.043394
0.053601
0.058131
0.135739
0.885626
0.794957
0.768836
0.726634
0.668126
0.608712
0
0.003254
0.347727
27,326
890
88
30.703371
0.739901
0.008014
0
0.702055
0
0
0.325541
0.071128
0
0
0
0
0.002283
1
0.001142
false
0
0.004566
0
0.005708
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
851a22f82e9633c51f3d7b27611c5e475d15b154
212
py
Python
app_survey/admin.py
MorganFrenk/survey_API
9172f00666c8788be5c0856157542d7eb76d112c
[ "MIT" ]
1
2021-08-15T16:35:27.000Z
2021-08-15T16:35:27.000Z
app_survey/admin.py
MorganFrenk/survey_API
9172f00666c8788be5c0856157542d7eb76d112c
[ "MIT" ]
4
2021-08-19T09:30:45.000Z
2021-08-19T12:23:36.000Z
app_survey/admin.py
MorganFrenk/survey_API
9172f00666c8788be5c0856157542d7eb76d112c
[ "MIT" ]
null
null
null
from django.contrib import admin from app_survey.models import Answer, Choice, Question, Survey admin.site.register(Survey) admin.site.register(Question) admin.site.register(Choice) admin.site.register(Answer)
23.555556
62
0.820755
30
212
5.766667
0.433333
0.208092
0.393064
0.265896
0
0
0
0
0
0
0
0
0.080189
212
8
63
26.5
0.887179
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
6
51799f844f911b1c5139663e3f7b9804832779bb
4,558
py
Python
tests/test_sensor.py
kubawolanin/Home-Assistant-Mail-And-Packages
6e1b43683d4e0a386724dfcd14ce653968ce6557
[ "MIT" ]
2
2022-01-13T18:55:56.000Z
2022-01-14T20:56:19.000Z
tests/test_sensor.py
kubawolanin/Home-Assistant-Mail-And-Packages
6e1b43683d4e0a386724dfcd14ce653968ce6557
[ "MIT" ]
4
2022-01-13T08:34:58.000Z
2022-02-20T11:17:31.000Z
tests/test_sensor.py
kubawolanin/Home-Assistant-Mail-And-Packages
6e1b43683d4e0a386724dfcd14ce653968ce6557
[ "MIT" ]
2
2022-01-13T16:47:21.000Z
2022-02-07T12:43:58.000Z
""" Test Mail and Packages Sensor """ from pytest_homeassistant_custom_component.common import MockConfigEntry from custom_components.mail_and_packages.const import DOMAIN from tests.const import FAKE_CONFIG_DATA_NO_RND async def test_sensor(hass, mock_update): entry = MockConfigEntry( domain=DOMAIN, title="imap.test.email", data=FAKE_CONFIG_DATA_NO_RND, ) entry.add_to_hass(hass) assert await hass.config_entries.async_setup(entry.entry_id) await hass.async_block_till_done() assert "mail_and_packages" in hass.config.components # Check for mail_updated sensor reporting value from test data state = hass.states.get("sensor.mail_updated") assert state assert state.state == "2022-01-06T12:14:38+00:00" # Make sure the rest of the sensors are importing our test data state = hass.states.get("sensor.mail_usps_mail") assert state assert state.state == "6" assert state.attributes["image"] == "mail_today.gif" state = hass.states.get("sensor.mail_usps_delivered") assert state assert state.state == "3" state = hass.states.get("sensor.mail_usps_delivering") assert state assert state.state == "3" assert state.attributes["tracking_#"] == ["92123456789012345"] state = hass.states.get("sensor.mail_usps_packages") assert state assert state.state == "3" state = hass.states.get("sensor.mail_ups_delivered") assert state assert state.state == "1" state = hass.states.get("sensor.mail_ups_delivering") assert state assert state.state == "1" assert state.attributes["tracking_#"] == ["1Z123456789"] state = hass.states.get("sensor.mail_ups_packages") assert state assert state.state == "1" state = hass.states.get("sensor.mail_fedex_delivered") assert state assert state.state == "0" state = hass.states.get("sensor.mail_fedex_delivering") assert state assert state.state == "2" assert state.attributes["tracking_#"] == ["1234567890"] state = hass.states.get("sensor.mail_fedex_packages") assert state assert state.state == "2" state = hass.states.get("sensor.mail_fedex_packages") assert state assert state.state == "2" state = hass.states.get("sensor.mail_amazon_packages") assert state assert state.state == "7" assert state.attributes["order"] == ["#123-4567890"] state = hass.states.get("sensor.mail_amazon_packages_delivered") assert state assert state.state == "2" state = hass.states.get("sensor.mail_dhl_delivered") assert state assert state.state == "0" state = hass.states.get("sensor.mail_dhl_delivering") assert state assert state.state == "1" assert state.attributes["tracking_#"] == ["1234567890"] state = hass.states.get("sensor.mail_dhl_packages") assert state assert state.state == "2" state = hass.states.get("sensor.mail_auspost_delivered") assert state assert state.state == "2" state = hass.states.get("sensor.mail_auspost_delivering") assert state assert state.state == "1" state = hass.states.get("sensor.mail_auspost_packages") assert state assert state.state == "3" state = hass.states.get("sensor.mail_poczta_polska_delivering") assert state assert state.state == "1" state = hass.states.get("sensor.mail_poczta_polska_packages") assert state assert state.state == "1" state = hass.states.get("sensor.mail_inpost_pl_delivered") assert state assert state.state == "2" state = hass.states.get("sensor.mail_inpost_pl_delivering") assert state assert state.state == "1" state = hass.states.get("sensor.mail_inpost_pl_packages") assert state assert state.state == "3" state = hass.states.get("sensor.mail_dpd_com_pl_delivered") assert state assert state.state == "2" state = hass.states.get("sensor.mail_dpd_com_pl_delivering") assert state assert state.state == "1" state = hass.states.get("sensor.mail_dpd_com_pl_packages") assert state assert state.state == "3" state = hass.states.get("sensor.mail_gls_delivered") assert state assert state.state == "2" state = hass.states.get("sensor.mail_gls_delivering") assert state assert state.state == "1" state = hass.states.get("sensor.mail_gls_packages") assert state assert state.state == "3" state = hass.states.get("sensor.mail_packages_delivered") assert state assert state.state == "7"
28.848101
72
0.689557
601
4,558
5.051581
0.161398
0.253623
0.158103
0.189723
0.791502
0.761199
0.720685
0.658762
0.606719
0.600791
0
0.028804
0.192628
4,558
157
73
29.031847
0.796196
0.033787
0
0.573913
0
0
0.250682
0.203822
0
0
0
0
0.626087
1
0
false
0
0.026087
0
0.026087
0
0
0
0
null
1
0
1
0
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
6
51c0d0c1544a17bf3745338c9729dee771cd6d78
179,923
py
Python
ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py
gcxtx/ambari
133d9c4661b21182482c25f96c3f0bf0a9740a9f
[ "Apache-2.0" ]
1
2021-05-06T06:24:04.000Z
2021-05-06T06:24:04.000Z
ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py
gcxtx/ambari
133d9c4661b21182482c25f96c3f0bf0a9740a9f
[ "Apache-2.0" ]
null
null
null
ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py
gcxtx/ambari
133d9c4661b21182482c25f96c3f0bf0a9740a9f
[ "Apache-2.0" ]
null
null
null
''' Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ''' import json import os import socket from unittest import TestCase from mock.mock import patch, MagicMock class TestHDP25StackAdvisor(TestCase): def setUp(self): import imp self.maxDiff = None self.testDirectory = os.path.dirname(os.path.abspath(__file__)) stackAdvisorPath = os.path.join(self.testDirectory, '../../../../../main/resources/stacks/stack_advisor.py') hdp206StackAdvisorPath = os.path.join(self.testDirectory, '../../../../../main/resources/stacks/HDP/2.0.6/services/stack_advisor.py') hdp21StackAdvisorPath = os.path.join(self.testDirectory, '../../../../../main/resources/stacks/HDP/2.1/services/stack_advisor.py') hdp22StackAdvisorPath = os.path.join(self.testDirectory, '../../../../../main/resources/stacks/HDP/2.2/services/stack_advisor.py') hdp23StackAdvisorPath = os.path.join(self.testDirectory, '../../../../../main/resources/stacks/HDP/2.3/services/stack_advisor.py') hdp24StackAdvisorPath = os.path.join(self.testDirectory, '../../../../../main/resources/stacks/HDP/2.4/services/stack_advisor.py') hdp25StackAdvisorPath = os.path.join(self.testDirectory, '../../../../../main/resources/stacks/HDP/2.5/services/stack_advisor.py') hdp25StackAdvisorClassName = 'HDP25StackAdvisor' with open(stackAdvisorPath, 'rb') as fp: imp.load_module('stack_advisor', fp, stackAdvisorPath, ('.py', 'rb', imp.PY_SOURCE)) with open(hdp206StackAdvisorPath, 'rb') as fp: imp.load_module('stack_advisor_impl', fp, hdp206StackAdvisorPath, ('.py', 'rb', imp.PY_SOURCE)) with open(hdp21StackAdvisorPath, 'rb') as fp: imp.load_module('stack_advisor_impl', fp, hdp21StackAdvisorPath, ('.py', 'rb', imp.PY_SOURCE)) with open(hdp22StackAdvisorPath, 'rb') as fp: imp.load_module('stack_advisor_impl', fp, hdp22StackAdvisorPath, ('.py', 'rb', imp.PY_SOURCE)) with open(hdp23StackAdvisorPath, 'rb') as fp: imp.load_module('stack_advisor_impl', fp, hdp23StackAdvisorPath, ('.py', 'rb', imp.PY_SOURCE)) with open(hdp24StackAdvisorPath, 'rb') as fp: imp.load_module('stack_advisor_impl', fp, hdp24StackAdvisorPath, ('.py', 'rb', imp.PY_SOURCE)) with open(hdp25StackAdvisorPath, 'rb') as fp: stack_advisor_impl = imp.load_module('stack_advisor_impl', fp, hdp25StackAdvisorPath, ('.py', 'rb', imp.PY_SOURCE)) clazz = getattr(stack_advisor_impl, hdp25StackAdvisorClassName) self.stackAdvisor = clazz() # substitute method in the instance self.get_system_min_uid_real = self.stackAdvisor.get_system_min_uid self.stackAdvisor.get_system_min_uid = self.get_system_min_uid_magic # setup for 'test_recommendYARNConfigurations' self.hosts = { "items": [ { "Hosts": { "cpu_count": 6, "total_mem": 50331648, "disk_info": [ {"mountpoint": "/"}, {"mountpoint": "/dev/shm"}, {"mountpoint": "/vagrant"}, {"mountpoint": "/"}, {"mountpoint": "/dev/shm"}, {"mountpoint": "/vagrant"} ], "public_host_name": "c6401.ambari.apache.org", "host_name": "c6401.ambari.apache.org" }, }, { "Hosts": { "cpu_count": 6, "total_mem": 50331648, "disk_info": [ {"mountpoint": "/"}, {"mountpoint": "/dev/shm"}, {"mountpoint": "/vagrant"}, {"mountpoint": "/"}, {"mountpoint": "/dev/shm"}, {"mountpoint": "/vagrant"} ], "public_host_name": "c6402.ambari.apache.org", "host_name": "c6402.ambari.apache.org" }, }, { "Hosts": { "cpu_count": 6, "total_mem": 50331648, "disk_info": [ {"mountpoint": "/"}, {"mountpoint": "/dev/shm"}, {"mountpoint": "/vagrant"}, {"mountpoint": "/"}, {"mountpoint": "/dev/shm"}, {"mountpoint": "/vagrant"} ], "public_host_name": "c6403.ambari.apache.org", "host_name": "c6403.ambari.apache.org" }, }, { "Hosts": { "cpu_count": 6, "total_mem": 50331648, "disk_info": [ {"mountpoint": "/"}, {"mountpoint": "/dev/shm"}, {"mountpoint": "/vagrant"}, {"mountpoint": "/"}, {"mountpoint": "/dev/shm"}, {"mountpoint": "/vagrant"} ], "public_host_name": "c6404.ambari.apache.org", "host_name": "c6404.ambari.apache.org" }, }, { "Hosts": { "cpu_count": 6, "total_mem": 50331648, "disk_info": [ {"mountpoint": "/"}, {"mountpoint": "/dev/shm"}, {"mountpoint": "/vagrant"}, {"mountpoint": "/"}, {"mountpoint": "/dev/shm"}, {"mountpoint": "/vagrant"} ], "public_host_name": "c6405.ambari.apache.org", "host_name": "c6405.ambari.apache.org" }, } ] } self.clusterData = { "cpu": 4, "mapMemory": 3000, "amMemory": 2000, "reduceMemory": 2056, "containers": 3, "ramPerContainer": 256 } # Expected config outputs. # Expected capacity-scheduler with 'llap' (size:20) and 'default' queue at root level. self.expected_capacity_scheduler_llap_queue_size_20 = { "properties": { "capacity-scheduler": 'yarn.scheduler.capacity.root.default.maximum-capacity=80\n' 'yarn.scheduler.capacity.root.accessible-node-labels=*\n' 'yarn.scheduler.capacity.root.capacity=100\n' 'yarn.scheduler.capacity.root.queues=default,llap\n' 'yarn.scheduler.capacity.maximum-applications=10000\n' 'yarn.scheduler.capacity.root.default.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.default.state=RUNNING\n' 'yarn.scheduler.capacity.maximum-am-resource-percent=1\n' 'yarn.scheduler.capacity.root.default.acl_submit_applications=*\n' 'yarn.scheduler.capacity.root.default.capacity=80\n' 'yarn.scheduler.capacity.root.acl_administer_queue=*\n' 'yarn.scheduler.capacity.node-locality-delay=40\n' 'yarn.scheduler.capacity.queue-mappings-override.enable=false\n' 'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.llap.state=RUNNING\n' 'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n' 'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n' 'yarn.scheduler.capacity.root.llap.maximum-capacity=20\n' 'yarn.scheduler.capacity.root.llap.capacity=20\n' 'yarn.scheduler.capacity.root.llap.acl_submit_applications=hive\n' 'yarn.scheduler.capacity.root.llap.acl_administer_queue=hive\n' 'yarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1' } } # Expected capacity-scheduler with 'llap' (size:40) and 'default' queue at root level. self.expected_capacity_scheduler_llap_queue_size_40 = { "properties": { "capacity-scheduler": 'yarn.scheduler.capacity.root.default.maximum-capacity=60\n' 'yarn.scheduler.capacity.root.accessible-node-labels=*\n' 'yarn.scheduler.capacity.root.capacity=100\n' 'yarn.scheduler.capacity.root.queues=default,llap\n' 'yarn.scheduler.capacity.maximum-applications=10000\n' 'yarn.scheduler.capacity.root.default.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.default.state=RUNNING\n' 'yarn.scheduler.capacity.maximum-am-resource-percent=1\n' 'yarn.scheduler.capacity.root.default.acl_submit_applications=*\n' 'yarn.scheduler.capacity.root.default.capacity=60\n' 'yarn.scheduler.capacity.root.acl_administer_queue=*\n' 'yarn.scheduler.capacity.node-locality-delay=40\n' 'yarn.scheduler.capacity.queue-mappings-override.enable=false\n' 'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.llap.state=RUNNING\n' 'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n' 'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n' 'yarn.scheduler.capacity.root.llap.maximum-capacity=40\n' 'yarn.scheduler.capacity.root.llap.capacity=40\n' 'yarn.scheduler.capacity.root.llap.acl_submit_applications=hive\n' 'yarn.scheduler.capacity.root.llap.acl_administer_queue=hive\n' 'yarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1' } } # Expected capacity-scheduler with 'llap' state = STOPPED, cap = 0 % and 'default' queue cap to 100%. self.expected_capacity_scheduler_llap_Stopped_size_0 = { "properties": { "capacity-scheduler": 'yarn.scheduler.capacity.root.default.maximum-capacity=100\n' 'yarn.scheduler.capacity.root.accessible-node-labels=*\n' 'yarn.scheduler.capacity.root.capacity=100\n' 'yarn.scheduler.capacity.root.queues=default,llap\n' 'yarn.scheduler.capacity.maximum-applications=10000\n' 'yarn.scheduler.capacity.root.default.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.default.state=RUNNING\n' 'yarn.scheduler.capacity.maximum-am-resource-percent=1\n' 'yarn.scheduler.capacity.root.default.acl_submit_applications=*\n' 'yarn.scheduler.capacity.root.default.capacity=100\n' 'yarn.scheduler.capacity.root.acl_administer_queue=*\n' 'yarn.scheduler.capacity.node-locality-delay=40\n' 'yarn.scheduler.capacity.queue-mappings-override.enable=false\n' 'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.llap.state=STOPPED\n' 'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n' 'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n' 'yarn.scheduler.capacity.root.llap.maximum-capacity=0\n' 'yarn.scheduler.capacity.root.llap.capacity=0\n' 'yarn.scheduler.capacity.root.llap.acl_submit_applications=hive\n' 'yarn.scheduler.capacity.root.llap.acl_administer_queue=hive\n' 'yarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1' } } # Expected capacity-scheduler with only 'default' queue. self.expected_capacity_scheduler_with_default_queue_only = { "properties": { "capacity-scheduler": 'yarn.scheduler.capacity.root.accessible-node-labels=*\n' 'yarn.scheduler.capacity.maximum-am-resource-percent=1\n' 'yarn.scheduler.capacity.root.capacity=100\n' 'yarn.scheduler.capacity.root.default.state=RUNNING\n' 'yarn.scheduler.capacity.node-locality-delay=40\n' 'yarn.scheduler.capacity.root.queues=default\n' 'yarn.scheduler.capacity.maximum-applications=10000\n' 'yarn.scheduler.capacity.root.default.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.acl_administer_queue=*\n' 'yarn.scheduler.capacity.root.default.acl_submit_applications=*\n' 'yarn.scheduler.capacity.root.default.capacity=100\n' "yarn.scheduler.capacity.root.default.maximum-capacity=100\n" 'yarn.scheduler.capacity.queue-mappings-override.enable=false\n' } } # Expected capacity-scheduler as empty. self.expected_capacity_scheduler_empty = { "properties": { } } # Expected 'hive_interactive_site' with (1). 'hive.llap.daemon.queue.name' set to 'llap' queue, and # (2). 'hive.llap.daemon.queue.name' property_attributes set to : default and llap. self.expected_hive_interactive_site_llap = { "hive-interactive-site": { "properties": { "hive.llap.daemon.queue.name": "llap" }, "property_attributes": { "hive.llap.daemon.queue.name": { "entries": [ { "value": "default", "label": "default" }, { "value": "llap", "label": "llap" } ] } } } } # Expected 'hive_interactive_site' with (1). 'hive.llap.daemon.queue.name' set to 'default' queue, and # (2). 'hive.llap.daemon.queue.name' property_attributes set to : default. self.expected_hive_interactive_site_default = { "hive-interactive-site": { "properties": { "hive.llap.daemon.queue.name": "default" }, "property_attributes": { "hive.llap.daemon.queue.name": { "entries": [ { "value": "default", "label": "default" } ] } } } } # Expected 'hive_interactive_site' when no modifications are done. self.expected_hive_interactive_site_empty = { "hive-interactive-site": { "properties": { } } } # Expected 'hive_interactive_site' when no modifications are done. self.expected_hive_interactive_env_empty = { "hive-interactive-env": { "properties": { } } } self.expected_hive_interactive_site_only_memory = { "hive-interactive-site": { "properties": { 'hive.llap.daemon.yarn.container.mb': '341' } } } # Expected 'hive_interactive_env' with 'llap_queue_capacity' set to 20. self.expected_llap_queue_capacity_20 = '20' # Expected 'hive_interactive_env' with 'llap_queue_capacity' set to 40. self.expected_llap_queue_capacity_40 = '40' # expected vals. self.expected_visibility_false = {'visible': 'false'} self.expected_visibility_true = {'visible': 'true'} def load_json(self, filename): file = os.path.join(self.testDirectory, filename) with open(file, 'rb') as f: data = json.load(f) return data def prepareHosts(self, hostsNames): hosts = { "items": [] } for hostName in hostsNames: nextHost = {"Hosts":{"host_name" : hostName}} hosts["items"].append(nextHost) return hosts @patch('__builtin__.open') @patch('os.path.exists') def get_system_min_uid_magic(self, exists_mock, open_mock): class MagicFile(object): def read(self): return """ #test line UID_MIN 200 UID_MIN 500 """ def __exit__(self, exc_type, exc_val, exc_tb): pass def __enter__(self): return self exists_mock.return_value = True open_mock.return_value = MagicFile() return self.get_system_min_uid_real() def __getHosts(self, componentsList, componentName): return [component["StackServiceComponents"] for component in componentsList if component["StackServiceComponents"]["component_name"] == componentName][0] def test_getComponentLayoutValidations_one_hsi_host(self): hosts = self.load_json("host-3-hosts.json") services = self.load_json("services-normal-his-2-hosts.json") validations = self.stackAdvisor.getComponentLayoutValidations(services, hosts) expected = {'component-name': 'HIVE_SERVER_INTERACTIVE', 'message': 'Between 0 and 1 HiveServer2 Interactive components should be installed in cluster.', 'type': 'host-component', 'level': 'ERROR'} self.assertEquals(validations[0], expected) def test_validateYarnConfigurations(self): properties = {'enable_hive_interactive': 'true', 'hive_server_interactive_host': 'c6401.ambari.apache.org', 'hive.tez.container.size': '2048'} recommendedDefaults = {'enable_hive_interactive': 'true', "hive_server_interactive_host": "c6401.ambari.apache.org"} configurations = { "hive-interactive-env": { "properties": {'enable_hive_interactive': 'true', "hive_server_interactive_host": "c6401.ambari.apache.org"} }, "hive-site": { "properties": {"hive.security.authorization.enabled": "true", 'hive.tez.java.opts': '-server -Djava.net.preferIPv4Stack=true'} }, "hive-env": { "properties": {"hive_security_authorization": "None"} }, "yarn-site": { "properties": {"yarn.resourcemanager.work-preserving-recovery.enabled": "false"} } } services = self.load_json("services-normal-his-valid.json") res_expected = [ {'config-type': 'yarn-site', 'message': 'While enabling HIVE_SERVER_INTERACTIVE it is recommended that you enable work preserving restart in YARN.', 'type': 'configuration', 'config-name': 'yarn.resourcemanager.work-preserving-recovery.enabled', 'level': 'WARN'} ] res = self.stackAdvisor.validateYarnConfigurations(properties, recommendedDefaults, configurations, services, {}) self.assertEquals(res, res_expected) pass def test_validateHiveConfigurations(self): properties = {'enable_hive_interactive': 'true', 'hive_server_interactive_host': 'c6401.ambari.apache.org', 'hive.tez.container.size': '2048'} recommendedDefaults = {'enable_hive_interactive': 'true', "hive_server_interactive_host": "c6401.ambari.apache.org"} configurations = { "hive-interactive-env": { "properties": {'enable_hive_interactive': 'true', 'hive_server_interactive_host': 'c6401.ambari.apache.org'} }, "hive-site": { "properties": {"hive.security.authorization.enabled": "true", 'hive.tez.java.opts': '-server -Djava.net.preferIPv4Stack=true'} }, "hive-env": { "properties": {"hive_security_authorization": "None"} }, "yarn-site": { "properties": {"yarn.resourcemanager.work-preserving-recovery.enabled": "true"} } } configurations2 = { "hive-interactive-env": { "properties": {'enable_hive_interactive': 'false'} }, "hive-site": { "properties": {"hive.security.authorization.enabled": "true", 'hive.tez.java.opts': '-server -Djava.net.preferIPv4Stack=true'} }, "hive-env": { "properties": {"hive_security_authorization": "None"} }, "yarn-site": { "properties": {"yarn.resourcemanager.work-preserving-recovery.enabled": "true"} } } configurations3 = { "hive-interactive-env": { "properties": {'enable_hive_interactive': 'true', "hive_server_interactive_host": "c6402.ambari.apache.org"} }, "hive-site": { "properties": {"hive.security.authorization.enabled": "true", 'hive.tez.java.opts': '-server -Djava.net.preferIPv4Stack=true'} }, "hive-env": { "properties": {"hive_security_authorization": "None"} }, "yarn-site": { "properties": {"yarn.resourcemanager.work-preserving-recovery.enabled": "true"} } } services = self.load_json("services-normal-his-valid.json") res_expected = [ ] # the above error is not what we are checking for - just to keep test happy without having to test res = self.stackAdvisor.validateHiveInteractiveEnvConfigurations(properties, recommendedDefaults, configurations, services, {}) self.assertEquals(res, res_expected) res_expected = [ {'config-type': 'hive-interactive-env', 'message': 'HIVE_SERVER_INTERACTIVE requires enable_hive_interactive in hive-interactive-env set to true.', 'type': 'configuration', 'config-name': 'enable_hive_interactive', 'level': 'ERROR'}, {'config-type': 'hive-interactive-env', 'message': 'HIVE_SERVER_INTERACTIVE requires hive_server_interactive_host in hive-interactive-env set to its host name.', 'type': 'configuration', 'config-name': 'hive_server_interactive_host', 'level': 'ERROR'} ] res = self.stackAdvisor.validateHiveInteractiveEnvConfigurations(properties, recommendedDefaults, configurations2, services, {}) self.assertEquals(res, res_expected) res_expected = [ {'config-type': 'hive-interactive-env', 'message': 'HIVE_SERVER_INTERACTIVE requires hive_server_interactive_host in hive-interactive-env set to its host name.', 'type': 'configuration', 'config-name': 'hive_server_interactive_host', 'level': 'ERROR'} ] res = self.stackAdvisor.validateHiveInteractiveEnvConfigurations(properties, recommendedDefaults, configurations3, services, {}) self.assertEquals(res, res_expected) pass # Tests related to 'recommendYARNConfigurations()' # Test 1 : (1). Only default queue exists in capacity-scheduler (2). enable_hive_interactive' is 'On' and # 'llap_queue_capacity is 0. def test_recommendYARNConfigurations_create_llap_queue_1(self): services = { "services": [{ "StackServices": { "service_name": "YARN", }, "Versions": { "stack_version": "2.5" }, "components": [ { "StackServiceComponents": { "component_name": "NODEMANAGER", "hostnames": ["c6401.ambari.apache.org"] }, } ] }, { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE", "StackServices": { "service_name": "HIVE", "service_version": "1.2.1.2.5", "stack_name": "HDP", "stack_version": "2.5" }, "components": [ { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE/components/HIVE_SERVER_INTERACTIVE", "StackServiceComponents": { "advertise_version": "true", "bulk_commands_display_name": "", "bulk_commands_master_component_name": "", "cardinality": "0-1", "component_category": "MASTER", "component_name": "HIVE_SERVER_INTERACTIVE", "custom_commands": ["RESTART_LLAP"], "decommission_allowed": "false", "display_name": "HiveServer2 Interactive", "has_bulk_commands_definition": "false", "is_client": "false", "is_master": "true", "reassign_allowed": "false", "recovery_enabled": "false", "service_name": "HIVE", "stack_name": "HDP", "stack_version": "2.5", "hostnames": ["c6401.ambari.apache.org"] }, "dependencies": [] } ] } ], "changed-configurations": [ { u'old_value': u'', u'type': u'', u'name': u'' } ], "configurations": { "capacity-scheduler": { "properties": { "capacity-scheduler": "yarn.scheduler.capacity.root.queues=default\n" "yarn.scheduler.capacity.root.default.user-limit-factor=1\n" "yarn.scheduler.capacity.root.default.state=RUNNING\n" "yarn.scheduler.capacity.root.default.maximum-capacity=100\n" "yarn.scheduler.capacity.root.default.capacity=100\n" "yarn.scheduler.capacity.root.default.acl_submit_applications=*\n" "yarn.scheduler.capacity.root.capacity=100\n" "yarn.scheduler.capacity.root.acl_administer_queue=*\n" "yarn.scheduler.capacity.root.accessible-node-labels=*\n" "yarn.scheduler.capacity.node-locality-delay=40\n" "yarn.scheduler.capacity.maximum-applications=10000\n" "yarn.scheduler.capacity.maximum-am-resource-percent=1\n" "yarn.scheduler.capacity.queue-mappings-override.enable=false\n" } }, "hive-interactive-env": { 'properties': { 'enable_hive_interactive': 'true', 'llap_queue_capacity':'0' } }, "yarn-site": { "properties": { "yarn.scheduler.minimum-allocation-mb": "682", "yarn.nodemanager.resource.memory-mb": "10240" } }, "hive-interactive-site": { 'properties': { 'hive.llap.daemon.queue.name':'default' } }, "tez-interactive-site": { "properties": { "tez.am.resource.memory.mb": "341" } }, "hive-env": { 'properties': { 'hive_user': 'hive' } }, "hive-site": { 'properties': { 'hive.tez.container.size': '341' } }, } } configurations = { } self.stackAdvisor.recommendYARNConfigurations(configurations, self.clusterData, services, self.hosts) # Check output self.assertEquals(configurations['hive-interactive-site']['properties']['hive.llap.daemon.queue.name'], self.expected_hive_interactive_site_llap['hive-interactive-site']['properties']['hive.llap.daemon.queue.name']) self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.llap.daemon.queue.name'], self.expected_hive_interactive_site_llap['hive-interactive-site']['property_attributes']['hive.llap.daemon.queue.name']) self.assertEquals(configurations['hive-interactive-env']['properties']['llap_queue_capacity'], self.expected_llap_queue_capacity_20) cap_sched_output_dict = convertToDict(configurations['capacity-scheduler']['properties']['capacity-scheduler']) cap_sched_expected_dict = convertToDict(self.expected_capacity_scheduler_llap_queue_size_20['properties']['capacity-scheduler']) self.assertEqual(cap_sched_output_dict, cap_sched_expected_dict) # Test 2: (1). Only default queue exists in capacity-scheduler (2). enable_hive_interactive' is 'On' and # 'llap_queue_capacity is 40. def test_recommendYARNConfigurations_create_llap_queue_2(self): services = { "services": [{ "StackServices": { "service_name": "YARN", }, "Versions": { "stack_version": "2.5" }, "components": [ { "StackServiceComponents": { "component_name": "NODEMANAGER", "hostnames": ["c6401.ambari.apache.org"] } } ] }, { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE", "StackServices": { "service_name": "HIVE", "service_version": "1.2.1.2.5", "stack_name": "HDP", "stack_version": "2.5" }, "components": [ { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE/components/HIVE_SERVER_INTERACTIVE", "StackServiceComponents": { "advertise_version": "true", "bulk_commands_display_name": "", "bulk_commands_master_component_name": "", "cardinality": "0-1", "component_category": "MASTER", "component_name": "HIVE_SERVER_INTERACTIVE", "custom_commands": ["RESTART_LLAP"], "decommission_allowed": "false", "display_name": "HiveServer2 Interactive", "has_bulk_commands_definition": "false", "is_client": "false", "is_master": "true", "reassign_allowed": "false", "recovery_enabled": "false", "service_name": "HIVE", "stack_name": "HDP", "stack_version": "2.5", "hostnames": ["c6401.ambari.apache.org"] }, "dependencies": [] } ] } ], "changed-configurations": [ { u'old_value': u'', u'type': u'', u'name': u'' } ], "configurations": { "capacity-scheduler": { "properties": { "capacity-scheduler": "yarn.scheduler.capacity.root.queues=default\n" "yarn.scheduler.capacity.root.default.user-limit-factor=1\n" "yarn.scheduler.capacity.root.default.state=RUNNING\n" "yarn.scheduler.capacity.root.default.maximum-capacity=100\n" "yarn.scheduler.capacity.root.default.capacity=100\n" "yarn.scheduler.capacity.root.default.acl_submit_applications=*\n" "yarn.scheduler.capacity.root.capacity=100\n" "yarn.scheduler.capacity.root.acl_administer_queue=*\n" "yarn.scheduler.capacity.root.accessible-node-labels=*\n" "yarn.scheduler.capacity.node-locality-delay=40\n" "yarn.scheduler.capacity.maximum-applications=10000\n" "yarn.scheduler.capacity.maximum-am-resource-percent=1\n" "yarn.scheduler.capacity.queue-mappings-override.enable=false\n" } }, "hive-interactive-env": { 'properties': { 'enable_hive_interactive': 'true', 'llap_queue_capacity':'40' } }, "yarn-site": { "properties": { "yarn.scheduler.minimum-allocation-mb": "682", "yarn.nodemanager.resource.memory-mb": "2048" } }, "hive-interactive-site": { 'properties': { 'hive.llap.daemon.queue.name':'default', } }, "tez-interactive-site": { "properties": { "tez.am.resource.memory.mb": "341" } }, "hive-env": { 'properties': { 'hive_user': 'hive' } }, "hive-site": { 'properties': { 'hive.tez.container.size': '341' } }, } } configurations = { } self.stackAdvisor.recommendYARNConfigurations(configurations, self.clusterData, services, self.hosts) # Check output self.assertEquals(configurations['hive-interactive-site']['properties']['hive.llap.daemon.queue.name'], self.expected_hive_interactive_site_llap['hive-interactive-site']['properties']['hive.llap.daemon.queue.name']) self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.llap.daemon.queue.name'], self.expected_hive_interactive_site_llap['hive-interactive-site']['property_attributes']['hive.llap.daemon.queue.name']) self.assertTrue('llap_queue_capacity' not in configurations['hive-interactive-env']['properties']) cap_sched_output_dict = convertToDict(configurations['capacity-scheduler']['properties']['capacity-scheduler']) cap_sched_expected_dict = convertToDict(self.expected_capacity_scheduler_llap_queue_size_40['properties']['capacity-scheduler']) self.assertEqual(cap_sched_output_dict, cap_sched_expected_dict) # Test 3: (1). 'llap' (0%) and 'default' (100%) queues exists at leaf level in capacity-scheduler # (2). llap is state = STOPPED, (3). llap_queue_capacity = 0, and (4). enable_hive_interactive' is 'ON'. # Expected : llap queue state = RUNNING, llap_queue_capacity = 20 def test_recommendYARNConfigurations_update_llap_queue_1(self): services = { "services": [{ "StackServices": { "service_name": "YARN", }, "Versions": { "stack_version": "2.5" }, "components": [ { "StackServiceComponents": { "component_name": "NODEMANAGER", "hostnames": ["c6401.ambari.apache.org"] } } ] }, { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE", "StackServices": { "service_name": "HIVE", "service_version": "1.2.1.2.5", "stack_name": "HDP", "stack_version": "2.5" }, "components": [ { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE/components/HIVE_SERVER_INTERACTIVE", "StackServiceComponents": { "advertise_version": "true", "bulk_commands_display_name": "", "bulk_commands_master_component_name": "", "cardinality": "0-1", "component_category": "MASTER", "component_name": "HIVE_SERVER_INTERACTIVE", "custom_commands": ["RESTART_LLAP"], "decommission_allowed": "false", "display_name": "HiveServer2 Interactive", "has_bulk_commands_definition": "false", "is_client": "false", "is_master": "true", "reassign_allowed": "false", "recovery_enabled": "false", "service_name": "HIVE", "stack_name": "HDP", "stack_version": "2.5", "hostnames": ["c6401.ambari.apache.org"] }, "dependencies": [] } ] } ], "changed-configurations": [ { u'old_value': u'off', u'type': u'hive-interactive-env', u'name': u'enable_hive_interactive' } ], "configurations": { "capacity-scheduler": { "properties": { "capacity-scheduler": "yarn.scheduler.capacity.root.accessible-node-labels=*\n" "yarn.scheduler.capacity.root.capacity=100\n" "yarn.scheduler.capacity.root.queues=default,llap\n" "yarn.scheduler.capacity.maximum-applications=10000\n" "yarn.scheduler.capacity.root.default.user-limit-factor=1\n" "yarn.scheduler.capacity.root.default.state=RUNNING\n" "yarn.scheduler.capacity.maximum-am-resource-percent=1\n" "yarn.scheduler.capacity.root.default.acl_submit_applications=*\n" "yarn.scheduler.capacity.root.default.capacity=100\n" "yarn.scheduler.capacity.root.acl_administer_queue=*\n" "yarn.scheduler.capacity.node-locality-delay=40\n" "yarn.scheduler.capacity.queue-mappings-override.enable=false\n" "yarn.scheduler.capacity.root.llap.user-limit-factor=1\n" "yarn.scheduler.capacity.root.llap.state=STOPPED\n" "yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n" "yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n" "yarn.scheduler.capacity.root.llap.maximum-capacity=0\n" "yarn.scheduler.capacity.root.default.maximum-capacity=100\n" "yarn.scheduler.capacity.root.llap.capacity=0\n" "yarn.scheduler.capacity.root.llap.acl_submit_applications=hive\n" "yarn.scheduler.capacity.root.llap.acl_administer_queue=hive\n" "yarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1\n" } }, "hive-interactive-env": { 'properties': { 'enable_hive_interactive': 'true', 'llap_queue_capacity':'0' } }, "yarn-site": { "properties": { "yarn.scheduler.minimum-allocation-mb": "341", "yarn.nodemanager.resource.memory-mb": "20000", "yarn.nodemanager.resource.cpu-vcores": '1' } }, "hive-interactive-site": { 'properties': { 'hive.llap.daemon.queue.name':'llap', 'hive.server2.tez.sessions.per.default.queue' : '1' } }, "tez-interactive-site": { "properties": { "tez.am.resource.memory.mb": "341" } }, "hive-env": { 'properties': { 'hive_user': 'hive' } }, "hive-site": { 'properties': { 'hive.tez.container.size': '341' } }, } } configurations = { } self.stackAdvisor.recommendYARNConfigurations(configurations, self.clusterData, services, self.hosts) # Check output self.assertEquals(configurations['hive-interactive-site']['properties']['hive.llap.daemon.queue.name'], self.expected_hive_interactive_site_llap['hive-interactive-site']['properties']['hive.llap.daemon.queue.name']) self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.llap.daemon.queue.name'], self.expected_hive_interactive_site_llap['hive-interactive-site']['property_attributes']['hive.llap.daemon.queue.name']) self.assertEquals(configurations['hive-interactive-env']['properties']['llap_queue_capacity'], self.expected_llap_queue_capacity_20) cap_sched_output_dict = convertToDict(configurations['capacity-scheduler']['properties']['capacity-scheduler']) cap_sched_expected_dict = convertToDict(self.expected_capacity_scheduler_llap_queue_size_20['properties']['capacity-scheduler']) self.assertEqual(cap_sched_output_dict, cap_sched_expected_dict) # Test 4: (1). 'llap' (20%) and 'default' (80%) queues exists at leaf level in capacity-scheduler # (2). llap is state = STOPPED, (3). llap_queue_capacity = 40, and (4). enable_hive_interactive' is 'ON'. # Expected : llap state goes RUNNING. def test_recommendYARNConfigurations_update_llap_queue_2(self): services = { "services": [{ "StackServices": { "service_name": "YARN", }, "Versions": { "stack_version": "2.5" }, "components": [ { "StackServiceComponents": { "component_name": "NODEMANAGER", "hostnames": ["c6401.ambari.apache.org"] } } ] }, { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE", "StackServices": { "service_name": "HIVE", "service_version": "1.2.1.2.5", "stack_name": "HDP", "stack_version": "2.5" }, "components": [ { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE/components/HIVE_SERVER_INTERACTIVE", "StackServiceComponents": { "advertise_version": "true", "bulk_commands_display_name": "", "bulk_commands_master_component_name": "", "cardinality": "0-1", "component_category": "MASTER", "component_name": "HIVE_SERVER_INTERACTIVE", "custom_commands": ["RESTART_LLAP"], "decommission_allowed": "false", "display_name": "HiveServer2 Interactive", "has_bulk_commands_definition": "false", "is_client": "false", "is_master": "true", "reassign_allowed": "false", "recovery_enabled": "false", "service_name": "HIVE", "stack_name": "HDP", "stack_version": "2.5", "hostnames": ["c6401.ambari.apache.org"] }, "dependencies": [] } ] } ], "changed-configurations": [ { u'old_value': u'', u'type': u'', u'name': u'' } ], "configurations": { "capacity-scheduler": { "properties": { "capacity-scheduler": "yarn.scheduler.capacity.root.accessible-node-labels=*\n" "yarn.scheduler.capacity.root.capacity=100\n" "yarn.scheduler.capacity.root.queues=default,llap\n" "yarn.scheduler.capacity.maximum-applications=10000\n" "yarn.scheduler.capacity.root.default.user-limit-factor=1\n" "yarn.scheduler.capacity.root.default.state=RUNNING\n" "yarn.scheduler.capacity.maximum-am-resource-percent=1\n" "yarn.scheduler.capacity.root.default.acl_submit_applications=*\n" "yarn.scheduler.capacity.root.default.capacity=80\n" "yarn.scheduler.capacity.root.acl_administer_queue=*\n" "yarn.scheduler.capacity.node-locality-delay=40\n" "yarn.scheduler.capacity.queue-mappings-override.enable=false\n" "yarn.scheduler.capacity.root.llap.user-limit-factor=1\n" "yarn.scheduler.capacity.root.llap.state=RUNNING\n" "yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n" "yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n" "yarn.scheduler.capacity.root.llap.maximum-capacity=20\n" "yarn.scheduler.capacity.root.default.maximum-capacity=80\n" "yarn.scheduler.capacity.root.llap.capacity=20\n" "yarn.scheduler.capacity.root.llap.acl_submit_applications=hive\n" "yarn.scheduler.capacity.root.llap.acl_administer_queue=hive\n" "yarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1\n" } }, "hive-interactive-env": { 'properties': { 'enable_hive_interactive': 'true', 'llap_queue_capacity':'40' } }, "hive-interactive-site": { 'properties': { 'hive.llap.daemon.queue.name':'llap' } }, "tez-interactive-site": { "properties": { "tez.am.resource.memory.mb": "341" } }, "yarn-site": { "properties": { "yarn.scheduler.minimum-allocation-mb": "341", "yarn.nodemanager.resource.memory-mb": "20000", "yarn.nodemanager.resource.cpu-vcores": '1' } }, "hive-env": { 'properties': { 'hive_user': 'hive' } }, "hive-site": { 'properties': { 'hive.tez.container.size': '341' } }, } } configurations = { } self.stackAdvisor.recommendYARNConfigurations(configurations, self.clusterData, services, self.hosts) # Check output self.assertEquals(configurations['hive-interactive-site']['properties']['hive.llap.daemon.queue.name'], self.expected_hive_interactive_site_llap['hive-interactive-site']['properties']['hive.llap.daemon.queue.name']) self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.llap.daemon.queue.name'], self.expected_hive_interactive_site_llap['hive-interactive-site']['property_attributes']['hive.llap.daemon.queue.name']) self.assertTrue('llap_queue_capacity' not in configurations['hive-interactive-env']['properties']) cap_sched_output_dict = convertToDict(configurations['capacity-scheduler']['properties']['capacity-scheduler']) cap_sched_expected_dict = convertToDict(self.expected_capacity_scheduler_llap_queue_size_40['properties']['capacity-scheduler']) self.assertEqual(cap_sched_output_dict, cap_sched_expected_dict) # Test 5: (1). 'llap' (20%) and 'default' (60%) queues exists at leaf level in capacity-scheduler # (2). llap is state = RUNNING, (3). llap_queue_capacity = 40, and (4). enable_hive_interactive' is 'ON'. # Expected : Existing llap queue's capacity in capacity-scheduler set to 40. def test_recommendYARNConfigurations_update_llap_queue_3(self): services = { "services": [{ "StackServices": { "service_name": "YARN", }, "Versions": { "stack_version": "2.5" }, "components": [ { "StackServiceComponents": { "component_name": "NODEMANAGER", "hostnames": ["c6401.ambari.apache.org"] } } ] }, { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE", "StackServices": { "service_name": "HIVE", "service_version": "1.2.1.2.5", "stack_name": "HDP", "stack_version": "2.5" }, "components": [ { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE/components/HIVE_SERVER_INTERACTIVE", "StackServiceComponents": { "advertise_version": "true", "bulk_commands_display_name": "", "bulk_commands_master_component_name": "", "cardinality": "0-1", "component_category": "MASTER", "component_name": "HIVE_SERVER_INTERACTIVE", "custom_commands": ["RESTART_LLAP"], "decommission_allowed": "false", "display_name": "HiveServer2 Interactive", "has_bulk_commands_definition": "false", "is_client": "false", "is_master": "true", "reassign_allowed": "false", "recovery_enabled": "false", "service_name": "HIVE", "stack_name": "HDP", "stack_version": "2.5", "hostnames": ["c6401.ambari.apache.org"] }, "dependencies": [] } ] } ], "changed-configurations": [ { u'old_value': u'', u'type': u'', u'name': u'' } ], "configurations": { "capacity-scheduler": { "properties": { "capacity-scheduler": "yarn.scheduler.capacity.root.accessible-node-labels=*\n" "yarn.scheduler.capacity.root.capacity=100\n" "yarn.scheduler.capacity.root.queues=default,llap\n" "yarn.scheduler.capacity.maximum-applications=10000\n" "yarn.scheduler.capacity.root.default.user-limit-factor=1\n" "yarn.scheduler.capacity.root.default.state=RUNNING\n" "yarn.scheduler.capacity.maximum-am-resource-percent=1\n" "yarn.scheduler.capacity.root.default.acl_submit_applications=*\n" "yarn.scheduler.capacity.root.default.capacity=80\n" "yarn.scheduler.capacity.root.acl_administer_queue=*\n" "yarn.scheduler.capacity.node-locality-delay=40\n" "yarn.scheduler.capacity.queue-mappings-override.enable=false\n" "yarn.scheduler.capacity.root.llap.user-limit-factor=1\n" "yarn.scheduler.capacity.root.llap.state=RUNNING\n" "yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n" "yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n" "yarn.scheduler.capacity.root.llap.maximum-capacity=20\n" "yarn.scheduler.capacity.root.default.maximum-capacity=80\n" "yarn.scheduler.capacity.root.llap.capacity=20\n" "yarn.scheduler.capacity.root.llap.acl_submit_applications=hive\n" "yarn.scheduler.capacity.root.llap.acl_administer_queue=hive\n" "yarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1\n" } }, "hive-interactive-env": { 'properties': { 'enable_hive_interactive': 'true', 'llap_queue_capacity':'40' } }, "hive-interactive-site": { 'properties': { 'hive.llap.daemon.queue.name':'llap' } }, "tez-interactive-site": { "properties": { "tez.am.resource.memory.mb": "341" } }, "yarn-site": { "properties": { "yarn.scheduler.minimum-allocation-mb": "341", "yarn.nodemanager.resource.memory-mb": "20000", "yarn.nodemanager.resource.cpu-vcores": '1' } }, "hive-env": { 'properties': { 'hive_user': 'hive' } }, "hive-site": { 'properties': { 'hive.tez.container.size': '341' } }, } } configurations = { } self.stackAdvisor.recommendYARNConfigurations(configurations, self.clusterData, services, self.hosts) # Check output self.assertEquals(configurations['hive-interactive-site']['properties']['hive.llap.daemon.queue.name'], self.expected_hive_interactive_site_llap['hive-interactive-site']['properties']['hive.llap.daemon.queue.name']) self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.llap.daemon.queue.name'], self.expected_hive_interactive_site_llap['hive-interactive-site']['property_attributes']['hive.llap.daemon.queue.name']) self.assertTrue('llap_queue_capacity' not in configurations['hive-interactive-env']['properties']) cap_sched_output_dict = convertToDict(configurations['capacity-scheduler']['properties']['capacity-scheduler']) cap_sched_expected_dict = convertToDict(self.expected_capacity_scheduler_llap_queue_size_40['properties']['capacity-scheduler']) self.assertEqual(cap_sched_output_dict, cap_sched_expected_dict) # Test 6: (1). Only default queue exists in capacity-scheduler (2). enable_hive_interactive' is 'Off' and # 'llap_queue_capacity is 0. # Expected : No changes def test_recommendYARNConfigurations_no_update_to_llap_queue_1(self): services = { "services": [{ "StackServices": { "service_name": "YARN", }, "Versions": { "stack_version": "2.5" }, "components": [ { "StackServiceComponents": { "component_name": "NODEMANAGER", "hostnames": ["c6401.ambari.apache.org"] } } ] }, { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE", "StackServices": { "service_name": "HIVE", "service_version": "1.2.1.2.5", "stack_name": "HDP", "stack_version": "2.5" }, "components": [ { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE/components/HIVE_SERVER_INTERACTIVE", "StackServiceComponents": { "advertise_version": "true", "bulk_commands_display_name": "", "bulk_commands_master_component_name": "", "cardinality": "0-1", "component_category": "MASTER", "component_name": "HIVE_SERVER_INTERACTIVE", "custom_commands": ["RESTART_LLAP"], "decommission_allowed": "false", "display_name": "HiveServer2 Interactive", "has_bulk_commands_definition": "false", "is_client": "false", "is_master": "true", "reassign_allowed": "false", "recovery_enabled": "false", "service_name": "HIVE", "stack_name": "HDP", "stack_version": "2.5", "hostnames": ["c6401.ambari.apache.org"] }, "dependencies": [] } ] } ], "changed-configurations": [ { u'old_value': u'', u'type': u'', u'name': u'' } ], "configurations": { "capacity-scheduler": { "properties": { "capacity-scheduler": "yarn.scheduler.capacity.root.queues=default\n" "yarn.scheduler.capacity.root.default.user-limit-factor=1\n" "yarn.scheduler.capacity.root.default.state=RUNNING\n" "yarn.scheduler.capacity.root.default.maximum-capacity=100\n" "yarn.scheduler.capacity.root.default.capacity=100\n" "yarn.scheduler.capacity.root.default.acl_submit_applications=*\n" "yarn.scheduler.capacity.root.capacity=100\n" "yarn.scheduler.capacity.root.acl_administer_queue=*\n" "yarn.scheduler.capacity.root.accessible-node-labels=*\n" "yarn.scheduler.capacity.node-locality-delay=40\n" "yarn.scheduler.capacity.maximum-applications=10000\n" "yarn.scheduler.capacity.maximum-am-resource-percent=1\n" "yarn.scheduler.capacity.queue-mappings-override.enable=false\n" } }, "hive-interactive-env": { 'properties': { 'enable_hive_interactive': 'false', 'llap_queue_capacity':'0' } }, "yarn-site": { "properties": { "yarn.scheduler.minimum-allocation-mb": "682", "yarn.nodemanager.resource.memory-mb": "2048" } }, "tez-interactive-site": { "properties": { "tez.am.resource.memory.mb": "341" } }, "hive-env": { 'properties': { 'hive_user': 'hive' } } } } configurations = { } self.stackAdvisor.recommendYARNConfigurations(configurations, self.clusterData, services, self.hosts) # Check output self.assertTrue('hive.llap.daemon.queue.name' not in configurations['hive-interactive-site']['properties']) self.assertTrue('property_attributes' not in configurations['hive-interactive-site']) self.assertTrue('hive-interactive-env' not in configurations) self.assertEquals(configurations['capacity-scheduler']['properties'],self.expected_capacity_scheduler_empty['properties']) # Test 7: (1). 'default' and 'llap' (State : RUNNING) queue exists at root level in capacity-scheduler, and # (2). enable_hive_interactive' is 'off'. # Expected : 'default' queue set to Size 100, 'llap' queue state set to STOPPED and sized to 0. def test_recommendYARNConfigurations_llap_queue_set_to_stopped_1(self): services = { "services": [{ "StackServices": { "service_name": "YARN", }, "Versions": { "stack_version": "2.5" }, "components": [ { "StackServiceComponents": { "component_name": "NODEMANAGER", "hostnames": ["c6401.ambari.apache.org"] } } ] }, { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE", "StackServices": { "service_name": "HIVE", "service_version": "1.2.1.2.5", "stack_name": "HDP", "stack_version": "2.5" }, "components": [ { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE/components/HIVE_SERVER_INTERACTIVE", "StackServiceComponents": { "advertise_version": "true", "bulk_commands_display_name": "", "bulk_commands_master_component_name": "", "cardinality": "0-1", "component_category": "MASTER", "component_name": "HIVE_SERVER_INTERACTIVE", "custom_commands": ["RESTART_LLAP"], "decommission_allowed": "false", "display_name": "HiveServer2 Interactive", "has_bulk_commands_definition": "false", "is_client": "false", "is_master": "true", "reassign_allowed": "false", "recovery_enabled": "false", "service_name": "HIVE", "stack_name": "HDP", "stack_version": "2.5", "hostnames": ["c6401.ambari.apache.org"] }, "dependencies": [] } ] } ], "changed-configurations": [ { u'old_value': u'', u'type': u'', u'name': u'' } ], "configurations": { "capacity-scheduler": { "properties": { "capacity-scheduler": "yarn.scheduler.capacity.root.accessible-node-labels=*\n" "yarn.scheduler.capacity.root.capacity=100\n" "yarn.scheduler.capacity.root.queues=default,llap\n" "yarn.scheduler.capacity.maximum-applications=10000\n" "yarn.scheduler.capacity.root.default.user-limit-factor=1\n" "yarn.scheduler.capacity.root.default.state=RUNNING\n" "yarn.scheduler.capacity.maximum-am-resource-percent=1\n" "yarn.scheduler.capacity.root.default.acl_submit_applications=*\n" "yarn.scheduler.capacity.root.default.capacity=80\n" "yarn.scheduler.capacity.root.acl_administer_queue=*\n" "yarn.scheduler.capacity.node-locality-delay=40\n" "yarn.scheduler.capacity.queue-mappings-override.enable=false\n" "yarn.scheduler.capacity.root.llap.user-limit-factor=1\n" "yarn.scheduler.capacity.root.llap.state=RUNNING\n" "yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n" "yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n" "yarn.scheduler.capacity.root.llap.maximum-capacity=20\n" "yarn.scheduler.capacity.root.default.maximum-capacity=100\n" "yarn.scheduler.capacity.root.llap.capacity=20\n" "yarn.scheduler.capacity.root.llap.acl_submit_applications=hive\n" "yarn.scheduler.capacity.root.llap.acl_administer_queue=hive\n" "yarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1\n" } }, "hive-interactive-env": { 'properties': { 'enable_hive_interactive': 'false' } }, "hive-interactive-site": { 'properties': { 'hive.llap.daemon.queue.name':'default' } }, "yarn-site": { "properties": { "yarn.scheduler.minimum-allocation-mb": "682", "yarn.nodemanager.resource.memory-mb": "2048" }, "tez-interactive-site": { "properties": { "tez.am.resource.memory.mb": "341" } }, }, "hive-env": { 'properties': { 'hive_user': 'hive' } } } } configurations = { } self.stackAdvisor.recommendYARNConfigurations(configurations, self.clusterData, services, self.hosts) # Check output self.assertEquals(configurations['hive-interactive-site']['properties']['hive.llap.daemon.queue.name'], self.expected_hive_interactive_site_default['hive-interactive-site']['properties']['hive.llap.daemon.queue.name']) self.assertFalse('property_attributes' in configurations['hive-interactive-site']) self.assertFalse('hive-interactive-env' in configurations) cap_sched_output_dict = convertToDict(configurations['capacity-scheduler']['properties']['capacity-scheduler']) cap_sched_expected_dict = convertToDict(self.expected_capacity_scheduler_llap_Stopped_size_0['properties']['capacity-scheduler']) self.assertEqual(cap_sched_output_dict, cap_sched_expected_dict) # Test 8: (1). More than 2 queues at leaf level exists in capacity-scheduler (no queue is named 'llap') # (2). enable_hive_interactive' is 'off'. # Expected : No changes. def test_recommendYARNConfigurations_no_update_to_llap_queue_2(self): services= { "services": [{ "StackServices": { "service_name": "YARN", }, "Versions": { "stack_version": "2.5" }, "components": [ { "StackServiceComponents": { "component_name": "NODEMANAGER", "hostnames": ["c6401.ambari.apache.org"] } } ] }, { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE", "StackServices": { "service_name": "HIVE", "service_version": "1.2.1.2.5", "stack_name": "HDP", "stack_version": "2.5" }, "components": [ { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE/components/HIVE_SERVER_INTERACTIVE", "StackServiceComponents": { "advertise_version": "true", "bulk_commands_display_name": "", "bulk_commands_master_component_name": "", "cardinality": "0-1", "component_category": "MASTER", "component_name": "HIVE_SERVER_INTERACTIVE", "custom_commands": ["RESTART_LLAP"], "decommission_allowed": "false", "display_name": "HiveServer2 Interactive", "has_bulk_commands_definition": "false", "is_client": "false", "is_master": "true", "reassign_allowed": "false", "recovery_enabled": "false", "service_name": "HIVE", "stack_name": "HDP", "stack_version": "2.5", "hostnames": ["c6401.ambari.apache.org"] }, "dependencies": [] } ] } ], "changed-configurations": [ { u'old_value': u'', u'type': u'', u'name': u'' } ], "configurations": { "capacity-scheduler": { "properties": { "capacity-scheduler": "yarn.scheduler.capacity.maximum-am-resource-percent=0.2\n" "yarn.scheduler.capacity.maximum-applications=10000\n" "yarn.scheduler.capacity.node-locality-delay=40\n" "yarn.scheduler.capacity.queue-mappings-override.enable=false\n" "yarn.scheduler.capacity.resource-calculator=org.apache.hadoop.yarn.util.resource.DefaultResourceCalculator\n" "yarn.scheduler.capacity.root.accessible-node-labels=*\n" "yarn.scheduler.capacity.root.acl_administer_queue=*\n" "yarn.scheduler.capacity.root.capacity=100\n" "yarn.scheduler.capacity.root.default.a.a1.acl_administer_queue=*\n" "yarn.scheduler.capacity.root.default.a.a1.acl_submit_applications=*\n" "yarn.scheduler.capacity.root.default.a.a1.capacity=75\n" "yarn.scheduler.capacity.root.default.a.a1.maximum-capacity=100\n" "yarn.scheduler.capacity.root.default.a.a1.minimum-user-limit-percent=100\n" "yarn.scheduler.capacity.root.default.a.a1.ordering-policy=fifo\n" "yarn.scheduler.capacity.root.default.a.a1.state=RUNNING\n" "yarn.scheduler.capacity.root.default.a.a1.user-limit-factor=1\n" "yarn.scheduler.capacity.root.default.a.a2.acl_administer_queue=*\n" "yarn.scheduler.capacity.root.default.a.a2.acl_submit_applications=*\n" "yarn.scheduler.capacity.root.default.a.a2.capacity=25\n" "yarn.scheduler.capacity.root.default.a.a2.maximum-capacity=25\n" "yarn.scheduler.capacity.root.default.a.a2.minimum-user-limit-percent=100\n" "yarn.scheduler.capacity.root.default.a.a2.ordering-policy=fifo\n" "yarn.scheduler.capacity.root.default.a.a2.state=RUNNING\n" "yarn.scheduler.capacity.root.default.a.a2.user-limit-factor=1\n" "yarn.scheduler.capacity.root.default.a.acl_administer_queue=*\n" "yarn.scheduler.capacity.root.default.a.acl_submit_applications=*\n" "yarn.scheduler.capacity.root.default.a.capacity=50\n" "yarn.scheduler.capacity.root.default.a.maximum-capacity=100\n" "yarn.scheduler.capacity.root.default.a.minimum-user-limit-percent=100\n" "yarn.scheduler.capacity.root.default.a.ordering-policy=fifo\n" "yarn.scheduler.capacity.root.default.a.queues=a1,a2\n" "yarn.scheduler.capacity.root.default.a.state=RUNNING\n" "yarn.scheduler.capacity.root.default.a.user-limit-factor=1\n" "yarn.scheduler.capacity.root.default.acl_submit_applications=*\n" "yarn.scheduler.capacity.root.default.b.acl_administer_queue=*\n" "yarn.scheduler.capacity.root.default.b.acl_submit_applications=*\n" "yarn.scheduler.capacity.root.default.b.capacity=50\n" "yarn.scheduler.capacity.root.default.b.maximum-capacity=50\n" "yarn.scheduler.capacity.root.default.b.minimum-user-limit-percent=100\n" "yarn.scheduler.capacity.root.default.b.ordering-policy=fifo\n" "yarn.scheduler.capacity.root.default.b.state=RUNNING\n" "yarn.scheduler.capacity.root.default.b.user-limit-factor=1\n" "yarn.scheduler.capacity.root.default.capacity=100\n" "yarn.scheduler.capacity.root.default.maximum-capacity=100\n" "yarn.scheduler.capacity.root.default.queues=a,b\n" "yarn.scheduler.capacity.root.default.state=RUNNING\n" "yarn.scheduler.capacity.root.default.user-limit-factor=1\n" "yarn.scheduler.capacity.root.queues=default" } }, "hive-interactive-env": { 'properties': { 'enable_hive_interactive': 'false', 'llap_queue_capacity':'0' } }, "tez-interactive-site": { "properties": { "tez.am.resource.memory.mb": "341" } }, "hive-env": { 'properties': { 'hive_user': 'hive' } } } } configurations = { } self.stackAdvisor.recommendYARNConfigurations(configurations, self.clusterData, services, self.hosts) # Check output self.assertEquals(configurations['hive-interactive-site']['properties'], self.expected_hive_interactive_site_empty['hive-interactive-site']['properties']) self.assertEquals(configurations['capacity-scheduler']['properties'], self.expected_capacity_scheduler_empty['properties']) self.assertFalse('hive-interactive-env' in configurations) # Test 9: (1). More than 2 queues at leaf level exists in capacity-scheduler (one queue is named 'llap') # (2). enable_hive_interactive' is 'off'. # Expected : No changes. def test_recommendYARNConfigurations_no_update_to_llap_queue_3(self): services= { "services": [{ "StackServices": { "service_name": "YARN", }, "Versions": { "stack_version": "2.5" }, "components": [ { "StackServiceComponents": { "component_name": "NODEMANAGER", "hostnames": ["c6401.ambari.apache.org"] } } ] }, { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE", "StackServices": { "service_name": "HIVE", "service_version": "1.2.1.2.5", "stack_name": "HDP", "stack_version": "2.5" }, "components": [ { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE/components/HIVE_SERVER_INTERACTIVE", "StackServiceComponents": { "advertise_version": "true", "bulk_commands_display_name": "", "bulk_commands_master_component_name": "", "cardinality": "0-1", "component_category": "MASTER", "component_name": "HIVE_SERVER_INTERACTIVE", "custom_commands": ["RESTART_LLAP"], "decommission_allowed": "false", "display_name": "HiveServer2 Interactive", "has_bulk_commands_definition": "false", "is_client": "false", "is_master": "true", "reassign_allowed": "false", "recovery_enabled": "false", "service_name": "HIVE", "stack_name": "HDP", "stack_version": "2.5", "hostnames": ["c6401.ambari.apache.org"] }, "dependencies": [] } ] } ], "changed-configurations": [ { u'old_value': u'', u'type': u'', u'name': u'' } ], "configurations": { "capacity-scheduler": { "properties": { "capacity-scheduler": "yarn.scheduler.capacity.maximum-am-resource-percent=0.2\n" "yarn.scheduler.capacity.maximum-applications=10000\n" "yarn.scheduler.capacity.node-locality-delay=40\n" "yarn.scheduler.capacity.queue-mappings-override.enable=false\n" "yarn.scheduler.capacity.resource-calculator=org.apache.hadoop.yarn.util.resource.DefaultResourceCalculator\n" "yarn.scheduler.capacity.root.accessible-node-labels=*\n" "yarn.scheduler.capacity.root.acl_administer_queue=*\n" "yarn.scheduler.capacity.root.capacity=100\n" "yarn.scheduler.capacity.root.default.a.a1.acl_administer_queue=*\n" "yarn.scheduler.capacity.root.default.a.a1.acl_submit_applications=*\n" "yarn.scheduler.capacity.root.default.a.a1.capacity=75\n" "yarn.scheduler.capacity.root.default.a.a1.maximum-capacity=100\n" "yarn.scheduler.capacity.root.default.a.a1.minimum-user-limit-percent=100\n" "yarn.scheduler.capacity.root.default.a.a1.ordering-policy=fifo\n" "yarn.scheduler.capacity.root.default.a.a1.state=RUNNING\n" "yarn.scheduler.capacity.root.default.a.a1.user-limit-factor=1\n" "yarn.scheduler.capacity.root.default.a.llap.acl_administer_queue=*\n" "yarn.scheduler.capacity.root.default.a.llap.acl_submit_applications=*\n" "yarn.scheduler.capacity.root.default.a.llap.capacity=25\n" "yarn.scheduler.capacity.root.default.a.llap.maximum-capacity=25\n" "yarn.scheduler.capacity.root.default.a.llap.minimum-user-limit-percent=100\n" "yarn.scheduler.capacity.root.default.a.llap.ordering-policy=fifo\n" "yarn.scheduler.capacity.root.default.a.llap.state=RUNNING\n" "yarn.scheduler.capacity.root.default.a.llap.user-limit-factor=1\n" "yarn.scheduler.capacity.root.default.a.acl_administer_queue=*\n" "yarn.scheduler.capacity.root.default.a.acl_submit_applications=*\n" "yarn.scheduler.capacity.root.default.a.capacity=50\n" "yarn.scheduler.capacity.root.default.a.maximum-capacity=100\n" "yarn.scheduler.capacity.root.default.a.minimum-user-limit-percent=100\n" "yarn.scheduler.capacity.root.default.a.ordering-policy=fifo\n" "yarn.scheduler.capacity.root.default.a.queues=a1,llap\n" "yarn.scheduler.capacity.root.default.a.state=RUNNING\n" "yarn.scheduler.capacity.root.default.a.user-limit-factor=1\n" "yarn.scheduler.capacity.root.default.acl_submit_applications=*\n" "yarn.scheduler.capacity.root.default.b.acl_administer_queue=*\n" "yarn.scheduler.capacity.root.default.b.acl_submit_applications=*\n" "yarn.scheduler.capacity.root.default.b.capacity=50\n" "yarn.scheduler.capacity.root.default.b.maximum-capacity=50\n" "yarn.scheduler.capacity.root.default.b.minimum-user-limit-percent=100\n" "yarn.scheduler.capacity.root.default.b.ordering-policy=fifo\n" "yarn.scheduler.capacity.root.default.b.state=RUNNING\n" "yarn.scheduler.capacity.root.default.b.user-limit-factor=1\n" "yarn.scheduler.capacity.root.default.capacity=100\n" "yarn.scheduler.capacity.root.default.maximum-capacity=100\n" "yarn.scheduler.capacity.root.default.queues=a,b\n" "yarn.scheduler.capacity.root.default.state=RUNNING\n" "yarn.scheduler.capacity.root.default.user-limit-factor=1\n" "yarn.scheduler.capacity.root.queues=default" } }, "hive-interactive-env": { 'properties': { 'enable_hive_interactive': 'false', 'llap_queue_capacity':'0' } }, "hive-env": { 'properties': { 'hive_user': 'hive' } } } } configurations = { } self.stackAdvisor.recommendYARNConfigurations(configurations, self.clusterData, services, self.hosts) # Check output self.assertEquals(configurations['hive-interactive-site']['properties'], self.expected_hive_interactive_site_empty['hive-interactive-site']['properties']) self.assertEquals(configurations['capacity-scheduler']['properties'], self.expected_capacity_scheduler_empty['properties']) self.assertFalse('hive-interactive-env' in configurations) # Test 10: (1). 'llap' (Cap: 0%, State: STOPPED) and 'default' (100%) queues exists at leaf level # in capacity-scheduler # (2). enable_hive_interactive' is 'off'. # Expected : No changes. def test_recommendYARNConfigurations_no_update_to_llap_queue_4(self): services = { "services": [{ "StackServices": { "service_name": "YARN", }, "Versions": { "stack_version": "2.5" }, "components": [ { "StackServiceComponents": { "component_name": "NODEMANAGER", "hostnames": ["c6401.ambari.apache.org"] } } ] }, { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE", "StackServices": { "service_name": "HIVE", "service_version": "1.2.1.2.5", "stack_name": "HDP", "stack_version": "2.5" }, "components": [ { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE/components/HIVE_SERVER_INTERACTIVE", "StackServiceComponents": { "advertise_version": "true", "bulk_commands_display_name": "", "bulk_commands_master_component_name": "", "cardinality": "0-1", "component_category": "MASTER", "component_name": "HIVE_SERVER_INTERACTIVE", "custom_commands": ["RESTART_LLAP"], "decommission_allowed": "false", "display_name": "HiveServer2 Interactive", "has_bulk_commands_definition": "false", "is_client": "false", "is_master": "true", "reassign_allowed": "false", "recovery_enabled": "false", "service_name": "HIVE", "stack_name": "HDP", "stack_version": "2.5", "hostnames": ["c6401.ambari.apache.org"] }, "dependencies": [] } ] } ], "changed-configurations": [ { u'old_value': u'', u'type': u'', u'name': u'' } ], "configurations": { "capacity-scheduler": { "properties": { "capacity-scheduler": "yarn.scheduler.capacity.root.accessible-node-labels=*\n" "yarn.scheduler.capacity.root.capacity=100\n" "yarn.scheduler.capacity.root.queues=default,llap\n" "yarn.scheduler.capacity.maximum-applications=10000\n" "yarn.scheduler.capacity.root.default.user-limit-factor=1\n" "yarn.scheduler.capacity.root.default.state=RUNNING\n" "yarn.scheduler.capacity.maximum-am-resource-percent=1\n" "yarn.scheduler.capacity.root.default.acl_submit_applications=*\n" "yarn.scheduler.capacity.root.default.capacity=100\n" "yarn.scheduler.capacity.root.acl_administer_queue=*\n" "yarn.scheduler.capacity.node-locality-delay=40\n" "yarn.scheduler.capacity.queue-mappings-override.enable=false\n" "yarn.scheduler.capacity.root.llap.user-limit-factor=1\n" "yarn.scheduler.capacity.root.llap.state=STOPPED\n" "yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n" "yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n" "yarn.scheduler.capacity.root.llap.maximum-capacity=0\n" "yarn.scheduler.capacity.root.default.maximum-capacity=100\n" "yarn.scheduler.capacity.root.llap.capacity=0\n" "yarn.scheduler.capacity.root.llap.acl_submit_applications=hive\n" "yarn.scheduler.capacity.root.llap.acl_administer_queue=hive\n" "yarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1\n" } }, "hive-interactive-env": { 'properties': { 'enable_hive_interactive': 'false' } }, "hive-env": { 'properties': { 'hive_user': 'hive' } } } } configurations = { } self.stackAdvisor.recommendYARNConfigurations(configurations, self.clusterData, services, self.hosts) # Check output self.assertEquals(configurations['hive-interactive-site']['properties'], self.expected_hive_interactive_site_empty['hive-interactive-site']['properties']) self.assertEquals(configurations['capacity-scheduler']['properties'], self.expected_capacity_scheduler_empty['properties']) self.assertFalse('hive-interactive-env' in configurations) # Test 11: YARN service with : (1). 'capacity scheduler' having 'llap' (state:stopped) and 'default' queue at # root level and (2). 'enable_hive_interactive' is ON and (3). 'hive.llap.daemon.queue.name' == 'default' def test_recommendYARNConfigurations_no_update_to_llap_queue_5(self): services_15 = { "services": [{ "StackServices": { "service_name": "YARN", }, "Versions": { "stack_version": "2.5" }, "components": [ { "StackServiceComponents": { "component_name": "NODEMANAGER", "hostnames": ["c6401.ambari.apache.org"] } } ] }, { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE", "StackServices": { "service_name": "HIVE", "service_version": "1.2.1.2.5", "stack_name": "HDP", "stack_version": "2.5" }, "components": [ { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE/components/HIVE_SERVER_INTERACTIVE", "StackServiceComponents": { "advertise_version": "true", "bulk_commands_display_name": "", "bulk_commands_master_component_name": "", "cardinality": "0-1", "component_category": "MASTER", "component_name": "HIVE_SERVER_INTERACTIVE", "custom_commands": ["RESTART_LLAP"], "decommission_allowed": "false", "display_name": "HiveServer2 Interactive", "has_bulk_commands_definition": "false", "is_client": "false", "is_master": "true", "reassign_allowed": "false", "recovery_enabled": "false", "service_name": "HIVE", "stack_name": "HDP", "stack_version": "2.5", "hostnames": ["c6401.ambari.apache.org"] }, "dependencies": [] }, { "StackServiceComponents": { "advertise_version": "true", "cardinality": "1+", "component_category": "SLAVE", "component_name": "NODEMANAGER", "display_name": "NodeManager", "is_client": "false", "is_master": "false", "hostnames": [ "c6403.ambari.apache.org" ] }, "dependencies": [] }, ] } ], "changed-configurations": [ { u'old_value': u'0', u'type': u'hive-interactive-env', u'name': u'llap_queue_capacity' } ], "configurations": { "capacity-scheduler": { "properties": { "capacity-scheduler": 'yarn.scheduler.capacity.root.default.maximum-capacity=60\n' 'yarn.scheduler.capacity.root.accessible-node-labels=*\n' 'yarn.scheduler.capacity.root.capacity=100\n' 'yarn.scheduler.capacity.root.queues=default,llap\n' 'yarn.scheduler.capacity.maximum-applications=10000\n' 'yarn.scheduler.capacity.root.default.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.default.state=RUNNING\n' 'yarn.scheduler.capacity.maximum-am-resource-percent=1\n' 'yarn.scheduler.capacity.root.default.acl_submit_applications=*\n' 'yarn.scheduler.capacity.root.default.capacity=60\n' 'yarn.scheduler.capacity.root.acl_administer_queue=*\n' 'yarn.scheduler.capacity.node-locality-delay=40\n' 'yarn.scheduler.capacity.queue-mappings-override.enable=false\n' 'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.llap.state=STOPPED\n' 'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n' 'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n' 'yarn.scheduler.capacity.root.llap.maximum-capacity=40\n' 'yarn.scheduler.capacity.root.llap.capacity=40\n' 'yarn.scheduler.capacity.root.llap.acl_submit_applications=hive\n' 'yarn.scheduler.capacity.root.llap.acl_administer_queue=hive\n' 'yarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1' } }, "hive-interactive-env": { 'properties': { 'enable_hive_interactive': 'true', 'llap_queue_capacity':'40' } }, "hive-interactive-site": { 'properties': { 'hive.llap.daemon.queue.name': 'default', 'hive.server2.tez.sessions.per.default.queue': '1' } }, "hive-env": { 'properties': { 'hive_user': 'hive' } }, "yarn-site": { "properties": { "yarn.scheduler.minimum-allocation-mb": "341", "yarn.nodemanager.resource.memory-mb": "4096", "yarn.nodemanager.resource.cpu-vcores": '1' } }, "tez-interactive-site": { "properties": { "tez.am.resource.memory.mb": "341" } }, "hive-site": { 'properties': { 'hive.tez.container.size': '341' } }, } } configurations = { } self.stackAdvisor.recommendYARNConfigurations(configurations, self.clusterData, services_15, self.hosts) # Check output self.assertEquals(configurations['capacity-scheduler']['properties'], self.expected_capacity_scheduler_empty['properties']) self.assertEquals(configurations['hive-interactive-site']['properties'], self.expected_hive_interactive_site_only_memory['hive-interactive-site']['properties']) self.assertEquals(configurations['hive-interactive-env']['properties'], self.expected_hive_interactive_env_empty['hive-interactive-env']['properties']) self.assertEquals(configurations['hive-interactive-env']['property_attributes']['llap_queue_capacity'], self.expected_visibility_false) # Test 12: capacity-scheduler not present as input in services. # Expected : No changes. def test_recommendYARNConfigurations_no_update_to_llap_queue_5(self): services= { "services": [{ "StackServices": { "service_name": "YARN", }, "Versions": { "stack_version": "2.5" }, "components": [ { "StackServiceComponents": { "component_name": "NODEMANAGER", "hostnames": ["c6401.ambari.apache.org"] } } ] }, { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE", "StackServices": { "service_name": "HIVE", "service_version": "1.2.1.2.5", "stack_name": "HDP", "stack_version": "2.5" }, "components": [ { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE/components/HIVE_SERVER_INTERACTIVE", "StackServiceComponents": { "advertise_version": "true", "bulk_commands_display_name": "", "bulk_commands_master_component_name": "", "cardinality": "0-1", "component_category": "MASTER", "component_name": "HIVE_SERVER_INTERACTIVE", "custom_commands": ["RESTART_LLAP"], "decommission_allowed": "false", "display_name": "HiveServer2 Interactive", "has_bulk_commands_definition": "false", "is_client": "false", "is_master": "true", "reassign_allowed": "false", "recovery_enabled": "false", "service_name": "HIVE", "stack_name": "HDP", "stack_version": "2.5", "hostnames": ["c6401.ambari.apache.org"] }, "dependencies": [] } ] } ], "changed-configurations": [ { u'old_value': u'', u'type': u'', u'name': u'' } ], "configurations": { "capacity-scheduler": { "properties": { } }, "hive-interactive-env": { 'properties': { 'enable_hive_interactive': 'false', 'llap_queue_capacity':'0' } }, "hive-env": { 'properties': { 'hive_user': 'hive' } } } } configurations = { } self.stackAdvisor.recommendYARNConfigurations(configurations, self.clusterData, services, self.hosts) # Check output self.assertEquals(configurations['capacity-scheduler']['properties'], self.expected_capacity_scheduler_empty['properties']) self.assertFalse('hive-interactive-env' in configurations) self.assertEquals(configurations['hive-interactive-site']['properties'], self.expected_hive_interactive_site_empty['hive-interactive-site']['properties']) # Test 13: capacity-scheduler malformed as input in services. # Expected : No changes. def test_recommendYARNConfigurations_no_update_to_llap_queue_6(self): services= { "services": [{ "StackServices": { "service_name": "YARN", }, "Versions": { "stack_version": "2.5" }, "components": [ { "StackServiceComponents": { "component_name": "NODEMANAGER", "hostnames": ["c6401.ambari.apache.org"] } } ] }, { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE", "StackServices": { "service_name": "HIVE", "service_version": "1.2.1.2.5", "stack_name": "HDP", "stack_version": "2.5" }, "components": [ { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE/components/HIVE_SERVER_INTERACTIVE", "StackServiceComponents": { "advertise_version": "true", "bulk_commands_display_name": "", "bulk_commands_master_component_name": "", "cardinality": "0-1", "component_category": "MASTER", "component_name": "HIVE_SERVER_INTERACTIVE", "custom_commands": ["RESTART_LLAP"], "decommission_allowed": "false", "display_name": "HiveServer2 Interactive", "has_bulk_commands_definition": "false", "is_client": "false", "is_master": "true", "reassign_allowed": "false", "recovery_enabled": "false", "service_name": "HIVE", "stack_name": "HDP", "stack_version": "2.5", "hostnames": ["c6401.ambari.apache.org"] }, "dependencies": [] } ] } ], "changed-configurations": [ { u'old_value': u'', u'type': u'', u'name': u'' } ], "configurations": { "capacity-scheduler": { "properties": { "capacity-scheduler": "yarn.scheduler.capacity.root.default.a.a1.acl_submit_applications=*\n" "yarn.scheduler.capacity.root.default.a.a1.capacity=75\n" "yarn.scheduler.capacity.root.default.a.a1.maximum-capacity=100\n" } }, "hive-interactive-env": { 'properties': { 'enable_hive_interactive': 'false', 'llap_queue_capacity':'0' } }, "hive-env": { 'properties': { 'hive_user': 'hive' } } } } configurations = { } self.stackAdvisor.recommendYARNConfigurations(configurations, self.clusterData, services, self.hosts) # Check output self.assertEquals(configurations['capacity-scheduler']['properties'], self.expected_capacity_scheduler_empty['properties']) self.assertFalse('hive-interactive-env' in configurations) self.assertEquals(configurations['hive-interactive-site']['properties'], self.expected_hive_interactive_site_empty['hive-interactive-site']['properties']) # Test 14 : (1). 'default' and 'llap' (State : RUNNING) queue exists at root level in capacity-scheduler, and # (2). enable_hive_interactive' is 'OFF' and (3). configuration change detected for 'enable_hive_interactive' # Expected : Configurations values not recommended for llap related configs. def test_recommendYARNConfigurations_llap_configs_not_updated_1(self): services = { "services": [{ "StackServices": { "service_name": "YARN", }, "Versions": { "stack_version": "2.5" }, "components": [ { "StackServiceComponents": { "component_name": "NODEMANAGER", "hostnames": ["c6401.ambari.apache.org"] } } ] }, { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE", "StackServices": { "service_name": "HIVE", "service_version": "1.2.1.2.5", "stack_name": "HDP", "stack_version": "2.5" }, "components": [ { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE/components/HIVE_SERVER_INTERACTIVE", "StackServiceComponents": { "advertise_version": "true", "bulk_commands_display_name": "", "bulk_commands_master_component_name": "", "cardinality": "0-1", "component_category": "MASTER", "component_name": "HIVE_SERVER_INTERACTIVE", "custom_commands": ["RESTART_LLAP"], "decommission_allowed": "false", "display_name": "HiveServer2 Interactive", "has_bulk_commands_definition": "false", "is_client": "false", "is_master": "true", "reassign_allowed": "false", "recovery_enabled": "false", "service_name": "HIVE", "stack_name": "HDP", "stack_version": "2.5", "hostnames": ["c6401.ambari.apache.org"] }, "dependencies": [] }, { "StackServiceComponents": { "advertise_version": "true", "cardinality": "1+", "component_category": "SLAVE", "component_name": "NODEMANAGER", "display_name": "NodeManager", "is_client": "false", "is_master": "false", "hostnames": [ "c6403.ambari.apache.org" ] }, "dependencies": [] }, ] } ], "changed-configurations": [ { u'old_value': u'false', u'type': u'hive-interactive-env', u'name': u'enable_hive_interactive' } ], "configurations": { "capacity-scheduler": { "properties": { "capacity-scheduler": 'yarn.scheduler.capacity.root.default.maximum-capacity=60\n' 'yarn.scheduler.capacity.root.accessible-node-labels=*\n' 'yarn.scheduler.capacity.root.capacity=100\n' 'yarn.scheduler.capacity.root.queues=default,llap\n' 'yarn.scheduler.capacity.maximum-applications=10000\n' 'yarn.scheduler.capacity.root.default.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.default.state=RUNNING\n' 'yarn.scheduler.capacity.maximum-am-resource-percent=1\n' 'yarn.scheduler.capacity.root.default.acl_submit_applications=*\n' 'yarn.scheduler.capacity.root.default.capacity=60\n' 'yarn.scheduler.capacity.root.acl_administer_queue=*\n' 'yarn.scheduler.capacity.node-locality-delay=40\n' 'yarn.scheduler.capacity.queue-mappings-override.enable=false\n' 'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.llap.state=RUNNING\n' 'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n' 'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n' 'yarn.scheduler.capacity.root.llap.maximum-capacity=40\n' 'yarn.scheduler.capacity.root.llap.capacity=40\n' 'yarn.scheduler.capacity.root.llap.acl_submit_applications=hive\n' 'yarn.scheduler.capacity.root.llap.acl_administer_queue=hive\n' 'yarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1' } }, "hive-interactive-env": { 'properties': { 'enable_hive_interactive': 'false', 'llap_queue_capacity':'40' } }, "hive-interactive-site": { 'properties': { 'hive.llap.daemon.queue.name': 'llap', 'hive.server2.tez.sessions.per.default.queue': '1' } }, "hive-env": { 'properties': { 'hive_user': 'hive' } }, "yarn-site": { "properties": { "yarn.scheduler.minimum-allocation-mb": "341", "yarn.nodemanager.resource.memory-mb": "4096", "yarn.nodemanager.resource.cpu-vcores": '1' } }, "tez-interactive-site": { "properties": { "tez.am.resource.memory.mb": "341" } } } } configurations = { } self.stackAdvisor.recommendYARNConfigurations(configurations, self.clusterData, services, self.hosts) cap_sched_output_dict = convertToDict(configurations['capacity-scheduler']['properties']['capacity-scheduler']) cap_sched_expected_dict = convertToDict(self.expected_capacity_scheduler_llap_Stopped_size_0['properties']['capacity-scheduler']) self.assertEqual(cap_sched_output_dict, cap_sched_expected_dict) self.assertEquals(configurations['hive-interactive-site']['properties'], self.expected_hive_interactive_site_default['hive-interactive-site']['properties']) self.assertTrue('hive-interactive-env' not in configurations) self.assertTrue('property_attributes' not in configurations) # Test 15 : (1). 'default' and 'llap' (State : RUNNING) queue exists at root level in capacity-scheduler, and # (2). enable_hive_interactive' is 'OFF' and (3). configuration change NOT detected for 'enable_hive_interactive' # Expected : No changes. def test_recommendYARNConfigurations_llap_configs_not_updated_2(self): services_18 = { "services": [{ "StackServices": { "service_name": "YARN", }, "Versions": { "stack_version": "2.5" }, "components": [ { "StackServiceComponents": { "component_name": "NODEMANAGER", "hostnames": ["c6401.ambari.apache.org"] } } ] }, { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE", "StackServices": { "service_name": "HIVE", "service_version": "1.2.1.2.5", "stack_name": "HDP", "stack_version": "2.5" }, "components": [ { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE/components/HIVE_SERVER_INTERACTIVE", "StackServiceComponents": { "advertise_version": "true", "bulk_commands_display_name": "", "bulk_commands_master_component_name": "", "cardinality": "0-1", "component_category": "MASTER", "component_name": "HIVE_SERVER_INTERACTIVE", "custom_commands": ["RESTART_LLAP"], "decommission_allowed": "false", "display_name": "HiveServer2 Interactive", "has_bulk_commands_definition": "false", "is_client": "false", "is_master": "true", "reassign_allowed": "false", "recovery_enabled": "false", "service_name": "HIVE", "stack_name": "HDP", "stack_version": "2.5", "hostnames": ["c6401.ambari.apache.org"] }, "dependencies": [] }, { "StackServiceComponents": { "advertise_version": "true", "cardinality": "1+", "component_category": "SLAVE", "component_name": "NODEMANAGER", "display_name": "NodeManager", "is_client": "false", "is_master": "false", "hostnames": [ "c6403.ambari.apache.org" ] }, "dependencies": [] }, ] } ], "configurations": { "capacity-scheduler": { "properties": { "capacity-scheduler": 'yarn.scheduler.capacity.root.default.maximum-capacity=60\n' 'yarn.scheduler.capacity.root.accessible-node-labels=*\n' 'yarn.scheduler.capacity.root.capacity=100\n' 'yarn.scheduler.capacity.root.queues=default,llap\n' 'yarn.scheduler.capacity.maximum-applications=10000\n' 'yarn.scheduler.capacity.root.default.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.default.state=RUNNING\n' 'yarn.scheduler.capacity.maximum-am-resource-percent=1\n' 'yarn.scheduler.capacity.root.default.acl_submit_applications=*\n' 'yarn.scheduler.capacity.root.default.capacity=60\n' 'yarn.scheduler.capacity.root.acl_administer_queue=*\n' 'yarn.scheduler.capacity.node-locality-delay=40\n' 'yarn.scheduler.capacity.queue-mappings-override.enable=false\n' 'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.llap.state=STOPPED\n' 'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n' 'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n' 'yarn.scheduler.capacity.root.llap.maximum-capacity=40\n' 'yarn.scheduler.capacity.root.llap.capacity=40\n' 'yarn.scheduler.capacity.root.llap.acl_submit_applications=hive\n' 'yarn.scheduler.capacity.root.llap.acl_administer_queue=hive\n' 'yarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1' } }, "hive-interactive-env": { 'properties': { 'enable_hive_interactive': 'false', 'llap_queue_capacity':'40' } }, "hive-interactive-site": { 'properties': { 'hive.llap.daemon.queue.name': 'llap', 'hive.server2.tez.sessions.per.default.queue': '1' } }, "hive-env": { 'properties': { 'hive_user': 'hive' } }, "yarn-site": { "properties": { "yarn.scheduler.minimum-allocation-mb": "341", "yarn.nodemanager.resource.memory-mb": "4096", "yarn.nodemanager.resource.cpu-vcores": '1' } }, "tez-interactive-site": { "properties": { "tez.am.resource.memory.mb": "341" } } } } configurations = { } self.stackAdvisor.recommendYARNConfigurations(configurations, self.clusterData, services_18, self.hosts) self.assertEquals(configurations['capacity-scheduler']['properties'], self.expected_capacity_scheduler_empty['properties']) self.assertEquals(configurations['hive-interactive-site']['properties'], self.expected_hive_interactive_site_empty['hive-interactive-site']['properties']) self.assertTrue('hive-interactive-env' not in configurations) self.assertTrue('property_attributes' not in configurations) ####################### 'One Node Manager' cluster - tests for calculating llap configs ################ # Test 16: (1). 'default' and 'llap' (State : RUNNING) queue exists at root level in capacity-scheduler, and # (2). enable_hive_interactive' is 'on' and (3). configuration change detected for 'llap_queue_capacity' # Expected : Configurations values recommended for llap related configs. def test_recommendYARNConfigurations_one_node_manager_llap_configs_updated_1(self): services = { "services": [{ "StackServices": { "service_name": "YARN", }, "Versions": { "stack_version": "2.5" }, "components": [ { "StackServiceComponents": { "component_name": "NODEMANAGER", "hostnames": ["c6401.ambari.apache.org"] } } ] }, { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE", "StackServices": { "service_name": "HIVE", "service_version": "1.2.1.2.5", "stack_name": "HDP", "stack_version": "2.5" }, "components": [ { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE/components/HIVE_SERVER_INTERACTIVE", "StackServiceComponents": { "advertise_version": "true", "bulk_commands_display_name": "", "bulk_commands_master_component_name": "", "cardinality": "0-1", "component_category": "MASTER", "component_name": "HIVE_SERVER_INTERACTIVE", "custom_commands": ["RESTART_LLAP"], "decommission_allowed": "false", "display_name": "HiveServer2 Interactive", "has_bulk_commands_definition": "false", "is_client": "false", "is_master": "true", "reassign_allowed": "false", "recovery_enabled": "false", "service_name": "HIVE", "stack_name": "HDP", "stack_version": "2.5", "hostnames": ["c6401.ambari.apache.org"] }, "dependencies": [] }, { "StackServiceComponents": { "advertise_version": "true", "cardinality": "1+", "component_category": "SLAVE", "component_name": "NODEMANAGER", "display_name": "NodeManager", "is_client": "false", "is_master": "false", "hostnames": [ "c6403.ambari.apache.org" ] }, "dependencies": [] }, ] } ], "changed-configurations": [ { u'old_value': u'0', u'type': u'hive-interactive-env', u'name': u'llap_queue_capacity' } ], "configurations": { "capacity-scheduler": { "properties": { "capacity-scheduler": 'yarn.scheduler.capacity.root.default.maximum-capacity=60\n' 'yarn.scheduler.capacity.root.accessible-node-labels=*\n' 'yarn.scheduler.capacity.root.capacity=100\n' 'yarn.scheduler.capacity.root.queues=default,llap\n' 'yarn.scheduler.capacity.maximum-applications=10000\n' 'yarn.scheduler.capacity.root.default.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.default.state=RUNNING\n' 'yarn.scheduler.capacity.maximum-am-resource-percent=1\n' 'yarn.scheduler.capacity.root.default.acl_submit_applications=*\n' 'yarn.scheduler.capacity.root.default.capacity=80\n' 'yarn.scheduler.capacity.root.acl_administer_queue=*\n' 'yarn.scheduler.capacity.node-locality-delay=40\n' 'yarn.scheduler.capacity.queue-mappings-override.enable=false\n' 'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.llap.state=RUNNING\n' 'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n' 'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n' 'yarn.scheduler.capacity.root.llap.maximum-capacity=20\n' 'yarn.scheduler.capacity.root.llap.capacity=20\n' 'yarn.scheduler.capacity.root.llap.acl_submit_applications=hive\n' 'yarn.scheduler.capacity.root.llap.acl_administer_queue=hive\n' 'yarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1' } }, "hive-interactive-env": { 'properties': { 'enable_hive_interactive': 'true', 'llap_queue_capacity':'21' } }, "hive-interactive-site": { 'properties': { 'hive.llap.daemon.queue.name': 'llap', 'hive.server2.tez.sessions.per.default.queue': '1' } }, "hive-env": { 'properties': { 'hive_user': 'hive' } }, "yarn-site": { "properties": { "yarn.scheduler.minimum-allocation-mb": "512", "yarn.nodemanager.resource.memory-mb": "10240", "yarn.nodemanager.resource.cpu-vcores": '1' } }, "tez-interactive-site": { "properties": { "tez.am.resource.memory.mb": "512" } }, "hive-site": { 'properties': { 'hive.tez.container.size': '512' } }, } } configurations = { } self.stackAdvisor.recommendYARNConfigurations(configurations, self.clusterData, services, self.hosts) self.assertEqual(configurations['hive-interactive-site']['properties']['hive.server2.tez.sessions.per.default.queue'], '1') self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.server2.tez.sessions.per.default.queue'], {'minimum': '1', 'maximum': '32'}) self.assertEqual(configurations['hive-interactive-env']['properties']['num_llap_nodes'], '1') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.yarn.container.mb'], '1536') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.num.executors'], '1') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.io.memory.size'], '1024') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.io.enabled'], 'true') self.assertEqual(configurations['hive-interactive-env']['properties']['llap_heap_size'], '409') self.assertEqual(configurations['hive-interactive-env']['properties']['slider_am_container_size'], '512') # Test 17: (1). 'default' and 'llap' (State : RUNNING) queue exists at root level in capacity-scheduler, and # (2). enable_hive_interactive' is 'on' and (3). configuration change detected for 'enable_hive_interactive' # Expected : Configurations values recommended for llap related configs. def test_recommendYARNConfigurations_one_node_manager_llap_configs_updated_2(self): # Services 16: YARN service with : (1). 'capacity scheduler' having 'llap' and 'default' queue at root level and # (2). 'enable_hive_interactive' is ON and (3). configuration change detected for 'enable_hive_interactive' services = { "services": [{ "StackServices": { "service_name": "YARN", }, "Versions": { "stack_version": "2.5" }, "components": [ { "StackServiceComponents": { "component_name": "NODEMANAGER", "hostnames": ["c6401.ambari.apache.org"] } } ] }, { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE", "StackServices": { "service_name": "HIVE", "service_version": "1.2.1.2.5", "stack_name": "HDP", "stack_version": "2.5" }, "components": [ { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE/components/HIVE_SERVER_INTERACTIVE", "StackServiceComponents": { "advertise_version": "true", "bulk_commands_display_name": "", "bulk_commands_master_component_name": "", "cardinality": "0-1", "component_category": "MASTER", "component_name": "HIVE_SERVER_INTERACTIVE", "custom_commands": ["RESTART_LLAP"], "decommission_allowed": "false", "display_name": "HiveServer2 Interactive", "has_bulk_commands_definition": "false", "is_client": "false", "is_master": "true", "reassign_allowed": "false", "recovery_enabled": "false", "service_name": "HIVE", "stack_name": "HDP", "stack_version": "2.5", "hostnames": ["c6401.ambari.apache.org"] }, "dependencies": [] }, { "StackServiceComponents": { "advertise_version": "true", "cardinality": "1+", "component_category": "SLAVE", "component_name": "NODEMANAGER", "display_name": "NodeManager", "is_client": "false", "is_master": "false", "hostnames": [ "c6403.ambari.apache.org" ] }, "dependencies": [] }, ] } ], "changed-configurations": [ { u'old_value': u'false', u'type': u'hive-interactive-env', u'name': u'enable_hive_interactive' } ], "configurations": { "capacity-scheduler": { "properties": { "capacity-scheduler": 'yarn.scheduler.capacity.root.default.maximum-capacity=60\n' 'yarn.scheduler.capacity.root.accessible-node-labels=*\n' 'yarn.scheduler.capacity.root.capacity=100\n' 'yarn.scheduler.capacity.root.queues=default,llap\n' 'yarn.scheduler.capacity.maximum-applications=10000\n' 'yarn.scheduler.capacity.root.default.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.default.state=RUNNING\n' 'yarn.scheduler.capacity.maximum-am-resource-percent=1\n' 'yarn.scheduler.capacity.root.default.acl_submit_applications=*\n' 'yarn.scheduler.capacity.root.default.capacity=60\n' 'yarn.scheduler.capacity.root.acl_administer_queue=*\n' 'yarn.scheduler.capacity.node-locality-delay=40\n' 'yarn.scheduler.capacity.queue-mappings-override.enable=false\n' 'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.llap.state=RUNNING\n' 'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n' 'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n' 'yarn.scheduler.capacity.root.llap.maximum-capacity=40\n' 'yarn.scheduler.capacity.root.llap.capacity=40\n' 'yarn.scheduler.capacity.root.llap.acl_submit_applications=hive\n' 'yarn.scheduler.capacity.root.llap.acl_administer_queue=hive\n' 'yarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1' } }, "hive-interactive-env": { 'properties': { 'enable_hive_interactive': 'true', 'llap_queue_capacity':'41' } }, "hive-interactive-site": { 'properties': { 'hive.llap.daemon.queue.name': 'llap', 'hive.server2.tez.sessions.per.default.queue': '1' } }, "hive-env": { 'properties': { 'hive_user': 'hive' } }, "yarn-site": { "properties": { "yarn.scheduler.minimum-allocation-mb": "341", "yarn.nodemanager.resource.memory-mb": "10240", "yarn.nodemanager.resource.cpu-vcores": '1' } }, "tez-interactive-site": { "properties": { "tez.am.resource.memory.mb": "341" } }, "hive-site": { 'properties': { 'hive.tez.container.size': '341' } }, } } configurations = { } self.stackAdvisor.recommendYARNConfigurations(configurations, self.clusterData, services, self.hosts) self.assertEqual(configurations['hive-interactive-site']['properties']['hive.server2.tez.sessions.per.default.queue'], '3') self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.server2.tez.sessions.per.default.queue'], {'minimum': '1', 'maximum': '32'}) self.assertEqual(configurations['hive-interactive-env']['properties']['num_llap_nodes'], '1') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.yarn.container.mb'], '3069') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.num.executors'], '1') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.io.memory.size'], '2728') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.io.enabled'], 'true') self.assertEqual(configurations['hive-interactive-env']['properties']['llap_heap_size'], '272') self.assertEqual(configurations['hive-interactive-env']['properties']['slider_am_container_size'], '341') # Test 18: (1). 'default' and 'llap' (State : RUNNING) queue exists at root level in capacity-scheduler, and # (2). enable_hive_interactive' is 'on' and (3). configuration change detected for 'hive.server2.tez.sessions.per.default.queue' # Expected : Configurations values recommended for llap related configs. def test_recommendYARNConfigurations_one_node_manager_llap_configs_updated_3(self): services = { "services": [{ "StackServices": { "service_name": "YARN", }, "Versions": { "stack_version": "2.5" }, "components": [ { "StackServiceComponents": { "component_name": "NODEMANAGER", "hostnames": ["c6401.ambari.apache.org"] } } ] }, { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE", "StackServices": { "service_name": "HIVE", "service_version": "1.2.1.2.5", "stack_name": "HDP", "stack_version": "2.5" }, "components": [ { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE/components/HIVE_SERVER_INTERACTIVE", "StackServiceComponents": { "advertise_version": "true", "bulk_commands_display_name": "", "bulk_commands_master_component_name": "", "cardinality": "0-1", "component_category": "MASTER", "component_name": "HIVE_SERVER_INTERACTIVE", "custom_commands": ["RESTART_LLAP"], "decommission_allowed": "false", "display_name": "HiveServer2 Interactive", "has_bulk_commands_definition": "false", "is_client": "false", "is_master": "true", "reassign_allowed": "false", "recovery_enabled": "false", "service_name": "HIVE", "stack_name": "HDP", "stack_version": "2.5", "hostnames": ["c6401.ambari.apache.org"] }, "dependencies": [] }, { "StackServiceComponents": { "advertise_version": "true", "cardinality": "1+", "component_category": "SLAVE", "component_name": "NODEMANAGER", "display_name": "NodeManager", "is_client": "false", "is_master": "false", "hostnames": [ "c6403.ambari.apache.org" ] }, "dependencies": [] }, ] } ], "changed-configurations": [ { u'old_value': u'1', u'type': u'hive-interactive-site', u'name': u'hive.server2.tez.sessions.per.default.queue' } ], "configurations": { "capacity-scheduler": { "properties": { "capacity-scheduler": 'yarn.scheduler.capacity.root.default.maximum-capacity=60\n' 'yarn.scheduler.capacity.root.accessible-node-labels=*\n' 'yarn.scheduler.capacity.root.capacity=100\n' 'yarn.scheduler.capacity.root.queues=default,llap\n' 'yarn.scheduler.capacity.maximum-applications=10000\n' 'yarn.scheduler.capacity.root.default.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.default.state=RUNNING\n' 'yarn.scheduler.capacity.maximum-am-resource-percent=1\n' 'yarn.scheduler.capacity.root.default.acl_submit_applications=*\n' 'yarn.scheduler.capacity.root.default.capacity=60\n' 'yarn.scheduler.capacity.root.acl_administer_queue=*\n' 'yarn.scheduler.capacity.node-locality-delay=40\n' 'yarn.scheduler.capacity.queue-mappings-override.enable=false\n' 'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.llap.state=RUNNING\n' 'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n' 'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n' 'yarn.scheduler.capacity.root.llap.maximum-capacity=40\n' 'yarn.scheduler.capacity.root.llap.capacity=40\n' 'yarn.scheduler.capacity.root.llap.acl_submit_applications=hive\n' 'yarn.scheduler.capacity.root.llap.acl_administer_queue=hive\n' 'yarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1' } }, "hive-interactive-env": { 'properties': { 'enable_hive_interactive': 'true', 'llap_queue_capacity':'41', 'num_llap_nodes': 1 } }, "hive-interactive-site": { 'properties': { 'hive.llap.daemon.queue.name': 'llap', 'hive.server2.tez.sessions.per.default.queue': '2', } }, "hive-env": { 'properties': { 'hive_user': 'hive' } }, "yarn-site": { "properties": { "yarn.scheduler.minimum-allocation-mb": "1024", "yarn.nodemanager.resource.memory-mb": "51200", "yarn.nodemanager.resource.cpu-vcores": '1' } }, "tez-interactive-site": { "properties": { "tez.am.resource.memory.mb": "1024" } }, "hive-site": { 'properties': { 'hive.tez.container.size': '1024' } }, } } configurations = { } self.stackAdvisor.recommendYARNConfigurations(configurations, self.clusterData, services, self.hosts) self.assertTrue('hive.server2.tez.sessions.per.default.queue' not in configurations['hive-interactive-site']['properties']) self.assertTrue('hive.server2.tez.sessions.per.default.queue' not in configurations['hive-interactive-site']['property_attributes']) self.assertEqual(configurations['hive-interactive-env']['properties']['num_llap_nodes'], '1') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.yarn.container.mb'], '18432') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.num.executors'], '1') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.io.memory.size'], '17408') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.io.enabled'], 'true') self.assertEqual(configurations['hive-interactive-env']['properties']['llap_heap_size'], '819') self.assertEqual(configurations['hive-interactive-env']['properties']['slider_am_container_size'], '1024') ####################### 'Three Node Managers' cluster - tests for calculating llap configs ################ # Test 19: (1). 'default' and 'llap' (State : RUNNING) queue exists at root level in capacity-scheduler, and # (2). enable_hive_interactive' is 'on' and (3). configuration change detected for 'llap_queue_capacity' # Expected : Configurations values recommended for llap related configs. def test_recommendYARNConfigurations_three_node_manager_llap_configs_updated_1(self): # Services 20: YARN service with : (1). 'capacity scheduler' having 'llap' and 'default' queue at root level and # (2). 'enable_hive_interactive' is ON and (3). configuration change detected for 'llap_queue_capacity' # 3 node managers and yarn.nodemanager.resource.memory-mb": "40960" services = { "services": [{ "StackServices": { "service_name": "YARN", }, "Versions": { "stack_version": "2.5" }, "components": [ { "StackServiceComponents": { "component_name": "NODEMANAGER", "hostnames": ["c6401.ambari.apache.org", "c6402.ambari.apache.org", "c6403.ambari.apache.org"] } } ] }, { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE", "StackServices": { "service_name": "HIVE", "service_version": "1.2.1.2.5", "stack_name": "HDP", "stack_version": "2.5" }, "components": [ { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE/components/HIVE_SERVER_INTERACTIVE", "StackServiceComponents": { "advertise_version": "true", "bulk_commands_display_name": "", "bulk_commands_master_component_name": "", "cardinality": "0-1", "component_category": "MASTER", "component_name": "HIVE_SERVER_INTERACTIVE", "custom_commands": ["RESTART_LLAP"], "decommission_allowed": "false", "display_name": "HiveServer2 Interactive", "has_bulk_commands_definition": "false", "is_client": "false", "is_master": "true", "reassign_allowed": "false", "recovery_enabled": "false", "service_name": "HIVE", "stack_name": "HDP", "stack_version": "2.5", "hostnames": ["c6401.ambari.apache.org"] }, "dependencies": [] }, { "StackServiceComponents": { "advertise_version": "true", "cardinality": "1+", "component_category": "SLAVE", "component_name": "NODEMANAGER", "display_name": "NodeManager", "is_client": "false", "is_master": "false", "hostnames": [ "c6401.ambari.apache.org" ] }, "dependencies": [] }, ] } ], "changed-configurations": [ { u'old_value': u'55', u'type': u'hive-interactive-env', u'name': u'llap_queue_capacity' } ], "configurations": { "capacity-scheduler": { "properties": { "capacity-scheduler": 'yarn.scheduler.capacity.root.default.maximum-capacity=60\n' 'yarn.scheduler.capacity.root.accessible-node-labels=*\n' 'yarn.scheduler.capacity.root.capacity=100\n' 'yarn.scheduler.capacity.root.queues=default,llap\n' 'yarn.scheduler.capacity.maximum-applications=10000\n' 'yarn.scheduler.capacity.root.default.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.default.state=RUNNING\n' 'yarn.scheduler.capacity.maximum-am-resource-percent=1\n' 'yarn.scheduler.capacity.root.default.acl_submit_applications=*\n' 'yarn.scheduler.capacity.root.default.capacity=60\n' 'yarn.scheduler.capacity.root.acl_administer_queue=*\n' 'yarn.scheduler.capacity.node-locality-delay=40\n' 'yarn.scheduler.capacity.queue-mappings-override.enable=false\n' 'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.llap.state=RUNNING\n' 'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n' 'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n' 'yarn.scheduler.capacity.root.llap.maximum-capacity=40\n' 'yarn.scheduler.capacity.root.llap.capacity=40\n' 'yarn.scheduler.capacity.root.llap.acl_submit_applications=hive\n' 'yarn.scheduler.capacity.root.llap.acl_administer_queue=hive\n' 'yarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1' } }, "hive-interactive-env": { 'properties': { 'enable_hive_interactive': 'true', 'llap_queue_capacity':'90' } }, "hive-interactive-site": { 'properties': { 'hive.llap.daemon.queue.name': 'llap', 'hive.server2.tez.sessions.per.default.queue': '1' } }, "hive-env": { 'properties': { 'hive_user': 'hive' } }, "yarn-site": { "properties": { "yarn.scheduler.minimum-allocation-mb": "2048", "yarn.nodemanager.resource.memory-mb": "40960", "yarn.nodemanager.resource.cpu-vcores": '4' } }, "tez-interactive-site": { "properties": { "tez.am.resource.memory.mb": "1024" } }, "hive-site": { 'properties': { 'hive.tez.container.size': '1024' } }, } } configurations = { } self.stackAdvisor.recommendYARNConfigurations(configurations, self.clusterData, services, self.hosts) self.assertEqual(configurations['hive-interactive-site']['properties']['hive.server2.tez.sessions.per.default.queue'], '13') self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.server2.tez.sessions.per.default.queue'], {'minimum': '1', 'maximum': '32'}) self.assertEqual(configurations['hive-interactive-env']['properties']['num_llap_nodes'], '2') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.yarn.container.mb'], '40960') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.num.executors'], '4') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.io.memory.size'], '36864') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.io.enabled'], 'true') self.assertEqual(configurations['hive-interactive-env']['properties']['llap_heap_size'], '3276') self.assertEqual(configurations['hive-interactive-env']['properties']['slider_am_container_size'], '1024') # Test 20: (1). 'default' and 'llap' (State : RUNNING) queue exists at root level in capacity-scheduler, and # (2). enable_hive_interactive' is 'on' and (3). configuration change detected for 'enable_hive_interactive' # Expected : Configurations values recommended for llap related configs. def test_recommendYARNConfigurations_three_node_manager_llap_configs_updated_2(self): # 3 node managers and yarn.nodemanager.resource.memory-mb": "12288" services = { "services": [{ "StackServices": { "service_name": "YARN", }, "Versions": { "stack_version": "2.5" }, "components": [ { "StackServiceComponents": { "component_name": "NODEMANAGER", "hostnames": ["c6401.ambari.apache.org", "c6402.ambari.apache.org", "c6403.ambari.apache.org"] } } ] }, { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE", "StackServices": { "service_name": "HIVE", "service_version": "1.2.1.2.5", "stack_name": "HDP", "stack_version": "2.5" }, "components": [ { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE/components/HIVE_SERVER_INTERACTIVE", "StackServiceComponents": { "advertise_version": "true", "bulk_commands_display_name": "", "bulk_commands_master_component_name": "", "cardinality": "0-1", "component_category": "MASTER", "component_name": "HIVE_SERVER_INTERACTIVE", "custom_commands": ["RESTART_LLAP"], "decommission_allowed": "false", "display_name": "HiveServer2 Interactive", "has_bulk_commands_definition": "false", "is_client": "false", "is_master": "true", "reassign_allowed": "false", "recovery_enabled": "false", "service_name": "HIVE", "stack_name": "HDP", "stack_version": "2.5", "hostnames": ["c6401.ambari.apache.org"] }, "dependencies": [] }, { "StackServiceComponents": { "advertise_version": "true", "cardinality": "1+", "component_category": "SLAVE", "component_name": "NODEMANAGER", "display_name": "NodeManager", "is_client": "false", "is_master": "false", "hostnames": [ "c6401.ambari.apache.org" ] }, "dependencies": [] }, ] } ], "changed-configurations": [ { u'old_value': u'false', u'type': u'hive-interactive-env', u'name': u'enable_hive_interactive' } ], "configurations": { "capacity-scheduler": { "properties": { "capacity-scheduler": 'yarn.scheduler.capacity.root.default.maximum-capacity=60\n' 'yarn.scheduler.capacity.root.accessible-node-labels=*\n' 'yarn.scheduler.capacity.root.capacity=100\n' 'yarn.scheduler.capacity.root.queues=default,llap\n' 'yarn.scheduler.capacity.maximum-applications=10000\n' 'yarn.scheduler.capacity.root.default.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.default.state=RUNNING\n' 'yarn.scheduler.capacity.maximum-am-resource-percent=1\n' 'yarn.scheduler.capacity.root.default.acl_submit_applications=*\n' 'yarn.scheduler.capacity.root.default.capacity=60\n' 'yarn.scheduler.capacity.root.acl_administer_queue=*\n' 'yarn.scheduler.capacity.node-locality-delay=40\n' 'yarn.scheduler.capacity.queue-mappings-override.enable=false\n' 'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.llap.state=RUNNING\n' 'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n' 'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n' 'yarn.scheduler.capacity.root.llap.maximum-capacity=40\n' 'yarn.scheduler.capacity.root.llap.capacity=40\n' 'yarn.scheduler.capacity.root.llap.acl_submit_applications=hive\n' 'yarn.scheduler.capacity.root.llap.acl_administer_queue=hive\n' 'yarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1' } }, "hive-interactive-env": { 'properties': { 'enable_hive_interactive': 'true', 'llap_queue_capacity':'100' } }, "hive-interactive-site": { 'properties': { 'hive.llap.daemon.queue.name': 'llap', 'hive.server2.tez.sessions.per.default.queue': '1' } }, "hive-env": { 'properties': { 'hive_user': 'hive' } }, "yarn-site": { "properties": { "yarn.scheduler.minimum-allocation-mb": "341", "yarn.nodemanager.resource.memory-mb": "12288", "yarn.nodemanager.resource.cpu-vcores": '3' } }, "tez-interactive-site": { "properties": { "tez.am.resource.memory.mb": "1024" } }, "hive-site": { 'properties': { 'hive.tez.container.size': '1024' } }, } } configurations = { } self.stackAdvisor.recommendYARNConfigurations(configurations, self.clusterData, services, self.hosts) self.assertEqual(configurations['hive-interactive-site']['properties']['hive.server2.tez.sessions.per.default.queue'], '6') self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.server2.tez.sessions.per.default.queue'], {'minimum': '1', 'maximum': '32'}) self.assertEqual(configurations['hive-interactive-env']['properties']['num_llap_nodes'], '2') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.yarn.container.mb'], '12276') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.num.executors'], '3') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.io.memory.size'], '9204') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.io.enabled'], 'true') self.assertEqual(configurations['hive-interactive-env']['properties']['llap_heap_size'], '2457') self.assertEqual(configurations['hive-interactive-env']['properties']['slider_am_container_size'], '341') # Test 21: (1). 'default' and 'llap' (State : RUNNING) queue exists at root level in capacity-scheduler, and # (2). enable_hive_interactive' is 'on' and (3). configuration change detected for 'hive.server2.tez.sessions.per.default.queue' # Expected : Configurations values recommended for llap related configs. def test_recommendYARNConfigurations_three_node_manager_llap_configs_updated_3(self): # 3 node managers and yarn.nodemanager.resource.memory-mb": "204800" services = { "services": [{ "StackServices": { "service_name": "YARN", }, "Versions": { "stack_version": "2.5" }, "components": [ { "StackServiceComponents": { "component_name": "NODEMANAGER", "hostnames": ["c6401.ambari.apache.org", "c6402.ambari.apache.org", "c6403.ambari.apache.org"] } } ] }, { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE", "StackServices": { "service_name": "HIVE", "service_version": "1.2.1.2.5", "stack_name": "HDP", "stack_version": "2.5" }, "components": [ { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE/components/HIVE_SERVER_INTERACTIVE", "StackServiceComponents": { "advertise_version": "true", "bulk_commands_display_name": "", "bulk_commands_master_component_name": "", "cardinality": "0-1", "component_category": "MASTER", "component_name": "HIVE_SERVER_INTERACTIVE", "custom_commands": ["RESTART_LLAP"], "decommission_allowed": "false", "display_name": "HiveServer2 Interactive", "has_bulk_commands_definition": "false", "is_client": "false", "is_master": "true", "reassign_allowed": "false", "recovery_enabled": "false", "service_name": "HIVE", "stack_name": "HDP", "stack_version": "2.5", "hostnames": ["c6401.ambari.apache.org"] }, "dependencies": [] }, { "StackServiceComponents": { "advertise_version": "true", "cardinality": "1+", "component_category": "SLAVE", "component_name": "NODEMANAGER", "display_name": "NodeManager", "is_client": "false", "is_master": "false", "hostnames": [ "c6401.ambari.apache.org" ] }, "dependencies": [] }, ] } ], "changed-configurations": [ { u'old_value': u'2', u'type': u'hive-interactive-site', u'name': u'hive.server2.tez.sessions.per.default.queue' } ], "configurations": { "capacity-scheduler": { "properties": { "capacity-scheduler": 'yarn.scheduler.capacity.root.default.maximum-capacity=60\n' 'yarn.scheduler.capacity.root.accessible-node-labels=*\n' 'yarn.scheduler.capacity.root.capacity=100\n' 'yarn.scheduler.capacity.root.queues=default,llap\n' 'yarn.scheduler.capacity.maximum-applications=10000\n' 'yarn.scheduler.capacity.root.default.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.default.state=RUNNING\n' 'yarn.scheduler.capacity.maximum-am-resource-percent=1\n' 'yarn.scheduler.capacity.root.default.acl_submit_applications=*\n' 'yarn.scheduler.capacity.root.default.capacity=60\n' 'yarn.scheduler.capacity.root.acl_administer_queue=*\n' 'yarn.scheduler.capacity.node-locality-delay=40\n' 'yarn.scheduler.capacity.queue-mappings-override.enable=false\n' 'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.llap.state=RUNNING\n' 'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n' 'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n' 'yarn.scheduler.capacity.root.llap.maximum-capacity=40\n' 'yarn.scheduler.capacity.root.llap.capacity=40\n' 'yarn.scheduler.capacity.root.llap.acl_submit_applications=hive\n' 'yarn.scheduler.capacity.root.llap.acl_administer_queue=hive\n' 'yarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1' } }, "hive-interactive-env": { 'properties': { 'enable_hive_interactive': 'true', 'llap_queue_capacity':'50' } }, "hive-interactive-site": { 'properties': { 'hive.llap.daemon.queue.name': 'llap', 'hive.server2.tez.sessions.per.default.queue': '1' } }, "hive-env": { 'properties': { 'hive_user': 'hive' } }, "yarn-site": { "properties": { "yarn.scheduler.minimum-allocation-mb": "2048", "yarn.nodemanager.resource.memory-mb": "204800", "yarn.nodemanager.resource.cpu-vcores": '3' } }, "tez-interactive-site": { "properties": { "tez.am.resource.memory.mb": "1024" } }, "hive-site": { 'properties': { 'hive.tez.container.size': '1024' } }, } } configurations = { } self.stackAdvisor.recommendYARNConfigurations(configurations, self.clusterData, services, self.hosts) self.assertEqual(configurations['hive-interactive-env']['properties']['num_llap_nodes'], '1') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.yarn.container.mb'], '204800') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.num.executors'], '3') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.io.memory.size'], '201728') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.io.enabled'], 'true') self.assertEqual(configurations['hive-interactive-env']['properties']['llap_heap_size'], '2457') self.assertEqual(configurations['hive-interactive-env']['properties']['slider_am_container_size'], '1024') ####################### 'Five Node Managers' cluster - tests for calculating llap configs ################ # Test 22: (1). 'default' and 'llap' (State : RUNNING) queue exists at root level in capacity-scheduler, and # (2). enable_hive_interactive' is 'on' and (3). configuration change detected for 'llap_queue_capacity' # Expected : Configurations values recommended for llap related configs. def test_recommendYARNConfigurations_five_node_manager_llap_configs_updated_1(self): services = { "services": [{ "StackServices": { "service_name": "YARN", }, "Versions": { "stack_version": "2.5" }, "components": [ { "StackServiceComponents": { "component_name": "NODEMANAGER", "hostnames": ["c6401.ambari.apache.org", "c6402.ambari.apache.org", "c6403.ambari.apache.org", "c6404.ambari.apache.org", "c6405.ambari.apache.org"] } } ] }, { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE", "StackServices": { "service_name": "HIVE", "service_version": "1.2.1.2.5", "stack_name": "HDP", "stack_version": "2.5" }, "components": [ { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE/components/HIVE_SERVER_INTERACTIVE", "StackServiceComponents": { "advertise_version": "true", "bulk_commands_display_name": "", "bulk_commands_master_component_name": "", "cardinality": "0-1", "component_category": "MASTER", "component_name": "HIVE_SERVER_INTERACTIVE", "custom_commands": ["RESTART_LLAP"], "decommission_allowed": "false", "display_name": "HiveServer2 Interactive", "has_bulk_commands_definition": "false", "is_client": "false", "is_master": "true", "reassign_allowed": "false", "recovery_enabled": "false", "service_name": "HIVE", "stack_name": "HDP", "stack_version": "2.5", "hostnames": ["c6401.ambari.apache.org"] }, "dependencies": [] }, { "StackServiceComponents": { "advertise_version": "true", "cardinality": "1+", "component_category": "SLAVE", "component_name": "NODEMANAGER", "display_name": "NodeManager", "is_client": "false", "is_master": "false", "hostnames": [ "c6401.ambari.apache.org" ] }, "dependencies": [] }, ] } ], "changed-configurations": [ { u'old_value': u'55', u'type': u'hive-interactive-env', u'name': u'llap_queue_capacity' } ], "configurations": { "capacity-scheduler": { "properties": { "capacity-scheduler": 'yarn.scheduler.capacity.root.default.maximum-capacity=60\n' 'yarn.scheduler.capacity.root.accessible-node-labels=*\n' 'yarn.scheduler.capacity.root.capacity=100\n' 'yarn.scheduler.capacity.root.queues=default,llap\n' 'yarn.scheduler.capacity.maximum-applications=10000\n' 'yarn.scheduler.capacity.root.default.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.default.state=RUNNING\n' 'yarn.scheduler.capacity.maximum-am-resource-percent=1\n' 'yarn.scheduler.capacity.root.default.acl_submit_applications=*\n' 'yarn.scheduler.capacity.root.default.capacity=60\n' 'yarn.scheduler.capacity.root.acl_administer_queue=*\n' 'yarn.scheduler.capacity.node-locality-delay=40\n' 'yarn.scheduler.capacity.queue-mappings-override.enable=false\n' 'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.llap.state=RUNNING\n' 'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n' 'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n' 'yarn.scheduler.capacity.root.llap.maximum-capacity=40\n' 'yarn.scheduler.capacity.root.llap.capacity=40\n' 'yarn.scheduler.capacity.root.llap.acl_submit_applications=hive\n' 'yarn.scheduler.capacity.root.llap.acl_administer_queue=hive\n' 'yarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1' } }, "hive-interactive-env": { 'properties': { 'enable_hive_interactive': 'true', 'llap_queue_capacity':'90' } }, "hive-interactive-site": { 'properties': { 'hive.llap.daemon.queue.name': 'llap', 'hive.server2.tez.sessions.per.default.queue': '1' } }, "hive-env": { 'properties': { 'hive_user': 'hive' } }, "yarn-site": { "properties": { "yarn.scheduler.minimum-allocation-mb": "3072", "yarn.nodemanager.resource.memory-mb": "40960", "yarn.nodemanager.resource.cpu-vcores": '4' } }, "tez-interactive-site": { "properties": { "tez.am.resource.memory.mb": "1024" } }, "hive-site": { 'properties': { 'hive.tez.container.size': '1024' } }, } } configurations = { } self.stackAdvisor.recommendYARNConfigurations(configurations, self.clusterData, services, self.hosts) self.assertEqual(configurations['hive-interactive-site']['properties']['hive.server2.tez.sessions.per.default.queue'], '15') self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.server2.tez.sessions.per.default.queue'], {'minimum': '1', 'maximum': '32'}) self.assertEqual(configurations['hive-interactive-env']['properties']['num_llap_nodes'], '3') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.yarn.container.mb'], '39936') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.num.executors'], '4') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.io.memory.size'], '35840') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.io.enabled'], 'true') self.assertEqual(configurations['hive-interactive-env']['properties']['llap_heap_size'], '3276') self.assertEqual(configurations['hive-interactive-env']['properties']['slider_am_container_size'], '1024') # Test 23: (1). 'default' and 'llap' (State : RUNNING) queue exists at root level in capacity-scheduler, and # (2). enable_hive_interactive' is 'on' and (3). configuration change detected for 'enable_hive_interactive' # Expected : Configurations values recommended for llap related configs. def test_recommendYARNConfigurations_five_node_manager_llap_configs_updated_2(self): # 3 node managers and yarn.nodemanager.resource.memory-mb": "12288" services = { "services": [{ "StackServices": { "service_name": "YARN", }, "Versions": { "stack_version": "2.5" }, "components": [ { "StackServiceComponents": { "component_name": "NODEMANAGER", "hostnames": ["c6401.ambari.apache.org", "c6402.ambari.apache.org", "c6403.ambari.apache.org", "c6404.ambari.apache.org", "c6405.ambari.apache.org"] } } ] }, { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE", "StackServices": { "service_name": "HIVE", "service_version": "1.2.1.2.5", "stack_name": "HDP", "stack_version": "2.5" }, "components": [ { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE/components/HIVE_SERVER_INTERACTIVE", "StackServiceComponents": { "advertise_version": "true", "bulk_commands_display_name": "", "bulk_commands_master_component_name": "", "cardinality": "0-1", "component_category": "MASTER", "component_name": "HIVE_SERVER_INTERACTIVE", "custom_commands": ["RESTART_LLAP"], "decommission_allowed": "false", "display_name": "HiveServer2 Interactive", "has_bulk_commands_definition": "false", "is_client": "false", "is_master": "true", "reassign_allowed": "false", "recovery_enabled": "false", "service_name": "HIVE", "stack_name": "HDP", "stack_version": "2.5", "hostnames": ["c6401.ambari.apache.org"] }, "dependencies": [] }, { "StackServiceComponents": { "advertise_version": "true", "cardinality": "1+", "component_category": "SLAVE", "component_name": "NODEMANAGER", "display_name": "NodeManager", "is_client": "false", "is_master": "false", "hostnames": [ "c6401.ambari.apache.org" ] }, "dependencies": [] }, ] } ], "changed-configurations": [ { u'old_value': u'false', u'type': u'hive-interactive-env', u'name': u'enable_hive_interactive' } ], "configurations": { "capacity-scheduler": { "properties": { "capacity-scheduler": 'yarn.scheduler.capacity.root.default.maximum-capacity=60\n' 'yarn.scheduler.capacity.root.accessible-node-labels=*\n' 'yarn.scheduler.capacity.root.capacity=100\n' 'yarn.scheduler.capacity.root.queues=default,llap\n' 'yarn.scheduler.capacity.maximum-applications=10000\n' 'yarn.scheduler.capacity.root.default.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.default.state=RUNNING\n' 'yarn.scheduler.capacity.maximum-am-resource-percent=1\n' 'yarn.scheduler.capacity.root.default.acl_submit_applications=*\n' 'yarn.scheduler.capacity.root.default.capacity=60\n' 'yarn.scheduler.capacity.root.acl_administer_queue=*\n' 'yarn.scheduler.capacity.node-locality-delay=40\n' 'yarn.scheduler.capacity.queue-mappings-override.enable=false\n' 'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.llap.state=RUNNING\n' 'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n' 'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n' 'yarn.scheduler.capacity.root.llap.maximum-capacity=40\n' 'yarn.scheduler.capacity.root.llap.capacity=40\n' 'yarn.scheduler.capacity.root.llap.acl_submit_applications=hive\n' 'yarn.scheduler.capacity.root.llap.acl_administer_queue=hive\n' 'yarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1' } }, "hive-interactive-env": { 'properties': { 'enable_hive_interactive': 'true', 'llap_queue_capacity':'100' } }, "hive-interactive-site": { 'properties': { 'hive.llap.daemon.queue.name': 'llap', 'hive.server2.tez.sessions.per.default.queue': '1' } }, "hive-env": { 'properties': { 'hive_user': 'hive' } }, "yarn-site": { "properties": { "yarn.scheduler.minimum-allocation-mb": "341", "yarn.nodemanager.resource.memory-mb": "204800", "yarn.nodemanager.resource.cpu-vcores": '10' } }, "tez-interactive-site": { "properties": { "tez.am.resource.memory.mb": "341" } }, "hive-site": { 'properties': { 'hive.tez.container.size': '341' } }, } } configurations = { } self.stackAdvisor.recommendYARNConfigurations(configurations, self.clusterData, services, self.hosts) self.assertEqual(configurations['hive-interactive-site']['properties']['hive.server2.tez.sessions.per.default.queue'], '32') self.assertEquals(configurations['hive-interactive-site']['property_attributes']['hive.server2.tez.sessions.per.default.queue'], {'minimum': '1', 'maximum': '32'}) self.assertEqual(configurations['hive-interactive-env']['properties']['num_llap_nodes'], '4') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.yarn.container.mb'], '204600') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.num.executors'], '10') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.io.memory.size'], '201190') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.io.enabled'], 'true') self.assertEqual(configurations['hive-interactive-env']['properties']['llap_heap_size'], '2728') self.assertEqual(configurations['hive-interactive-env']['properties']['slider_am_container_size'], '341') # Test 24: (1). 'default' and 'llap' (State : RUNNING) queue exists at root level in capacity-scheduler, and # (2). enable_hive_interactive' is 'on' and (3). configuration change detected for 'hive.server2.tez.sessions.per.default.queue' # Expected : Configurations values recommended for llap related configs. def test_recommendYARNConfigurations_five_node_manager_llap_configs_updated_3(self): # 3 node managers and yarn.nodemanager.resource.memory-mb": "204800" services = { "services": [{ "StackServices": { "service_name": "YARN", }, "Versions": { "stack_version": "2.5" }, "components": [ { "StackServiceComponents": { "component_name": "NODEMANAGER", "hostnames": ["c6401.ambari.apache.org", "c6402.ambari.apache.org", "c6403.ambari.apache.org", "c6404.ambari.apache.org", "c6405.ambari.apache.org"] } } ] }, { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE", "StackServices": { "service_name": "HIVE", "service_version": "1.2.1.2.5", "stack_name": "HDP", "stack_version": "2.5" }, "components": [ { "href": "/api/v1/stacks/HDP/versions/2.5/services/HIVE/components/HIVE_SERVER_INTERACTIVE", "StackServiceComponents": { "advertise_version": "true", "bulk_commands_display_name": "", "bulk_commands_master_component_name": "", "cardinality": "0-1", "component_category": "MASTER", "component_name": "HIVE_SERVER_INTERACTIVE", "custom_commands": ["RESTART_LLAP"], "decommission_allowed": "false", "display_name": "HiveServer2 Interactive", "has_bulk_commands_definition": "false", "is_client": "false", "is_master": "true", "reassign_allowed": "false", "recovery_enabled": "false", "service_name": "HIVE", "stack_name": "HDP", "stack_version": "2.5", "hostnames": ["c6401.ambari.apache.org"] }, "dependencies": [] }, { "StackServiceComponents": { "advertise_version": "true", "cardinality": "1+", "component_category": "SLAVE", "component_name": "NODEMANAGER", "display_name": "NodeManager", "is_client": "false", "is_master": "false", "hostnames": [ "c6401.ambari.apache.org" ] }, "dependencies": [] }, ] } ], "changed-configurations": [ { u'old_value': u'3', u'type': u'hive-interactive-site', u'name': u'hive.server2.tez.sessions.per.default.queue' } ], "configurations": { "capacity-scheduler": { "properties": { "capacity-scheduler": 'yarn.scheduler.capacity.root.default.maximum-capacity=60\n' 'yarn.scheduler.capacity.root.accessible-node-labels=*\n' 'yarn.scheduler.capacity.root.capacity=100\n' 'yarn.scheduler.capacity.root.queues=default,llap\n' 'yarn.scheduler.capacity.maximum-applications=10000\n' 'yarn.scheduler.capacity.root.default.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.default.state=RUNNING\n' 'yarn.scheduler.capacity.maximum-am-resource-percent=1\n' 'yarn.scheduler.capacity.root.default.acl_submit_applications=*\n' 'yarn.scheduler.capacity.root.default.capacity=60\n' 'yarn.scheduler.capacity.root.acl_administer_queue=*\n' 'yarn.scheduler.capacity.node-locality-delay=40\n' 'yarn.scheduler.capacity.queue-mappings-override.enable=false\n' 'yarn.scheduler.capacity.root.llap.user-limit-factor=1\n' 'yarn.scheduler.capacity.root.llap.state=RUNNING\n' 'yarn.scheduler.capacity.root.llap.ordering-policy=fifo\n' 'yarn.scheduler.capacity.root.llap.minimum-user-limit-percent=100\n' 'yarn.scheduler.capacity.root.llap.maximum-capacity=40\n' 'yarn.scheduler.capacity.root.llap.capacity=40\n' 'yarn.scheduler.capacity.root.llap.acl_submit_applications=hive\n' 'yarn.scheduler.capacity.root.llap.acl_administer_queue=hive\n' 'yarn.scheduler.capacity.root.llap.maximum-am-resource-percent=1' } }, "hive-interactive-env": { 'properties': { 'enable_hive_interactive': 'true', 'llap_queue_capacity':'50' } }, "hive-interactive-site": { 'properties': { 'hive.llap.daemon.queue.name': 'llap', 'hive.server2.tez.sessions.per.default.queue': '1' } }, "hive-env": { 'properties': { 'hive_user': 'hive' } }, "yarn-site": { "properties": { "yarn.scheduler.minimum-allocation-mb": "2048", "yarn.nodemanager.resource.memory-mb": "204800", "yarn.nodemanager.resource.cpu-vcores": '3' } }, "tez-interactive-site": { "properties": { "tez.am.resource.memory.mb": "1024" } }, "hive-site": { 'properties': { 'hive.tez.container.size': '1024' } }, } } configurations = { } self.stackAdvisor.recommendYARNConfigurations(configurations, self.clusterData, services, self.hosts) self.assertEqual(configurations['hive-interactive-env']['properties']['num_llap_nodes'], '2') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.yarn.container.mb'], '204800') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.daemon.num.executors'], '3') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.io.memory.size'], '201728') self.assertEqual(configurations['hive-interactive-site']['properties']['hive.llap.io.enabled'], 'true') self.assertEqual(configurations['hive-interactive-env']['properties']['llap_heap_size'], '2457') self.assertEqual(configurations['hive-interactive-env']['properties']['slider_am_container_size'], '1024') def test_recommendAtlasConfigurations(self): self.maxDiff = None configurations = { "application-properties": { "properties": { "atlas.graph.index.search.solr.zookeeper-url": "" } }, "logsearch-solr-env": { "properties": { "logsearch_solr_znode": "/logsearch" } } } clusterData = { "cpu": 4, "mapMemory": 3000, "amMemory": 2000, "reduceMemory": 2056, "containers": 3, "ramPerContainer": 256 } expected = { 'application-properties': { 'properties': { 'atlas.graph.index.search.solr.zookeeper-url': '{{solr_zookeeper_url}}', } }, "logsearch-solr-env": { "properties": { "logsearch_solr_znode": "/logsearch" } } } services = { "services": [ { "href": "/api/v1/stacks/HDP/versions/2.2/services/ATLAS", "StackServices": { "service_name": "LOGSEARCH", "service_version": "2.6.0.2.2", "stack_name": "HDP", "stack_version": "2.3" }, "components": [ { "StackServiceComponents": { "advertise_version": "false", "cardinality": "1", "component_category": "MASTER", "component_name": "LOGSEARCH_SOLR", "display_name": "solr", "is_client": "false", "is_master": "true", "hostnames": [] }, "dependencies": [] } ] }, ], "configurations": { "application-properties": { "properties": { "atlas.graph.index.search.solr.zookeeper-url": "" } }, "logsearch-solr-env": { "properties": { "logsearch_solr_znode": "/logsearch" } } }, "changed-configurations": [ ] } hosts = { "items" : [ { "href" : "/api/v1/hosts/c6401.ambari.apache.org", "Hosts" : { "cpu_count" : 1, "host_name" : "c6401.ambari.apache.org", "os_arch" : "x86_64", "os_type" : "centos6", "ph_cpu_count" : 1, "public_host_name" : "c6401.ambari.apache.org", "rack_info" : "/default-rack", "total_mem" : 1922680 } } ] } self.stackAdvisor.recommendAtlasConfigurations(configurations, clusterData, services, hosts) self.assertEquals(configurations, expected) services['ambari-server-properties'] = {'java.home': '/usr/jdk64/jdk1.7.3_23'} self.stackAdvisor.recommendAtlasConfigurations(configurations, clusterData, services, hosts) self.assertEquals(configurations, expected) """ Helper method to convert string of key-values to dict. """ def convertToDict(properties): capacitySchedulerProperties = dict() properties = str(properties).split('\n') if properties: for property in properties: key, sep, value = property.partition("=") if key: capacitySchedulerProperties[key] = value return capacitySchedulerProperties
42.275141
268
0.533523
16,163
179,923
5.802821
0.030564
0.08455
0.132326
0.132294
0.949739
0.946903
0.936764
0.928565
0.925963
0.919459
0
0.02197
0.33088
179,923
4,255
269
42.285076
0.757089
0.049738
0
0.689863
0
0.019958
0.480059
0.319905
0
0
0
0
0.036502
1
0.009716
false
0.000788
0.001576
0.000788
0.013655
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
cf8c586e6631f46b42cb5ed9d74ef74c9c030dd8
35
py
Python
discord/webhook/sync.py
Harukomaze/disnake
541f5c9623a02be894cd1015dbb344070700cb87
[ "MIT" ]
null
null
null
discord/webhook/sync.py
Harukomaze/disnake
541f5c9623a02be894cd1015dbb344070700cb87
[ "MIT" ]
null
null
null
discord/webhook/sync.py
Harukomaze/disnake
541f5c9623a02be894cd1015dbb344070700cb87
[ "MIT" ]
null
null
null
from disnake.webhook.sync import *
17.5
34
0.8
5
35
5.6
1
0
0
0
0
0
0
0
0
0
0
0
0.114286
35
1
35
35
0.903226
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
cfe0253c203b0b4ef21e89f0fb0e0ab7a7c7c51b
512
py
Python
testdata/testfile.py
viswaraavi/Introspect
2884786afbae0399d049fdca90c68ea46846d581
[ "MIT" ]
2
2016-08-13T20:52:37.000Z
2018-11-13T20:08:14.000Z
testdata/testfile.py
viswaraavi/Introspect
2884786afbae0399d049fdca90c68ea46846d581
[ "MIT" ]
null
null
null
testdata/testfile.py
viswaraavi/Introspect
2884786afbae0399d049fdca90c68ea46846d581
[ "MIT" ]
null
null
null
class A(object): def __init__(self,boo): self.boo=boo def a(self): pass def b(self): pass class B(object): def __init__(self,boo): pass def c(self): pass def d(self): pass class c(object): def __init__(self,boo): pass def e(self): pass def f(self): pass class D(A,B): def __init__(self,boo): pass def g(self): pass def b(self): pass
12.487805
27
0.457031
67
512
3.253731
0.208955
0.293578
0.201835
0.256881
0.619266
0.527523
0.247706
0
0
0
0
0
0.435547
512
40
28
12.8
0.754325
0
0
0.607143
0
0
0
0
0
0
0
0
0
1
0.428571
false
0.392857
0
0
0.571429
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
1
0
1
0
0
1
0
0
6
5c66f7bae2354a4448866e4302f7da5eeeaea35c
134
py
Python
conf/script/src/build_system/cmd/setup/_priv/cli/__init__.py
benoit-dubreuil/template-repo-cpp-full-ecosystem
f506dd5e2a61cdd311b6a6a4be4abc59567b4b20
[ "MIT" ]
null
null
null
conf/script/src/build_system/cmd/setup/_priv/cli/__init__.py
benoit-dubreuil/template-repo-cpp-full-ecosystem
f506dd5e2a61cdd311b6a6a4be4abc59567b4b20
[ "MIT" ]
113
2021-02-15T19:22:36.000Z
2021-05-07T15:17:42.000Z
conf/script/src/build_system/cmd/setup/_priv/cli/__init__.py
benoit-dubreuil/template-repo-cpp-full-ecosystem
f506dd5e2a61cdd311b6a6a4be4abc59567b4b20
[ "MIT" ]
null
null
null
from .colorize import * from .compiler_env import * from .compiler_shell_env import * from .meson import * from .target_info import *
22.333333
33
0.776119
19
134
5.263158
0.473684
0.4
0.36
0
0
0
0
0
0
0
0
0
0.149254
134
5
34
26.8
0.877193
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
6
5ccb22f7c34198947919605140d97c08d0be927b
163
py
Python
Math/check_if_prime_number.py
IshGill/Leetcode-Guides
90b0f8e69e558926b3d47c988c663b9a4d1c845c
[ "Unlicense" ]
6
2021-02-08T08:00:45.000Z
2021-09-29T11:08:40.000Z
Math/check_if_prime_number.py
IshGill/Leetcode-Guides
90b0f8e69e558926b3d47c988c663b9a4d1c845c
[ "Unlicense" ]
11
2021-02-19T08:56:32.000Z
2021-03-22T04:52:33.000Z
Math/check_if_prime_number.py
IshGill/Leetcode-Guides
90b0f8e69e558926b3d47c988c663b9a4d1c845c
[ "Unlicense" ]
3
2021-02-20T12:03:36.000Z
2021-03-22T13:19:30.000Z
def checkPrime(n): return "{} is not prime".format(n) if len([i for i in range(2, n) if n % i == 0]) >= 1 else "{} is prime".format(n) print(checkPrime(7))
40.75
120
0.588957
31
163
3.096774
0.645161
0.229167
0.25
0
0
0
0
0
0
0
0
0.031008
0.208589
163
4
121
40.75
0.713178
0
0
0
0
0
0.161491
0
0
0
0
0
0
1
0.333333
false
0
0
0.333333
0.666667
0.333333
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
6
7a8448be4215444012a4250d1db2376f4b847cab
170
py
Python
cobra/screen/base.py
emersonmx/cobra-pycurses
bbe99832df4128eb93ae4af4881b56d638006fc5
[ "MIT" ]
null
null
null
cobra/screen/base.py
emersonmx/cobra-pycurses
bbe99832df4128eb93ae4af4881b56d638006fc5
[ "MIT" ]
null
null
null
cobra/screen/base.py
emersonmx/cobra-pycurses
bbe99832df4128eb93ae4af4881b56d638006fc5
[ "MIT" ]
null
null
null
class Screen(object): def show(self): pass def hide(self): pass def dispose(self): pass def update(self, delta): pass
12.142857
28
0.511765
20
170
4.35
0.55
0.275862
0.37931
0
0
0
0
0
0
0
0
0
0.394118
170
13
29
13.076923
0.84466
0
0
0.444444
0
0
0
0
0
0
0
0
0
1
0.444444
false
0.444444
0
0
0.555556
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
6
8faf2e2c62cd18ba9901ab9f606eca1c53b7b867
208
py
Python
src/eascheduler/errors/errors.py
spacemanspiff2007/eascheduler
849fe8f43b7bbcb8db3e76c0dda2811eb935cf39
[ "Apache-2.0" ]
null
null
null
src/eascheduler/errors/errors.py
spacemanspiff2007/eascheduler
849fe8f43b7bbcb8db3e76c0dda2811eb935cf39
[ "Apache-2.0" ]
3
2021-04-08T11:02:31.000Z
2022-02-14T06:07:56.000Z
src/eascheduler/errors/errors.py
spacemanspiff2007/eascheduler
849fe8f43b7bbcb8db3e76c0dda2811eb935cf39
[ "Apache-2.0" ]
null
null
null
class JobAlreadyCanceledException(Exception): pass class UnknownWeekdayError(Exception): pass class FirstRunInThePastError(Exception): pass class BoundaryFunctionError(Exception): pass
13
45
0.774038
16
208
10.0625
0.4375
0.322981
0.335404
0
0
0
0
0
0
0
0
0
0.168269
208
15
46
13.866667
0.930636
0
0
0.5
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
0
1
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
6
8fcff00d6088575fd3843a74f877f9ba25a8c311
25
py
Python
guildreader/__init__.py
redmoogle/jsonreader
b37db693a1f382661c44cf756e5ac7a6a3953010
[ "MIT" ]
null
null
null
guildreader/__init__.py
redmoogle/jsonreader
b37db693a1f382661c44cf756e5ac7a6a3953010
[ "MIT" ]
null
null
null
guildreader/__init__.py
redmoogle/jsonreader
b37db693a1f382661c44cf756e5ac7a6a3953010
[ "MIT" ]
1
2021-04-13T15:09:58.000Z
2021-04-13T15:09:58.000Z
from .jsonreader import *
25
25
0.8
3
25
6.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.12
25
1
25
25
0.909091
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
8fd334bd36faa5b25f78339294796b4573e916f8
769
py
Python
misc/first_fit.py
Cryptonite-MIT/Write-ups
d0daa4516aa524f56225357bc46020c4a33db198
[ "MIT" ]
null
null
null
misc/first_fit.py
Cryptonite-MIT/Write-ups
d0daa4516aa524f56225357bc46020c4a33db198
[ "MIT" ]
null
null
null
misc/first_fit.py
Cryptonite-MIT/Write-ups
d0daa4516aa524f56225357bc46020c4a33db198
[ "MIT" ]
2
2021-10-01T19:40:55.000Z
2021-10-01T19:41:40.000Z
from pwn import * r = remote("chal.imaginaryctf.org", 42003) # for i in range(0,7): r.recvuntil('1: Malloc\n2: Free\n3: Fill a\n4: System b\n> ') r.sendline("1") r.recvuntil("What do I malloc?\n(1) a\n(2) b\n>> ") r.sendline("1") r.recvuntil("1: Malloc\n2: Free\n3: Fill a\n4: System b\n> ") r.sendline("3") r.recvuntil(">> ") r.sendline("/bin/sh") r.recvuntil("1: Malloc\n2: Free\n3: Fill a\n4: System b\n> ") r.sendline("2") r.recvuntil("What do I free?\n(1) a\n(2) b\n>> ") r.sendline("1") r.recvuntil("1: Malloc\n2: Free\n3: Fill a\n4: System b\n> ") r.sendline("1") r.recvuntil("What do I malloc?\n(1) a\n(2) b\n>> ") r.sendline("2") r.recvuntil("1: Malloc\n2: Free\n3: Fill a\n4: System b\n> ") r.sendline("4") r.sendline("whoami") print(r.recvline()) r.close()
29.576923
61
0.629389
157
769
3.082803
0.248408
0.18595
0.049587
0.181818
0.747934
0.733471
0.733471
0.708678
0.708678
0.708678
0
0.060294
0.115735
769
25
62
30.76
0.651471
0.026008
0
0.521739
0
0
0.51004
0.028112
0
0
0
0
0
1
0
false
0
0.043478
0
0.043478
0.043478
0
0
0
null
0
0
1
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
0
0
0
6
8fe787b361aae25e4cd41f49281fcfece810ee59
73
py
Python
parcels/compilation/__init__.py
noemieplanat/Copy-parcels-master
21f053b81a9ccdaa5d8ee4f7efd6f01639b83bfc
[ "MIT" ]
202
2017-07-24T23:22:38.000Z
2022-03-22T15:33:46.000Z
parcels/compilation/__init__.py
noemieplanat/Copy-parcels-master
21f053b81a9ccdaa5d8ee4f7efd6f01639b83bfc
[ "MIT" ]
538
2017-06-21T08:04:43.000Z
2022-03-31T14:36:45.000Z
parcels/compilation/__init__.py
noemieplanat/Copy-parcels-master
21f053b81a9ccdaa5d8ee4f7efd6f01639b83bfc
[ "MIT" ]
94
2017-07-05T10:28:55.000Z
2022-03-23T19:46:23.000Z
from .codegenerator import * # noqa from .codecompiler import * # noqa
24.333333
36
0.726027
8
73
6.625
0.625
0.377358
0
0
0
0
0
0
0
0
0
0
0.191781
73
2
37
36.5
0.898305
0.123288
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
8f018c130e62a4cfb313d1e3169db60e67bb0598
36
py
Python
number.py
Jonting416/cs3240-labdemo
11e71e2d034fe9863ee950699ad6352ba276e966
[ "MIT" ]
null
null
null
number.py
Jonting416/cs3240-labdemo
11e71e2d034fe9863ee950699ad6352ba276e966
[ "MIT" ]
null
null
null
number.py
Jonting416/cs3240-labdemo
11e71e2d034fe9863ee950699ad6352ba276e966
[ "MIT" ]
null
null
null
def number(num): return num + 5
12
18
0.611111
6
36
3.666667
0.833333
0
0
0
0
0
0
0
0
0
0
0.038462
0.277778
36
2
19
18
0.807692
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
8f27f01e065f5ace76f6d3b5e5da76e906df0973
79
py
Python
Setup.py
FedDragon1/MCFS
8aa4144c206502c16278a4b5b6e825f8ddf5b1d1
[ "MIT" ]
1
2022-02-24T02:15:10.000Z
2022-02-24T02:15:10.000Z
Setup.py
FedDragon1/MCFS
8aa4144c206502c16278a4b5b6e825f8ddf5b1d1
[ "MIT" ]
null
null
null
Setup.py
FedDragon1/MCFS
8aa4144c206502c16278a4b5b6e825f8ddf5b1d1
[ "MIT" ]
null
null
null
from os import system system("pip install svg.path") system("pip install kivy")
26.333333
30
0.772152
13
79
4.692308
0.692308
0.295082
0.52459
0
0
0
0
0
0
0
0
0
0.113924
79
3
31
26.333333
0.871429
0
0
0
0
0
0.45
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
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
8f479a26ef9aae86d134953cac93046801d90e8c
122
py
Python
abc/124/a/answer.py
TakuyaNoguchi/atcoder
d079402e6fe9c9aaf3a6fc9272331ee71fc497da
[ "MIT" ]
null
null
null
abc/124/a/answer.py
TakuyaNoguchi/atcoder
d079402e6fe9c9aaf3a6fc9272331ee71fc497da
[ "MIT" ]
null
null
null
abc/124/a/answer.py
TakuyaNoguchi/atcoder
d079402e6fe9c9aaf3a6fc9272331ee71fc497da
[ "MIT" ]
null
null
null
A, B = map(int, input().split()) if A == B: print(A + B) elif A > B: print(A + A - 1) else: print(B + B - 1)
13.555556
32
0.45082
24
122
2.291667
0.458333
0.145455
0.254545
0.290909
0
0
0
0
0
0
0
0.02439
0.327869
122
8
33
15.25
0.646341
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
0
0.428571
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
0
0
0
1
0
6
8f5c30b28542e374fd1f9133a3becfa45fb3d4ce
1,481
py
Python
terrascript/vcd/r.py
vutsalsinghal/python-terrascript
3b9fb5ad77453d330fb0cd03524154a342c5d5dc
[ "BSD-2-Clause" ]
null
null
null
terrascript/vcd/r.py
vutsalsinghal/python-terrascript
3b9fb5ad77453d330fb0cd03524154a342c5d5dc
[ "BSD-2-Clause" ]
null
null
null
terrascript/vcd/r.py
vutsalsinghal/python-terrascript
3b9fb5ad77453d330fb0cd03524154a342c5d5dc
[ "BSD-2-Clause" ]
null
null
null
# terrascript/vcd/r.py import terrascript class vcd_network(terrascript.Resource): pass class vcd_network_routed(terrascript.Resource): pass class vcd_network_direct(terrascript.Resource): pass class vcd_network_isolated(terrascript.Resource): pass class vcd_vapp_network(terrascript.Resource): pass class vcd_vapp(terrascript.Resource): pass class vcd_firewall_rules(terrascript.Resource): pass class vcd_dnat(terrascript.Resource): pass class vcd_snat(terrascript.Resource): pass class vcd_edgegateway(terrascript.Resource): pass class vcd_edgegateway_vpn(terrascript.Resource): pass class vcd_vapp_vm(terrascript.Resource): pass class vcd_org(terrascript.Resource): pass class vcd_org_vdc(terrascript.Resource): pass class vcd_org_user(terrascript.Resource): pass class vcd_catalog(terrascript.Resource): pass class vcd_catalog_item(terrascript.Resource): pass class vcd_catalog_media(terrascript.Resource): pass class vcd_inserted_media(terrascript.Resource): pass class vcd_independent_disk(terrascript.Resource): pass class vcd_external_network(terrascript.Resource): pass class vcd_lb_service_monitor(terrascript.Resource): pass class vcd_lb_server_pool(terrascript.Resource): pass class vcd_lb_app_profile(terrascript.Resource): pass class vcd_lb_app_rule(terrascript.Resource): pass class vcd_lb_virtual_server(terrascript.Resource): pass
17.843373
51
0.781904
186
1,481
5.956989
0.209677
0.187726
0.539711
0.631769
0.818592
0.706679
0.064982
0
0
0
0
0
0.145172
1,481
82
52
18.060976
0.875197
0.013504
0
0.490566
0
0
0
0
0
0
0
0
0
1
0
true
0.490566
0.018868
0
0.509434
0
0
0
0
null
0
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
6
8f5e972efdad8c613c937586d6c013992ec4f437
139
py
Python
__init__.py
vitorpp0/unitsmod
82307ca1b5cabdc931ab37813784804ab0d567db
[ "MIT" ]
null
null
null
__init__.py
vitorpp0/unitsmod
82307ca1b5cabdc931ab37813784804ab0d567db
[ "MIT" ]
null
null
null
__init__.py
vitorpp0/unitsmod
82307ca1b5cabdc931ab37813784804ab0d567db
[ "MIT" ]
null
null
null
import unitsmod.convertDimension as convertDimension import unitsmod.database as database import unitsmod.dimensionClass as dimensionClass
34.75
52
0.892086
15
139
8.266667
0.4
0.33871
0
0
0
0
0
0
0
0
0
0
0.086331
139
3
53
46.333333
0.976378
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
8f7d7d3cc5a7331cfb2f611c52c455dae64c8702
144
py
Python
tests/fixtures/color.py
bcurnow/rfid-security-svc
d3806cb74d3d0cc2623ea425230dc8781ba4d8b4
[ "Apache-2.0" ]
null
null
null
tests/fixtures/color.py
bcurnow/rfid-security-svc
d3806cb74d3d0cc2623ea425230dc8781ba4d8b4
[ "Apache-2.0" ]
null
null
null
tests/fixtures/color.py
bcurnow/rfid-security-svc
d3806cb74d3d0cc2623ea425230dc8781ba4d8b4
[ "Apache-2.0" ]
null
null
null
import pytest from rfidsecuritysvc.model.color import Color @pytest.fixture(scope='session') def default_color(): return Color(0xABCDEF)
16
45
0.777778
18
144
6.166667
0.722222
0
0
0
0
0
0
0
0
0
0
0.007937
0.125
144
8
46
18
0.873016
0
0
0
0
0
0.048611
0
0
0
0.055556
0
0
1
0.2
true
0
0.4
0.2
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
0
1
1
1
0
0
6
56aee59ab2c2b4c41fa5c8444707e5bc9d8cfcf1
2,255
py
Python
pycmc/charts/applemusic.py
RomeoDespres/pycmc
7f9abb0e8c076f0cd85f78ce66d3da4a3f1b52ee
[ "MIT" ]
23
2020-05-19T13:19:19.000Z
2022-02-23T12:38:19.000Z
pycmc/charts/applemusic.py
RomeoDespres/pycmc
7f9abb0e8c076f0cd85f78ce66d3da4a3f1b52ee
[ "MIT" ]
9
2020-05-14T17:00:14.000Z
2021-02-08T05:55:41.000Z
pycmc/charts/applemusic.py
RomeoDespres/pycmc
7f9abb0e8c076f0cd85f78ce66d3da4a3f1b52ee
[ "MIT" ]
2
2020-12-03T16:33:33.000Z
2021-04-28T01:03:29.000Z
from .. import utilities APPLE_MUSIC_CHARTS_URL = f"/charts/applemusic" FRIDAY = 4 def tracks(date, country="US", genre="All Genres"): """ Query the charts/applemusic/tracks endpoint for the given date. https://api.chartmetric.com/api/charts/applemusic/tracks **Parameters** - `date`: string date in ISO format %Y-%m-%d - `country`: string country code, e.g. 'US' - `genre`: string genre (see CM docs) **Returns** list of dictionary of tracks on AppleMusic charts """ params = { "date": date, "country_code": country, "genre": genre, "type": "daily", "offset": 0, } urlhandle = f"{APPLE_MUSIC_CHARTS_URL}/tracks" data = utilities.RequestData(urlhandle, params) return utilities.RequestGet(data)["data"] def albums(date, country="US", genre="All Genres"): """ Query the charts/applemusic/albums endpoint for the given date. https://api.chartmetric.com/api/charts/applemusic/albums **Parameters** - `date`: string date in ISO format %Y-%m-%d - `country`: string country code, e.g. 'US' - `genre`: string genre (see CM docs) **Returns** A list of dictionary of albums on AppleMusic charts. """ urlhandle = f"{APPLE_MUSIC_CHARTS_URL}/albums" params = { "date": date, "country_code": country, "genre": genre, } data = utilities.RequestData(urlhandle, params) return utilities.RequestGet(data)["data"] def videos(date, country="US", genre="All Genres"): """ Query the charts/applemusic/videos endpoint for the given date. https://api.chartmetric.com/api/charts/applemusic/videos **Parameters** - `date`: string date in ISO format %Y-%m-%d - `country`: string country code, e.g. 'US' - `genre`: string genre (see CM docs) **Returns** A list of dictionary of videos on AppleMusic charts. """ urlhandle = f"{APPLE_MUSIC_CHARTS_URL}/videos" params = { "date": date, "country_code": country, "genre": genre, } data = utilities.RequestData(urlhandle, params) return utilities.RequestGet(data)["data"]
24.51087
67
0.607539
267
2,255
5.074906
0.224719
0.082657
0.047232
0.056089
0.847232
0.847232
0.82583
0.82583
0.794834
0.725461
0
0.001196
0.258537
2,255
91
68
24.78022
0.809211
0.474945
0
0.5625
0
0
0.224858
0.088235
0
0
0
0
0
1
0.09375
false
0
0.03125
0
0.21875
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
56d8a78508548ee10bba38fa26e090eb5949e13a
33
py
Python
module/functions/__init__.py
Nz-zero/Insira
562e0a1ccb38e99177f7f0861e5fded99bc1cfd0
[ "MIT" ]
null
null
null
module/functions/__init__.py
Nz-zero/Insira
562e0a1ccb38e99177f7f0861e5fded99bc1cfd0
[ "MIT" ]
null
null
null
module/functions/__init__.py
Nz-zero/Insira
562e0a1ccb38e99177f7f0861e5fded99bc1cfd0
[ "MIT" ]
null
null
null
from .dataprep import Data_prep
16.5
32
0.818182
5
33
5.2
1
0
0
0
0
0
0
0
0
0
0
0
0.151515
33
1
33
33
0.928571
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
a422e1dc8144852ba0697e35ee337c87c72a3854
36
py
Python
tests/test_fastfantasy.py
kevin-persaud-davis/fastfantasy
90a45e4a49baa2108b29989cc05c23ca4fa5314b
[ "MIT" ]
null
null
null
tests/test_fastfantasy.py
kevin-persaud-davis/fastfantasy
90a45e4a49baa2108b29989cc05c23ca4fa5314b
[ "MIT" ]
null
null
null
tests/test_fastfantasy.py
kevin-persaud-davis/fastfantasy
90a45e4a49baa2108b29989cc05c23ca4fa5314b
[ "MIT" ]
null
null
null
from fastfantasy import fastfantasy
18
35
0.888889
4
36
8
0.75
0
0
0
0
0
0
0
0
0
0
0
0.111111
36
1
36
36
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
a4385c51bc7ed4f28f97803ff0ef71379c984e35
152
py
Python
example/services/library.py
TheCaptainCat/flasque
d42deb57572084f513202a32c460186700ce8e0b
[ "MIT" ]
3
2019-10-25T12:21:28.000Z
2020-09-11T13:43:32.000Z
example/services/library.py
TheCaptainCat/bolinette
d42deb57572084f513202a32c460186700ce8e0b
[ "MIT" ]
null
null
null
example/services/library.py
TheCaptainCat/bolinette
d42deb57572084f513202a32c460186700ce8e0b
[ "MIT" ]
null
null
null
from bolinette.data import service, Service from example.entities import Library @service("library") class LibraryService(Service[Library]): ...
16.888889
43
0.763158
17
152
6.823529
0.588235
0.241379
0
0
0
0
0
0
0
0
0
0
0.131579
152
8
44
19
0.878788
0
0
0
0
0
0.046053
0
0
0
0
0
0
1
0
true
0
0.4
0
0.6
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
a43b1104130b003687e6f13000445f1003a036c9
57
py
Python
avalonbot/__init__.py
AvantiShri/avalon-bot
20916ce670084f27eeaed35a6e44507e9ecf229d
[ "MIT" ]
null
null
null
avalonbot/__init__.py
AvantiShri/avalon-bot
20916ce670084f27eeaed35a6e44507e9ecf229d
[ "MIT" ]
null
null
null
avalonbot/__init__.py
AvantiShri/avalon-bot
20916ce670084f27eeaed35a6e44507e9ecf229d
[ "MIT" ]
null
null
null
from . import cards from . import game from . import bot
14.25
19
0.736842
9
57
4.666667
0.555556
0.714286
0
0
0
0
0
0
0
0
0
0
0.210526
57
3
20
19
0.933333
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
a4415d7e6eb2a1d6fc57fc3bd0ed10f7f8c0927a
24
py
Python
elastico/__init__.py
klorenz/python-elastico
9a39e6cfe33d3081cc52424284c19e9698343006
[ "MIT" ]
null
null
null
elastico/__init__.py
klorenz/python-elastico
9a39e6cfe33d3081cc52424284c19e9698343006
[ "MIT" ]
null
null
null
elastico/__init__.py
klorenz/python-elastico
9a39e6cfe33d3081cc52424284c19e9698343006
[ "MIT" ]
null
null
null
from . import pyaml_ext
12
23
0.791667
4
24
4.5
1
0
0
0
0
0
0
0
0
0
0
0
0.166667
24
1
24
24
0.9
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
a4506b05ad0b6ebb26334d6a3a9b8a4cb578ada8
28
py
Python
eddl/backend/__init__.py
salvacarrion/pyeddl
56d1e4378844d12c064f168f4541900684079c4b
[ "MIT" ]
null
null
null
eddl/backend/__init__.py
salvacarrion/pyeddl
56d1e4378844d12c064f168f4541900684079c4b
[ "MIT" ]
null
null
null
eddl/backend/__init__.py
salvacarrion/pyeddl
56d1e4378844d12c064f168f4541900684079c4b
[ "MIT" ]
null
null
null
from .eddl_backend import *
14
27
0.785714
4
28
5.25
1
0
0
0
0
0
0
0
0
0
0
0
0.142857
28
1
28
28
0.875
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
f12775fd5a8342524d1cfb232339eac47b3b3c99
20,754
py
Python
tests/ut/python/parallel/test_stridedslice.py
httpsgithu/mindspore
c29d6bb764e233b427319cb89ba79e420f1e2c64
[ "Apache-2.0" ]
1
2022-02-23T09:13:43.000Z
2022-02-23T09:13:43.000Z
tests/ut/python/parallel/test_stridedslice.py
949144093/mindspore
c29d6bb764e233b427319cb89ba79e420f1e2c64
[ "Apache-2.0" ]
null
null
null
tests/ut/python/parallel/test_stridedslice.py
949144093/mindspore
c29d6bb764e233b427319cb89ba79e420f1e2c64
[ "Apache-2.0" ]
null
null
null
# Copyright 2020 Huawei Technologies Co., Ltd # # 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 numpy as np import pytest import mindspore as ms from mindspore import context, Tensor, Parameter from mindspore.common.api import _cell_graph_executor from mindspore.nn import Cell, TrainOneStepCell, Momentum from mindspore.ops import operations as P from parallel.utils.utils import ParallelValidator class Net(Cell): def __init__(self, weight, w2, begin, end, strides, strategy1=None, strategy2=None, is_parameter=True, begin_mask=0, end_mask=0, ellipsis_mask=0, new_axis_mask=0, shrink_axis_mask=0): super().__init__() self.mul = P.Mul().shard(strategy1) self.strided_slice = P.StridedSlice(begin_mask=begin_mask, end_mask=end_mask, ellipsis_mask=ellipsis_mask, new_axis_mask=new_axis_mask, shrink_axis_mask=shrink_axis_mask).shard(strategy2) if is_parameter: self.weight = Parameter(weight, "w1") else: self.weight = weight self.mul2 = P.Mul() self.weight2 = Parameter(w2, "w2") self.begin = begin self.end = end self.strides = strides def construct(self, x, b): out = self.strided_slice(self.weight, self.begin, self.end, self.strides) out = self.mul(x, out) out = self.mul2(out, self.weight2) return out class Net2(Cell): def __init__(self, weight2, begin, end, strides, strategy1=None, strategy2=None, begin_mask=0, end_mask=0, ellipsis_mask=0, new_axis_mask=0, shrink_axis_mask=0): super().__init__() self.mul = P.Mul().shard(strategy1) self.strided_slice = P.StridedSlice(begin_mask=begin_mask, end_mask=end_mask, ellipsis_mask=ellipsis_mask, new_axis_mask=new_axis_mask, shrink_axis_mask=shrink_axis_mask).shard(strategy2) self.weight2 = Parameter(weight2, "w2") self.begin = begin self.end = end self.strides = strides def construct(self, x, b): out = self.mul(x, self.weight2) out = self.strided_slice(out, self.begin, self.end, self.strides) return out _x1 = Tensor(np.ones([128, 64, 1]), dtype=ms.float32) _x2 = Tensor(np.ones([1, 64, 32, 32]), dtype=ms.float32) _x3 = Tensor(np.ones([64, 32]), dtype=ms.float32) _w1 = Tensor(np.ones([256, 64, 32]), dtype=ms.float32) _w2 = Tensor(np.ones([128, 64, 1]), dtype=ms.float32) _w3 = Tensor(np.ones([1, 64, 32, 32]), dtype=ms.float32) _b1 = Tensor(np.ones([128, 64, 32]), dtype=ms.float32) _b2 = Tensor(np.ones([1, 64, 32, 32]), dtype=ms.float32) def compile_net(net, _x1, _b1): optimizer = Momentum(net.trainable_params(), learning_rate=0.1, momentum=0.9) train_net = TrainOneStepCell(net, optimizer) train_net.set_auto_parallel() train_net.set_train() _cell_graph_executor.compile(train_net, _x1, _b1) context.reset_auto_parallel_context() def compile_net_utils(net: Cell, *inputs): net.set_auto_parallel() net.set_train() phase, _ = _cell_graph_executor.compile(net, *inputs, auto_parallel_mode=True) context.reset_auto_parallel_context() return phase def test_stridedslice_no_fully_fetch_split_error(): context.set_auto_parallel_context(parallel_mode="semi_auto_parallel", device_num=8, global_rank=0) strategy1 = ((2, 2, 2), (2, 2, 2)) strategy2 = ((2, 2, 2),) net = Net(_w1, _w2, (0, 0, 0), (128, 64, 32), (1, 1, 1), strategy1, strategy2, is_parameter=True) with pytest.raises(RuntimeError): compile_net(net, _x1, _b1) def test_stridedslice_strides_no_1_split_error(): """ Feature: distribute operator stridedslice in auto parallel mode. Description: test stridedslice with strides no 1 split in semi auto parallel. Expectation: compile error. """ context.set_auto_parallel_context(parallel_mode="semi_auto_parallel", device_num=8, global_rank=0) strategy1 = ((2, 2, 2), (2, 2, 2)) strategy2 = ((1, 2, 2),) net = Net(_w1, _w2, (0, 0, 0), (128, 64, 32), (1, 1, 2), strategy1, strategy2, is_parameter=True) with pytest.raises(RuntimeError): compile_net(net, _x1, _b1) def test_stridedslice_begin_size_smaller(): """ Feature: distribute operator stridedslice in auto parallel mode. Description: test stridedslice with begin size is smaller in semi auto parallel. Expectation: compile done without error. """ context.set_auto_parallel_context(parallel_mode="semi_auto_parallel", device_num=8, global_rank=0) strategy1 = ((1, 4, 1), (1, 4, 2)) strategy2 = ((1, 4, 2),) net = Net(_w1, _w2, (0, 0), (128, 64), (1, 1), strategy1, strategy2, is_parameter=True) compile_net(net, _x1, _b1) def test_stridedslice_parameter(): """ Feature: distribute operator stridedslice in auto parallel mode. Description: test stridedslice of parameter in semi auto parallel. Expectation: compile done without error. """ context.set_auto_parallel_context(parallel_mode="semi_auto_parallel", device_num=8, global_rank=0) strategy1 = ((1, 4, 1), (1, 4, 2)) strategy2 = ((1, 4, 2),) net = Net(_w1, _w2, (0, 0, 0), (128, 64, 32), (1, 1, 1), strategy1, strategy2, is_parameter=True) compile_net(net, _x1, _b1) def test_stridedslice_begin_mask_no_0_split_parameter(): """ Feature: distribute operator stridedslice in auto parallel mode. Description: test stridedslice with begin mask no 0 split in semi auto parallel. Expectation: compile done without error. """ context.set_auto_parallel_context(parallel_mode="semi_auto_parallel", device_num=8, global_rank=0) strategy1 = ((1, 4, 1), (1, 4, 2)) strategy2 = ((1, 4, 2),) net = Net(_w1, _w2, (0, 0, 0), (128, 64, 32), (1, 1, 1), strategy1, strategy2, is_parameter=True, begin_mask=1) compile_net(net, _x1, _b1) def test_stridedslice_end_mask_no_0_parameter(): """ Feature: distribute operator stridedslice in auto parallel mode. Description: test stridedslice with end mask no 0 in semi auto parallel. Expectation: compile done without error. """ context.set_auto_parallel_context(parallel_mode="semi_auto_parallel", device_num=8, global_rank=0) strategy1 = ((1, 4, 1), (1, 4, 2)) strategy2 = ((1, 4, 2),) net = Net(_w1, _w2, (127, 0, 0), (128, 63, 32), (1, 1, 1), strategy1, strategy2, is_parameter=True, begin_mask=1, end_mask=2) compile_net(net, _x1, _b1) def test_stridedslice_ellipsis_mask_no_0_parameter(): """ Feature: distribute operator stridedslice in auto parallel mode. Description: test stridedslice with ellipsis mask no 0 in semi auto parallel. Expectation: compile done without error. """ context.set_auto_parallel_context(parallel_mode="semi_auto_parallel", device_num=8, global_rank=0) strategy1 = ((1, 4, 1), (1, 4, 2)) strategy2 = ((1, 4, 2),) net = Net(_w1, _w2, (127, 0, 0), (128, 64, 32), (1, 1, 1), strategy1, strategy2, is_parameter=True, begin_mask=1, end_mask=2, ellipsis_mask=4) compile_net(net, _x1, _b1) def test_stridedslice_new_axis_mask_no_0_parameter(): """ Feature: distribute operator stridedslice in auto parallel mode. Description: test stridedslice with new axis mask no 0 in semi auto parallel. Expectation: compile done without error. """ context.set_auto_parallel_context(parallel_mode="semi_auto_parallel", device_num=8, global_rank=0) strategy1 = ((1, 4, 2, 1), (1, 4, 2, 1)) strategy2 = ((1, 1, 4),) net = Net(_w1, _w3, (0, 0, 0), (128, 64, 32), (1, 1, 1), strategy1, strategy2, is_parameter=True, new_axis_mask=1) compile_net(net, _x2, _b2) def test_stridedslice_shrink_axis_mask_no_0_parameter(): """ Feature: distribute operator stridedslice in auto parallel mode. Description: test stridedslice with shrink axis mask no 0 in semi auto parallel. Expectation: compile done without error. """ context.set_auto_parallel_context(parallel_mode="semi_auto_parallel", device_num=8, global_rank=0) strategy1 = ((1, 2), (1, 2)) strategy2 = ((1, 4, 1),) net = Net(_w1, _w2, (0, 0, 0), (128, 64, 32), (1, 1, 1), strategy1, strategy2, is_parameter=True, shrink_axis_mask=1) compile_net(net, _x3, _b1) def test_stridedslice_tensor(): """ Feature: distribute operator stridedslice in auto parallel mode. Description: test stridedslice of tensor in semi auto parallel. Expectation: compile done without error. """ context.set_auto_parallel_context(parallel_mode="semi_auto_parallel", device_num=8, global_rank=0) strategy1 = ((1, 4, 1), (1, 4, 2)) strategy2 = ((1, 4, 2),) net = Net(_w1, _w2, (0, 0, 0), (128, 64, 32), (1, 1, 1), strategy1, strategy2, is_parameter=False) compile_net(net, _x1, _b1) def test_stridedslice_begin_mask_no_0_tensor(): """ Feature: distribute operator stridedslice in auto parallel mode. Description: test stridedslice with begin mask no 0 in semi auto parallel. Expectation: compile done without error. """ context.set_auto_parallel_context(parallel_mode="semi_auto_parallel", device_num=8, global_rank=0) strategy1 = ((1, 4, 1), (1, 4, 2)) strategy2 = ((1, 4, 2),) net = Net(_w1, _w2, (127, 0, 0), (128, 64, 32), (1, 1, 1), strategy1, strategy2, is_parameter=False, begin_mask=1) compile_net(net, _x1, _b1) def test_stridedslice_end_mask_no_0_tensor(): """ Feature: distribute operator stridedslice in auto parallel mode. Description: test stridedslice with end mask no 0 in semi auto parallel. Expectation: compile done without error. """ context.set_auto_parallel_context(parallel_mode="semi_auto_parallel", device_num=8, global_rank=0) strategy1 = ((1, 4, 1), (1, 4, 2)) strategy2 = ((1, 4, 2),) net = Net(_w1, _w2, (0, 0, 0), (128, 63, 32), (1, 1, 1), strategy1, strategy2, is_parameter=False, end_mask=2) compile_net(net, _x1, _b1) def test_stridedslice_ellipsis_mask_no_0_tensor(): """ Feature: distribute operator stridedslice in auto parallel mode. Description: test stridedslice with ellipsis mask no 0 in semi auto parallel. Expectation: compile done without error. """ context.set_auto_parallel_context(parallel_mode="semi_auto_parallel", device_num=8, global_rank=0) strategy1 = ((1, 4, 1), (1, 4, 2)) strategy2 = ((1, 4, 2),) net = Net(_w1, _w2, (127, 0, 0), (128, 64, 32), (1, 1, 1), strategy1, strategy2, is_parameter=False, begin_mask=1, end_mask=2, ellipsis_mask=4) compile_net(net, _x1, _b1) def test_stridedslice_new_axis_mask_no_0_tensor(): """ Feature: distribute operator stridedslice in auto parallel mode. Description: test stridedslice with new axis mask no 0 in semi auto parallel. Expectation: compile done without error. """ context.set_auto_parallel_context(parallel_mode="semi_auto_parallel", device_num=8, global_rank=0) strategy1 = ((1, 4, 2, 1), (1, 4, 2, 1)) strategy2 = ((1, 1, 4),) net = Net(_w1, _w3, (0, 0, 0), (128, 64, 32), (1, 1, 1), strategy1, strategy2, is_parameter=False, new_axis_mask=1) compile_net(net, _x2, _b2) def test_stridedslice_shrink_axis_mask_no_0_tensor(): """ Feature: distribute operator stridedslice in auto parallel mode. Description: test stridedslice with shrink axis mask no 0 in semi auto parallel. Expectation: compile done without error. """ context.set_auto_parallel_context(parallel_mode="semi_auto_parallel", device_num=8, global_rank=0) strategy1 = ((1, 2), (1, 2)) strategy2 = ((1, 4, 1),) net = Net(_w1, _w2, (0, 0, 0), (128, 64, 32), (1, 1, 1), strategy1, strategy2, is_parameter=False, shrink_axis_mask=1) compile_net(net, _x3, _b1) def test_stridedslice_parameter_no_full_split(): """ Feature: distribute operator stridedslice in auto parallel mode. Description: test stridedslice with no full split in semi auto parallel. Expectation: compile done without error. """ context.set_auto_parallel_context(parallel_mode="semi_auto_parallel", device_num=8, global_rank=0) strategy1 = ((1, 4, 1), (1, 4, 2)) strategy2 = ((1, 2, 2),) net = Net(_w1, _w2, (0, 0, 0), (128, 64, 32), (1, 1, 1), strategy1, strategy2, is_parameter=True) compile_net(net, _x1, _b1) def test_stridedslice_output(): """ Feature: distribute operator stridedslice in auto parallel mode. Description: test stridedslice of output in semi auto parallel. Expectation: compile done without error. """ context.set_auto_parallel_context(parallel_mode="semi_auto_parallel", device_num=8, global_rank=0) strategy1 = ((1, 8, 1), (1, 8, 1)) strategy2 = ((1, 8, 1),) net = Net2(_w2, (0, 0, 0), (64, 64, 1), (1, 1, 1), strategy1, strategy2) compile_net(net, _x1, _b1) def test_stridedslice_begin_mask_no_0_output(): """ Feature: distribute operator stridedslice in auto parallel mode. Description: test stridedslice with begin mask no 0 in semi auto parallel. Expectation: compile done without error. """ context.set_auto_parallel_context(parallel_mode="semi_auto_parallel", device_num=8, global_rank=0) strategy1 = ((1, 8, 1), (1, 8, 1)) strategy2 = ((1, 8, 1),) net = Net2(_w2, (61, 0, 0), (64, 64, 1), (1, 1, 1), strategy1, strategy2, begin_mask=1) compile_net(net, _x1, _b1) def test_stridedslice_end_mask_no_0_output(): """ Feature: distribute operator stridedslice in auto parallel mode. Description: test stridedslice with end mask no 0 in semi auto parallel. Expectation: compile done without error. """ context.set_auto_parallel_context(parallel_mode="semi_auto_parallel", device_num=8, global_rank=0) strategy1 = ((1, 8, 1), (1, 8, 1)) strategy2 = ((1, 8, 1),) net = Net2(_w2, (0, 0, 0), (64, 63, 1), (1, 1, 1), strategy1, strategy2, end_mask=2) compile_net(net, _x1, _b1) def test_stridedslice_ellipsis_mask_no_0_output(): """ Feature: distribute operator stridedslice in auto parallel mode. Description: test stridedslice with ellipsis mask no 0 in semi auto parallel. Expectation: compile done without error. """ context.set_auto_parallel_context(parallel_mode="semi_auto_parallel", device_num=8, global_rank=0) strategy1 = ((1, 8, 1), (1, 8, 1)) strategy2 = ((1, 8, 1),) net = Net2(_w2, (63, 0, 0), (64, 63, 1), (1, 1, 1), strategy1, strategy2, begin_mask=1, end_mask=2, ellipsis_mask=4) compile_net(net, _x1, _b1) def test_stridedslice_new_axis_mask_no_0_output(): """ Feature: distribute operator stridedslice in auto parallel mode. Description: test stridedslice with new axis mask no 0 in semi auto parallel. Expectation: compile done without error. """ context.set_auto_parallel_context(parallel_mode="semi_auto_parallel", device_num=8, global_rank=0) strategy1 = ((1, 8, 1), (1, 8, 1)) strategy2 = ((8, 1, 1),) net = Net2(_w2, (0, 0, 0), (64, 64, 1), (1, 1, 1), strategy1, strategy2, new_axis_mask=1) compile_net(net, _x1, _b1) def test_stridedslice_shrink_axis_mask_no_0_output(): """ Feature: distribute operator stridedslice in auto parallel mode. Description: test stridedslice with shrink axis mask no 0 in semi auto parallel. Expectation: compile done without error. """ context.set_auto_parallel_context(parallel_mode="semi_auto_parallel", device_num=8, global_rank=0) strategy1 = ((1, 8, 1), (1, 8, 1)) strategy2 = ((1, 8, 1),) net = Net2(_w2, (0, 0, 0), (64, 64, 1), (1, 1, 1), strategy1, strategy2, shrink_axis_mask=1) compile_net(net, _x1, _b1) def test_stridedslice_output_no_full_split(): """ Feature: distribute operator stridedslice in auto parallel mode. Description: test stridedslice with no full split in semi auto parallel. Expectation: compile done without error. """ context.set_auto_parallel_context(parallel_mode="semi_auto_parallel", device_num=8, global_rank=0) strategy1 = ((1, 8, 1), (1, 8, 1)) strategy2 = ((1, 4, 1),) net = Net2(_w2, (0, 0, 0), (64, 64, 1), (1, 1, 1), strategy1, strategy2) compile_net(net, _x1, _b1) def test_stridedslice_no_strategy(): """ Feature: distribute operator stridedslice in auto parallel mode. Description: test stridedslice with no strategy in semi auto parallel. Expectation: compile done without error. """ context.set_auto_parallel_context(parallel_mode="semi_auto_parallel", device_num=8, global_rank=0) strategy1 = ((1, 8, 1), (1, 8, 1)) strategy2 = None net = Net2(_w2, (0, 0, 0), (128, 64, 1), (1, 1, 1), strategy1, strategy2) compile_net(net, _x1, _b1) def test_stridedslice_begin_mask_no_0_no_strategy(): """ Feature: distribute operator stridedslice in auto parallel mode. Description: test stridedslice with begin mask no 0 in auto parallel. Expectation: compile done without error. """ context.set_auto_parallel_context(parallel_mode="semi_auto_parallel", device_num=8, global_rank=0) strategy1 = ((1, 8, 1), (1, 8, 1)) strategy2 = None net = Net2(_w2, (127, 0, 0), (128, 64, 1), (1, 1, 1), strategy1, strategy2, begin_mask=1) compile_net(net, _x1, _b1) def test_stridedslice_auto_parallel(): """ Feature: distribute operator stridedslice in auto parallel mode. Description: test stridedslice in auto parallel. Expectation: compile done without error. """ context.set_auto_parallel_context(parallel_mode="auto_parallel", device_num=8, global_rank=0) net = Net2(_w2, (0, 0, 0), (32, 64, 1), (1, 1, 1)) compile_net(net, _x1, _b1) def test_stridedslice_begin_mask_no_0_auto_parallel(): """ Feature: distribute operator stridedslice in auto parallel mode. Description: test stridedslice with begin mask no 0 in auto parallel. Expectation: compile done without error. """ context.set_auto_parallel_context(parallel_mode="auto_parallel", device_num=8, global_rank=0) net = Net2(_w2, (29, 0, 0), (32, 64, 1), (1, 1, 1), begin_mask=1) compile_net(net, _x1, _b1) def test_stridedslice_layout(): """ Features: StridedSlice Description: validate layout and structure Expectation: No raise RuntimeError """ context.set_auto_parallel_context(parallel_mode="semi_auto_parallel", device_num=8, global_rank=0) strategy1 = ((1, 4, 1), (1, 4, 2)) strategy2 = ((1, 4, 2),) net = Net(_w1, _w2, (127, 0, 0), (128, 64, 32), (1, 1, 1), strategy1, strategy2, is_parameter=True, begin_mask=1, end_mask=2, ellipsis_mask=4) phase = compile_net_utils(net, _x1, _b1) validator = ParallelValidator(net, phase) # check layout features_expect_layout = ([4, 2], [-1, 1, 0], [256, 16, 16], 0, True, '') assert validator.check_parameter_layout('w1', features_expect_layout) # check attrs roi_expect_attrs = {'begin_mask': 1, 'end_mask': 2, 'ellipsis_mask': 4} assert validator.check_node_attrs('StridedSlice-1', roi_expect_attrs) # check inputs roi_expect_inputs = ['Load-0', 'out((127, 0, 0))', 'out((128, 64, 32))', 'out((1, 1, 1))'] assert validator.check_node_inputs('StridedSlice-1', roi_expect_inputs) # check sub_graph sub_graph = { 'StridedSlice-1': ['Load-0', 'out((127, 0, 0))', 'out((128, 64, 32))', 'out((1, 1, 1))'], 'Mul-0': ['Reshape-1', 'StridedSlice-1'], 'AllGather-2': ['Reshape-2'], 'Split-1': ['AllGather-2'], 'TupleGetItem-3': ['Split-1', 0], 'TupleGetItem-4': ['Split-1', 1], 'TupleGetItem-5': ['Split-1', 2], 'TupleGetItem-6': ['Split-1', 3], 'MakeTuple-2': ['TupleGetItem-3', 'TupleGetItem-4', 'TupleGetItem-5', 'TupleGetItem-6'], 'Concat-1': ['MakeTuple-2'] } assert validator.check_graph_structure(sub_graph)
42.182927
118
0.668498
2,964
20,754
4.448718
0.069838
0.104656
0.059457
0.046716
0.832929
0.81943
0.814576
0.804565
0.80267
0.794176
0
0.067471
0.200877
20,754
491
119
42.268839
0.727585
0.262985
0
0.560606
0
0
0.0627
0
0
0
0
0
0.015152
1
0.128788
false
0
0.030303
0
0.17803
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
f18833ab2e03af35fc67a4690feb71c126f206a0
11,971
py
Python
src/jengaapi/send_money_services.py
MainaKamau92/JengaAPIPythonWrapper
b48682fc045e74c19d674ea83f905f7c5d55230b
[ "BSD-2-Clause" ]
null
null
null
src/jengaapi/send_money_services.py
MainaKamau92/JengaAPIPythonWrapper
b48682fc045e74c19d674ea83f905f7c5d55230b
[ "BSD-2-Clause" ]
null
null
null
src/jengaapi/send_money_services.py
MainaKamau92/JengaAPIPythonWrapper
b48682fc045e74c19d674ea83f905f7c5d55230b
[ "BSD-2-Clause" ]
null
null
null
import json import requests from . import BASE_URL from .exceptions import handle_response, generate_reference class SendMoneyService: def __init__(self, token): self.token = token self.headers = { 'Content-Type': 'application/json', 'Authorization': self.token } self.reference_no = generate_reference() @staticmethod def _generate_payload_source(country_code, source_name, source_account_number): return dict( countryCode=country_code, name=source_name, accountNumber=source_account_number ) @staticmethod def _generate_payload_destination(country_code, destination_name): return dict( type=None, countryCode=country_code, name=destination_name, ) @staticmethod def _generate_payload_transfer(transfer_amount, currency_code, reference_no, transfer_date, description): return dict( type=None, amount=str(transfer_amount), currencyCode=currency_code, reference=reference_no, date=transfer_date.strftime("%Y-%m-%d"), description=description ) @staticmethod def _send_request(headers, payload): url = BASE_URL + f'transaction/v2/remittance' response = requests.post(url, headers=headers, data=json.dumps(payload)) formatted_response = handle_response(response) return formatted_response @staticmethod def _redundant_params(kwargs): country_code = kwargs.get("country_code") source_name = kwargs.get("source_name") source_account_number = kwargs.get("source_account_number") destination_name = kwargs.get("destination_name") transfer_amount = kwargs.get("transfer_amount") currency_code = kwargs.get("currency_code") reference_no = kwargs.get("reference_no") transfer_date = kwargs.get("transfer_date") description = kwargs.get("description") return (country_code, source_name, source_account_number, destination_name, transfer_amount, currency_code, reference_no, transfer_date, description) def send_within_equity(self, signature, **kwargs): destination_account_number = kwargs.get("destination_account_number") (country_code, source_name, source_account_number, destination_name, transfer_amount, currency_code, reference_no, transfer_date, description) = self._redundant_params(kwargs) payload_destination = self._generate_payload_destination(country_code, destination_name) payload_source = self._generate_payload_source(country_code, source_name, source_account_number) payload_transfer = self._generate_payload_transfer(transfer_amount, currency_code, reference_no, transfer_date, description) self.headers["signature"] = signature payload_destination["type"] = "bank" payload_destination["accountNumber"] = destination_account_number payload_transfer["type"] = "InternalFundsTransfer" payload = dict(source=payload_source, destination=payload_destination, transfer=payload_transfer) return self._send_request(headers=self.headers, payload=payload) def send_to_mobile_wallets(self, signature, **kwargs): wallet_name = kwargs.get("wallet_name") destination_mobile_number = kwargs.get("destination_mobile_number") (country_code, source_name, source_account_number, destination_name, transfer_amount, currency_code, reference_no, transfer_date, description) = self._redundant_params(kwargs) payload_destination = self._generate_payload_destination(country_code, destination_name) payload_source = self._generate_payload_source(country_code, source_name, source_account_number) payload_transfer = self._generate_payload_transfer(transfer_amount, currency_code, reference_no, transfer_date, description) self.headers["signature"] = signature payload_destination["type"] = "mobile" payload_destination["mobileNumber"] = destination_mobile_number payload_destination["walletName"] = wallet_name payload_transfer["type"] = "MobileWallet" payload = dict(source=payload_source, destination=payload_destination, transfer=payload_transfer) return self._send_request(headers=self.headers, payload=payload) def send_rtgs(self, signature, **kwargs): destination_account_number = kwargs.get("destination_account_number") bank_code = kwargs.get("bank_code") (country_code, source_name, source_account_number, destination_name, transfer_amount, currency_code, reference_no, transfer_date, description) = self._redundant_params(kwargs) payload_destination = self._generate_payload_destination(country_code, destination_name) payload_source = self._generate_payload_source(country_code, source_name, source_account_number) payload_transfer = self._generate_payload_transfer(transfer_amount, currency_code, reference_no, transfer_date, description) self.headers["signature"] = signature payload_destination["type"] = "bank" payload_destination["bankCode"] = bank_code payload_destination["accountNumber"] = destination_account_number payload_transfer["type"] = "RTGS" payload = dict(source=payload_source, destination=payload_destination, transfer=payload_transfer) return self._send_request(headers=self.headers, payload=payload) def send_swift(self, signature, **kwargs): bank_bic = kwargs.get('bank_bic') address_line = kwargs.get('address_line') charge_option = kwargs.get('charge_option') destination_account_number = kwargs.get('destination_account_number') (country_code, source_name, source_account_number, destination_name, transfer_amount, currency_code, reference_no, transfer_date, description) = self._redundant_params(kwargs) payload_destination = self._generate_payload_destination(country_code, destination_name) payload_source = self._generate_payload_source(country_code, source_name, source_account_number) payload_transfer = self._generate_payload_transfer(transfer_amount, currency_code, reference_no, transfer_date, description) self.headers["signature"] = signature payload_destination["type"] = "bank" payload_destination["bankBic"] = bank_bic payload_destination["accountNumber"] = destination_account_number payload_destination["addressline1"] = address_line payload_transfer["type"] = "SWIFT" payload_transfer["chargeOption"] = charge_option payload = dict(source=payload_source, destination=payload_destination, transfer=payload_transfer) return self._send_request(headers=self.headers, payload=payload) def send_eft(self, signature, **kwargs): bank_code = kwargs.get('bank_code') branch_code = kwargs.get('branch_code') destination_account_number = kwargs.get('destination_account_number') # signature = API.signature((self.reference_no, self.source_account_number, # destination_account_number, self.transfer_amount, # bank_code)) (country_code, source_name, source_account_number, destination_name, transfer_amount, currency_code, reference_no, transfer_date, description) = self._redundant_params(kwargs) payload_destination = self._generate_payload_destination(country_code, destination_name) payload_source = self._generate_payload_source(country_code, source_name, source_account_number) payload_transfer = self._generate_payload_transfer(transfer_amount, currency_code, reference_no, transfer_date, description) self.headers["signature"] = signature payload_destination["type"] = "bank" payload_destination["bankCode"] = bank_code payload_destination["branchCode"] = branch_code payload_destination["accountNumber"] = destination_account_number payload_transfer["type"] = "EFT" payload = dict(source=payload_source, destination=payload_destination, transfer=payload_transfer) return self._send_request(headers=self.headers, payload=payload) def send_pesalink_to_bank_account(self, signature, **kwargs): bank_code = kwargs.get('bank_code') mobile_number = kwargs.get('mobile_number') destination_account_number = kwargs.get('destination_account_number') # signature = API.signature((self.transfer_amount, self.currency_code, self.reference_no, # self.destination_name, self.source_account_number)) (country_code, source_name, source_account_number, destination_name, transfer_amount, currency_code, reference_no, transfer_date, description) = self._redundant_params(kwargs) payload_destination = self._generate_payload_destination(country_code, destination_name) payload_source = self._generate_payload_source(country_code, source_name, source_account_number) payload_transfer = self._generate_payload_transfer(transfer_amount, currency_code, reference_no, transfer_date, description) self.headers["signature"] = signature payload_destination["type"] = "bank" payload_destination["bankCode"] = bank_code payload_destination["mobileNumber"] = mobile_number payload_destination["accountNumber"] = destination_account_number payload_transfer["type"] = "PesaLink" payload = dict(source=payload_source, destination=payload_destination, transfer=payload_transfer) return self._send_request(headers=self.headers, payload=payload) def send_pesalink_to_mobile_number(self, signature, **kwargs): destination_mobile_number = kwargs.get("destination_mobile_number") bank_code = kwargs.get("bank_code") # signature = API.signature((self.transfer_amount, self.currency_code, # self.reference_no, self.destination_name, # self.source_account_number)) (country_code, source_name, source_account_number, destination_name, transfer_amount, currency_code, reference_no, transfer_date, description) = self._redundant_params(kwargs) payload_destination = self._generate_payload_destination(country_code, destination_name) payload_source = self._generate_payload_source(country_code, source_name, source_account_number) payload_transfer = self._generate_payload_transfer(transfer_amount, currency_code, reference_no, transfer_date, description) self.headers["signature"] = signature payload_destination["type"] = "mobile" payload_destination["bankCode"] = bank_code payload_destination["mobileNumber"] = destination_mobile_number payload = dict(source=payload_source, destination=payload_destination, transfer=payload_transfer) return self._send_request(headers=self.headers, payload=payload)
52.047826
115
0.681564
1,182
11,971
6.5
0.076142
0.105428
0.054406
0.046466
0.78524
0.77704
0.77704
0.748275
0.72719
0.698816
0
0.00022
0.24008
11,971
229
116
52.275109
0.844344
0.045944
0
0.631016
1
0
0.075885
0.021644
0
0
0
0
0
1
0.069519
false
0
0.02139
0.016043
0.160428
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
2d01d24333ce1d97700190a60ce6a9d6089a21f9
2,356
py
Python
tests/test_watcher.py
FXTD-ODYSSEY/pyuiw
9613d0ff3cc1187a0aa854ce17fd14245751d969
[ "MIT" ]
null
null
null
tests/test_watcher.py
FXTD-ODYSSEY/pyuiw
9613d0ff3cc1187a0aa854ce17fd14245751d969
[ "MIT" ]
null
null
null
tests/test_watcher.py
FXTD-ODYSSEY/pyuiw
9613d0ff3cc1187a0aa854ce17fd14245751d969
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ """ # Import future modules from __future__ import absolute_import from __future__ import division from __future__ import print_function # Import built-in modules from pathlib import Path import subprocess from textwrap import dedent import time # Import third-party modules import pytest __author__ = "timmyliang" __email__ = "820472580@qq.com" __date__ = "2021-11-28 20:13:19" def test_watch_files(runner, get_ui): custom, custom_py = get_ui("custom") blank, blank_py = get_ui("blank") basic, basic_py = get_ui("basic") blank_button, blank_button_py = get_ui("blank_button") args = ["-w", custom, blank, basic] process = runner(args, subprocess.Popen) time.sleep(3) assert custom_py.is_file() assert blank_py.is_file() assert basic_py.is_file() with open(blank_py, encoding="utf8") as f: before_py = f.read() with open(blank_button, encoding="utf8") as f: button_content = f.read() with open(blank, encoding="utf8") as f: content = f.read() with open(blank, "w", encoding="utf8") as f: f.write(button_content) time.sleep(2) with open(blank_py, encoding="utf8") as f: after_py = f.read() assert before_py != after_py process.terminate() with open(blank, "w", encoding="utf8") as f: f.write(content) def test_watch_dir_and_exclude(runner, get_ui, UI_DIR): custom, custom_py = get_ui("custom") blank, blank_py = get_ui("blank") basic, basic_py = get_ui("basic") blank_button, blank_button_py = get_ui("blank_button") args = ["-w", str(UI_DIR), "-e", "*custom*"] process = runner(args, subprocess.Popen) time.sleep(3) assert not custom_py.is_file() assert blank_py.is_file() assert basic_py.is_file() with open(blank_py, encoding="utf8") as f: before_py = f.read() with open(blank_button, encoding="utf8") as f: button_content = f.read() with open(blank, encoding="utf8") as f: content = f.read() with open(blank, "w", encoding="utf8") as f: f.write(button_content) time.sleep(2) with open(blank_py, encoding="utf8") as f: after_py = f.read() assert before_py != after_py process.terminate() with open(blank, "w", encoding="utf8") as f: f.write(content)
24.040816
58
0.652801
344
2,356
4.215116
0.218023
0.066207
0.107586
0.124138
0.728276
0.728276
0.728276
0.728276
0.728276
0.662069
0
0.021657
0.216044
2,356
97
59
24.28866
0.7634
0.039898
0
0.730159
0
0
0.074255
0
0
0
0
0
0.126984
1
0.031746
false
0
0.126984
0
0.15873
0.015873
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
2d0a1a263077e01c5cffaa0a1b194e86edf80b30
35
py
Python
branch_test1_1.py
11pikachu/starter-workflows
c007143a1d9853f2a8b98bff385fd8dcb6f3af6e
[ "MIT" ]
null
null
null
branch_test1_1.py
11pikachu/starter-workflows
c007143a1d9853f2a8b98bff385fd8dcb6f3af6e
[ "MIT" ]
null
null
null
branch_test1_1.py
11pikachu/starter-workflows
c007143a1d9853f2a8b98bff385fd8dcb6f3af6e
[ "MIT" ]
1
2020-05-20T05:58:03.000Z
2020-05-20T05:58:03.000Z
print('branch test1 first commit')
17.5
34
0.771429
5
35
5.4
1
0
0
0
0
0
0
0
0
0
0
0.032258
0.114286
35
1
35
35
0.83871
0
0
0
0
0
0.714286
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